summaryrefslogtreecommitdiffstats
path: root/arm-wt-22k
diff options
context:
space:
mode:
authorDave Sparks <davidsparks@android.com>2009-08-24 17:35:45 -0700
committerDave Sparks <davidsparks@android.com>2009-08-24 17:35:45 -0700
commit56c99cd2c2c1e6ab038dac5fced5b92ccf11ff6c (patch)
tree42d3ac8ff2731bda88f4e060f40400de456542c6 /arm-wt-22k
parent618669a0423554a0af43cd0aa42101fc80b7d948 (diff)
downloadandroid_external_sonivox-56c99cd2c2c1e6ab038dac5fced5b92ccf11ff6c.zip
android_external_sonivox-56c99cd2c2c1e6ab038dac5fced5b92ccf11ff6c.tar.gz
android_external_sonivox-56c99cd2c2c1e6ab038dac5fced5b92ccf11ff6c.tar.bz2
Sonivox whitespace cleanup
Diffstat (limited to 'arm-wt-22k')
-rw-r--r--arm-wt-22k/host_src/eas.h570
-rw-r--r--arm-wt-22k/host_src/eas_build.h48
-rw-r--r--arm-wt-22k/host_src/eas_chorus.h80
-rw-r--r--arm-wt-22k/host_src/eas_config.c1214
-rw-r--r--arm-wt-22k/host_src/eas_config.h358
-rw-r--r--arm-wt-22k/host_src/eas_host.h150
-rw-r--r--arm-wt-22k/host_src/eas_hostmm.c24
-rw-r--r--arm-wt-22k/host_src/eas_main.c674
-rw-r--r--arm-wt-22k/host_src/eas_report.c504
-rw-r--r--arm-wt-22k/host_src/eas_report.h130
-rw-r--r--arm-wt-22k/host_src/eas_reverb.h84
-rw-r--r--arm-wt-22k/host_src/eas_types.h522
-rw-r--r--arm-wt-22k/host_src/eas_wave.c822
-rw-r--r--arm-wt-22k/host_src/eas_wave.h124
-rw-r--r--arm-wt-22k/host_src/jet.h398
-rw-r--r--[-rwxr-xr-x]arm-wt-22k/jetcreator_lib_src/darwin-x86/EASLib.c3618
-rw-r--r--[-rwxr-xr-x]arm-wt-22k/jetcreator_lib_src/darwin-x86/EASLib.h62
-rw-r--r--[-rwxr-xr-x]arm-wt-22k/jetcreator_lib_src/darwin-x86/EASLibVst.c3008
-rw-r--r--[-rwxr-xr-x]arm-wt-22k/jetcreator_lib_src/darwin-x86/eas_host_debug.h94
-rw-r--r--[-rwxr-xr-x]arm-wt-22k/jetcreator_lib_src/darwin-x86/eastestv37.c1998
-rw-r--r--arm-wt-22k/jetcreator_lib_src/darwin-x86/wt_44khz.c29446
-rw-r--r--arm-wt-22k/lib_src/ARM_synth_constants_gnu.inc306
-rw-r--r--arm-wt-22k/lib_src/dls.h536
-rw-r--r--arm-wt-22k/lib_src/dls2.h244
-rw-r--r--arm-wt-22k/lib_src/eas_audioconst.h170
-rw-r--r--arm-wt-22k/lib_src/eas_chorus.c1184
-rw-r--r--arm-wt-22k/lib_src/eas_chorusdata.c44
-rw-r--r--arm-wt-22k/lib_src/eas_chorusdata.h296
-rw-r--r--arm-wt-22k/lib_src/eas_ctype.h58
-rw-r--r--arm-wt-22k/lib_src/eas_data.c50
-rw-r--r--arm-wt-22k/lib_src/eas_data.h242
-rw-r--r--arm-wt-22k/lib_src/eas_dlssynth.c754
-rw-r--r--arm-wt-22k/lib_src/eas_dlssynth.h58
-rw-r--r--arm-wt-22k/lib_src/eas_effects.h98
-rw-r--r--arm-wt-22k/lib_src/eas_flog.c168
-rw-r--r--arm-wt-22k/lib_src/eas_ima_tables.c84
-rw-r--r--arm-wt-22k/lib_src/eas_imaadpcm.c712
-rw-r--r--arm-wt-22k/lib_src/eas_imelody.c3460
-rw-r--r--arm-wt-22k/lib_src/eas_imelodydata.c62
-rw-r--r--arm-wt-22k/lib_src/eas_imelodydata.h122
-rw-r--r--arm-wt-22k/lib_src/eas_math.c312
-rw-r--r--arm-wt-22k/lib_src/eas_math.h800
-rw-r--r--arm-wt-22k/lib_src/eas_mdls.c3928
-rw-r--r--arm-wt-22k/lib_src/eas_mdls.h566
-rw-r--r--arm-wt-22k/lib_src/eas_midi.c1114
-rw-r--r--arm-wt-22k/lib_src/eas_midi.h118
-rw-r--r--arm-wt-22k/lib_src/eas_midictrl.h104
-rw-r--r--arm-wt-22k/lib_src/eas_mididata.c44
-rw-r--r--arm-wt-22k/lib_src/eas_miditypes.h252
-rw-r--r--arm-wt-22k/lib_src/eas_mixbuf.c48
-rw-r--r--arm-wt-22k/lib_src/eas_mixer.c904
-rw-r--r--arm-wt-22k/lib_src/eas_mixer.h250
-rw-r--r--arm-wt-22k/lib_src/eas_ota.c2130
-rw-r--r--arm-wt-22k/lib_src/eas_otadata.c58
-rw-r--r--arm-wt-22k/lib_src/eas_otadata.h138
-rw-r--r--arm-wt-22k/lib_src/eas_pan.c172
-rw-r--r--arm-wt-22k/lib_src/eas_pan.h108
-rw-r--r--arm-wt-22k/lib_src/eas_parser.h172
-rw-r--r--arm-wt-22k/lib_src/eas_pcm.c2940
-rw-r--r--arm-wt-22k/lib_src/eas_pcm.h694
-rw-r--r--arm-wt-22k/lib_src/eas_pcmdata.c46
-rw-r--r--arm-wt-22k/lib_src/eas_pcmdata.h290
-rw-r--r--arm-wt-22k/lib_src/eas_public.c3092
-rw-r--r--arm-wt-22k/lib_src/eas_reverb.c2284
-rw-r--r--arm-wt-22k/lib_src/eas_reverbdata.c44
-rw-r--r--arm-wt-22k/lib_src/eas_reverbdata.h948
-rw-r--r--arm-wt-22k/lib_src/eas_rtttl.c2370
-rw-r--r--arm-wt-22k/lib_src/eas_rtttldata.c58
-rw-r--r--arm-wt-22k/lib_src/eas_rtttldata.h116
-rw-r--r--arm-wt-22k/lib_src/eas_smf.c1636
-rw-r--r--arm-wt-22k/lib_src/eas_smf.h74
-rw-r--r--arm-wt-22k/lib_src/eas_smfdata.c108
-rw-r--r--arm-wt-22k/lib_src/eas_smfdata.h108
-rw-r--r--arm-wt-22k/lib_src/eas_sndlib.h788
-rw-r--r--arm-wt-22k/lib_src/eas_synth.h766
-rw-r--r--arm-wt-22k/lib_src/eas_synth_protos.h96
-rw-r--r--arm-wt-22k/lib_src/eas_synthcfg.h116
-rw-r--r--arm-wt-22k/lib_src/eas_tcdata.c62
-rw-r--r--arm-wt-22k/lib_src/eas_tcdata.h106
-rw-r--r--arm-wt-22k/lib_src/eas_tonecontrol.c1858
-rw-r--r--arm-wt-22k/lib_src/eas_vm_protos.h2148
-rw-r--r--arm-wt-22k/lib_src/eas_voicemgt.c7918
-rw-r--r--arm-wt-22k/lib_src/eas_wavefile.c1710
-rw-r--r--arm-wt-22k/lib_src/eas_wavefile.h102
-rw-r--r--arm-wt-22k/lib_src/eas_wavefiledata.c42
-rw-r--r--arm-wt-22k/lib_src/eas_wt_IPC_frame.h140
-rw-r--r--arm-wt-22k/lib_src/eas_wtengine.c898
-rw-r--r--arm-wt-22k/lib_src/eas_wtengine.h318
-rw-r--r--arm-wt-22k/lib_src/eas_wtsynth.c1428
-rw-r--r--arm-wt-22k/lib_src/eas_wtsynth.h108
-rw-r--r--arm-wt-22k/lib_src/eas_xmf.c1676
-rw-r--r--arm-wt-22k/lib_src/eas_xmf.h96
-rw-r--r--arm-wt-22k/lib_src/eas_xmfdata.c64
-rw-r--r--arm-wt-22k/lib_src/eas_xmfdata.h86
-rw-r--r--arm-wt-22k/lib_src/jet.c2258
-rw-r--r--arm-wt-22k/lib_src/jet_data.h342
-rw-r--r--arm-wt-22k/lib_src/wt_22khz.c29280
-rw-r--r--arm-wt-22k/misc/eas_host.c1550
98 files changed, 66279 insertions, 66279 deletions
diff --git a/arm-wt-22k/host_src/eas.h b/arm-wt-22k/host_src/eas.h
index 524601e..c64af49 100644
--- a/arm-wt-22k/host_src/eas.h
+++ b/arm-wt-22k/host_src/eas.h
@@ -1,16 +1,16 @@
/*----------------------------------------------------------------------------
*
- * File:
+ * File:
* eas.h
*
* Contents and purpose:
* The public interface header for the EAS synthesizer.
*
* This header only contains declarations that are specific
- * to this implementation.
+ * to this implementation.
*
* DO NOT MODIFY THIS FILE!
- *
+ *
* Copyright Sonic Network Inc. 2005, 2006
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -48,59 +48,59 @@ extern "C" {
typedef struct
{
- EAS_U32 libVersion;
- EAS_BOOL checkedVersion;
- EAS_I32 maxVoices;
- EAS_I32 numChannels;
- EAS_I32 sampleRate;
- EAS_I32 mixBufferSize;
- EAS_BOOL filterEnabled;
- EAS_U32 buildTimeStamp;
- EAS_CHAR *buildGUID;
+ EAS_U32 libVersion;
+ EAS_BOOL checkedVersion;
+ EAS_I32 maxVoices;
+ EAS_I32 numChannels;
+ EAS_I32 sampleRate;
+ EAS_I32 mixBufferSize;
+ EAS_BOOL filterEnabled;
+ EAS_U32 buildTimeStamp;
+ EAS_CHAR *buildGUID;
} S_EAS_LIB_CONFIG;
/* enumerated effects module numbers for configuration */
typedef enum
{
- EAS_MODULE_ENHANCER = 0,
- EAS_MODULE_COMPRESSOR,
- EAS_MODULE_REVERB,
- EAS_MODULE_CHORUS,
- EAS_MODULE_WIDENER,
- EAS_MODULE_GRAPHIC_EQ,
- EAS_MODULE_WOW,
- EAS_MODULE_MAXIMIZER,
- EAS_MODULE_TONECONTROLEQ,
- NUM_EFFECTS_MODULES
+ EAS_MODULE_ENHANCER = 0,
+ EAS_MODULE_COMPRESSOR,
+ EAS_MODULE_REVERB,
+ EAS_MODULE_CHORUS,
+ EAS_MODULE_WIDENER,
+ EAS_MODULE_GRAPHIC_EQ,
+ EAS_MODULE_WOW,
+ EAS_MODULE_MAXIMIZER,
+ EAS_MODULE_TONECONTROLEQ,
+ NUM_EFFECTS_MODULES
} E_FX_MODULES;
/* enumerated optional module numbers for configuration */
typedef enum
{
- EAS_MODULE_MMAPI_TONE_CONTROL = 0,
- EAS_MODULE_METRICS
+ EAS_MODULE_MMAPI_TONE_CONTROL = 0,
+ EAS_MODULE_METRICS
} E_OPT_MODULES;
-#define NUM_OPTIONAL_MODULES 2
+#define NUM_OPTIONAL_MODULES 2
/* enumerated audio decoders for configuration */
typedef enum
{
- EAS_DECODER_PCM = 0,
- EAS_DECODER_SMAF_ADPCM,
- EAS_DECODER_IMA_ADPCM,
- EAS_DECODER_7BIT_SMAF_ADPCM,
- EAS_DECODER_NOT_SUPPORTED
+ EAS_DECODER_PCM = 0,
+ EAS_DECODER_SMAF_ADPCM,
+ EAS_DECODER_IMA_ADPCM,
+ EAS_DECODER_7BIT_SMAF_ADPCM,
+ EAS_DECODER_NOT_SUPPORTED
} E_DECODER_MODULES;
-#define NUM_DECODER_MODULES 4
+#define NUM_DECODER_MODULES 4
/* defines for EAS_PEOpenStream flags parameter */
-#define PCM_FLAGS_STEREO 0x00000100 /* stream is stereo */
-#define PCM_FLAGS_8_BIT 0x00000001 /* 8-bit format */
-#define PCM_FLAGS_UNSIGNED 0x00000010 /* unsigned format */
-#define PCM_FLAGS_STREAMING 0x80000000 /* streaming mode */
+#define PCM_FLAGS_STEREO 0x00000100 /* stream is stereo */
+#define PCM_FLAGS_8_BIT 0x00000001 /* 8-bit format */
+#define PCM_FLAGS_UNSIGNED 0x00000010 /* unsigned format */
+#define PCM_FLAGS_STREAMING 0x80000000 /* streaming mode */
/* maximum volume setting */
-#define EAS_MAX_VOLUME 100
+#define EAS_MAX_VOLUME 100
/*----------------------------------------------------------------------------
* EAS_Init()
@@ -109,8 +109,8 @@ typedef enum
* Initialize the synthesizer library
*
* Inputs:
- * polyphony - number of voices to play (dynamic memory model only)
- * ppLibData - pointer to data handle variable for this instance
+ * polyphony - number of voices to play (dynamic memory model only)
+ * ppLibData - pointer to data handle variable for this instance
*
* Outputs:
*
@@ -141,7 +141,7 @@ EAS_PUBLIC const S_EAS_LIB_CONFIG *EAS_Config (void);
* synthesizer (dynamic memory model only)
*
* Inputs:
- * pEASData - handle to data for this instance
+ * pEASData - handle to data for this instance
*
* Outputs:
*
@@ -157,12 +157,12 @@ EAS_PUBLIC EAS_RESULT EAS_Shutdown (EAS_DATA_HANDLE pEASData);
*
* Inputs:
* pEASData - buffer for internal EAS data
- * pOut - output buffer pointer
- * nNumRequested - requested num samples to generate
- * pnNumGenerated - actual number of samples generated
+ * pOut - output buffer pointer
+ * nNumRequested - requested num samples to generate
+ * pnNumGenerated - actual number of samples generated
*
* Outputs:
- * EAS_SUCCESS if PCM data was successfully rendered
+ * EAS_SUCCESS if PCM data was successfully rendered
*
*----------------------------------------------------------------------------
*/
@@ -171,21 +171,21 @@ EAS_PUBLIC EAS_RESULT EAS_Render (EAS_DATA_HANDLE pEASData, EAS_PCM *pOut, EAS_I
/*----------------------------------------------------------------------------
* EAS_SetRepeat()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Set the selected stream to repeat.
*
* Inputs:
- * pEASData - handle to data for this instance
- * streamHandle - handle to stream
- * repeatCount - repeat count (0 = no repeat, -1 = repeat forever)
- *
+ * pEASData - handle to data for this instance
+ * streamHandle - handle to stream
+ * repeatCount - repeat count (0 = no repeat, -1 = repeat forever)
+ *
* Outputs:
*
* Side Effects:
*
* Notes:
- * 0 = no repeat
- * 1 = repeat once, i.e. play through twice
+ * 0 = no repeat
+ * 1 = repeat once, i.e. play through twice
* -1 = repeat forever
*----------------------------------------------------------------------------
*/
@@ -194,21 +194,21 @@ EAS_PUBLIC EAS_RESULT EAS_SetRepeat (EAS_DATA_HANDLE pEASData, EAS_HANDLE stream
/*----------------------------------------------------------------------------
* EAS_GetRepeat()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Gets the current repeat count for the selected stream.
*
* Inputs:
- * pEASData - handle to data for this instance
- * streamHandle - handle to stream
- * pRrepeatCount - pointer to variable to hold repeat count
- *
+ * pEASData - handle to data for this instance
+ * streamHandle - handle to stream
+ * pRrepeatCount - pointer to variable to hold repeat count
+ *
* Outputs:
*
* Side Effects:
*
* Notes:
- * 0 = no repeat
- * 1 = repeat once, i.e. play through twice
+ * 0 = no repeat
+ * 1 = repeat once, i.e. play through twice
* -1 = repeat forever
*----------------------------------------------------------------------------
*/
@@ -217,14 +217,14 @@ EAS_PUBLIC EAS_RESULT EAS_GetRepeat (EAS_DATA_HANDLE pEASData, EAS_HANDLE stream
/*----------------------------------------------------------------------------
* EAS_SetPlaybackRate()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Set the playback rate.
*
* Inputs:
- * pEASData - handle to data for this instance
- * streamHandle - handle to stream
- * rate - rate (28-bit fractional amount)
- *
+ * pEASData - handle to data for this instance
+ * streamHandle - handle to stream
+ * rate - rate (28-bit fractional amount)
+ *
* Outputs:
*
* Side Effects:
@@ -232,22 +232,22 @@ EAS_PUBLIC EAS_RESULT EAS_GetRepeat (EAS_DATA_HANDLE pEASData, EAS_HANDLE stream
*----------------------------------------------------------------------------
*/
EAS_PUBLIC EAS_RESULT EAS_SetPlaybackRate (EAS_DATA_HANDLE pEASData, EAS_HANDLE streamHandle, EAS_U32 rate);
-#define MAX_PLAYBACK_RATE (EAS_U32)(1L << 29)
-#define MIN_PLAYBACK_RATE (EAS_U32)(1L << 27)
+#define MAX_PLAYBACK_RATE (EAS_U32)(1L << 29)
+#define MIN_PLAYBACK_RATE (EAS_U32)(1L << 27)
/*----------------------------------------------------------------------------
* EAS_SetTransposition)
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Sets the key tranposition for the synthesizer. Transposes all
* melodic instruments by the specified amount. Range is limited
* to +/-12 semitones.
*
* Inputs:
- * pEASData - handle to data for this instance
- * streamHandle - handle to stream
- * transposition - +/-12 semitones
- *
+ * pEASData - handle to data for this instance
+ * streamHandle - handle to stream
+ * transposition - +/-12 semitones
+ *
* Outputs:
*
* Side Effects:
@@ -255,21 +255,21 @@ EAS_PUBLIC EAS_RESULT EAS_SetPlaybackRate (EAS_DATA_HANDLE pEASData, EAS_HANDLE
*----------------------------------------------------------------------------
*/
EAS_PUBLIC EAS_RESULT EAS_SetTransposition (EAS_DATA_HANDLE pEASData, EAS_HANDLE streamHandle, EAS_I32 transposition);
-#define MAX_TRANSPOSE 12
+#define MAX_TRANSPOSE 12
/*----------------------------------------------------------------------------
* EAS_SetSynthPolyphony()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Set the polyphony of the synthesizer. Value must be >= 1 and <= the
* maximum number of voices. This function will pin the polyphony
* at those limits
*
* Inputs:
- * pEASData - pointer to overall EAS data structure
- * synthNum - synthesizer number (0 = onboard, 1 = DSP)
- * polyphonyCount - the desired polyphony count
- *
+ * pEASData - pointer to overall EAS data structure
+ * synthNum - synthesizer number (0 = onboard, 1 = DSP)
+ * polyphonyCount - the desired polyphony count
+ *
* Outputs:
*
* Side Effects:
@@ -281,14 +281,14 @@ EAS_PUBLIC EAS_RESULT EAS_SetSynthPolyphony (EAS_DATA_HANDLE pEASData, EAS_I32 s
/*----------------------------------------------------------------------------
* EAS_GetSynthPolyphony()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Returns the current polyphony setting of the synthesizer
*
* Inputs:
- * pEASData - pointer to overall EAS data structure
- * synthNum - synthesizer number (0 = onboard, 1 = DSP)
- * pPolyphonyCount - pointer to variable to receive polyphony count
- *
+ * pEASData - pointer to overall EAS data structure
+ * synthNum - synthesizer number (0 = onboard, 1 = DSP)
+ * pPolyphonyCount - pointer to variable to receive polyphony count
+ *
* Outputs:
*
* Side Effects:
@@ -300,16 +300,16 @@ EAS_PUBLIC EAS_RESULT EAS_GetSynthPolyphony (EAS_DATA_HANDLE pEASData, EAS_I32 s
/*----------------------------------------------------------------------------
* EAS_SetPolyphony()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Set the polyphony of the stream. Value must be >= 1 and <= the
* maximum number of voices. This function will pin the polyphony
* at those limits
*
* Inputs:
- * pEASData - pointer to overall EAS data structure
- * streamHandle - handle returned by EAS_OpenFile
- * polyphonyCount - the desired polyphony count
- *
+ * pEASData - pointer to overall EAS data structure
+ * streamHandle - handle returned by EAS_OpenFile
+ * polyphonyCount - the desired polyphony count
+ *
* Outputs:
*
* Side Effects:
@@ -321,14 +321,14 @@ EAS_PUBLIC EAS_RESULT EAS_SetPolyphony (EAS_DATA_HANDLE pEASData, EAS_HANDLE str
/*----------------------------------------------------------------------------
* EAS_GetPolyphony()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Returns the current polyphony setting of the stream
*
* Inputs:
- * pEASData - pointer to overall EAS data structure
- * streamHandle - handle returned by EAS_OpenFile
- * pPolyphonyCount - pointer to variable to receive polyphony count
- *
+ * pEASData - pointer to overall EAS data structure
+ * streamHandle - handle returned by EAS_OpenFile
+ * pPolyphonyCount - pointer to variable to receive polyphony count
+ *
* Outputs:
*
* Side Effects:
@@ -340,17 +340,17 @@ EAS_PUBLIC EAS_RESULT EAS_GetPolyphony (EAS_DATA_HANDLE pEASData, EAS_HANDLE str
/*----------------------------------------------------------------------------
* EAS_SetPriority()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Set the priority of the stream. Determines which stream's voices
* are stolen when there are insufficient voices for all notes.
* Value must be in the range of 1-255, lower values are higher
* priority. The default priority is 50.
*
* Inputs:
- * pEASData - pointer to overall EAS data structure
- * streamHandle - handle returned by EAS_OpenFile
- * polyphonyCount - the desired polyphony count
- *
+ * pEASData - pointer to overall EAS data structure
+ * streamHandle - handle returned by EAS_OpenFile
+ * polyphonyCount - the desired polyphony count
+ *
* Outputs:
*
* Side Effects:
@@ -362,14 +362,14 @@ EAS_PUBLIC EAS_RESULT EAS_SetPriority (EAS_DATA_HANDLE pEASData, EAS_HANDLE stre
/*----------------------------------------------------------------------------
* EAS_GetPriority()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Returns the current priority setting of the stream
*
* Inputs:
- * pEASData - pointer to overall EAS data structure
- * streamHandle - handle returned by EAS_OpenFile
- * pPriority - pointer to variable to receive priority
- *
+ * pEASData - pointer to overall EAS data structure
+ * streamHandle - handle returned by EAS_OpenFile
+ * pPriority - pointer to variable to receive priority
+ *
* Outputs:
*
* Side Effects:
@@ -381,14 +381,14 @@ EAS_PUBLIC EAS_RESULT EAS_GetPriority (EAS_DATA_HANDLE pEASData, EAS_HANDLE stre
/*----------------------------------------------------------------------------
* EAS_SetVolume()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Set the master volume for the mixer. The default volume setting is
* 90 (-10 dB). The volume range is 0 to 100 in 1dB increments.
*
* Inputs:
- * pEASData - pointer to overall EAS data structure
- * volume - the desired master volume
- *
+ * pEASData - pointer to overall EAS data structure
+ * volume - the desired master volume
+ *
* Outputs:
*
*
@@ -402,13 +402,13 @@ EAS_PUBLIC EAS_RESULT EAS_SetVolume (EAS_DATA_HANDLE pEASData, EAS_HANDLE stream
/*----------------------------------------------------------------------------
* EAS_GetVolume()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Returns the master volume for the mixer in 1dB increments.
*
* Inputs:
- * pEASData - pointer to overall EAS data structure
- * volume - the desired master volume
- *
+ * pEASData - pointer to overall EAS data structure
+ * volume - the desired master volume
+ *
* Outputs:
*
*
@@ -422,7 +422,7 @@ EAS_PUBLIC EAS_I32 EAS_GetVolume (EAS_DATA_HANDLE pEASData, EAS_HANDLE streamHan
/*----------------------------------------------------------------------------
* EAS_SetMaxLoad()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Sets the maximum workload the parsers will do in a single call to
* EAS_Render. The units are currently arbitrary, but should correlate
* well to the actual CPU cycles consumed. The primary effect is to
@@ -431,9 +431,9 @@ EAS_PUBLIC EAS_I32 EAS_GetVolume (EAS_DATA_HANDLE pEASData, EAS_HANDLE streamHan
* the workload limiting function.
*
* Inputs:
- * pEASData - handle to data for this instance
- * maxLoad - the desired maximum workload
- *
+ * pEASData - handle to data for this instance
+ * maxLoad - the desired maximum workload
+ *
* Outputs:
*
* Side Effects:
@@ -449,9 +449,9 @@ EAS_PUBLIC EAS_RESULT EAS_SetMaxLoad (EAS_DATA_HANDLE pEASData, EAS_I32 maxLoad)
* use PCM streaming.
*
* Inputs:
- * pEASData - pointer to overall EAS data structure
- * streamHandle - handle returned by EAS_OpenFile
- * maxNumStreams - maximum number of PCM streams
+ * pEASData - pointer to overall EAS data structure
+ * streamHandle - handle returned by EAS_OpenFile
+ * maxNumStreams - maximum number of PCM streams
*----------------------------------------------------------------------------
*/
EAS_PUBLIC EAS_RESULT EAS_SetMaxPCMStreams (EAS_DATA_HANDLE pEASData, EAS_HANDLE pStream, EAS_I32 maxNumStreams);
@@ -459,16 +459,16 @@ EAS_PUBLIC EAS_RESULT EAS_SetMaxPCMStreams (EAS_DATA_HANDLE pEASData, EAS_HANDLE
/*----------------------------------------------------------------------------
* EAS_OpenFile()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Opens a file for audio playback.
*
* Inputs:
- * pEASData - pointer to overall EAS data structure
- * locator - pointer to filename or other locating information
- * pStreamHandle - pointer to stream handle variable
- *
+ * pEASData - pointer to overall EAS data structure
+ * locator - pointer to filename or other locating information
+ * pStreamHandle - pointer to stream handle variable
+ *
* Outputs:
- *
+ *
*
* Side Effects:
*
@@ -480,16 +480,16 @@ EAS_PUBLIC EAS_RESULT EAS_OpenFile (EAS_DATA_HANDLE pEASData, EAS_FILE_LOCATOR l
/*----------------------------------------------------------------------------
* EAS_MMAPIToneControl()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Opens a ToneControl file for audio playback.
*
* Inputs:
- * pEASData - pointer to overall EAS data structure
- * locator - pointer to filename or other locating information
- * pStreamHandle - pointer to stream handle variable
- *
+ * pEASData - pointer to overall EAS data structure
+ * locator - pointer to filename or other locating information
+ * pStreamHandle - pointer to stream handle variable
+ *
* Outputs:
- *
+ *
*
* Side Effects:
*
@@ -502,9 +502,9 @@ EAS_PUBLIC EAS_RESULT EAS_MMAPIToneControl (EAS_DATA_HANDLE pEASData, EAS_FILE_L
*----------------------------------------------------------------------------
* Helper function to retrieve WAVE file fmt chunk for MMAPI
*----------------------------------------------------------------------------
- * pEASData - pointer to EAS persistent data object
- * streamHandle - stream handle
- * pFmtChunk - pointer to pointer to FMT chunk data
+ * pEASData - pointer to EAS persistent data object
+ * streamHandle - stream handle
+ * pFmtChunk - pointer to pointer to FMT chunk data
*----------------------------------------------------------------------------
*/
EAS_PUBLIC EAS_RESULT EAS_GetWaveFmtChunk (EAS_DATA_HANDLE pEASData, EAS_HANDLE streamHandle, EAS_VOID_PTR *ppFmtChunk);
@@ -515,9 +515,9 @@ EAS_PUBLIC EAS_RESULT EAS_GetWaveFmtChunk (EAS_DATA_HANDLE pEASData, EAS_HANDLE
*----------------------------------------------------------------------------
* Returns the file type (see eas_types.h for enumerations)
*----------------------------------------------------------------------------
- * pEASData - pointer to EAS persistent data object
- * streamHandle - stream handle
- * pFileType - pointer to variable to receive file type
+ * pEASData - pointer to EAS persistent data object
+ * streamHandle - stream handle
+ * pFileType - pointer to variable to receive file type
*----------------------------------------------------------------------------
*/
EAS_PUBLIC EAS_RESULT EAS_GetFileType (EAS_DATA_HANDLE pEASData, EAS_HANDLE streamHandle, EAS_I32 *pFileType);
@@ -525,19 +525,19 @@ EAS_PUBLIC EAS_RESULT EAS_GetFileType (EAS_DATA_HANDLE pEASData, EAS_HANDLE stre
/*----------------------------------------------------------------------------
* EAS_ParseMetaData()
*----------------------------------------------------------------------------
- * Purpose:
- *
+ * Purpose:
+ *
*
* Inputs:
- * pEASData - pointer to overall EAS data structure
- * streamHandle - file or stream handle
- * playLength - pointer to variable to store the play length (in msecs)
- *
+ * pEASData - pointer to overall EAS data structure
+ * streamHandle - file or stream handle
+ * playLength - pointer to variable to store the play length (in msecs)
+ *
* Outputs:
- *
+ *
*
* Side Effects:
- * - resets the parser to the start of the file
+ * - resets the parser to the start of the file
*----------------------------------------------------------------------------
*/
EAS_PUBLIC EAS_RESULT EAS_ParseMetaData (EAS_DATA_HANDLE pEASData, EAS_HANDLE streamHandle, EAS_I32 *pPlayLength);
@@ -545,16 +545,16 @@ EAS_PUBLIC EAS_RESULT EAS_ParseMetaData (EAS_DATA_HANDLE pEASData, EAS_HANDLE st
/*----------------------------------------------------------------------------
* EAS_Prepare()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Prepares the synthesizer to play the file or stream. Parses the first
* frame of data from the file and arms the synthesizer.
*
* Inputs:
- * pEASData - pointer to overall EAS data structure
- * streamHandle - file or stream handle
- *
+ * pEASData - pointer to overall EAS data structure
+ * streamHandle - file or stream handle
+ *
* Outputs:
- *
+ *
*
* Side Effects:
*
@@ -565,15 +565,15 @@ EAS_PUBLIC EAS_RESULT EAS_Prepare (EAS_DATA_HANDLE pEASData, EAS_HANDLE streamHa
/*----------------------------------------------------------------------------
* EAS_State()
*----------------------------------------------------------------------------
- * Purpose:
- * Returns the state of an audio file or stream.
+ * Purpose:
+ * Returns the state of an audio file or stream.
*
* Inputs:
- * pEASData - pointer to overall EAS data structure
- * streamHandle - file or stream handle
- *
+ * pEASData - pointer to overall EAS data structure
+ * streamHandle - file or stream handle
+ *
* Outputs:
- *
+ *
*
* Side Effects:
*
@@ -584,32 +584,32 @@ EAS_PUBLIC EAS_RESULT EAS_State (EAS_DATA_HANDLE pEASData, EAS_HANDLE streamHand
/*----------------------------------------------------------------------------
* EAS_RegisterMetaDataCallback()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Registers a metadata callback function for parsed metadata. To
* de-register the callback, call this function again with parameter
* cbFunc set to NULL.
*
* Inputs:
- * pEASData - pointer to overall EAS data structure
- * streamHandle - file or stream handle
- * cbFunc - pointer to host callback function
- * metaDataBuffer - pointer to metadata buffer
- * metaDataBufSize - maximum size of the metadata buffer
- *
+ * pEASData - pointer to overall EAS data structure
+ * streamHandle - file or stream handle
+ * cbFunc - pointer to host callback function
+ * metaDataBuffer - pointer to metadata buffer
+ * metaDataBufSize - maximum size of the metadata buffer
+ *
* Outputs:
- *
+ *
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
EAS_PUBLIC EAS_RESULT EAS_RegisterMetaDataCallback (
- EAS_DATA_HANDLE pEASData,
- EAS_HANDLE streamHandle,
- EAS_METADATA_CBFUNC cbFunc,
- char *metaDataBuffer,
- EAS_I32 metaDataBufSize,
- EAS_VOID_PTR pUserData);
+ EAS_DATA_HANDLE pEASData,
+ EAS_HANDLE streamHandle,
+ EAS_METADATA_CBFUNC cbFunc,
+ char *metaDataBuffer,
+ EAS_I32 metaDataBufSize,
+ EAS_VOID_PTR pUserData);
/*----------------------------------------------------------------------------
* EAS_GetNoteCount ()
@@ -617,9 +617,9 @@ EAS_PUBLIC EAS_RESULT EAS_RegisterMetaDataCallback (
* Returns the total number of notes played in this stream
*
* Inputs:
- * pEASData - pointer to overall EAS data structure
- * streamHandle - file or stream handle
- * pNoteCount - pointer to variable to receive note count
+ * pEASData - pointer to overall EAS data structure
+ * streamHandle - file or stream handle
+ * pNoteCount - pointer to variable to receive note count
*----------------------------------------------------------------------------
*/
EAS_PUBLIC EAS_RESULT EAS_GetNoteCount (EAS_DATA_HANDLE pEASData, EAS_HANDLE pStream, EAS_I32 *pNoteCount);
@@ -627,16 +627,16 @@ EAS_PUBLIC EAS_RESULT EAS_GetNoteCount (EAS_DATA_HANDLE pEASData, EAS_HANDLE pSt
/*----------------------------------------------------------------------------
* EAS_CloseFile()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Closes an audio file or stream. Playback should have either paused or
* completed (EAS_State returns EAS_PAUSED or EAS_STOPPED).
*
* Inputs:
- * pEASData - pointer to overall EAS data structure
- * streamHandle - file or stream handle
- *
+ * pEASData - pointer to overall EAS data structure
+ * streamHandle - file or stream handle
+ *
* Outputs:
- *
+ *
*
* Side Effects:
*
@@ -647,16 +647,16 @@ EAS_PUBLIC EAS_RESULT EAS_CloseFile (EAS_DATA_HANDLE pEASData, EAS_HANDLE stream
/*----------------------------------------------------------------------------
* EAS_OpenMIDIStream()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Opens a raw MIDI stream allowing the host to route MIDI cable data directly to the synthesizer
*
* Inputs:
- * pEASData - pointer to overall EAS data structure
- * pStreamHandle - pointer to variable to hold file or stream handle
- * streamHandle - open stream or NULL for new synthesizer instance
- *
+ * pEASData - pointer to overall EAS data structure
+ * pStreamHandle - pointer to variable to hold file or stream handle
+ * streamHandle - open stream or NULL for new synthesizer instance
+ *
* Outputs:
- *
+ *
*
* Side Effects:
*
@@ -667,17 +667,17 @@ EAS_PUBLIC EAS_RESULT EAS_OpenMIDIStream (EAS_DATA_HANDLE pEASData, EAS_HANDLE *
/*----------------------------------------------------------------------------
* EAS_WriteMIDIStream()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Send data to the MIDI stream device
*
* Inputs:
- * pEASData - pointer to overall EAS data structure
- * streamHandle - stream handle
- * pBuffer - pointer to buffer
- * count - number of bytes to write
- *
+ * pEASData - pointer to overall EAS data structure
+ * streamHandle - stream handle
+ * pBuffer - pointer to buffer
+ * count - number of bytes to write
+ *
* Outputs:
- *
+ *
*
* Side Effects:
*
@@ -688,15 +688,15 @@ EAS_PUBLIC EAS_RESULT EAS_WriteMIDIStream(EAS_DATA_HANDLE pEASData, EAS_HANDLE s
/*----------------------------------------------------------------------------
* EAS_CloseMIDIStream()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Closes a raw MIDI stream
*
* Inputs:
- * pEASData - pointer to overall EAS data structure
- * streamHandle - stream handle
- *
+ * pEASData - pointer to overall EAS data structure
+ * streamHandle - stream handle
+ *
* Outputs:
- *
+ *
*
* Side Effects:
*
@@ -707,16 +707,16 @@ EAS_PUBLIC EAS_RESULT EAS_CloseMIDIStream (EAS_DATA_HANDLE pEASData, EAS_HANDLE
/*----------------------------------------------------------------------------
* EAS_Locate()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Locate into the file associated with the handle.
*
* Inputs:
- * pEASData - pointer to overall EAS data structure
- * streamHandle - file handle
- * milliseconds - playback offset from start of file in milliseconds
- *
+ * pEASData - pointer to overall EAS data structure
+ * streamHandle - file handle
+ * milliseconds - playback offset from start of file in milliseconds
+ *
* Outputs:
- *
+ *
*
* Side Effects:
* the actual offset will be quantized to the closest update period, typically
@@ -730,12 +730,12 @@ EAS_PUBLIC EAS_RESULT EAS_Locate (EAS_DATA_HANDLE pEASData, EAS_HANDLE streamHan
/*----------------------------------------------------------------------------
* EAS_GetRenderTime()
*----------------------------------------------------------------------------
- * Purpose:
- * Returns the current playback offset
+ * Purpose:
+ * Returns the current playback offset
*
* Inputs:
- * pEASData - pointer to overall EAS data structure
- *
+ * pEASData - pointer to overall EAS data structure
+ *
* Outputs:
* Gets the render time clock in msecs.
*
@@ -748,13 +748,13 @@ EAS_PUBLIC EAS_RESULT EAS_GetRenderTime (EAS_DATA_HANDLE pEASData, EAS_I32 *pTim
/*----------------------------------------------------------------------------
* EAS_GetLocation()
*----------------------------------------------------------------------------
- * Purpose:
- * Returns the current playback offset
+ * Purpose:
+ * Returns the current playback offset
*
* Inputs:
- * pEASData - pointer to overall EAS data structure
- * streamHandle - file handle
- *
+ * pEASData - pointer to overall EAS data structure
+ * streamHandle - file handle
+ *
* Outputs:
* The offset in milliseconds from the start of the current sequence, quantized
* to the nearest update period. Actual resolution is typically 5.9 ms.
@@ -768,17 +768,17 @@ EAS_PUBLIC EAS_RESULT EAS_GetLocation (EAS_DATA_HANDLE pEASData, EAS_HANDLE stre
/*----------------------------------------------------------------------------
* EAS_Pause()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Pauses the playback of the data associated with this handle. The audio
* is gracefully ramped down to prevent clicks and pops. It may take several
* buffers of audio before the audio is muted.
*
* Inputs:
- * psEASData - pointer to overall EAS data structure
- * streamHandle - file or stream handle
- *
+ * psEASData - pointer to overall EAS data structure
+ * streamHandle - file or stream handle
+ *
* Outputs:
- *
+ *
*
* Side Effects:
*
@@ -790,16 +790,16 @@ EAS_PUBLIC EAS_RESULT EAS_Pause (EAS_DATA_HANDLE pEASData, EAS_HANDLE streamHand
/*----------------------------------------------------------------------------
* EAS_Resume()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Resumes the playback of the data associated with this handle. The audio
* is gracefully ramped up to prevent clicks and pops.
*
* Inputs:
- * psEASData - pointer to overall EAS data structure
- * streamHandle - file or stream handle
- *
+ * psEASData - pointer to overall EAS data structure
+ * streamHandle - file or stream handle
+ *
* Outputs:
- *
+ *
*
* Side Effects:
*
@@ -811,18 +811,18 @@ EAS_PUBLIC EAS_RESULT EAS_Resume (EAS_DATA_HANDLE pEASData, EAS_HANDLE streamHan
/*----------------------------------------------------------------------------
* EAS_GetParameter()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Set the parameter of a module. See E_MODULES for a list of modules
* and the header files of the modules for a list of parameters.
*
* Inputs:
- * psEASData - pointer to overall EAS data structure
- * module - enumerated module number
- * param - enumerated parameter number
- * pValue - pointer to variable to receive parameter value
- *
+ * psEASData - pointer to overall EAS data structure
+ * module - enumerated module number
+ * param - enumerated parameter number
+ * pValue - pointer to variable to receive parameter value
+ *
* Outputs:
- *
+ *
*
* Side Effects:
*
@@ -834,19 +834,19 @@ EAS_PUBLIC EAS_RESULT EAS_GetParameter (EAS_DATA_HANDLE pEASData, EAS_I32 module
/*----------------------------------------------------------------------------
* EAS_SetParameter()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Set the parameter of a module. See E_MODULES for a list of modules
* and the header files of the modules for a list of parameters.
*
* Inputs:
- * psEASData - pointer to overall EAS data structure
- * handle - file or stream handle
- * module - enumerated module number
- * param - enumerated parameter number
- * value - new parameter value
- *
+ * psEASData - pointer to overall EAS data structure
+ * handle - file or stream handle
+ * module - enumerated module number
+ * param - enumerated parameter number
+ * value - new parameter value
+ *
* Outputs:
- *
+ *
*
* Side Effects:
*
@@ -855,18 +855,18 @@ EAS_PUBLIC EAS_RESULT EAS_GetParameter (EAS_DATA_HANDLE pEASData, EAS_I32 module
*/
EAS_PUBLIC EAS_RESULT EAS_SetParameter (EAS_DATA_HANDLE pEASData, EAS_I32 module, EAS_I32 param, EAS_I32 value);
-#ifdef _METRICS_ENABLED
+#ifdef _METRICS_ENABLED
/*----------------------------------------------------------------------------
* EAS_MetricsReport()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Displays the current metrics through the EAS_Report interface.
*
* Inputs:
- * pEASData - instance data handle
- *
+ * pEASData - instance data handle
+ *
* Outputs:
- *
+ *
*
* Side Effects:
*
@@ -877,14 +877,14 @@ EAS_PUBLIC EAS_RESULT EAS_MetricsReport (EAS_DATA_HANDLE pEASData);
/*----------------------------------------------------------------------------
* EAS_MetricsReset()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Displays the current metrics through the EAS_Report interface.
*
* Inputs:
- * pEASData - instance data handle
- *
+ * pEASData - instance data handle
+ *
* Outputs:
- *
+ *
*
* Side Effects:
*
@@ -896,16 +896,16 @@ EAS_PUBLIC EAS_RESULT EAS_MetricsReset (EAS_DATA_HANDLE pEASData);
/*----------------------------------------------------------------------------
* EAS_SetSoundLibrary()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Sets the location of the sound library.
*
* Inputs:
- * pEASData - instance data handle
- * streamHandle - file or stream handle
- * pSoundLib - pointer to sound library
- *
+ * pEASData - instance data handle
+ * streamHandle - file or stream handle
+ * pSoundLib - pointer to sound library
+ *
* Outputs:
- *
+ *
*
* Side Effects:
*
@@ -926,8 +926,8 @@ EAS_PUBLIC EAS_RESULT EAS_SetSoundLibrary (EAS_DATA_HANDLE pEASData, EAS_HANDLE
* it make take slightly longer to process the EAS_OpenFile request.
*
* Inputs:
- * pEASData - instance data handle
- * searchFlag - search flag (EAS_TRUE or EAS_FALSE)
+ * pEASData - instance data handle
+ * searchFlag - search flag (EAS_TRUE or EAS_FALSE)
*----------------------------------------------------------------------------
*/
EAS_PUBLIC EAS_RESULT EAS_SetHeaderSearchFlag (EAS_DATA_HANDLE pEASData, EAS_BOOL searchFlag);
@@ -940,9 +940,9 @@ EAS_PUBLIC EAS_RESULT EAS_SetHeaderSearchFlag (EAS_DATA_HANDLE pEASData, EAS_BOO
* default play mode (usually straight playback) is always zero.
*
* Inputs:
- * pEASData - instance data handle
- * handle - file or stream handle
- * playMode - play mode (see eas_types.h for enumerations)
+ * pEASData - instance data handle
+ * handle - file or stream handle
+ * playMode - play mode (see eas_types.h for enumerations)
*----------------------------------------------------------------------------
*/
EAS_PUBLIC EAS_RESULT EAS_SetPlayMode (EAS_DATA_HANDLE pEASData, EAS_HANDLE pStream, EAS_I32 playMode);
@@ -951,16 +951,16 @@ EAS_PUBLIC EAS_RESULT EAS_SetPlayMode (EAS_DATA_HANDLE pEASData, EAS_HANDLE pStr
/*----------------------------------------------------------------------------
* EAS_LoadDLSCollection()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Downloads a DLS collection
*
* Inputs:
- * pEASData - instance data handle
- * streamHandle - file or stream handle
- * locator - file locator
- *
+ * pEASData - instance data handle
+ * streamHandle - file or stream handle
+ * locator - file locator
+ *
* Outputs:
- *
+ *
*
* Side Effects:
* May overlay instruments in the GM sound set
@@ -973,15 +973,15 @@ EAS_PUBLIC EAS_RESULT EAS_LoadDLSCollection (EAS_DATA_HANDLE pEASData, EAS_HANDL
/*----------------------------------------------------------------------------
* EAS_SetFrameBuffer()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Sets the frame buffer pointer passed to the IPC communications functions
*
* Inputs:
- * pEASData - instance data handle
- * locator - file locator
- *
+ * pEASData - instance data handle
+ * locator - file locator
+ *
* Outputs:
- *
+ *
*
* Side Effects:
* May overlay instruments in the GM sound set
@@ -994,41 +994,41 @@ EAS_PUBLIC EAS_RESULT EAS_SetFrameBuffer (EAS_DATA_HANDLE pEASData, EAS_FRAME_BU
/*----------------------------------------------------------------------------
* EAS_RegExtAudioCallback()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Registers callback functions for audio events.
*
* Inputs:
- * pEASData - pointer to overall EAS data structure
- * streamHandle - file or stream handle
- * cbProgChgFunc - pointer to host callback function for program change
- * cbEventFunc - pointer to host callback functio for note events
- *
+ * pEASData - pointer to overall EAS data structure
+ * streamHandle - file or stream handle
+ * cbProgChgFunc - pointer to host callback function for program change
+ * cbEventFunc - pointer to host callback functio for note events
+ *
* Outputs:
- *
+ *
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
EAS_PUBLIC EAS_RESULT EAS_RegExtAudioCallback (EAS_DATA_HANDLE pEASData,
- EAS_HANDLE streamHandle,
- EAS_VOID_PTR pInstData,
- EAS_EXT_PRG_CHG_FUNC cbProgChgFunc,
- EAS_EXT_EVENT_FUNC cbEventFunc);
+ EAS_HANDLE streamHandle,
+ EAS_VOID_PTR pInstData,
+ EAS_EXT_PRG_CHG_FUNC cbProgChgFunc,
+ EAS_EXT_EVENT_FUNC cbEventFunc);
/*----------------------------------------------------------------------------
* EAS_GetMIDIControllers()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Returns the current state of MIDI controllers on the requested channel.
*
* Inputs:
- * pEASData - pointer to overall EAS data structure
- * streamHandle - file or stream handle
- * pControl - pointer to structure to receive data
- *
+ * pEASData - pointer to overall EAS data structure
+ * streamHandle - file or stream handle
+ * pControl - pointer to structure to receive data
+ *
* Outputs:
- *
+ *
*
* Side Effects:
*
@@ -1044,11 +1044,11 @@ EAS_PUBLIC EAS_RESULT EAS_GetMIDIControllers (EAS_DATA_HANDLE pEASData, EAS_HAND
* position. Returns offset to start of sequence.
*
* Inputs:
- * pEASData - pointer to EAS persistent data object
- * fileHandle - file handle
- * searchString - pointer to search sequence
- * len - length of search sequence
- * pOffset - pointer to variable to store offset to sequence
+ * pEASData - pointer to EAS persistent data object
+ * fileHandle - file handle
+ * searchString - pointer to search sequence
+ * len - length of search sequence
+ * pOffset - pointer to variable to store offset to sequence
*
* Returns EAS_EOF if end-of-file is reached
*----------------------------------------------------------------------------
diff --git a/arm-wt-22k/host_src/eas_build.h b/arm-wt-22k/host_src/eas_build.h
index 4ff15cc..a65f8a6 100644
--- a/arm-wt-22k/host_src/eas_build.h
+++ b/arm-wt-22k/host_src/eas_build.h
@@ -1,15 +1,15 @@
-/*----------------------------------------------------------------------------
- *
- * File:
- * host_src\eas_build.h
- *
- * Contents and purpose:
- * This file contains the build configuration for this
- * build. The buildGUIDStr is a GUID created during
- * the build process and is guaranteed to be unique
- * for each build.
- *
- * Copyright Sonic Network Inc. 2006
+/*----------------------------------------------------------------------------
+ *
+ * File:
+ * host_src\eas_build.h
+ *
+ * Contents and purpose:
+ * This file contains the build configuration for this
+ * build. The buildGUIDStr is a GUID created during
+ * the build process and is guaranteed to be unique
+ * for each build.
+ *
+ * Copyright Sonic Network Inc. 2006
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,15 +22,15 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
- * This file was autogenerated by buildid.exe
- *----------------------------------------------------------------------------
-*/
-
-#ifndef _GUID_1feda229b9a845e996f473c0a80e7220_
-#define _GUID_1feda229b9a845e996f473c0a80e7220_
-
-#define _BUILD_VERSION_ "1feda229-b9a8-45e9-96f4-73c0a80e7220"
-#define _BUILD_TIME_ 0x4743badd
-
-#endif /* _GUID_1feda229b9a845e996f473c0a80e7220_ */
+ *
+ * This file was autogenerated by buildid.exe
+ *----------------------------------------------------------------------------
+*/
+
+#ifndef _GUID_1feda229b9a845e996f473c0a80e7220_
+#define _GUID_1feda229b9a845e996f473c0a80e7220_
+
+#define _BUILD_VERSION_ "1feda229-b9a8-45e9-96f4-73c0a80e7220"
+#define _BUILD_TIME_ 0x4743badd
+
+#endif /* _GUID_1feda229b9a845e996f473c0a80e7220_ */
diff --git a/arm-wt-22k/host_src/eas_chorus.h b/arm-wt-22k/host_src/eas_chorus.h
index 0e9057f..998a828 100644
--- a/arm-wt-22k/host_src/eas_chorus.h
+++ b/arm-wt-22k/host_src/eas_chorus.h
@@ -1,13 +1,13 @@
-/*----------------------------------------------------------------------------
- *
- * File:
- * eas_chorus.h
- *
- * Contents and purpose:
- * Contains parameter enumerations for the Chorus effect
- *
- *
- * Copyright Sonic Network Inc. 2006
+/*----------------------------------------------------------------------------
+ *
+ * File:
+ * eas_chorus.h
+ *
+ * Contents and purpose:
+ * Contains parameter enumerations for the Chorus effect
+ *
+ *
+ * Copyright Sonic Network Inc. 2006
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,34 +20,34 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
- *----------------------------------------------------------------------------
- * Revision Control:
- * $Revision: 309 $
- * $Date: 2006-09-12 18:52:45 -0700 (Tue, 12 Sep 2006) $
- *----------------------------------------------------------------------------
-*/
-
-#ifndef EAS_CHORUS_H
-#define EAS_CHORUS_H
-
-/* enumerated parameter settings for Chorus effect */
-typedef enum
-{
- EAS_PARAM_CHORUS_BYPASS,
- EAS_PARAM_CHORUS_PRESET,
- EAS_PARAM_CHORUS_RATE,
- EAS_PARAM_CHORUS_DEPTH,
- EAS_PARAM_CHORUS_LEVEL
-} E_CHORUS_PARAMS;
-
-typedef enum
-{
- EAS_PARAM_CHORUS_PRESET1,
- EAS_PARAM_CHORUS_PRESET2,
- EAS_PARAM_CHORUS_PRESET3,
- EAS_PARAM_CHORUS_PRESET4
-} E_CHORUS_PRESETS;
-
-
+ *
+ *----------------------------------------------------------------------------
+ * Revision Control:
+ * $Revision: 309 $
+ * $Date: 2006-09-12 18:52:45 -0700 (Tue, 12 Sep 2006) $
+ *----------------------------------------------------------------------------
+*/
+
+#ifndef EAS_CHORUS_H
+#define EAS_CHORUS_H
+
+/* enumerated parameter settings for Chorus effect */
+typedef enum
+{
+ EAS_PARAM_CHORUS_BYPASS,
+ EAS_PARAM_CHORUS_PRESET,
+ EAS_PARAM_CHORUS_RATE,
+ EAS_PARAM_CHORUS_DEPTH,
+ EAS_PARAM_CHORUS_LEVEL
+} E_CHORUS_PARAMS;
+
+typedef enum
+{
+ EAS_PARAM_CHORUS_PRESET1,
+ EAS_PARAM_CHORUS_PRESET2,
+ EAS_PARAM_CHORUS_PRESET3,
+ EAS_PARAM_CHORUS_PRESET4
+} E_CHORUS_PRESETS;
+
+
#endif \ No newline at end of file
diff --git a/arm-wt-22k/host_src/eas_config.c b/arm-wt-22k/host_src/eas_config.c
index c45fbb7..0b92357 100644
--- a/arm-wt-22k/host_src/eas_config.c
+++ b/arm-wt-22k/host_src/eas_config.c
@@ -1,22 +1,22 @@
-/*----------------------------------------------------------------------------
- *
- * File:
- * eas_config.c
- *
- * Contents and purpose:
- * This file contains the Configuration Module interface (CM). The CM
- * is a module compiled external to the library that sets the configuration
- * for this build. It allows the library to find optional components and
- * links to static memory allocations (when used in a static configuration).
- *
- * DO NOT MODIFY THIS FILE!
- *
- * NOTE: This module is not intended to be modified by the customer. It
- * needs to be included in the build process with the correct configuration
- * defines (see the library documentation for information on how to configure
- * the library).
- *
- * Copyright Sonic Network Inc. 2004-2006
+/*----------------------------------------------------------------------------
+ *
+ * File:
+ * eas_config.c
+ *
+ * Contents and purpose:
+ * This file contains the Configuration Module interface (CM). The CM
+ * is a module compiled external to the library that sets the configuration
+ * for this build. It allows the library to find optional components and
+ * links to static memory allocations (when used in a static configuration).
+ *
+ * DO NOT MODIFY THIS FILE!
+ *
+ * NOTE: This module is not intended to be modified by the customer. It
+ * needs to be included in the build process with the correct configuration
+ * defines (see the library documentation for information on how to configure
+ * the library).
+ *
+ * Copyright Sonic Network Inc. 2004-2006
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,591 +29,591 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
- *----------------------------------------------------------------------------
- * Revision Control:
- * $Revision: 796 $
- * $Date: 2007-08-01 00:15:25 -0700 (Wed, 01 Aug 2007) $
- *----------------------------------------------------------------------------
-*/
-
-#include "eas.h"
-#include "eas_config.h"
-
-
-#ifdef _MFI_PARSER
-/*----------------------------------------------------------------------------
- * Vendor/Device ID for MFi Extensions
- *
- * Define the preprocessor symbols to establish the vendor ID and
- * device ID for the MFi PCM/ADPCM extensions.
- *----------------------------------------------------------------------------
-*/
-const EAS_U8 eas_MFIVendorIDMSB = (MFI_VENDOR_ID >> 8) & 0xff;
-const EAS_U8 eas_MFIVendorIDLSB = MFI_VENDOR_ID & 0xff;
-const EAS_U8 eas_MFIDeviceID = MFI_DEVICE_ID;
-#endif
-
-/*----------------------------------------------------------------------------
- *
- * parserModules
- *
- * This structure is used by the EAS library to locate file parsing
- * modules.
- *----------------------------------------------------------------------------
-*/
-
-/* define the external file parsers */
-extern EAS_VOID_PTR EAS_SMF_Parser;
-
-#ifdef _XMF_PARSER
-extern EAS_VOID_PTR EAS_XMF_Parser;
-#endif
-
-#ifdef _SMAF_PARSER
-extern EAS_VOID_PTR EAS_SMAF_Parser;
-#endif
-
-#ifdef _WAVE_PARSER
-extern EAS_VOID_PTR EAS_Wave_Parser;
-#endif
-
-#ifdef _OTA_PARSER
-extern EAS_VOID_PTR EAS_OTA_Parser;
-#endif
-
-#ifdef _IMELODY_PARSER
-extern EAS_VOID_PTR EAS_iMelody_Parser;
-#endif
-
-#ifdef _RTTTL_PARSER
-extern EAS_VOID_PTR EAS_RTTTL_Parser;
-#endif
-
-#if defined (_CMX_PARSER) || defined(_MFI_PARSER)
-extern EAS_VOID_PTR EAS_CMF_Parser;
-#endif
-
-/* initalize pointers to parser interfaces */
-/*lint -e{605} not pretty, but it works */
-EAS_VOID_PTR const parserModules[] =
-{
- &EAS_SMF_Parser,
-
-#ifdef _XMF_PARSER
- &EAS_XMF_Parser,
-#endif
-
-#ifdef _WAVE_PARSER
- &EAS_Wave_Parser,
-#endif
-
-#ifdef _SMAF_PARSER
- &EAS_SMAF_Parser,
-#endif
-
-#ifdef _OTA_PARSER
- &EAS_OTA_Parser,
-#endif
-
-#ifdef _IMELODY_PARSER
- &EAS_iMelody_Parser,
-#endif
-
-#ifdef _RTTTL_PARSER
- &EAS_RTTTL_Parser,
-#endif
-
-#if defined (_CMX_PARSER) || defined(_MFI_PARSER)
- &EAS_CMF_Parser
-#endif
-};
-#define NUM_PARSER_MODULES (sizeof(parserModules) / sizeof(EAS_VOID_PTR))
-
-/*----------------------------------------------------------------------------
- * Data Modules
- *----------------------------------------------------------------------------
-*/
-
-#ifdef _STATIC_MEMORY
-extern EAS_VOID_PTR eas_SMFData;
-extern EAS_VOID_PTR eas_Data;
-extern EAS_VOID_PTR eas_MixBuffer;
-extern EAS_VOID_PTR eas_Synth;
-extern EAS_VOID_PTR eas_MIDI;
-extern EAS_VOID_PTR eas_PCMData;
-extern EAS_VOID_PTR eas_MIDIData;
-
-#ifdef _XMF_PARSER
-extern EAS_VOID_PTR eas_XMFData;
-#endif
-
-#ifdef _SMAF_PARSER
-extern EAS_VOID_PTR eas_SMAFData;
-#endif
-
-#ifdef _OTA_PARSER
-extern EAS_VOID_PTR eas_OTAData;
-#endif
-
-#ifdef _IMELODY_PARSER
-extern EAS_VOID_PTR eas_iMelodyData;
-#endif
-
-#ifdef _RTTTL_PARSER
-extern EAS_VOID_PTR eas_RTTTLData;
-#endif
-
-#ifdef _WAVE_PARSER
-extern EAS_VOID_PTR eas_WaveData;
-#endif
-
-#if defined (_CMX_PARSER) || defined(_MFI_PARSER)
-extern EAS_VOID_PTR eas_CMFData;
-#endif
-#endif
-
-/*----------------------------------------------------------------------------
- *
- * Effects Modules
- *
- * These declarations are used by the EAS library to locate
- * effects modules.
- *----------------------------------------------------------------------------
-*/
-
-#ifdef _ENHANCER_ENABLED
-extern EAS_VOID_PTR EAS_Enhancer;
-#define EAS_ENHANCER_INTERFACE &EAS_Enhancer
-#ifdef _STATIC_MEMORY
-extern EAS_VOID_PTR eas_EnhancerData;
-#define EAS_ENHANCER_DATA &eas_EnhancerData
-#else
-#define EAS_ENHANCER_DATA NULL
-#endif
-#else
-#define EAS_ENHANCER_INTERFACE NULL
-#define EAS_ENHANCER_DATA NULL
-#endif
-
-#ifdef _COMPRESSOR_ENABLED
-extern EAS_VOID_PTR EAS_Compressor;
-#define EAS_COMPRESSOR_INTERFACE &EAS_Compressor
-#ifdef _STATIC_MEMORY
-extern EAS_VOID_PTR eas_CompressorData;
-#define EAS_COMPRESSOR_DATA &eas_CompressorData
-#else
-#define EAS_COMPRESSOR_DATA NULL
-#endif
-#else
-#define EAS_COMPRESSOR_INTERFACE NULL
-#define EAS_COMPRESSOR_DATA NULL
-#endif
-
-#ifdef _MAXIMIZER_ENABLED
-extern EAS_VOID_PTR EAS_Maximizer;
-#define EAS_MAXIMIZER_INTERFACE &EAS_Maximizer
-#ifdef _STATIC_MEMORY
-extern EAS_VOID_PTR eas_MaximizerData;
-#define EAS_MAXIMIZER_DATA &eas_MaximizerData
-#else
-#define EAS_MAXIMIZER_DATA NULL
-#endif
-#else
-#define EAS_MAXIMIZER_INTERFACE NULL
-#define EAS_MAXIMIZER_DATA NULL
-#endif
-
-
-#ifdef _REVERB_ENABLED
-extern EAS_VOID_PTR EAS_Reverb;
-#define EAS_REVERB_INTERFACE &EAS_Reverb
-#ifdef _STATIC_MEMORY
-extern EAS_VOID_PTR eas_ReverbData;
-#define EAS_REVERB_DATA &eas_ReverbData
-#else
-#define EAS_REVERB_DATA NULL
-#endif
-#else
-#define EAS_REVERB_INTERFACE NULL
-#define EAS_REVERB_DATA NULL
-#endif
-
-#ifdef _CHORUS_ENABLED
-extern EAS_VOID_PTR EAS_Chorus;
-#define EAS_CHORUS_INTERFACE &EAS_Chorus
-#ifdef _STATIC_MEMORY
-extern EAS_VOID_PTR eas_ChorusData;
-#define EAS_CHORUS_DATA &eas_ChorusData
-#else
-#define EAS_CHORUS_DATA NULL
-#endif
-#else
-#define EAS_CHORUS_INTERFACE NULL
-#define EAS_CHORUS_DATA NULL
-#endif
-
-#ifdef _WIDENER_ENABLED
-extern EAS_VOID_PTR EAS_Widener;
-#define EAS_WIDENER_INTERFACE &EAS_Widener
-#ifdef _STATIC_MEMORY
-extern EAS_VOID_PTR eas_WidenerData;
-#define EAS_WIDENER_DATA &eas_WidenerData
-#else
-#define EAS_WIDENER_DATA NULL
-#endif
-#else
-#define EAS_WIDENER_INTERFACE NULL
-#define EAS_WIDENER_DATA NULL
-#endif
-
-#ifdef _GRAPHIC_EQ_ENABLED
-extern EAS_VOID_PTR EAS_GraphicEQ;
-#define EAS_GRAPHIC_EQ_INTERFACE &EAS_GraphicEQ
-#ifdef _STATIC_MEMORY
-extern EAS_VOID_PTR eas_GraphicEQData;
-#define EAS_GRAPHIC_EQ_DATA &eas_GraphicEQData
-#else
-#define EAS_GRAPHIC_EQ_DATA NULL
-#endif
-#else
-#define EAS_GRAPHIC_EQ_INTERFACE NULL
-#define EAS_GRAPHIC_EQ_DATA NULL
-#endif
-
-#ifdef _WOW_ENABLED
-extern EAS_VOID_PTR EAS_Wow;
-#define EAS_WOW_INTERFACE &EAS_Wow
-#ifdef _STATIC_MEMORY
-#error "WOW module requires dynamic memory model"
-#else
-#define EAS_WOW_DATA NULL
-#endif
-#else
-#define EAS_WOW_INTERFACE NULL
-#define EAS_WOW_DATA NULL
-#endif
-
-#ifdef _TONECONTROLEQ_ENABLED
-extern EAS_VOID_PTR EAS_ToneControlEQ;
-#define EAS_TONECONTROLEQ_INTERFACE &EAS_ToneControlEQ
-#ifdef _STATIC_MEMORY
-extern EAS_VOID_PTR eas_ToneControlEQData;
-#define EAS_TONECONTROLEQ_DATA &eas_ToneControlEQData
-#else
-#define EAS_TONECONTROLEQ_DATA NULL
-#endif
-#else
-#define EAS_TONECONTROLEQ_INTERFACE NULL
-#define EAS_TONECONTROLEQ_DATA NULL
-#endif
-
-/*lint -e{605} not pretty, but it works */
-EAS_VOID_PTR const effectsModules[] =
-{
- EAS_ENHANCER_INTERFACE,
- EAS_COMPRESSOR_INTERFACE,
- EAS_REVERB_INTERFACE,
- EAS_CHORUS_INTERFACE,
- EAS_WIDENER_INTERFACE,
- EAS_GRAPHIC_EQ_INTERFACE,
- EAS_WOW_INTERFACE,
- EAS_MAXIMIZER_INTERFACE,
- EAS_TONECONTROLEQ_INTERFACE
-};
-
-EAS_VOID_PTR const effectsData[] =
-{
- EAS_ENHANCER_DATA,
- EAS_COMPRESSOR_DATA,
- EAS_REVERB_DATA,
- EAS_CHORUS_DATA,
- EAS_WIDENER_DATA,
- EAS_GRAPHIC_EQ_DATA,
- EAS_WOW_DATA,
- EAS_MAXIMIZER_DATA,
- EAS_TONECONTROLEQ_DATA
-};
-
-/*----------------------------------------------------------------------------
- *
- * Optional Modules
- *
- * These declarations are used by the EAS library to locate
- * effects modules.
- *----------------------------------------------------------------------------
-*/
-
-#ifdef _METRICS_ENABLED
-extern EAS_VOID_PTR EAS_Metrics;
-#define EAS_METRICS_INTERFACE &EAS_Metrics
-#ifdef _STATIC_MEMORY
-extern EAS_VOID_PTR eas_MetricsData;
-#define EAS_METRICS_DATA &eas_MetricsData
-#else
-#define EAS_METRICS_DATA NULL
-#endif
-#else
-#define EAS_METRICS_INTERFACE NULL
-#define EAS_METRICS_DATA NULL
-#endif
-
-#ifdef MMAPI_SUPPORT
-extern EAS_VOID_PTR EAS_TC_Parser;
-#define EAS_TONE_CONTROL_PARSER &EAS_TC_Parser
-#ifdef _STATIC_MEMORY
-extern EAS_VOID_PTR eas_TCData;
-#define EAS_TONE_CONTROL_DATA &eas_TCData
-#else
-#define EAS_TONE_CONTROL_DATA NULL
-#endif
-#else
-#define EAS_TONE_CONTROL_PARSER NULL
-#define EAS_TONE_CONTROL_DATA NULL
-#endif
-
-/*lint -e{605} not pretty, but it works */
-EAS_VOID_PTR const optionalModules[] =
-{
- EAS_TONE_CONTROL_PARSER,
- EAS_METRICS_INTERFACE
-};
-
-EAS_VOID_PTR const optionalData[] =
-{
- EAS_TONE_CONTROL_DATA,
- EAS_METRICS_DATA
-};
-
-/*----------------------------------------------------------------------------
- * EAS_CMStaticMemoryModel()
- *----------------------------------------------------------------------------
- * Purpose:
- * This function returns true if EAS has been configured for
- * a static memory model. There are some limitations in the
- * static memory model, see the documentation for more
- * information.
- *
- * Outputs:
- * returns EAS_TRUE if a module is found
- *----------------------------------------------------------------------------
-*/
-EAS_BOOL EAS_CMStaticMemoryModel (void)
-{
-#ifdef _STATIC_MEMORY
- return EAS_TRUE;
-#else
- return EAS_FALSE;
-#endif
-}
-
-/*----------------------------------------------------------------------------
- * EAS_CMEnumModules()
- *----------------------------------------------------------------------------
- * Purpose:
- * This function is used to find pointers to optional modules.
- *
- * Inputs:
- * module - module number
- *
- * Outputs:
- * returns a pointer to the module function table or NULL if no module
- *----------------------------------------------------------------------------
-*/
-EAS_VOID_PTR EAS_CMEnumModules (EAS_INT module)
-{
-
- if (module >= (EAS_INT) NUM_PARSER_MODULES)
- return NULL;
- return parserModules[module];
-}
-
-/*----------------------------------------------------------------------------
- * EAS_CMEnumData()
- *----------------------------------------------------------------------------
- * Purpose:
- * This function is used to find pointers to static memory allocations.
- *
- * Inputs:
- * dataModule - enumerated module number
- *
- * Outputs:
- * Returns handle to data or NULL if not found
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, dataModule) used only when _STATIC_MEMORY is defined */
-EAS_VOID_PTR EAS_CMEnumData (EAS_INT dataModule)
-{
-
-#ifdef _STATIC_MEMORY
- switch (dataModule)
- {
-
- /* main instance data for synthesizer */
- case EAS_CM_EAS_DATA:
- return &eas_Data;
-
- /* mix buffer for mix engine */
- case EAS_CM_MIX_BUFFER:
- /*lint -e{545} lint doesn't like this because it sees the underlying type */
- return &eas_MixBuffer;
-
- /* instance data for synth */
- case EAS_CM_SYNTH_DATA:
- return &eas_Synth;
-
- /* instance data for MIDI parser */
- case EAS_CM_MIDI_DATA:
- return &eas_MIDI;
-
- /* instance data for SMF parser */
- case EAS_CM_SMF_DATA:
- return &eas_SMFData;
-
-#ifdef _XMF_PARSER
- /* instance data for XMF parser */
- case EAS_CM_XMF_DATA:
- return &eas_XMFData;
-#endif
-
-#ifdef _SMAF_PARSER
- /* instance data for SMAF parser */
- case EAS_CM_SMAF_DATA:
- return &eas_SMAFData;
-#endif
-
- /* instance data for the PCM engine */
- case EAS_CM_PCM_DATA:
- /*lint -e{545} lint doesn't like this because it sees the underlying type */
- return &eas_PCMData;
-
- case EAS_CM_MIDI_STREAM_DATA:
- return &eas_MIDIData;
-
-#ifdef _OTA_PARSER
- /* instance data for OTA parser */
- case EAS_CM_OTA_DATA:
- return &eas_OTAData;
-#endif
-
-#ifdef _IMELODY_PARSER
- /* instance data for iMelody parser */
- case EAS_CM_IMELODY_DATA:
- return &eas_iMelodyData;
-#endif
-
-#ifdef _RTTTL_PARSER
- /* instance data for RTTTL parser */
- case EAS_CM_RTTTL_DATA:
- return &eas_RTTTLData;
-#endif
-
-#ifdef _WAVE_PARSER
- /* instance data for WAVE parser */
- case EAS_CM_WAVE_DATA:
- return &eas_WaveData;
-#endif
-
-#if defined (_CMX_PARSER) || defined(_MFI_PARSER)
- /* instance data for CMF parser */
- case EAS_CM_CMF_DATA:
- return &eas_CMFData;
-#endif
-
- default:
- return NULL;
- }
-
-#else
- return NULL;
-#endif
-}
-
-/*----------------------------------------------------------------------------
- * EAS_CMEnumFXModules()
- *----------------------------------------------------------------------------
- * Purpose:
- * This function is used to find pointers to optional effects modules.
- *
- * Inputs:
- * module - enumerated module number
- * pModule - pointer to module interface
- *
- * Outputs:
- * Returns pointer to function table or NULL if not found
- *----------------------------------------------------------------------------
-*/
-EAS_VOID_PTR EAS_CMEnumFXModules (EAS_INT module)
-{
-
- if (module >= NUM_EFFECTS_MODULES)
- return NULL;
- return effectsModules[module];
-}
-
-/*----------------------------------------------------------------------------
- * EAS_CMEnumFXData()
- *----------------------------------------------------------------------------
- * Purpose:
- * This function is used to find pointers to static memory allocations.
- *
- * Inputs:
- * dataModule - enumerated module number
- * pData - pointer to handle variable
- *
- * Outputs:
- * Returns handle to data or NULL if not found
- *----------------------------------------------------------------------------
-*/
-EAS_VOID_PTR EAS_CMEnumFXData (EAS_INT dataModule)
-{
-
- if (dataModule >= NUM_EFFECTS_MODULES)
- return NULL;
- return effectsData[dataModule];
-}
-
-/*----------------------------------------------------------------------------
- * EAS_CMEnumOptModules()
- *----------------------------------------------------------------------------
- * Purpose:
- * This function is used to find pointers to optional modules.
- *
- * Inputs:
- * module - enumerated module number
- *
- * Outputs:
- * returns pointer to function table or NULL if no module
- *----------------------------------------------------------------------------
-*/
-EAS_VOID_PTR EAS_CMEnumOptModules (EAS_INT module)
-{
-
- /* sanity check */
- if (module >= NUM_OPTIONAL_MODULES)
- return EAS_FALSE;
- return optionalModules[module];
-}
-
-/*----------------------------------------------------------------------------
- * EAS_CMEnumOptData()
- *----------------------------------------------------------------------------
- * Purpose:
- * This function is used to find pointers to static memory allocations.
- *
- * Inputs:
- * dataModule - enumerated module number
- *
- * Outputs:
- * Returns handle to data or NULL if not found
- *----------------------------------------------------------------------------
-*/
-EAS_VOID_PTR EAS_CMEnumOptData (EAS_INT dataModule)
-{
-
- if (dataModule >= NUM_OPTIONAL_MODULES)
- return NULL;
- return optionalData[dataModule];
-}
-
-
+ *
+ *----------------------------------------------------------------------------
+ * Revision Control:
+ * $Revision: 796 $
+ * $Date: 2007-08-01 00:15:25 -0700 (Wed, 01 Aug 2007) $
+ *----------------------------------------------------------------------------
+*/
+
+#include "eas.h"
+#include "eas_config.h"
+
+
+#ifdef _MFI_PARSER
+/*----------------------------------------------------------------------------
+ * Vendor/Device ID for MFi Extensions
+ *
+ * Define the preprocessor symbols to establish the vendor ID and
+ * device ID for the MFi PCM/ADPCM extensions.
+ *----------------------------------------------------------------------------
+*/
+const EAS_U8 eas_MFIVendorIDMSB = (MFI_VENDOR_ID >> 8) & 0xff;
+const EAS_U8 eas_MFIVendorIDLSB = MFI_VENDOR_ID & 0xff;
+const EAS_U8 eas_MFIDeviceID = MFI_DEVICE_ID;
+#endif
+
+/*----------------------------------------------------------------------------
+ *
+ * parserModules
+ *
+ * This structure is used by the EAS library to locate file parsing
+ * modules.
+ *----------------------------------------------------------------------------
+*/
+
+/* define the external file parsers */
+extern EAS_VOID_PTR EAS_SMF_Parser;
+
+#ifdef _XMF_PARSER
+extern EAS_VOID_PTR EAS_XMF_Parser;
+#endif
+
+#ifdef _SMAF_PARSER
+extern EAS_VOID_PTR EAS_SMAF_Parser;
+#endif
+
+#ifdef _WAVE_PARSER
+extern EAS_VOID_PTR EAS_Wave_Parser;
+#endif
+
+#ifdef _OTA_PARSER
+extern EAS_VOID_PTR EAS_OTA_Parser;
+#endif
+
+#ifdef _IMELODY_PARSER
+extern EAS_VOID_PTR EAS_iMelody_Parser;
+#endif
+
+#ifdef _RTTTL_PARSER
+extern EAS_VOID_PTR EAS_RTTTL_Parser;
+#endif
+
+#if defined (_CMX_PARSER) || defined(_MFI_PARSER)
+extern EAS_VOID_PTR EAS_CMF_Parser;
+#endif
+
+/* initalize pointers to parser interfaces */
+/*lint -e{605} not pretty, but it works */
+EAS_VOID_PTR const parserModules[] =
+{
+ &EAS_SMF_Parser,
+
+#ifdef _XMF_PARSER
+ &EAS_XMF_Parser,
+#endif
+
+#ifdef _WAVE_PARSER
+ &EAS_Wave_Parser,
+#endif
+
+#ifdef _SMAF_PARSER
+ &EAS_SMAF_Parser,
+#endif
+
+#ifdef _OTA_PARSER
+ &EAS_OTA_Parser,
+#endif
+
+#ifdef _IMELODY_PARSER
+ &EAS_iMelody_Parser,
+#endif
+
+#ifdef _RTTTL_PARSER
+ &EAS_RTTTL_Parser,
+#endif
+
+#if defined (_CMX_PARSER) || defined(_MFI_PARSER)
+ &EAS_CMF_Parser
+#endif
+};
+#define NUM_PARSER_MODULES (sizeof(parserModules) / sizeof(EAS_VOID_PTR))
+
+/*----------------------------------------------------------------------------
+ * Data Modules
+ *----------------------------------------------------------------------------
+*/
+
+#ifdef _STATIC_MEMORY
+extern EAS_VOID_PTR eas_SMFData;
+extern EAS_VOID_PTR eas_Data;
+extern EAS_VOID_PTR eas_MixBuffer;
+extern EAS_VOID_PTR eas_Synth;
+extern EAS_VOID_PTR eas_MIDI;
+extern EAS_VOID_PTR eas_PCMData;
+extern EAS_VOID_PTR eas_MIDIData;
+
+#ifdef _XMF_PARSER
+extern EAS_VOID_PTR eas_XMFData;
+#endif
+
+#ifdef _SMAF_PARSER
+extern EAS_VOID_PTR eas_SMAFData;
+#endif
+
+#ifdef _OTA_PARSER
+extern EAS_VOID_PTR eas_OTAData;
+#endif
+
+#ifdef _IMELODY_PARSER
+extern EAS_VOID_PTR eas_iMelodyData;
+#endif
+
+#ifdef _RTTTL_PARSER
+extern EAS_VOID_PTR eas_RTTTLData;
+#endif
+
+#ifdef _WAVE_PARSER
+extern EAS_VOID_PTR eas_WaveData;
+#endif
+
+#if defined (_CMX_PARSER) || defined(_MFI_PARSER)
+extern EAS_VOID_PTR eas_CMFData;
+#endif
+#endif
+
+/*----------------------------------------------------------------------------
+ *
+ * Effects Modules
+ *
+ * These declarations are used by the EAS library to locate
+ * effects modules.
+ *----------------------------------------------------------------------------
+*/
+
+#ifdef _ENHANCER_ENABLED
+extern EAS_VOID_PTR EAS_Enhancer;
+#define EAS_ENHANCER_INTERFACE &EAS_Enhancer
+#ifdef _STATIC_MEMORY
+extern EAS_VOID_PTR eas_EnhancerData;
+#define EAS_ENHANCER_DATA &eas_EnhancerData
+#else
+#define EAS_ENHANCER_DATA NULL
+#endif
+#else
+#define EAS_ENHANCER_INTERFACE NULL
+#define EAS_ENHANCER_DATA NULL
+#endif
+
+#ifdef _COMPRESSOR_ENABLED
+extern EAS_VOID_PTR EAS_Compressor;
+#define EAS_COMPRESSOR_INTERFACE &EAS_Compressor
+#ifdef _STATIC_MEMORY
+extern EAS_VOID_PTR eas_CompressorData;
+#define EAS_COMPRESSOR_DATA &eas_CompressorData
+#else
+#define EAS_COMPRESSOR_DATA NULL
+#endif
+#else
+#define EAS_COMPRESSOR_INTERFACE NULL
+#define EAS_COMPRESSOR_DATA NULL
+#endif
+
+#ifdef _MAXIMIZER_ENABLED
+extern EAS_VOID_PTR EAS_Maximizer;
+#define EAS_MAXIMIZER_INTERFACE &EAS_Maximizer
+#ifdef _STATIC_MEMORY
+extern EAS_VOID_PTR eas_MaximizerData;
+#define EAS_MAXIMIZER_DATA &eas_MaximizerData
+#else
+#define EAS_MAXIMIZER_DATA NULL
+#endif
+#else
+#define EAS_MAXIMIZER_INTERFACE NULL
+#define EAS_MAXIMIZER_DATA NULL
+#endif
+
+
+#ifdef _REVERB_ENABLED
+extern EAS_VOID_PTR EAS_Reverb;
+#define EAS_REVERB_INTERFACE &EAS_Reverb
+#ifdef _STATIC_MEMORY
+extern EAS_VOID_PTR eas_ReverbData;
+#define EAS_REVERB_DATA &eas_ReverbData
+#else
+#define EAS_REVERB_DATA NULL
+#endif
+#else
+#define EAS_REVERB_INTERFACE NULL
+#define EAS_REVERB_DATA NULL
+#endif
+
+#ifdef _CHORUS_ENABLED
+extern EAS_VOID_PTR EAS_Chorus;
+#define EAS_CHORUS_INTERFACE &EAS_Chorus
+#ifdef _STATIC_MEMORY
+extern EAS_VOID_PTR eas_ChorusData;
+#define EAS_CHORUS_DATA &eas_ChorusData
+#else
+#define EAS_CHORUS_DATA NULL
+#endif
+#else
+#define EAS_CHORUS_INTERFACE NULL
+#define EAS_CHORUS_DATA NULL
+#endif
+
+#ifdef _WIDENER_ENABLED
+extern EAS_VOID_PTR EAS_Widener;
+#define EAS_WIDENER_INTERFACE &EAS_Widener
+#ifdef _STATIC_MEMORY
+extern EAS_VOID_PTR eas_WidenerData;
+#define EAS_WIDENER_DATA &eas_WidenerData
+#else
+#define EAS_WIDENER_DATA NULL
+#endif
+#else
+#define EAS_WIDENER_INTERFACE NULL
+#define EAS_WIDENER_DATA NULL
+#endif
+
+#ifdef _GRAPHIC_EQ_ENABLED
+extern EAS_VOID_PTR EAS_GraphicEQ;
+#define EAS_GRAPHIC_EQ_INTERFACE &EAS_GraphicEQ
+#ifdef _STATIC_MEMORY
+extern EAS_VOID_PTR eas_GraphicEQData;
+#define EAS_GRAPHIC_EQ_DATA &eas_GraphicEQData
+#else
+#define EAS_GRAPHIC_EQ_DATA NULL
+#endif
+#else
+#define EAS_GRAPHIC_EQ_INTERFACE NULL
+#define EAS_GRAPHIC_EQ_DATA NULL
+#endif
+
+#ifdef _WOW_ENABLED
+extern EAS_VOID_PTR EAS_Wow;
+#define EAS_WOW_INTERFACE &EAS_Wow
+#ifdef _STATIC_MEMORY
+#error "WOW module requires dynamic memory model"
+#else
+#define EAS_WOW_DATA NULL
+#endif
+#else
+#define EAS_WOW_INTERFACE NULL
+#define EAS_WOW_DATA NULL
+#endif
+
+#ifdef _TONECONTROLEQ_ENABLED
+extern EAS_VOID_PTR EAS_ToneControlEQ;
+#define EAS_TONECONTROLEQ_INTERFACE &EAS_ToneControlEQ
+#ifdef _STATIC_MEMORY
+extern EAS_VOID_PTR eas_ToneControlEQData;
+#define EAS_TONECONTROLEQ_DATA &eas_ToneControlEQData
+#else
+#define EAS_TONECONTROLEQ_DATA NULL
+#endif
+#else
+#define EAS_TONECONTROLEQ_INTERFACE NULL
+#define EAS_TONECONTROLEQ_DATA NULL
+#endif
+
+/*lint -e{605} not pretty, but it works */
+EAS_VOID_PTR const effectsModules[] =
+{
+ EAS_ENHANCER_INTERFACE,
+ EAS_COMPRESSOR_INTERFACE,
+ EAS_REVERB_INTERFACE,
+ EAS_CHORUS_INTERFACE,
+ EAS_WIDENER_INTERFACE,
+ EAS_GRAPHIC_EQ_INTERFACE,
+ EAS_WOW_INTERFACE,
+ EAS_MAXIMIZER_INTERFACE,
+ EAS_TONECONTROLEQ_INTERFACE
+};
+
+EAS_VOID_PTR const effectsData[] =
+{
+ EAS_ENHANCER_DATA,
+ EAS_COMPRESSOR_DATA,
+ EAS_REVERB_DATA,
+ EAS_CHORUS_DATA,
+ EAS_WIDENER_DATA,
+ EAS_GRAPHIC_EQ_DATA,
+ EAS_WOW_DATA,
+ EAS_MAXIMIZER_DATA,
+ EAS_TONECONTROLEQ_DATA
+};
+
+/*----------------------------------------------------------------------------
+ *
+ * Optional Modules
+ *
+ * These declarations are used by the EAS library to locate
+ * effects modules.
+ *----------------------------------------------------------------------------
+*/
+
+#ifdef _METRICS_ENABLED
+extern EAS_VOID_PTR EAS_Metrics;
+#define EAS_METRICS_INTERFACE &EAS_Metrics
+#ifdef _STATIC_MEMORY
+extern EAS_VOID_PTR eas_MetricsData;
+#define EAS_METRICS_DATA &eas_MetricsData
+#else
+#define EAS_METRICS_DATA NULL
+#endif
+#else
+#define EAS_METRICS_INTERFACE NULL
+#define EAS_METRICS_DATA NULL
+#endif
+
+#ifdef MMAPI_SUPPORT
+extern EAS_VOID_PTR EAS_TC_Parser;
+#define EAS_TONE_CONTROL_PARSER &EAS_TC_Parser
+#ifdef _STATIC_MEMORY
+extern EAS_VOID_PTR eas_TCData;
+#define EAS_TONE_CONTROL_DATA &eas_TCData
+#else
+#define EAS_TONE_CONTROL_DATA NULL
+#endif
+#else
+#define EAS_TONE_CONTROL_PARSER NULL
+#define EAS_TONE_CONTROL_DATA NULL
+#endif
+
+/*lint -e{605} not pretty, but it works */
+EAS_VOID_PTR const optionalModules[] =
+{
+ EAS_TONE_CONTROL_PARSER,
+ EAS_METRICS_INTERFACE
+};
+
+EAS_VOID_PTR const optionalData[] =
+{
+ EAS_TONE_CONTROL_DATA,
+ EAS_METRICS_DATA
+};
+
+/*----------------------------------------------------------------------------
+ * EAS_CMStaticMemoryModel()
+ *----------------------------------------------------------------------------
+ * Purpose:
+ * This function returns true if EAS has been configured for
+ * a static memory model. There are some limitations in the
+ * static memory model, see the documentation for more
+ * information.
+ *
+ * Outputs:
+ * returns EAS_TRUE if a module is found
+ *----------------------------------------------------------------------------
+*/
+EAS_BOOL EAS_CMStaticMemoryModel (void)
+{
+#ifdef _STATIC_MEMORY
+ return EAS_TRUE;
+#else
+ return EAS_FALSE;
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * EAS_CMEnumModules()
+ *----------------------------------------------------------------------------
+ * Purpose:
+ * This function is used to find pointers to optional modules.
+ *
+ * Inputs:
+ * module - module number
+ *
+ * Outputs:
+ * returns a pointer to the module function table or NULL if no module
+ *----------------------------------------------------------------------------
+*/
+EAS_VOID_PTR EAS_CMEnumModules (EAS_INT module)
+{
+
+ if (module >= (EAS_INT) NUM_PARSER_MODULES)
+ return NULL;
+ return parserModules[module];
+}
+
+/*----------------------------------------------------------------------------
+ * EAS_CMEnumData()
+ *----------------------------------------------------------------------------
+ * Purpose:
+ * This function is used to find pointers to static memory allocations.
+ *
+ * Inputs:
+ * dataModule - enumerated module number
+ *
+ * Outputs:
+ * Returns handle to data or NULL if not found
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, dataModule) used only when _STATIC_MEMORY is defined */
+EAS_VOID_PTR EAS_CMEnumData (EAS_INT dataModule)
+{
+
+#ifdef _STATIC_MEMORY
+ switch (dataModule)
+ {
+
+ /* main instance data for synthesizer */
+ case EAS_CM_EAS_DATA:
+ return &eas_Data;
+
+ /* mix buffer for mix engine */
+ case EAS_CM_MIX_BUFFER:
+ /*lint -e{545} lint doesn't like this because it sees the underlying type */
+ return &eas_MixBuffer;
+
+ /* instance data for synth */
+ case EAS_CM_SYNTH_DATA:
+ return &eas_Synth;
+
+ /* instance data for MIDI parser */
+ case EAS_CM_MIDI_DATA:
+ return &eas_MIDI;
+
+ /* instance data for SMF parser */
+ case EAS_CM_SMF_DATA:
+ return &eas_SMFData;
+
+#ifdef _XMF_PARSER
+ /* instance data for XMF parser */
+ case EAS_CM_XMF_DATA:
+ return &eas_XMFData;
+#endif
+
+#ifdef _SMAF_PARSER
+ /* instance data for SMAF parser */
+ case EAS_CM_SMAF_DATA:
+ return &eas_SMAFData;
+#endif
+
+ /* instance data for the PCM engine */
+ case EAS_CM_PCM_DATA:
+ /*lint -e{545} lint doesn't like this because it sees the underlying type */
+ return &eas_PCMData;
+
+ case EAS_CM_MIDI_STREAM_DATA:
+ return &eas_MIDIData;
+
+#ifdef _OTA_PARSER
+ /* instance data for OTA parser */
+ case EAS_CM_OTA_DATA:
+ return &eas_OTAData;
+#endif
+
+#ifdef _IMELODY_PARSER
+ /* instance data for iMelody parser */
+ case EAS_CM_IMELODY_DATA:
+ return &eas_iMelodyData;
+#endif
+
+#ifdef _RTTTL_PARSER
+ /* instance data for RTTTL parser */
+ case EAS_CM_RTTTL_DATA:
+ return &eas_RTTTLData;
+#endif
+
+#ifdef _WAVE_PARSER
+ /* instance data for WAVE parser */
+ case EAS_CM_WAVE_DATA:
+ return &eas_WaveData;
+#endif
+
+#if defined (_CMX_PARSER) || defined(_MFI_PARSER)
+ /* instance data for CMF parser */
+ case EAS_CM_CMF_DATA:
+ return &eas_CMFData;
+#endif
+
+ default:
+ return NULL;
+ }
+
+#else
+ return NULL;
+#endif
+}
+
+/*----------------------------------------------------------------------------
+ * EAS_CMEnumFXModules()
+ *----------------------------------------------------------------------------
+ * Purpose:
+ * This function is used to find pointers to optional effects modules.
+ *
+ * Inputs:
+ * module - enumerated module number
+ * pModule - pointer to module interface
+ *
+ * Outputs:
+ * Returns pointer to function table or NULL if not found
+ *----------------------------------------------------------------------------
+*/
+EAS_VOID_PTR EAS_CMEnumFXModules (EAS_INT module)
+{
+
+ if (module >= NUM_EFFECTS_MODULES)
+ return NULL;
+ return effectsModules[module];
+}
+
+/*----------------------------------------------------------------------------
+ * EAS_CMEnumFXData()
+ *----------------------------------------------------------------------------
+ * Purpose:
+ * This function is used to find pointers to static memory allocations.
+ *
+ * Inputs:
+ * dataModule - enumerated module number
+ * pData - pointer to handle variable
+ *
+ * Outputs:
+ * Returns handle to data or NULL if not found
+ *----------------------------------------------------------------------------
+*/
+EAS_VOID_PTR EAS_CMEnumFXData (EAS_INT dataModule)
+{
+
+ if (dataModule >= NUM_EFFECTS_MODULES)
+ return NULL;
+ return effectsData[dataModule];
+}
+
+/*----------------------------------------------------------------------------
+ * EAS_CMEnumOptModules()
+ *----------------------------------------------------------------------------
+ * Purpose:
+ * This function is used to find pointers to optional modules.
+ *
+ * Inputs:
+ * module - enumerated module number
+ *
+ * Outputs:
+ * returns pointer to function table or NULL if no module
+ *----------------------------------------------------------------------------
+*/
+EAS_VOID_PTR EAS_CMEnumOptModules (EAS_INT module)
+{
+
+ /* sanity check */
+ if (module >= NUM_OPTIONAL_MODULES)
+ return EAS_FALSE;
+ return optionalModules[module];
+}
+
+/*----------------------------------------------------------------------------
+ * EAS_CMEnumOptData()
+ *----------------------------------------------------------------------------
+ * Purpose:
+ * This function is used to find pointers to static memory allocations.
+ *
+ * Inputs:
+ * dataModule - enumerated module number
+ *
+ * Outputs:
+ * Returns handle to data or NULL if not found
+ *----------------------------------------------------------------------------
+*/
+EAS_VOID_PTR EAS_CMEnumOptData (EAS_INT dataModule)
+{
+
+ if (dataModule >= NUM_OPTIONAL_MODULES)
+ return NULL;
+ return optionalData[dataModule];
+}
+
+
diff --git a/arm-wt-22k/host_src/eas_config.h b/arm-wt-22k/host_src/eas_config.h
index d16be4a..49c2ef2 100644
--- a/arm-wt-22k/host_src/eas_config.h
+++ b/arm-wt-22k/host_src/eas_config.h
@@ -1,22 +1,22 @@
-/*----------------------------------------------------------------------------
- *
- * File:
- * eas_config.h
- *
- * Contents and purpose:
- * This header declares the Configuration Module interface (CM). The CM
- * is a module compiled external to the library that sets the configuration
- * for this build. It allows the library to find optional components and
- * links to static memory allocations (when used in a static configuration).
- *
- * NOTE: This module is not intended to be modified by the customer. It
- * needs to be included in the build process with the correct configuration
- * defines (see the library documentation for information on how to configure
- * the library).
- *
- * DO NOT MODIFY THIS FILE!
- *
- * Copyright 2005 Sonic Network Inc.
+/*----------------------------------------------------------------------------
+ *
+ * File:
+ * eas_config.h
+ *
+ * Contents and purpose:
+ * This header declares the Configuration Module interface (CM). The CM
+ * is a module compiled external to the library that sets the configuration
+ * for this build. It allows the library to find optional components and
+ * links to static memory allocations (when used in a static configuration).
+ *
+ * NOTE: This module is not intended to be modified by the customer. It
+ * needs to be included in the build process with the correct configuration
+ * defines (see the library documentation for information on how to configure
+ * the library).
+ *
+ * DO NOT MODIFY THIS FILE!
+ *
+ * Copyright 2005 Sonic Network Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,163 +29,163 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
- *----------------------------------------------------------------------------
- * Revision Control:
- * $Revision: 82 $
- * $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
- *----------------------------------------------------------------------------
-*/
-
-// sentinel
-#ifndef _EAS_CONFIG_H
-#define _EAS_CONFIG_H
-
-#include "eas_types.h"
-
-/* list of enumerators for optional modules */
-typedef enum {
- EAS_CM_FILE_PARSERS = 1
-} E_CM_ENUM_MODULES;
-
-/* list of enumerators for module and memory pointers */
-typedef enum {
- EAS_CM_EAS_DATA = 1,
- EAS_CM_MIX_BUFFER,
- EAS_CM_SYNTH_DATA,
- EAS_CM_MIDI_DATA,
- EAS_CM_SMF_DATA,
- EAS_CM_XMF_DATA,
- EAS_CM_SMAF_DATA,
- EAS_CM_PCM_DATA,
- EAS_CM_MIDI_STREAM_DATA,
- EAS_CM_METRICS_DATA,
- EAS_CM_OTA_DATA,
- EAS_CM_IMELODY_DATA,
- EAS_CM_RTTTL_DATA,
- EAS_CM_WAVE_DATA,
- EAS_CM_CMF_DATA
-} E_CM_DATA_MODULES;
-
-typedef struct
-{
- int maxSMFStreams;
- void *pSMFData;
- void *pSMFStream;
-} S_EAS_SMF_PTRS;
-
-typedef struct
-{
- int maxSMAFStreams;
- void *pSMAFData;
- void *pSMAFStream;
-} S_EAS_SMAF_PTRS;
-
-/*----------------------------------------------------------------------------
- * EAS_CMStaticMemoryModel()
- *----------------------------------------------------------------------------
- * Purpose:
- * This function returns true if EAS has been configured for
- * a static memory model. There are some limitations in the
- * static memory model, see the documentation for more
- * information.
- *
- * Outputs:
- * returns EAS_TRUE if a module is found
- *----------------------------------------------------------------------------
-*/
-EAS_BOOL EAS_CMStaticMemoryModel (void);
-
-/*----------------------------------------------------------------------------
- * EAS_CMEnumModules()
- *----------------------------------------------------------------------------
- * Purpose:
- * This function is used to find pointers to optional modules.
- *
- * Inputs:
- * module - module number
- *
- * Outputs:
- * returns a pointer to the module function table or NULL if no module
- *----------------------------------------------------------------------------
-*/
-EAS_VOID_PTR EAS_CMEnumModules (EAS_INT module);
-
-/*----------------------------------------------------------------------------
- * EAS_CMEnumData()
- *----------------------------------------------------------------------------
- * Purpose:
- * This function is used to find pointers to static memory allocations.
- *
- * Inputs:
- * dataModule - enumerated module number
- *
- * Outputs:
- * Returns handle to data or NULL if not found
- *----------------------------------------------------------------------------
-*/
-EAS_VOID_PTR EAS_CMEnumData (EAS_INT dataModule);
-
-/*----------------------------------------------------------------------------
- * EAS_CMEnumFXModules()
- *----------------------------------------------------------------------------
- * Purpose:
- * This function is used to find pointers to optional effects modules.
- *
- * Inputs:
- * module - enumerated module number
- * pModule - pointer to module interface
- *
- * Outputs:
- * Returns pointer to function table or NULL if not found
- *----------------------------------------------------------------------------
-*/
-EAS_VOID_PTR EAS_CMEnumFXModules (EAS_INT module);
-
-/*----------------------------------------------------------------------------
- * EAS_CMEnumFXData()
- *----------------------------------------------------------------------------
- * Purpose:
- * This function is used to find pointers to static memory allocations.
- *
- * Inputs:
- * dataModule - enumerated module number
- * pData - pointer to handle variable
- *
- * Outputs:
- * Returns handle to data or NULL if not found
- *----------------------------------------------------------------------------
-*/
-EAS_VOID_PTR EAS_CMEnumFXData (EAS_INT dataModule);
-
-/*----------------------------------------------------------------------------
- * EAS_CMEnumOptModules()
- *----------------------------------------------------------------------------
- * Purpose:
- * This function is used to find pointers to optional modules.
- *
- * Inputs:
- * module - enumerated module number
- *
- * Outputs:
- * returns pointer to function table or NULL if no module
- *----------------------------------------------------------------------------
-*/
-EAS_VOID_PTR EAS_CMEnumOptModules (EAS_INT module);
-
-/*----------------------------------------------------------------------------
- * EAS_CMEnumOptData()
- *----------------------------------------------------------------------------
- * Purpose:
- * This function is used to find pointers to static memory allocations.
- *
- * Inputs:
- * dataModule - enumerated module number
- *
- * Outputs:
- * Returns handle to data or NULL if not found
- *----------------------------------------------------------------------------
-*/
-EAS_VOID_PTR EAS_CMEnumOptData (EAS_INT dataModule);
-
-#endif /* end _EAS_CONFIG_H */
+ *
+ *----------------------------------------------------------------------------
+ * Revision Control:
+ * $Revision: 82 $
+ * $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
+ *----------------------------------------------------------------------------
+*/
+
+// sentinel
+#ifndef _EAS_CONFIG_H
+#define _EAS_CONFIG_H
+
+#include "eas_types.h"
+
+/* list of enumerators for optional modules */
+typedef enum {
+ EAS_CM_FILE_PARSERS = 1
+} E_CM_ENUM_MODULES;
+
+/* list of enumerators for module and memory pointers */
+typedef enum {
+ EAS_CM_EAS_DATA = 1,
+ EAS_CM_MIX_BUFFER,
+ EAS_CM_SYNTH_DATA,
+ EAS_CM_MIDI_DATA,
+ EAS_CM_SMF_DATA,
+ EAS_CM_XMF_DATA,
+ EAS_CM_SMAF_DATA,
+ EAS_CM_PCM_DATA,
+ EAS_CM_MIDI_STREAM_DATA,
+ EAS_CM_METRICS_DATA,
+ EAS_CM_OTA_DATA,
+ EAS_CM_IMELODY_DATA,
+ EAS_CM_RTTTL_DATA,
+ EAS_CM_WAVE_DATA,
+ EAS_CM_CMF_DATA
+} E_CM_DATA_MODULES;
+
+typedef struct
+{
+ int maxSMFStreams;
+ void *pSMFData;
+ void *pSMFStream;
+} S_EAS_SMF_PTRS;
+
+typedef struct
+{
+ int maxSMAFStreams;
+ void *pSMAFData;
+ void *pSMAFStream;
+} S_EAS_SMAF_PTRS;
+
+/*----------------------------------------------------------------------------
+ * EAS_CMStaticMemoryModel()
+ *----------------------------------------------------------------------------
+ * Purpose:
+ * This function returns true if EAS has been configured for
+ * a static memory model. There are some limitations in the
+ * static memory model, see the documentation for more
+ * information.
+ *
+ * Outputs:
+ * returns EAS_TRUE if a module is found
+ *----------------------------------------------------------------------------
+*/
+EAS_BOOL EAS_CMStaticMemoryModel (void);
+
+/*----------------------------------------------------------------------------
+ * EAS_CMEnumModules()
+ *----------------------------------------------------------------------------
+ * Purpose:
+ * This function is used to find pointers to optional modules.
+ *
+ * Inputs:
+ * module - module number
+ *
+ * Outputs:
+ * returns a pointer to the module function table or NULL if no module
+ *----------------------------------------------------------------------------
+*/
+EAS_VOID_PTR EAS_CMEnumModules (EAS_INT module);
+
+/*----------------------------------------------------------------------------
+ * EAS_CMEnumData()
+ *----------------------------------------------------------------------------
+ * Purpose:
+ * This function is used to find pointers to static memory allocations.
+ *
+ * Inputs:
+ * dataModule - enumerated module number
+ *
+ * Outputs:
+ * Returns handle to data or NULL if not found
+ *----------------------------------------------------------------------------
+*/
+EAS_VOID_PTR EAS_CMEnumData (EAS_INT dataModule);
+
+/*----------------------------------------------------------------------------
+ * EAS_CMEnumFXModules()
+ *----------------------------------------------------------------------------
+ * Purpose:
+ * This function is used to find pointers to optional effects modules.
+ *
+ * Inputs:
+ * module - enumerated module number
+ * pModule - pointer to module interface
+ *
+ * Outputs:
+ * Returns pointer to function table or NULL if not found
+ *----------------------------------------------------------------------------
+*/
+EAS_VOID_PTR EAS_CMEnumFXModules (EAS_INT module);
+
+/*----------------------------------------------------------------------------
+ * EAS_CMEnumFXData()
+ *----------------------------------------------------------------------------
+ * Purpose:
+ * This function is used to find pointers to static memory allocations.
+ *
+ * Inputs:
+ * dataModule - enumerated module number
+ * pData - pointer to handle variable
+ *
+ * Outputs:
+ * Returns handle to data or NULL if not found
+ *----------------------------------------------------------------------------
+*/
+EAS_VOID_PTR EAS_CMEnumFXData (EAS_INT dataModule);
+
+/*----------------------------------------------------------------------------
+ * EAS_CMEnumOptModules()
+ *----------------------------------------------------------------------------
+ * Purpose:
+ * This function is used to find pointers to optional modules.
+ *
+ * Inputs:
+ * module - enumerated module number
+ *
+ * Outputs:
+ * returns pointer to function table or NULL if no module
+ *----------------------------------------------------------------------------
+*/
+EAS_VOID_PTR EAS_CMEnumOptModules (EAS_INT module);
+
+/*----------------------------------------------------------------------------
+ * EAS_CMEnumOptData()
+ *----------------------------------------------------------------------------
+ * Purpose:
+ * This function is used to find pointers to static memory allocations.
+ *
+ * Inputs:
+ * dataModule - enumerated module number
+ *
+ * Outputs:
+ * Returns handle to data or NULL if not found
+ *----------------------------------------------------------------------------
+*/
+EAS_VOID_PTR EAS_CMEnumOptData (EAS_INT dataModule);
+
+#endif /* end _EAS_CONFIG_H */
diff --git a/arm-wt-22k/host_src/eas_host.h b/arm-wt-22k/host_src/eas_host.h
index 270e68c..8567432 100644
--- a/arm-wt-22k/host_src/eas_host.h
+++ b/arm-wt-22k/host_src/eas_host.h
@@ -1,16 +1,16 @@
-/*----------------------------------------------------------------------------
- *
- * File:
- * eas_host.h
- *
- * Contents and purpose:
- * This header defines the host wrapper functions for stdio, stdlib, etc.
- * The host application must provide an abstraction layer for these functions
- * to support certain features, such as SMAF and SMF-1 conversion.
- *
- * DO NOT MODIFY THIS FILE!
- *
- * Copyright 2005 Sonic Network Inc.
+/*----------------------------------------------------------------------------
+ *
+ * File:
+ * eas_host.h
+ *
+ * Contents and purpose:
+ * This header defines the host wrapper functions for stdio, stdlib, etc.
+ * The host application must provide an abstraction layer for these functions
+ * to support certain features, such as SMAF and SMF-1 conversion.
+ *
+ * DO NOT MODIFY THIS FILE!
+ *
+ * Copyright 2005 Sonic Network Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,65 +23,65 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
- *----------------------------------------------------------------------------
- * Revision Control:
- * $Revision: 82 $
- * $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
- *----------------------------------------------------------------------------
-*/
-
-// sentinel
-#ifndef _EAS_HOST_H
-#define _EAS_HOST_H
-
-#include "eas_types.h"
-
-/* for C++ linkage */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* initialization and shutdown routines */
-extern EAS_RESULT EAS_HWInit(EAS_HW_DATA_HANDLE *hwInstData);
-extern EAS_RESULT EAS_HWShutdown(EAS_HW_DATA_HANDLE hwInstData);
-
-/* threading */
-extern void* EAS_HWRegisterSignalHandler();
-extern EAS_RESULT EAS_HWUnRegisterSignalHandler(void *cookie);
-
-/* memory functions */
-extern void *EAS_HWMemSet(void *s, int c, EAS_I32 n);
-extern void *EAS_HWMemCpy(void *s1, const void *s2, EAS_I32 n);
-extern EAS_I32 EAS_HWMemCmp(const void *s1, const void *s2, EAS_I32 n);
-
-/* memory allocation */
-extern void *EAS_HWMalloc(EAS_HW_DATA_HANDLE hwInstData, EAS_I32 size);
-extern void EAS_HWFree(EAS_HW_DATA_HANDLE hwInstData, void *p);
-
-/* file I/O */
-extern EAS_RESULT EAS_HWOpenFile(EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_LOCATOR locator, EAS_FILE_HANDLE *pFile, EAS_FILE_MODE mode);
-extern EAS_RESULT EAS_HWReadFile(EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *pBuffer, EAS_I32 n, EAS_I32 *pBytesRead);
-extern EAS_RESULT EAS_HWGetByte(EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p);
-extern EAS_RESULT EAS_HWGetWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst);
-extern EAS_RESULT EAS_HWGetDWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst);
-extern EAS_RESULT EAS_HWFilePos (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pPosition);
-extern EAS_RESULT EAS_HWFileSeek (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position);
-extern EAS_RESULT EAS_HWFileSeekOfs (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position);
-extern EAS_RESULT EAS_HWFileLength (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pLength);
-extern EAS_RESULT EAS_HWDupHandle (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_FILE_HANDLE* pFile);
-extern EAS_RESULT EAS_HWCloseFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file);
-
-/* vibrate, LED, and backlight functions */
-extern EAS_RESULT EAS_HWVibrate(EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state);
-extern EAS_RESULT EAS_HWLED(EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state);
-extern EAS_RESULT EAS_HWBackLight(EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state);
-
-#ifdef __cplusplus
-} /* end extern "C" */
-#endif
-
-
-/* host yield function */
-extern EAS_BOOL EAS_HWYield(EAS_HW_DATA_HANDLE hwInstData);
-#endif /* end _EAS_HOST_H */
+ *
+ *----------------------------------------------------------------------------
+ * Revision Control:
+ * $Revision: 82 $
+ * $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
+ *----------------------------------------------------------------------------
+*/
+
+// sentinel
+#ifndef _EAS_HOST_H
+#define _EAS_HOST_H
+
+#include "eas_types.h"
+
+/* for C++ linkage */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* initialization and shutdown routines */
+extern EAS_RESULT EAS_HWInit(EAS_HW_DATA_HANDLE *hwInstData);
+extern EAS_RESULT EAS_HWShutdown(EAS_HW_DATA_HANDLE hwInstData);
+
+/* threading */
+extern void* EAS_HWRegisterSignalHandler();
+extern EAS_RESULT EAS_HWUnRegisterSignalHandler(void *cookie);
+
+/* memory functions */
+extern void *EAS_HWMemSet(void *s, int c, EAS_I32 n);
+extern void *EAS_HWMemCpy(void *s1, const void *s2, EAS_I32 n);
+extern EAS_I32 EAS_HWMemCmp(const void *s1, const void *s2, EAS_I32 n);
+
+/* memory allocation */
+extern void *EAS_HWMalloc(EAS_HW_DATA_HANDLE hwInstData, EAS_I32 size);
+extern void EAS_HWFree(EAS_HW_DATA_HANDLE hwInstData, void *p);
+
+/* file I/O */
+extern EAS_RESULT EAS_HWOpenFile(EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_LOCATOR locator, EAS_FILE_HANDLE *pFile, EAS_FILE_MODE mode);
+extern EAS_RESULT EAS_HWReadFile(EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *pBuffer, EAS_I32 n, EAS_I32 *pBytesRead);
+extern EAS_RESULT EAS_HWGetByte(EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p);
+extern EAS_RESULT EAS_HWGetWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst);
+extern EAS_RESULT EAS_HWGetDWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst);
+extern EAS_RESULT EAS_HWFilePos (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pPosition);
+extern EAS_RESULT EAS_HWFileSeek (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position);
+extern EAS_RESULT EAS_HWFileSeekOfs (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position);
+extern EAS_RESULT EAS_HWFileLength (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pLength);
+extern EAS_RESULT EAS_HWDupHandle (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_FILE_HANDLE* pFile);
+extern EAS_RESULT EAS_HWCloseFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file);
+
+/* vibrate, LED, and backlight functions */
+extern EAS_RESULT EAS_HWVibrate(EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state);
+extern EAS_RESULT EAS_HWLED(EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state);
+extern EAS_RESULT EAS_HWBackLight(EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state);
+
+#ifdef __cplusplus
+} /* end extern "C" */
+#endif
+
+
+/* host yield function */
+extern EAS_BOOL EAS_HWYield(EAS_HW_DATA_HANDLE hwInstData);
+#endif /* end _EAS_HOST_H */
diff --git a/arm-wt-22k/host_src/eas_hostmm.c b/arm-wt-22k/host_src/eas_hostmm.c
index d8eed8e..6732928 100644
--- a/arm-wt-22k/host_src/eas_hostmm.c
+++ b/arm-wt-22k/host_src/eas_hostmm.c
@@ -8,11 +8,11 @@
* This is a sample version that reads from a filedescriptor.
* The file locator (EAS_FILE_LOCATOR) handle passed to
* HWOpenFile is the same one that is passed to EAS_OpenFile.
- *
+ *
* Modify this file to suit the needs of your particular system.
*
* EAS_MAX_FILE_HANDLES sets the maximum number of MIDI streams within
- * a MIDI type 1 file that can be played.
+ * a MIDI type 1 file that can be played.
*
* EAS_HW_FILE is a structure to support the file I/O functions. It
* comprises the file descriptor, the file read pointer, and
@@ -73,8 +73,8 @@
// 100 max file handles == 3 * (nb tracks(32) + 1 for the segment) + 1 for jet file
// 3 == 1(playing segment) + 1(prepared segment)
// + 1(after end of playing segment, before files closed)
-#define EAS_MAX_FILE_HANDLES 100
-#endif
+#define EAS_MAX_FILE_HANDLES 100
+#endif
/*
* this structure and the related function are here
@@ -118,7 +118,7 @@ EAS_RESULT EAS_HWInit (EAS_HW_DATA_HANDLE *pHWInstData)
return EAS_ERROR_MALLOC_FAILED;
EAS_HWMemSet(*pHWInstData, 0, sizeof(EAS_HW_INST_DATA));
-
+
file = (*pHWInstData)->files;
for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
{
@@ -184,7 +184,7 @@ void EAS_HWFree (EAS_HW_DATA_HANDLE hwInstData, void *p)
*
*----------------------------------------------------------------------------
*/
-void *EAS_HWMemCpy (void *dest, const void *src, EAS_I32 amount)
+void *EAS_HWMemCpy (void *dest, const void *src, EAS_I32 amount)
{
if (amount < 0) {
EAS_ReportEx(_EAS_SEVERITY_NOFILTER, 0x1a54b6e8, 0x00000004 , amount);
@@ -201,7 +201,7 @@ void *EAS_HWMemCpy (void *dest, const void *src, EAS_I32 amount)
*
*----------------------------------------------------------------------------
*/
-void *EAS_HWMemSet (void *dest, int val, EAS_I32 amount)
+void *EAS_HWMemSet (void *dest, int val, EAS_I32 amount)
{
if (amount < 0) {
EAS_ReportEx(_EAS_SEVERITY_NOFILTER, 0x1a54b6e8, 0x00000005 , amount);
@@ -218,7 +218,7 @@ void *EAS_HWMemSet (void *dest, int val, EAS_I32 amount)
*
*----------------------------------------------------------------------------
*/
-EAS_I32 EAS_HWMemCmp (const void *s1, const void *s2, EAS_I32 amount)
+EAS_I32 EAS_HWMemCmp (const void *s1, const void *s2, EAS_I32 amount)
{
if (amount < 0) {
EAS_ReportEx(_EAS_SEVERITY_NOFILTER, 0x1a54b6e8, 0x00000006 , amount);
@@ -389,7 +389,7 @@ EAS_RESULT EAS_HWGetWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, v
*
* EAS_HWGetDWord
*
- * Returns the current location in the file
+ * Returns the current location in the file
*
*----------------------------------------------------------------------------
*/
@@ -422,7 +422,7 @@ EAS_RESULT EAS_HWGetDWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file,
*
* EAS_HWFilePos
*
- * Returns the current location in the file
+ * Returns the current location in the file
*
*----------------------------------------------------------------------------
*/
@@ -454,7 +454,7 @@ EAS_RESULT EAS_HWFileSeek (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file,
if (file->fd < 0)
return EAS_ERROR_INVALID_HANDLE;
- /* validate new position */
+ /* validate new position */
if ((position < 0) || (position > file->fileSize))
return EAS_ERROR_FILE_SEEK;
@@ -479,7 +479,7 @@ EAS_RESULT EAS_HWFileSeekOfs (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE fil
if (file->fd < 0)
return EAS_ERROR_INVALID_HANDLE;
- /* determine the file position */
+ /* determine the file position */
position += file->filePos;
if ((position < 0) || (position > file->fileSize))
return EAS_ERROR_FILE_SEEK;
diff --git a/arm-wt-22k/host_src/eas_main.c b/arm-wt-22k/host_src/eas_main.c
index fed600e..5cbf064 100644
--- a/arm-wt-22k/host_src/eas_main.c
+++ b/arm-wt-22k/host_src/eas_main.c
@@ -1,12 +1,12 @@
/*----------------------------------------------------------------------------
*
- * File:
+ * File:
* eas_main.c
*
* Contents and purpose:
* The entry point and high-level functions for the EAS Synthesizer test
* harness.
- *
+ *
* Copyright Sonic Network Inc. 2004
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -42,7 +42,7 @@
#include "eas_report.h"
/* determines how many EAS buffers to fill a host buffer */
-#define NUM_BUFFERS 8
+#define NUM_BUFFERS 8
/* default file to play if no filename is specified on the command line */
static const char defaultTestFile[] = "test.mid";
@@ -60,11 +60,11 @@ static EAS_BOOL EASLibraryCheck (const S_EAS_LIB_CONFIG *pLibConfig);
/*----------------------------------------------------------------------------
* PlayFile()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* This function plays the file requested by filename
- *
- * Inputs:
- *
+ *
+ * Inputs:
+ *
* Outputs:
*
*----------------------------------------------------------------------------
@@ -72,351 +72,351 @@ static EAS_BOOL EASLibraryCheck (const S_EAS_LIB_CONFIG *pLibConfig);
static EAS_RESULT PlayFile (EAS_DATA_HANDLE easData, const char* filename, const char* outputFile, const S_EAS_LIB_CONFIG *pLibConfig, void *buffer, EAS_I32 bufferSize)
{
- EAS_HANDLE handle;
- EAS_RESULT result, reportResult;
- EAS_I32 count;
- EAS_STATE state;
- EAS_I32 playTime;
- char waveFilename[256];
- WAVE_FILE *wFile;
- EAS_INT i;
- EAS_PCM *p;
- EAS_FILE file;
-
- /* determine the name of the output file */
- wFile = NULL;
- if (outputFile == NULL)
- {
- StrCopy(waveFilename, filename, sizeof(waveFilename));
- if (!ChangeFileExt(waveFilename, "wav", sizeof(waveFilename)))
- {
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "Error in output filename %s\n", waveFilename); */ }
- return EAS_FAILURE;
- }
- outputFile = waveFilename;
- }
-
- /* call EAS library to open file */
- file.path = filename;
- file.fd = 0;
- if ((reportResult = EAS_OpenFile(easData, &file, &handle)) != EAS_SUCCESS)
- {
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "EAS_OpenFile returned %ld\n", reportResult); */ }
- return reportResult;
- }
-
- /* prepare to play the file */
- if ((result = EAS_Prepare(easData, handle)) != EAS_SUCCESS)
- {
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "EAS_Prepare returned %ld\n", result); */ }
- reportResult = result;
- }
-
- /* get play length */
- if ((result = EAS_ParseMetaData(easData, handle, &playTime)) != EAS_SUCCESS)
- {
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "EAS_ParseMetaData returned %ld\n", result); */ }
- return result;
- }
- EAS_ReportEx(_EAS_SEVERITY_NOFILTER, 0xe624f4d9, 0x00000005 , playTime / 1000, playTime % 1000);
-
- if (reportResult == EAS_SUCCESS)
- {
- /* create the output file */
- wFile = WaveFileCreate(outputFile, pLibConfig->numChannels, pLibConfig->sampleRate, sizeof(EAS_PCM) * 8);
- if (!wFile)
- {
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "Unable to create output file %s\n", waveFilename); */ }
- reportResult = EAS_FAILURE;
- }
- }
-
- /* rendering loop */
- while (reportResult == EAS_SUCCESS)
- {
-
- /* we may render several buffers here to fill one host buffer */
- for (i = 0, p = buffer; i < NUM_BUFFERS; i++, p+= pLibConfig->mixBufferSize * pLibConfig->numChannels)
- {
-
- /* get the current time */
- if ((result = EAS_GetLocation(easData, handle, &playTime)) != EAS_SUCCESS)
- {
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "EAS_GetLocation returned %d\n",result); */ }
- if (reportResult == EAS_SUCCESS)
- reportResult = result;
- break;
- }
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_DETAIL, "Parser time: %d.%03d\n", playTime / 1000, playTime % 1000); */ }
-
- /* render a buffer of audio */
- if ((result = EAS_Render(easData, p, pLibConfig->mixBufferSize, &count)) != EAS_SUCCESS)
- {
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "EAS_Render returned %d\n",result); */ }
- if (reportResult == EAS_SUCCESS)
- reportResult = result;
- }
- }
-
- if (result == EAS_SUCCESS)
- {
- /* write it to the wave file */
- if (WaveFileWrite(wFile, buffer, bufferSize) != bufferSize)
- {
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "WaveFileWrite failed\n"); */ }
- reportResult = EAS_FAILURE;
- }
- }
-
- if (reportResult == EAS_SUCCESS)
- {
- /* check stream state */
- if ((result = EAS_State(easData, handle, &state)) != EAS_SUCCESS)
- {
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "EAS_State returned %d\n", result); */ }
- reportResult = result;
- }
-
- /* is playback complete */
- if ((state == EAS_STATE_STOPPED) || (state == EAS_STATE_ERROR))
- break;
- }
- }
-
- /* close the output file */
- if (wFile)
- {
- if (!WaveFileClose(wFile))
- {
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "Error closing wave file %s\n", waveFilename); */ }
- if (reportResult == EAS_SUCCESS)
- result = EAS_FAILURE;
- }
- }
-
- /* close the input file */
- if ((result = EAS_CloseFile(easData,handle)) != EAS_SUCCESS)
- {
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "EAS_Close returned %ld\n", result); */ }
- if (reportResult == EAS_SUCCESS)
- result = EAS_FAILURE;
- }
-
- return reportResult;
+ EAS_HANDLE handle;
+ EAS_RESULT result, reportResult;
+ EAS_I32 count;
+ EAS_STATE state;
+ EAS_I32 playTime;
+ char waveFilename[256];
+ WAVE_FILE *wFile;
+ EAS_INT i;
+ EAS_PCM *p;
+ EAS_FILE file;
+
+ /* determine the name of the output file */
+ wFile = NULL;
+ if (outputFile == NULL)
+ {
+ StrCopy(waveFilename, filename, sizeof(waveFilename));
+ if (!ChangeFileExt(waveFilename, "wav", sizeof(waveFilename)))
+ {
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "Error in output filename %s\n", waveFilename); */ }
+ return EAS_FAILURE;
+ }
+ outputFile = waveFilename;
+ }
+
+ /* call EAS library to open file */
+ file.path = filename;
+ file.fd = 0;
+ if ((reportResult = EAS_OpenFile(easData, &file, &handle)) != EAS_SUCCESS)
+ {
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "EAS_OpenFile returned %ld\n", reportResult); */ }
+ return reportResult;
+ }
+
+ /* prepare to play the file */
+ if ((result = EAS_Prepare(easData, handle)) != EAS_SUCCESS)
+ {
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "EAS_Prepare returned %ld\n", result); */ }
+ reportResult = result;
+ }
+
+ /* get play length */
+ if ((result = EAS_ParseMetaData(easData, handle, &playTime)) != EAS_SUCCESS)
+ {
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "EAS_ParseMetaData returned %ld\n", result); */ }
+ return result;
+ }
+ EAS_ReportEx(_EAS_SEVERITY_NOFILTER, 0xe624f4d9, 0x00000005 , playTime / 1000, playTime % 1000);
+
+ if (reportResult == EAS_SUCCESS)
+ {
+ /* create the output file */
+ wFile = WaveFileCreate(outputFile, pLibConfig->numChannels, pLibConfig->sampleRate, sizeof(EAS_PCM) * 8);
+ if (!wFile)
+ {
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "Unable to create output file %s\n", waveFilename); */ }
+ reportResult = EAS_FAILURE;
+ }
+ }
+
+ /* rendering loop */
+ while (reportResult == EAS_SUCCESS)
+ {
+
+ /* we may render several buffers here to fill one host buffer */
+ for (i = 0, p = buffer; i < NUM_BUFFERS; i++, p+= pLibConfig->mixBufferSize * pLibConfig->numChannels)
+ {
+
+ /* get the current time */
+ if ((result = EAS_GetLocation(easData, handle, &playTime)) != EAS_SUCCESS)
+ {
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "EAS_GetLocation returned %d\n",result); */ }
+ if (reportResult == EAS_SUCCESS)
+ reportResult = result;
+ break;
+ }
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_DETAIL, "Parser time: %d.%03d\n", playTime / 1000, playTime % 1000); */ }
+
+ /* render a buffer of audio */
+ if ((result = EAS_Render(easData, p, pLibConfig->mixBufferSize, &count)) != EAS_SUCCESS)
+ {
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "EAS_Render returned %d\n",result); */ }
+ if (reportResult == EAS_SUCCESS)
+ reportResult = result;
+ }
+ }
+
+ if (result == EAS_SUCCESS)
+ {
+ /* write it to the wave file */
+ if (WaveFileWrite(wFile, buffer, bufferSize) != bufferSize)
+ {
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "WaveFileWrite failed\n"); */ }
+ reportResult = EAS_FAILURE;
+ }
+ }
+
+ if (reportResult == EAS_SUCCESS)
+ {
+ /* check stream state */
+ if ((result = EAS_State(easData, handle, &state)) != EAS_SUCCESS)
+ {
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "EAS_State returned %d\n", result); */ }
+ reportResult = result;
+ }
+
+ /* is playback complete */
+ if ((state == EAS_STATE_STOPPED) || (state == EAS_STATE_ERROR))
+ break;
+ }
+ }
+
+ /* close the output file */
+ if (wFile)
+ {
+ if (!WaveFileClose(wFile))
+ {
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "Error closing wave file %s\n", waveFilename); */ }
+ if (reportResult == EAS_SUCCESS)
+ result = EAS_FAILURE;
+ }
+ }
+
+ /* close the input file */
+ if ((result = EAS_CloseFile(easData,handle)) != EAS_SUCCESS)
+ {
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "EAS_Close returned %ld\n", result); */ }
+ if (reportResult == EAS_SUCCESS)
+ result = EAS_FAILURE;
+ }
+
+ return reportResult;
} /* end PlayFile */
/*----------------------------------------------------------------------------
* main()
*----------------------------------------------------------------------------
* Purpose: The entry point for the EAS sample application
- *
- * Inputs:
- *
+ *
+ * Inputs:
+ *
* Outputs:
*
*----------------------------------------------------------------------------
*/
int main( int argc, char **argv )
{
- EAS_DATA_HANDLE easData;
- const S_EAS_LIB_CONFIG *pLibConfig;
- void *buffer;
- EAS_RESULT result, playResult;
- EAS_I32 bufferSize;
- int i;
- int temp;
- FILE *debugFile;
- char *outputFile = NULL;
-
- /* set the error reporting level */
- EAS_SetDebugLevel(_EAS_SEVERITY_INFO);
- debugFile = NULL;
-
- /* process command-line arguments */
- for (i = 1; i < argc; i++)
- {
- /* check for switch */
- if (argv[i][0] == '-')
- {
- switch (argv[i][1])
- {
- case 'd':
- temp = argv[i][2];
- if ((temp >= '0') || (temp <= '9'))
- EAS_SetDebugLevel(temp);
- else
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_WARNING, "Invalid debug level %d\n", temp); */ }
- break;
- case 'f':
- if ((debugFile = fopen(&argv[i][2],"w")) == NULL)
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_WARNING, "Unable to create debug file %s\n", &argv[i][2]); */ }
- else
- EAS_SetDebugFile(debugFile, EAS_TRUE);
- break;
- case 'o':
- outputFile = &argv[i][2];
- break;
- case 'p':
- polyphony = atoi(&argv[i][2]);
- if (polyphony < 1)
- polyphony = 1;
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "Polyphony set to %d\n", polyphony); */ }
- break;
- default:
- break;
- }
- continue;
- }
- }
-
- /* assume success */
- playResult = EAS_SUCCESS;
-
- /* get the library configuration */
- pLibConfig = EAS_Config();
- if (!EASLibraryCheck(pLibConfig))
- return -1;
- if (polyphony > pLibConfig->maxVoices)
- polyphony = pLibConfig->maxVoices;
-
- /* calculate buffer size */
- bufferSize = pLibConfig->mixBufferSize * pLibConfig->numChannels * (EAS_I32)sizeof(EAS_PCM) * NUM_BUFFERS;
-
- /* allocate output buffer memory */
- buffer = malloc((EAS_U32)bufferSize);
- if (!buffer)
- {
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_FATAL, "Error allocating memory for audio buffer\n"); */ }
- return EAS_FAILURE;
- }
-
- /* initialize the EAS library */
- polyphony = pLibConfig->maxVoices;
- if ((result = EAS_Init(&easData)) != EAS_SUCCESS)
- {
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_FATAL, "EAS_Init returned %ld - aborting!\n", result); */ }
- free(buffer);
- return result;
- }
-
- /*
- * Some debugging environments don't allow for passed parameters.
- * In this case, just play the default MIDI file "test.mid"
- */
- if (argc < 2)
- {
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "Playing '%s'\n", defaultTestFile); */ }
- if ((playResult = PlayFile(easData, defaultTestFile, NULL, pLibConfig, buffer, bufferSize)) != EAS_SUCCESS)
- {
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "Error %d playing file %s\n", playResult, defaultTestFile); */ }
- }
- }
- /* iterate through the list of files to be played */
- else
- {
- for (i = 1; i < argc; i++)
- {
- /* check for switch */
- if (argv[i][0] != '-')
- {
-
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "Playing '%s'\n", argv[i]); */ }
- if ((playResult = PlayFile(easData, argv[i], outputFile, pLibConfig, buffer, bufferSize)) != EAS_SUCCESS)
- {
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "Error %d playing file %s\n", playResult, argv[i]); */ }
- break;
- }
- }
- }
- }
-
- /* shutdown the EAS library */
- if ((result = EAS_Shutdown(easData)) != EAS_SUCCESS)
- {
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_FATAL, "EAS_Shutdown returned %ld\n", result); */ }
- }
-
- /* free the output buffer */
- free(buffer);
-
- /* close the debug file */
- if (debugFile)
- fclose(debugFile);
-
- /* play errors take precedence over shutdown errors */
- if (playResult != EAS_SUCCESS)
- return playResult;
- return result;
+ EAS_DATA_HANDLE easData;
+ const S_EAS_LIB_CONFIG *pLibConfig;
+ void *buffer;
+ EAS_RESULT result, playResult;
+ EAS_I32 bufferSize;
+ int i;
+ int temp;
+ FILE *debugFile;
+ char *outputFile = NULL;
+
+ /* set the error reporting level */
+ EAS_SetDebugLevel(_EAS_SEVERITY_INFO);
+ debugFile = NULL;
+
+ /* process command-line arguments */
+ for (i = 1; i < argc; i++)
+ {
+ /* check for switch */
+ if (argv[i][0] == '-')
+ {
+ switch (argv[i][1])
+ {
+ case 'd':
+ temp = argv[i][2];
+ if ((temp >= '0') || (temp <= '9'))
+ EAS_SetDebugLevel(temp);
+ else
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_WARNING, "Invalid debug level %d\n", temp); */ }
+ break;
+ case 'f':
+ if ((debugFile = fopen(&argv[i][2],"w")) == NULL)
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_WARNING, "Unable to create debug file %s\n", &argv[i][2]); */ }
+ else
+ EAS_SetDebugFile(debugFile, EAS_TRUE);
+ break;
+ case 'o':
+ outputFile = &argv[i][2];
+ break;
+ case 'p':
+ polyphony = atoi(&argv[i][2]);
+ if (polyphony < 1)
+ polyphony = 1;
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "Polyphony set to %d\n", polyphony); */ }
+ break;
+ default:
+ break;
+ }
+ continue;
+ }
+ }
+
+ /* assume success */
+ playResult = EAS_SUCCESS;
+
+ /* get the library configuration */
+ pLibConfig = EAS_Config();
+ if (!EASLibraryCheck(pLibConfig))
+ return -1;
+ if (polyphony > pLibConfig->maxVoices)
+ polyphony = pLibConfig->maxVoices;
+
+ /* calculate buffer size */
+ bufferSize = pLibConfig->mixBufferSize * pLibConfig->numChannels * (EAS_I32)sizeof(EAS_PCM) * NUM_BUFFERS;
+
+ /* allocate output buffer memory */
+ buffer = malloc((EAS_U32)bufferSize);
+ if (!buffer)
+ {
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_FATAL, "Error allocating memory for audio buffer\n"); */ }
+ return EAS_FAILURE;
+ }
+
+ /* initialize the EAS library */
+ polyphony = pLibConfig->maxVoices;
+ if ((result = EAS_Init(&easData)) != EAS_SUCCESS)
+ {
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_FATAL, "EAS_Init returned %ld - aborting!\n", result); */ }
+ free(buffer);
+ return result;
+ }
+
+ /*
+ * Some debugging environments don't allow for passed parameters.
+ * In this case, just play the default MIDI file "test.mid"
+ */
+ if (argc < 2)
+ {
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "Playing '%s'\n", defaultTestFile); */ }
+ if ((playResult = PlayFile(easData, defaultTestFile, NULL, pLibConfig, buffer, bufferSize)) != EAS_SUCCESS)
+ {
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "Error %d playing file %s\n", playResult, defaultTestFile); */ }
+ }
+ }
+ /* iterate through the list of files to be played */
+ else
+ {
+ for (i = 1; i < argc; i++)
+ {
+ /* check for switch */
+ if (argv[i][0] != '-')
+ {
+
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "Playing '%s'\n", argv[i]); */ }
+ if ((playResult = PlayFile(easData, argv[i], outputFile, pLibConfig, buffer, bufferSize)) != EAS_SUCCESS)
+ {
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "Error %d playing file %s\n", playResult, argv[i]); */ }
+ break;
+ }
+ }
+ }
+ }
+
+ /* shutdown the EAS library */
+ if ((result = EAS_Shutdown(easData)) != EAS_SUCCESS)
+ {
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_FATAL, "EAS_Shutdown returned %ld\n", result); */ }
+ }
+
+ /* free the output buffer */
+ free(buffer);
+
+ /* close the debug file */
+ if (debugFile)
+ fclose(debugFile);
+
+ /* play errors take precedence over shutdown errors */
+ if (playResult != EAS_SUCCESS)
+ return playResult;
+ return result;
} /* end main */
/*----------------------------------------------------------------------------
* StrCopy()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Safe string copy
- *
- * Inputs:
- *
+ *
+ * Inputs:
+ *
* Outputs:
*
*----------------------------------------------------------------------------
*/
static void StrCopy(char *dest, const char *src, EAS_I32 size)
{
- int len;
+ int len;
- strncpy(dest, src, (size_t) size-1);
- len = (int) strlen(src);
- if (len < size)
- dest[len] = 0;
+ strncpy(dest, src, (size_t) size-1);
+ len = (int) strlen(src);
+ if (len < size)
+ dest[len] = 0;
} /* end StrCopy */
/*----------------------------------------------------------------------------
* ChangeFileExt()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Changes the file extension of a filename
- *
- * Inputs:
- *
+ *
+ * Inputs:
+ *
* Outputs:
*
*----------------------------------------------------------------------------
*/
static EAS_BOOL ChangeFileExt(char *str, const char *ext, EAS_I32 size)
{
- char *p;
-
- /* find the extension, if any */
- p = strrchr(str,'.');
- if (!p)
- {
- if ((EAS_I32)(strlen(str) + 5) > size)
- return EAS_FALSE;
- strcat(str,".");
- strcat(str,ext);
- return EAS_TRUE;
- }
-
- /* make sure there's room for the extension */
- p++;
- *p = 0;
- if ((EAS_I32)(strlen(str) + 4) > size)
- return EAS_FALSE;
- strcat(str,ext);
- return EAS_TRUE;
+ char *p;
+
+ /* find the extension, if any */
+ p = strrchr(str,'.');
+ if (!p)
+ {
+ if ((EAS_I32)(strlen(str) + 5) > size)
+ return EAS_FALSE;
+ strcat(str,".");
+ strcat(str,ext);
+ return EAS_TRUE;
+ }
+
+ /* make sure there's room for the extension */
+ p++;
+ *p = 0;
+ if ((EAS_I32)(strlen(str) + 4) > size)
+ return EAS_FALSE;
+ strcat(str,ext);
+ return EAS_TRUE;
} /* end ChangeFileExt */
/*----------------------------------------------------------------------------
* EASLibraryCheck()
*----------------------------------------------------------------------------
- * Purpose:
+ * Purpose:
* Displays the library version and checks it against the header
* file used to build this code.
*
* Inputs:
- * pLibConfig - library configuration retrieved from the library
- *
+ * pLibConfig - library configuration retrieved from the library
+ *
* Outputs:
* returns EAS_TRUE if matched
*
@@ -427,38 +427,38 @@ static EAS_BOOL ChangeFileExt(char *str, const char *ext, EAS_I32 size)
static EAS_BOOL EASLibraryCheck (const S_EAS_LIB_CONFIG *pLibConfig)
{
- /* display the library version */
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "EAS Library Version %d.%d.%d.%d\n",
- pLibConfig->libVersion >> 24,
- (pLibConfig->libVersion >> 16) & 0x0f,
- (pLibConfig->libVersion >> 8) & 0x0f,
- pLibConfig->libVersion & 0x0f); */ }
-
- /* display some info about the library build */
- if (pLibConfig->checkedVersion)
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "\tChecked library\n"); */ }
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "\tMaximum polyphony: %d\n", pLibConfig->maxVoices); */ }
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "\tNumber of channels: %d\n", pLibConfig->numChannels); */ }
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "\tSample rate: %d\n", pLibConfig->sampleRate); */ }
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "\tMix buffer size: %d\n", pLibConfig->mixBufferSize); */ }
- if (pLibConfig->filterEnabled)
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "\tFilter enabled\n"); */ }
+ /* display the library version */
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "EAS Library Version %d.%d.%d.%d\n",
+ pLibConfig->libVersion >> 24,
+ (pLibConfig->libVersion >> 16) & 0x0f,
+ (pLibConfig->libVersion >> 8) & 0x0f,
+ pLibConfig->libVersion & 0x0f); */ }
+
+ /* display some info about the library build */
+ if (pLibConfig->checkedVersion)
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "\tChecked library\n"); */ }
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "\tMaximum polyphony: %d\n", pLibConfig->maxVoices); */ }
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "\tNumber of channels: %d\n", pLibConfig->numChannels); */ }
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "\tSample rate: %d\n", pLibConfig->sampleRate); */ }
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "\tMix buffer size: %d\n", pLibConfig->mixBufferSize); */ }
+ if (pLibConfig->filterEnabled)
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "\tFilter enabled\n"); */ }
#ifndef _WIN32_WCE
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "\tLibrary Build Timestamp: %s", ctime((time_t*)&pLibConfig->buildTimeStamp)); */ }
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "\tLibrary Build Timestamp: %s", ctime((time_t*)&pLibConfig->buildTimeStamp)); */ }
#endif
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "\tLibrary Build ID: %s\n", pLibConfig->buildGUID); */ }
-
- /* check it against the header file used to build this code */
- /*lint -e{778} constant expression used for display purposes may evaluate to zero */
- if (LIB_VERSION != pLibConfig->libVersion)
- {
- { /* dpp: EAS_ReportEx(_EAS_SEVERITY_FATAL, "Library version does not match header files. EAS Header Version %d.%d.%d.%d\n",
- LIB_VERSION >> 24,
- (LIB_VERSION >> 16) & 0x0f,
- (LIB_VERSION >> 8) & 0x0f,
- LIB_VERSION & 0x0f); */ }
- return EAS_FALSE;
- }
- return EAS_TRUE;
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "\tLibrary Build ID: %s\n", pLibConfig->buildGUID); */ }
+
+ /* check it against the header file used to build this code */
+ /*lint -e{778} constant expression used for display purposes may evaluate to zero */
+ if (LIB_VERSION != pLibConfig->libVersion)
+ {
+ { /* dpp: EAS_ReportEx(_EAS_SEVERITY_FATAL, "Library version does not match header files. EAS Header Version %d.%d.%d.%d\n",
+ LIB_VERSION >> 24,
+ (LIB_VERSION >> 16) & 0x0f,
+ (LIB_VERSION >> 8) & 0x0f,
+ LIB_VERSION & 0x0f); */ }
+ return EAS_FALSE;
+ }
+ return EAS_TRUE;
} /* end EASLibraryCheck */
diff --git a/arm-wt-22k/host_src/eas_report.c b/arm-wt-22k/host_src/eas_report.c
index d4dd22c..04a828c 100644
--- a/arm-wt-22k/host_src/eas_report.c
+++ b/arm-wt-22k/host_src/eas_report.c
@@ -1,13 +1,13 @@
-/*----------------------------------------------------------------------------
- *
- * File:
- * eas_report.c
- *
- * Contents and purpose:
- * This file contains the debug message handling routines for the EAS library.
- * These routines should be modified as needed for your system.
- *
- * Copyright 2005 Sonic Network Inc.
+/*----------------------------------------------------------------------------
+ *
+ * File:
+ * eas_report.c
+ *
+ * Contents and purpose:
+ * This file contains the debug message handling routines for the EAS library.
+ * These routines should be modified as needed for your system.
+ *
+ * Copyright 2005 Sonic Network Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,245 +20,245 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
- *----------------------------------------------------------------------------
- * Revision Control:
- * $Revision: 659 $
- * $Date: 2007-04-24 13:36:35 -0700 (Tue, 24 Apr 2007) $
- *----------------------------------------------------------------------------
-*/
-
-#ifdef _lint
-#include "lint_stdlib.h"
-#else
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#endif
-
-#include "eas_report.h"
-
-static int severityLevel = 9999;
-
-/* debug file */
-static FILE *debugFile = NULL;
-int flush = 0;
-
-#ifndef _NO_DEBUG_PREPROCESSOR
-
-/* structure should have an #include for each error message header file */
-S_DEBUG_MESSAGES debugMessages[] =
-{
-#ifndef UNIFIED_DEBUG_MESSAGES
-#include "eas_config_msgs.h"
-
-
-#include "eas_host_msgs.h"
-#include "eas_hostmm_msgs.h"
-#include "eas_math_msgs.h"
-#include "eas_midi_msgs.h"
-#include "eas_mixer_msgs.h"
-#include "eas_pcm_msgs.h"
-#include "eas_public_msgs.h"
-#include "eas_smf_msgs.h"
-#include "eas_wave_msgs.h"
-#include "eas_voicemgt_msgs.h"
-
-#ifdef _FM_SYNTH
-#include "eas_fmsynth_msgs.h"
-#include "eas_fmengine_msgs.h"
-#endif
-
-#ifdef _WT_SYNTH
-#include "eas_wtsynth_msgs.h"
-#include "eas_wtengine_msgs.h"
-#endif
-
-#ifdef _ARM_TEST_MAIN
-#include "arm_main_msgs.h"
-#endif
-
-#ifdef _EAS_MAIN
-#include "eas_main_msgs.h"
-#endif
-
-#ifdef _EAS_MAIN_IPC
-#include "eas_main_ipc_msgs.h"
-#endif
-
-#ifdef _METRICS_ENABLED
-#include "eas_perf_msgs.h"
-#endif
-
-#ifdef _COMPRESSOR_ENABLED
-#include "eas_compressor_msgs.h"
-#endif
-
-#ifdef _ENHANCER_ENABLED
-#include "eas_enhancer_msgs.h"
-#endif
-
-#ifdef _WOW_ENABLED
-#include "eas_wow_msgs.h"
-#endif
-
-#ifdef _SMAF_PARSER
-#include "eas_smaf_msgs.h"
-#endif
-
-#ifdef _OTA_PARSER
-#include "eas_ota_msgs.h"
-#endif
-
-#ifdef _IMELODY_PARSER
-#include "eas_imelody_msgs.h"
-#endif
-
-#ifdef _WAVE_PARSER
-#include "eas_wavefile_msgs.h"
-#endif
-
-#if defined(_CMX_PARSER) || defined(_MFI_PARSER)
-#include "eas_cmf_msgs.h"
-#endif
-
-#if defined(_CMX_PARSER) || defined(_MFI_PARSER) || defined(_WAVE_PARSER)
-#include "eas_imaadpcm_msgs.h"
-#endif
-
-#else
-#include "eas_debugmsgs.h"
-#endif
-
-/* denotes end of error messages */
-{ 0,0,0 }
-};
-
-/*----------------------------------------------------------------------------
- * EAS_ReportEx()
- *
- * This is the error message handler. The default handler outputs error
- * messages to stdout. Modify this as needed for your system.
- *----------------------------------------------------------------------------
-*/
-void EAS_ReportEx (int severity, unsigned long hashCode, int serialNum, ...)
-{
- va_list vargs;
- int i;
-
- /* check severity level */
- if (severity > severityLevel)
- return;
-
- /* find the error message and output to stdout */
- /*lint -e{661} we check for NULL pointer - no fence post error here */
- for (i = 0; debugMessages[i].m_pDebugMsg; i++)
- {
- if ((debugMessages[i].m_nHashCode == hashCode) &&
- (debugMessages[i].m_nSerialNum == serialNum))
- {
- /*lint -e{826} <allow variable args> */
- va_start(vargs, serialNum);
- if (debugFile)
- {
- vfprintf(debugFile, debugMessages[i].m_pDebugMsg, vargs);
- if (flush)
- fflush(debugFile);
- }
- else
- {
- vprintf(debugMessages[i].m_pDebugMsg, vargs);
- }
- va_end(vargs);
- return;
- }
- }
- printf("Unrecognized error: Severity=%d; HashCode=%lu; SerialNum=%d\n", severity, hashCode, serialNum);
-} /* end EAS_ReportEx */
-
-#else
-/*----------------------------------------------------------------------------
- * EAS_Report()
- *
- * This is the error message handler. The default handler outputs error
- * messages to stdout. Modify this as needed for your system.
- *----------------------------------------------------------------------------
-*/
-void EAS_Report (int severity, const char *fmt, ...)
-{
- va_list vargs;
-
- /* check severity level */
- if (severity > severityLevel)
- return;
-
- /*lint -e{826} <allow variable args> */
- va_start(vargs, fmt);
- if (debugFile)
- {
- vfprintf(debugFile, fmt, vargs);
- if (flush)
- fflush(debugFile);
- }
- else
- {
- vprintf(fmt, vargs);
- }
- va_end(vargs);
-} /* end EAS_Report */
-
-/*----------------------------------------------------------------------------
- * EAS_ReportX()
- *
- * This is the error message handler. The default handler outputs error
- * messages to stdout. Modify this as needed for your system.
- *----------------------------------------------------------------------------
-*/
-void EAS_ReportX (int severity, const char *fmt, ...)
-{
- va_list vargs;
-
- /* check severity level */
- if (severity > severityLevel)
- return;
-
- /*lint -e{826} <allow variable args> */
- va_start(vargs, fmt);
- if (debugFile)
- {
- vfprintf(debugFile, fmt, vargs);
- if (flush)
- fflush(debugFile);
- }
- else
- {
- vprintf(fmt, vargs);
- }
- va_end(vargs);
-} /* end EAS_ReportX */
-#endif
-
-/*----------------------------------------------------------------------------
- * EAS_SetDebugLevel()
- *
- * Sets the level for debug message output
- *----------------------------------------------------------------------------
-*/
-
-void EAS_SetDebugLevel (int severity)
-{
- severityLevel = severity;
-} /* end EAS_SetDebugLevel */
-
-/*----------------------------------------------------------------------------
- * EAS_SetDebugFile()
- *
- * Redirect debugger output to the specified file.
- *----------------------------------------------------------------------------
-*/
-void EAS_SetDebugFile (void *file, int flushAfterWrite)
-{
- debugFile = (FILE*) file;
- flush = flushAfterWrite;
-} /* end EAS_SetDebugFile */
-
+ *
+ *----------------------------------------------------------------------------
+ * Revision Control:
+ * $Revision: 659 $
+ * $Date: 2007-04-24 13:36:35 -0700 (Tue, 24 Apr 2007) $
+ *----------------------------------------------------------------------------
+*/
+
+#ifdef _lint
+#include "lint_stdlib.h"
+#else
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#endif
+
+#include "eas_report.h"
+
+static int severityLevel = 9999;
+
+/* debug file */
+static FILE *debugFile = NULL;
+int flush = 0;
+
+#ifndef _NO_DEBUG_PREPROCESSOR
+
+/* structure should have an #include for each error message header file */
+S_DEBUG_MESSAGES debugMessages[] =
+{
+#ifndef UNIFIED_DEBUG_MESSAGES
+#include "eas_config_msgs.h"
+
+
+#include "eas_host_msgs.h"
+#include "eas_hostmm_msgs.h"
+#include "eas_math_msgs.h"
+#include "eas_midi_msgs.h"
+#include "eas_mixer_msgs.h"
+#include "eas_pcm_msgs.h"
+#include "eas_public_msgs.h"
+#include "eas_smf_msgs.h"
+#include "eas_wave_msgs.h"
+#include "eas_voicemgt_msgs.h"
+
+#ifdef _FM_SYNTH
+#include "eas_fmsynth_msgs.h"
+#include "eas_fmengine_msgs.h"
+#endif
+
+#ifdef _WT_SYNTH
+#include "eas_wtsynth_msgs.h"
+#include "eas_wtengine_msgs.h"
+#endif
+
+#ifdef _ARM_TEST_MAIN
+#include "arm_main_msgs.h"
+#endif
+
+#ifdef _EAS_MAIN
+#include "eas_main_msgs.h"
+#endif
+
+#ifdef _EAS_MAIN_IPC
+#include "eas_main_ipc_msgs.h"
+#endif
+
+#ifdef _METRICS_ENABLED
+#include "eas_perf_msgs.h"
+#endif
+
+#ifdef _COMPRESSOR_ENABLED
+#include "eas_compressor_msgs.h"
+#endif
+
+#ifdef _ENHANCER_ENABLED
+#include "eas_enhancer_msgs.h"
+#endif
+
+#ifdef _WOW_ENABLED
+#include "eas_wow_msgs.h"
+#endif
+
+#ifdef _SMAF_PARSER
+#include "eas_smaf_msgs.h"
+#endif
+
+#ifdef _OTA_PARSER
+#include "eas_ota_msgs.h"
+#endif
+
+#ifdef _IMELODY_PARSER
+#include "eas_imelody_msgs.h"
+#endif
+
+#ifdef _WAVE_PARSER
+#include "eas_wavefile_msgs.h"
+#endif
+
+#if defined(_CMX_PARSER) || defined(_MFI_PARSER)
+#include "eas_cmf_msgs.h"
+#endif
+
+#if defined(_CMX_PARSER) || defined(_MFI_PARSER) || defined(_WAVE_PARSER)
+#include "eas_imaadpcm_msgs.h"
+#endif
+
+#else
+#include "eas_debugmsgs.h"
+#endif
+
+/* denotes end of error messages */
+{ 0,0,0 }
+};
+
+/*----------------------------------------------------------------------------
+ * EAS_ReportEx()
+ *
+ * This is the error message handler. The default handler outputs error
+ * messages to stdout. Modify this as needed for your system.
+ *----------------------------------------------------------------------------
+*/
+void EAS_ReportEx (int severity, unsigned long hashCode, int serialNum, ...)
+{
+ va_list vargs;
+ int i;
+
+ /* check severity level */
+ if (severity > severityLevel)
+ return;
+
+ /* find the error message and output to stdout */
+ /*lint -e{661} we check for NULL pointer - no fence post error here */
+ for (i = 0; debugMessages[i].m_pDebugMsg; i++)
+ {
+ if ((debugMessages[i].m_nHashCode == hashCode) &&
+ (debugMessages[i].m_nSerialNum == serialNum))
+ {
+ /*lint -e{826} <allow variable args> */
+ va_start(vargs, serialNum);
+ if (debugFile)
+ {
+ vfprintf(debugFile, debugMessages[i].m_pDebugMsg, vargs);
+ if (flush)
+ fflush(debugFile);
+ }
+ else
+ {
+ vprintf(debugMessages[i].m_pDebugMsg, vargs);
+ }
+ va_end(vargs);
+ return;
+ }
+ }
+ printf("Unrecognized error: Severity=%d; HashCode=%lu; SerialNum=%d\n", severity, hashCode, serialNum);
+} /* end EAS_ReportEx */
+
+#else
+/*----------------------------------------------------------------------------
+ * EAS_Report()
+ *
+ * This is the error message handler. The default handler outputs error
+ * messages to stdout. Modify this as needed for your system.
+ *----------------------------------------------------------------------------
+*/
+void EAS_Report (int severity, const char *fmt, ...)
+{
+ va_list vargs;
+
+ /* check severity level */
+ if (severity > severityLevel)
+ return;
+
+ /*lint -e{826} <allow variable args> */
+ va_start(vargs, fmt);
+ if (debugFile)
+ {
+ vfprintf(debugFile, fmt, vargs);
+ if (flush)
+ fflush(debugFile);
+ }
+ else
+ {
+ vprintf(fmt, vargs);
+ }
+ va_end(vargs);
+} /* end EAS_Report */
+
+/*----------------------------------------------------------------------------
+ * EAS_ReportX()
+ *
+ * This is the error message handler. The default handler outputs error
+ * messages to stdout. Modify this as needed for your system.
+ *----------------------------------------------------------------------------
+*/
+void EAS_ReportX (int severity, const char *fmt, ...)
+{
+ va_list vargs;
+
+ /* check severity level */
+ if (severity > severityLevel)
+ return;
+
+ /*lint -e{826} <allow variable args> */
+ va_start(vargs, fmt);
+ if (debugFile)
+ {
+ vfprintf(debugFile, fmt, vargs);
+ if (flush)
+ fflush(debugFile);
+ }
+ else
+ {
+ vprintf(fmt, vargs);
+ }
+ va_end(vargs);
+} /* end EAS_ReportX */
+#endif
+
+/*----------------------------------------------------------------------------
+ * EAS_SetDebugLevel()
+ *
+ * Sets the level for debug message output
+ *----------------------------------------------------------------------------
+*/
+
+void EAS_SetDebugLevel (int severity)
+{
+ severityLevel = severity;
+} /* end EAS_SetDebugLevel */
+
+/*----------------------------------------------------------------------------
+ * EAS_SetDebugFile()
+ *
+ * Redirect debugger output to the specified file.
+ *----------------------------------------------------------------------------
+*/
+void EAS_SetDebugFile (void *file, int flushAfterWrite)
+{
+ debugFile = (FILE*) file;
+ flush = flushAfterWrite;
+} /* end EAS_SetDebugFile */
+
diff --git a/arm-wt-22k/host_src/eas_report.h b/arm-wt-22k/host_src/eas_report.h
index 9d7c8e8..b603b12 100644
--- a/arm-wt-22k/host_src/eas_report.h
+++ b/arm-wt-22k/host_src/eas_report.h
@@ -1,15 +1,15 @@
-/*----------------------------------------------------------------------------
- *
- * File:
- * eas_report.h
- *
- * Contents and purpose:
- * This file contains the debug message handling routines for the EAS library.
- * These routines should be modified as needed for your system.
- *
- * DO NOT MODIFY THIS FILE!
- *
- * Copyright 2005 Sonic Network Inc.
+/*----------------------------------------------------------------------------
+ *
+ * File:
+ * eas_report.h
+ *
+ * Contents and purpose:
+ * This file contains the debug message handling routines for the EAS library.
+ * These routines should be modified as needed for your system.
+ *
+ * DO NOT MODIFY THIS FILE!
+ *
+ * Copyright 2005 Sonic Network Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,56 +22,56 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
- *----------------------------------------------------------------------------
- * Revision Control:
- * $Revision: 82 $
- * $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
- *----------------------------------------------------------------------------
-*/
-
-/* sentinel */
-#ifndef _EAS_REPORT_H
-#define _EAS_REPORT_H
-
-#define _EAS_SEVERITY_NOFILTER 0
-#define _EAS_SEVERITY_FATAL 1
-#define _EAS_SEVERITY_ERROR 2
-#define _EAS_SEVERITY_WARNING 3
-#define _EAS_SEVERITY_INFO 4
-#define _EAS_SEVERITY_DETAIL 5
-
-/* for C++ linkage */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _NO_DEBUG_PREPROCESSOR
-
-/* structure for included debug message header files */
-typedef struct
-{
- unsigned long m_nHashCode;
- int m_nSerialNum;
- char *m_pDebugMsg;
-} S_DEBUG_MESSAGES;
-
-/* debug message handling prototypes */
-extern void EAS_ReportEx (int severity, unsigned long hashCode, int serialNum, ...);
-
-#else
-
-/* these prototypes are used if the debug preprocessor is not used */
-extern void EAS_Report (int severity, const char* fmt, ...);
-extern void EAS_ReportX (int severity, const char* fmt, ...);
-
-#endif
-
-extern void EAS_SetDebugLevel (int severity);
-extern void EAS_SetDebugFile (void *file, int flushAfterWrite);
-
-#ifdef __cplusplus
-} /* end extern "C" */
-#endif
-
-#endif
+ *
+ *----------------------------------------------------------------------------
+ * Revision Control:
+ * $Revision: 82 $
+ * $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
+ *----------------------------------------------------------------------------
+*/
+
+/* sentinel */
+#ifndef _EAS_REPORT_H
+#define _EAS_REPORT_H
+
+#define _EAS_SEVERITY_NOFILTER 0
+#define _EAS_SEVERITY_FATAL 1
+#define _EAS_SEVERITY_ERROR 2
+#define _EAS_SEVERITY_WARNING 3
+#define _EAS_SEVERITY_INFO 4
+#define _EAS_SEVERITY_DETAIL 5
+
+/* for C++ linkage */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _NO_DEBUG_PREPROCESSOR
+
+/* structure for included debug message header files */
+typedef struct
+{
+ unsigned long m_nHashCode;
+ int m_nSerialNum;
+ char *m_pDebugMsg;
+} S_DEBUG_MESSAGES;
+
+/* debug message handling prototypes */
+extern void EAS_ReportEx (int severity, unsigned long hashCode, int serialNum, ...);
+
+#else
+
+/* these prototypes are used if the debug preprocessor is not used */
+extern void EAS_Report (int severity, const char* fmt, ...);
+extern void EAS_ReportX (int severity, const char* fmt, ...);
+
+#endif
+
+extern void EAS_SetDebugLevel (int severity);
+extern void EAS_SetDebugFile (void *file, int flushAfterWrite);
+
+#ifdef __cplusplus
+} /* end extern "C" */
+#endif
+
+#endif
diff --git a/arm-wt-22k/host_src/eas_reverb.h b/arm-wt-22k/host_src/eas_reverb.h
index a2535fb..559abed 100644
--- a/arm-wt-22k/host_src/eas_reverb.h
+++ b/arm-wt-22k/host_src/eas_reverb.h
@@ -1,13 +1,13 @@
-/*----------------------------------------------------------------------------
- *
- * File:
- * eas_reverb.h
- *
- * Contents and purpose:
- * Contains parameter enumerations for the Reverb effect
- *
- *
- * Copyright Sonic Network Inc. 2006
+/*----------------------------------------------------------------------------
+ *
+ * File:
+ * eas_reverb.h
+ *
+ * Contents and purpose:
+ * Contains parameter enumerations for the Reverb effect
+ *
+ *
+ * Copyright Sonic Network Inc. 2006
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,35 +20,35 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
- *----------------------------------------------------------------------------
- * Revision Control:
- * $Revision: 300 $
- * $Date: 2006-09-11 17:37:20 -0700 (Mon, 11 Sep 2006) $
- *----------------------------------------------------------------------------
-*/
-
-#ifndef _EAS_REVERB_H
-#define _EAS_REVERB_H
-
-
-/* enumerated parameter settings for Reverb effect */
-typedef enum
-{
- EAS_PARAM_REVERB_BYPASS,
- EAS_PARAM_REVERB_PRESET,
- EAS_PARAM_REVERB_WET,
- EAS_PARAM_REVERB_DRY
-} E_REVERB_PARAMS;
-
-
-typedef enum
-{
- EAS_PARAM_REVERB_LARGE_HALL,
- EAS_PARAM_REVERB_HALL,
- EAS_PARAM_REVERB_CHAMBER,
- EAS_PARAM_REVERB_ROOM,
-} E_REVERB_PRESETS;
-
-
-#endif /* _REVERB_H */
+ *
+ *----------------------------------------------------------------------------
+ * Revision Control:
+ * $Revision: 300 $
+ * $Date: 2006-09-11 17:37:20 -0700 (Mon, 11 Sep 2006) $
+ *----------------------------------------------------------------------------
+*/
+
+#ifndef _EAS_REVERB_H
+#define _EAS_REVERB_H
+
+
+/* enumerated parameter settings for Reverb effect */
+typedef enum
+{
+ EAS_PARAM_REVERB_BYPASS,
+ EAS_PARAM_REVERB_PRESET,
+ EAS_PARAM_REVERB_WET,
+ EAS_PARAM_REVERB_DRY
+} E_REVERB_PARAMS;
+
+
+typedef enum
+{
+ EAS_PARAM_REVERB_LARGE_HALL,
+ EAS_PARAM_REVERB_HALL,
+ EAS_PARAM_REVERB_CHAMBER,
+ EAS_PARAM_REVERB_ROOM,
+} E_REVERB_PRESETS;
+
+
+#endif /* _REVERB_H */
diff --git a/arm-wt-22k/host_src/eas_types.h b/arm-wt-22k/host_src/eas_types.h
index 5ba1e4e..d66a2b7 100644
--- a/arm-wt-22k/host_src/eas_types.h
+++ b/arm-wt-22k/host_src/eas_types.h
@@ -1,17 +1,17 @@
-/*----------------------------------------------------------------------------
- *
- * File:
- * eas_types.h
- *
- * Contents and purpose:
- * The public interface header for the EAS synthesizer.
- *
- * This header only contains declarations that are specific
- * to this implementation.
- *
- * DO NOT MODIFY THIS FILE!
- *
- * Copyright Sonic Network Inc. 2004
+/*----------------------------------------------------------------------------
+ *
+ * File:
+ * eas_types.h
+ *
+ * Contents and purpose:
+ * The public interface header for the EAS synthesizer.
+ *
+ * This header only contains declarations that are specific
+ * to this implementation.
+ *
+ * DO NOT MODIFY THIS FILE!
+ *
+ * Copyright Sonic Network Inc. 2004
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,250 +24,250 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
- *----------------------------------------------------------------------------
- * Revision Control:
- * $Revision: 726 $
- * $Date: 2007-06-14 23:10:46 -0700 (Thu, 14 Jun 2007) $
- *----------------------------------------------------------------------------
-*/
-
-#ifndef _EAS_TYPES_H
-#define _EAS_TYPES_H
-
-/* EAS_RESULT return codes */
-typedef long EAS_RESULT;
-#define EAS_SUCCESS 0
-#define EAS_FAILURE -1
-#define EAS_ERROR_INVALID_MODULE -2
-#define EAS_ERROR_MALLOC_FAILED -3
-#define EAS_ERROR_FILE_POS -4
-#define EAS_ERROR_INVALID_FILE_MODE -5
-#define EAS_ERROR_FILE_SEEK -6
-#define EAS_ERROR_FILE_LENGTH -7
-#define EAS_ERROR_NOT_IMPLEMENTED -8
-#define EAS_ERROR_CLOSE_FAILED -9
-#define EAS_ERROR_FILE_OPEN_FAILED -10
-#define EAS_ERROR_INVALID_HANDLE -11
-#define EAS_ERROR_NO_MIX_BUFFER -12
-#define EAS_ERROR_PARAMETER_RANGE -13
-#define EAS_ERROR_MAX_FILES_OPEN -14
-#define EAS_ERROR_UNRECOGNIZED_FORMAT -15
-#define EAS_BUFFER_SIZE_MISMATCH -16
-#define EAS_ERROR_FILE_FORMAT -17
-#define EAS_ERROR_SMF_NOT_INITIALIZED -18
-#define EAS_ERROR_LOCATE_BEYOND_END -19
-#define EAS_ERROR_INVALID_PCM_TYPE -20
-#define EAS_ERROR_MAX_PCM_STREAMS -21
-#define EAS_ERROR_NO_VOICE_ALLOCATED -22
-#define EAS_ERROR_INVALID_CHANNEL -23
-#define EAS_ERROR_ALREADY_STOPPED -24
-#define EAS_ERROR_FILE_READ_FAILED -25
-#define EAS_ERROR_HANDLE_INTEGRITY -26
-#define EAS_ERROR_MAX_STREAMS_OPEN -27
-#define EAS_ERROR_INVALID_PARAMETER -28
-#define EAS_ERROR_FEATURE_NOT_AVAILABLE -29
-#define EAS_ERROR_SOUND_LIBRARY -30
-#define EAS_ERROR_NOT_VALID_IN_THIS_STATE -31
-#define EAS_ERROR_NO_VIRTUAL_SYNTHESIZER -32
-#define EAS_ERROR_FILE_ALREADY_OPEN -33
-#define EAS_ERROR_FILE_ALREADY_CLOSED -34
-#define EAS_ERROR_INCOMPATIBLE_VERSION -35
-#define EAS_ERROR_QUEUE_IS_FULL -36
-#define EAS_ERROR_QUEUE_IS_EMPTY -37
-#define EAS_ERROR_FEATURE_ALREADY_ACTIVE -38
-
-/* special return codes */
-#define EAS_EOF 3
-#define EAS_STREAM_BUFFERING 4
-#define EAS_BUFFER_FULL 5
-
-/* EAS_STATE return codes */
-typedef long EAS_STATE;
-typedef enum
-{
- EAS_STATE_READY = 0,
- EAS_STATE_PLAY,
- EAS_STATE_STOPPING,
- EAS_STATE_PAUSING,
- EAS_STATE_STOPPED,
- EAS_STATE_PAUSED,
- EAS_STATE_OPEN,
- EAS_STATE_ERROR,
- EAS_STATE_EMPTY
-} E_EAS_STATE;
-
-/* constants */
-#ifndef EAS_CONST
-#define EAS_CONST const
-#endif
-
-/* definition for public interface functions */
-#ifndef EAS_PUBLIC
-#define EAS_PUBLIC
-#endif
-
-/* boolean values */
-typedef unsigned EAS_BOOL;
-typedef unsigned char EAS_BOOL8;
-
-#define EAS_FALSE 0
-#define EAS_TRUE 1
-
-/* scalar variable definitions */
-typedef unsigned char EAS_U8;
-typedef signed char EAS_I8;
-typedef char EAS_CHAR;
-
-typedef unsigned short EAS_U16;
-typedef short EAS_I16;
-
-typedef unsigned long EAS_U32;
-typedef long EAS_I32;
-
-typedef unsigned EAS_UINT;
-typedef int EAS_INT;
-typedef long EAS_LONG;
-
-/* audio output type */
-typedef short EAS_PCM;
-
-/* file open modes */
-typedef EAS_I32 EAS_FILE_MODE;
-#define EAS_FILE_READ 1
-#define EAS_FILE_WRITE 2
-
-/* file locator e.g. filename or memory pointer */
-typedef struct s_eas_file_tag {
- const char* path;
- int fd;
- long long offset;
- long long length;
-} EAS_FILE, *EAS_FILE_LOCATOR;
-
-/* handle to stream */
-typedef struct s_eas_stream_tag *EAS_HANDLE;
-
-/* handle to file */
-typedef struct eas_hw_file_tag *EAS_FILE_HANDLE;
-
-/* handle for synthesizer data */
-typedef struct s_eas_data_tag *EAS_DATA_HANDLE;
-
-/* handle to persistent data for host wrapper interface */
-typedef struct eas_hw_inst_data_tag *EAS_HW_DATA_HANDLE;
-
-/* handle to sound library */
-typedef struct s_eas_sndlib_tag *EAS_SNDLIB_HANDLE;
-typedef struct s_eas_dls_tag *EAS_DLSLIB_HANDLE;
-
-/* pointer to frame buffer - used in split architecture only */
-typedef struct s_eas_frame_buffer_tag *EAS_FRAME_BUFFER_HANDLE;
-
-/* untyped pointer for instance data */
-typedef void *EAS_VOID_PTR;
-
-/* inline functions */
-#ifndef EAS_INLINE
-#if defined (__XCC__)
-#define EAS_INLINE __inline__
-#elif defined (__GNUC__)
-#define EAS_INLINE inline static
-#else
-#define EAS_INLINE __inline
-#endif
-#endif
-
-/* define NULL value */
-#ifndef NULL
-#define NULL 0
-#endif
-
-/* metadata types for metadata return codes */
-typedef enum
-{
- EAS_METADATA_UNKNOWN = 0,
- EAS_METADATA_TITLE,
- EAS_METADATA_AUTHOR,
- EAS_METADATA_COPYRIGHT,
- EAS_METADATA_LYRIC,
- EAS_METADATA_TEXT
-} E_EAS_METADATA_TYPE;
-
-/* metadata callback function */
-typedef void (*EAS_METADATA_CBFUNC) (E_EAS_METADATA_TYPE metaDataType, char *metaDataBuf, EAS_VOID_PTR pUserData);
-
-/* file types for metadata return codes */
-typedef enum
-{
- EAS_FILE_UNKNOWN = 0,
- EAS_FILE_SMF0,
- EAS_FILE_SMF1,
- EAS_FILE_SMAF_UNKNOWN,
- EAS_FILE_SMAF_MA2,
- EAS_FILE_SMAF_MA3,
- EAS_FILE_SMAF_MA5,
- EAS_FILE_CMX,
- EAS_FILE_MFI,
- EAS_FILE_OTA,
- EAS_FILE_IMELODY,
- EAS_FILE_RTTTL,
- EAS_FILE_XMF0,
- EAS_FILE_XMF1,
- EAS_FILE_WAVE_PCM,
- EAS_FILE_WAVE_IMA_ADPCM,
- EAS_FILE_MMAPI_TONE_CONTROL
-} E_EAS_FILE_TYPE;
-
-/* enumeration for synthesizers */
-typedef enum
-{
- EAS_MCU_SYNTH = 0,
- EAS_DSP_SYNTH
-} E_SYNTHESIZER;
-
-/* external audio callback program change */
-typedef struct s_ext_audio_prg_chg_tag
-{
- EAS_U16 bank;
- EAS_U8 program;
- EAS_U8 channel;
-} S_EXT_AUDIO_PRG_CHG;
-
-/* external audio callback event */
-typedef struct s_ext_audio_event_tag
-{
- EAS_U8 channel;
- EAS_U8 note;
- EAS_U8 velocity;
- EAS_BOOL8 noteOn;
-} S_EXT_AUDIO_EVENT;
-
-typedef struct s_midi_controllers_tag
-{
- EAS_U8 modWheel; /* CC1 */
- EAS_U8 volume; /* CC7 */
- EAS_U8 pan; /* CC10 */
- EAS_U8 expression; /* CC11 */
- EAS_U8 channelPressure; /* MIDI channel pressure */
-
-#ifdef _REVERB
- EAS_U8 reverbSend; /* CC91 */
-#endif
-
-#ifdef _CHORUS
- EAS_U8 chorusSend; /* CC93 */
-#endif
-} S_MIDI_CONTROLLERS;
-
-/* iMode play modes enumeration for EAS_SetPlayMode */
-typedef enum
-{
- IMODE_PLAY_ALL = 0,
- IMODE_PLAY_PARTIAL
-} E_I_MODE_PLAY_MODE;
-
-typedef EAS_BOOL (*EAS_EXT_PRG_CHG_FUNC) (EAS_VOID_PTR pInstData, S_EXT_AUDIO_PRG_CHG *pPrgChg);
-typedef EAS_BOOL (*EAS_EXT_EVENT_FUNC) (EAS_VOID_PTR pInstData, S_EXT_AUDIO_EVENT *pEvent);
-
-#endif /* #ifndef _EAS_TYPES_H */
+ *
+ *----------------------------------------------------------------------------
+ * Revision Control:
+ * $Revision: 726 $
+ * $Date: 2007-06-14 23:10:46 -0700 (Thu, 14 Jun 2007) $
+ *----------------------------------------------------------------------------
+*/
+
+#ifndef _EAS_TYPES_H
+#define _EAS_TYPES_H
+
+/* EAS_RESULT return codes */
+typedef long EAS_RESULT;
+#define EAS_SUCCESS 0
+#define EAS_FAILURE -1
+#define EAS_ERROR_INVALID_MODULE -2
+#define EAS_ERROR_MALLOC_FAILED -3
+#define EAS_ERROR_FILE_POS -4
+#define EAS_ERROR_INVALID_FILE_MODE -5
+#define EAS_ERROR_FILE_SEEK -6
+#define EAS_ERROR_FILE_LENGTH -7
+#define EAS_ERROR_NOT_IMPLEMENTED -8
+#define EAS_ERROR_CLOSE_FAILED -9
+#define EAS_ERROR_FILE_OPEN_FAILED -10
+#define EAS_ERROR_INVALID_HANDLE -11
+#define EAS_ERROR_NO_MIX_BUFFER -12
+#define EAS_ERROR_PARAMETER_RANGE -13
+#define EAS_ERROR_MAX_FILES_OPEN -14
+#define EAS_ERROR_UNRECOGNIZED_FORMAT -15
+#define EAS_BUFFER_SIZE_MISMATCH -16
+#define EAS_ERROR_FILE_FORMAT -17
+#define EAS_ERROR_SMF_NOT_INITIALIZED -18
+#define EAS_ERROR_LOCATE_BEYOND_END -19
+#define EAS_ERROR_INVALID_PCM_TYPE -20
+#define EAS_ERROR_MAX_PCM_STREAMS -21
+#define EAS_ERROR_NO_VOICE_ALLOCATED -22
+#define EAS_ERROR_INVALID_CHANNEL -23
+#define EAS_ERROR_ALREADY_STOPPED -24
+#define EAS_ERROR_FILE_READ_FAILED -25
+#define EAS_ERROR_HANDLE_INTEGRITY -26
+#define EAS_ERROR_MAX_STREAMS_OPEN -27
+#define EAS_ERROR_INVALID_PARAMETER -28
+#define EAS_ERROR_FEATURE_NOT_AVAILABLE -29
+#define EAS_ERROR_SOUND_LIBRARY -30
+#define EAS_ERROR_NOT_VALID_IN_THIS_STATE -31
+#define EAS_ERROR_NO_VIRTUAL_SYNTHESIZER -32
+#define EAS_ERROR_FILE_ALREADY_OPEN -33
+#define EAS_ERROR_FILE_ALREADY_CLOSED -34
+#define EAS_ERROR_INCOMPATIBLE_VERSION -35
+#define EAS_ERROR_QUEUE_IS_FULL -36
+#define EAS_ERROR_QUEUE_IS_EMPTY -37
+#define EAS_ERROR_FEATURE_ALREADY_ACTIVE -38
+
+/* special return codes */
+#define EAS_EOF 3
+#define EAS_STREAM_BUFFERING 4
+#define EAS_BUFFER_FULL 5
+
+/* EAS_STATE return codes */
+typedef long EAS_STATE;
+typedef enum
+{
+ EAS_STATE_READY = 0,
+ EAS_STATE_PLAY,
+ EAS_STATE_STOPPING,
+ EAS_STATE_PAUSING,
+ EAS_STATE_STOPPED,
+ EAS_STATE_PAUSED,
+ EAS_STATE_OPEN,
+ EAS_STATE_ERROR,
+ EAS_STATE_EMPTY
+} E_EAS_STATE;
+
+/* constants */
+#ifndef EAS_CONST
+#define EAS_CONST const
+#endif
+
+/* definition for public interface functions */
+#ifndef EAS_PUBLIC
+#define EAS_PUBLIC
+#endif
+
+/* boolean values */
+typedef unsigned EAS_BOOL;
+typedef unsigned char EAS_BOOL8;
+
+#define EAS_FALSE 0
+#define EAS_TRUE 1
+
+/* scalar variable definitions */
+typedef unsigned char EAS_U8;
+typedef signed char EAS_I8;
+typedef char EAS_CHAR;
+
+typedef unsigned short EAS_U16;
+typedef short EAS_I16;
+
+typedef unsigned long EAS_U32;
+typedef long EAS_I32;
+
+typedef unsigned EAS_UINT;
+typedef int EAS_INT;
+typedef long EAS_LONG;
+
+/* audio output type */
+typedef short EAS_PCM;
+
+/* file open modes */
+typedef EAS_I32 EAS_FILE_MODE;
+#define EAS_FILE_READ 1
+#define EAS_FILE_WRITE 2
+
+/* file locator e.g. filename or memory pointer */
+typedef struct s_eas_file_tag {
+ const char* path;
+ int fd;
+ long long offset;
+ long long length;
+} EAS_FILE, *EAS_FILE_LOCATOR;
+
+/* handle to stream */
+typedef struct s_eas_stream_tag *EAS_HANDLE;
+
+/* handle to file */
+typedef struct eas_hw_file_tag *EAS_FILE_HANDLE;
+
+/* handle for synthesizer data */
+typedef struct s_eas_data_tag *EAS_DATA_HANDLE;
+
+/* handle to persistent data for host wrapper interface */
+typedef struct eas_hw_inst_data_tag *EAS_HW_DATA_HANDLE;
+
+/* handle to sound library */
+typedef struct s_eas_sndlib_tag *EAS_SNDLIB_HANDLE;
+typedef struct s_eas_dls_tag *EAS_DLSLIB_HANDLE;
+
+/* pointer to frame buffer - used in split architecture only */
+typedef struct s_eas_frame_buffer_tag *EAS_FRAME_BUFFER_HANDLE;
+
+/* untyped pointer for instance data */
+typedef void *EAS_VOID_PTR;
+
+/* inline functions */
+#ifndef EAS_INLINE
+#if defined (__XCC__)
+#define EAS_INLINE __inline__
+#elif defined (__GNUC__)
+#define EAS_INLINE inline static
+#else
+#define EAS_INLINE __inline
+#endif
+#endif
+
+/* define NULL value */
+#ifndef NULL
+#define NULL 0
+#endif
+
+/* metadata types for metadata return codes */
+typedef enum
+{
+ EAS_METADATA_UNKNOWN = 0,
+ EAS_METADATA_TITLE,
+ EAS_METADATA_AUTHOR,
+ EAS_METADATA_COPYRIGHT,
+ EAS_METADATA_LYRIC,
+ EAS_METADATA_TEXT
+} E_EAS_METADATA_TYPE;
+
+/* metadata callback function */
+typedef void (*EAS_METADATA_CBFUNC) (E_EAS_METADATA_TYPE metaDataType, char *metaDataBuf, EAS_VOID_PTR pUserData);
+
+/* file types for metadata return codes */
+typedef enum
+{
+ EAS_FILE_UNKNOWN = 0,
+ EAS_FILE_SMF0,
+ EAS_FILE_SMF1,
+ EAS_FILE_SMAF_UNKNOWN,
+ EAS_FILE_SMAF_MA2,
+ EAS_FILE_SMAF_MA3,
+ EAS_FILE_SMAF_MA5,
+ EAS_FILE_CMX,
+ EAS_FILE_MFI,
+ EAS_FILE_OTA,
+ EAS_FILE_IMELODY,
+ EAS_FILE_RTTTL,
+ EAS_FILE_XMF0,
+ EAS_FILE_XMF1,
+ EAS_FILE_WAVE_PCM,
+ EAS_FILE_WAVE_IMA_ADPCM,
+ EAS_FILE_MMAPI_TONE_CONTROL
+} E_EAS_FILE_TYPE;
+
+/* enumeration for synthesizers */
+typedef enum
+{
+ EAS_MCU_SYNTH = 0,
+ EAS_DSP_SYNTH
+} E_SYNTHESIZER;
+
+/* external audio callback program change */
+typedef struct s_ext_audio_prg_chg_tag
+{
+ EAS_U16 bank;
+ EAS_U8 program;
+ EAS_U8 channel;
+} S_EXT_AUDIO_PRG_CHG;
+
+/* external audio callback event */
+typedef struct s_ext_audio_event_tag
+{
+ EAS_U8 channel;
+ EAS_U8 note;
+ EAS_U8 velocity;
+ EAS_BOOL8 noteOn;
+} S_EXT_AUDIO_EVENT;
+
+typedef struct s_midi_controllers_tag
+{
+ EAS_U8 modWheel; /* CC1 */
+ EAS_U8 volume; /* CC7 */
+ EAS_U8 pan; /* CC10 */
+ EAS_U8 expression; /* CC11 */
+ EAS_U8 channelPressure; /* MIDI channel pressure */
+
+#ifdef _REVERB
+ EAS_U8 reverbSend; /* CC91 */
+#endif
+
+#ifdef _CHORUS
+ EAS_U8 chorusSend; /* CC93 */
+#endif
+} S_MIDI_CONTROLLERS;
+
+/* iMode play modes enumeration for EAS_SetPlayMode */
+typedef enum
+{
+ IMODE_PLAY_ALL = 0,
+ IMODE_PLAY_PARTIAL
+} E_I_MODE_PLAY_MODE;
+
+typedef EAS_BOOL (*EAS_EXT_PRG_CHG_FUNC) (EAS_VOID_PTR pInstData, S_EXT_AUDIO_PRG_CHG *pPrgChg);
+typedef EAS_BOOL (*EAS_EXT_EVENT_FUNC) (EAS_VOID_PTR pInstData, S_EXT_AUDIO_EVENT *pEvent);
+
+#endif /* #ifndef _EAS_TYPES_H */
diff --git a/arm-wt-22k/host_src/eas_wave.c b/arm-wt-22k/host_src/eas_wave.c
index 02fed6e..4f6ffbd 100644
--- a/arm-wt-22k/host_src/eas_wave.c
+++ b/arm-wt-22k/host_src/eas_wave.c
@@ -1,13 +1,13 @@
-/*----------------------------------------------------------------------------
- *
- * File:
- * eas_wave.c
- *
- * Contents and purpose:
- * This module contains .WAV file functions for the EAS synthesizer
- * test harness.
- *
- * Copyright Sonic Network Inc. 2005
+/*----------------------------------------------------------------------------
+ *
+ * File:
+ * eas_wave.c
+ *
+ * Contents and purpose:
+ * This module contains .WAV file functions for the EAS synthesizer
+ * test harness.
+ *
+ * Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,404 +20,404 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *----------------------------------------------------------------------------
- * Revision Control:
- * $Revision: 658 $
- * $Date: 2007-04-24 13:35:49 -0700 (Tue, 24 Apr 2007) $
- *----------------------------------------------------------------------------
-*/
-
-/* lint complaints about most C library headers, so we use our own during lint step */
-#ifdef _lint
-#include "lint_stdlib.h"
-#else
-#include <stdio.h>
-#include <stdlib.h>
-#endif
-
-#include "eas_wave.h"
-
-/* .WAV file format tags */
-const EAS_U32 riffTag = 0x46464952;
-const EAS_U32 waveTag = 0x45564157;
-const EAS_U32 fmtTag = 0x20746d66;
-const EAS_U32 dataTag = 0x61746164;
-
-#ifdef _BIG_ENDIAN
-/*----------------------------------------------------------------------------
- * FlipDWord()
- *----------------------------------------------------------------------------
- * Purpose: Endian flip a DWORD for big-endian processors
- *
- * Inputs:
- *
- * Outputs:
- *
- *----------------------------------------------------------------------------
-*/
-static void FlipDWord (EAS_U32 *pValue)
-{
- EAS_U8 *p;
- EAS_U32 temp;
-
- p = (EAS_U8*) pValue;
- temp = (((((p[3] << 8) | p[2]) << 8) | p[1]) << 8) | p[0];
- *pValue = temp;
-}
-
-/*----------------------------------------------------------------------------
- * FlipWord()
- *----------------------------------------------------------------------------
- * Purpose: Endian flip a WORD for big-endian processors
- *
- * Inputs:
- *
- * Outputs:
- *
- *----------------------------------------------------------------------------
-*/
-static void FlipWord (EAS_U16 *pValue)
-{
- EAS_U8 *p;
- EAS_U16 temp;
-
- p = (EAS_U8*) pValue;
- temp = (p[1] << 8) | p[0];
- *pValue = temp;
-}
-
-/*----------------------------------------------------------------------------
- * FlipWaveHeader()
- *----------------------------------------------------------------------------
- * Purpose: Endian flip the wave header for big-endian processors
- *
- * Inputs:
- *
- * Outputs:
- *
- *----------------------------------------------------------------------------
-*/
-static void FlipWaveHeader (WAVE_HEADER *p)
-{
-
- FlipDWord(&p->nRiffTag);
- FlipDWord(&p->nRiffSize);
- FlipDWord(&p->nWaveTag);
- FlipDWord(&p->nFmtTag);
- FlipDWord(&p->nFmtSize);
- FlipDWord(&p->nDataTag);
- FlipDWord(&p->nDataSize);
- FlipWord(&p->fc.wFormatTag);
- FlipWord(&p->fc.nChannels);
- FlipDWord(&p->fc.nSamplesPerSec);
- FlipDWord(&p->fc.nAvgBytesPerSec);
- FlipWord(&p->fc.nBlockAlign);
- FlipWord(&p->fc.wBitsPerSample);
-
-}
-#endif
-
-/*----------------------------------------------------------------------------
- * WaveFileCreate()
- *----------------------------------------------------------------------------
- * Purpose: Opens a wave file for writing and writes the header
- *
- * Inputs:
- *
- * Outputs:
- *
- *----------------------------------------------------------------------------
-*/
-
-WAVE_FILE *WaveFileCreate (const char *filename, EAS_I32 nChannels, EAS_I32 nSamplesPerSec, EAS_I32 wBitsPerSample)
-{
- WAVE_FILE *wFile;
-
- /* allocate memory */
- wFile = malloc(sizeof(WAVE_FILE));
- if (!wFile)
- return NULL;
- wFile->write = EAS_TRUE;
-
- /* create the file */
- wFile->file = fopen(filename,"wb");
- if (!wFile->file)
- {
- free(wFile);
- return NULL;
- }
-
- /* initialize PCM format .WAV file header */
- wFile->wh.nRiffTag = riffTag;
- wFile->wh.nRiffSize = sizeof(WAVE_HEADER) - 8;
- wFile->wh.nWaveTag = waveTag;
- wFile->wh.nFmtTag = fmtTag;
- wFile->wh.nFmtSize = sizeof(FMT_CHUNK);
-
- /* initalize 'fmt' chunk */
- wFile->wh.fc.wFormatTag = 1;
- wFile->wh.fc.nChannels = (EAS_U16) nChannels;
- wFile->wh.fc.nSamplesPerSec = (EAS_U32) nSamplesPerSec;
- wFile->wh.fc.wBitsPerSample = (EAS_U16) wBitsPerSample;
- wFile->wh.fc.nBlockAlign = (EAS_U16) (nChannels * (EAS_U16) (wBitsPerSample / 8));
- wFile->wh.fc.nAvgBytesPerSec = wFile->wh.fc.nBlockAlign * (EAS_U32) nSamplesPerSec;
-
- /* initialize 'data' chunk */
- wFile->wh.nDataTag = dataTag;
- wFile->wh.nDataSize = 0;
-
-#ifdef _BIG_ENDIAN
- FlipWaveHeader(&wFile->wh);
-#endif
-
- /* write the header */
- if (fwrite(&wFile->wh, sizeof(WAVE_HEADER), 1, wFile->file) != 1)
- {
- fclose(wFile->file);
- free(wFile);
- return NULL;
- }
-
-#ifdef _BIG_ENDIAN
- FlipWaveHeader(&wFile->wh);
-#endif
-
- /* return the file handle */
- return wFile;
-} /* end WaveFileCreate */
-
-/*----------------------------------------------------------------------------
- * WaveFileWrite()
- *----------------------------------------------------------------------------
- * Purpose: Writes data to the wave file
- *
- * Inputs:
- *
- * Outputs:
- *
- *----------------------------------------------------------------------------
-*/
-EAS_I32 WaveFileWrite (WAVE_FILE *wFile, void *buffer, EAS_I32 n)
-{
- EAS_I32 count;
-
- /* make sure we have an open file */
- if (wFile == NULL)
- {
- return 0;
- }
-
-#ifdef _BIG_ENDIAN
- {
- EAS_I32 i;
- EAS_U16 *p;
- p = buffer;
- i = n >> 1;
- while (i--)
- FlipWord(p++);
- }
-#endif
-
- /* write the data */
- count = (EAS_I32) fwrite(buffer, 1, (size_t) n, wFile->file);
-
- /* add the number of bytes written */
- wFile->wh.nRiffSize += (EAS_U32) count;
- wFile->wh.nDataSize += (EAS_U32) count;
-
- /* return the count of bytes written */
- return count;
-} /* end WriteWaveHeader */
-
-/*----------------------------------------------------------------------------
- * WaveFileClose()
- *----------------------------------------------------------------------------
- * Purpose: Opens a wave file for writing and writes the header
- *
- * Inputs:
- *
- * Outputs:
- *
- *----------------------------------------------------------------------------
-*/
-
-EAS_BOOL WaveFileClose (WAVE_FILE *wFile)
-{
- EAS_I32 count = 1;
-
- /* return to beginning of file and write the header */
- if (wFile->write)
- {
- if (fseek(wFile->file, 0L, SEEK_SET) == 0)
- {
-
-#ifdef _BIG_ENDIAN
- FlipWaveHeader(&wFile->wh);
-#endif
- count = (EAS_I32) fwrite(&wFile->wh, sizeof(WAVE_HEADER), 1, wFile->file);
-#ifdef _BIG_ENDIAN
- FlipWaveHeader(&wFile->wh);
-#endif
- }
- }
-
- /* close the file */
- if (fclose(wFile->file) != 0)
- count = 0;
-
- /* free the memory */
- free(wFile);
-
- /* return the file handle */
- return (count == 1 ? EAS_TRUE : EAS_FALSE);
-} /* end WaveFileClose */
-
-#ifdef _WAVE_FILE_READ
-#ifdef _BIG_ENDIAN
-#error "WaveFileOpen not currently supported on big-endian processors"
-#endif
-/*----------------------------------------------------------------------------
- * WaveFileOpen()
- *----------------------------------------------------------------------------
- * Purpose: Opens a wave file for reading and reads the header
- *
- * Inputs:
- *
- * Outputs:
- *
- *----------------------------------------------------------------------------
-*/
-
-WAVE_FILE *WaveFileOpen (const char *filename)
-{
- WAVE_FILE *wFile;
- struct
- {
- EAS_U32 tag;
- EAS_U32 size;
- } chunk;
- EAS_U32 tag;
- EAS_I32 startChunkPos;
- EAS_INT state;
- EAS_BOOL done;
-
- /* allocate memory */
- wFile = malloc(sizeof(WAVE_FILE));
- if (!wFile)
- return NULL;
-
- /* open the file */
- wFile->write = EAS_FALSE;
- wFile->file = fopen(filename,"rb");
- if (!wFile->file)
- {
- free(wFile);
- return NULL;
- }
-
- /* make lint happy */
- chunk.tag = chunk.size = 0;
- startChunkPos = 0;
-
- /* read the RIFF tag and file size */
- state = 0;
- done = EAS_FALSE;
- while (!done)
- {
-
- switch(state)
- {
- /* read the RIFF tag */
- case 0:
- if (fread(&chunk, sizeof(chunk), 1, wFile->file) != 1)
- done = EAS_TRUE;
- else
- {
- if (chunk.tag != riffTag)
- done = EAS_TRUE;
- else
- state++;
- }
- break;
-
- /* read the WAVE tag */
- case 1:
- if (fread(&tag, sizeof(tag), 1, wFile->file) != 1)
- done = EAS_TRUE;
- else
- {
- if (tag != waveTag)
- done = EAS_TRUE;
- else
- state++;
- }
- break;
-
- /* looking for fmt chunk */
- case 2:
- if (fread(&chunk, sizeof(chunk), 1, wFile->file) != 1)
- done = EAS_TRUE;
- else
- {
- startChunkPos = ftell(wFile->file);
-
- /* not fmt tag, skip it */
- if (chunk.tag != fmtTag)
- fseek(wFile->file, startChunkPos + (EAS_I32) chunk.size, SEEK_SET);
- else
- state++;
- }
- break;
-
- /* read fmt chunk */
- case 3:
- if (fread(&wFile->wh.fc, sizeof(FMT_CHUNK), 1, wFile->file) != 1)
- done = EAS_TRUE;
- else
- {
- fseek(wFile->file, startChunkPos + (EAS_I32) chunk.size, SEEK_SET);
- state++;
- }
- break;
-
- /* looking for data chunk */
- case 4:
- if (fread(&chunk, sizeof(chunk), 1, wFile->file) != 1)
- done = EAS_TRUE;
- else
- {
- startChunkPos = ftell(wFile->file);
-
- /* not data tag, skip it */
- if (chunk.tag != dataTag)
- fseek(wFile->file, startChunkPos + (EAS_I32) chunk.size, SEEK_SET);
- else
- {
- wFile->dataSize = chunk.size;
- state++;
- done = EAS_TRUE;
- }
- }
- break;
-
- default:
- done = EAS_TRUE;
- break;
- }
- }
-
- /* if not final state, an error occurred */
- if (state != 5)
- {
- fclose(wFile->file);
- free(wFile);
- return NULL;
- }
-
- /* return the file handle */
- return wFile;
-} /* end WaveFileOpen */
-#endif
-
-
-
+ *----------------------------------------------------------------------------
+ * Revision Control:
+ * $Revision: 658 $
+ * $Date: 2007-04-24 13:35:49 -0700 (Tue, 24 Apr 2007) $
+ *----------------------------------------------------------------------------
+*/
+
+/* lint complaints about most C library headers, so we use our own during lint step */
+#ifdef _lint
+#include "lint_stdlib.h"
+#else
+#include <stdio.h>
+#include <stdlib.h>
+#endif
+
+#include "eas_wave.h"
+
+/* .WAV file format tags */
+const EAS_U32 riffTag = 0x46464952;
+const EAS_U32 waveTag = 0x45564157;
+const EAS_U32 fmtTag = 0x20746d66;
+const EAS_U32 dataTag = 0x61746164;
+
+#ifdef _BIG_ENDIAN
+/*----------------------------------------------------------------------------
+ * FlipDWord()
+ *----------------------------------------------------------------------------
+ * Purpose: Endian flip a DWORD for big-endian processors
+ *
+ * Inputs:
+ *
+ * Outputs:
+ *
+ *----------------------------------------------------------------------------
+*/
+static void FlipDWord (EAS_U32 *pValue)
+{
+ EAS_U8 *p;
+ EAS_U32 temp;
+
+ p = (EAS_U8*) pValue;
+ temp = (((((p[3] << 8) | p[2]) << 8) | p[1]) << 8) | p[0];
+ *pValue = temp;
+}
+
+/*----------------------------------------------------------------------------
+ * FlipWord()
+ *----------------------------------------------------------------------------
+ * Purpose: Endian flip a WORD for big-endian processors
+ *
+ * Inputs:
+ *
+ * Outputs:
+ *
+ *----------------------------------------------------------------------------
+*/
+static void FlipWord (EAS_U16 *pValue)
+{
+ EAS_U8 *p;
+ EAS_U16 temp;
+
+ p = (EAS_U8*) pValue;
+ temp = (p[1] << 8) | p[0];
+ *pValue = temp;
+}
+
+/*----------------------------------------------------------------------------
+ * FlipWaveHeader()
+ *----------------------------------------------------------------------------
+ * Purpose: Endian flip the wave header for big-endian processors
+ *
+ * Inputs:
+ *
+ * Outputs:
+ *
+ *----------------------------------------------------------------------------
+*/
+static void FlipWaveHeader (WAVE_HEADER *p)
+{
+
+ FlipDWord(&p->nRiffTag);
+ FlipDWord(&p->nRiffSize);
+ FlipDWord(&p->nWaveTag);
+ FlipDWord(&p->nFmtTag);
+ FlipDWord(&p->nFmtSize);
+ FlipDWord(&p->nDataTag);
+ FlipDWord(&p->nDataSize);
+ FlipWord(&p->fc.wFormatTag);
+ FlipWord(&p->fc.nChannels);
+ FlipDWord(&p->fc.nSamplesPerSec);
+ FlipDWord(&p->fc.nAvgBytesPerSec);
+ FlipWord(&p->fc.nBlockAlign);
+ FlipWord(&p->fc.wBitsPerSample);
+
+}
+#endif
+
+/*----------------------------------------------------------------------------
+ * WaveFileCreate()
+ *----------------------------------------------------------------------------
+ * Purpose: Opens a wave file for writing and writes the header
+ *
+ * Inputs:
+ *
+ * Outputs:
+ *
+ *----------------------------------------------------------------------------
+*/
+
+WAVE_FILE *WaveFileCreate (const char *filename, EAS_I32 nChannels, EAS_I32 nSamplesPerSec, EAS_I32 wBitsPerSample)
+{
+ WAVE_FILE *wFile;
+
+ /* allocate memory */
+ wFile = malloc(sizeof(WAVE_FILE));
+ if (!wFile)
+ return NULL;
+ wFile->write = EAS_TRUE;
+
+ /* create the file */
+ wFile->file = fopen(filename,"wb");
+ if (!wFile->file)
+ {
+ free(wFile);
+ return NULL;
+ }
+
+ /* initialize PCM format .WAV file header */
+ wFile->wh.nRiffTag = riffTag;
+ wFile->wh.nRiffSize = sizeof(WAVE_HEADER) - 8;
+ wFile->wh.nWaveTag = waveTag;
+ wFile->wh.nFmtTag = fmtTag;
+ wFile->wh.nFmtSize = sizeof(FMT_CHUNK);
+
+ /* initalize 'fmt' chunk */
+ wFile->wh.fc.wFormatTag = 1;
+ wFile->wh.fc.nChannels = (EAS_U16) nChannels;
+ wFile->wh.fc.nSamplesPerSec = (EAS_U32) nSamplesPerSec;
+ wFile->wh.fc.wBitsPerSample = (EAS_U16) wBitsPerSample;
+ wFile->wh.fc.nBlockAlign = (EAS_U16) (nChannels * (EAS_U16) (wBitsPerSample / 8));
+ wFile->wh.fc.nAvgBytesPerSec = wFile->wh.fc.nBlockAlign * (EAS_U32) nSamplesPerSec;
+
+ /* initialize 'data' chunk */
+ wFile->wh.nDataTag = dataTag;
+ wFile->wh.nDataSize = 0;
+
+#ifdef _BIG_ENDIAN
+ FlipWaveHeader(&wFile->wh);
+#endif
+
+ /* write the header */
+ if (fwrite(&wFile->wh, sizeof(WAVE_HEADER), 1, wFile->file) != 1)
+ {
+ fclose(wFile->file);
+ free(wFile);
+ return NULL;
+ }
+
+#ifdef _BIG_ENDIAN
+ FlipWaveHeader(&wFile->wh);
+#endif
+
+ /* return the file handle */
+ return wFile;
+} /* end WaveFileCreate */
+
+/*----------------------------------------------------------------------------
+ * WaveFileWrite()
+ *----------------------------------------------------------------------------
+ * Purpose: Writes data to the wave file
+ *
+ * Inputs:
+ *
+ * Outputs:
+ *
+ *----------------------------------------------------------------------------
+*/
+EAS_I32 WaveFileWrite (WAVE_FILE *wFile, void *buffer, EAS_I32 n)
+{
+ EAS_I32 count;
+
+ /* make sure we have an open file */
+ if (wFile == NULL)
+ {
+ return 0;
+ }
+
+#ifdef _BIG_ENDIAN
+ {
+ EAS_I32 i;
+ EAS_U16 *p;
+ p = buffer;
+ i = n >> 1;
+ while (i--)
+ FlipWord(p++);
+ }
+#endif
+
+ /* write the data */
+ count = (EAS_I32) fwrite(buffer, 1, (size_t) n, wFile->file);
+
+ /* add the number of bytes written */
+ wFile->wh.nRiffSize += (EAS_U32) count;
+ wFile->wh.nDataSize += (EAS_U32) count;
+
+ /* return the count of bytes written */
+ return count;
+} /* end WriteWaveHeader */
+
+/*----------------------------------------------------------------------------
+ * WaveFileClose()
+ *----------------------------------------------------------------------------
+ * Purpose: Opens a wave file for writing and writes the header
+ *
+ * Inputs:
+ *
+ * Outputs:
+ *
+ *----------------------------------------------------------------------------
+*/
+
+EAS_BOOL WaveFileClose (WAVE_FILE *wFile)
+{
+ EAS_I32 count = 1;
+
+ /* return to beginning of file and write the header */
+ if (wFile->write)
+ {
+ if (fseek(wFile->file, 0L, SEEK_SET) == 0)
+ {
+
+#ifdef _BIG_ENDIAN
+ FlipWaveHeader(&wFile->wh);
+#endif
+ count = (EAS_I32) fwrite(&wFile->wh, sizeof(WAVE_HEADER), 1, wFile->file);
+#ifdef _BIG_ENDIAN
+ FlipWaveHeader(&wFile->wh);
+#endif
+ }
+ }
+
+ /* close the file */
+ if (fclose(wFile->file) != 0)
+ count = 0;
+
+ /* free the memory */
+ free(wFile);
+
+ /* return the file handle */
+ return (count == 1 ? EAS_TRUE : EAS_FALSE);
+} /* end WaveFileClose */
+
+#ifdef _WAVE_FILE_READ
+#ifdef _BIG_ENDIAN
+#error "WaveFileOpen not currently supported on big-endian processors"
+#endif
+/*----------------------------------------------------------------------------
+ * WaveFileOpen()
+ *----------------------------------------------------------------------------
+ * Purpose: Opens a wave file for reading and reads the header
+ *
+ * Inputs:
+ *
+ * Outputs:
+ *
+ *----------------------------------------------------------------------------
+*/
+
+WAVE_FILE *WaveFileOpen (const char *filename)
+{
+ WAVE_FILE *wFile;
+ struct
+ {
+ EAS_U32 tag;
+ EAS_U32 size;
+ } chunk;
+ EAS_U32 tag;
+ EAS_I32 startChunkPos;
+ EAS_INT state;
+ EAS_BOOL done;
+
+ /* allocate memory */
+ wFile = malloc(sizeof(WAVE_FILE));
+ if (!wFile)
+ return NULL;
+
+ /* open the file */
+ wFile->write = EAS_FALSE;
+ wFile->file = fopen(filename,"rb");
+ if (!wFile->file)
+ {
+ free(wFile);
+ return NULL;
+ }
+
+ /* make lint happy */
+ chunk.tag = chunk.size = 0;
+ startChunkPos = 0;
+
+ /* read the RIFF tag and file size */
+ state = 0;
+ done = EAS_FALSE;
+ while (!done)
+ {
+
+ switch(state)
+ {
+ /* read the RIFF tag */
+ case 0:
+ if (fread(&chunk, sizeof(chunk), 1, wFile->file) != 1)
+ done = EAS_TRUE;
+ else
+ {
+ if (chunk.tag != riffTag)
+ done = EAS_TRUE;
+ else
+ state++;
+ }
+ break;
+
+ /* read the WAVE tag */
+ case 1:
+ if (fread(&tag, sizeof(tag), 1, wFile->file) != 1)
+ done = EAS_TRUE;
+ else
+ {
+ if (tag != waveTag)
+ done = EAS_TRUE;
+ else
+ state++;
+ }
+ break;
+
+ /* looking for fmt chunk */
+ case 2:
+ if (fread(&chunk, sizeof(chunk), 1, wFile->file) != 1)
+ done = EAS_TRUE;
+ else
+ {
+ startChunkPos = ftell(wFile->file);
+
+ /* not fmt tag, skip it */
+ if (chunk.tag != fmtTag)
+ fseek(wFile->file, startChunkPos + (EAS_I32) chunk.size, SEEK_SET);
+ else
+ state++;
+ }
+ break;
+
+ /* read fmt chunk */
+ case 3:
+ if (fread(&wFile->wh.fc, sizeof(FMT_CHUNK), 1, wFile->file) != 1)
+ done = EAS_TRUE;
+ else
+ {
+ fseek(wFile->file, startChunkPos + (EAS_I32) chunk.size, SEEK_SET);
+ state++;
+ }
+ break;
+
+ /* looking for data chunk */
+ case 4:
+ if (fread(&chunk, sizeof(chunk), 1, wFile->file) != 1)
+ done = EAS_TRUE;
+ else
+ {
+ startChunkPos = ftell(wFile->file);
+
+ /* not data tag, skip it */
+ if (chunk.tag != dataTag)
+ fseek(wFile->file, startChunkPos + (EAS_I32) chunk.size, SEEK_SET);
+ else
+ {
+ wFile->dataSize = chunk.size;
+ state++;
+ done = EAS_TRUE;
+ }
+ }
+ break;
+
+ default:
+ done = EAS_TRUE;
+ break;
+ }
+ }
+
+ /* if not final state, an error occurred */
+ if (state != 5)
+ {
+ fclose(wFile->file);
+ free(wFile);
+ return NULL;
+ }
+
+ /* return the file handle */
+ return wFile;
+} /* end WaveFileOpen */
+#endif
+
+
+
diff --git a/arm-wt-22k/host_src/eas_wave.h b/arm-wt-22k/host_src/eas_wave.h
index ca388f5..968782f 100644
--- a/arm-wt-22k/host_src/eas_wave.h
+++ b/arm-wt-22k/host_src/eas_wave.h
@@ -1,14 +1,14 @@
-/*----------------------------------------------------------------------------
- *
- * File:
- * eas_wave.h
- *
- * Contents and purpose:
- * Writes output to a .WAV file
- *
- * DO NOT MODIFY THIS FILE!
- *
- * Copyright Sonic Network Inc. 2005
+/*----------------------------------------------------------------------------
+ *
+ * File:
+ * eas_wave.h
+ *
+ * Contents and purpose:
+ * Writes output to a .WAV file
+ *
+ * DO NOT MODIFY THIS FILE!
+ *
+ * Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,54 +21,54 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *----------------------------------------------------------------------------
- * Revision Control:
- * $Revision: 82 $
- * $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
- *----------------------------------------------------------------------------
-*/
-
-#include "eas_types.h"
-
-/* sentinel */
-#ifndef _EAS_WAVE_H
-#define _EAS_WAVE_H
-
-/* .WAV file format chunk */
-typedef struct {
- EAS_U16 wFormatTag;
- EAS_U16 nChannels;
- EAS_U32 nSamplesPerSec;
- EAS_U32 nAvgBytesPerSec;
- EAS_U16 nBlockAlign;
- EAS_U16 wBitsPerSample;
-} FMT_CHUNK;
-
-/* .WAV file header */
-typedef struct {
- EAS_U32 nRiffTag;
- EAS_U32 nRiffSize;
- EAS_U32 nWaveTag;
- EAS_U32 nFmtTag;
- EAS_U32 nFmtSize;
- FMT_CHUNK fc;
- EAS_U32 nDataTag;
- EAS_U32 nDataSize;
-} WAVE_HEADER;
-
-typedef struct {
- WAVE_HEADER wh;
- FILE *file;
- EAS_BOOL write;
- EAS_U32 dataSize;
-} WAVE_FILE;
-
-WAVE_FILE *WaveFileCreate (const char *filename, EAS_I32 nChannels, EAS_I32 nSamplesPerSec, EAS_I32 wBitsPerSample);
-EAS_I32 WaveFileWrite (WAVE_FILE *wFile, void *buffer, EAS_I32 n);
-EAS_BOOL WaveFileClose (WAVE_FILE *wFile);
-WAVE_FILE *WaveFileOpen (const char *filename);
-
-#endif /* end #ifndef _EAS_WAVE_H */
-
-
-
+ *----------------------------------------------------------------------------
+ * Revision Control:
+ * $Revision: 82 $
+ * $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
+ *----------------------------------------------------------------------------
+*/
+
+#include "eas_types.h"
+
+/* sentinel */
+#ifndef _EAS_WAVE_H
+#define _EAS_WAVE_H
+
+/* .WAV file format chunk */
+typedef struct {
+ EAS_U16 wFormatTag;
+ EAS_U16 nChannels;
+ EAS_U32 nSamplesPerSec;
+ EAS_U32 nAvgBytesPerSec;
+ EAS_U16 nBlockAlign;
+ EAS_U16 wBitsPerSample;
+} FMT_CHUNK;
+
+/* .WAV file header */
+typedef struct {
+ EAS_U32 nRiffTag;
+ EAS_U32 nRiffSize;
+ EAS_U32 nWaveTag;
+ EAS_U32 nFmtTag;
+ EAS_U32 nFmtSize;
+ FMT_CHUNK fc;
+ EAS_U32 nDataTag;
+ EAS_U32 nDataSize;
+} WAVE_HEADER;
+
+typedef struct {
+ WAVE_HEADER wh;
+ FILE *file;
+ EAS_BOOL write;
+ EAS_U32 dataSize;
+} WAVE_FILE;
+
+WAVE_FILE *WaveFileCreate (const char *filename, EAS_I32 nChannels, EAS_I32 nSamplesPerSec, EAS_I32 wBitsPerSample);
+EAS_I32 WaveFileWrite (WAVE_FILE *wFile, void *buffer, EAS_I32 n);
+EAS_BOOL WaveFileClose (WAVE_FILE *wFile);
+WAVE_FILE *WaveFileOpen (const char *filename);
+
+#endif /* end #ifndef _EAS_WAVE_H */
+
+
+
diff --git a/arm-wt-22k/host_src/jet.h b/arm-wt-22k/host_src/jet.h
index 35bdb6d..2e97a13 100644
--- a/arm-wt-22k/host_src/jet.h
+++ b/arm-wt-22k/host_src/jet.h
@@ -1,199 +1,199 @@
-/*----------------------------------------------------------------------------
- *
- * File:
- * jet.h
- *
- * Contents and purpose:
- * Public interface for JET sound engine
- *
- * Copyright (c) 2006 Sonic Network Inc.
-
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *----------------------------------------------------------------------------
- * Revision Control:
- * $Revision: 554 $
- * $Date: 2007-02-02 11:06:10 -0800 (Fri, 02 Feb 2007) $
- *----------------------------------------------------------------------------
-*/
-
-#ifndef _JET_H
-#define _JET_H
-
-#include "eas_types.h"
-#include "eas.h"
-
-/* for C++ linkage */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* opaque handle types for JET interface */
-typedef struct s_jet_data_tag *JET_DATA_HANDLE;
-
-typedef struct s_jet_config_tag
-{
- EAS_U8 appEventRangeLow;
- EAS_U8 appEventRangeHigh;
-} S_JET_CONFIG;
-
-typedef struct s_jet_status_tag
-{
- EAS_INT currentUserID;
- EAS_INT segmentRepeatCount;
- EAS_INT numQueuedSegments;
- EAS_BOOL paused;
- EAS_I32 location;
- EAS_U8 currentPlayingSegment;
- EAS_U8 currentQueuedSegment;
-} S_JET_STATUS;
-
-typedef struct s_jet_event_tag
-{
- EAS_U8 segment;
- EAS_U8 channel;
- EAS_U8 track;
- EAS_U8 controller;
- EAS_U8 value;
-} S_JET_EVENT;
-
-/*----------------------------------------------------------------------------
- * JET_Init()
- *----------------------------------------------------------------------------
- * Initializes the JET library, allocates memory, etc. Call
- * JET_Shutdown to de-allocate memory. Pass NULL for pConfig
- * to use defaults. If passing config data, configSize should be
- * sizeof(S_JET_CONFIG). This allows for future expansion of the
- * config structure while maintaining compatibility.
- *----------------------------------------------------------------------------
-*/
-EAS_PUBLIC EAS_RESULT JET_Init (EAS_DATA_HANDLE easHandle, const S_JET_CONFIG *pConfig, EAS_INT configSize);
-
-/*----------------------------------------------------------------------------
- * JET_Shutdown()
- *----------------------------------------------------------------------------
- * Frees any memory used by the JET library
- *----------------------------------------------------------------------------
-*/
-EAS_PUBLIC EAS_RESULT JET_Shutdown (EAS_DATA_HANDLE easHandle);
-
-/*----------------------------------------------------------------------------
- * JET_OpenFile()
- *----------------------------------------------------------------------------
- * Opens a JET content file for playback
- *----------------------------------------------------------------------------
-*/
-EAS_PUBLIC EAS_RESULT JET_OpenFile (EAS_DATA_HANDLE easHandle, EAS_FILE_LOCATOR locator);
-
-/*----------------------------------------------------------------------------
- * JET_GetAppData()
- *----------------------------------------------------------------------------
- * Returns location and size of application data in the JET file
- *----------------------------------------------------------------------------
-*/
-EAS_RESULT JET_GetAppData (EAS_DATA_HANDLE easHandle, EAS_I32 *pAppDataOffset, EAS_I32 *pAppDataSize);
-
-/*----------------------------------------------------------------------------
- * JET_CloseFile()
- *----------------------------------------------------------------------------
- * Closes a JET content file and releases associated resources
- *----------------------------------------------------------------------------
-*/
-EAS_PUBLIC EAS_RESULT JET_CloseFile (EAS_DATA_HANDLE easHandle);
-
-/*----------------------------------------------------------------------------
- * JET_Status()
- *----------------------------------------------------------------------------
- * Returns current status
- *----------------------------------------------------------------------------
-*/
-EAS_PUBLIC EAS_RESULT JET_Status (EAS_DATA_HANDLE easHandle, S_JET_STATUS *pStatus);
-
-/*----------------------------------------------------------------------------
- * JET_GetEvent()
- *----------------------------------------------------------------------------
- * Checks for application events
- *----------------------------------------------------------------------------
-*/
-EAS_PUBLIC EAS_BOOL JET_GetEvent (EAS_DATA_HANDLE easHandle, EAS_U32 *pEventRaw, S_JET_EVENT *pEvent);
-
-/*----------------------------------------------------------------------------
- * JET_ParseEvent()
- *----------------------------------------------------------------------------
- * Returns current status
- *----------------------------------------------------------------------------
-*/
-EAS_PUBLIC void JET_ParseEvent (EAS_U32 event, S_JET_EVENT *pEvent);
-
-/*----------------------------------------------------------------------------
- * JET_QueueSegment()
- *----------------------------------------------------------------------------
- * Queue a segment for playback
- *----------------------------------------------------------------------------
-*/
-EAS_PUBLIC EAS_RESULT JET_QueueSegment (EAS_DATA_HANDLE easHandle, EAS_INT segmentNum, EAS_INT libNum, EAS_INT repeatCount, EAS_INT transpose, EAS_U32 muteFlags, EAS_U8 userID);
-
-/*----------------------------------------------------------------------------
- * JET_Play()
- *----------------------------------------------------------------------------
- * Starts playback of the file
- *----------------------------------------------------------------------------
-*/
-EAS_PUBLIC EAS_RESULT JET_Play (EAS_DATA_HANDLE easHandle);
-
-/*----------------------------------------------------------------------------
- * JET_Pause()
- *----------------------------------------------------------------------------
- * Pauses playback of the file
- *----------------------------------------------------------------------------
-*/
-EAS_PUBLIC EAS_RESULT JET_Pause (EAS_DATA_HANDLE easHandle);
-
-/*----------------------------------------------------------------------------
- * JET_SetMuteFlags()
- *----------------------------------------------------------------------------
- * Change the state of the mute flags
- *----------------------------------------------------------------------------
-*/
-EAS_PUBLIC EAS_RESULT JET_SetMuteFlags (EAS_DATA_HANDLE easHandle, EAS_U32 muteFlags, EAS_BOOL sync);
-
-/*----------------------------------------------------------------------------
- * JET_SetMuteFlag()
- *----------------------------------------------------------------------------
- * Change the state of a single mute flag
- *----------------------------------------------------------------------------
-*/
-EAS_PUBLIC EAS_RESULT JET_SetMuteFlag (EAS_DATA_HANDLE easHandle, EAS_INT trackNum, EAS_BOOL muteFlag, EAS_BOOL sync);
-
-/*----------------------------------------------------------------------------
- * JET_TriggerClip()
- *----------------------------------------------------------------------------
- * Unmute a track and then mute it when it is complete
- *----------------------------------------------------------------------------
-*/
-EAS_PUBLIC EAS_RESULT JET_TriggerClip (EAS_DATA_HANDLE easHandle, EAS_INT clipID);
-
-/*----------------------------------------------------------------------------
- * JET_Clear_Queue()
- *----------------------------------------------------------------------------
- * Clears all segments in the queue
- *----------------------------------------------------------------------------
-*/
-EAS_PUBLIC EAS_RESULT JET_Clear_Queue (EAS_DATA_HANDLE easHandle);
-
-#ifdef __cplusplus
-} /* end extern "C" */
-#endif
-
-
-#endif
-
+/*----------------------------------------------------------------------------
+ *
+ * File:
+ * jet.h
+ *
+ * Contents and purpose:
+ * Public interface for JET sound engine
+ *
+ * Copyright (c) 2006 Sonic Network Inc.
+
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *----------------------------------------------------------------------------
+ * Revision Control:
+ * $Revision: 554 $
+ * $Date: 2007-02-02 11:06:10 -0800 (Fri, 02 Feb 2007) $
+ *----------------------------------------------------------------------------
+*/
+
+#ifndef _JET_H
+#define _JET_H
+
+#include "eas_types.h"
+#include "eas.h"
+
+/* for C++ linkage */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* opaque handle types for JET interface */
+typedef struct s_jet_data_tag *JET_DATA_HANDLE;
+
+typedef struct s_jet_config_tag
+{
+ EAS_U8 appEventRangeLow;
+ EAS_U8 appEventRangeHigh;
+} S_JET_CONFIG;
+
+typedef struct s_jet_status_tag
+{
+ EAS_INT currentUserID;
+ EAS_INT segmentRepeatCount;
+ EAS_INT numQueuedSegments;
+ EAS_BOOL paused;
+ EAS_I32 location;
+ EAS_U8 currentPlayingSegment;
+ EAS_U8 currentQueuedSegment;
+} S_JET_STATUS;
+
+typedef struct s_jet_event_tag
+{
+ EAS_U8 segment;
+ EAS_U8 channel;
+ EAS_U8 track;
+ EAS_U8 controller;
+ EAS_U8 value;
+} S_JET_EVENT;
+
+/*----------------------------------------------------------------------------
+ * JET_Init()
+ *----------------------------------------------------------------------------
+ * Initializes the JET library, allocates memory, etc. Call
+ * JET_Shutdown to de-allocate memory. Pass NULL for pConfig
+ * to use defaults. If passing config data, configSize should be
+ * sizeof(S_JET_CONFIG). This allows for future expansion of the
+ * config structure while maintaining compatibility.
+ *----------------------------------------------------------------------------
+*/
+EAS_PUBLIC EAS_RESULT JET_Init (EAS_DATA_HANDLE easHandle, const S_JET_CONFIG *pConfig, EAS_INT configSize);
+
+/*----------------------------------------------------------------------------
+ * JET_Shutdown()
+ *----------------------------------------------------------------------------
+ * Frees any memory used by the JET library
+ *----------------------------------------------------------------------------
+*/
+EAS_PUBLIC EAS_RESULT JET_Shutdown (EAS_DATA_HANDLE easHandle);
+
+/*----------------------------------------------------------------------------
+ * JET_OpenFile()
+ *----------------------------------------------------------------------------
+ * Opens a JET content file for playback
+ *----------------------------------------------------------------------------
+*/
+EAS_PUBLIC EAS_RESULT JET_OpenFile (EAS_DATA_HANDLE easHandle, EAS_FILE_LOCATOR locator);
+
+/*----------------------------------------------------------------------------
+ * JET_GetAppData()
+ *----------------------------------------------------------------------------
+ * Returns location and size of application data in the JET file
+ *----------------------------------------------------------------------------
+*/
+EAS_RESULT JET_GetAppData (EAS_DATA_HANDLE easHandle, EAS_I32 *pAppDataOffset, EAS_I32 *pAppDataSize);
+
+/*----------------------------------------------------------------------------
+ * JET_CloseFile()
+ *----------------------------------------------------------------------------
+ * Closes a JET content file and releases associated resources
+ *----------------------------------------------------------------------------
+*/
+EAS_PUBLIC EAS_RESULT JET_CloseFile (EAS_DATA_HANDLE easHandle);
+
+/*----------------------------------------------------------------------------
+ * JET_Status()
+ *----------------------------------------------------------------------------
+ * Returns current status
+ *----------------------------------------------------------------------------
+*/
+EAS_PUBLIC EAS_RESULT JET_Status (EAS_DATA_HANDLE easHandle, S_JET_STATUS *pStatus);
+
+/*----------------------------------------------------------------------------
+ * JET_GetEvent()
+ *----------------------------------------------------------------------------
+ * Checks for application events
+ *----------------------------------------------------------------------------
+*/
+EAS_PUBLIC EAS_BOOL JET_GetEvent (EAS_DATA_HANDLE easHandle, EAS_U32 *pEventRaw, S_JET_EVENT *pEvent);
+
+/*----------------------------------------------------------------------------
+ * JET_ParseEvent()
+ *----------------------------------------------------------------------------
+ * Returns current status
+ *----------------------------------------------------------------------------
+*/
+EAS_PUBLIC void JET_ParseEvent (EAS_U32 event, S_JET_EVENT *pEvent);
+
+/*----------------------------------------------------------------------------
+ * JET_QueueSegment()
+ *----------------------------------------------------------------------------
+ * Queue a segment for playback
+ *----------------------------------------------------------------------------
+*/
+EAS_PUBLIC EAS_RESULT JET_QueueSegment (EAS_DATA_HANDLE easHandle, EAS_INT segmentNum, EAS_INT libNum, EAS_INT repeatCount, EAS_INT transpose, EAS_U32 muteFlags, EAS_U8 userID);
+
+/*----------------------------------------------------------------------------
+ * JET_Play()
+ *----------------------------------------------------------------------------
+ * Starts playback of the file
+ *----------------------------------------------------------------------------
+*/
+EAS_PUBLIC EAS_RESULT JET_Play (EAS_DATA_HANDLE easHandle);
+
+/*----------------------------------------------------------------------------
+ * JET_Pause()
+ *----------------------------------------------------------------------------
+ * Pauses playback of the file
+ *----------------------------------------------------------------------------
+*/
+EAS_PUBLIC EAS_RESULT JET_Pause (EAS_DATA_HANDLE easHandle);
+
+/*----------------------------------------------------------------------------
+ * JET_SetMuteFlags()
+ *----------------------------------------------------------------------------
+ * Change the state of the mute flags
+ *----------------------------------------------------------------------------
+*/
+EAS_PUBLIC EAS_RESULT JET_SetMuteFlags (EAS_DATA_HANDLE easHandle, EAS_U32 muteFlags, EAS_BOOL sync);
+
+/*----------------------------------------------------------------------------
+ * JET_SetMuteFlag()
+ *----------------------------------------------------------------------------
+ * Change the state of a single mute flag
+ *----------------------------------------------------------------------------
+*/
+EAS_PUBLIC EAS_RESULT JET_SetMuteFlag (EAS_DATA_HANDLE easHandle, EAS_INT trackNum, EAS_BOOL muteFlag, EAS_BOOL sync);
+
+/*----------------------------------------------------------------------------
+ * JET_TriggerClip()
+ *----------------------------------------------------------------------------
+ * Unmute a track and then mute it when it is complete
+ *----------------------------------------------------------------------------
+*/
+EAS_PUBLIC EAS_RESULT JET_TriggerClip (EAS_DATA_HANDLE easHandle, EAS_INT clipID);
+
+/*----------------------------------------------------------------------------
+ * JET_Clear_Queue()
+ *----------------------------------------------------------------------------
+ * Clears all segments in the queue
+ *----------------------------------------------------------------------------
+*/
+EAS_PUBLIC EAS_RESULT JET_Clear_Queue (EAS_DATA_HANDLE easHandle);
+
+#ifdef __cplusplus
+} /* end extern "C" */
+#endif
+
+
+#endif
+
diff --git a/arm-wt-22k/jetcreator_lib_src/darwin-x86/EASLib.c b/arm-wt-22k/jetcreator_lib_src/darwin-x86/EASLib.c
index 6f98bc1..ca19247 100755..100644
--- a/arm-wt-22k/jetcreator_lib_src/darwin-x86/EASLib.c
+++ b/arm-wt-22k/jetcreator_lib_src/darwin-x86/EASLib.c
@@ -1,1809 +1,1809 @@
-/*
- * EASLib.c
- * EASLIb
- *
- *
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
-
-#include "eas.h"
-#include "eas_report.h"
-#include "eas_host.h"
-#include <AudioUnit/AudioUnit.h>
-#include <CoreServices/CoreServices.h>
-
-#ifdef JET_INTERFACE
-#include "jet.h"
-#endif
-
-
-#define EAS_EXPORT __attribute__((visibility("default")))
-
-// #define DEBUG_FILE_IO
-
-/* include debug interface */
-#include "eas_host_debug.h"
-
-#ifdef AUX_MIXER
-#include "eas_auxmix.h"
-#endif
-
-/* this module requires dynamic memory support */
-#ifdef _STATIC_MEMORY
-#error "eas_hostmm.c requires the dynamic memory model!\n"
-#endif
-
-#ifndef EAS_MAX_FILE_HANDLES
-#define EAS_MAX_FILE_HANDLES 32
-#endif
-
-#ifndef EAS_FILE_BUFFER_SIZE
-#define EAS_FILE_BUFFER_SIZE 32
-#endif
-
-/*
- * this structure and the related function are here
- * to support the ability to create duplicate handles
- * and buffering it in memory. If your system uses
- * in-memory resources, you can eliminate the calls
- * to malloc and free, the dup flag, and simply track
- * the file size and read position.
- */
- #ifdef BUFFERED_FILE_ACCESS
-typedef struct eas_hw_file_tag
-{
- FILE *pFile;
- EAS_I32 bytesInBuffer;
- EAS_I32 readIndex;
- EAS_I32 filePos;
- EAS_I32 fileSize;
- EAS_BOOL dup;
- EAS_U8 buffer[EAS_FILE_BUFFER_SIZE];
-} EAS_HW_FILE;
-#else
-typedef struct eas_hw_file_tag
-{
- EAS_I32 fileSize;
- EAS_I32 filePos;
- EAS_BOOL dup;
- EAS_U8 *buffer;
-} EAS_HW_FILE;
-#endif
-
-typedef struct eas_hw_inst_data_tag
-{
- EAS_HW_FILE files[EAS_MAX_FILE_HANDLES];
-} EAS_HW_INST_DATA;
-
-EAS_BOOL errorConditions[eNumErrorConditions];
-EAS_BOOL ledState;
-EAS_BOOL vibState;
-EAS_BOOL backlightState;
-
-#define MAX_DEBUG_MSG_LEN 1024
-
-typedef void (*EAS_LOG_FUNC)(EAS_INT severity, char *msg);
-
-static EAS_LOG_FUNC logCallback = NULL;
-static char messageBuffer[MAX_DEBUG_MSG_LEN];
-
-/* error counts */
-static EAS_INT eas_fatalErrors;
-static EAS_INT eas_errors;
-static EAS_INT eas_warnings;
-static int severityLevel = 9999;
-
-
-#define MAX_BUFFERS 8
-
-// The output unit
-AudioUnit OutputUnit;
-AudioStreamBasicDescription streamFormat;
-
-// sync stuf
-pthread_mutex_t mtx;
-pthread_cond_t cond;
-bool bStopped = true;
-
-// buffer to hold the data
-typedef struct
-{
- UInt32 uOutBufferLength;
- UInt32 uOutFrames;
- int ix;
- short* pData[8];
- unsigned int uLength;
-} S_BUFFER_INFO;
-
-static S_BUFFER_INFO *pBuf = NULL;
-const S_EAS_LIB_CONFIG *pConfig = NULL;
-
-/*----------------------------------------------------------------------------
- * ResetErrorCounters()
- *----------------------------------------------------------------------------
-*/
-EAS_EXPORT void ResetErrorCounters()
-{
- eas_fatalErrors = 0;
- eas_errors = 0;
- eas_warnings = 0;
-}
-
-/*----------------------------------------------------------------------------
- * SetLogCallback()
- *----------------------------------------------------------------------------
-*/
-EAS_EXPORT void SetLogCallback (EAS_LOG_FUNC callback)
-{
- logCallback = callback;
-}
-
-#ifndef _NO_DEBUG_PREPROCESSOR
-static S_DEBUG_MESSAGES debugMessages[] =
-{
-#ifdef UNIFIED_DEBUG_MESSAGES
-#include "eas_debugmsgs.h"
-#endif
- { 0,0,0 }
-};
-
-/*----------------------------------------------------------------------------
- * EAS_ReportEx()
- *----------------------------------------------------------------------------
-*/
-void EAS_ReportEx (int severity, unsigned long hashCode, int serialNum, ...)
-{
- va_list vargs;
- int i;
-
- switch (severity)
- {
- case _EAS_SEVERITY_FATAL:
- eas_fatalErrors++;
- break;
-
- case _EAS_SEVERITY_ERROR:
- eas_errors++;
- break;
-
- case _EAS_SEVERITY_WARNING:
- eas_warnings++;
- break;
-
- default:
- break;
- }
-
- /* check severity level */
- if (severity > severityLevel)
- return;
-
- /* check for callback */
- if (logCallback == NULL)
- return;
-
- /* find the error message and output to stdout */
- for (i = 0; debugMessages[i].m_pDebugMsg; i++)
- {
- if ((debugMessages[i].m_nHashCode == hashCode) &&
- (debugMessages[i].m_nSerialNum == serialNum))
- {
- va_start(vargs, serialNum);
-#ifdef WIN32
- vsprintf_s(messageBuffer, sizeof(messageBuffer), fmt, vargs);
-#else
- vsprintf(messageBuffer, debugMessages[i].m_pDebugMsg, vargs);
-#endif
- logCallback(severity, messageBuffer);
- va_end(vargs);
- return;
- }
- }
- printf("Unrecognized error: Severity=%d; HashCode=%lu; SerialNum=%d\n", severity, hashCode, serialNum);
-} /* end EAS_ReportEx */
-
-#else
-/*----------------------------------------------------------------------------
- * EAS_Report()
- *----------------------------------------------------------------------------
-*/
-void EAS_Report (int severity, const char *fmt, ...)
-{
- va_list vargs;
-
- switch (severity)
- {
- case _EAS_SEVERITY_FATAL:
- eas_fatalErrors++;
- break;
-
- case _EAS_SEVERITY_ERROR:
- eas_errors++;
- break;
-
- case _EAS_SEVERITY_WARNING:
- eas_warnings++;
- break;
-
- default:
- break;
- }
-
- /* check severity level */
- if (severity > severityLevel)
- return;
-
- /* check for callback */
- if (logCallback == NULL)
- return;
-
- va_start(vargs, fmt);
-#ifdef _WIN32
- vsprintf_s(messageBuffer, sizeof(messageBuffer), fmt, vargs);
-#else
- vsprintf(messageBuffer, fmt, vargs);
-#endif
- logCallback(severity, messageBuffer);
- va_end(vargs);
-} /* end EAS_Report */
-
-/*----------------------------------------------------------------------------
- * EAS_ReportX()
- *----------------------------------------------------------------------------
-*/
-void EAS_ReportX (int severity, const char *fmt, ...)
-{
- va_list vargs;
-
- switch (severity)
- {
- case _EAS_SEVERITY_FATAL:
- eas_fatalErrors++;
- break;
-
- case _EAS_SEVERITY_ERROR:
- eas_errors++;
- break;
-
- case _EAS_SEVERITY_WARNING:
- eas_warnings++;
- break;
-
- default:
- break;
- }
-
- /* check severity level */
- if (severity > severityLevel)
- return;
-
- /* check for callback */
- if (logCallback == NULL)
- return;
-
- va_start(vargs, fmt);
-#ifdef _WIN32
- vsprintf_s(messageBuffer, sizeof(messageBuffer), fmt, vargs);
-#else
- vsprintf(messageBuffer, fmt, vargs);
-#endif
- logCallback(severity, messageBuffer);
- va_end(vargs);
-}
-#endif
-
-/*----------------------------------------------------------------------------
- * EAS_DLLSetDebugLevel()
- *----------------------------------------------------------------------------
-*/
-EAS_EXPORT void EAS_DLLSetDebugLevel (int severity)
-{
- severityLevel = severity;
-}
-
-/*----------------------------------------------------------------------------
- * EAS_ExSetDebugLevel()
- *----------------------------------------------------------------------------
-*/
-void EAS_SetDebugLevel (int severity)
-{
- severityLevel = severity;
-}
-
-/*----------------------------------------------------------------------------
- * EAS_SelectLibrary()
- *----------------------------------------------------------------------------
-*/
-EAS_EXPORT EAS_RESULT EAS_SelectLib (EAS_DATA_HANDLE pEASData, EAS_HANDLE streamHandle, EAS_BOOL testLib)
-{
- extern EAS_SNDLIB_HANDLE VMGetLibHandle(EAS_INT libNum);
- return EAS_SetSoundLibrary(pEASData, streamHandle, VMGetLibHandle(testLib ? 1 : 0));
-}
-
-// Callback proc
-static OSStatus RenderProc( void *inRefCon,
- AudioUnitRenderActionFlags *ioActionFlags,
- const AudioTimeStamp *inTimeStamp,
- UInt32 inBusNumber,
- UInt32 inNumberFrames,
- AudioBufferList *ioData)
-{
- // Get the mutex
- pthread_mutex_lock(&mtx);
-
- short* ptrOutL = (short *)ioData->mBuffers[0].mData;
- short* ptrOutR = (short *)ioData->mBuffers[1].mData;
-
- memset(ptrOutL, 0, pBuf->uOutFrames);
- memset(ptrOutR, 0, pBuf->uOutFrames);
-
- // check if there is any data in the buffer
- if (pBuf->ix == 0 )
- {
- // Release the mutex and signal the python thread
- pthread_mutex_unlock(&mtx);
- pthread_cond_signal(&cond);
- return 0;
- }
-
- // Get a ptr to the data
- short* pData = pBuf->pData[--(pBuf->ix)];
-
- // Now copy the data
- int i;
- for (i = 0; i < pBuf->uOutFrames; i+=2 )
- {
- *ptrOutL++ = pData[i];
- *ptrOutR++ = pData[i+1];
- }
-
- // Release the mutex
- pthread_mutex_unlock(&mtx);
- pthread_cond_signal(&cond);
-
- return 0;
-}
-
-EAS_RESULT addData(EAS_PCM *pAudioBuffer)
-{
- // Copy the data we got from the synth
- memcpy(pBuf->pData[(pBuf->ix)++], pAudioBuffer, 2048);
-
- // Start the output Audio Unit only the first time
- if ( bStopped == true )
- {
- bStopped = false;
- OSStatus err = AudioOutputUnitStart (OutputUnit);
- if (err)
- {
- printf ("AudioDeviceStart=%ld\n", err);
- return EAS_FAILURE;
- }
- }
-
- return EAS_SUCCESS;
-}
-
-
-EAS_EXPORT EAS_RESULT EAS_RenderWaveOut(EAS_DATA_HANDLE easHandle, EAS_PCM *pAudioBuffer, EAS_I32 numRequested, EAS_I32 *pNumGenerated)
-{
- // Get the mutex
- pthread_mutex_lock(&mtx);
-
- // Check if our buffer is full
- while(pBuf->ix == MAX_BUFFERS - 1)
- pthread_cond_wait(&cond, &mtx);
-
- // Call the synth the render a buffer
- EAS_RESULT result = EAS_Render(easHandle, pAudioBuffer, numRequested, pNumGenerated);
- addData( pAudioBuffer );
-
- // Release the mutex
- pthread_mutex_unlock(&mtx);
-
- //Done
- return result;
-}
-
-#ifdef AUX_MIXER
-EAS_EXPORT EAS_RESULT EAS_RenderAuxMixerWaveOut (EAS_DATA_HANDLE easHandle, EAS_PCM *pAudioBuffer, EAS_I32 *pNumGenerated)
-{
- // Get the mutex
- pthread_mutex_lock(&mtx);
-
- // Check if our buffer is full
- while(pBuf->ix == MAX_BUFFERS - 1)
- pthread_cond_wait(&cond, &mtx);
-
- EAS_RESULT result = EAS_RenderAuxMixer(easHandle, pAudioBuffer, pNumGenerated);
- addData( pAudioBuffer );
-
- // Release the mutex
- pthread_mutex_unlock(&mtx);
-
- return result;
-}
-#endif
-
-EAS_EXPORT EAS_RESULT OpenWaveOutDevice(EAS_INT devNum, EAS_INT sampleRate, EAS_INT maxBufSize)
-{
- // Open the default output unit
- ComponentDescription desc;
- desc.componentType = kAudioUnitType_Output;
- desc.componentSubType = kAudioUnitSubType_DefaultOutput;
- desc.componentManufacturer = kAudioUnitManufacturer_Apple;
- desc.componentFlags = 0;
- desc.componentFlagsMask = 0;
-
- Component comp = FindNextComponent(NULL, &desc);
- if (comp == NULL)
- {
- printf ("Could find the default output unit!!!\n");
- return EAS_FAILURE;
- }
-
- OSStatus err = OpenAComponent(comp, &OutputUnit);
- if (comp == NULL)
- {
- printf ("OpenAComponent=%ld\n", err);
- return EAS_FAILURE;
- }
-
- // Set up a callback function to generate output to the output unit
- AURenderCallbackStruct auRenderCallback;
- auRenderCallback.inputProc = RenderProc;
- auRenderCallback.inputProcRefCon = NULL;
-
- err = AudioUnitSetProperty (OutputUnit,
- kAudioUnitProperty_SetRenderCallback,
- kAudioUnitScope_Input,
- 0,
- &auRenderCallback,
- sizeof(auRenderCallback));
- if (err)
- {
- printf ("AudioUnitSetProperty-CB=%ld\n", err);
- return EAS_FAILURE;;
- }
-
- pConfig = EAS_Config();
-
- // The synth engine already uses short* for the buffers so let CoreAudio do any conversions if needed
- if (sampleRate != 0)
- streamFormat.mSampleRate = sampleRate;
- else
- streamFormat.mSampleRate = pConfig->sampleRate;
-
- streamFormat.mFormatID = kAudioFormatLinearPCM;
- streamFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger
- | kAudioFormatFlagsNativeEndian
- | kLinearPCMFormatFlagIsPacked
- | kAudioFormatFlagIsNonInterleaved;
-
- streamFormat.mBytesPerPacket = 2;
- streamFormat.mFramesPerPacket = 1;
- streamFormat.mBytesPerFrame = 2;
- streamFormat.mChannelsPerFrame = 2;
- streamFormat.mBitsPerChannel = 16;
-
- err = AudioUnitSetProperty (OutputUnit,
- kAudioUnitProperty_StreamFormat,
- kAudioUnitScope_Input,
- 0,
- &streamFormat,
- sizeof(AudioStreamBasicDescription));
- if (err)
- {
- printf ("AudioUnitSetProperty-SF= %4.4s, %ld\n", (char*)&err, err);
- return EAS_FAILURE;
- }
-
- // Initialize
- err = AudioUnitInitialize(OutputUnit);
- if (err)
- {
- printf ("AudioUnitInitialize = %ld\n", err);
- return EAS_FAILURE;
- }
-
- pBuf = (S_BUFFER_INFO *) malloc(sizeof(S_BUFFER_INFO));
- if( !pBuf )
- return EAS_FAILURE;
-
- pBuf->uOutBufferLength = pConfig->mixBufferSize * streamFormat.mBitsPerChannel / 2;
- UInt32 uDataSize = sizeof(pBuf->uOutBufferLength);
-
- err = AudioUnitSetProperty(OutputUnit, kAudioDevicePropertyBufferSize, kAudioUnitScope_Output, 0, &pBuf->uOutBufferLength, uDataSize);
- if (err)
- {
- printf ("AudioUnitSetProperty = %ld\n", err);
- return EAS_FAILURE;
- }
-
- err = AudioUnitGetProperty(OutputUnit, kAudioDevicePropertyBufferSize, kAudioUnitScope_Output, 0, &pBuf->uOutBufferLength, &uDataSize);
- if (err)
- {
- printf ("AudioUnitGetProperty = %ld\n", err);
- return EAS_FAILURE;
- }
-
- pBuf->uLength = pBuf->uOutBufferLength;
- int i;
- for ( i = 0; i < MAX_BUFFERS; i++)
- pBuf->pData[i] = malloc(pBuf->uLength);
-
- pBuf->uOutBufferLength /= pConfig->numChannels;
- pBuf->uOutFrames = pBuf->uOutBufferLength / sizeof(short);
-
- pBuf->ix = 0;
-
- // Init the stop flag
- bStopped = true;
-
- int result = pthread_mutex_init(&mtx, NULL);
- if (result)
- {
- printf("pthread_mutex_init failed\n");
- return EAS_FAILURE;
- }
-
- result = pthread_cond_init(&cond, NULL);
- if (result)
- {
- printf("pthread_cond_init failed\n");
- return EAS_FAILURE;
- }
-
- // Done
- return EAS_SUCCESS;
-}
-
-
-EAS_EXPORT EAS_RESULT StartStream()
-{
- OSStatus err = noErr;
- pthread_mutex_lock(&mtx);
- if ( bStopped == true )
- {
- err = AudioOutputUnitStart (OutputUnit);
- if (err)
- {
- printf ("AudioOutputUnitStart=%ld\n", err);
- return EAS_FAILURE;
- }
- bStopped = false;
- }
-
- return EAS_SUCCESS;
-}
-
-
-EAS_EXPORT EAS_RESULT CloseWaveOutDevice()
-{
- OSStatus err;
-
- pthread_mutex_lock(&mtx);
- if( false == bStopped )
- {
- AudioOutputUnitStop (OutputUnit);
- bStopped = true;
-
- err = AudioUnitUninitialize (OutputUnit);
- if (err)
- {
- printf ("AudioUnitUninitialize=%ld\n", err);
- return EAS_FAILURE;
- }
-
- CloseComponent (OutputUnit);
- int i = 0;
- for(i; i < MAX_BUFFERS; i++)
- free(pBuf->pData[i]);
-
- free(pBuf);
- }
-
- pthread_mutex_unlock(&mtx);
- return EAS_SUCCESS;
-}
-
-
-#if defined(_DEBUG) && !defined(MSC)
-#include <crtdbg.h>
-/*----------------------------------------------------------------------------
- * EnableHeapDebug()
- *----------------------------------------------------------------------------
-*/
-static void EnableHeapDebug (void)
-{
- int temp;
- temp = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
- temp |= _CRTDBG_ALLOC_MEM_DF;
- temp |= _CRTDBG_CHECK_ALWAYS_DF;
- temp |= _CRTDBG_LEAK_CHECK_DF;
-// temp |= _CRTDBG_DELAY_FREE_MEM_DF;
- _CrtSetDbgFlag(temp);
-}
-
-/*----------------------------------------------------------------------------
- * HeapCheck()
- *----------------------------------------------------------------------------
- * Check heap status
- *----------------------------------------------------------------------------
-*/
-void HeapCheck (void)
-{
- int heapStatus;
-
- /* Check heap status */
- heapStatus = _heapchk();
- if ((heapStatus == _HEAPOK) || (heapStatus == _HEAPEMPTY))
- return;
-
- EAS_ReportX(_EAS_SEVERITY_FATAL, "Heap corrupt\n" );
-}
-#endif
-
-
-/*----------------------------------------------------------------------------
- * EAS_HWInit
- *
- * Initialize host wrapper interface
- *
- *----------------------------------------------------------------------------
-*/
-EAS_RESULT EAS_HWInit (EAS_HW_DATA_HANDLE *pHWInstData)
-{
-
-#if defined(_DEBUG) && !defined(MSC)
- EnableHeapDebug();
-#endif
-
- #ifdef BUFFERED_FILE_ACCESS
- EAS_ReportX(_EAS_SEVERITY_INFO, "EAS_HWInit: Buffered file access\n");
- #else
- EAS_ReportX(_EAS_SEVERITY_INFO, "EAS_HWInit: Memory mapped file access\n");
- #endif
-
- /* simulate failure */
- if (errorConditions[eInitError])
- return EAS_FAILURE;
-
- /* need to track file opens for duplicate handles */
- *pHWInstData = malloc(sizeof(EAS_HW_INST_DATA));
- if (!(*pHWInstData))
- return EAS_ERROR_MALLOC_FAILED;
-
- EAS_HWMemSet(*pHWInstData, 0, sizeof(EAS_HW_INST_DATA));
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- * EAS_HWShutdown
- *
- * Shut down host wrapper interface
- *
- *----------------------------------------------------------------------------
-*/
-EAS_RESULT EAS_HWShutdown (EAS_HW_DATA_HANDLE hwInstData)
-{
-
- /* simulate failure */
- if (errorConditions[eShutdownError])
- return EAS_FAILURE;
-
- free(hwInstData);
-
-#if defined(_DEBUG) && !defined(MSC)
- HeapCheck();
-#endif
-
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWMalloc
- *
- * Allocates dynamic memory
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) available for customer use */
-void *EAS_HWMalloc (EAS_HW_DATA_HANDLE hwInstData, EAS_I32 size)
-{
- /* simulate failure */
- if (errorConditions[eMallocError])
- return NULL;
-
- return malloc((size_t) size);
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWFree
- *
- * Frees dynamic memory
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) available for customer use */
-void EAS_HWFree (EAS_HW_DATA_HANDLE hwInstData, void *p)
-{
- free(p);
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWMemCpy
- *
- * Copy memory wrapper
- *
- *----------------------------------------------------------------------------
-*/
-void *EAS_HWMemCpy (void *dest, const void *src, EAS_I32 amount)
-{
- return memcpy(dest, src, (size_t) amount);
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWMemSet
- *
- * Set memory wrapper
- *
- *----------------------------------------------------------------------------
-*/
-void *EAS_HWMemSet (void *dest, int val, EAS_I32 amount)
-{
- return memset(dest, val, (size_t) amount);
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWMemCmp
- *
- * Compare memory wrapper
- *
- *----------------------------------------------------------------------------
-*/
-EAS_I32 EAS_HWMemCmp (const void *s1, const void *s2, EAS_I32 amount)
-{
- return (EAS_I32) memcmp(s1, s2, (size_t) amount);
-}
-
-#ifdef BUFFERED_FILE_ACCESS
-/*----------------------------------------------------------------------------
- *
- * EAS_HWOpenFile
- *
- * Open a file for read or write
- *
- *----------------------------------------------------------------------------
-*/
-EAS_RESULT EAS_HWOpenFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_LOCATOR locator, EAS_FILE_HANDLE *pFile, EAS_FILE_MODE mode)
-{
- EAS_HW_FILE *file;
- int i;
-
- /* set return value to NULL */
- *pFile = NULL;
-
- /* only support read mode at this time */
- if (mode != EAS_FILE_READ)
- return EAS_ERROR_INVALID_FILE_MODE;
-
- /* find an empty entry in the file table */
- file = hwInstData->files;
- for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
- {
- /* is this slot being used? */
- if (file->pFile == NULL)
- {
- EAS_RESULT result;
-
- /* open the file */
- file->pFile = fopen((const char*) locator, "rb");
- if (file->pFile == NULL)
- return EAS_ERROR_FILE_OPEN_FAILED;
-
- /* get file length */
- if ((result = EAS_HWFileLength(hwInstData, file, &file->fileSize)) != EAS_SUCCESS)
- {
- EAS_HWCloseFile(hwInstData, file);
- return result;
- }
-
-#ifdef DEBUG_FILE_IO
- EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWOpenFile: Open file %d\n", i);
-#endif
-
- /* initialize some values */
- file->bytesInBuffer = 0;
- file->readIndex = 0;
- file->filePos = 0;
- file->dup = EAS_FALSE;
-
- *pFile = file;
- return EAS_SUCCESS;
- }
- file++;
- }
-
- /* too many open files */
- return EAS_ERROR_MAX_FILES_OPEN;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWFillBuffer
- *
- * Fill buffer from file
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) hwInstData available for customer use */
-EAS_RESULT EAS_HWFillBuffer (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file)
-{
- /* reposition the file pointer */
- if (fseek(file->pFile, file->filePos, SEEK_SET) != 0)
- return EAS_ERROR_FILE_SEEK;
-
- /* read some data from the file */
- file->bytesInBuffer = (EAS_I32) fread(file->buffer, 1, EAS_FILE_BUFFER_SIZE, file->pFile);
- file->readIndex = 0;
- if (file->bytesInBuffer == 0)
- return EAS_EOF;
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWReadFile
- *
- * Read data from a file
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) hwInstData available for customer use */
-EAS_RESULT EAS_HWReadFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *pBuffer, EAS_I32 n, EAS_I32 *pBytesRead)
-{
- EAS_RESULT result;
- EAS_I32 temp;
- EAS_U8 *p = pBuffer;
- EAS_I32 bytesLeft = n;
-
- *pBytesRead = 0;
-
- /* check handle integrity */
- if (file->pFile == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
-#ifdef DEBUG_FILE_IO
- EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWReadFile: Reading %d bytes from position %d\n", n, file->filePos);
-#endif
-
- /* try to fulfill request from buffer */
- for (;bytesLeft > 0;)
- {
- /* how many bytes can we get from buffer? */
- temp = file->bytesInBuffer - file->readIndex;
- if (temp > bytesLeft)
- temp = bytesLeft;
-
- /* copy data from buffer */
- EAS_HWMemCpy(p, &file->buffer[file->readIndex], temp);
- *pBytesRead += temp;
- file->readIndex += temp;
- file->filePos += temp;
- p += temp;
- bytesLeft -= temp;
-
- /* don't refill buffer if request is bigger than buffer */
- if ((bytesLeft == 0) || (bytesLeft >= EAS_FILE_BUFFER_SIZE))
- break;
-
- /* refill buffer */
- if ((result = EAS_HWFillBuffer(hwInstData, file)) != EAS_SUCCESS)
- return result;
- }
-
- /* more to read? do unbuffered read directly to target memory */
- if (bytesLeft)
- {
-
- /* position the file pointer */
- if (fseek(file->pFile, file->filePos, SEEK_SET) != 0)
- return EAS_ERROR_FILE_SEEK;
-
- /* read data in the buffer */
- temp = (EAS_I32) fread(p, 1, (size_t) bytesLeft, file->pFile);
- *pBytesRead += temp;
- file->filePos += temp;
-
- /* reset buffer info */
- file->bytesInBuffer = 0;
- file->readIndex = 0;
- }
-
-#ifdef DEBUG_FILE_IO
- {
-#define BYTES_PER_LINE 16
- char str[BYTES_PER_LINE * 3 + 1];
- EAS_INT i;
- for (i = 0; i < (n > BYTES_PER_LINE ? BYTES_PER_LINE : n) ; i ++)
- sprintf(&str[i*3], "%02x ", ((EAS_U8*)pBuffer)[i]);
- if (i)
- EAS_ReportX(_EAS_SEVERITY_NOFILTER, "%s\n", str);
- }
-#endif
-
- /* were n bytes read? */
- if (*pBytesRead != n)
- return EAS_EOF;
-
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWGetByte
- *
- * Read a byte from a file
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) hwInstData available for customer use */
-EAS_RESULT EAS_HWGetByte (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p)
-{
- EAS_RESULT result;
-
- /* check handle integrity */
- if (file->pFile == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- /* use local buffer - do we have any data? */
- if (file->readIndex >= file->bytesInBuffer)
- {
- if ((result = EAS_HWFillBuffer(hwInstData, file)) != EAS_SUCCESS)
- return result;
-
- /* if nothing to read, return EOF */
- if (file->bytesInBuffer == 0)
- return EAS_EOF;
- }
-
- /* get a character from the buffer */
- *((EAS_U8*) p) = file->buffer[file->readIndex++];
-
-#ifdef DEBUG_FILE_IO
- EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWGetByte: Reading from position %d, byte = 0x%02x\n", file->filePos, *(EAS_U8*)p);
-#endif
-
- file->filePos++;
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWGetWord
- *
- * Read a 16-bit value from the file
- *----------------------------------------------------------------------------
-*/
-EAS_RESULT EAS_HWGetWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst)
-{
- EAS_RESULT result;
- EAS_I32 count;
- EAS_U8 c[2];
-
-#ifdef DEBUG_FILE_IO
- EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWGetWord: Reading 2 bytes from position %d\n", file->filePos);
-#endif
-
- /* read 2 bytes from the file */
- if ((result = EAS_HWReadFile(hwInstData, file, c, 2, &count)) != EAS_SUCCESS)
- return result;
-
- /* order them as requested */
- if (msbFirst)
- *((EAS_U16*) p) = ((EAS_U16) c[0] << 8) | c[1];
- else
- *((EAS_U16*) p) = ((EAS_U16) c[1] << 8) | c[0];
-
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWGetDWord
- *
- * Read a 16-bit value from the file
- *----------------------------------------------------------------------------
-*/
-EAS_RESULT EAS_HWGetDWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst)
-{
- EAS_RESULT result;
- EAS_I32 count;
- EAS_U8 c[4];
-
-#ifdef DEBUG_FILE_IO
- EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWGetDWord: Reading 4 bytes from position %d\n", file->filePos);
-#endif
-
- /* read 4 bytes from the file */
- if ((result = EAS_HWReadFile(hwInstData, file, c, 4, &count)) != EAS_SUCCESS)
- return result;
-
- /* order them as requested */
- if (msbFirst)
- *((EAS_U32*) p) = ((EAS_U32) c[0] << 24) | ((EAS_U32) c[1] << 16) | ((EAS_U32) c[2] << 8) | c[3];
- else
- *((EAS_U32*) p) = ((EAS_U32) c[3] << 24) | ((EAS_U32) c[2] << 16) | ((EAS_U32) c[1] << 8) | c[0];
-
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWFilePos
- *
- * Returns the current location in the file
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) hwInstData available for customer use */
-EAS_RESULT EAS_HWFilePos (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pPosition)
-{
-
- /* check handle integrity */
- if (file->pFile == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- *pPosition = file->filePos;
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWFileSeek
- *
- * Seek to a specific location in the file
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) hwInstData available for customer use */
-EAS_RESULT EAS_HWFileSeek (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position)
-{
- EAS_I32 newIndex;
-
- /* check handle integrity */
- if (file->pFile == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- /* check for seek past end */
- if ((position < 0) || (position > file->fileSize))
- return EAS_ERROR_FILE_SEEK;
-
-#ifdef DEBUG_FILE_IO
- EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWFileSeek: Seeking to new position %d\n", file->filePos);
-#endif
-
- /* is new position in current buffer? */
- newIndex = position - file->filePos + file->readIndex;
- if ((newIndex >= 0) && (newIndex < file->bytesInBuffer))
- {
- file->readIndex = newIndex;
- file->filePos = position;
- return EAS_SUCCESS;
- }
-
- /* save new position and reset buffer info so EAS_HWGetByte doesn't fail */
- file->filePos = position;
- file->bytesInBuffer = 0;
- file->readIndex = 0;
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWFileSeekOfs
- *
- * Seek forward or back relative to the current position
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) hwInstData available for customer use */
-EAS_RESULT EAS_HWFileSeekOfs (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position)
-{
- EAS_I32 temp;
-
-#ifdef DEBUG_FILE_IO
- EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWFileSeekOfs: Seeking to new position %d\n", file->filePos + position);
-#endif
-
- /* check handle integrity */
- if (file->pFile == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- /* check for seek past end */
- temp = file->filePos + position;
- if ((temp < 0) || (temp > file->fileSize))
- return EAS_ERROR_FILE_SEEK;
-
- /* is new position in current buffer? */
- temp = position + file->readIndex;
- if ((temp >= 0) && (temp < file->bytesInBuffer))
- {
- file->readIndex = temp;
- file->filePos += position;
- return EAS_SUCCESS;
- }
-
- /* save new position and reset buffer info so EAS_HWGetByte doesn't fail */
- file->filePos += position;
- file->bytesInBuffer = 0;
- file->readIndex = 0;
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWFileLength
- *
- * Return the file length
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) hwInstData available for customer use */
-EAS_RESULT EAS_HWFileLength (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pLength)
-{
- long pos;
-
- /* check handle integrity */
- if (file->pFile == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- if ((pos = ftell(file->pFile)) == -1L)
- return EAS_ERROR_FILE_LENGTH;
- if (fseek(file->pFile, 0L, SEEK_END) != 0)
- return EAS_ERROR_FILE_LENGTH;
- if ((*pLength = ftell(file->pFile)) == -1L)
- return EAS_ERROR_FILE_LENGTH;
- if (fseek(file->pFile, pos, SEEK_SET) != 0)
- return EAS_ERROR_FILE_LENGTH;
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWDupHandle
- *
- * Duplicate a file handle
- *
- *----------------------------------------------------------------------------
-*/
-EAS_RESULT EAS_HWDupHandle (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_FILE_HANDLE* pDupFile)
-{
- EAS_HW_FILE *dupfile;
- int i;
-
- /* check handle integrity */
- *pDupFile = NULL;
- if (file->pFile == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- /* find an empty entry in the file table */
- dupfile = hwInstData->files;
- for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
- {
- /* is this slot being used? */
- if (dupfile->pFile == NULL)
- {
-
- /* copy info from the handle to be duplicated */
- dupfile->filePos = file->filePos;
- dupfile->pFile = file->pFile;
- dupfile->fileSize = file->fileSize;
-
- /* set the duplicate handle flag */
- dupfile->dup = file->dup = EAS_TRUE;
-
- /* initialize some values */
- dupfile->bytesInBuffer = 0;
- dupfile->readIndex = 0;
-
- *pDupFile = dupfile;
- return EAS_SUCCESS;
- }
- dupfile++;
- }
-
- /* too many open files */
- return EAS_ERROR_MAX_FILES_OPEN;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWClose
- *
- * Wrapper for fclose function
- *
- *----------------------------------------------------------------------------
-*/
-EAS_RESULT EAS_HWCloseFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file1)
-{
- EAS_HW_FILE *file2,*dupFile;
- int i;
-
- /* check handle integrity */
- if (file1->pFile == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- /* check for duplicate handle */
- if (file1->dup)
- {
- dupFile = NULL;
- file2 = hwInstData->files;
- for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
- {
- /* check for duplicate */
- if ((file1 != file2) && (file2->pFile == file1->pFile))
- {
- /* is there more than one duplicate? */
- if (dupFile != NULL)
- {
- /* clear this entry and return */
- file1->pFile = NULL;
- return EAS_SUCCESS;
- }
-
- /* this is the first duplicate found */
- dupFile = file2;
- }
- file2++;
- }
-
- /* there is only one duplicate, clear the dup flag */
- if (dupFile)
- dupFile->dup = EAS_FALSE;
- else
- /* if we get here, there's a serious problem */
- return EAS_ERROR_HANDLE_INTEGRITY;
-
- /* clear this entry and return */
- file1->pFile = NULL;
- return EAS_SUCCESS;
- }
-
- /* no duplicates - close the file */
- if (fclose(file1->pFile) != 0)
- return EAS_ERROR_CLOSE_FAILED;
-
- /* clear this entry and return */
- file1->pFile = NULL;
- return EAS_SUCCESS;
-}
-#else
-/*----------------------------------------------------------------------------
- *
- * EAS_HWOpenFile
- *
- * Open a file for read or write
- *
- *----------------------------------------------------------------------------
-*/
-EAS_RESULT EAS_HWOpenFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_LOCATOR locator, EAS_FILE_HANDLE *pFile, EAS_FILE_MODE mode)
-{
- EAS_HW_FILE *file;
- FILE *ioFile;
- int i, temp;
-
- /* set return value to NULL */
- *pFile = NULL;
-
- /* simulate failure */
- if (errorConditions[eOpenError])
- return EAS_FAILURE;
-
- /* only support read mode at this time */
- if (mode != EAS_FILE_READ)
- return EAS_ERROR_INVALID_FILE_MODE;
-
- /* find an empty entry in the file table */
- file = hwInstData->files;
- for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
- {
- /* is this slot being used? */
- if (file->buffer == NULL)
- {
- /* open the file */
- if ((ioFile = fopen(locator,"rb")) == NULL)
- return EAS_ERROR_FILE_OPEN_FAILED;
-
- /* determine the file size */
- if (fseek(ioFile, 0L, SEEK_END) != 0)
- return EAS_ERROR_FILE_LENGTH;
- if ((file->fileSize = ftell(ioFile)) == -1L)
- return EAS_ERROR_FILE_LENGTH;
- if (fseek(ioFile, 0L, SEEK_SET) != 0)
- return EAS_ERROR_FILE_LENGTH;
-
- /* allocate a buffer */
- file->buffer = EAS_HWMalloc(hwInstData, file->fileSize);
- if (file->buffer == NULL)
- {
- fclose(ioFile);
- return EAS_ERROR_MALLOC_FAILED;
- }
-
- /* read the file into memory */
- temp = (int) fread(file->buffer, (size_t) file->fileSize, 1, ioFile);
-
- /* close the file - don't need it any more */
- fclose(ioFile);
-
- /* check for error reading file */
- if (temp != 1)
- return EAS_ERROR_FILE_READ_FAILED;
-
- /* initialize some values */
- file->filePos = 0;
- file->dup = EAS_FALSE;
-
- *pFile = file;
- return EAS_SUCCESS;
- }
- file++;
- }
-
- /* too many open files */
- return EAS_ERROR_MAX_FILES_OPEN;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWReadFile
- *
- * Read data from a file
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) available for customer use */
-EAS_RESULT EAS_HWReadFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *pBuffer, EAS_I32 n, EAS_I32 *pBytesRead)
-{
- EAS_I32 count;
-
- /* simulate failure */
- if (errorConditions[eReadError])
- return EAS_FAILURE;
-
- /* make sure we have a valid handle */
- if (file->buffer == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- /* calculate the bytes to read */
- count = file->fileSize - file->filePos;
- if (n < count)
- count = n;
-
- /* copy the data to the requested location, and advance the pointer */
- if (count)
- EAS_HWMemCpy(pBuffer, &file->buffer[file->filePos], count);
- file->filePos += count;
- *pBytesRead = count;
-
- /* were n bytes read? */
- if (count!= n)
- return EAS_EOF;
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWGetByte
- *
- * Read a byte from a file
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -e{715} hwInstData available for customer use */
-EAS_RESULT EAS_HWGetByte (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p)
-{
-
- /* simulate failure */
- if (errorConditions[eReadError])
- return EAS_FAILURE;
-
- /* make sure we have a valid handle */
- if (file->buffer == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- /* check for end of file */
- if (file->filePos >= file->fileSize)
- {
- *((EAS_U8*) p) = 0;
- return EAS_EOF;
- }
-
- /* get a character from the buffer */
- *((EAS_U8*) p) = file->buffer[file->filePos++];
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWGetWord
- *
- * Returns the current location in the file
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) available for customer use */
-EAS_RESULT EAS_HWGetWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst)
-{
- EAS_RESULT result;
- EAS_U8 c1, c2;
-
- /* read 2 bytes from the file */
- if ((result = EAS_HWGetByte(hwInstData, file, &c1)) != EAS_SUCCESS)
- return result;
- if ((result = EAS_HWGetByte(hwInstData, file, &c2)) != EAS_SUCCESS)
- return result;
-
- /* order them as requested */
- if (msbFirst)
- *((EAS_U16*) p) = ((EAS_U16) c1 << 8) | c2;
- else
- *((EAS_U16*) p) = ((EAS_U16) c2 << 8) | c1;
-
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWGetDWord
- *
- * Returns the current location in the file
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) available for customer use */
-EAS_RESULT EAS_HWGetDWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst)
-{
- EAS_RESULT result;
- EAS_U8 c1, c2,c3,c4;
-
- /* read 4 bytes from the file */
- if ((result = EAS_HWGetByte(hwInstData, file, &c1)) != EAS_SUCCESS)
- return result;
- if ((result = EAS_HWGetByte(hwInstData, file, &c2)) != EAS_SUCCESS)
- return result;
- if ((result = EAS_HWGetByte(hwInstData, file, &c3)) != EAS_SUCCESS)
- return result;
- if ((result = EAS_HWGetByte(hwInstData, file, &c4)) != EAS_SUCCESS)
- return result;
-
- /* order them as requested */
- if (msbFirst)
- *((EAS_U32*) p) = ((EAS_U32) c1 << 24) | ((EAS_U32) c2 << 16) | ((EAS_U32) c3 << 8) | c4;
- else
- *((EAS_U32*) p)= ((EAS_U32) c4 << 24) | ((EAS_U32) c3 << 16) | ((EAS_U32) c2 << 8) | c1;
-
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWFilePos
- *
- * Returns the current location in the file
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) available for customer use */
-EAS_RESULT EAS_HWFilePos (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pPosition)
-{
-
- /* simulate failure */
- if (errorConditions[ePosError])
- return EAS_FAILURE;
-
- /* make sure we have a valid handle */
- if (file->buffer == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- *pPosition = file->filePos;
- return EAS_SUCCESS;
-} /* end EAS_HWFilePos */
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWFileSeek
- *
- * Seek to a specific location in the file
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) available for customer use */
-EAS_RESULT EAS_HWFileSeek (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position)
-{
-
- /* simulate failure */
- if (errorConditions[eSeekError])
- return EAS_FAILURE;
-
- /* make sure we have a valid handle */
- if (file->buffer == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- /* validate new position */
- if ((position < 0) || (position > file->fileSize))
- return EAS_ERROR_FILE_SEEK;
-
- /* save new position */
- file->filePos = position;
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWFileSeekOfs
- *
- * Seek forward or back relative to the current position
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) available for customer use */
-EAS_RESULT EAS_HWFileSeekOfs (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position)
-{
-
- /* simulate failure */
- if (errorConditions[eSeekError])
- return EAS_FAILURE;
-
- /* make sure we have a valid handle */
- if (file->buffer == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- /* determine the file position */
- position += file->filePos;
- if ((position < 0) || (position > file->fileSize))
- return EAS_ERROR_FILE_SEEK;
-
- /* save new position */
- file->filePos = position;
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWFileLength
- *
- * Return the file length
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) available for customer use */
-EAS_RESULT EAS_HWFileLength (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pLength)
-{
-
- /* simulate failure */
- if (errorConditions[eLengthError])
- return EAS_FAILURE;
-
- /* make sure we have a valid handle */
- if (file->buffer == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- *pLength = file->fileSize;
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWDupHandle
- *
- * Duplicate a file handle
- *
- *----------------------------------------------------------------------------
-*/
-EAS_RESULT EAS_HWDupHandle (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_FILE_HANDLE *pDupFile)
-{
- EAS_HW_FILE *dupFile;
- int i;
-
- /* simulate failure */
- if (errorConditions[eDupError])
- return EAS_FAILURE;
-
- /* make sure we have a valid handle */
- if (file->buffer == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- /* find an empty entry in the file table */
- dupFile = hwInstData->files;
- for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
- {
- /* is this slot being used? */
- if (dupFile->buffer == NULL)
- {
-
- /* copy info from the handle to be duplicated */
- dupFile->filePos = file->filePos;
- dupFile->fileSize = file->fileSize;
- dupFile->buffer = file->buffer;
-
- /* set the duplicate handle flag */
- dupFile->dup = file->dup = EAS_TRUE;
-
- *pDupFile = dupFile;
- return EAS_SUCCESS;
- }
- dupFile++;
- }
-
- /* too many open files */
- return EAS_ERROR_MAX_FILES_OPEN;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWClose
- *
- * Wrapper for fclose function
- *
- *----------------------------------------------------------------------------
-*/
-EAS_RESULT EAS_HWCloseFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file1)
-{
- EAS_HW_FILE *file2,*dupFile;
- int i;
-
- /* simulate failure */
- if (errorConditions[eCloseError])
- return EAS_FAILURE;
-
- /* make sure we have a valid handle */
- if (file1->buffer == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- /* check for duplicate handle */
- if (file1->dup)
- {
- dupFile = NULL;
- file2 = hwInstData->files;
- for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
- {
- /* check for duplicate */
- if ((file1 != file2) && (file2->buffer == file1->buffer))
- {
- /* is there more than one duplicate? */
- if (dupFile != NULL)
- {
- /* clear this entry and return */
- file1->buffer = NULL;
- return EAS_SUCCESS;
- }
-
- /* this is the first duplicate found */
- else
- dupFile = file2;
- }
- file2++;
- }
-
- /* there is only one duplicate, clear the dup flag */
- if (dupFile)
- dupFile->dup = EAS_FALSE;
- else
- /* if we get here, there's a serious problem */
- return EAS_ERROR_HANDLE_INTEGRITY;
-
- /* clear this entry and return */
- file1->buffer = NULL;
- return EAS_SUCCESS;
- }
-
- /* no duplicates -free the buffer */
- EAS_HWFree(hwInstData, file1->buffer);
-
- /* clear this entry and return */
- file1->buffer = NULL;
- return EAS_SUCCESS;
-}
-#endif
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWVibrate
- *
- * Turn on/off vibrate function
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) available for customer use */
-EAS_RESULT EAS_HWVibrate (EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state)
-{
- vibState = state;
-// EAS_ReportX(_EAS_SEVERITY_NOFILTER, "Vibrate state: %d\n", state);
- return EAS_SUCCESS;
-} /* end EAS_HWVibrate */
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWLED
- *
- * Turn on/off LED
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) available for customer use */
-EAS_RESULT EAS_HWLED (EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state)
-{
- ledState = state;
-// EAS_ReportX(_EAS_SEVERITY_NOFILTER, "LED state: %d\n", state);
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWBackLight
- *
- * Turn on/off backlight
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) available for customer use */
-EAS_RESULT EAS_HWBackLight (EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state)
-{
- backlightState = state;
-// EAS_ReportX(_EAS_SEVERITY_NOFILTER, "Backlight state: %d\n", state);
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWYield
- *
- * This function is called periodically by the EAS library to give the
- * host an opportunity to allow other tasks to run. There are two ways to
- * use this call:
- *
- * If you have a multi-tasking OS, you can call the yield function in the
- * OS to allow other tasks to run. In this case, return EAS_FALSE to tell
- * the EAS library to continue processing when control returns from this
- * function.
- *
- * If tasks run in a single thread by sequential function calls (sometimes
- * call a "commutator loop"), return EAS_TRUE to cause the EAS Library to
- * return to the caller. Be sure to check the number of bytes rendered
- * before passing the audio buffer to the codec - it may not be filled.
- * The next call to EAS_Render will continue processing until the buffer
- * has been filled.
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) available for customer use */
-EAS_BOOL EAS_HWYield (EAS_HW_DATA_HANDLE hwInstData)
-{
- /* put your code here */
- return EAS_FALSE;
-}
-
-
+/*
+ * EASLib.c
+ * EASLIb
+ *
+ *
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+
+#include "eas.h"
+#include "eas_report.h"
+#include "eas_host.h"
+#include <AudioUnit/AudioUnit.h>
+#include <CoreServices/CoreServices.h>
+
+#ifdef JET_INTERFACE
+#include "jet.h"
+#endif
+
+
+#define EAS_EXPORT __attribute__((visibility("default")))
+
+// #define DEBUG_FILE_IO
+
+/* include debug interface */
+#include "eas_host_debug.h"
+
+#ifdef AUX_MIXER
+#include "eas_auxmix.h"
+#endif
+
+/* this module requires dynamic memory support */
+#ifdef _STATIC_MEMORY
+#error "eas_hostmm.c requires the dynamic memory model!\n"
+#endif
+
+#ifndef EAS_MAX_FILE_HANDLES
+#define EAS_MAX_FILE_HANDLES 32
+#endif
+
+#ifndef EAS_FILE_BUFFER_SIZE
+#define EAS_FILE_BUFFER_SIZE 32
+#endif
+
+/*
+ * this structure and the related function are here
+ * to support the ability to create duplicate handles
+ * and buffering it in memory. If your system uses
+ * in-memory resources, you can eliminate the calls
+ * to malloc and free, the dup flag, and simply track
+ * the file size and read position.
+ */
+ #ifdef BUFFERED_FILE_ACCESS
+typedef struct eas_hw_file_tag
+{
+ FILE *pFile;
+ EAS_I32 bytesInBuffer;
+ EAS_I32 readIndex;
+ EAS_I32 filePos;
+ EAS_I32 fileSize;
+ EAS_BOOL dup;
+ EAS_U8 buffer[EAS_FILE_BUFFER_SIZE];
+} EAS_HW_FILE;
+#else
+typedef struct eas_hw_file_tag
+{
+ EAS_I32 fileSize;
+ EAS_I32 filePos;
+ EAS_BOOL dup;
+ EAS_U8 *buffer;
+} EAS_HW_FILE;
+#endif
+
+typedef struct eas_hw_inst_data_tag
+{
+ EAS_HW_FILE files[EAS_MAX_FILE_HANDLES];
+} EAS_HW_INST_DATA;
+
+EAS_BOOL errorConditions[eNumErrorConditions];
+EAS_BOOL ledState;
+EAS_BOOL vibState;
+EAS_BOOL backlightState;
+
+#define MAX_DEBUG_MSG_LEN 1024
+
+typedef void (*EAS_LOG_FUNC)(EAS_INT severity, char *msg);
+
+static EAS_LOG_FUNC logCallback = NULL;
+static char messageBuffer[MAX_DEBUG_MSG_LEN];
+
+/* error counts */
+static EAS_INT eas_fatalErrors;
+static EAS_INT eas_errors;
+static EAS_INT eas_warnings;
+static int severityLevel = 9999;
+
+
+#define MAX_BUFFERS 8
+
+// The output unit
+AudioUnit OutputUnit;
+AudioStreamBasicDescription streamFormat;
+
+// sync stuf
+pthread_mutex_t mtx;
+pthread_cond_t cond;
+bool bStopped = true;
+
+// buffer to hold the data
+typedef struct
+{
+ UInt32 uOutBufferLength;
+ UInt32 uOutFrames;
+ int ix;
+ short* pData[8];
+ unsigned int uLength;
+} S_BUFFER_INFO;
+
+static S_BUFFER_INFO *pBuf = NULL;
+const S_EAS_LIB_CONFIG *pConfig = NULL;
+
+/*----------------------------------------------------------------------------
+ * ResetErrorCounters()
+ *----------------------------------------------------------------------------
+*/
+EAS_EXPORT void ResetErrorCounters()
+{
+ eas_fatalErrors = 0;
+ eas_errors = 0;
+ eas_warnings = 0;
+}
+
+/*----------------------------------------------------------------------------
+ * SetLogCallback()
+ *----------------------------------------------------------------------------
+*/
+EAS_EXPORT void SetLogCallback (EAS_LOG_FUNC callback)
+{
+ logCallback = callback;
+}
+
+#ifndef _NO_DEBUG_PREPROCESSOR
+static S_DEBUG_MESSAGES debugMessages[] =
+{
+#ifdef UNIFIED_DEBUG_MESSAGES
+#include "eas_debugmsgs.h"
+#endif
+ { 0,0,0 }
+};
+
+/*----------------------------------------------------------------------------
+ * EAS_ReportEx()
+ *----------------------------------------------------------------------------
+*/
+void EAS_ReportEx (int severity, unsigned long hashCode, int serialNum, ...)
+{
+ va_list vargs;
+ int i;
+
+ switch (severity)
+ {
+ case _EAS_SEVERITY_FATAL:
+ eas_fatalErrors++;
+ break;
+
+ case _EAS_SEVERITY_ERROR:
+ eas_errors++;
+ break;
+
+ case _EAS_SEVERITY_WARNING:
+ eas_warnings++;
+ break;
+
+ default:
+ break;
+ }
+
+ /* check severity level */
+ if (severity > severityLevel)
+ return;
+
+ /* check for callback */
+ if (logCallback == NULL)
+ return;
+
+ /* find the error message and output to stdout */
+ for (i = 0; debugMessages[i].m_pDebugMsg; i++)
+ {
+ if ((debugMessages[i].m_nHashCode == hashCode) &&
+ (debugMessages[i].m_nSerialNum == serialNum))
+ {
+ va_start(vargs, serialNum);
+#ifdef WIN32
+ vsprintf_s(messageBuffer, sizeof(messageBuffer), fmt, vargs);
+#else
+ vsprintf(messageBuffer, debugMessages[i].m_pDebugMsg, vargs);
+#endif
+ logCallback(severity, messageBuffer);
+ va_end(vargs);
+ return;
+ }
+ }
+ printf("Unrecognized error: Severity=%d; HashCode=%lu; SerialNum=%d\n", severity, hashCode, serialNum);
+} /* end EAS_ReportEx */
+
+#else
+/*----------------------------------------------------------------------------
+ * EAS_Report()
+ *----------------------------------------------------------------------------
+*/
+void EAS_Report (int severity, const char *fmt, ...)
+{
+ va_list vargs;
+
+ switch (severity)
+ {
+ case _EAS_SEVERITY_FATAL:
+ eas_fatalErrors++;
+ break;
+
+ case _EAS_SEVERITY_ERROR:
+ eas_errors++;
+ break;
+
+ case _EAS_SEVERITY_WARNING:
+ eas_warnings++;
+ break;
+
+ default:
+ break;
+ }
+
+ /* check severity level */
+ if (severity > severityLevel)
+ return;
+
+ /* check for callback */
+ if (logCallback == NULL)
+ return;
+
+ va_start(vargs, fmt);
+#ifdef _WIN32
+ vsprintf_s(messageBuffer, sizeof(messageBuffer), fmt, vargs);
+#else
+ vsprintf(messageBuffer, fmt, vargs);
+#endif
+ logCallback(severity, messageBuffer);
+ va_end(vargs);
+} /* end EAS_Report */
+
+/*----------------------------------------------------------------------------
+ * EAS_ReportX()
+ *----------------------------------------------------------------------------
+*/
+void EAS_ReportX (int severity, const char *fmt, ...)
+{
+ va_list vargs;
+
+ switch (severity)
+ {
+ case _EAS_SEVERITY_FATAL:
+ eas_fatalErrors++;
+ break;
+
+ case _EAS_SEVERITY_ERROR:
+ eas_errors++;
+ break;
+
+ case _EAS_SEVERITY_WARNING:
+ eas_warnings++;
+ break;
+
+ default:
+ break;
+ }
+
+ /* check severity level */
+ if (severity > severityLevel)
+ return;
+
+ /* check for callback */
+ if (logCallback == NULL)
+ return;
+
+ va_start(vargs, fmt);
+#ifdef _WIN32
+ vsprintf_s(messageBuffer, sizeof(messageBuffer), fmt, vargs);
+#else
+ vsprintf(messageBuffer, fmt, vargs);
+#endif
+ logCallback(severity, messageBuffer);
+ va_end(vargs);
+}
+#endif
+
+/*----------------------------------------------------------------------------
+ * EAS_DLLSetDebugLevel()
+ *----------------------------------------------------------------------------
+*/
+EAS_EXPORT void EAS_DLLSetDebugLevel (int severity)
+{
+ severityLevel = severity;
+}
+
+/*----------------------------------------------------------------------------
+ * EAS_ExSetDebugLevel()
+ *----------------------------------------------------------------------------
+*/
+void EAS_SetDebugLevel (int severity)
+{
+ severityLevel = severity;
+}
+
+/*----------------------------------------------------------------------------
+ * EAS_SelectLibrary()
+ *----------------------------------------------------------------------------
+*/
+EAS_EXPORT EAS_RESULT EAS_SelectLib (EAS_DATA_HANDLE pEASData, EAS_HANDLE streamHandle, EAS_BOOL testLib)
+{
+ extern EAS_SNDLIB_HANDLE VMGetLibHandle(EAS_INT libNum);
+ return EAS_SetSoundLibrary(pEASData, streamHandle, VMGetLibHandle(testLib ? 1 : 0));
+}
+
+// Callback proc
+static OSStatus RenderProc( void *inRefCon,
+ AudioUnitRenderActionFlags *ioActionFlags,
+ const AudioTimeStamp *inTimeStamp,
+ UInt32 inBusNumber,
+ UInt32 inNumberFrames,
+ AudioBufferList *ioData)
+{
+ // Get the mutex
+ pthread_mutex_lock(&mtx);
+
+ short* ptrOutL = (short *)ioData->mBuffers[0].mData;
+ short* ptrOutR = (short *)ioData->mBuffers[1].mData;
+
+ memset(ptrOutL, 0, pBuf->uOutFrames);
+ memset(ptrOutR, 0, pBuf->uOutFrames);
+
+ // check if there is any data in the buffer
+ if (pBuf->ix == 0 )
+ {
+ // Release the mutex and signal the python thread
+ pthread_mutex_unlock(&mtx);
+ pthread_cond_signal(&cond);
+ return 0;
+ }
+
+ // Get a ptr to the data
+ short* pData = pBuf->pData[--(pBuf->ix)];
+
+ // Now copy the data
+ int i;
+ for (i = 0; i < pBuf->uOutFrames; i+=2 )
+ {
+ *ptrOutL++ = pData[i];
+ *ptrOutR++ = pData[i+1];
+ }
+
+ // Release the mutex
+ pthread_mutex_unlock(&mtx);
+ pthread_cond_signal(&cond);
+
+ return 0;
+}
+
+EAS_RESULT addData(EAS_PCM *pAudioBuffer)
+{
+ // Copy the data we got from the synth
+ memcpy(pBuf->pData[(pBuf->ix)++], pAudioBuffer, 2048);
+
+ // Start the output Audio Unit only the first time
+ if ( bStopped == true )
+ {
+ bStopped = false;
+ OSStatus err = AudioOutputUnitStart (OutputUnit);
+ if (err)
+ {
+ printf ("AudioDeviceStart=%ld\n", err);
+ return EAS_FAILURE;
+ }
+ }
+
+ return EAS_SUCCESS;
+}
+
+
+EAS_EXPORT EAS_RESULT EAS_RenderWaveOut(EAS_DATA_HANDLE easHandle, EAS_PCM *pAudioBuffer, EAS_I32 numRequested, EAS_I32 *pNumGenerated)
+{
+ // Get the mutex
+ pthread_mutex_lock(&mtx);
+
+ // Check if our buffer is full
+ while(pBuf->ix == MAX_BUFFERS - 1)
+ pthread_cond_wait(&cond, &mtx);
+
+ // Call the synth the render a buffer
+ EAS_RESULT result = EAS_Render(easHandle, pAudioBuffer, numRequested, pNumGenerated);
+ addData( pAudioBuffer );
+
+ // Release the mutex
+ pthread_mutex_unlock(&mtx);
+
+ //Done
+ return result;
+}
+
+#ifdef AUX_MIXER
+EAS_EXPORT EAS_RESULT EAS_RenderAuxMixerWaveOut (EAS_DATA_HANDLE easHandle, EAS_PCM *pAudioBuffer, EAS_I32 *pNumGenerated)
+{
+ // Get the mutex
+ pthread_mutex_lock(&mtx);
+
+ // Check if our buffer is full
+ while(pBuf->ix == MAX_BUFFERS - 1)
+ pthread_cond_wait(&cond, &mtx);
+
+ EAS_RESULT result = EAS_RenderAuxMixer(easHandle, pAudioBuffer, pNumGenerated);
+ addData( pAudioBuffer );
+
+ // Release the mutex
+ pthread_mutex_unlock(&mtx);
+
+ return result;
+}
+#endif
+
+EAS_EXPORT EAS_RESULT OpenWaveOutDevice(EAS_INT devNum, EAS_INT sampleRate, EAS_INT maxBufSize)
+{
+ // Open the default output unit
+ ComponentDescription desc;
+ desc.componentType = kAudioUnitType_Output;
+ desc.componentSubType = kAudioUnitSubType_DefaultOutput;
+ desc.componentManufacturer = kAudioUnitManufacturer_Apple;
+ desc.componentFlags = 0;
+ desc.componentFlagsMask = 0;
+
+ Component comp = FindNextComponent(NULL, &desc);
+ if (comp == NULL)
+ {
+ printf ("Could find the default output unit!!!\n");
+ return EAS_FAILURE;
+ }
+
+ OSStatus err = OpenAComponent(comp, &OutputUnit);
+ if (comp == NULL)
+ {
+ printf ("OpenAComponent=%ld\n", err);
+ return EAS_FAILURE;
+ }
+
+ // Set up a callback function to generate output to the output unit
+ AURenderCallbackStruct auRenderCallback;
+ auRenderCallback.inputProc = RenderProc;
+ auRenderCallback.inputProcRefCon = NULL;
+
+ err = AudioUnitSetProperty (OutputUnit,
+ kAudioUnitProperty_SetRenderCallback,
+ kAudioUnitScope_Input,
+ 0,
+ &auRenderCallback,
+ sizeof(auRenderCallback));
+ if (err)
+ {
+ printf ("AudioUnitSetProperty-CB=%ld\n", err);
+ return EAS_FAILURE;;
+ }
+
+ pConfig = EAS_Config();
+
+ // The synth engine already uses short* for the buffers so let CoreAudio do any conversions if needed
+ if (sampleRate != 0)
+ streamFormat.mSampleRate = sampleRate;
+ else
+ streamFormat.mSampleRate = pConfig->sampleRate;
+
+ streamFormat.mFormatID = kAudioFormatLinearPCM;
+ streamFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger
+ | kAudioFormatFlagsNativeEndian
+ | kLinearPCMFormatFlagIsPacked
+ | kAudioFormatFlagIsNonInterleaved;
+
+ streamFormat.mBytesPerPacket = 2;
+ streamFormat.mFramesPerPacket = 1;
+ streamFormat.mBytesPerFrame = 2;
+ streamFormat.mChannelsPerFrame = 2;
+ streamFormat.mBitsPerChannel = 16;
+
+ err = AudioUnitSetProperty (OutputUnit,
+ kAudioUnitProperty_StreamFormat,
+ kAudioUnitScope_Input,
+ 0,
+ &streamFormat,
+ sizeof(AudioStreamBasicDescription));
+ if (err)
+ {
+ printf ("AudioUnitSetProperty-SF= %4.4s, %ld\n", (char*)&err, err);
+ return EAS_FAILURE;
+ }
+
+ // Initialize
+ err = AudioUnitInitialize(OutputUnit);
+ if (err)
+ {
+ printf ("AudioUnitInitialize = %ld\n", err);
+ return EAS_FAILURE;
+ }
+
+ pBuf = (S_BUFFER_INFO *) malloc(sizeof(S_BUFFER_INFO));
+ if( !pBuf )
+ return EAS_FAILURE;
+
+ pBuf->uOutBufferLength = pConfig->mixBufferSize * streamFormat.mBitsPerChannel / 2;
+ UInt32 uDataSize = sizeof(pBuf->uOutBufferLength);
+
+ err = AudioUnitSetProperty(OutputUnit, kAudioDevicePropertyBufferSize, kAudioUnitScope_Output, 0, &pBuf->uOutBufferLength, uDataSize);
+ if (err)
+ {
+ printf ("AudioUnitSetProperty = %ld\n", err);
+ return EAS_FAILURE;
+ }
+
+ err = AudioUnitGetProperty(OutputUnit, kAudioDevicePropertyBufferSize, kAudioUnitScope_Output, 0, &pBuf->uOutBufferLength, &uDataSize);
+ if (err)
+ {
+ printf ("AudioUnitGetProperty = %ld\n", err);
+ return EAS_FAILURE;
+ }
+
+ pBuf->uLength = pBuf->uOutBufferLength;
+ int i;
+ for ( i = 0; i < MAX_BUFFERS; i++)
+ pBuf->pData[i] = malloc(pBuf->uLength);
+
+ pBuf->uOutBufferLength /= pConfig->numChannels;
+ pBuf->uOutFrames = pBuf->uOutBufferLength / sizeof(short);
+
+ pBuf->ix = 0;
+
+ // Init the stop flag
+ bStopped = true;
+
+ int result = pthread_mutex_init(&mtx, NULL);
+ if (result)
+ {
+ printf("pthread_mutex_init failed\n");
+ return EAS_FAILURE;
+ }
+
+ result = pthread_cond_init(&cond, NULL);
+ if (result)
+ {
+ printf("pthread_cond_init failed\n");
+ return EAS_FAILURE;
+ }
+
+ // Done
+ return EAS_SUCCESS;
+}
+
+
+EAS_EXPORT EAS_RESULT StartStream()
+{
+ OSStatus err = noErr;
+ pthread_mutex_lock(&mtx);
+ if ( bStopped == true )
+ {
+ err = AudioOutputUnitStart (OutputUnit);
+ if (err)
+ {
+ printf ("AudioOutputUnitStart=%ld\n", err);
+ return EAS_FAILURE;
+ }
+ bStopped = false;
+ }
+
+ return EAS_SUCCESS;
+}
+
+
+EAS_EXPORT EAS_RESULT CloseWaveOutDevice()
+{
+ OSStatus err;
+
+ pthread_mutex_lock(&mtx);
+ if( false == bStopped )
+ {
+ AudioOutputUnitStop (OutputUnit);
+ bStopped = true;
+
+ err = AudioUnitUninitialize (OutputUnit);
+ if (err)
+ {
+ printf ("AudioUnitUninitialize=%ld\n", err);
+ return EAS_FAILURE;
+ }
+
+ CloseComponent (OutputUnit);
+ int i = 0;
+ for(i; i < MAX_BUFFERS; i++)
+ free(pBuf->pData[i]);
+
+ free(pBuf);
+ }
+
+ pthread_mutex_unlock(&mtx);
+ return EAS_SUCCESS;
+}
+
+
+#if defined(_DEBUG) && !defined(MSC)
+#include <crtdbg.h>
+/*----------------------------------------------------------------------------
+ * EnableHeapDebug()
+ *----------------------------------------------------------------------------
+*/
+static void EnableHeapDebug (void)
+{
+ int temp;
+ temp = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
+ temp |= _CRTDBG_ALLOC_MEM_DF;
+ temp |= _CRTDBG_CHECK_ALWAYS_DF;
+ temp |= _CRTDBG_LEAK_CHECK_DF;
+// temp |= _CRTDBG_DELAY_FREE_MEM_DF;
+ _CrtSetDbgFlag(temp);
+}
+
+/*----------------------------------------------------------------------------
+ * HeapCheck()
+ *----------------------------------------------------------------------------
+ * Check heap status
+ *----------------------------------------------------------------------------
+*/
+void HeapCheck (void)
+{
+ int heapStatus;
+
+ /* Check heap status */
+ heapStatus = _heapchk();
+ if ((heapStatus == _HEAPOK) || (heapStatus == _HEAPEMPTY))
+ return;
+
+ EAS_ReportX(_EAS_SEVERITY_FATAL, "Heap corrupt\n" );
+}
+#endif
+
+
+/*----------------------------------------------------------------------------
+ * EAS_HWInit
+ *
+ * Initialize host wrapper interface
+ *
+ *----------------------------------------------------------------------------
+*/
+EAS_RESULT EAS_HWInit (EAS_HW_DATA_HANDLE *pHWInstData)
+{
+
+#if defined(_DEBUG) && !defined(MSC)
+ EnableHeapDebug();
+#endif
+
+ #ifdef BUFFERED_FILE_ACCESS
+ EAS_ReportX(_EAS_SEVERITY_INFO, "EAS_HWInit: Buffered file access\n");
+ #else
+ EAS_ReportX(_EAS_SEVERITY_INFO, "EAS_HWInit: Memory mapped file access\n");
+ #endif
+
+ /* simulate failure */
+ if (errorConditions[eInitError])
+ return EAS_FAILURE;
+
+ /* need to track file opens for duplicate handles */
+ *pHWInstData = malloc(sizeof(EAS_HW_INST_DATA));
+ if (!(*pHWInstData))
+ return EAS_ERROR_MALLOC_FAILED;
+
+ EAS_HWMemSet(*pHWInstData, 0, sizeof(EAS_HW_INST_DATA));
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ * EAS_HWShutdown
+ *
+ * Shut down host wrapper interface
+ *
+ *----------------------------------------------------------------------------
+*/
+EAS_RESULT EAS_HWShutdown (EAS_HW_DATA_HANDLE hwInstData)
+{
+
+ /* simulate failure */
+ if (errorConditions[eShutdownError])
+ return EAS_FAILURE;
+
+ free(hwInstData);
+
+#if defined(_DEBUG) && !defined(MSC)
+ HeapCheck();
+#endif
+
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWMalloc
+ *
+ * Allocates dynamic memory
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) available for customer use */
+void *EAS_HWMalloc (EAS_HW_DATA_HANDLE hwInstData, EAS_I32 size)
+{
+ /* simulate failure */
+ if (errorConditions[eMallocError])
+ return NULL;
+
+ return malloc((size_t) size);
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWFree
+ *
+ * Frees dynamic memory
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) available for customer use */
+void EAS_HWFree (EAS_HW_DATA_HANDLE hwInstData, void *p)
+{
+ free(p);
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWMemCpy
+ *
+ * Copy memory wrapper
+ *
+ *----------------------------------------------------------------------------
+*/
+void *EAS_HWMemCpy (void *dest, const void *src, EAS_I32 amount)
+{
+ return memcpy(dest, src, (size_t) amount);
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWMemSet
+ *
+ * Set memory wrapper
+ *
+ *----------------------------------------------------------------------------
+*/
+void *EAS_HWMemSet (void *dest, int val, EAS_I32 amount)
+{
+ return memset(dest, val, (size_t) amount);
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWMemCmp
+ *
+ * Compare memory wrapper
+ *
+ *----------------------------------------------------------------------------
+*/
+EAS_I32 EAS_HWMemCmp (const void *s1, const void *s2, EAS_I32 amount)
+{
+ return (EAS_I32) memcmp(s1, s2, (size_t) amount);
+}
+
+#ifdef BUFFERED_FILE_ACCESS
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWOpenFile
+ *
+ * Open a file for read or write
+ *
+ *----------------------------------------------------------------------------
+*/
+EAS_RESULT EAS_HWOpenFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_LOCATOR locator, EAS_FILE_HANDLE *pFile, EAS_FILE_MODE mode)
+{
+ EAS_HW_FILE *file;
+ int i;
+
+ /* set return value to NULL */
+ *pFile = NULL;
+
+ /* only support read mode at this time */
+ if (mode != EAS_FILE_READ)
+ return EAS_ERROR_INVALID_FILE_MODE;
+
+ /* find an empty entry in the file table */
+ file = hwInstData->files;
+ for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
+ {
+ /* is this slot being used? */
+ if (file->pFile == NULL)
+ {
+ EAS_RESULT result;
+
+ /* open the file */
+ file->pFile = fopen((const char*) locator, "rb");
+ if (file->pFile == NULL)
+ return EAS_ERROR_FILE_OPEN_FAILED;
+
+ /* get file length */
+ if ((result = EAS_HWFileLength(hwInstData, file, &file->fileSize)) != EAS_SUCCESS)
+ {
+ EAS_HWCloseFile(hwInstData, file);
+ return result;
+ }
+
+#ifdef DEBUG_FILE_IO
+ EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWOpenFile: Open file %d\n", i);
+#endif
+
+ /* initialize some values */
+ file->bytesInBuffer = 0;
+ file->readIndex = 0;
+ file->filePos = 0;
+ file->dup = EAS_FALSE;
+
+ *pFile = file;
+ return EAS_SUCCESS;
+ }
+ file++;
+ }
+
+ /* too many open files */
+ return EAS_ERROR_MAX_FILES_OPEN;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWFillBuffer
+ *
+ * Fill buffer from file
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) hwInstData available for customer use */
+EAS_RESULT EAS_HWFillBuffer (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file)
+{
+ /* reposition the file pointer */
+ if (fseek(file->pFile, file->filePos, SEEK_SET) != 0)
+ return EAS_ERROR_FILE_SEEK;
+
+ /* read some data from the file */
+ file->bytesInBuffer = (EAS_I32) fread(file->buffer, 1, EAS_FILE_BUFFER_SIZE, file->pFile);
+ file->readIndex = 0;
+ if (file->bytesInBuffer == 0)
+ return EAS_EOF;
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWReadFile
+ *
+ * Read data from a file
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) hwInstData available for customer use */
+EAS_RESULT EAS_HWReadFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *pBuffer, EAS_I32 n, EAS_I32 *pBytesRead)
+{
+ EAS_RESULT result;
+ EAS_I32 temp;
+ EAS_U8 *p = pBuffer;
+ EAS_I32 bytesLeft = n;
+
+ *pBytesRead = 0;
+
+ /* check handle integrity */
+ if (file->pFile == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+#ifdef DEBUG_FILE_IO
+ EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWReadFile: Reading %d bytes from position %d\n", n, file->filePos);
+#endif
+
+ /* try to fulfill request from buffer */
+ for (;bytesLeft > 0;)
+ {
+ /* how many bytes can we get from buffer? */
+ temp = file->bytesInBuffer - file->readIndex;
+ if (temp > bytesLeft)
+ temp = bytesLeft;
+
+ /* copy data from buffer */
+ EAS_HWMemCpy(p, &file->buffer[file->readIndex], temp);
+ *pBytesRead += temp;
+ file->readIndex += temp;
+ file->filePos += temp;
+ p += temp;
+ bytesLeft -= temp;
+
+ /* don't refill buffer if request is bigger than buffer */
+ if ((bytesLeft == 0) || (bytesLeft >= EAS_FILE_BUFFER_SIZE))
+ break;
+
+ /* refill buffer */
+ if ((result = EAS_HWFillBuffer(hwInstData, file)) != EAS_SUCCESS)
+ return result;
+ }
+
+ /* more to read? do unbuffered read directly to target memory */
+ if (bytesLeft)
+ {
+
+ /* position the file pointer */
+ if (fseek(file->pFile, file->filePos, SEEK_SET) != 0)
+ return EAS_ERROR_FILE_SEEK;
+
+ /* read data in the buffer */
+ temp = (EAS_I32) fread(p, 1, (size_t) bytesLeft, file->pFile);
+ *pBytesRead += temp;
+ file->filePos += temp;
+
+ /* reset buffer info */
+ file->bytesInBuffer = 0;
+ file->readIndex = 0;
+ }
+
+#ifdef DEBUG_FILE_IO
+ {
+#define BYTES_PER_LINE 16
+ char str[BYTES_PER_LINE * 3 + 1];
+ EAS_INT i;
+ for (i = 0; i < (n > BYTES_PER_LINE ? BYTES_PER_LINE : n) ; i ++)
+ sprintf(&str[i*3], "%02x ", ((EAS_U8*)pBuffer)[i]);
+ if (i)
+ EAS_ReportX(_EAS_SEVERITY_NOFILTER, "%s\n", str);
+ }
+#endif
+
+ /* were n bytes read? */
+ if (*pBytesRead != n)
+ return EAS_EOF;
+
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWGetByte
+ *
+ * Read a byte from a file
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) hwInstData available for customer use */
+EAS_RESULT EAS_HWGetByte (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p)
+{
+ EAS_RESULT result;
+
+ /* check handle integrity */
+ if (file->pFile == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ /* use local buffer - do we have any data? */
+ if (file->readIndex >= file->bytesInBuffer)
+ {
+ if ((result = EAS_HWFillBuffer(hwInstData, file)) != EAS_SUCCESS)
+ return result;
+
+ /* if nothing to read, return EOF */
+ if (file->bytesInBuffer == 0)
+ return EAS_EOF;
+ }
+
+ /* get a character from the buffer */
+ *((EAS_U8*) p) = file->buffer[file->readIndex++];
+
+#ifdef DEBUG_FILE_IO
+ EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWGetByte: Reading from position %d, byte = 0x%02x\n", file->filePos, *(EAS_U8*)p);
+#endif
+
+ file->filePos++;
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWGetWord
+ *
+ * Read a 16-bit value from the file
+ *----------------------------------------------------------------------------
+*/
+EAS_RESULT EAS_HWGetWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst)
+{
+ EAS_RESULT result;
+ EAS_I32 count;
+ EAS_U8 c[2];
+
+#ifdef DEBUG_FILE_IO
+ EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWGetWord: Reading 2 bytes from position %d\n", file->filePos);
+#endif
+
+ /* read 2 bytes from the file */
+ if ((result = EAS_HWReadFile(hwInstData, file, c, 2, &count)) != EAS_SUCCESS)
+ return result;
+
+ /* order them as requested */
+ if (msbFirst)
+ *((EAS_U16*) p) = ((EAS_U16) c[0] << 8) | c[1];
+ else
+ *((EAS_U16*) p) = ((EAS_U16) c[1] << 8) | c[0];
+
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWGetDWord
+ *
+ * Read a 16-bit value from the file
+ *----------------------------------------------------------------------------
+*/
+EAS_RESULT EAS_HWGetDWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst)
+{
+ EAS_RESULT result;
+ EAS_I32 count;
+ EAS_U8 c[4];
+
+#ifdef DEBUG_FILE_IO
+ EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWGetDWord: Reading 4 bytes from position %d\n", file->filePos);
+#endif
+
+ /* read 4 bytes from the file */
+ if ((result = EAS_HWReadFile(hwInstData, file, c, 4, &count)) != EAS_SUCCESS)
+ return result;
+
+ /* order them as requested */
+ if (msbFirst)
+ *((EAS_U32*) p) = ((EAS_U32) c[0] << 24) | ((EAS_U32) c[1] << 16) | ((EAS_U32) c[2] << 8) | c[3];
+ else
+ *((EAS_U32*) p) = ((EAS_U32) c[3] << 24) | ((EAS_U32) c[2] << 16) | ((EAS_U32) c[1] << 8) | c[0];
+
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWFilePos
+ *
+ * Returns the current location in the file
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) hwInstData available for customer use */
+EAS_RESULT EAS_HWFilePos (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pPosition)
+{
+
+ /* check handle integrity */
+ if (file->pFile == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ *pPosition = file->filePos;
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWFileSeek
+ *
+ * Seek to a specific location in the file
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) hwInstData available for customer use */
+EAS_RESULT EAS_HWFileSeek (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position)
+{
+ EAS_I32 newIndex;
+
+ /* check handle integrity */
+ if (file->pFile == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ /* check for seek past end */
+ if ((position < 0) || (position > file->fileSize))
+ return EAS_ERROR_FILE_SEEK;
+
+#ifdef DEBUG_FILE_IO
+ EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWFileSeek: Seeking to new position %d\n", file->filePos);
+#endif
+
+ /* is new position in current buffer? */
+ newIndex = position - file->filePos + file->readIndex;
+ if ((newIndex >= 0) && (newIndex < file->bytesInBuffer))
+ {
+ file->readIndex = newIndex;
+ file->filePos = position;
+ return EAS_SUCCESS;
+ }
+
+ /* save new position and reset buffer info so EAS_HWGetByte doesn't fail */
+ file->filePos = position;
+ file->bytesInBuffer = 0;
+ file->readIndex = 0;
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWFileSeekOfs
+ *
+ * Seek forward or back relative to the current position
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) hwInstData available for customer use */
+EAS_RESULT EAS_HWFileSeekOfs (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position)
+{
+ EAS_I32 temp;
+
+#ifdef DEBUG_FILE_IO
+ EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWFileSeekOfs: Seeking to new position %d\n", file->filePos + position);
+#endif
+
+ /* check handle integrity */
+ if (file->pFile == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ /* check for seek past end */
+ temp = file->filePos + position;
+ if ((temp < 0) || (temp > file->fileSize))
+ return EAS_ERROR_FILE_SEEK;
+
+ /* is new position in current buffer? */
+ temp = position + file->readIndex;
+ if ((temp >= 0) && (temp < file->bytesInBuffer))
+ {
+ file->readIndex = temp;
+ file->filePos += position;
+ return EAS_SUCCESS;
+ }
+
+ /* save new position and reset buffer info so EAS_HWGetByte doesn't fail */
+ file->filePos += position;
+ file->bytesInBuffer = 0;
+ file->readIndex = 0;
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWFileLength
+ *
+ * Return the file length
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) hwInstData available for customer use */
+EAS_RESULT EAS_HWFileLength (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pLength)
+{
+ long pos;
+
+ /* check handle integrity */
+ if (file->pFile == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ if ((pos = ftell(file->pFile)) == -1L)
+ return EAS_ERROR_FILE_LENGTH;
+ if (fseek(file->pFile, 0L, SEEK_END) != 0)
+ return EAS_ERROR_FILE_LENGTH;
+ if ((*pLength = ftell(file->pFile)) == -1L)
+ return EAS_ERROR_FILE_LENGTH;
+ if (fseek(file->pFile, pos, SEEK_SET) != 0)
+ return EAS_ERROR_FILE_LENGTH;
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWDupHandle
+ *
+ * Duplicate a file handle
+ *
+ *----------------------------------------------------------------------------
+*/
+EAS_RESULT EAS_HWDupHandle (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_FILE_HANDLE* pDupFile)
+{
+ EAS_HW_FILE *dupfile;
+ int i;
+
+ /* check handle integrity */
+ *pDupFile = NULL;
+ if (file->pFile == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ /* find an empty entry in the file table */
+ dupfile = hwInstData->files;
+ for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
+ {
+ /* is this slot being used? */
+ if (dupfile->pFile == NULL)
+ {
+
+ /* copy info from the handle to be duplicated */
+ dupfile->filePos = file->filePos;
+ dupfile->pFile = file->pFile;
+ dupfile->fileSize = file->fileSize;
+
+ /* set the duplicate handle flag */
+ dupfile->dup = file->dup = EAS_TRUE;
+
+ /* initialize some values */
+ dupfile->bytesInBuffer = 0;
+ dupfile->readIndex = 0;
+
+ *pDupFile = dupfile;
+ return EAS_SUCCESS;
+ }
+ dupfile++;
+ }
+
+ /* too many open files */
+ return EAS_ERROR_MAX_FILES_OPEN;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWClose
+ *
+ * Wrapper for fclose function
+ *
+ *----------------------------------------------------------------------------
+*/
+EAS_RESULT EAS_HWCloseFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file1)
+{
+ EAS_HW_FILE *file2,*dupFile;
+ int i;
+
+ /* check handle integrity */
+ if (file1->pFile == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ /* check for duplicate handle */
+ if (file1->dup)
+ {
+ dupFile = NULL;
+ file2 = hwInstData->files;
+ for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
+ {
+ /* check for duplicate */
+ if ((file1 != file2) && (file2->pFile == file1->pFile))
+ {
+ /* is there more than one duplicate? */
+ if (dupFile != NULL)
+ {
+ /* clear this entry and return */
+ file1->pFile = NULL;
+ return EAS_SUCCESS;
+ }
+
+ /* this is the first duplicate found */
+ dupFile = file2;
+ }
+ file2++;
+ }
+
+ /* there is only one duplicate, clear the dup flag */
+ if (dupFile)
+ dupFile->dup = EAS_FALSE;
+ else
+ /* if we get here, there's a serious problem */
+ return EAS_ERROR_HANDLE_INTEGRITY;
+
+ /* clear this entry and return */
+ file1->pFile = NULL;
+ return EAS_SUCCESS;
+ }
+
+ /* no duplicates - close the file */
+ if (fclose(file1->pFile) != 0)
+ return EAS_ERROR_CLOSE_FAILED;
+
+ /* clear this entry and return */
+ file1->pFile = NULL;
+ return EAS_SUCCESS;
+}
+#else
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWOpenFile
+ *
+ * Open a file for read or write
+ *
+ *----------------------------------------------------------------------------
+*/
+EAS_RESULT EAS_HWOpenFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_LOCATOR locator, EAS_FILE_HANDLE *pFile, EAS_FILE_MODE mode)
+{
+ EAS_HW_FILE *file;
+ FILE *ioFile;
+ int i, temp;
+
+ /* set return value to NULL */
+ *pFile = NULL;
+
+ /* simulate failure */
+ if (errorConditions[eOpenError])
+ return EAS_FAILURE;
+
+ /* only support read mode at this time */
+ if (mode != EAS_FILE_READ)
+ return EAS_ERROR_INVALID_FILE_MODE;
+
+ /* find an empty entry in the file table */
+ file = hwInstData->files;
+ for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
+ {
+ /* is this slot being used? */
+ if (file->buffer == NULL)
+ {
+ /* open the file */
+ if ((ioFile = fopen(locator,"rb")) == NULL)
+ return EAS_ERROR_FILE_OPEN_FAILED;
+
+ /* determine the file size */
+ if (fseek(ioFile, 0L, SEEK_END) != 0)
+ return EAS_ERROR_FILE_LENGTH;
+ if ((file->fileSize = ftell(ioFile)) == -1L)
+ return EAS_ERROR_FILE_LENGTH;
+ if (fseek(ioFile, 0L, SEEK_SET) != 0)
+ return EAS_ERROR_FILE_LENGTH;
+
+ /* allocate a buffer */
+ file->buffer = EAS_HWMalloc(hwInstData, file->fileSize);
+ if (file->buffer == NULL)
+ {
+ fclose(ioFile);
+ return EAS_ERROR_MALLOC_FAILED;
+ }
+
+ /* read the file into memory */
+ temp = (int) fread(file->buffer, (size_t) file->fileSize, 1, ioFile);
+
+ /* close the file - don't need it any more */
+ fclose(ioFile);
+
+ /* check for error reading file */
+ if (temp != 1)
+ return EAS_ERROR_FILE_READ_FAILED;
+
+ /* initialize some values */
+ file->filePos = 0;
+ file->dup = EAS_FALSE;
+
+ *pFile = file;
+ return EAS_SUCCESS;
+ }
+ file++;
+ }
+
+ /* too many open files */
+ return EAS_ERROR_MAX_FILES_OPEN;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWReadFile
+ *
+ * Read data from a file
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) available for customer use */
+EAS_RESULT EAS_HWReadFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *pBuffer, EAS_I32 n, EAS_I32 *pBytesRead)
+{
+ EAS_I32 count;
+
+ /* simulate failure */
+ if (errorConditions[eReadError])
+ return EAS_FAILURE;
+
+ /* make sure we have a valid handle */
+ if (file->buffer == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ /* calculate the bytes to read */
+ count = file->fileSize - file->filePos;
+ if (n < count)
+ count = n;
+
+ /* copy the data to the requested location, and advance the pointer */
+ if (count)
+ EAS_HWMemCpy(pBuffer, &file->buffer[file->filePos], count);
+ file->filePos += count;
+ *pBytesRead = count;
+
+ /* were n bytes read? */
+ if (count!= n)
+ return EAS_EOF;
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWGetByte
+ *
+ * Read a byte from a file
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -e{715} hwInstData available for customer use */
+EAS_RESULT EAS_HWGetByte (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p)
+{
+
+ /* simulate failure */
+ if (errorConditions[eReadError])
+ return EAS_FAILURE;
+
+ /* make sure we have a valid handle */
+ if (file->buffer == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ /* check for end of file */
+ if (file->filePos >= file->fileSize)
+ {
+ *((EAS_U8*) p) = 0;
+ return EAS_EOF;
+ }
+
+ /* get a character from the buffer */
+ *((EAS_U8*) p) = file->buffer[file->filePos++];
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWGetWord
+ *
+ * Returns the current location in the file
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) available for customer use */
+EAS_RESULT EAS_HWGetWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst)
+{
+ EAS_RESULT result;
+ EAS_U8 c1, c2;
+
+ /* read 2 bytes from the file */
+ if ((result = EAS_HWGetByte(hwInstData, file, &c1)) != EAS_SUCCESS)
+ return result;
+ if ((result = EAS_HWGetByte(hwInstData, file, &c2)) != EAS_SUCCESS)
+ return result;
+
+ /* order them as requested */
+ if (msbFirst)
+ *((EAS_U16*) p) = ((EAS_U16) c1 << 8) | c2;
+ else
+ *((EAS_U16*) p) = ((EAS_U16) c2 << 8) | c1;
+
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWGetDWord
+ *
+ * Returns the current location in the file
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) available for customer use */
+EAS_RESULT EAS_HWGetDWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst)
+{
+ EAS_RESULT result;
+ EAS_U8 c1, c2,c3,c4;
+
+ /* read 4 bytes from the file */
+ if ((result = EAS_HWGetByte(hwInstData, file, &c1)) != EAS_SUCCESS)
+ return result;
+ if ((result = EAS_HWGetByte(hwInstData, file, &c2)) != EAS_SUCCESS)
+ return result;
+ if ((result = EAS_HWGetByte(hwInstData, file, &c3)) != EAS_SUCCESS)
+ return result;
+ if ((result = EAS_HWGetByte(hwInstData, file, &c4)) != EAS_SUCCESS)
+ return result;
+
+ /* order them as requested */
+ if (msbFirst)
+ *((EAS_U32*) p) = ((EAS_U32) c1 << 24) | ((EAS_U32) c2 << 16) | ((EAS_U32) c3 << 8) | c4;
+ else
+ *((EAS_U32*) p)= ((EAS_U32) c4 << 24) | ((EAS_U32) c3 << 16) | ((EAS_U32) c2 << 8) | c1;
+
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWFilePos
+ *
+ * Returns the current location in the file
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) available for customer use */
+EAS_RESULT EAS_HWFilePos (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pPosition)
+{
+
+ /* simulate failure */
+ if (errorConditions[ePosError])
+ return EAS_FAILURE;
+
+ /* make sure we have a valid handle */
+ if (file->buffer == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ *pPosition = file->filePos;
+ return EAS_SUCCESS;
+} /* end EAS_HWFilePos */
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWFileSeek
+ *
+ * Seek to a specific location in the file
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) available for customer use */
+EAS_RESULT EAS_HWFileSeek (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position)
+{
+
+ /* simulate failure */
+ if (errorConditions[eSeekError])
+ return EAS_FAILURE;
+
+ /* make sure we have a valid handle */
+ if (file->buffer == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ /* validate new position */
+ if ((position < 0) || (position > file->fileSize))
+ return EAS_ERROR_FILE_SEEK;
+
+ /* save new position */
+ file->filePos = position;
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWFileSeekOfs
+ *
+ * Seek forward or back relative to the current position
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) available for customer use */
+EAS_RESULT EAS_HWFileSeekOfs (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position)
+{
+
+ /* simulate failure */
+ if (errorConditions[eSeekError])
+ return EAS_FAILURE;
+
+ /* make sure we have a valid handle */
+ if (file->buffer == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ /* determine the file position */
+ position += file->filePos;
+ if ((position < 0) || (position > file->fileSize))
+ return EAS_ERROR_FILE_SEEK;
+
+ /* save new position */
+ file->filePos = position;
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWFileLength
+ *
+ * Return the file length
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) available for customer use */
+EAS_RESULT EAS_HWFileLength (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pLength)
+{
+
+ /* simulate failure */
+ if (errorConditions[eLengthError])
+ return EAS_FAILURE;
+
+ /* make sure we have a valid handle */
+ if (file->buffer == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ *pLength = file->fileSize;
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWDupHandle
+ *
+ * Duplicate a file handle
+ *
+ *----------------------------------------------------------------------------
+*/
+EAS_RESULT EAS_HWDupHandle (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_FILE_HANDLE *pDupFile)
+{
+ EAS_HW_FILE *dupFile;
+ int i;
+
+ /* simulate failure */
+ if (errorConditions[eDupError])
+ return EAS_FAILURE;
+
+ /* make sure we have a valid handle */
+ if (file->buffer == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ /* find an empty entry in the file table */
+ dupFile = hwInstData->files;
+ for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
+ {
+ /* is this slot being used? */
+ if (dupFile->buffer == NULL)
+ {
+
+ /* copy info from the handle to be duplicated */
+ dupFile->filePos = file->filePos;
+ dupFile->fileSize = file->fileSize;
+ dupFile->buffer = file->buffer;
+
+ /* set the duplicate handle flag */
+ dupFile->dup = file->dup = EAS_TRUE;
+
+ *pDupFile = dupFile;
+ return EAS_SUCCESS;
+ }
+ dupFile++;
+ }
+
+ /* too many open files */
+ return EAS_ERROR_MAX_FILES_OPEN;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWClose
+ *
+ * Wrapper for fclose function
+ *
+ *----------------------------------------------------------------------------
+*/
+EAS_RESULT EAS_HWCloseFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file1)
+{
+ EAS_HW_FILE *file2,*dupFile;
+ int i;
+
+ /* simulate failure */
+ if (errorConditions[eCloseError])
+ return EAS_FAILURE;
+
+ /* make sure we have a valid handle */
+ if (file1->buffer == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ /* check for duplicate handle */
+ if (file1->dup)
+ {
+ dupFile = NULL;
+ file2 = hwInstData->files;
+ for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
+ {
+ /* check for duplicate */
+ if ((file1 != file2) && (file2->buffer == file1->buffer))
+ {
+ /* is there more than one duplicate? */
+ if (dupFile != NULL)
+ {
+ /* clear this entry and return */
+ file1->buffer = NULL;
+ return EAS_SUCCESS;
+ }
+
+ /* this is the first duplicate found */
+ else
+ dupFile = file2;
+ }
+ file2++;
+ }
+
+ /* there is only one duplicate, clear the dup flag */
+ if (dupFile)
+ dupFile->dup = EAS_FALSE;
+ else
+ /* if we get here, there's a serious problem */
+ return EAS_ERROR_HANDLE_INTEGRITY;
+
+ /* clear this entry and return */
+ file1->buffer = NULL;
+ return EAS_SUCCESS;
+ }
+
+ /* no duplicates -free the buffer */
+ EAS_HWFree(hwInstData, file1->buffer);
+
+ /* clear this entry and return */
+ file1->buffer = NULL;
+ return EAS_SUCCESS;
+}
+#endif
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWVibrate
+ *
+ * Turn on/off vibrate function
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) available for customer use */
+EAS_RESULT EAS_HWVibrate (EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state)
+{
+ vibState = state;
+// EAS_ReportX(_EAS_SEVERITY_NOFILTER, "Vibrate state: %d\n", state);
+ return EAS_SUCCESS;
+} /* end EAS_HWVibrate */
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWLED
+ *
+ * Turn on/off LED
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) available for customer use */
+EAS_RESULT EAS_HWLED (EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state)
+{
+ ledState = state;
+// EAS_ReportX(_EAS_SEVERITY_NOFILTER, "LED state: %d\n", state);
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWBackLight
+ *
+ * Turn on/off backlight
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) available for customer use */
+EAS_RESULT EAS_HWBackLight (EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state)
+{
+ backlightState = state;
+// EAS_ReportX(_EAS_SEVERITY_NOFILTER, "Backlight state: %d\n", state);
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWYield
+ *
+ * This function is called periodically by the EAS library to give the
+ * host an opportunity to allow other tasks to run. There are two ways to
+ * use this call:
+ *
+ * If you have a multi-tasking OS, you can call the yield function in the
+ * OS to allow other tasks to run. In this case, return EAS_FALSE to tell
+ * the EAS library to continue processing when control returns from this
+ * function.
+ *
+ * If tasks run in a single thread by sequential function calls (sometimes
+ * call a "commutator loop"), return EAS_TRUE to cause the EAS Library to
+ * return to the caller. Be sure to check the number of bytes rendered
+ * before passing the audio buffer to the codec - it may not be filled.
+ * The next call to EAS_Render will continue processing until the buffer
+ * has been filled.
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) available for customer use */
+EAS_BOOL EAS_HWYield (EAS_HW_DATA_HANDLE hwInstData)
+{
+ /* put your code here */
+ return EAS_FALSE;
+}
+
+
diff --git a/arm-wt-22k/jetcreator_lib_src/darwin-x86/EASLib.h b/arm-wt-22k/jetcreator_lib_src/darwin-x86/EASLib.h
index 0c0a89d..adaaa70 100755..100644
--- a/arm-wt-22k/jetcreator_lib_src/darwin-x86/EASLib.h
+++ b/arm-wt-22k/jetcreator_lib_src/darwin-x86/EASLib.h
@@ -1,31 +1,31 @@
-/*
- * EASLib.h
- * EASLIb
- *
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "eas_types.h"
-
-extern EAS_RESULT EAS_LibInit (EAS_DATA_HANDLE *pHandle)
-{
- return EAS_Init(pEASData);
-}
-
-EAS_EXPORT EAS_LibShutdown (EAS_DATA_HANDLE handle)
-{
- EAS_Shutdown(handle);
-}
+/*
+ * EASLib.h
+ * EASLIb
+ *
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "eas_types.h"
+
+extern EAS_RESULT EAS_LibInit (EAS_DATA_HANDLE *pHandle)
+{
+ return EAS_Init(pEASData);
+}
+
+EAS_EXPORT EAS_LibShutdown (EAS_DATA_HANDLE handle)
+{
+ EAS_Shutdown(handle);
+}
diff --git a/arm-wt-22k/jetcreator_lib_src/darwin-x86/EASLibVst.c b/arm-wt-22k/jetcreator_lib_src/darwin-x86/EASLibVst.c
index 58c8770..5bfe774 100755..100644
--- a/arm-wt-22k/jetcreator_lib_src/darwin-x86/EASLibVst.c
+++ b/arm-wt-22k/jetcreator_lib_src/darwin-x86/EASLibVst.c
@@ -1,1504 +1,1504 @@
-/*
- * EASLib.c
- * EASLIb
- *
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
-
-#include "eas.h"
-#include "eas_report.h"
-#include "eas_host.h"
-
-#ifdef JET_INTERFACE
-#include "jet.h"
-#endif
-
-
-#define EAS_EXPORT __attribute__((visibility("default")))
-
-// #define DEBUG_FILE_IO
-
-/* include debug interface */
-#include "eas_host_debug.h"
-
-#ifdef AUX_MIXER
-#include "eas_auxmix.h"
-#endif
-
-/* this module requires dynamic memory support */
-#ifdef _STATIC_MEMORY
-#error "eas_hostmm.c requires the dynamic memory model!\n"
-#endif
-
-#ifndef EAS_MAX_FILE_HANDLES
-#define EAS_MAX_FILE_HANDLES 32
-#endif
-
-#ifndef EAS_FILE_BUFFER_SIZE
-#define EAS_FILE_BUFFER_SIZE 32
-#endif
-
-/*
- * this structure and the related function are here
- * to support the ability to create duplicate handles
- * and buffering it in memory. If your system uses
- * in-memory resources, you can eliminate the calls
- * to malloc and free, the dup flag, and simply track
- * the file size and read position.
- */
- #ifdef BUFFERED_FILE_ACCESS
-typedef struct eas_hw_file_tag
-{
- FILE *pFile;
- EAS_I32 bytesInBuffer;
- EAS_I32 readIndex;
- EAS_I32 filePos;
- EAS_I32 fileSize;
- EAS_BOOL dup;
- EAS_U8 buffer[EAS_FILE_BUFFER_SIZE];
-} EAS_HW_FILE;
-#else
-typedef struct eas_hw_file_tag
-{
- EAS_I32 fileSize;
- EAS_I32 filePos;
- EAS_BOOL dup;
- EAS_U8 *buffer;
-} EAS_HW_FILE;
-#endif
-
-typedef struct eas_hw_inst_data_tag
-{
- EAS_HW_FILE files[EAS_MAX_FILE_HANDLES];
-} EAS_HW_INST_DATA;
-
-EAS_BOOL errorConditions[eNumErrorConditions];
-EAS_BOOL ledState;
-EAS_BOOL vibState;
-EAS_BOOL backlightState;
-
-#define MAX_DEBUG_MSG_LEN 1024
-
-typedef void (*EAS_LOG_FUNC)(EAS_INT severity, char *msg);
-
-static EAS_LOG_FUNC logCallback = NULL;
-static char messageBuffer[MAX_DEBUG_MSG_LEN];
-
-/* error counts */
-static EAS_INT eas_fatalErrors;
-static EAS_INT eas_errors;
-static EAS_INT eas_warnings;
-static int severityLevel = 9999;
-
-/* wave out device */
-#ifndef MAX_WAVE_OUT_BUFFERS
-#define MAX_WAVE_OUT_BUFFERS 8
-#endif
-
-#ifndef EAS_BUFFERS_PER_WAVE_BUFFER
-#define EAS_BUFFERS_PER_WAVE_BUFFER 8
-#endif
-
-/*----------------------------------------------------------------------------
- * ResetErrorCounters()
- *----------------------------------------------------------------------------
-*/
-EAS_EXPORT void ResetErrorCounters()
-{
- eas_fatalErrors = 0;
- eas_errors = 0;
- eas_warnings = 0;
-}
-
-/*----------------------------------------------------------------------------
- * SetLogCallback()
- *----------------------------------------------------------------------------
-*/
-EAS_EXPORT void SetLogCallback (EAS_LOG_FUNC callback)
-{
- logCallback = callback;
-}
-
-#ifndef _NO_DEBUG_PREPROCESSOR
-static S_DEBUG_MESSAGES debugMessages[] =
-{
-#ifdef UNIFIED_DEBUG_MESSAGES
-#include "eas_debugmsgs.h"
-#endif
- { 0,0,0 }
-};
-
-/*----------------------------------------------------------------------------
- * EAS_ReportEx()
- *----------------------------------------------------------------------------
-*/
-void EAS_ReportEx (int severity, unsigned long hashCode, int serialNum, ...)
-{
- va_list vargs;
- int i;
-
- switch (severity)
- {
- case _EAS_SEVERITY_FATAL:
- eas_fatalErrors++;
- break;
-
- case _EAS_SEVERITY_ERROR:
- eas_errors++;
- break;
-
- case _EAS_SEVERITY_WARNING:
- eas_warnings++;
- break;
-
- default:
- break;
- }
-
- /* check severity level */
- if (severity > severityLevel)
- return;
-
- /* check for callback */
- if (logCallback == NULL)
- return;
-
- /* find the error message and output to stdout */
- for (i = 0; debugMessages[i].m_pDebugMsg; i++)
- {
- if ((debugMessages[i].m_nHashCode == hashCode) &&
- (debugMessages[i].m_nSerialNum == serialNum))
- {
- va_start(vargs, serialNum);
-#ifdef WIN32
- vsprintf_s(messageBuffer, sizeof(messageBuffer), fmt, vargs);
-#else
- vsprintf(messageBuffer, debugMessages[i].m_pDebugMsg, vargs);
-#endif
- logCallback(severity, messageBuffer);
- va_end(vargs);
- return;
- }
- }
- printf("Unrecognized error: Severity=%d; HashCode=%lu; SerialNum=%d\n", severity, hashCode, serialNum);
-} /* end EAS_ReportEx */
-
-#else
-/*----------------------------------------------------------------------------
- * EAS_Report()
- *----------------------------------------------------------------------------
-*/
-void EAS_Report (int severity, const char *fmt, ...)
-{
- va_list vargs;
-
- switch (severity)
- {
- case _EAS_SEVERITY_FATAL:
- eas_fatalErrors++;
- break;
-
- case _EAS_SEVERITY_ERROR:
- eas_errors++;
- break;
-
- case _EAS_SEVERITY_WARNING:
- eas_warnings++;
- break;
-
- default:
- break;
- }
-
- /* check severity level */
- if (severity > severityLevel)
- return;
-
- /* check for callback */
- if (logCallback == NULL)
- return;
-
- va_start(vargs, fmt);
-#ifdef _WIN32
- vsprintf_s(messageBuffer, sizeof(messageBuffer), fmt, vargs);
-#else
- vsprintf(messageBuffer, fmt, vargs);
-#endif
- logCallback(severity, messageBuffer);
- va_end(vargs);
-} /* end EAS_Report */
-
-/*----------------------------------------------------------------------------
- * EAS_ReportX()
- *----------------------------------------------------------------------------
-*/
-void EAS_ReportX (int severity, const char *fmt, ...)
-{
- va_list vargs;
-
- switch (severity)
- {
- case _EAS_SEVERITY_FATAL:
- eas_fatalErrors++;
- break;
-
- case _EAS_SEVERITY_ERROR:
- eas_errors++;
- break;
-
- case _EAS_SEVERITY_WARNING:
- eas_warnings++;
- break;
-
- default:
- break;
- }
-
- /* check severity level */
- if (severity > severityLevel)
- return;
-
- /* check for callback */
- if (logCallback == NULL)
- return;
-
- va_start(vargs, fmt);
-#ifdef _WIN32
- vsprintf_s(messageBuffer, sizeof(messageBuffer), fmt, vargs);
-#else
- vsprintf(messageBuffer, fmt, vargs);
-#endif
- logCallback(severity, messageBuffer);
- va_end(vargs);
-}
-#endif
-
-/*----------------------------------------------------------------------------
- * EAS_DLLSetDebugLevel()
- *----------------------------------------------------------------------------
-*/
-EAS_EXPORT void EAS_DLLSetDebugLevel (int severity)
-{
- severityLevel = severity;
-}
-
-/*----------------------------------------------------------------------------
- * EAS_ExSetDebugLevel()
- *----------------------------------------------------------------------------
-*/
-void EAS_SetDebugLevel (int severity)
-{
- severityLevel = severity;
-}
-
-/*----------------------------------------------------------------------------
- * EAS_SelectLibrary()
- *----------------------------------------------------------------------------
-*/
-EAS_EXPORT EAS_RESULT EAS_SelectLib (EAS_DATA_HANDLE pEASData, EAS_HANDLE streamHandle, EAS_BOOL testLib)
-{
- extern EAS_SNDLIB_HANDLE VMGetLibHandle(EAS_INT libNum);
- return EAS_SetSoundLibrary(pEASData, streamHandle, VMGetLibHandle(testLib ? 1 : 0));
-}
-
-
-#if defined(_DEBUG) && !defined(MSC)
-#include <crtdbg.h>
-/*----------------------------------------------------------------------------
- * EnableHeapDebug()
- *----------------------------------------------------------------------------
-*/
-static void EnableHeapDebug (void)
-{
- int temp;
- temp = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
- temp |= _CRTDBG_ALLOC_MEM_DF;
- temp |= _CRTDBG_CHECK_ALWAYS_DF;
- temp |= _CRTDBG_LEAK_CHECK_DF;
-// temp |= _CRTDBG_DELAY_FREE_MEM_DF;
- _CrtSetDbgFlag(temp);
-}
-
-/*----------------------------------------------------------------------------
- * HeapCheck()
- *----------------------------------------------------------------------------
- * Check heap status
- *----------------------------------------------------------------------------
-*/
-void HeapCheck (void)
-{
- int heapStatus;
-
- /* Check heap status */
- heapStatus = _heapchk();
- if ((heapStatus == _HEAPOK) || (heapStatus == _HEAPEMPTY))
- return;
-
- EAS_ReportX(_EAS_SEVERITY_FATAL, "Heap corrupt\n" );
-}
-#endif
-
-
-/*----------------------------------------------------------------------------
- * EAS_HWInit
- *
- * Initialize host wrapper interface
- *
- *----------------------------------------------------------------------------
-*/
-EAS_RESULT EAS_HWInit (EAS_HW_DATA_HANDLE *pHWInstData)
-{
-
-#if defined(_DEBUG) && !defined(MSC)
- EnableHeapDebug();
-#endif
-
- #ifdef BUFFERED_FILE_ACCESS
- EAS_ReportX(_EAS_SEVERITY_INFO, "EAS_HWInit: Buffered file access\n");
- #else
- EAS_ReportX(_EAS_SEVERITY_INFO, "EAS_HWInit: Memory mapped file access\n");
- #endif
-
- /* simulate failure */
- if (errorConditions[eInitError])
- return EAS_FAILURE;
-
- /* need to track file opens for duplicate handles */
- *pHWInstData = malloc(sizeof(EAS_HW_INST_DATA));
- if (!(*pHWInstData))
- return EAS_ERROR_MALLOC_FAILED;
-
- EAS_HWMemSet(*pHWInstData, 0, sizeof(EAS_HW_INST_DATA));
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- * EAS_HWShutdown
- *
- * Shut down host wrapper interface
- *
- *----------------------------------------------------------------------------
-*/
-EAS_RESULT EAS_HWShutdown (EAS_HW_DATA_HANDLE hwInstData)
-{
-
- /* simulate failure */
- if (errorConditions[eShutdownError])
- return EAS_FAILURE;
-
- free(hwInstData);
-
-#if defined(_DEBUG) && !defined(MSC)
- HeapCheck();
-#endif
-
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWMalloc
- *
- * Allocates dynamic memory
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) available for customer use */
-void *EAS_HWMalloc (EAS_HW_DATA_HANDLE hwInstData, EAS_I32 size)
-{
- /* simulate failure */
- if (errorConditions[eMallocError])
- return NULL;
-
- return malloc((size_t) size);
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWFree
- *
- * Frees dynamic memory
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) available for customer use */
-void EAS_HWFree (EAS_HW_DATA_HANDLE hwInstData, void *p)
-{
- free(p);
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWMemCpy
- *
- * Copy memory wrapper
- *
- *----------------------------------------------------------------------------
-*/
-void *EAS_HWMemCpy (void *dest, const void *src, EAS_I32 amount)
-{
- return memcpy(dest, src, (size_t) amount);
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWMemSet
- *
- * Set memory wrapper
- *
- *----------------------------------------------------------------------------
-*/
-void *EAS_HWMemSet (void *dest, int val, EAS_I32 amount)
-{
- return memset(dest, val, (size_t) amount);
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWMemCmp
- *
- * Compare memory wrapper
- *
- *----------------------------------------------------------------------------
-*/
-EAS_I32 EAS_HWMemCmp (const void *s1, const void *s2, EAS_I32 amount)
-{
- return (EAS_I32) memcmp(s1, s2, (size_t) amount);
-}
-
-#ifdef BUFFERED_FILE_ACCESS
-/*----------------------------------------------------------------------------
- *
- * EAS_HWOpenFile
- *
- * Open a file for read or write
- *
- *----------------------------------------------------------------------------
-*/
-EAS_RESULT EAS_HWOpenFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_LOCATOR locator, EAS_FILE_HANDLE *pFile, EAS_FILE_MODE mode)
-{
- EAS_HW_FILE *file;
- int i;
-
- /* set return value to NULL */
- *pFile = NULL;
-
- /* only support read mode at this time */
- if (mode != EAS_FILE_READ)
- return EAS_ERROR_INVALID_FILE_MODE;
-
- /* find an empty entry in the file table */
- file = hwInstData->files;
- for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
- {
- /* is this slot being used? */
- if (file->pFile == NULL)
- {
- EAS_RESULT result;
-
- /* open the file */
- file->pFile = fopen((const char*) locator, "rb");
- if (file->pFile == NULL)
- return EAS_ERROR_FILE_OPEN_FAILED;
-
- /* get file length */
- if ((result = EAS_HWFileLength(hwInstData, file, &file->fileSize)) != EAS_SUCCESS)
- {
- EAS_HWCloseFile(hwInstData, file);
- return result;
- }
-
-#ifdef DEBUG_FILE_IO
- EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWOpenFile: Open file %d\n", i);
-#endif
-
- /* initialize some values */
- file->bytesInBuffer = 0;
- file->readIndex = 0;
- file->filePos = 0;
- file->dup = EAS_FALSE;
-
- *pFile = file;
- return EAS_SUCCESS;
- }
- file++;
- }
-
- /* too many open files */
- return EAS_ERROR_MAX_FILES_OPEN;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWFillBuffer
- *
- * Fill buffer from file
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) hwInstData available for customer use */
-EAS_RESULT EAS_HWFillBuffer (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file)
-{
- /* reposition the file pointer */
- if (fseek(file->pFile, file->filePos, SEEK_SET) != 0)
- return EAS_ERROR_FILE_SEEK;
-
- /* read some data from the file */
- file->bytesInBuffer = (EAS_I32) fread(file->buffer, 1, EAS_FILE_BUFFER_SIZE, file->pFile);
- file->readIndex = 0;
- if (file->bytesInBuffer == 0)
- return EAS_EOF;
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWReadFile
- *
- * Read data from a file
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) hwInstData available for customer use */
-EAS_RESULT EAS_HWReadFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *pBuffer, EAS_I32 n, EAS_I32 *pBytesRead)
-{
- EAS_RESULT result;
- EAS_I32 temp;
- EAS_U8 *p = pBuffer;
- EAS_I32 bytesLeft = n;
-
- *pBytesRead = 0;
-
- /* check handle integrity */
- if (file->pFile == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
-#ifdef DEBUG_FILE_IO
- EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWReadFile: Reading %d bytes from position %d\n", n, file->filePos);
-#endif
-
- /* try to fulfill request from buffer */
- for (;bytesLeft > 0;)
- {
- /* how many bytes can we get from buffer? */
- temp = file->bytesInBuffer - file->readIndex;
- if (temp > bytesLeft)
- temp = bytesLeft;
-
- /* copy data from buffer */
- EAS_HWMemCpy(p, &file->buffer[file->readIndex], temp);
- *pBytesRead += temp;
- file->readIndex += temp;
- file->filePos += temp;
- p += temp;
- bytesLeft -= temp;
-
- /* don't refill buffer if request is bigger than buffer */
- if ((bytesLeft == 0) || (bytesLeft >= EAS_FILE_BUFFER_SIZE))
- break;
-
- /* refill buffer */
- if ((result = EAS_HWFillBuffer(hwInstData, file)) != EAS_SUCCESS)
- return result;
- }
-
- /* more to read? do unbuffered read directly to target memory */
- if (bytesLeft)
- {
-
- /* position the file pointer */
- if (fseek(file->pFile, file->filePos, SEEK_SET) != 0)
- return EAS_ERROR_FILE_SEEK;
-
- /* read data in the buffer */
- temp = (EAS_I32) fread(p, 1, (size_t) bytesLeft, file->pFile);
- *pBytesRead += temp;
- file->filePos += temp;
-
- /* reset buffer info */
- file->bytesInBuffer = 0;
- file->readIndex = 0;
- }
-
-#ifdef DEBUG_FILE_IO
- {
-#define BYTES_PER_LINE 16
- char str[BYTES_PER_LINE * 3 + 1];
- EAS_INT i;
- for (i = 0; i < (n > BYTES_PER_LINE ? BYTES_PER_LINE : n) ; i ++)
- sprintf(&str[i*3], "%02x ", ((EAS_U8*)pBuffer)[i]);
- if (i)
- EAS_ReportX(_EAS_SEVERITY_NOFILTER, "%s\n", str);
- }
-#endif
-
- /* were n bytes read? */
- if (*pBytesRead != n)
- return EAS_EOF;
-
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWGetByte
- *
- * Read a byte from a file
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) hwInstData available for customer use */
-EAS_RESULT EAS_HWGetByte (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p)
-{
- EAS_RESULT result;
-
- /* check handle integrity */
- if (file->pFile == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- /* use local buffer - do we have any data? */
- if (file->readIndex >= file->bytesInBuffer)
- {
- if ((result = EAS_HWFillBuffer(hwInstData, file)) != EAS_SUCCESS)
- return result;
-
- /* if nothing to read, return EOF */
- if (file->bytesInBuffer == 0)
- return EAS_EOF;
- }
-
- /* get a character from the buffer */
- *((EAS_U8*) p) = file->buffer[file->readIndex++];
-
-#ifdef DEBUG_FILE_IO
- EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWGetByte: Reading from position %d, byte = 0x%02x\n", file->filePos, *(EAS_U8*)p);
-#endif
-
- file->filePos++;
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWGetWord
- *
- * Read a 16-bit value from the file
- *----------------------------------------------------------------------------
-*/
-EAS_RESULT EAS_HWGetWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst)
-{
- EAS_RESULT result;
- EAS_I32 count;
- EAS_U8 c[2];
-
-#ifdef DEBUG_FILE_IO
- EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWGetWord: Reading 2 bytes from position %d\n", file->filePos);
-#endif
-
- /* read 2 bytes from the file */
- if ((result = EAS_HWReadFile(hwInstData, file, c, 2, &count)) != EAS_SUCCESS)
- return result;
-
- /* order them as requested */
- if (msbFirst)
- *((EAS_U16*) p) = ((EAS_U16) c[0] << 8) | c[1];
- else
- *((EAS_U16*) p) = ((EAS_U16) c[1] << 8) | c[0];
-
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWGetDWord
- *
- * Read a 16-bit value from the file
- *----------------------------------------------------------------------------
-*/
-EAS_RESULT EAS_HWGetDWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst)
-{
- EAS_RESULT result;
- EAS_I32 count;
- EAS_U8 c[4];
-
-#ifdef DEBUG_FILE_IO
- EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWGetDWord: Reading 4 bytes from position %d\n", file->filePos);
-#endif
-
- /* read 4 bytes from the file */
- if ((result = EAS_HWReadFile(hwInstData, file, c, 4, &count)) != EAS_SUCCESS)
- return result;
-
- /* order them as requested */
- if (msbFirst)
- *((EAS_U32*) p) = ((EAS_U32) c[0] << 24) | ((EAS_U32) c[1] << 16) | ((EAS_U32) c[2] << 8) | c[3];
- else
- *((EAS_U32*) p) = ((EAS_U32) c[3] << 24) | ((EAS_U32) c[2] << 16) | ((EAS_U32) c[1] << 8) | c[0];
-
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWFilePos
- *
- * Returns the current location in the file
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) hwInstData available for customer use */
-EAS_RESULT EAS_HWFilePos (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pPosition)
-{
-
- /* check handle integrity */
- if (file->pFile == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- *pPosition = file->filePos;
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWFileSeek
- *
- * Seek to a specific location in the file
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) hwInstData available for customer use */
-EAS_RESULT EAS_HWFileSeek (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position)
-{
- EAS_I32 newIndex;
-
- /* check handle integrity */
- if (file->pFile == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- /* check for seek past end */
- if ((position < 0) || (position > file->fileSize))
- return EAS_ERROR_FILE_SEEK;
-
-#ifdef DEBUG_FILE_IO
- EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWFileSeek: Seeking to new position %d\n", file->filePos);
-#endif
-
- /* is new position in current buffer? */
- newIndex = position - file->filePos + file->readIndex;
- if ((newIndex >= 0) && (newIndex < file->bytesInBuffer))
- {
- file->readIndex = newIndex;
- file->filePos = position;
- return EAS_SUCCESS;
- }
-
- /* save new position and reset buffer info so EAS_HWGetByte doesn't fail */
- file->filePos = position;
- file->bytesInBuffer = 0;
- file->readIndex = 0;
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWFileSeekOfs
- *
- * Seek forward or back relative to the current position
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) hwInstData available for customer use */
-EAS_RESULT EAS_HWFileSeekOfs (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position)
-{
- EAS_I32 temp;
-
-#ifdef DEBUG_FILE_IO
- EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWFileSeekOfs: Seeking to new position %d\n", file->filePos + position);
-#endif
-
- /* check handle integrity */
- if (file->pFile == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- /* check for seek past end */
- temp = file->filePos + position;
- if ((temp < 0) || (temp > file->fileSize))
- return EAS_ERROR_FILE_SEEK;
-
- /* is new position in current buffer? */
- temp = position + file->readIndex;
- if ((temp >= 0) && (temp < file->bytesInBuffer))
- {
- file->readIndex = temp;
- file->filePos += position;
- return EAS_SUCCESS;
- }
-
- /* save new position and reset buffer info so EAS_HWGetByte doesn't fail */
- file->filePos += position;
- file->bytesInBuffer = 0;
- file->readIndex = 0;
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWFileLength
- *
- * Return the file length
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) hwInstData available for customer use */
-EAS_RESULT EAS_HWFileLength (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pLength)
-{
- long pos;
-
- /* check handle integrity */
- if (file->pFile == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- if ((pos = ftell(file->pFile)) == -1L)
- return EAS_ERROR_FILE_LENGTH;
- if (fseek(file->pFile, 0L, SEEK_END) != 0)
- return EAS_ERROR_FILE_LENGTH;
- if ((*pLength = ftell(file->pFile)) == -1L)
- return EAS_ERROR_FILE_LENGTH;
- if (fseek(file->pFile, pos, SEEK_SET) != 0)
- return EAS_ERROR_FILE_LENGTH;
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWDupHandle
- *
- * Duplicate a file handle
- *
- *----------------------------------------------------------------------------
-*/
-EAS_RESULT EAS_HWDupHandle (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_FILE_HANDLE* pDupFile)
-{
- EAS_HW_FILE *dupfile;
- int i;
-
- /* check handle integrity */
- *pDupFile = NULL;
- if (file->pFile == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- /* find an empty entry in the file table */
- dupfile = hwInstData->files;
- for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
- {
- /* is this slot being used? */
- if (dupfile->pFile == NULL)
- {
-
- /* copy info from the handle to be duplicated */
- dupfile->filePos = file->filePos;
- dupfile->pFile = file->pFile;
- dupfile->fileSize = file->fileSize;
-
- /* set the duplicate handle flag */
- dupfile->dup = file->dup = EAS_TRUE;
-
- /* initialize some values */
- dupfile->bytesInBuffer = 0;
- dupfile->readIndex = 0;
-
- *pDupFile = dupfile;
- return EAS_SUCCESS;
- }
- dupfile++;
- }
-
- /* too many open files */
- return EAS_ERROR_MAX_FILES_OPEN;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWClose
- *
- * Wrapper for fclose function
- *
- *----------------------------------------------------------------------------
-*/
-EAS_RESULT EAS_HWCloseFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file1)
-{
- EAS_HW_FILE *file2,*dupFile;
- int i;
-
- /* check handle integrity */
- if (file1->pFile == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- /* check for duplicate handle */
- if (file1->dup)
- {
- dupFile = NULL;
- file2 = hwInstData->files;
- for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
- {
- /* check for duplicate */
- if ((file1 != file2) && (file2->pFile == file1->pFile))
- {
- /* is there more than one duplicate? */
- if (dupFile != NULL)
- {
- /* clear this entry and return */
- file1->pFile = NULL;
- return EAS_SUCCESS;
- }
-
- /* this is the first duplicate found */
- dupFile = file2;
- }
- file2++;
- }
-
- /* there is only one duplicate, clear the dup flag */
- if (dupFile)
- dupFile->dup = EAS_FALSE;
- else
- /* if we get here, there's a serious problem */
- return EAS_ERROR_HANDLE_INTEGRITY;
-
- /* clear this entry and return */
- file1->pFile = NULL;
- return EAS_SUCCESS;
- }
-
- /* no duplicates - close the file */
- if (fclose(file1->pFile) != 0)
- return EAS_ERROR_CLOSE_FAILED;
-
- /* clear this entry and return */
- file1->pFile = NULL;
- return EAS_SUCCESS;
-}
-#else
-/*----------------------------------------------------------------------------
- *
- * EAS_HWOpenFile
- *
- * Open a file for read or write
- *
- *----------------------------------------------------------------------------
-*/
-EAS_RESULT EAS_HWOpenFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_LOCATOR locator, EAS_FILE_HANDLE *pFile, EAS_FILE_MODE mode)
-{
- EAS_HW_FILE *file;
- FILE *ioFile;
- int i, temp;
-
- /* set return value to NULL */
- *pFile = NULL;
-
- /* simulate failure */
- if (errorConditions[eOpenError])
- return EAS_FAILURE;
-
- /* only support read mode at this time */
- if (mode != EAS_FILE_READ)
- return EAS_ERROR_INVALID_FILE_MODE;
-
- /* find an empty entry in the file table */
- file = hwInstData->files;
- for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
- {
- /* is this slot being used? */
- if (file->buffer == NULL)
- {
- /* open the file */
- if ((ioFile = fopen(locator,"rb")) == NULL)
- return EAS_ERROR_FILE_OPEN_FAILED;
-
- /* determine the file size */
- if (fseek(ioFile, 0L, SEEK_END) != 0)
- return EAS_ERROR_FILE_LENGTH;
- if ((file->fileSize = ftell(ioFile)) == -1L)
- return EAS_ERROR_FILE_LENGTH;
- if (fseek(ioFile, 0L, SEEK_SET) != 0)
- return EAS_ERROR_FILE_LENGTH;
-
- /* allocate a buffer */
- file->buffer = EAS_HWMalloc(hwInstData, file->fileSize);
- if (file->buffer == NULL)
- {
- fclose(ioFile);
- return EAS_ERROR_MALLOC_FAILED;
- }
-
- /* read the file into memory */
- temp = (int) fread(file->buffer, (size_t) file->fileSize, 1, ioFile);
-
- /* close the file - don't need it any more */
- fclose(ioFile);
-
- /* check for error reading file */
- if (temp != 1)
- return EAS_ERROR_FILE_READ_FAILED;
-
- /* initialize some values */
- file->filePos = 0;
- file->dup = EAS_FALSE;
-
- *pFile = file;
- return EAS_SUCCESS;
- }
- file++;
- }
-
- /* too many open files */
- return EAS_ERROR_MAX_FILES_OPEN;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWReadFile
- *
- * Read data from a file
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) available for customer use */
-EAS_RESULT EAS_HWReadFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *pBuffer, EAS_I32 n, EAS_I32 *pBytesRead)
-{
- EAS_I32 count;
-
- /* simulate failure */
- if (errorConditions[eReadError])
- return EAS_FAILURE;
-
- /* make sure we have a valid handle */
- if (file->buffer == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- /* calculate the bytes to read */
- count = file->fileSize - file->filePos;
- if (n < count)
- count = n;
-
- /* copy the data to the requested location, and advance the pointer */
- if (count)
- EAS_HWMemCpy(pBuffer, &file->buffer[file->filePos], count);
- file->filePos += count;
- *pBytesRead = count;
-
- /* were n bytes read? */
- if (count!= n)
- return EAS_EOF;
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWGetByte
- *
- * Read a byte from a file
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -e{715} hwInstData available for customer use */
-EAS_RESULT EAS_HWGetByte (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p)
-{
-
- /* simulate failure */
- if (errorConditions[eReadError])
- return EAS_FAILURE;
-
- /* make sure we have a valid handle */
- if (file->buffer == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- /* check for end of file */
- if (file->filePos >= file->fileSize)
- {
- *((EAS_U8*) p) = 0;
- return EAS_EOF;
- }
-
- /* get a character from the buffer */
- *((EAS_U8*) p) = file->buffer[file->filePos++];
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWGetWord
- *
- * Returns the current location in the file
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) available for customer use */
-EAS_RESULT EAS_HWGetWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst)
-{
- EAS_RESULT result;
- EAS_U8 c1, c2;
-
- /* read 2 bytes from the file */
- if ((result = EAS_HWGetByte(hwInstData, file, &c1)) != EAS_SUCCESS)
- return result;
- if ((result = EAS_HWGetByte(hwInstData, file, &c2)) != EAS_SUCCESS)
- return result;
-
- /* order them as requested */
- if (msbFirst)
- *((EAS_U16*) p) = ((EAS_U16) c1 << 8) | c2;
- else
- *((EAS_U16*) p) = ((EAS_U16) c2 << 8) | c1;
-
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWGetDWord
- *
- * Returns the current location in the file
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) available for customer use */
-EAS_RESULT EAS_HWGetDWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst)
-{
- EAS_RESULT result;
- EAS_U8 c1, c2,c3,c4;
-
- /* read 4 bytes from the file */
- if ((result = EAS_HWGetByte(hwInstData, file, &c1)) != EAS_SUCCESS)
- return result;
- if ((result = EAS_HWGetByte(hwInstData, file, &c2)) != EAS_SUCCESS)
- return result;
- if ((result = EAS_HWGetByte(hwInstData, file, &c3)) != EAS_SUCCESS)
- return result;
- if ((result = EAS_HWGetByte(hwInstData, file, &c4)) != EAS_SUCCESS)
- return result;
-
- /* order them as requested */
- if (msbFirst)
- *((EAS_U32*) p) = ((EAS_U32) c1 << 24) | ((EAS_U32) c2 << 16) | ((EAS_U32) c3 << 8) | c4;
- else
- *((EAS_U32*) p)= ((EAS_U32) c4 << 24) | ((EAS_U32) c3 << 16) | ((EAS_U32) c2 << 8) | c1;
-
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWFilePos
- *
- * Returns the current location in the file
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) available for customer use */
-EAS_RESULT EAS_HWFilePos (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pPosition)
-{
-
- /* simulate failure */
- if (errorConditions[ePosError])
- return EAS_FAILURE;
-
- /* make sure we have a valid handle */
- if (file->buffer == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- *pPosition = file->filePos;
- return EAS_SUCCESS;
-} /* end EAS_HWFilePos */
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWFileSeek
- *
- * Seek to a specific location in the file
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) available for customer use */
-EAS_RESULT EAS_HWFileSeek (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position)
-{
-
- /* simulate failure */
- if (errorConditions[eSeekError])
- return EAS_FAILURE;
-
- /* make sure we have a valid handle */
- if (file->buffer == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- /* validate new position */
- if ((position < 0) || (position > file->fileSize))
- return EAS_ERROR_FILE_SEEK;
-
- /* save new position */
- file->filePos = position;
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWFileSeekOfs
- *
- * Seek forward or back relative to the current position
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) available for customer use */
-EAS_RESULT EAS_HWFileSeekOfs (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position)
-{
-
- /* simulate failure */
- if (errorConditions[eSeekError])
- return EAS_FAILURE;
-
- /* make sure we have a valid handle */
- if (file->buffer == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- /* determine the file position */
- position += file->filePos;
- if ((position < 0) || (position > file->fileSize))
- return EAS_ERROR_FILE_SEEK;
-
- /* save new position */
- file->filePos = position;
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWFileLength
- *
- * Return the file length
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) available for customer use */
-EAS_RESULT EAS_HWFileLength (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pLength)
-{
-
- /* simulate failure */
- if (errorConditions[eLengthError])
- return EAS_FAILURE;
-
- /* make sure we have a valid handle */
- if (file->buffer == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- *pLength = file->fileSize;
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWDupHandle
- *
- * Duplicate a file handle
- *
- *----------------------------------------------------------------------------
-*/
-EAS_RESULT EAS_HWDupHandle (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_FILE_HANDLE *pDupFile)
-{
- EAS_HW_FILE *dupFile;
- int i;
-
- /* simulate failure */
- if (errorConditions[eDupError])
- return EAS_FAILURE;
-
- /* make sure we have a valid handle */
- if (file->buffer == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- /* find an empty entry in the file table */
- dupFile = hwInstData->files;
- for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
- {
- /* is this slot being used? */
- if (dupFile->buffer == NULL)
- {
-
- /* copy info from the handle to be duplicated */
- dupFile->filePos = file->filePos;
- dupFile->fileSize = file->fileSize;
- dupFile->buffer = file->buffer;
-
- /* set the duplicate handle flag */
- dupFile->dup = file->dup = EAS_TRUE;
-
- *pDupFile = dupFile;
- return EAS_SUCCESS;
- }
- dupFile++;
- }
-
- /* too many open files */
- return EAS_ERROR_MAX_FILES_OPEN;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWClose
- *
- * Wrapper for fclose function
- *
- *----------------------------------------------------------------------------
-*/
-EAS_RESULT EAS_HWCloseFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file1)
-{
- EAS_HW_FILE *file2,*dupFile;
- int i;
-
- /* simulate failure */
- if (errorConditions[eCloseError])
- return EAS_FAILURE;
-
- /* make sure we have a valid handle */
- if (file1->buffer == NULL)
- return EAS_ERROR_INVALID_HANDLE;
-
- /* check for duplicate handle */
- if (file1->dup)
- {
- dupFile = NULL;
- file2 = hwInstData->files;
- for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
- {
- /* check for duplicate */
- if ((file1 != file2) && (file2->buffer == file1->buffer))
- {
- /* is there more than one duplicate? */
- if (dupFile != NULL)
- {
- /* clear this entry and return */
- file1->buffer = NULL;
- return EAS_SUCCESS;
- }
-
- /* this is the first duplicate found */
- else
- dupFile = file2;
- }
- file2++;
- }
-
- /* there is only one duplicate, clear the dup flag */
- if (dupFile)
- dupFile->dup = EAS_FALSE;
- else
- /* if we get here, there's a serious problem */
- return EAS_ERROR_HANDLE_INTEGRITY;
-
- /* clear this entry and return */
- file1->buffer = NULL;
- return EAS_SUCCESS;
- }
-
- /* no duplicates -free the buffer */
- EAS_HWFree(hwInstData, file1->buffer);
-
- /* clear this entry and return */
- file1->buffer = NULL;
- return EAS_SUCCESS;
-}
-#endif
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWVibrate
- *
- * Turn on/off vibrate function
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) available for customer use */
-EAS_RESULT EAS_HWVibrate (EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state)
-{
- vibState = state;
-// EAS_ReportX(_EAS_SEVERITY_NOFILTER, "Vibrate state: %d\n", state);
- return EAS_SUCCESS;
-} /* end EAS_HWVibrate */
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWLED
- *
- * Turn on/off LED
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) available for customer use */
-EAS_RESULT EAS_HWLED (EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state)
-{
- ledState = state;
-// EAS_ReportX(_EAS_SEVERITY_NOFILTER, "LED state: %d\n", state);
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWBackLight
- *
- * Turn on/off backlight
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) available for customer use */
-EAS_RESULT EAS_HWBackLight (EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state)
-{
- backlightState = state;
-// EAS_ReportX(_EAS_SEVERITY_NOFILTER, "Backlight state: %d\n", state);
- return EAS_SUCCESS;
-}
-
-/*----------------------------------------------------------------------------
- *
- * EAS_HWYield
- *
- * This function is called periodically by the EAS library to give the
- * host an opportunity to allow other tasks to run. There are two ways to
- * use this call:
- *
- * If you have a multi-tasking OS, you can call the yield function in the
- * OS to allow other tasks to run. In this case, return EAS_FALSE to tell
- * the EAS library to continue processing when control returns from this
- * function.
- *
- * If tasks run in a single thread by sequential function calls (sometimes
- * call a "commutator loop"), return EAS_TRUE to cause the EAS Library to
- * return to the caller. Be sure to check the number of bytes rendered
- * before passing the audio buffer to the codec - it may not be filled.
- * The next call to EAS_Render will continue processing until the buffer
- * has been filled.
- *
- *----------------------------------------------------------------------------
-*/
-/*lint -esym(715, hwInstData) available for customer use */
-EAS_BOOL EAS_HWYield (EAS_HW_DATA_HANDLE hwInstData)
-{
- /* put your code here */
- return EAS_FALSE;
-}
-
-
+/*
+ * EASLib.c
+ * EASLIb
+ *
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+
+#include "eas.h"
+#include "eas_report.h"
+#include "eas_host.h"
+
+#ifdef JET_INTERFACE
+#include "jet.h"
+#endif
+
+
+#define EAS_EXPORT __attribute__((visibility("default")))
+
+// #define DEBUG_FILE_IO
+
+/* include debug interface */
+#include "eas_host_debug.h"
+
+#ifdef AUX_MIXER
+#include "eas_auxmix.h"
+#endif
+
+/* this module requires dynamic memory support */
+#ifdef _STATIC_MEMORY
+#error "eas_hostmm.c requires the dynamic memory model!\n"
+#endif
+
+#ifndef EAS_MAX_FILE_HANDLES
+#define EAS_MAX_FILE_HANDLES 32
+#endif
+
+#ifndef EAS_FILE_BUFFER_SIZE
+#define EAS_FILE_BUFFER_SIZE 32
+#endif
+
+/*
+ * this structure and the related function are here
+ * to support the ability to create duplicate handles
+ * and buffering it in memory. If your system uses
+ * in-memory resources, you can eliminate the calls
+ * to malloc and free, the dup flag, and simply track
+ * the file size and read position.
+ */
+ #ifdef BUFFERED_FILE_ACCESS
+typedef struct eas_hw_file_tag
+{
+ FILE *pFile;
+ EAS_I32 bytesInBuffer;
+ EAS_I32 readIndex;
+ EAS_I32 filePos;
+ EAS_I32 fileSize;
+ EAS_BOOL dup;
+ EAS_U8 buffer[EAS_FILE_BUFFER_SIZE];
+} EAS_HW_FILE;
+#else
+typedef struct eas_hw_file_tag
+{
+ EAS_I32 fileSize;
+ EAS_I32 filePos;
+ EAS_BOOL dup;
+ EAS_U8 *buffer;
+} EAS_HW_FILE;
+#endif
+
+typedef struct eas_hw_inst_data_tag
+{
+ EAS_HW_FILE files[EAS_MAX_FILE_HANDLES];
+} EAS_HW_INST_DATA;
+
+EAS_BOOL errorConditions[eNumErrorConditions];
+EAS_BOOL ledState;
+EAS_BOOL vibState;
+EAS_BOOL backlightState;
+
+#define MAX_DEBUG_MSG_LEN 1024
+
+typedef void (*EAS_LOG_FUNC)(EAS_INT severity, char *msg);
+
+static EAS_LOG_FUNC logCallback = NULL;
+static char messageBuffer[MAX_DEBUG_MSG_LEN];
+
+/* error counts */
+static EAS_INT eas_fatalErrors;
+static EAS_INT eas_errors;
+static EAS_INT eas_warnings;
+static int severityLevel = 9999;
+
+/* wave out device */
+#ifndef MAX_WAVE_OUT_BUFFERS
+#define MAX_WAVE_OUT_BUFFERS 8
+#endif
+
+#ifndef EAS_BUFFERS_PER_WAVE_BUFFER
+#define EAS_BUFFERS_PER_WAVE_BUFFER 8
+#endif
+
+/*----------------------------------------------------------------------------
+ * ResetErrorCounters()
+ *----------------------------------------------------------------------------
+*/
+EAS_EXPORT void ResetErrorCounters()
+{
+ eas_fatalErrors = 0;
+ eas_errors = 0;
+ eas_warnings = 0;
+}
+
+/*----------------------------------------------------------------------------
+ * SetLogCallback()
+ *----------------------------------------------------------------------------
+*/
+EAS_EXPORT void SetLogCallback (EAS_LOG_FUNC callback)
+{
+ logCallback = callback;
+}
+
+#ifndef _NO_DEBUG_PREPROCESSOR
+static S_DEBUG_MESSAGES debugMessages[] =
+{
+#ifdef UNIFIED_DEBUG_MESSAGES
+#include "eas_debugmsgs.h"
+#endif
+ { 0,0,0 }
+};
+
+/*----------------------------------------------------------------------------
+ * EAS_ReportEx()
+ *----------------------------------------------------------------------------
+*/
+void EAS_ReportEx (int severity, unsigned long hashCode, int serialNum, ...)
+{
+ va_list vargs;
+ int i;
+
+ switch (severity)
+ {
+ case _EAS_SEVERITY_FATAL:
+ eas_fatalErrors++;
+ break;
+
+ case _EAS_SEVERITY_ERROR:
+ eas_errors++;
+ break;
+
+ case _EAS_SEVERITY_WARNING:
+ eas_warnings++;
+ break;
+
+ default:
+ break;
+ }
+
+ /* check severity level */
+ if (severity > severityLevel)
+ return;
+
+ /* check for callback */
+ if (logCallback == NULL)
+ return;
+
+ /* find the error message and output to stdout */
+ for (i = 0; debugMessages[i].m_pDebugMsg; i++)
+ {
+ if ((debugMessages[i].m_nHashCode == hashCode) &&
+ (debugMessages[i].m_nSerialNum == serialNum))
+ {
+ va_start(vargs, serialNum);
+#ifdef WIN32
+ vsprintf_s(messageBuffer, sizeof(messageBuffer), fmt, vargs);
+#else
+ vsprintf(messageBuffer, debugMessages[i].m_pDebugMsg, vargs);
+#endif
+ logCallback(severity, messageBuffer);
+ va_end(vargs);
+ return;
+ }
+ }
+ printf("Unrecognized error: Severity=%d; HashCode=%lu; SerialNum=%d\n", severity, hashCode, serialNum);
+} /* end EAS_ReportEx */
+
+#else
+/*----------------------------------------------------------------------------
+ * EAS_Report()
+ *----------------------------------------------------------------------------
+*/
+void EAS_Report (int severity, const char *fmt, ...)
+{
+ va_list vargs;
+
+ switch (severity)
+ {
+ case _EAS_SEVERITY_FATAL:
+ eas_fatalErrors++;
+ break;
+
+ case _EAS_SEVERITY_ERROR:
+ eas_errors++;
+ break;
+
+ case _EAS_SEVERITY_WARNING:
+ eas_warnings++;
+ break;
+
+ default:
+ break;
+ }
+
+ /* check severity level */
+ if (severity > severityLevel)
+ return;
+
+ /* check for callback */
+ if (logCallback == NULL)
+ return;
+
+ va_start(vargs, fmt);
+#ifdef _WIN32
+ vsprintf_s(messageBuffer, sizeof(messageBuffer), fmt, vargs);
+#else
+ vsprintf(messageBuffer, fmt, vargs);
+#endif
+ logCallback(severity, messageBuffer);
+ va_end(vargs);
+} /* end EAS_Report */
+
+/*----------------------------------------------------------------------------
+ * EAS_ReportX()
+ *----------------------------------------------------------------------------
+*/
+void EAS_ReportX (int severity, const char *fmt, ...)
+{
+ va_list vargs;
+
+ switch (severity)
+ {
+ case _EAS_SEVERITY_FATAL:
+ eas_fatalErrors++;
+ break;
+
+ case _EAS_SEVERITY_ERROR:
+ eas_errors++;
+ break;
+
+ case _EAS_SEVERITY_WARNING:
+ eas_warnings++;
+ break;
+
+ default:
+ break;
+ }
+
+ /* check severity level */
+ if (severity > severityLevel)
+ return;
+
+ /* check for callback */
+ if (logCallback == NULL)
+ return;
+
+ va_start(vargs, fmt);
+#ifdef _WIN32
+ vsprintf_s(messageBuffer, sizeof(messageBuffer), fmt, vargs);
+#else
+ vsprintf(messageBuffer, fmt, vargs);
+#endif
+ logCallback(severity, messageBuffer);
+ va_end(vargs);
+}
+#endif
+
+/*----------------------------------------------------------------------------
+ * EAS_DLLSetDebugLevel()
+ *----------------------------------------------------------------------------
+*/
+EAS_EXPORT void EAS_DLLSetDebugLevel (int severity)
+{
+ severityLevel = severity;
+}
+
+/*----------------------------------------------------------------------------
+ * EAS_ExSetDebugLevel()
+ *----------------------------------------------------------------------------
+*/
+void EAS_SetDebugLevel (int severity)
+{
+ severityLevel = severity;
+}
+
+/*----------------------------------------------------------------------------
+ * EAS_SelectLibrary()
+ *----------------------------------------------------------------------------
+*/
+EAS_EXPORT EAS_RESULT EAS_SelectLib (EAS_DATA_HANDLE pEASData, EAS_HANDLE streamHandle, EAS_BOOL testLib)
+{
+ extern EAS_SNDLIB_HANDLE VMGetLibHandle(EAS_INT libNum);
+ return EAS_SetSoundLibrary(pEASData, streamHandle, VMGetLibHandle(testLib ? 1 : 0));
+}
+
+
+#if defined(_DEBUG) && !defined(MSC)
+#include <crtdbg.h>
+/*----------------------------------------------------------------------------
+ * EnableHeapDebug()
+ *----------------------------------------------------------------------------
+*/
+static void EnableHeapDebug (void)
+{
+ int temp;
+ temp = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
+ temp |= _CRTDBG_ALLOC_MEM_DF;
+ temp |= _CRTDBG_CHECK_ALWAYS_DF;
+ temp |= _CRTDBG_LEAK_CHECK_DF;
+// temp |= _CRTDBG_DELAY_FREE_MEM_DF;
+ _CrtSetDbgFlag(temp);
+}
+
+/*----------------------------------------------------------------------------
+ * HeapCheck()
+ *----------------------------------------------------------------------------
+ * Check heap status
+ *----------------------------------------------------------------------------
+*/
+void HeapCheck (void)
+{
+ int heapStatus;
+
+ /* Check heap status */
+ heapStatus = _heapchk();
+ if ((heapStatus == _HEAPOK) || (heapStatus == _HEAPEMPTY))
+ return;
+
+ EAS_ReportX(_EAS_SEVERITY_FATAL, "Heap corrupt\n" );
+}
+#endif
+
+
+/*----------------------------------------------------------------------------
+ * EAS_HWInit
+ *
+ * Initialize host wrapper interface
+ *
+ *----------------------------------------------------------------------------
+*/
+EAS_RESULT EAS_HWInit (EAS_HW_DATA_HANDLE *pHWInstData)
+{
+
+#if defined(_DEBUG) && !defined(MSC)
+ EnableHeapDebug();
+#endif
+
+ #ifdef BUFFERED_FILE_ACCESS
+ EAS_ReportX(_EAS_SEVERITY_INFO, "EAS_HWInit: Buffered file access\n");
+ #else
+ EAS_ReportX(_EAS_SEVERITY_INFO, "EAS_HWInit: Memory mapped file access\n");
+ #endif
+
+ /* simulate failure */
+ if (errorConditions[eInitError])
+ return EAS_FAILURE;
+
+ /* need to track file opens for duplicate handles */
+ *pHWInstData = malloc(sizeof(EAS_HW_INST_DATA));
+ if (!(*pHWInstData))
+ return EAS_ERROR_MALLOC_FAILED;
+
+ EAS_HWMemSet(*pHWInstData, 0, sizeof(EAS_HW_INST_DATA));
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ * EAS_HWShutdown
+ *
+ * Shut down host wrapper interface
+ *
+ *----------------------------------------------------------------------------
+*/
+EAS_RESULT EAS_HWShutdown (EAS_HW_DATA_HANDLE hwInstData)
+{
+
+ /* simulate failure */
+ if (errorConditions[eShutdownError])
+ return EAS_FAILURE;
+
+ free(hwInstData);
+
+#if defined(_DEBUG) && !defined(MSC)
+ HeapCheck();
+#endif
+
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWMalloc
+ *
+ * Allocates dynamic memory
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) available for customer use */
+void *EAS_HWMalloc (EAS_HW_DATA_HANDLE hwInstData, EAS_I32 size)
+{
+ /* simulate failure */
+ if (errorConditions[eMallocError])
+ return NULL;
+
+ return malloc((size_t) size);
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWFree
+ *
+ * Frees dynamic memory
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) available for customer use */
+void EAS_HWFree (EAS_HW_DATA_HANDLE hwInstData, void *p)
+{
+ free(p);
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWMemCpy
+ *
+ * Copy memory wrapper
+ *
+ *----------------------------------------------------------------------------
+*/
+void *EAS_HWMemCpy (void *dest, const void *src, EAS_I32 amount)
+{
+ return memcpy(dest, src, (size_t) amount);
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWMemSet
+ *
+ * Set memory wrapper
+ *
+ *----------------------------------------------------------------------------
+*/
+void *EAS_HWMemSet (void *dest, int val, EAS_I32 amount)
+{
+ return memset(dest, val, (size_t) amount);
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWMemCmp
+ *
+ * Compare memory wrapper
+ *
+ *----------------------------------------------------------------------------
+*/
+EAS_I32 EAS_HWMemCmp (const void *s1, const void *s2, EAS_I32 amount)
+{
+ return (EAS_I32) memcmp(s1, s2, (size_t) amount);
+}
+
+#ifdef BUFFERED_FILE_ACCESS
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWOpenFile
+ *
+ * Open a file for read or write
+ *
+ *----------------------------------------------------------------------------
+*/
+EAS_RESULT EAS_HWOpenFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_LOCATOR locator, EAS_FILE_HANDLE *pFile, EAS_FILE_MODE mode)
+{
+ EAS_HW_FILE *file;
+ int i;
+
+ /* set return value to NULL */
+ *pFile = NULL;
+
+ /* only support read mode at this time */
+ if (mode != EAS_FILE_READ)
+ return EAS_ERROR_INVALID_FILE_MODE;
+
+ /* find an empty entry in the file table */
+ file = hwInstData->files;
+ for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
+ {
+ /* is this slot being used? */
+ if (file->pFile == NULL)
+ {
+ EAS_RESULT result;
+
+ /* open the file */
+ file->pFile = fopen((const char*) locator, "rb");
+ if (file->pFile == NULL)
+ return EAS_ERROR_FILE_OPEN_FAILED;
+
+ /* get file length */
+ if ((result = EAS_HWFileLength(hwInstData, file, &file->fileSize)) != EAS_SUCCESS)
+ {
+ EAS_HWCloseFile(hwInstData, file);
+ return result;
+ }
+
+#ifdef DEBUG_FILE_IO
+ EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWOpenFile: Open file %d\n", i);
+#endif
+
+ /* initialize some values */
+ file->bytesInBuffer = 0;
+ file->readIndex = 0;
+ file->filePos = 0;
+ file->dup = EAS_FALSE;
+
+ *pFile = file;
+ return EAS_SUCCESS;
+ }
+ file++;
+ }
+
+ /* too many open files */
+ return EAS_ERROR_MAX_FILES_OPEN;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWFillBuffer
+ *
+ * Fill buffer from file
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) hwInstData available for customer use */
+EAS_RESULT EAS_HWFillBuffer (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file)
+{
+ /* reposition the file pointer */
+ if (fseek(file->pFile, file->filePos, SEEK_SET) != 0)
+ return EAS_ERROR_FILE_SEEK;
+
+ /* read some data from the file */
+ file->bytesInBuffer = (EAS_I32) fread(file->buffer, 1, EAS_FILE_BUFFER_SIZE, file->pFile);
+ file->readIndex = 0;
+ if (file->bytesInBuffer == 0)
+ return EAS_EOF;
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWReadFile
+ *
+ * Read data from a file
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) hwInstData available for customer use */
+EAS_RESULT EAS_HWReadFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *pBuffer, EAS_I32 n, EAS_I32 *pBytesRead)
+{
+ EAS_RESULT result;
+ EAS_I32 temp;
+ EAS_U8 *p = pBuffer;
+ EAS_I32 bytesLeft = n;
+
+ *pBytesRead = 0;
+
+ /* check handle integrity */
+ if (file->pFile == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+#ifdef DEBUG_FILE_IO
+ EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWReadFile: Reading %d bytes from position %d\n", n, file->filePos);
+#endif
+
+ /* try to fulfill request from buffer */
+ for (;bytesLeft > 0;)
+ {
+ /* how many bytes can we get from buffer? */
+ temp = file->bytesInBuffer - file->readIndex;
+ if (temp > bytesLeft)
+ temp = bytesLeft;
+
+ /* copy data from buffer */
+ EAS_HWMemCpy(p, &file->buffer[file->readIndex], temp);
+ *pBytesRead += temp;
+ file->readIndex += temp;
+ file->filePos += temp;
+ p += temp;
+ bytesLeft -= temp;
+
+ /* don't refill buffer if request is bigger than buffer */
+ if ((bytesLeft == 0) || (bytesLeft >= EAS_FILE_BUFFER_SIZE))
+ break;
+
+ /* refill buffer */
+ if ((result = EAS_HWFillBuffer(hwInstData, file)) != EAS_SUCCESS)
+ return result;
+ }
+
+ /* more to read? do unbuffered read directly to target memory */
+ if (bytesLeft)
+ {
+
+ /* position the file pointer */
+ if (fseek(file->pFile, file->filePos, SEEK_SET) != 0)
+ return EAS_ERROR_FILE_SEEK;
+
+ /* read data in the buffer */
+ temp = (EAS_I32) fread(p, 1, (size_t) bytesLeft, file->pFile);
+ *pBytesRead += temp;
+ file->filePos += temp;
+
+ /* reset buffer info */
+ file->bytesInBuffer = 0;
+ file->readIndex = 0;
+ }
+
+#ifdef DEBUG_FILE_IO
+ {
+#define BYTES_PER_LINE 16
+ char str[BYTES_PER_LINE * 3 + 1];
+ EAS_INT i;
+ for (i = 0; i < (n > BYTES_PER_LINE ? BYTES_PER_LINE : n) ; i ++)
+ sprintf(&str[i*3], "%02x ", ((EAS_U8*)pBuffer)[i]);
+ if (i)
+ EAS_ReportX(_EAS_SEVERITY_NOFILTER, "%s\n", str);
+ }
+#endif
+
+ /* were n bytes read? */
+ if (*pBytesRead != n)
+ return EAS_EOF;
+
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWGetByte
+ *
+ * Read a byte from a file
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) hwInstData available for customer use */
+EAS_RESULT EAS_HWGetByte (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p)
+{
+ EAS_RESULT result;
+
+ /* check handle integrity */
+ if (file->pFile == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ /* use local buffer - do we have any data? */
+ if (file->readIndex >= file->bytesInBuffer)
+ {
+ if ((result = EAS_HWFillBuffer(hwInstData, file)) != EAS_SUCCESS)
+ return result;
+
+ /* if nothing to read, return EOF */
+ if (file->bytesInBuffer == 0)
+ return EAS_EOF;
+ }
+
+ /* get a character from the buffer */
+ *((EAS_U8*) p) = file->buffer[file->readIndex++];
+
+#ifdef DEBUG_FILE_IO
+ EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWGetByte: Reading from position %d, byte = 0x%02x\n", file->filePos, *(EAS_U8*)p);
+#endif
+
+ file->filePos++;
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWGetWord
+ *
+ * Read a 16-bit value from the file
+ *----------------------------------------------------------------------------
+*/
+EAS_RESULT EAS_HWGetWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst)
+{
+ EAS_RESULT result;
+ EAS_I32 count;
+ EAS_U8 c[2];
+
+#ifdef DEBUG_FILE_IO
+ EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWGetWord: Reading 2 bytes from position %d\n", file->filePos);
+#endif
+
+ /* read 2 bytes from the file */
+ if ((result = EAS_HWReadFile(hwInstData, file, c, 2, &count)) != EAS_SUCCESS)
+ return result;
+
+ /* order them as requested */
+ if (msbFirst)
+ *((EAS_U16*) p) = ((EAS_U16) c[0] << 8) | c[1];
+ else
+ *((EAS_U16*) p) = ((EAS_U16) c[1] << 8) | c[0];
+
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWGetDWord
+ *
+ * Read a 16-bit value from the file
+ *----------------------------------------------------------------------------
+*/
+EAS_RESULT EAS_HWGetDWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst)
+{
+ EAS_RESULT result;
+ EAS_I32 count;
+ EAS_U8 c[4];
+
+#ifdef DEBUG_FILE_IO
+ EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWGetDWord: Reading 4 bytes from position %d\n", file->filePos);
+#endif
+
+ /* read 4 bytes from the file */
+ if ((result = EAS_HWReadFile(hwInstData, file, c, 4, &count)) != EAS_SUCCESS)
+ return result;
+
+ /* order them as requested */
+ if (msbFirst)
+ *((EAS_U32*) p) = ((EAS_U32) c[0] << 24) | ((EAS_U32) c[1] << 16) | ((EAS_U32) c[2] << 8) | c[3];
+ else
+ *((EAS_U32*) p) = ((EAS_U32) c[3] << 24) | ((EAS_U32) c[2] << 16) | ((EAS_U32) c[1] << 8) | c[0];
+
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWFilePos
+ *
+ * Returns the current location in the file
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) hwInstData available for customer use */
+EAS_RESULT EAS_HWFilePos (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pPosition)
+{
+
+ /* check handle integrity */
+ if (file->pFile == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ *pPosition = file->filePos;
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWFileSeek
+ *
+ * Seek to a specific location in the file
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) hwInstData available for customer use */
+EAS_RESULT EAS_HWFileSeek (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position)
+{
+ EAS_I32 newIndex;
+
+ /* check handle integrity */
+ if (file->pFile == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ /* check for seek past end */
+ if ((position < 0) || (position > file->fileSize))
+ return EAS_ERROR_FILE_SEEK;
+
+#ifdef DEBUG_FILE_IO
+ EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWFileSeek: Seeking to new position %d\n", file->filePos);
+#endif
+
+ /* is new position in current buffer? */
+ newIndex = position - file->filePos + file->readIndex;
+ if ((newIndex >= 0) && (newIndex < file->bytesInBuffer))
+ {
+ file->readIndex = newIndex;
+ file->filePos = position;
+ return EAS_SUCCESS;
+ }
+
+ /* save new position and reset buffer info so EAS_HWGetByte doesn't fail */
+ file->filePos = position;
+ file->bytesInBuffer = 0;
+ file->readIndex = 0;
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWFileSeekOfs
+ *
+ * Seek forward or back relative to the current position
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) hwInstData available for customer use */
+EAS_RESULT EAS_HWFileSeekOfs (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position)
+{
+ EAS_I32 temp;
+
+#ifdef DEBUG_FILE_IO
+ EAS_ReportX(_EAS_SEVERITY_NOFILTER, "EAS_HWFileSeekOfs: Seeking to new position %d\n", file->filePos + position);
+#endif
+
+ /* check handle integrity */
+ if (file->pFile == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ /* check for seek past end */
+ temp = file->filePos + position;
+ if ((temp < 0) || (temp > file->fileSize))
+ return EAS_ERROR_FILE_SEEK;
+
+ /* is new position in current buffer? */
+ temp = position + file->readIndex;
+ if ((temp >= 0) && (temp < file->bytesInBuffer))
+ {
+ file->readIndex = temp;
+ file->filePos += position;
+ return EAS_SUCCESS;
+ }
+
+ /* save new position and reset buffer info so EAS_HWGetByte doesn't fail */
+ file->filePos += position;
+ file->bytesInBuffer = 0;
+ file->readIndex = 0;
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWFileLength
+ *
+ * Return the file length
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) hwInstData available for customer use */
+EAS_RESULT EAS_HWFileLength (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pLength)
+{
+ long pos;
+
+ /* check handle integrity */
+ if (file->pFile == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ if ((pos = ftell(file->pFile)) == -1L)
+ return EAS_ERROR_FILE_LENGTH;
+ if (fseek(file->pFile, 0L, SEEK_END) != 0)
+ return EAS_ERROR_FILE_LENGTH;
+ if ((*pLength = ftell(file->pFile)) == -1L)
+ return EAS_ERROR_FILE_LENGTH;
+ if (fseek(file->pFile, pos, SEEK_SET) != 0)
+ return EAS_ERROR_FILE_LENGTH;
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWDupHandle
+ *
+ * Duplicate a file handle
+ *
+ *----------------------------------------------------------------------------
+*/
+EAS_RESULT EAS_HWDupHandle (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_FILE_HANDLE* pDupFile)
+{
+ EAS_HW_FILE *dupfile;
+ int i;
+
+ /* check handle integrity */
+ *pDupFile = NULL;
+ if (file->pFile == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ /* find an empty entry in the file table */
+ dupfile = hwInstData->files;
+ for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
+ {
+ /* is this slot being used? */
+ if (dupfile->pFile == NULL)
+ {
+
+ /* copy info from the handle to be duplicated */
+ dupfile->filePos = file->filePos;
+ dupfile->pFile = file->pFile;
+ dupfile->fileSize = file->fileSize;
+
+ /* set the duplicate handle flag */
+ dupfile->dup = file->dup = EAS_TRUE;
+
+ /* initialize some values */
+ dupfile->bytesInBuffer = 0;
+ dupfile->readIndex = 0;
+
+ *pDupFile = dupfile;
+ return EAS_SUCCESS;
+ }
+ dupfile++;
+ }
+
+ /* too many open files */
+ return EAS_ERROR_MAX_FILES_OPEN;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWClose
+ *
+ * Wrapper for fclose function
+ *
+ *----------------------------------------------------------------------------
+*/
+EAS_RESULT EAS_HWCloseFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file1)
+{
+ EAS_HW_FILE *file2,*dupFile;
+ int i;
+
+ /* check handle integrity */
+ if (file1->pFile == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ /* check for duplicate handle */
+ if (file1->dup)
+ {
+ dupFile = NULL;
+ file2 = hwInstData->files;
+ for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
+ {
+ /* check for duplicate */
+ if ((file1 != file2) && (file2->pFile == file1->pFile))
+ {
+ /* is there more than one duplicate? */
+ if (dupFile != NULL)
+ {
+ /* clear this entry and return */
+ file1->pFile = NULL;
+ return EAS_SUCCESS;
+ }
+
+ /* this is the first duplicate found */
+ dupFile = file2;
+ }
+ file2++;
+ }
+
+ /* there is only one duplicate, clear the dup flag */
+ if (dupFile)
+ dupFile->dup = EAS_FALSE;
+ else
+ /* if we get here, there's a serious problem */
+ return EAS_ERROR_HANDLE_INTEGRITY;
+
+ /* clear this entry and return */
+ file1->pFile = NULL;
+ return EAS_SUCCESS;
+ }
+
+ /* no duplicates - close the file */
+ if (fclose(file1->pFile) != 0)
+ return EAS_ERROR_CLOSE_FAILED;
+
+ /* clear this entry and return */
+ file1->pFile = NULL;
+ return EAS_SUCCESS;
+}
+#else
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWOpenFile
+ *
+ * Open a file for read or write
+ *
+ *----------------------------------------------------------------------------
+*/
+EAS_RESULT EAS_HWOpenFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_LOCATOR locator, EAS_FILE_HANDLE *pFile, EAS_FILE_MODE mode)
+{
+ EAS_HW_FILE *file;
+ FILE *ioFile;
+ int i, temp;
+
+ /* set return value to NULL */
+ *pFile = NULL;
+
+ /* simulate failure */
+ if (errorConditions[eOpenError])
+ return EAS_FAILURE;
+
+ /* only support read mode at this time */
+ if (mode != EAS_FILE_READ)
+ return EAS_ERROR_INVALID_FILE_MODE;
+
+ /* find an empty entry in the file table */
+ file = hwInstData->files;
+ for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
+ {
+ /* is this slot being used? */
+ if (file->buffer == NULL)
+ {
+ /* open the file */
+ if ((ioFile = fopen(locator,"rb")) == NULL)
+ return EAS_ERROR_FILE_OPEN_FAILED;
+
+ /* determine the file size */
+ if (fseek(ioFile, 0L, SEEK_END) != 0)
+ return EAS_ERROR_FILE_LENGTH;
+ if ((file->fileSize = ftell(ioFile)) == -1L)
+ return EAS_ERROR_FILE_LENGTH;
+ if (fseek(ioFile, 0L, SEEK_SET) != 0)
+ return EAS_ERROR_FILE_LENGTH;
+
+ /* allocate a buffer */
+ file->buffer = EAS_HWMalloc(hwInstData, file->fileSize);
+ if (file->buffer == NULL)
+ {
+ fclose(ioFile);
+ return EAS_ERROR_MALLOC_FAILED;
+ }
+
+ /* read the file into memory */
+ temp = (int) fread(file->buffer, (size_t) file->fileSize, 1, ioFile);
+
+ /* close the file - don't need it any more */
+ fclose(ioFile);
+
+ /* check for error reading file */
+ if (temp != 1)
+ return EAS_ERROR_FILE_READ_FAILED;
+
+ /* initialize some values */
+ file->filePos = 0;
+ file->dup = EAS_FALSE;
+
+ *pFile = file;
+ return EAS_SUCCESS;
+ }
+ file++;
+ }
+
+ /* too many open files */
+ return EAS_ERROR_MAX_FILES_OPEN;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWReadFile
+ *
+ * Read data from a file
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) available for customer use */
+EAS_RESULT EAS_HWReadFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *pBuffer, EAS_I32 n, EAS_I32 *pBytesRead)
+{
+ EAS_I32 count;
+
+ /* simulate failure */
+ if (errorConditions[eReadError])
+ return EAS_FAILURE;
+
+ /* make sure we have a valid handle */
+ if (file->buffer == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ /* calculate the bytes to read */
+ count = file->fileSize - file->filePos;
+ if (n < count)
+ count = n;
+
+ /* copy the data to the requested location, and advance the pointer */
+ if (count)
+ EAS_HWMemCpy(pBuffer, &file->buffer[file->filePos], count);
+ file->filePos += count;
+ *pBytesRead = count;
+
+ /* were n bytes read? */
+ if (count!= n)
+ return EAS_EOF;
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWGetByte
+ *
+ * Read a byte from a file
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -e{715} hwInstData available for customer use */
+EAS_RESULT EAS_HWGetByte (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p)
+{
+
+ /* simulate failure */
+ if (errorConditions[eReadError])
+ return EAS_FAILURE;
+
+ /* make sure we have a valid handle */
+ if (file->buffer == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ /* check for end of file */
+ if (file->filePos >= file->fileSize)
+ {
+ *((EAS_U8*) p) = 0;
+ return EAS_EOF;
+ }
+
+ /* get a character from the buffer */
+ *((EAS_U8*) p) = file->buffer[file->filePos++];
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWGetWord
+ *
+ * Returns the current location in the file
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) available for customer use */
+EAS_RESULT EAS_HWGetWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst)
+{
+ EAS_RESULT result;
+ EAS_U8 c1, c2;
+
+ /* read 2 bytes from the file */
+ if ((result = EAS_HWGetByte(hwInstData, file, &c1)) != EAS_SUCCESS)
+ return result;
+ if ((result = EAS_HWGetByte(hwInstData, file, &c2)) != EAS_SUCCESS)
+ return result;
+
+ /* order them as requested */
+ if (msbFirst)
+ *((EAS_U16*) p) = ((EAS_U16) c1 << 8) | c2;
+ else
+ *((EAS_U16*) p) = ((EAS_U16) c2 << 8) | c1;
+
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWGetDWord
+ *
+ * Returns the current location in the file
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) available for customer use */
+EAS_RESULT EAS_HWGetDWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst)
+{
+ EAS_RESULT result;
+ EAS_U8 c1, c2,c3,c4;
+
+ /* read 4 bytes from the file */
+ if ((result = EAS_HWGetByte(hwInstData, file, &c1)) != EAS_SUCCESS)
+ return result;
+ if ((result = EAS_HWGetByte(hwInstData, file, &c2)) != EAS_SUCCESS)
+ return result;
+ if ((result = EAS_HWGetByte(hwInstData, file, &c3)) != EAS_SUCCESS)
+ return result;
+ if ((result = EAS_HWGetByte(hwInstData, file, &c4)) != EAS_SUCCESS)
+ return result;
+
+ /* order them as requested */
+ if (msbFirst)
+ *((EAS_U32*) p) = ((EAS_U32) c1 << 24) | ((EAS_U32) c2 << 16) | ((EAS_U32) c3 << 8) | c4;
+ else
+ *((EAS_U32*) p)= ((EAS_U32) c4 << 24) | ((EAS_U32) c3 << 16) | ((EAS_U32) c2 << 8) | c1;
+
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWFilePos
+ *
+ * Returns the current location in the file
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) available for customer use */
+EAS_RESULT EAS_HWFilePos (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pPosition)
+{
+
+ /* simulate failure */
+ if (errorConditions[ePosError])
+ return EAS_FAILURE;
+
+ /* make sure we have a valid handle */
+ if (file->buffer == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ *pPosition = file->filePos;
+ return EAS_SUCCESS;
+} /* end EAS_HWFilePos */
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWFileSeek
+ *
+ * Seek to a specific location in the file
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) available for customer use */
+EAS_RESULT EAS_HWFileSeek (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position)
+{
+
+ /* simulate failure */
+ if (errorConditions[eSeekError])
+ return EAS_FAILURE;
+
+ /* make sure we have a valid handle */
+ if (file->buffer == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ /* validate new position */
+ if ((position < 0) || (position > file->fileSize))
+ return EAS_ERROR_FILE_SEEK;
+
+ /* save new position */
+ file->filePos = position;
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWFileSeekOfs
+ *
+ * Seek forward or back relative to the current position
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) available for customer use */
+EAS_RESULT EAS_HWFileSeekOfs (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position)
+{
+
+ /* simulate failure */
+ if (errorConditions[eSeekError])
+ return EAS_FAILURE;
+
+ /* make sure we have a valid handle */
+ if (file->buffer == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ /* determine the file position */
+ position += file->filePos;
+ if ((position < 0) || (position > file->fileSize))
+ return EAS_ERROR_FILE_SEEK;
+
+ /* save new position */
+ file->filePos = position;
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWFileLength
+ *
+ * Return the file length
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) available for customer use */
+EAS_RESULT EAS_HWFileLength (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pLength)
+{
+
+ /* simulate failure */
+ if (errorConditions[eLengthError])
+ return EAS_FAILURE;
+
+ /* make sure we have a valid handle */
+ if (file->buffer == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ *pLength = file->fileSize;
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWDupHandle
+ *
+ * Duplicate a file handle
+ *
+ *----------------------------------------------------------------------------
+*/
+EAS_RESULT EAS_HWDupHandle (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_FILE_HANDLE *pDupFile)
+{
+ EAS_HW_FILE *dupFile;
+ int i;
+
+ /* simulate failure */
+ if (errorConditions[eDupError])
+ return EAS_FAILURE;
+
+ /* make sure we have a valid handle */
+ if (file->buffer == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ /* find an empty entry in the file table */
+ dupFile = hwInstData->files;
+ for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
+ {
+ /* is this slot being used? */
+ if (dupFile->buffer == NULL)
+ {
+
+ /* copy info from the handle to be duplicated */
+ dupFile->filePos = file->filePos;
+ dupFile->fileSize = file->fileSize;
+ dupFile->buffer = file->buffer;
+
+ /* set the duplicate handle flag */
+ dupFile->dup = file->dup = EAS_TRUE;
+
+ *pDupFile = dupFile;
+ return EAS_SUCCESS;
+ }
+ dupFile++;
+ }
+
+ /* too many open files */
+ return EAS_ERROR_MAX_FILES_OPEN;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWClose
+ *
+ * Wrapper for fclose function
+ *
+ *----------------------------------------------------------------------------
+*/
+EAS_RESULT EAS_HWCloseFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file1)
+{
+ EAS_HW_FILE *file2,*dupFile;
+ int i;
+
+ /* simulate failure */
+ if (errorConditions[eCloseError])
+ return EAS_FAILURE;
+
+ /* make sure we have a valid handle */
+ if (file1->buffer == NULL)
+ return EAS_ERROR_INVALID_HANDLE;
+
+ /* check for duplicate handle */
+ if (file1->dup)
+ {
+ dupFile = NULL;
+ file2 = hwInstData->files;
+ for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
+ {
+ /* check for duplicate */
+ if ((file1 != file2) && (file2->buffer == file1->buffer))
+ {
+ /* is there more than one duplicate? */
+ if (dupFile != NULL)
+ {
+ /* clear this entry and return */
+ file1->buffer = NULL;
+ return EAS_SUCCESS;
+ }
+
+ /* this is the first duplicate found */
+ else
+ dupFile = file2;
+ }
+ file2++;
+ }
+
+ /* there is only one duplicate, clear the dup flag */
+ if (dupFile)
+ dupFile->dup = EAS_FALSE;
+ else
+ /* if we get here, there's a serious problem */
+ return EAS_ERROR_HANDLE_INTEGRITY;
+
+ /* clear this entry and return */
+ file1->buffer = NULL;
+ return EAS_SUCCESS;
+ }
+
+ /* no duplicates -free the buffer */
+ EAS_HWFree(hwInstData, file1->buffer);
+
+ /* clear this entry and return */
+ file1->buffer = NULL;
+ return EAS_SUCCESS;
+}
+#endif
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWVibrate
+ *
+ * Turn on/off vibrate function
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) available for customer use */
+EAS_RESULT EAS_HWVibrate (EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state)
+{
+ vibState = state;
+// EAS_ReportX(_EAS_SEVERITY_NOFILTER, "Vibrate state: %d\n", state);
+ return EAS_SUCCESS;
+} /* end EAS_HWVibrate */
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWLED
+ *
+ * Turn on/off LED
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) available for customer use */
+EAS_RESULT EAS_HWLED (EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state)
+{
+ ledState = state;
+// EAS_ReportX(_EAS_SEVERITY_NOFILTER, "LED state: %d\n", state);
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWBackLight
+ *
+ * Turn on/off backlight
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) available for customer use */
+EAS_RESULT EAS_HWBackLight (EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state)
+{
+ backlightState = state;
+// EAS_ReportX(_EAS_SEVERITY_NOFILTER, "Backlight state: %d\n", state);
+ return EAS_SUCCESS;
+}
+
+/*----------------------------------------------------------------------------
+ *
+ * EAS_HWYield
+ *
+ * This function is called periodically by the EAS library to give the
+ * host an opportunity to allow other tasks to run. There are two ways to
+ * use this call:
+ *
+ * If you have a multi-tasking OS, you can call the yield function in the
+ * OS to allow other tasks to run. In this case, return EAS_FALSE to tell
+ * the EAS library to continue processing when control returns from this
+ * function.
+ *
+ * If tasks run in a single thread by sequential function calls (sometimes
+ * call a "commutator loop"), return EAS_TRUE to cause the EAS Library to
+ * return to the caller. Be sure to check the number of bytes rendered
+ * before passing the audio buffer to the codec - it may not be filled.
+ * The next call to EAS_Render will continue processing until the buffer
+ * has been filled.
+ *
+ *----------------------------------------------------------------------------
+*/
+/*lint -esym(715, hwInstData) available for customer use */
+EAS_BOOL EAS_HWYield (EAS_HW_DATA_HANDLE hwInstData)
+{
+ /* put your code here */
+ return EAS_FALSE;
+}
+
+
diff --git a/arm-wt-22k/jetcreator_lib_src/darwin-x86/eas_host_debug.h b/arm-wt-22k/jetcreator_lib_src/darwin-x86/eas_host_debug.h
index 8a01922..fb40923 100755..100644
--- a/arm-wt-22k/jetcreator_lib_src/darwin-x86/eas_host_debug.h
+++ b/arm-wt-22k/jetcreator_lib_src/darwin-x86/eas_host_debug.h
@@ -1,47 +1,47 @@
-/*----------------------------------------------------------------------------
- *
- * File:
- * eas_host_debug.h
- *
- * Contents and purpose:
- * This header defines the host wrapper functions for simulating
- * error conditions.
- *
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-// sentinel
-#ifndef _EAS_HOST_DEBUG_H
-#define _EAS_HOST_DEBUG_H
-
-#include "eas_types.h"
-
-typedef enum
-{
- eInitError,
- eShutdownError,
- eMallocError,
- eOpenError,
- eReadError,
- ePosError,
- eSeekError,
- eLengthError,
- eDupError,
- eCloseError,
- eNumErrorConditions,
-} E_ERROR_CONDITIONS;
-
-#endif
-
+/*----------------------------------------------------------------------------
+ *
+ * File:
+ * eas_host_debug.h
+ *
+ * Contents and purpose:
+ * This header defines the host wrapper functions for simulating
+ * error conditions.
+ *
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+// sentinel
+#ifndef _EAS_HOST_DEBUG_H
+#define _EAS_HOST_DEBUG_H
+
+#include "eas_types.h"
+
+typedef enum
+{
+ eInitError,
+ eShutdownError,
+ eMallocError,
+ eOpenError,
+ eReadError,
+ ePosError,
+ eSeekError,
+ eLengthError,
+ eDupError,
+ eCloseError,
+ eNumErrorConditions,
+} E_ERROR_CONDITIONS;
+
+#endif
+
diff --git a/arm-wt-22k/jetcreator_lib_src/darwin-x86/eastestv37.c b/arm-wt-22k/jetcreator_lib_src/darwin-x86/eastestv37.c
index e4e9c48..f325c04 100755..100644
--- a/arm-wt-22k/jetcreator_lib_src/darwin-x86/eastestv37.c
+++ b/arm-wt-22k/jetcreator_lib_src/darwin-x86/eastestv37.c
@@ -1,999 +1,999 @@
-/*----------------------------------------------------------------------------
- *
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-#include "eas_sndlib.h"
-
-/*----------------------------------------------------------------------------
- * Articulations
- *----------------------------------------------------------------------------
-*/
-const S_ARTICULATION testArticulations[] =
-{
- { /* articulation 0 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 1 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 100, 0, 19, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 2 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 100, 34, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 3 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 100, 86, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 4 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 100, 172, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 5 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 100, 345, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 6 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 100, 517, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 7 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 100, 689, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 8 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 100, 861, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 9 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 100, 1723, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 10 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 100, 0, 191, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 11 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 100, 0, 382, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 12 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 100, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 13 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 100, 0, 1903, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 14 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 100, 0, 3804, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 15 */
- { 1902, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 16 */
- { 380, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 17 */
- { 190, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 18 */
- { 38, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 19 */
- { 19, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 20 */
- { 10, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 21 */
- { 5, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 22 */
- { 32767, 17213, 0, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 23 */
- { 32767, 28809, 0, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 24 */
- { 32767, 30725, 0, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 25 */
- { 32767, 32349, 0, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 26 */
- { 32767, 32558, 0, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 27 */
- { 32767, 32663, 0, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 28 */
- { 32767, 32715, 0, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 29 */
- { 32767, 30725, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 30 */
- { 32767, 30725, 3566, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 31 */
- { 32767, 30725, 42, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 32 */
- { 32767, 30725, 5, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 33 */
- { 32767, 30725, 2, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 34 */
- { 32767, 0, 32767, 17213 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 35 */
- { 32767, 0, 32767, 28809 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 36 */
- { 32767, 0, 32767, 30725 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 37 */
- { 32767, 0, 32767, 32349 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 38 */
- { 32767, 0, 32767, 32558 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 39 */
- { 32767, 0, 32767, 32663 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 40 */
- { 32767, 0, 32767, 32715 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 41 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 190, 0, 0, 0, 1, 0, 0
- },
- { /* articulation 42 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 189, 0, 0, 0, 3, 0, 0
- },
- { /* articulation 43 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 190, 0, 0, 0, 4, 0, 0
- },
- { /* articulation 44 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 190, 0, 0, 0, 6, 0, 0
- },
- { /* articulation 45 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- -1200, 0, 190, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 46 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- -600, 0, 190, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 47 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- -100, 0, 190, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 48 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- -50, 0, 190, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 49 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 50, 0, 190, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 50 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 100, 0, 190, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 51 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 600, 0, 190, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 52 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 1200, 0, 190, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 53 */
- { 32767, 0, 32767, 0 },
- { 190, 190, 0, 0 },
- 0, 0, 951, -1200, 0, 0, 0, 0, 0
- },
- { /* articulation 54 */
- { 32767, 0, 32767, 0 },
- { 190, 190, 0, 0 },
- 0, 0, 951, -600, 0, 0, 0, 0, 0
- },
- { /* articulation 55 */
- { 32767, 0, 32767, 0 },
- { 190, 190, 0, 0 },
- 0, 0, 951, -100, 0, 0, 0, 0, 0
- },
- { /* articulation 56 */
- { 32767, 0, 32767, 0 },
- { 190, 190, 0, 0 },
- 0, 0, 951, -50, 0, 0, 0, 0, 0
- },
- { /* articulation 57 */
- { 32767, 0, 32767, 0 },
- { 190, 190, 0, 0 },
- 0, 0, 951, 50, 0, 0, 0, 0, 0
- },
- { /* articulation 58 */
- { 32767, 0, 32767, 0 },
- { 190, 190, 0, 0 },
- 0, 0, 951, 100, 0, 0, 0, 0, 0
- },
- { /* articulation 59 */
- { 32767, 0, 32767, 0 },
- { 190, 190, 0, 0 },
- 0, 0, 951, 600, 0, 0, 0, 0, 0
- },
- { /* articulation 60 */
- { 32767, 0, 32767, 0 },
- { 190, 190, 0, 0 },
- 0, 0, 951, 1200, 0, 0, 0, 0, 0
- },
- { /* articulation 61 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 5535, 0, 0, 0
- },
- { /* articulation 62 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 7121, 0, 0, 0
- },
- { /* articulation 63 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 8321, 0, 0, 0
- },
- { /* articulation 64 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 9906, 0, 0, 0
- },
- { /* articulation 65 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 11106, 0, 0, 0
- },
- { /* articulation 66 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 9521, 0, 0, 0
- },
- { /* articulation 67 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 9521, 0, 8, 0
- },
- { /* articulation 68 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 9521, 0, 16, 0
- },
- { /* articulation 69 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 9521, 0, 24, 0
- },
- { /* articulation 70 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 9521, 0, 30, 0
- },
- { /* articulation 71 */
- { 32767, 0, 32767, 0 },
- { 190, 190, 0, 0 },
- 0, 0, 951, 0, -6400, 9521, 0, 0, 0
- },
- { /* articulation 72 */
- { 32767, 0, 32767, 0 },
- { 190, 190, 0, 0 },
- 0, 0, 951, 0, -3200, 9521, 0, 0, 0
- },
- { /* articulation 73 */
- { 32767, 0, 32767, 0 },
- { 190, 190, 0, 0 },
- 0, 0, 951, 0, -1600, 9521, 0, 0, 0
- },
- { /* articulation 74 */
- { 32767, 0, 32767, 0 },
- { 190, 190, 0, 0 },
- 0, 0, 951, 0, -800, 9521, 0, 0, 0
- },
- { /* articulation 75 */
- { 32767, 0, 32767, 0 },
- { 190, 190, 0, 0 },
- 0, 0, 951, 0, 800, 7121, 0, 0, 0
- },
- { /* articulation 76 */
- { 190, 30725, 32767, 0 },
- { 190, 190, 0, 0 },
- 0, 0, 951, 0, 1600, 7121, 0, 0, 0
- },
- { /* articulation 77 */
- { 32767, 0, 32767, 0 },
- { 190, 190, 0, 0 },
- 0, 0, 951, 0, 3200, 7121, 0, 0, 0
- },
- { /* articulation 78 */
- { 32767, 0, 32767, 0 },
- { 190, 190, 0, 0 },
- 0, 0, 951, 0, 6400, 7121, 0, 0, 0
- },
- { /* articulation 79 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 190, 0, 0, 11106, 0, 0, 0
- },
- { /* articulation 80 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 191, 0, 0, 11106, 0, 0, 0
- },
- { /* articulation 81 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 190, 0, 0, 7121, 0, 0, 0
- },
- { /* articulation 82 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, -63
- },
- { /* articulation 83 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, -50
- },
- { /* articulation 84 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, -37
- },
- { /* articulation 85 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, -25
- },
- { /* articulation 86 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, -12
- },
- { /* articulation 87 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 12
- },
- { /* articulation 88 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 25
- },
- { /* articulation 89 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 37
- },
- { /* articulation 90 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 50
- },
- { /* articulation 91 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 0, 0, 0, 63
- },
- { /* articulation 92 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 9907, 0, 0, 0
- },
- { /* articulation 93 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 10574, 0, 0, 0
- },
- { /* articulation 94 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 11373, 0, 0, 0
- },
- { /* articulation 95 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 951, 0, 0, 11376, 0, 0, 0
- },
- { /* articulation 96 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 100, 0, 949, 0, 0, 0, 0, 0, 0
- }
-}; /*end Articulations */
-
-/*----------------------------------------------------------------------------
- * Regions
- *----------------------------------------------------------------------------
-*/
-const S_WT_REGION testRegions[] =
-{
- { { 32769, 0, 127 }, -6000, 32767, 101, 301, 4, 0 }, /* region 0 */
- { { 1, 0, 60 }, -6000, 32767, 101, 301, 4, 2 }, /* region 1 */
- { { 1, 61, 61 }, -6000, 32767, 101, 301, 4, 3 }, /* region 2 */
- { { 1, 62, 62 }, -6000, 32767, 101, 301, 4, 4 }, /* region 3 */
- { { 1, 63, 63 }, -6000, 32767, 101, 301, 4, 5 }, /* region 4 */
- { { 1, 64, 64 }, -6000, 32767, 101, 301, 4, 6 }, /* region 5 */
- { { 1, 65, 65 }, -6000, 32767, 101, 301, 4, 7 }, /* region 6 */
- { { 1, 66, 66 }, -6000, 32767, 101, 301, 4, 8 }, /* region 7 */
- { { 32769, 67, 127 }, -6000, 32767, 101, 301, 4, 9 }, /* region 8 */
- { { 32769, 0, 127 }, -6005, 32767, 3, 171, 5, 0 }, /* region 9 */
- { { 32768, 0, 127 }, -6555, 32767, 0, 0, 2, 0 }, /* region 10 */
- { { 32770, 0, 127 }, -6000, 32767, 0, 0, 0, 0 }, /* region 11 */
- { { 1, 60, 60 }, -6000, 32767, 101, 301, 4, 0 }, /* region 12 */
- { { 1, 61, 61 }, -6100, 16422, 101, 151, 4, 0 }, /* region 13 */
- { { 1, 62, 62 }, -6200, 8231, 101, 151, 4, 0 }, /* region 14 */
- { { 1, 63, 63 }, -6300, 2067, 101, 151, 4, 0 }, /* region 15 */
- { { 1, 64, 64 }, -6400, 130, 101, 151, 4, 0 }, /* region 16 */
- { { 32769, 65, 65 }, -6500, 1, 101, 151, 4, 0 }, /* region 17 */
- { { 1, 60, 60 }, -6000, 32767, 101, 301, 4, 0 }, /* region 18 */
- { { 1, 61, 61 }, -6200, 32767, 101, 151, 4, 0 }, /* region 19 */
- { { 1, 62, 62 }, -6400, 32767, 101, 151, 4, 0 }, /* region 20 */
- { { 1, 63, 63 }, -6600, 32767, 101, 151, 4, 0 }, /* region 21 */
- { { 1, 64, 64 }, -6800, 32767, 101, 151, 4, 0 }, /* region 22 */
- { { 1, 65, 65 }, -7000, 32767, 101, 151, 4, 0 }, /* region 23 */
- { { 1, 66, 66 }, -7200, 32767, 101, 151, 4, 0 }, /* region 24 */
- { { 1, 67, 67 }, -7400, 32767, 101, 151, 4, 0 }, /* region 25 */
- { { 1, 68, 68 }, -7600, 32767, 101, 151, 4, 0 }, /* region 26 */
- { { 1, 69, 69 }, -7800, 32767, 101, 151, 4, 0 }, /* region 27 */
- { { 1, 70, 70 }, -8000, 32767, 101, 151, 4, 0 }, /* region 28 */
- { { 1, 71, 71 }, -8200, 32767, 101, 151, 4, 0 }, /* region 29 */
- { { 32769, 72, 72 }, -8400, 32767, 101, 151, 4, 0 }, /* region 30 */
- { { 1, 60, 60 }, -6000, 32767, 101, 301, 4, 0 }, /* region 31 */
- { { 1, 61, 61 }, -6099, 32767, 101, 151, 4, 0 }, /* region 32 */
- { { 1, 62, 62 }, -6190, 32767, 101, 151, 4, 0 }, /* region 33 */
- { { 1, 63, 63 }, -6250, 32767, 101, 151, 4, 0 }, /* region 34 */
- { { 1, 64, 64 }, -6300, 32767, 101, 151, 4, 0 }, /* region 35 */
- { { 1, 65, 65 }, -6500, 32767, 101, 151, 4, 0 }, /* region 36 */
- { { 1, 66, 66 }, -6601, 32767, 101, 151, 4, 0 }, /* region 37 */
- { { 1, 67, 67 }, -6710, 32767, 101, 151, 4, 0 }, /* region 38 */
- { { 1, 68, 68 }, -6850, 32767, 101, 151, 4, 0 }, /* region 39 */
- { { 32769, 69, 69 }, -7000, 32767, 101, 151, 4, 0 }, /* region 40 */
- { { 1, 0, 0 }, 0, 32767, 101, 151, 4, 1 }, /* region 41 */
- { { 1, 1, 1 }, -100, 32767, 101, 151, 4, 10 }, /* region 42 */
- { { 1, 2, 2 }, -200, 32767, 101, 151, 4, 11 }, /* region 43 */
- { { 1, 3, 3 }, -300, 32767, 101, 151, 4, 12 }, /* region 44 */
- { { 1, 4, 4 }, -400, 32767, 101, 151, 4, 13 }, /* region 45 */
- { { 1, 5, 5 }, -500, 32767, 101, 151, 4, 14 }, /* region 46 */
- { { 1, 6, 6 }, -600, 32767, 101, 151, 4, 0 }, /* region 47 */
- { { 1, 7, 7 }, -700, 32767, 101, 151, 4, 15 }, /* region 48 */
- { { 1, 8, 8 }, -800, 32767, 101, 151, 4, 16 }, /* region 49 */
- { { 1, 9, 9 }, -900, 32767, 101, 151, 4, 17 }, /* region 50 */
- { { 1, 10, 10 }, -1000, 32767, 101, 151, 4, 18 }, /* region 51 */
- { { 1, 11, 11 }, -1100, 32767, 101, 151, 4, 19 }, /* region 52 */
- { { 1, 12, 12 }, -1200, 32767, 101, 151, 4, 20 }, /* region 53 */
- { { 1, 13, 13 }, -1300, 32767, 101, 151, 4, 21 }, /* region 54 */
- { { 1, 14, 14 }, -1400, 32767, 101, 151, 4, 22 }, /* region 55 */
- { { 1, 15, 15 }, -1500, 32767, 101, 151, 4, 23 }, /* region 56 */
- { { 1, 16, 16 }, -1600, 32767, 101, 151, 4, 24 }, /* region 57 */
- { { 1, 17, 17 }, -1700, 32767, 101, 151, 4, 25 }, /* region 58 */
- { { 1, 18, 18 }, -1800, 32767, 101, 151, 4, 26 }, /* region 59 */
- { { 1, 19, 19 }, -1900, 32767, 101, 151, 4, 27 }, /* region 60 */
- { { 1, 20, 20 }, -2000, 32767, 101, 151, 4, 28 }, /* region 61 */
- { { 1, 21, 21 }, -2100, 32767, 101, 151, 4, 29 }, /* region 62 */
- { { 1, 22, 22 }, -2200, 32767, 101, 151, 4, 30 }, /* region 63 */
- { { 1, 23, 23 }, -2300, 32767, 101, 151, 4, 31 }, /* region 64 */
- { { 1, 24, 24 }, -2400, 32767, 101, 151, 4, 32 }, /* region 65 */
- { { 1, 25, 25 }, -2500, 32767, 101, 151, 4, 33 }, /* region 66 */
- { { 1, 26, 26 }, -2600, 32767, 101, 151, 4, 24 }, /* region 67 */
- { { 1, 27, 27 }, -2700, 32767, 101, 151, 4, 0 }, /* region 68 */
- { { 1, 28, 28 }, -2800, 32767, 101, 151, 4, 34 }, /* region 69 */
- { { 1, 29, 29 }, -2900, 32767, 101, 151, 4, 35 }, /* region 70 */
- { { 1, 30, 30 }, -3000, 32767, 101, 151, 4, 36 }, /* region 71 */
- { { 1, 31, 31 }, -3100, 32767, 101, 151, 4, 37 }, /* region 72 */
- { { 1, 32, 32 }, -3200, 32767, 101, 151, 4, 38 }, /* region 73 */
- { { 1, 33, 33 }, -3300, 32767, 101, 151, 4, 39 }, /* region 74 */
- { { 1, 34, 34 }, -3400, 32767, 101, 151, 4, 40 }, /* region 75 */
- { { 1, 35, 35 }, -3500, 32767, 101, 151, 4, 41 }, /* region 76 */
- { { 1, 36, 36 }, -3600, 32767, 101, 151, 4, 42 }, /* region 77 */
- { { 1, 37, 37 }, -3700, 32767, 101, 151, 4, 43 }, /* region 78 */
- { { 1, 38, 38 }, -3800, 32767, 101, 151, 4, 44 }, /* region 79 */
- { { 1, 39, 39 }, -3900, 32767, 101, 151, 4, 45 }, /* region 80 */
- { { 1, 40, 40 }, -4000, 32767, 101, 151, 4, 46 }, /* region 81 */
- { { 1, 41, 41 }, -4100, 32767, 101, 151, 4, 47 }, /* region 82 */
- { { 1, 42, 42 }, -4200, 32767, 101, 151, 4, 48 }, /* region 83 */
- { { 1, 43, 43 }, -4300, 32767, 101, 151, 4, 49 }, /* region 84 */
- { { 1, 44, 44 }, -4400, 32767, 101, 151, 4, 50 }, /* region 85 */
- { { 1, 45, 45 }, -4500, 32767, 101, 151, 4, 51 }, /* region 86 */
- { { 1, 46, 46 }, -4600, 32767, 101, 151, 4, 52 }, /* region 87 */
- { { 1, 47, 47 }, -4700, 32767, 101, 151, 4, 53 }, /* region 88 */
- { { 1, 48, 48 }, -4800, 32767, 101, 151, 4, 54 }, /* region 89 */
- { { 1, 49, 49 }, -4900, 32767, 101, 151, 4, 55 }, /* region 90 */
- { { 1, 50, 50 }, -5000, 32767, 101, 151, 4, 56 }, /* region 91 */
- { { 1, 51, 51 }, -5100, 32767, 101, 151, 4, 57 }, /* region 92 */
- { { 1, 52, 52 }, -5200, 32767, 101, 151, 4, 58 }, /* region 93 */
- { { 1, 53, 53 }, -5300, 32767, 101, 151, 4, 59 }, /* region 94 */
- { { 1, 54, 54 }, -5400, 32767, 101, 151, 4, 60 }, /* region 95 */
- { { 2, 55, 55 }, -5500, 32767, 0, 0, 0, 61 }, /* region 96 */
- { { 2, 56, 56 }, -5600, 32767, 0, 0, 0, 62 }, /* region 97 */
- { { 2, 57, 57 }, -5700, 32767, 0, 0, 0, 63 }, /* region 98 */
- { { 2, 58, 58 }, -5800, 32767, 0, 0, 0, 64 }, /* region 99 */
- { { 2, 59, 59 }, -5900, 32767, 0, 0, 0, 65 }, /* region 100 */
- { { 2, 60, 60 }, -6000, 32767, 0, 0, 0, 0 }, /* region 101 */
- { { 2, 61, 61 }, -6100, 32767, 0, 0, 0, 66 }, /* region 102 */
- { { 2, 62, 62 }, -6200, 32767, 0, 0, 0, 67 }, /* region 103 */
- { { 2, 63, 63 }, -6300, 32767, 0, 0, 0, 68 }, /* region 104 */
- { { 2, 64, 64 }, -6400, 32767, 0, 0, 0, 69 }, /* region 105 */
- { { 2, 65, 65 }, -6500, 32767, 0, 0, 0, 70 }, /* region 106 */
- { { 2, 66, 66 }, -6600, 32767, 0, 0, 0, 71 }, /* region 107 */
- { { 2, 67, 67 }, -6700, 32767, 0, 0, 0, 72 }, /* region 108 */
- { { 2, 68, 68 }, -6800, 32767, 0, 0, 0, 73 }, /* region 109 */
- { { 2, 69, 69 }, -6900, 32767, 0, 0, 0, 74 }, /* region 110 */
- { { 2, 70, 70 }, -7000, 32767, 0, 0, 0, 75 }, /* region 111 */
- { { 2, 71, 71 }, -7100, 32767, 0, 0, 0, 76 }, /* region 112 */
- { { 2, 72, 72 }, -7200, 32767, 0, 0, 0, 77 }, /* region 113 */
- { { 2, 73, 73 }, -7300, 32767, 0, 0, 0, 78 }, /* region 114 */
- { { 2, 74, 74 }, -7400, 32767, 0, 0, 0, 79 }, /* region 115 */
- { { 2, 75, 75 }, -7500, 32767, 0, 0, 0, 79 }, /* region 116 */
- { { 2, 76, 76 }, -7600, 32767, 0, 0, 0, 79 }, /* region 117 */
- { { 2, 77, 77 }, -7700, 32767, 0, 0, 0, 80 }, /* region 118 */
- { { 2, 78, 78 }, -7800, 32767, 0, 0, 0, 81 }, /* region 119 */
- { { 2, 79, 79 }, -7900, 32767, 0, 0, 0, 81 }, /* region 120 */
- { { 2, 80, 80 }, -8000, 32767, 0, 0, 0, 81 }, /* region 121 */
- { { 2, 81, 81 }, -8100, 32767, 0, 0, 0, 81 }, /* region 122 */
- { { 2, 82, 82 }, -8200, 32767, 0, 0, 0, 0 }, /* region 123 */
- { { 257, 83, 83 }, -8300, 32767, 101, 151, 4, 0 }, /* region 124 */
- { { 257, 84, 84 }, -8405, 32767, 0, 171, 5, 0 }, /* region 125 */
- { { 0, 85, 85 }, -9055, 32767, 0, 0, 2, 82 }, /* region 126 */
- { { 0, 86, 86 }, -9155, 32767, 0, 0, 2, 83 }, /* region 127 */
- { { 0, 87, 87 }, -9255, 32767, 0, 0, 2, 84 }, /* region 128 */
- { { 0, 88, 88 }, -9355, 32767, 0, 0, 2, 85 }, /* region 129 */
- { { 0, 89, 89 }, -9455, 32767, 0, 0, 2, 86 }, /* region 130 */
- { { 0, 90, 90 }, -9555, 32767, 0, 0, 2, 0 }, /* region 131 */
- { { 0, 91, 91 }, -9655, 32767, 0, 0, 2, 87 }, /* region 132 */
- { { 0, 92, 92 }, -9755, 32767, 0, 0, 2, 88 }, /* region 133 */
- { { 0, 93, 93 }, -9855, 32767, 0, 0, 2, 89 }, /* region 134 */
- { { 0, 94, 94 }, -9955, 32767, 0, 0, 2, 90 }, /* region 135 */
- { { 0, 95, 95 }, -10055, 32767, 0, 0, 2, 91 }, /* region 136 */
- { { 2, 96, 96 }, -9600, 32767, 0, 0, 0, 63 }, /* region 137 */
- { { 2, 97, 97 }, -9700, 32767, 0, 0, 0, 92 }, /* region 138 */
- { { 2, 98, 98 }, -9800, 32767, 0, 0, 0, 93 }, /* region 139 */
- { { 2, 99, 99 }, -9900, 32767, 0, 0, 0, 94 }, /* region 140 */
- { { 2, 100, 100 }, -10000, 32767, 0, 0, 0, 95 }, /* region 141 */
- { { 32770, 101, 101 }, -10100, 32767, 0, 0, 0, 0 }, /* region 142 */
- { { 1, 36, 60 }, -6000, 32767, 1481, 1565, 0, 0 }, /* region 143 */
- { { 1, 61, 61 }, -7300, 32767, 740, 782, 1, 0 }, /* region 144 */
- { { 32769, 62, 62 }, -8599, 32767, 370, 391, 3, 0 }, /* region 145 */
- { { 32769, 60, 60 }, -6000, 32767, 101, 301, 4, 1 }, /* region 146 */
- { { 32769, 60, 60 }, -6000, 32767, 101, 301, 4, 50 }, /* region 147 */
- { { 32769, 60, 60 }, -6000, 32767, 101, 301, 4, 11 }, /* region 148 */
- { { 32769, 60, 60 }, -6000, 32767, 101, 301, 4, 96 }, /* region 149 */
- { { 32769, 60, 60 }, -6000, 32767, 101, 301, 4, 13 }, /* region 150 */
- { { 32769, 60, 60 }, -6000, 32767, 101, 301, 4, 14 } /* region 151 */
-}; /* end Regions */
-
-/*----------------------------------------------------------------------------
- * Programs
- *----------------------------------------------------------------------------
-*/
-const S_PROGRAM testPrograms[] =
-{
- { 0, 41 } /* program 0 */,
- { 1, 10 } /* program 1 */,
- { 2, 11 } /* program 2 */,
- { 3, 12 } /* program 3 */,
- { 4, 18 } /* program 4 */,
- { 5, 31 } /* program 5 */,
- { 6, 143 } /* program 6 */,
- { 7, 146 } /* program 7 */,
- { 8, 147 } /* program 8 */,
- { 9, 148 } /* program 9 */,
- { 10, 149 } /* program 10 */,
- { 11, 150 } /* program 11 */,
- { 12, 151 } /* program 12 */,
- { 13, 0 } /* program 13 */,
- { 14, 9 } /* program 14 */,
- { 15, 1 } /* program 15 */
-}; /* end Programs */
-
-/*----------------------------------------------------------------------------
- * Banks
- *----------------------------------------------------------------------------
-*/
-#define testBanks NULL
-
-/*----------------------------------------------------------------------------
- * Samples
- *----------------------------------------------------------------------------
-*/
-
-const EAS_SAMPLE testSamples[] =
-{
- -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12,
- 13, 13, 14, 13, 13, 13, 12, 12, 10, 9, 8, 6, 5, 3, 2, 0,
- -1, -3, -5, -8, -10, -12, -14, -15, -16, -17, -17, -17, -17, -16, -14, -13,
- -11, -10, -8, -6, -5, -4, -4, -3, -3, -2, -1, -1, -1, -1, -1, -1,
- -1, -2, -3, -3, -3, -3, -3, -2, -2, -2, -1, -1, -1, -1, 0, 0,
- 0, 0, 0, 0, 0, 1, 2, 4, 6, 9, 11, 12, 13, 15, 16, 17,
- 19, 20, 22, 23, 25, 28, 32, 34, 36, 36, 35, 31, 25, 18, 11, 3,
- -5, -13, -20, -26, -31, -34, -35, -36, -36, -35, -34, -32, -29, -26, -23, -19,
- -16, -12, -8, -5, -4, -4, -4, -6, -8, -9, -11, -11, -12, -13, -13, -13,
- -12, -11, -10, -9, -7, -5, -4, -3, -2, -1, -1, 0, 0, 2, 4, 5,
- 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 7, 9, 12, 14, 17, 20,
- 24, 27, 30, 33, 36, 39, 41, 43, 46, 49, 51, 51, 50, 48, 43, 35,
- 25, 14, 1, -12, -25, -37, -48, -56, -61, -63, -62, -60, -57, -53, -48, -42,
- -35, -29, -23, -17, -12, -8, -5, -3, -3, -4, -5, -7, -9, -11, -12, -14,
- -14, -14, -14, -13, -11, -9, -7, -5, -3, -1, 0, 1, 1, 1, 2, 3,
- 4, 5, 6, 6, 7, 8, 9, 10, 11, 11, 11, 11, 10, 9, 9, 10,
- 12, 14, 17, 20, 23, 26, 30, 34, 38, 40, 43, 46, 49, 52, 55, 57,
- 58, 56, 50, 42, 30, 16, 1, -15, -29, -43, -54, -63, -68, -69, -68, -65,
- -60, -55, -49, -42, -35, -29, -22, -16, -10, -6, -2, -1, 0, -1, -3, -6,
- -9, -12, -16, -18, -20, -21, -21, -21, -19, -17, -14, -11, -8, -5, -2, 1,
- 3, 5, 7, 9, 11, 12, 12, 12, 11, 10, 9, 8, 7, 7, 7, 7,
- 8, 9, 10, 12, 15, 17, 19, 22, 24, 26, 28, 30, 32, 34, 36, 38,
- 42, 44, 47, 49, 53, 56, 55, 52, 45, 35, 22, 8, -8, -23, -37, -50,
- -60, -67, -71, -71, -69, -63, -56, -48, -40, -33, -27, -21, -16, -12, -8, -6,
- -5, -5, -6, -8, -11, -14, -17, -19, -21, -22, -22, -22, -20, -18, -16, -13,
- -9, -6, -2, 1, 5, 7, 8, 9, 10, 11, 11, 11, 10, 10, 9, 9,
- 9, 8, 8, 9, 9, 10, 10, 12, 13, 14, 16, 18, 19, 21, 24, 26,
- 29, 32, 35, 39, 42, 46, 49, 51, 53, 56, 59, 59, 55, 48, 37, 22,
- 5, -12, -29, -45, -58, -68, -74, -77, -77, -75, -69, -62, -53, -44, -35, -28,
- -21, -15, -11, -8, -5, -4, -4, -4, -6, -8, -10, -13, -15, -17, -19, -19,
- -19, -18, -16, -13, -10, -8, -4, -1, 1, 4, 5, 7, 8, 10, 11, 12,
- 13, 14, 14, 13, 12, 12, 11, 9, 8, 7, 6, 6, 7, 8, 10, 12,
- 15, 18, 21, 25, 29, 34, 39, 45, 51, 57, 61, 67, 73, 77, 82, 84,
- 81, 70, 52, 29, 3, -24, -49, -72, -90, -103, -110, -112, -109, -102, -91, -78,
- -64, -49, -35, -23, -13, -5, 1, 5, 8, 9, 9, 7, 4, 0, -4, -9,
- -12, -15, -18, -18, -18, -17, -14, -12, -9, -6, -3, 0, 3, 6, 8, 10,
- 11, 12, 11, 11, 10, 8, 7, 5, 4, 2, 2, 1, 2, 3, 4, 6,
- 8, 11, 13, 15, 18, 21, 26, 31, 36, 42, 48, 53, 60, 66, 72, 77,
- 82, 87, 91, 91, 86, 73, 54, 28, -2, -32, -61, -86, -105, -119, -126, -126,
- -121, -111, -98, -82, -65, -48, -33, -19, -7, 1, 8, 12, 14, 14, 12, 10,
- 6, 1, -4, -9, -14, -18, -20, -21, -22, -21, -19, -17, -14, -11, -8, -4,
- 0, 3, 7, 10, 12, 13, 14, 14, 13, 12, 11, 10, 9, 8, 7, 5,
- 4, 3, 2, 2, 4, 6, 9, 12, 16, 20, 26, 31, 36, 42, 48, 53,
- 58, 64, 69, 74, 79, 82, 84, 83, 80, 72, 59, 39, 14, -14, -43, -70,
- -92, -109, -119, -123, -120, -113, -102, -88, -73, -56, -40, -25, -12, -2, 5, 10,
- 12, 12, 11, 9, 5, 1, -3, -8, -12, -15, -18, -20, -21, -21, -20, -18,
- -16, -13, -9, -6, -2, 1, 5, 8, 11, 13, 15, 16, 16, 16, 15, 14,
- 12, 10, 7, 5, 4, 3, 3, 5, 6, 8, 9, 12, 15, 19, 23, 27,
- 31, 35, 38, 42, 46, 50, 54, 59, 65, 71, 75, 77, 78, 76, 68, 54,
- 34, 10, -16, -43, -68, -88, -103, -112, -114, -112, -105, -94, -80, -65, -50, -35,
- -22, -10, -2, 5, 9, 11, 10, 9, 6, 2, -3, -7, -12, -15, -18, -20,
- -21, -22, -21, -20, -17, -14, -11, -7, -3, 0, 4, 7, 9, 11, 13, 15,
- 17, 17, 17, 16, 14, 12, 11, 10, 8, 7, 5, 5, 5, 6, 7, 8,
- 10, 11, 14, 17, 20, 24, 28, 32, 37, 43, 49, 57, 63, 70, 77, 82,
- 83, 80, 73, 60, 42, 18, -8, -34, -59, -80, -95, -105, -110, -109, -103, -94,
- -81, -67, -53, -38, -24, -13, -3, 4, 9, 11, 11, 9, 6, 3, -2, -6,
- -10, -14, -17, -19, -20, -20, -20, -19, -17, -15, -12, -8, -5, -1, 2, 6,
- 9, 11, 13, 15, 15, 16, 16, 15, 14, 12, 11, 9, 8, 6, 6, 5,
- 5, 5, 6, 7, 8, 10, 12, 15, 19, 23, 28, 32, 38, 44, 50, 58,
- 66, 74, 82, 87, 90, 89, 83, 69, 48, 21, -9, -41, -69, -93, -111, -121,
- -124, -121, -113, -100, -85, -68, -50, -33, -18, -5, 5, 12, 16, 17, 16, 13,
- 9, 4, -1, -6, -11, -15, -18, -20, -21, -21, -21, -19, -17, -15, -12, -8,
- -4, -1, 3, 6, 9, 12, 14, 15, 15, 14, 13, 12, 11, 10, 9, 9,
- 8, 8, 6, 6, 5, 5, 6, 7, 8, 11, 15, 18, 23, 27, 31, 36,
- 41, 46, 51, 58, 66, 74, 82, 88, 91, 90, 83, 68, 46, 16, -16, -48,
- -77, -101, -118, -127, -128, -124, -114, -101, -84, -66, -47, -30, -14, -1, 9, 16,
- 19, 20, 19, 15, 11, 5, -1, -6, -11, -16, -19, -21, -23, -23, -23, -21,
- -19, -16, -12, -8, -4, 0, 4, 8, 11, 13, 14, 15, 15, 14, 13, 12,
- 11, 10, 9, 8, 7, 7, 7, 7, 7, 8, 8, 9, 11, 12, 14, 16,
- 19, 23, 27, 31, 35, 40, 45, 51, 58, 66, 74, 82, 88, 90, 88, 77,
- 58, 32, 1, -31, -62, -87, -107, -119, -125, -123, -117, -105, -90, -73, -56, -38,
- -22, -8, 2, 10, 15, 17, 17, 15, 11, 7, 2, -4, -9, -14, -17, -20,
- -22, -23, -22, -21, -19, -17, -14, -10, -6, -2, 2, 5, 9, 12, 14, 15,
- 17, 18, 18, 18, 17, 15, 12, 10, 8, 6, 4, 4, 4, 5, 6, 7,
- 8, 10, 13, 16, 19, 22, 25, 28, 32, 35, 40, 45, 52, 59, 67, 75,
- 81, 85, 86, 80, 66, 45, 18, -12, -42, -69, -91, -107, -116, -119, -115, -107,
- -95, -80, -64, -47, -31, -17, -5, 4, 10, 13, 14, 14, 11, 7, 3, -2,
- -7, -12, -15, -18, -20, -21, -21, -20, -18, -16, -14, -11, -7, -4, 0, 4,
- 7, 10, 12, 14, 16, 16, 16, 16, 16, 15, 14, 12, 10, 9, 7, 6,
- 5, 4, 4, 5, 6, 7, 8, 10, 12, 15, 19, 23, 27, 31, 36, 41,
- 47, 55, 64, 73, 81, 87, 90, 86, 75, 56, 30, 1, -30, -58, -82, -100,
- -112, -117, -115, -109, -98, -84, -69, -52, -37, -22, -10, 0, 8, 12, 14, 14,
- 13, 10, 6, 2, -3, -8, -12, -16, -18, -20, -20, -20, -19, -17, -15, -12,
- -9, -5, -1, 2, 6, 9, 12, 14, 16, 17, 17, 17, 16, 14, 13, 11,
- 8, 6, 4, 3, 2, 2, 2, 3, 5, 6, 8, 10, 12, 15, 18, 22,
- 26, 30, 35, 40, 47, 55, 63, 71, 80, 87, 90, 88, 78, 59, 34, 4,
- -27, -57, -82, -101, -113, -118, -117, -110, -99, -85, -69, -53, -37, -22, -9, 2,
- 9, 14, 17, 17, 15, 12, 8, 3, -2, -7, -12, -16, -19, -20, -21, -21,
- -19, -18, -15, -12, -9, -6, -2, 2, 6, 9, 12, 14, 16, 17, 17, 16,
- 14, 12, 10, 8, 6, 5, 4, 3, 3, 2, 3, 4, 6, 7, 9, 11,
- 13, 16, 19, 22, 26, 30, 34, 39, 46, 53, 61, 70, 80, 88, 93, 91,
- 80, 61, 34, 3, -30, -59, -84, -102, -114, -119, -117, -110, -99, -84, -68, -51,
- -35, -20, -7, 3, 11, 15, 17, 18, 16, 13, 9, 4, -2, -7, -11, -15,
- -18, -20, -21, -21, -20, -19, -16, -14, -11, -8, -4, 0, 3, 7, 10, 13,
- 15, 16, 17, 16, 14, 12, 10, 9, 7, 6, 5, 4, 4, 4, 5, 6,
- 7, 8, 9, 11, 13, 15, 18, 21, 24, 27, 31, 35, 41, 48, 55, 64,
- 73, 82, 89, 91, 85, 71, 48, 19, -13, -44, -71, -93, -108, -117, -118, -114,
- -105, -92, -77, -60, -43, -27, -13, -1, 8, 14, 17, 18, 17, 14, 8, 13,
- -1, -1, 0, 2, 4, 6, 9, 11, 13, 14, 13, 12, 11, 8, 5, 2,
- -1, -5, -10, -14, -16, -17, -16, -14, -11, -8, -5, -4, -3, -1, -1, -1,
- -1, -3, -3, -3, -2, -1, -1, 0, 0, 0, 0, 2, 6, 11, 14, 16,
- 19, 22, 25, 32, 36, 34, 25, 11, -5, -20, -31, -35, -36, -34, -29, -23,
- -16, -8, -4, -4, -8, -11, -12, -13, -12, -10, -7, -4, -2, -1, 1, 4,
- 7, 7, 6, 6, 6, 7, 12, 17, 24, 30, 36, 41, 46, 51, 50, 43,
- 25, 2, -25, -48, -61, -62, -57, -48, -35, -23, -12, -5, -3, -5, -9, -12,
- -14, -14, -12, -7, -3, 0, 1, 2, 4, 6, 7, 9, 11, 11, 10, 9,
- 12, 17, 23, 30, 37, 43, 49, 55, 58, 50, 30, 1, -29, -54, -68, -68,
- -60, -49, -35, -22, -10, -2, 0, -3, -9, -16, -20, -21, -19, -14, -8, -2,
- 3, 7, 11, 12, 11, 9, 7, 7, 8, 10, 15, 19, 24, 28, 33, 36,
- 42, 47, 53, 56, 45, 23, -8, -37, -60, -71, -69, -56, -40, -27, -16, -8,
- -5, -6, -11, -17, -21, -22, -20, -16, -9, -2, 5, 8, 10, 11, 10, 9,
- 8, 8, 9, 10, 13, 16, 19, 24, 29, 35, 42, 49, 53, 59, 55, 37,
- 5, -29, -58, -74, -77, -69, -53, -35, -21, -11, -5, -4, -6, -10, -15, -19,
- -19, -16, -10, -5, 1, 5, 8, 11, 13, 14, 12, 10, 8, 6, 7, 10,
- 15, 21, 29, 39, 51, 62, 72, 82, 81, 52, 3, -50, -90, -110, -109, -91,
- -64, -35, -13, 1, 8, 9, 4, -4, -12, -18, -18, -14, -9, -3, 3, 8,
- 11, 11, 10, 7, 4, 2, 2, 4, 8, 13, 18, 26, 36, 48, 60, 72,
- 82, 91, 86, 54, -2, -61, -105, -126, -121, -98, -65, -33, -7, 8, 14, 12,
- 6, -4, -14, -20, -22, -19, -14, -8, 0, 7, 12, 14, 13, 11, 9, 7,
- 4, 2, 4, 9, 16, 26, 36, 48, 58, 69, 79, 84, 80, 59, 14, -43,
- -92, -119, -120, -102, -73, -40, -12, 5, 12, 11, 5, -3, -12, -18, -21, -20,
- -16, -9, -2, 5, 11, 15, 16, 15, 12, 7, 4, 4, 6, 9, 15, 23,
- 31, 38, 46, 54, 65, 75, 78, 68, 34, -16, -68, -103, -114, -105, -80, -50,
- -22, -1, 9, 10, 6, -3, -12, -18, -21, -21, -17, -11, -3, 4, 9, 13,
- 16, 17, 14, 11, 8, 5, 5, 7, 10, 14, 20, 28, 37, 49, 64, 77,
- 83, 73, 42, -8, -59, -95, -110, -103, -81, -53, -24, -3, 9, 11, 6, -2,
- -10, -17, -20, -20, -17, -12, -5, 2, 9, 13, 15, 16, 14, 11, 8, 6,
- 5, 6, 8, 12, 19, 28, 38, 50, 66, 82, 90, 83, 48, -9, -69, -111,
- -124, -113, -85, -50, -18, 5, 16, 16, 9, -1, -11, -18, -21, -21, -17, -12,
- -5, 3, 9, 14, 15, 13, 11, 9, 8, 6, 5, 6, 8, 15, 23, 31,
- 41, 52, 66, 82, 91, 83, 46, -16, -77, -118, -128, -114, -84, -47, -14, 9,
- 19, 19, 10, -1, -11, -19, -23, -23, -19, -12, -4, 4, 11, 14, 15, 13,
- 11, 9, 7, 7, 7, 8, 11, 14, 19, 27, 35, 45, 58, 74, 88, 88,
- 58, 1, -62, -107, -125, -116, -90, -56, -22, 2, 15, 17, 11, 2, -9, -17,
- -22, -22, -20, -14, -6, 2, 9, 14, 17, 18, 17, 12, 8, 4, 4, 6,
- 8, 13, 19, 25, 32, 40, 52, 67, 81, 86, 66, 18, -42, -91, -116, -115,
- -95, -64, -31, -5, 10, 14, 11, 3, -7, -15, -20, -21, -18, -14, -7, 0,
- 7, 12, 16, 17, 16, 14, 10, 7, 5, 4, 6, 8, 12, 19, 27, 36,
- 47, 64, 81, 90, 75, 30, -30, -82, -112, -115, -98, -69, -37, -10, 8, 14,
- 13, 6, -3, -12, -18, -20, -19, -15, -9, -1, 6, 12, 16, 17, 16, 13,
- 8, 4, 2, 2, 5, 8, 12, 18, 26, 35, 47, 63, 80, 90, 78, 34,
- -27, -82, -113, -117, -99, -69, -37, -9, 9, 17, 15, 8, -2, -12, -19, -21,
- -19, -15, -9, -2, 6, 12, 16, 17, 14, 10, 6, 4, 3, 3, 6, 9,
- 13, 19, 26, 34, 46, 61, 80, 93, 80, 34, -30, -84, -114, -117, -99, -68,
- -35, -7, 11, 17, 16, 9, -2, -11, -18, -21, -20, -16, -11, -4, 3, 10,
- 15, 17, 14, 10, 7, 5, 4, 5, 7, 9, 13, 18, 24, 31, 41, 55,
- 73, 89, 85, 48, -12, -71, -108, -118, -104, -77, -43, -13, 8, 16, 17, 16,
- 0, -3, -4, -5, -4, 0, -4, -8, -20, -25, 51, 11, -55, 9, 39, 55,
- -76, -19, 92, -23, -58, 2, -15, 57, 71, 34, -41, 20, 51, 22, 63, -21,
- 63, 74, 32, 36, 99, -14, 27, 102, 66, 90, 79, 77, 58, 66, 65, 114,
- 69, 26, 30, 92, 90, 53, 78, 97, 77, 66, 39, -4, 60, 57, 64, 68,
- -16, 36, 49, 12, 19, 12, -12, 21, 11, -32, -19, -41, -44, -12, -36, -44,
- -45, -51, -55, -70, -69, -73, -85, -102, -86, -99, -92, -105, -108, -103, -100, -107,
- -112, -104, -113, -112, -104, -119, -124, -115, -87, -100, -128, -106, -83, -105, -108, -109,
- -91, -95, -90, -83, -80, -79, -83, -68, -59, -53, -63, -69, -57, -28, -11, -38,
- -43, -23, -10, -6, 3, 1, 6, 14, 21, 23, 34, 40, 42, 48, 57, 61,
- 63, 65, 73, 82, 90, 82, 89, 98, 100, 110, 111, 109, 115, 120, 121, 121,
- 123, 123, 123, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 121, 121,
- 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 120, 120, 120, 120, 120, 120,
- 120, 120, 120, 120, 113, 104, 103, 113, 110, 94, 80, 88, 96, 89, 81, 70,
- 68, 64, 59, 59, 54, 44, 44, 39, 31, 31, 21, 18, 16, 8, 6, 2,
- -3, -6, -13, -19, -27, -31, -34, -30, -38, -47, -48, -51, -56, -64, -68, -67,
- -68, -76, -73, -79, -85, -94, -89, -90, -94, -92, -99, -100, -107, -107, -104, -107,
- -106, -112, -114, -113, -112, -111, -112, -116, -116, -115, -115, -115, -115, -115, -115, -115,
- -114, -114, -114, -114, -114, -114, -114, -114, -113, -113, -113, -113, -113, -108, -106, -107,
- -111, -110, -105, -108, -107, -102, -100, -103, -103, -100, -100, -97, -97, -100, -99, -97,
- -94, -90, -94, -94, -93, -93, -92, -92, -90, -89, -89, -90, -91, -87, -87, -88,
- -89, -88, -84, -85, -88, -87, -86, -85, -85, -84, -82, -83, -83, -82, -81, -80,
- -79, -79, -79, -78, -75, -74, -75, -73, -74, -71, -69, -67, -69, -66, -64, -66,
- -65, -64, -62, -58, -57, -57, -57, -56, -52, -51, -50, -48, -46, -43, -43, -42,
- -39, -36, -35, -34, -32, -31, -29, -26, -23, -23, -21, -15, -18, -15, -11, -8,
- -6, -7, 0, 2, 0, 2, 7, 15, 14, 15, 16, 19, 23, 27, 29, 30,
- 31, 34, 41, 41, 42, 44, 45, 51, 55, 54, 56, 57, 60, 65, 67, 69,
- 69, 71, 74, 77, 79, 78, 80, 82, 86, 86, 84, 86, 88, 87, 87, 87,
- 87, 87, 86, 86, 86, 86, 86, 85, 85, 85, 85, 85, 84, 84, 84, 84,
- 84, 83, 83, 83, 83, 83, 83, 82, 82, 82, 82, 82, 81, 81, 81, 81,
- 81, 80, 80, 80, 80, 80, 79, 79, 79, 79, 79, 78, 78, 78, 78, 76,
- 75, 72, 69, 67, 65, 64, 63, 59, 55, 54, 52, 50, 48, 45, 42, 38,
- 36, 34, 31, 30, 27, 24, 21, 18, 16, 14, 12, 9, 7, 4, 1, -2,
- -4, -7, -10, -11, -13, -16, -17, -18, -21, -24, -26, -27, -28, -30, -32, -33,
- -35, -36, -38, -39, -41, -42, -43, -45, -45, -46, -47, -48, -49, -50, -51, -50,
- -51, -52, -53, -53, -53, -53, -53, -53, -53, -54, -54, -54, -54, -53, -53, -52,
- -52, -52, -51, -51, -51, -50, -50, -50, -48, -49, -48, -47, -46, -45, -45, -44,
- -43, -42, -41, -41, -40, -39, -38, -37, -36, -35, -34, -33, -31, -30, -29, -28,
- -27, -26, -24, -24, -23, -22, -21, -20, -19, -18, -17, -16, -15, -14, -13, -13,
- -12, -11, -11, -10, -9, -9, -8, -8, -7, -6, -7, -6, -5, -5, -5, -4,
- -4, -3, -3, -3, -3, -3, -2, -2, -2, -2, -2, -2, -2, -2, 0, 0,
- 0, 0, -1, 0, 4, 9, 13, 13, 11, 5, -1, -10, -16, -17, -11, -5,
- -2, -1, -2, -3, -2, -1, 0, 0, 6, 14, 19, 26, 36, 25, -5, -30,
- -36, -29, -16, -4, -7, -13, -12, -7, -2, 1, 6, 7, 6, 11, 24, 36,
- 46, 50, 26, -25, -60, -57, -36, -12, -3, -9, -14, -12, -3, 1, 4, 7,
- 11, 10, 12, 23, 37, 49, 58, 31, -29, -67, -61, -36, -10, 0, -9, -20,
- -19, -8, 3, 11, 11, 7, 8, 15, 24, 32, 41, 53, 45, -7, -60, -68,
- -41, -16, -5, -11, -21, -20, -10, 4, 10, 10, 8, 9, 13, 19, 29, 42,
- 54, 55, 6, -57, -77, -54, -21, -6, -6, -15, -19, -11, 1, 8, 13, 12,
- 8, 7, 15, 29, 50, 73, 80, 5, -90, -109, -65, -13, 8, 4, -13, -18,
- -10, 3, 11, 10, 4, 2, 8, 18, 36, 60, 82, 86, 1, -105, -121, -66,
- -8, 13, 6, -14, -22, -15, -1, 12, 13, 9, 4, 3, 16, 36, 58, 78,
- 81, 15, -91, -121, -74, -13, 12, 5, -11, -21, -16, -2, 11, 16, 12, 4,
- 6, 15, 31, 46, 64, 79, 36, -66, -115, -81, -23, 9, 6, -11, -21, -17,
- -4, 9, 16, 15, 8, 5, 9, 20, 37, 63, 83, 43, -57, -110, -83, -25,
- 8, 7, -10, -20, -17, -5, 9, 15, 14, 8, 5, 8, 18, 37, 65, 91,
- 50, -67, -124, -86, -19, 16, 9, -10, -21, -18, -5, 9, 15, 11, 8, 5,
- 8, 22, 40, 65, 92, 48, -74, -128, -85, -16, 19, 11, -11, -23, -19, -4,
- 10, 15, 11, 8, 7, 11, 19, 35, 57, 88, 60, -58, -125, -92, -24, 15,
- 12, -8, -22, -20, -7, 9, 17, 17, 8, 4, 8, 18, 31, 51, 81, 67,
- -38, -116, -96, -33, 9, 11, -6, -20, -19, -8, 7, 16, 16, 11, 5, 5,
- 12, 26, 47, 80, 76, -26, -111, -99, -39, 7, 13, -3, -18, -19, -9, 5,
- 16, 16, 8, 2, 4, 12, 25, 46, 79, 79, -23, -112, -101, -39, 9, 15,
- -2, -18, -20, -9, 5, 16, 14, 7, 3, 5, 13, 25, 44, 79, 81, -25,
- -113, -100, -37, 10, 16, -1, -18, -20, -11, 3, 15, 15, 7, 4, 6, 13,
- 23, 40, 72, 86, -7, -107, -106, -46, 7, 16, 0, 16, 31, 47, 61, 75,
- 87, 98, 107, 115, 121, 125, 127, 127, 125, 121, 116, 108, 99, 88, 75, 62,
- 47, 32, 16, 0, -16, -31, -47, -61, -75, -87, -98, -108, -116, -122, -126, -128,
- -128, -126, -123, -117, -109, -100, -89, -77, -64, -49, -34, -18, -2, 14, 29, 45,
- 59, 73, 86, 97, 106, 114, 121, 125, 127, 127, 126, 122, 116, 109, 100, 89,
- 77, 63, 49, 34, 18, 2, -14, -30, -45, -60, -73, -86, -97, -107, -115, -121,
- -126, -128, -128, -127, -123, -118, -110, -101, -91, -79, -65, -51, -36, -20, -4, 12,
- 28, 43, 58, 72, 84, 96, 106, 114, 120, 124, 127, 127, 126, 122, 117, 109,
- 100, 90, 78, 64, 50, 35, 19, 3, -13, -29, -44, -59, -73, -85, -97, -107,
- -115, -121, -125, -128, -128, -127, -123, -118, -110, -101, -91, -79, -65, -51, -36, -20,
- -4, 12, 28, 43, 58, 72, 84, 96, 106, 114, 120, 124, 127, 127, 126, 122,
- 117, 109, 100, 90, 78, 64, 50, 35, 19, 3, -13, -29, -44, -59, -73, -85,
- -97, -107, -115, -121, -125, -128, -128, -127, -123, -118, -110, -101, -91, -79, -65, -51,
- -36, -20, -4, 12, 28, 43, 58, 72, 84, 96, 106, 114, 120, 124, 127, 127,
- 126, 122, 117, 109, 100, 90, 78, 64, 50, 35, 19, 3, -13, -29, -44, -59,
- -73, -85, -97, -107, -115, -121, -125, -128, -128, -127, -123, -118, -110, -101, -91, -79,
- -65, -51, -36, -20, -4, 12, 28, 43, 58, 72, 84, 96, 106, 114, 120, 124,
- 127, 127, 126, 122, 117, 109, 100, 90, 78, 64, 50, 35, 19, 3, -13, -29,
- -44, -59, -73, -85, -97, -107, -115, -121, -125, -128, -128, -127, -123, -118, -110, -101,
- -91, -79, -65, -51, -36, -20, -4, 12, 0, -104, -55, -11, 24, 33, 30, 7,
- -15, -31, -30, -25, -23, -20, -9, 10, 31, 59, 91, 111, 115, 92, 51, 7,
- -33, -64, -81, -81, -71, -51, -22, 16, 52, 74, 82, 81, 68, 38, 0, -40,
- -81, -112, -124, -102, -57, -11, 24, 33, 30, 7, -15, -31, -30, -25, -23, -20,
- -9, 10, 31, 59, 91, 111, 115, 92, 51, 7, -33, -64, -81, -81, -71, -51,
- -22, 16, 52, 74, 82, 81, 68, 38, 0, -40, -81, -112, -124, -102, -57, -11,
- 24, 33, 30, 7, -15, -31, -30, -25, -23, -20, -9, 10, 31, 59, 91, 111,
- 115, 92, 51, 7, -33, -64, -81, -81, -71, -51, -22, 16, 52, 74, 82, 81,
- 68, 38, 0, -40, -81, -112, -124, -102, -57, -11, 24, 33, 30, 7, -15, -31,
- -30, -25, -23, -20, -9, 10, 31, 59, 91, 111, 115, 92, 51, 7, -33, -64,
- -81, -81, -71, -51, -22, 16, 52, 74, 82, 81, 68, 38, 0, -40, -81, -112,
- -124, -102, -57, -11, 0
-};
-
-const EAS_U32 testSampleLengths[] =
-{
- 1568, 784, 642, 392, 302, 172
-};
-
-const EAS_U32 testSampleOffsets[] =
-{
- 0x00000000, 0x00000620, 0x00000930, 0x00000bb2, 0x00000d3a, 0x00000e68
-};
-
-/*----------------------------------------------------------------------------
- * S_EAS
- *----------------------------------------------------------------------------
-*/
-const S_EAS easTestLib =
-{
- 0x01534145,
- 0x00105622,
- testBanks,
- testPrograms,
- testRegions,
- testArticulations,
- testSampleLengths,
- testSampleOffsets,
- testSamples,
- 0,
- 0,
- 16,
- 152,
- 97,
- 6,
- 0
-}; /* end S_EAS */
-
-/*----------------------------------------------------------------------------
- * Statistics
- *
- * Number of banks: 0
- * Number of programs: 16
- * Number of regions: 152
- * Number of articulations: 97
- * Number of samples: 6
- * Size of sample pool: 3861
- *----------------------------------------------------------------------------
-*/
-/* end ..\..\EASLib\WTLibrary\eastestv37.c */
+/*----------------------------------------------------------------------------
+ *
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#include "eas_sndlib.h"
+
+/*----------------------------------------------------------------------------
+ * Articulations
+ *----------------------------------------------------------------------------
+*/
+const S_ARTICULATION testArticulations[] =
+{
+ { /* articulation 0 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 1 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 100, 0, 19, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 2 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 100, 34, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 3 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 100, 86, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 4 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 100, 172, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 5 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 100, 345, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 6 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 100, 517, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 7 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 100, 689, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 8 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 100, 861, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 9 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 100, 1723, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 10 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 100, 0, 191, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 11 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 100, 0, 382, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 12 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 100, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 13 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 100, 0, 1903, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 14 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 100, 0, 3804, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 15 */
+ { 1902, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 16 */
+ { 380, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 17 */
+ { 190, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 18 */
+ { 38, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 19 */
+ { 19, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 20 */
+ { 10, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 21 */
+ { 5, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 22 */
+ { 32767, 17213, 0, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 23 */
+ { 32767, 28809, 0, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 24 */
+ { 32767, 30725, 0, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 25 */
+ { 32767, 32349, 0, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 26 */
+ { 32767, 32558, 0, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 27 */
+ { 32767, 32663, 0, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 28 */
+ { 32767, 32715, 0, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 29 */
+ { 32767, 30725, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 30 */
+ { 32767, 30725, 3566, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 31 */
+ { 32767, 30725, 42, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 32 */
+ { 32767, 30725, 5, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 33 */
+ { 32767, 30725, 2, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 34 */
+ { 32767, 0, 32767, 17213 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 35 */
+ { 32767, 0, 32767, 28809 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 36 */
+ { 32767, 0, 32767, 30725 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 37 */
+ { 32767, 0, 32767, 32349 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 38 */
+ { 32767, 0, 32767, 32558 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 39 */
+ { 32767, 0, 32767, 32663 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 40 */
+ { 32767, 0, 32767, 32715 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 41 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 190, 0, 0, 0, 1, 0, 0
+ },
+ { /* articulation 42 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 189, 0, 0, 0, 3, 0, 0
+ },
+ { /* articulation 43 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 190, 0, 0, 0, 4, 0, 0
+ },
+ { /* articulation 44 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 190, 0, 0, 0, 6, 0, 0
+ },
+ { /* articulation 45 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ -1200, 0, 190, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 46 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ -600, 0, 190, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 47 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ -100, 0, 190, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 48 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ -50, 0, 190, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 49 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 50, 0, 190, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 50 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 100, 0, 190, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 51 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 600, 0, 190, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 52 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 1200, 0, 190, 0, 0, 0, 0, 0, 0
+ },
+ { /* articulation 53 */
+ { 32767, 0, 32767, 0 },
+ { 190, 190, 0, 0 },
+ 0, 0, 951, -1200, 0, 0, 0, 0, 0
+ },
+ { /* articulation 54 */
+ { 32767, 0, 32767, 0 },
+ { 190, 190, 0, 0 },
+ 0, 0, 951, -600, 0, 0, 0, 0, 0
+ },
+ { /* articulation 55 */
+ { 32767, 0, 32767, 0 },
+ { 190, 190, 0, 0 },
+ 0, 0, 951, -100, 0, 0, 0, 0, 0
+ },
+ { /* articulation 56 */
+ { 32767, 0, 32767, 0 },
+ { 190, 190, 0, 0 },
+ 0, 0, 951, -50, 0, 0, 0, 0, 0
+ },
+ { /* articulation 57 */
+ { 32767, 0, 32767, 0 },
+ { 190, 190, 0, 0 },
+ 0, 0, 951, 50, 0, 0, 0, 0, 0
+ },
+ { /* articulation 58 */
+ { 32767, 0, 32767, 0 },
+ { 190, 190, 0, 0 },
+ 0, 0, 951, 100, 0, 0, 0, 0, 0
+ },
+ { /* articulation 59 */
+ { 32767, 0, 32767, 0 },
+ { 190, 190, 0, 0 },
+ 0, 0, 951, 600, 0, 0, 0, 0, 0
+ },
+ { /* articulation 60 */
+ { 32767, 0, 32767, 0 },
+ { 190, 190, 0, 0 },
+ 0, 0, 951, 1200, 0, 0, 0, 0, 0
+ },
+ { /* articulation 61 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 5535, 0, 0, 0
+ },
+ { /* articulation 62 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 7121, 0, 0, 0
+ },
+ { /* articulation 63 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 8321, 0, 0, 0
+ },
+ { /* articulation 64 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 9906, 0, 0, 0
+ },
+ { /* articulation 65 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 11106, 0, 0, 0
+ },
+ { /* articulation 66 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 9521, 0, 0, 0
+ },
+ { /* articulation 67 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 9521, 0, 8, 0
+ },
+ { /* articulation 68 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 9521, 0, 16, 0
+ },
+ { /* articulation 69 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 9521, 0, 24, 0
+ },
+ { /* articulation 70 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 9521, 0, 30, 0
+ },
+ { /* articulation 71 */
+ { 32767, 0, 32767, 0 },
+ { 190, 190, 0, 0 },
+ 0, 0, 951, 0, -6400, 9521, 0, 0, 0
+ },
+ { /* articulation 72 */
+ { 32767, 0, 32767, 0 },
+ { 190, 190, 0, 0 },
+ 0, 0, 951, 0, -3200, 9521, 0, 0, 0
+ },
+ { /* articulation 73 */
+ { 32767, 0, 32767, 0 },
+ { 190, 190, 0, 0 },
+ 0, 0, 951, 0, -1600, 9521, 0, 0, 0
+ },
+ { /* articulation 74 */
+ { 32767, 0, 32767, 0 },
+ { 190, 190, 0, 0 },
+ 0, 0, 951, 0, -800, 9521, 0, 0, 0
+ },
+ { /* articulation 75 */
+ { 32767, 0, 32767, 0 },
+ { 190, 190, 0, 0 },
+ 0, 0, 951, 0, 800, 7121, 0, 0, 0
+ },
+ { /* articulation 76 */
+ { 190, 30725, 32767, 0 },
+ { 190, 190, 0, 0 },
+ 0, 0, 951, 0, 1600, 7121, 0, 0, 0
+ },
+ { /* articulation 77 */
+ { 32767, 0, 32767, 0 },
+ { 190, 190, 0, 0 },
+ 0, 0, 951, 0, 3200, 7121, 0, 0, 0
+ },
+ { /* articulation 78 */
+ { 32767, 0, 32767, 0 },
+ { 190, 190, 0, 0 },
+ 0, 0, 951, 0, 6400, 7121, 0, 0, 0
+ },
+ { /* articulation 79 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 190, 0, 0, 11106, 0, 0, 0
+ },
+ { /* articulation 80 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 191, 0, 0, 11106, 0, 0, 0
+ },
+ { /* articulation 81 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 190, 0, 0, 7121, 0, 0, 0
+ },
+ { /* articulation 82 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, -63
+ },
+ { /* articulation 83 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, -50
+ },
+ { /* articulation 84 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, -37
+ },
+ { /* articulation 85 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, -25
+ },
+ { /* articulation 86 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, -12
+ },
+ { /* articulation 87 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 12
+ },
+ { /* articulation 88 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 25
+ },
+ { /* articulation 89 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 37
+ },
+ { /* articulation 90 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 50
+ },
+ { /* articulation 91 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 0, 0, 0, 63
+ },
+ { /* articulation 92 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 9907, 0, 0, 0
+ },
+ { /* articulation 93 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 10574, 0, 0, 0
+ },
+ { /* articulation 94 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 11373, 0, 0, 0
+ },
+ { /* articulation 95 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 0, 0, 951, 0, 0, 11376, 0, 0, 0
+ },
+ { /* articulation 96 */
+ { 32767, 0, 32767, 0 },
+ { 32767, 32767, 32767, 0 },
+ 100, 0, 949, 0, 0, 0, 0, 0, 0
+ }
+}; /*end Articulations */
+
+/*----------------------------------------------------------------------------
+ * Regions
+ *----------------------------------------------------------------------------
+*/
+const S_WT_REGION testRegions[] =
+{
+ { { 32769, 0, 127 }, -6000, 32767, 101, 301, 4, 0 }, /* region 0 */
+ { { 1, 0, 60 }, -6000, 32767, 101, 301, 4, 2 }, /* region 1 */
+ { { 1, 61, 61 }, -6000, 32767, 101, 301, 4, 3 }, /* region 2 */
+ { { 1, 62, 62 }, -6000, 32767, 101, 301, 4, 4 }, /* region 3 */
+ { { 1, 63, 63 }, -6000, 32767, 101, 301, 4, 5 }, /* region 4 */
+ { { 1, 64, 64 }, -6000, 32767, 101, 301, 4, 6 }, /* region 5 */
+ { { 1, 65, 65 }, -6000, 32767, 101, 301, 4, 7 }, /* region 6 */
+ { { 1, 66, 66 }, -6000, 32767, 101, 301, 4, 8 }, /* region 7 */
+ { { 32769, 67, 127 }, -6000, 32767, 101, 301, 4, 9 }, /* region 8 */
+ { { 32769, 0, 127 }, -6005, 32767, 3, 171, 5, 0 }, /* region 9 */
+ { { 32768, 0, 127 }, -6555, 32767, 0, 0, 2, 0 }, /* region 10 */
+ { { 32770, 0, 127 }, -6000, 32767, 0, 0, 0, 0 }, /* region 11 */
+ { { 1, 60, 60 }, -6000, 32767, 101, 301, 4, 0 }, /* region 12 */
+ { { 1, 61, 61 }, -6100, 16422, 101, 151, 4, 0 }, /* region 13 */
+ { { 1, 62, 62 }, -6200, 8231, 101, 151, 4, 0 }, /* region 14 */
+ { { 1, 63, 63 }, -6300, 2067, 101, 151, 4, 0 }, /* region 15 */
+ { { 1, 64, 64 }, -6400, 130, 101, 151, 4, 0 }, /* region 16 */
+ { { 32769, 65, 65 }, -6500, 1, 101, 151, 4, 0 }, /* region 17 */
+ { { 1, 60, 60 }, -6000, 32767, 101, 301, 4, 0 }, /* region 18 */
+ { { 1, 61, 61 }, -6200, 32767, 101, 151, 4, 0 }, /* region 19 */
+ { { 1, 62, 62 }, -6400, 32767, 101, 151, 4, 0 }, /* region 20 */
+ { { 1, 63, 63 }, -6600, 32767, 101, 151, 4, 0 }, /* region 21 */
+ { { 1, 64, 64 }, -6800, 32767, 101, 151, 4, 0 }, /* region 22 */
+ { { 1, 65, 65 }, -7000, 32767, 101, 151, 4, 0 }, /* region 23 */
+ { { 1, 66, 66 }, -7200, 32767, 101, 151, 4, 0 }, /* region 24 */
+ { { 1, 67, 67 }, -7400, 32767, 101, 151, 4, 0 }, /* region 25 */
+ { { 1, 68, 68 }, -7600, 32767, 101, 151, 4, 0 }, /* region 26 */
+ { { 1, 69, 69 }, -7800, 32767, 101, 151, 4, 0 }, /* region 27 */
+ { { 1, 70, 70 }, -8000, 32767, 101, 151, 4, 0 }, /* region 28 */
+ { { 1, 71, 71 }, -8200, 32767, 101, 151, 4, 0 }, /* region 29 */
+ { { 32769, 72, 72 }, -8400, 32767, 101, 151, 4, 0 }, /* region 30 */
+ { { 1, 60, 60 }, -6000, 32767, 101, 301, 4, 0 }, /* region 31 */
+ { { 1, 61, 61 }, -6099, 32767, 101, 151, 4, 0 }, /* region 32 */
+ { { 1, 62, 62 }, -6190, 32767, 101, 151, 4, 0 }, /* region 33 */
+ { { 1, 63, 63 }, -6250, 32767, 101, 151, 4, 0 }, /* region 34 */
+ { { 1, 64, 64 }, -6300, 32767, 101, 151, 4, 0 }, /* region 35 */
+ { { 1, 65, 65 }, -6500, 32767, 101, 151, 4, 0 }, /* region 36 */
+ { { 1, 66, 66 }, -6601, 32767, 101, 151, 4, 0 }, /* region 37 */
+ { { 1, 67, 67 }, -6710, 32767, 101, 151, 4, 0 }, /* region 38 */
+ { { 1, 68, 68 }, -6850, 32767, 101, 151, 4, 0 }, /* region 39 */
+ { { 32769, 69, 69 }, -7000, 32767, 101, 151, 4, 0 }, /* region 40 */
+ { { 1, 0, 0 }, 0, 32767, 101, 151, 4, 1 }, /* region 41 */
+ { { 1, 1, 1 }, -100, 32767, 101, 151, 4, 10 }, /* region 42 */
+ { { 1, 2, 2 }, -200, 32767, 101, 151, 4, 11 }, /* region 43 */
+ { { 1, 3, 3 }, -300, 32767, 101, 151, 4, 12 }, /* region 44 */
+ { { 1, 4, 4 }, -400, 32767, 101, 151, 4, 13 }, /* region 45 */
+ { { 1, 5, 5 }, -500, 32767, 101, 151, 4, 14 }, /* region 46 */
+ { { 1, 6, 6 }, -600, 32767, 101, 151, 4, 0 }, /* region 47 */
+ { { 1, 7, 7 }, -700, 32767, 101, 151, 4, 15 }, /* region 48 */
+ { { 1, 8, 8 }, -800, 32767, 101, 151, 4, 16 }, /* region 49 */
+ { { 1, 9, 9 }, -900, 32767, 101, 151, 4, 17 }, /* region 50 */
+ { { 1, 10, 10 }, -1000, 32767, 101, 151, 4, 18 }, /* region 51 */
+ { { 1, 11, 11 }, -1100, 32767, 101, 151, 4, 19 }, /* region 52 */
+ { { 1, 12, 12 }, -1200, 32767, 101, 151, 4, 20 }, /* region 53 */
+ { { 1, 13, 13 }, -1300, 32767, 101, 151, 4, 21 }, /* region 54 */
+ { { 1, 14, 14 }, -1400, 32767, 101, 151, 4, 22 }, /* region 55 */
+ { { 1, 15, 15 }, -1500, 32767, 101, 151, 4, 23 }, /* region 56 */
+ { { 1, 16, 16 }, -1600, 32767, 101, 151, 4, 24 }, /* region 57 */
+ { { 1, 17, 17 }, -1700, 32767, 101, 151, 4, 25 }, /* region 58 */
+ { { 1, 18, 18 }, -1800, 32767, 101, 151, 4, 26 }, /* region 59 */
+ { { 1, 19, 19 }, -1900, 32767, 101, 151, 4, 27 }, /* region 60 */
+ { { 1, 20, 20 }, -2000, 32767, 101, 151, 4, 28 }, /* region 61 */
+ { { 1, 21, 21 }, -2100, 32767, 101, 151, 4, 29 }, /* region 62 */
+ { { 1, 22, 22 }, -2200, 32767, 101, 151, 4, 30 }, /* region 63 */
+ { { 1, 23, 23 }, -2300, 32767, 101, 151, 4, 31 }, /* region 64 */
+ { { 1, 24, 24 }, -2400, 32767, 101, 151, 4, 32 }, /* region 65 */
+ { { 1, 25, 25 }, -2500, 32767, 101, 151, 4, 33 }, /* region 66 */
+ { { 1, 26, 26 }, -2600, 32767, 101, 151, 4, 24 }, /* region 67 */
+ { { 1, 27, 27 }, -2700, 32767, 101, 151, 4, 0 }, /* region 68 */
+ { { 1, 28, 28 }, -2800, 32767, 101, 151, 4, 34 }, /* region 69 */
+ { { 1, 29, 29 }, -2900, 32767, 101, 151, 4, 35 }, /* region 70 */
+ { { 1, 30, 30 }, -3000, 32767, 101, 151, 4, 36 }, /* region 71 */
+ { { 1, 31, 31 }, -3100, 32767, 101, 151, 4, 37 }, /* region 72 */
+ { { 1, 32, 32 }, -3200, 32767, 101, 151, 4, 38 }, /* region 73 */
+ { { 1, 33, 33 }, -3300, 32767, 101, 151, 4, 39 }, /* region 74 */
+ { { 1, 34, 34 }, -3400, 32767, 101, 151, 4, 40 }, /* region 75 */
+ { { 1, 35, 35 }, -3500, 32767, 101, 151, 4, 41 }, /* region 76 */
+ { { 1, 36, 36 }, -3600, 32767, 101, 151, 4, 42 }, /* region 77 */
+ { { 1, 37, 37 }, -3700, 32767, 101, 151, 4, 43 }, /* region 78 */
+ { { 1, 38, 38 }, -3800, 32767, 101, 151, 4, 44 }, /* region 79 */
+ { { 1, 39, 39 }, -3900, 32767, 101, 151, 4, 45 }, /* region 80 */
+ { { 1, 40, 40 }, -4000, 32767, 101, 151, 4, 46 }, /* region 81 */
+ { { 1, 41, 41 }, -4100, 32767, 101, 151, 4, 47 }, /* region 82 */
+ { { 1, 42, 42 }, -4200, 32767, 101, 151, 4, 48 }, /* region 83 */
+ { { 1, 43, 43 }, -4300, 32767, 101, 151, 4, 49 }, /* region 84 */
+ { { 1, 44, 44 }, -4400, 32767, 101, 151, 4, 50 }, /* region 85 */
+ { { 1, 45, 45 }, -4500, 32767, 101, 151, 4, 51 }, /* region 86 */
+ { { 1, 46, 46 }, -4600, 32767, 101, 151, 4, 52 }, /* region 87 */
+ { { 1, 47, 47 }, -4700, 32767, 101, 151, 4, 53 }, /* region 88 */
+ { { 1, 48, 48 }, -4800, 32767, 101, 151, 4, 54 }, /* region 89 */
+ { { 1, 49, 49 }, -4900, 32767, 101, 151, 4, 55 }, /* region 90 */
+ { { 1, 50, 50 }, -5000, 32767, 101, 151, 4, 56 }, /* region 91 */
+ { { 1, 51, 51 }, -5100, 32767, 101, 151, 4, 57 }, /* region 92 */
+ { { 1, 52, 52 }, -5200, 32767, 101, 151, 4, 58 }, /* region 93 */
+ { { 1, 53, 53 }, -5300, 32767, 101, 151, 4, 59 }, /* region 94 */
+ { { 1, 54, 54 }, -5400, 32767, 101, 151, 4, 60 }, /* region 95 */
+ { { 2, 55, 55 }, -5500, 32767, 0, 0, 0, 61 }, /* region 96 */
+ { { 2, 56, 56 }, -5600, 32767, 0, 0, 0, 62 }, /* region 97 */
+ { { 2, 57, 57 }, -5700, 32767, 0, 0, 0, 63 }, /* region 98 */
+ { { 2, 58, 58 }, -5800, 32767, 0, 0, 0, 64 }, /* region 99 */
+ { { 2, 59, 59 }, -5900, 32767, 0, 0, 0, 65 }, /* region 100 */
+ { { 2, 60, 60 }, -6000, 32767, 0, 0, 0, 0 }, /* region 101 */
+ { { 2, 61, 61 }, -6100, 32767, 0, 0, 0, 66 }, /* region 102 */
+ { { 2, 62, 62 }, -6200, 32767, 0, 0, 0, 67 }, /* region 103 */
+ { { 2, 63, 63 }, -6300, 32767, 0, 0, 0, 68 }, /* region 104 */
+ { { 2, 64, 64 }, -6400, 32767, 0, 0, 0, 69 }, /* region 105 */
+ { { 2, 65, 65 }, -6500, 32767, 0, 0, 0, 70 }, /* region 106 */
+ { { 2, 66, 66 }, -6600, 32767, 0, 0, 0, 71 }, /* region 107 */
+ { { 2, 67, 67 }, -6700, 32767, 0, 0, 0, 72 }, /* region 108 */
+ { { 2, 68, 68 }, -6800, 32767, 0, 0, 0, 73 }, /* region 109 */
+ { { 2, 69, 69 }, -6900, 32767, 0, 0, 0, 74 }, /* region 110 */
+ { { 2, 70, 70 }, -7000, 32767, 0, 0, 0, 75 }, /* region 111 */
+ { { 2, 71, 71 }, -7100, 32767, 0, 0, 0, 76 }, /* region 112 */
+ { { 2, 72, 72 }, -7200, 32767, 0, 0, 0, 77 }, /* region 113 */
+ { { 2, 73, 73 }, -7300, 32767, 0, 0, 0, 78 }, /* region 114 */
+ { { 2, 74, 74 }, -7400, 32767, 0, 0, 0, 79 }, /* region 115 */
+ { { 2, 75, 75 }, -7500, 32767, 0, 0, 0, 79 }, /* region 116 */
+ { { 2, 76, 76 }, -7600, 32767, 0, 0, 0, 79 }, /* region 117 */
+ { { 2, 77, 77 }, -7700, 32767, 0, 0, 0, 80 }, /* region 118 */
+ { { 2, 78, 78 }, -7800, 32767, 0, 0, 0, 81 }, /* region 119 */
+ { { 2, 79, 79 }, -7900, 32767, 0, 0, 0, 81 }, /* region 120 */
+ { { 2, 80, 80 }, -8000, 32767, 0, 0, 0, 81 }, /* region 121 */
+ { { 2, 81, 81 }, -8100, 32767, 0, 0, 0, 81 }, /* region 122 */
+ { { 2, 82, 82 }, -8200, 32767, 0, 0, 0, 0 }, /* region 123 */
+ { { 257, 83, 83 }, -8300, 32767, 101, 151, 4, 0 }, /* region 124 */
+ { { 257, 84, 84 }, -8405, 32767, 0, 171, 5, 0 }, /* region 125 */
+ { { 0, 85, 85 }, -9055, 32767, 0, 0, 2, 82 }, /* region 126 */
+ { { 0, 86, 86 }, -9155, 32767, 0, 0, 2, 83 }, /* region 127 */
+ { { 0, 87, 87 }, -9255, 32767, 0, 0, 2, 84 }, /* region 128 */
+ { { 0, 88, 88 }, -9355, 32767, 0, 0, 2, 85 }, /* region 129 */
+ { { 0, 89, 89 }, -9455, 32767, 0, 0, 2, 86 }, /* region 130 */
+ { { 0, 90, 90 }, -9555, 32767, 0, 0, 2, 0 }, /* region 131 */
+ { { 0, 91, 91 }, -9655, 32767, 0, 0, 2, 87 }, /* region 132 */
+ { { 0, 92, 92 }, -9755, 32767, 0, 0, 2, 88 }, /* region 133 */
+ { { 0, 93, 93 }, -9855, 32767, 0, 0, 2, 89 }, /* region 134 */
+ { { 0, 94, 94 }, -9955, 32767, 0, 0, 2, 90 }, /* region 135 */
+ { { 0, 95, 95 }, -10055, 32767, 0, 0, 2, 91 }, /* region 136 */
+ { { 2, 96, 96 }, -9600, 32767, 0, 0, 0, 63 }, /* region 137 */
+ { { 2, 97, 97 }, -9700, 32767, 0, 0, 0, 92 }, /* region 138 */
+ { { 2, 98, 98 }, -9800, 32767, 0, 0, 0, 93 }, /* region 139 */
+ { { 2, 99, 99 }, -9900, 32767, 0, 0, 0, 94 }, /* region 140 */
+ { { 2, 100, 100 }, -10000, 32767, 0, 0, 0, 95 }, /* region 141 */
+ { { 32770, 101, 101 }, -10100, 32767, 0, 0, 0, 0 }, /* region 142 */
+ { { 1, 36, 60 }, -6000, 32767, 1481, 1565, 0, 0 }, /* region 143 */
+ { { 1, 61, 61 }, -7300, 32767, 740, 782, 1, 0 }, /* region 144 */
+ { { 32769, 62, 62 }, -8599, 32767, 370, 391, 3, 0 }, /* region 145 */
+ { { 32769, 60, 60 }, -6000, 32767, 101, 301, 4, 1 }, /* region 146 */
+ { { 32769, 60, 60 }, -6000, 32767, 101, 301, 4, 50 }, /* region 147 */
+ { { 32769, 60, 60 }, -6000, 32767, 101, 301, 4, 11 }, /* region 148 */
+ { { 32769, 60, 60 }, -6000, 32767, 101, 301, 4, 96 }, /* region 149 */
+ { { 32769, 60, 60 }, -6000, 32767, 101, 301, 4, 13 }, /* region 150 */
+ { { 32769, 60, 60 }, -6000, 32767, 101, 301, 4, 14 } /* region 151 */
+}; /* end Regions */
+
+/*----------------------------------------------------------------------------
+ * Programs
+ *----------------------------------------------------------------------------
+*/
+const S_PROGRAM testPrograms[] =
+{
+ { 0, 41 } /* program 0 */,
+ { 1, 10 } /* program 1 */,
+ { 2, 11 } /* program 2 */,
+ { 3, 12 } /* program 3 */,
+ { 4, 18 } /* program 4 */,
+ { 5, 31 } /* program 5 */,
+ { 6, 143 } /* program 6 */,
+ { 7, 146 } /* program 7 */,
+ { 8, 147 } /* program 8 */,
+ { 9, 148 } /* program 9 */,
+ { 10, 149 } /* program 10 */,
+ { 11, 150 } /* program 11 */,
+ { 12, 151 } /* program 12 */,
+ { 13, 0 } /* program 13 */,
+ { 14, 9 } /* program 14 */,
+ { 15, 1 } /* program 15 */
+}; /* end Programs */
+
+/*----------------------------------------------------------------------------
+ * Banks
+ *----------------------------------------------------------------------------
+*/
+#define testBanks NULL
+
+/*----------------------------------------------------------------------------
+ * Samples
+ *----------------------------------------------------------------------------
+*/
+
+const EAS_SAMPLE testSamples[] =
+{
+ -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12,
+ 13, 13, 14, 13, 13, 13, 12, 12, 10, 9, 8, 6, 5, 3, 2, 0,
+ -1, -3, -5, -8, -10, -12, -14, -15, -16, -17, -17, -17, -17, -16, -14, -13,
+ -11, -10, -8, -6, -5, -4, -4, -3, -3, -2, -1, -1, -1, -1, -1, -1,
+ -1, -2, -3, -3, -3, -3, -3, -2, -2, -2, -1, -1, -1, -1, 0, 0,
+ 0, 0, 0, 0, 0, 1, 2, 4, 6, 9, 11, 12, 13, 15, 16, 17,
+ 19, 20, 22, 23, 25, 28, 32, 34, 36, 36, 35, 31, 25, 18, 11, 3,
+ -5, -13, -20, -26, -31, -34, -35, -36, -36, -35, -34, -32, -29, -26, -23, -19,
+ -16, -12, -8, -5, -4, -4, -4, -6, -8, -9, -11, -11, -12, -13, -13, -13,
+ -12, -11, -10, -9, -7, -5, -4, -3, -2, -1, -1, 0, 0, 2, 4, 5,
+ 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 7, 9, 12, 14, 17, 20,
+ 24, 27, 30, 33, 36, 39, 41, 43, 46, 49, 51, 51, 50, 48, 43, 35,
+ 25, 14, 1, -12, -25, -37, -48, -56, -61, -63, -62, -60, -57, -53, -48, -42,
+ -35, -29, -23, -17, -12, -8, -5, -3, -3, -4, -5, -7, -9, -11, -12, -14,
+ -14, -14, -14, -13, -11, -9, -7, -5, -3, -1, 0, 1, 1, 1, 2, 3,
+ 4, 5, 6, 6, 7, 8, 9, 10, 11, 11, 11, 11, 10, 9, 9, 10,
+ 12, 14, 17, 20, 23, 26, 30, 34, 38, 40, 43, 46, 49, 52, 55, 57,
+ 58, 56, 50, 42, 30, 16, 1, -15, -29, -43, -54, -63, -68, -69, -68, -65,
+ -60, -55, -49, -42, -35, -29, -22, -16, -10, -6, -2, -1, 0, -1, -3, -6,
+ -9, -12, -16, -18, -20, -21, -21, -21, -19, -17, -14, -11, -8, -5, -2, 1,
+ 3, 5, 7, 9, 11, 12, 12, 12, 11, 10, 9, 8, 7, 7, 7, 7,
+ 8, 9, 10, 12, 15, 17, 19, 22, 24, 26, 28, 30, 32, 34, 36, 38,
+ 42, 44, 47, 49, 53, 56, 55, 52, 45, 35, 22, 8, -8, -23, -37, -50,
+ -60, -67, -71, -71, -69, -63, -56, -48, -40, -33, -27, -21, -16, -12, -8, -6,
+ -5, -5, -6, -8, -11, -14, -17, -19, -21, -22, -22, -22, -20, -18, -16, -13,
+ -9, -6, -2, 1, 5, 7, 8, 9, 10, 11, 11, 11, 10, 10, 9, 9,
+ 9, 8, 8, 9, 9, 10, 10, 12, 13, 14, 16, 18, 19, 21, 24, 26,
+ 29, 32, 35, 39, 42, 46, 49, 51, 53, 56, 59, 59, 55, 48, 37, 22,
+ 5, -12, -29, -45, -58, -68, -74, -77, -77, -75, -69, -62, -53, -44, -35, -28,
+ -21, -15, -11, -8, -5, -4, -4, -4, -6, -8, -10, -13, -15, -17, -19, -19,
+ -19, -18, -16, -13, -10, -8, -4, -1, 1, 4, 5, 7, 8, 10, 11, 12,
+ 13, 14, 14, 13, 12, 12, 11, 9, 8, 7, 6, 6, 7, 8, 10, 12,
+ 15, 18, 21, 25, 29, 34, 39, 45, 51, 57, 61, 67, 73, 77, 82, 84,
+ 81, 70, 52, 29, 3, -24, -49, -72, -90, -103, -110, -112, -109, -102, -91, -78,
+ -64, -49, -35, -23, -13, -5, 1, 5, 8, 9, 9, 7, 4, 0, -4, -9,
+ -12, -15, -18, -18, -18, -17, -14, -12, -9, -6, -3, 0, 3, 6, 8, 10,
+ 11, 12, 11, 11, 10, 8, 7, 5, 4, 2, 2, 1, 2, 3, 4, 6,
+ 8, 11, 13, 15, 18, 21, 26, 31, 36, 42, 48, 53, 60, 66, 72, 77,
+ 82, 87, 91, 91, 86, 73, 54, 28, -2, -32, -61, -86, -105, -119, -126, -126,
+ -121, -111, -98, -82, -65, -48, -33, -19, -7, 1, 8, 12, 14, 14, 12, 10,
+ 6, 1, -4, -9, -14, -18, -20, -21, -22, -21, -19, -17, -14, -11, -8, -4,
+ 0, 3, 7, 10, 12, 13, 14, 14, 13, 12, 11, 10, 9, 8, 7, 5,
+ 4, 3, 2, 2, 4, 6, 9, 12, 16, 20, 26, 31, 36, 42, 48, 53,
+ 58, 64, 69, 74, 79, 82, 84, 83, 80, 72, 59, 39, 14, -14, -43, -70,
+ -92, -109, -119, -123, -120, -113, -102, -88, -73, -56, -40, -25, -12, -2, 5, 10,
+ 12, 12, 11, 9, 5, 1, -3, -8, -12, -15, -18, -20, -21, -21, -20, -18,
+ -16, -13, -9, -6, -2, 1, 5, 8, 11, 13, 15, 16, 16, 16, 15, 14,
+ 12, 10, 7, 5, 4, 3, 3, 5, 6, 8, 9, 12, 15, 19, 23, 27,
+ 31, 35, 38, 42, 46, 50, 54, 59, 65, 71, 75, 77, 78, 76, 68, 54,
+ 34, 10, -16, -43, -68, -88, -103, -112, -114, -112, -105, -94, -80, -65, -50, -35,
+ -22, -10, -2, 5, 9, 11, 10, 9, 6, 2, -3, -7, -12, -15, -18, -20,
+ -21, -22, -21, -20, -17, -14, -11, -7, -3, 0, 4, 7, 9, 11, 13, 15,
+ 17, 17, 17, 16, 14, 12, 11, 10, 8, 7, 5, 5, 5, 6, 7, 8,
+ 10, 11, 14, 17, 20, 24, 28, 32, 37, 43, 49, 57, 63, 70, 77, 82,
+ 83, 80, 73, 60, 42, 18, -8, -34, -59, -80, -95, -105, -110, -109, -103, -94,
+ -81, -67, -53, -38, -24, -13, -3, 4, 9, 11, 11, 9, 6, 3, -2, -6,
+ -10, -14, -17, -19, -20, -20, -20, -19, -17, -15, -12, -8, -5, -1, 2, 6,
+ 9, 11, 13, 15, 15, 16, 16, 15, 14, 12, 11, 9, 8, 6, 6, 5,
+ 5, 5, 6, 7, 8, 10, 12, 15, 19, 23, 28, 32, 38, 44, 50, 58,
+ 66, 74, 82, 87, 90, 89, 83, 69, 48, 21, -9, -41, -69, -93, -111, -121,
+ -124, -121, -113, -100, -85, -68, -50, -33, -18, -5, 5, 12, 16, 17, 16, 13,
+ 9, 4, -1, -6, -11, -15, -18, -20, -21, -21, -21, -19, -17, -15, -12, -8,
+ -4, -1, 3, 6, 9, 12, 14, 15, 15, 14, 13, 12, 11, 10, 9, 9,
+ 8, 8, 6, 6, 5, 5, 6, 7, 8, 11, 15, 18, 23, 27, 31, 36,
+ 41, 46, 51, 58, 66, 74, 82, 88, 91, 90, 83, 68, 46, 16, -16, -48,
+ -77, -101, -118, -127, -128, -124, -114, -101, -84, -66, -47, -30, -14, -1, 9, 16,
+ 19, 20, 19, 15, 11, 5, -1, -6, -11, -16, -19, -21, -23, -23, -23, -21,
+ -19, -16, -12, -8, -4, 0, 4, 8, 11, 13, 14, 15, 15, 14, 13, 12,
+ 11, 10, 9, 8, 7, 7, 7, 7, 7, 8, 8, 9, 11, 12, 14, 16,
+ 19, 23, 27, 31, 35, 40, 45, 51, 58, 66, 74, 82, 88, 90, 88, 77,
+ 58, 32, 1, -31, -62, -87, -107, -119, -125, -123, -117, -105, -90, -73, -56, -38,
+ -22, -8, 2, 10, 15, 17, 17, 15, 11, 7, 2, -4, -9, -14, -17, -20,
+ -22, -23, -22, -21, -19, -17, -14, -10, -6, -2, 2, 5, 9, 12, 14, 15,
+ 17, 18, 18, 18, 17, 15, 12, 10, 8, 6, 4, 4, 4, 5, 6, 7,
+ 8, 10, 13, 16, 19, 22, 25, 28, 32, 35, 40, 45, 52, 59, 67, 75,
+ 81, 85, 86, 80, 66, 45, 18, -12, -42, -69, -91, -107, -116, -119, -115, -107,
+ -95, -80, -64, -47, -31, -17, -5, 4, 10, 13, 14, 14, 11, 7, 3, -2,
+ -7, -12, -15, -18, -20, -21, -21, -20, -18, -16, -14, -11, -7, -4, 0, 4,
+ 7, 10, 12, 14, 16, 16, 16, 16, 16, 15, 14, 12, 10, 9, 7, 6,
+ 5, 4, 4, 5, 6, 7, 8, 10, 12, 15, 19, 23, 27, 31, 36, 41,
+ 47, 55, 64, 73, 81, 87, 90, 86, 75, 56, 30, 1, -30, -58, -82, -100,
+ -112, -117, -115, -109, -98, -84, -69, -52, -37, -22, -10, 0, 8, 12, 14, 14,
+ 13, 10, 6, 2, -3, -8, -12, -16, -18, -20, -20, -20, -19, -17, -15, -12,
+ -9, -5, -1, 2, 6, 9, 12, 14, 16, 17, 17, 17, 16, 14, 13, 11,
+ 8, 6, 4, 3, 2, 2, 2, 3, 5, 6, 8, 10, 12, 15, 18, 22,
+ 26, 30, 35, 40, 47, 55, 63, 71, 80, 87, 90, 88, 78, 59, 34, 4,
+ -27, -57, -82, -101, -113, -118, -117, -110, -99, -85, -69, -53, -37, -22, -9, 2,
+ 9, 14, 17, 17, 15, 12, 8, 3, -2, -7, -12, -16, -19, -20, -21, -21,
+ -19, -18, -15, -12, -9, -6, -2, 2, 6, 9, 12, 14, 16, 17, 17, 16,
+ 14, 12, 10, 8, 6, 5, 4, 3, 3, 2, 3, 4, 6, 7, 9, 11,
+ 13, 16, 19, 22, 26, 30, 34, 39, 46, 53, 61, 70, 80, 88, 93, 91,
+ 80, 61, 34, 3, -30, -59, -84, -102, -114, -119, -117, -110, -99, -84, -68, -51,
+ -35, -20, -7, 3, 11, 15, 17, 18, 16, 13, 9, 4, -2, -7, -11, -15,
+ -18, -20, -21, -21, -20, -19, -16, -14, -11, -8, -4, 0, 3, 7, 10, 13,
+ 15, 16, 17, 16, 14, 12, 10, 9, 7, 6, 5, 4, 4, 4, 5, 6,
+ 7, 8, 9, 11, 13, 15, 18, 21, 24, 27, 31, 35, 41, 48, 55, 64,
+ 73, 82, 89, 91, 85, 71, 48, 19, -13, -44, -71, -93, -108, -117, -118, -114,
+ -105, -92, -77, -60, -43, -27, -13, -1, 8, 14, 17, 18, 17, 14, 8, 13,
+ -1, -1, 0, 2, 4, 6, 9, 11, 13, 14, 13, 12, 11, 8, 5, 2,
+ -1, -5, -10, -14, -16, -17, -16, -14, -11, -8, -5, -4, -3, -1, -1, -1,
+ -1, -3, -3, -3, -2, -1, -1, 0, 0, 0, 0, 2, 6, 11, 14, 16,
+ 19, 22, 25, 32, 36, 34, 25, 11, -5, -20, -31, -35, -36, -34, -29, -23,
+ -16, -8, -4, -4, -8, -11, -12, -13, -12, -10, -7, -4, -2, -1, 1, 4,
+ 7, 7, 6, 6, 6, 7, 12, 17, 24, 30, 36, 41, 46, 51, 50, 43,
+ 25, 2, -25, -48, -61, -62, -57, -48, -35, -23, -12, -5, -3, -5, -9, -12,
+ -14, -14, -12, -7, -3, 0, 1, 2, 4, 6, 7, 9, 11, 11, 10, 9,
+ 12, 17, 23, 30, 37, 43, 49, 55, 58, 50, 30, 1, -29, -54, -68, -68,
+ -60, -49, -35, -22, -10, -2, 0, -3, -9, -16, -20, -21, -19, -14, -8, -2,
+ 3, 7, 11, 12, 11, 9, 7, 7, 8, 10, 15, 19, 24, 28, 33, 36,
+ 42, 47, 53, 56, 45, 23, -8, -37, -60, -71, -69, -56, -40, -27, -16, -8,
+ -5, -6, -11, -17, -21, -22, -20, -16, -9, -2, 5, 8, 10, 11, 10, 9,
+ 8, 8, 9, 10, 13, 16, 19, 24, 29, 35, 42, 49, 53, 59, 55, 37,
+ 5, -29, -58, -74, -77, -69, -53, -35, -21, -11, -5, -4, -6, -10, -15, -19,
+ -19, -16, -10, -5, 1, 5, 8, 11, 13, 14, 12, 10, 8, 6, 7, 10,
+ 15, 21, 29, 39, 51, 62, 72, 82, 81, 52, 3, -50, -90, -110, -109, -91,
+ -64, -35, -13, 1, 8, 9, 4, -4, -12, -18, -18, -14, -9, -3, 3, 8,
+ 11, 11, 10, 7, 4, 2, 2, 4, 8, 13, 18, 26, 36, 48, 60, 72,
+ 82, 91, 86, 54, -2, -61, -105, -126, -121, -98, -65, -33, -7, 8, 14, 12,
+ 6, -4, -14, -20, -22, -19, -14, -8, 0, 7, 12, 14, 13, 11, 9, 7,
+ 4, 2, 4, 9, 16, 26, 36, 48, 58, 69, 79, 84, 80, 59, 14, -43,
+ -92, -119, -120, -102, -73, -40, -12, 5, 12, 11, 5, -3, -12, -18, -21, -20,
+ -16, -9, -2, 5, 11, 15, 16, 15, 12, 7, 4, 4, 6, 9, 15, 23,
+ 31, 38, 46, 54, 65, 75, 78, 68, 34, -16, -68, -103, -114, -105, -80, -50,
+ -22, -1, 9, 10, 6, -3, -12, -18, -21, -21, -17, -11, -3, 4, 9, 13,
+ 16, 17, 14, 11, 8, 5, 5, 7, 10, 14, 20, 28, 37, 49, 64, 77,
+ 83, 73, 42, -8, -59, -95, -110, -103, -81, -53, -24, -3, 9, 11, 6, -2,
+ -10, -17, -20, -20, -17, -12, -5, 2, 9, 13, 15, 16, 14, 11, 8, 6,
+ 5, 6, 8, 12, 19, 28, 38, 50, 66, 82, 90, 83, 48, -9, -69, -111,
+ -124, -113, -85, -50, -18, 5, 16, 16, 9, -1, -11, -18, -21, -21, -17, -12,
+ -5, 3, 9, 14, 15, 13, 11, 9, 8, 6, 5, 6, 8, 15, 23, 31,
+ 41, 52, 66, 82, 91, 83, 46, -16, -77, -118, -128, -114, -84, -47, -14, 9,
+ 19, 19, 10, -1, -11, -19, -23, -23, -19, -12, -4, 4, 11, 14, 15, 13,
+ 11, 9, 7, 7, 7, 8, 11, 14, 19, 27, 35, 45, 58, 74, 88, 88,
+ 58, 1, -62, -107, -125, -116, -90, -56, -22, 2, 15, 17, 11, 2, -9, -17,
+ -22, -22, -20, -14, -6, 2, 9, 14, 17, 18, 17, 12, 8, 4, 4, 6,
+ 8, 13, 19, 25, 32, 40, 52, 67, 81, 86, 66, 18, -42, -91, -116, -115,
+ -95, -64, -31, -5, 10, 14, 11, 3, -7, -15, -20, -21, -18, -14, -7, 0,
+ 7, 12, 16, 17, 16, 14, 10, 7, 5, 4, 6, 8, 12, 19, 27, 36,
+ 47, 64, 81, 90, 75, 30, -30, -82, -112, -115, -98, -69, -37, -10, 8, 14,
+ 13, 6, -3, -12, -18, -20, -19, -15, -9, -1, 6, 12, 16, 17, 16, 13,
+ 8, 4, 2, 2, 5, 8, 12, 18, 26, 35, 47, 63, 80, 90, 78, 34,
+ -27, -82, -113, -117, -99, -69, -37, -9, 9, 17, 15, 8, -2, -12, -19, -21,
+ -19, -15, -9, -2, 6, 12, 16, 17, 14, 10, 6, 4, 3, 3, 6, 9,
+ 13, 19, 26, 34, 46, 61, 80, 93, 80, 34, -30, -84, -114, -117, -99, -68,
+ -35, -7, 11, 17, 16, 9, -2, -11, -18, -21, -20, -16, -11, -4, 3, 10,
+ 15, 17, 14, 10, 7, 5, 4, 5, 7, 9, 13, 18, 24, 31, 41, 55,
+ 73, 89, 85, 48, -12, -71, -108, -118, -104, -77, -43, -13, 8, 16, 17, 16,
+ 0, -3, -4, -5, -4, 0, -4, -8, -20, -25, 51, 11, -55, 9, 39, 55,
+ -76, -19, 92, -23, -58, 2, -15, 57, 71, 34, -41, 20, 51, 22, 63, -21,
+ 63, 74, 32, 36, 99, -14, 27, 102, 66, 90, 79, 77, 58, 66, 65, 114,
+ 69, 26, 30, 92, 90, 53, 78, 97, 77, 66, 39, -4, 60, 57, 64, 68,
+ -16, 36, 49, 12, 19, 12, -12, 21, 11, -32, -19, -41, -44, -12, -36, -44,
+ -45, -51, -55, -70, -69, -73, -85, -102, -86, -99, -92, -105, -108, -103, -100, -107,
+ -112, -104, -113, -112, -104, -119, -124, -115, -87, -100, -128, -106, -83, -105, -108, -109,
+ -91, -95, -90, -83, -80, -79, -83, -68, -59, -53, -63, -69, -57, -28, -11, -38,
+ -43, -23, -10, -6, 3, 1, 6, 14, 21, 23, 34, 40, 42, 48, 57, 61,
+ 63, 65, 73, 82, 90, 82, 89, 98, 100, 110, 111, 109, 115, 120, 121, 121,
+ 123, 123, 123, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 121, 121,
+ 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 113, 104, 103, 113, 110, 94, 80, 88, 96, 89, 81, 70,
+ 68, 64, 59, 59, 54, 44, 44, 39, 31, 31, 21, 18, 16, 8, 6, 2,
+ -3, -6, -13, -19, -27, -31, -34, -30, -38, -47, -48, -51, -56, -64, -68, -67,
+ -68, -76, -73, -79, -85, -94, -89, -90, -94, -92, -99, -100, -107, -107, -104, -107,
+ -106, -112, -114, -113, -112, -111, -112, -116, -116, -115, -115, -115, -115, -115, -115, -115,
+ -114, -114, -114, -114, -114, -114, -114, -114, -113, -113, -113, -113, -113, -108, -106, -107,
+ -111, -110, -105, -108, -107, -102, -100, -103, -103, -100, -100, -97, -97, -100, -99, -97,
+ -94, -90, -94, -94, -93, -93, -92, -92, -90, -89, -89, -90, -91, -87, -87, -88,
+ -89, -88, -84, -85, -88, -87, -86, -85, -85, -84, -82, -83, -83, -82, -81, -80,
+ -79, -79, -79, -78, -75, -74, -75, -73, -74, -71, -69, -67, -69, -66, -64, -66,
+ -65, -64, -62, -58, -57, -57, -57, -56, -52, -51, -50, -48, -46, -43, -43, -42,
+ -39, -36, -35, -34, -32, -31, -29, -26, -23, -23, -21, -15, -18, -15, -11, -8,
+ -6, -7, 0, 2, 0, 2, 7, 15, 14, 15, 16, 19, 23, 27, 29, 30,
+ 31, 34, 41, 41, 42, 44, 45, 51, 55, 54, 56, 57, 60, 65, 67, 69,
+ 69, 71, 74, 77, 79, 78, 80, 82, 86, 86, 84, 86, 88, 87, 87, 87,
+ 87, 87, 86, 86, 86, 86, 86, 85, 85, 85, 85, 85, 84, 84, 84, 84,
+ 84, 83, 83, 83, 83, 83, 83, 82, 82, 82, 82, 82, 81, 81, 81, 81,
+ 81, 80, 80, 80, 80, 80, 79, 79, 79, 79, 79, 78, 78, 78, 78, 76,
+ 75, 72, 69, 67, 65, 64, 63, 59, 55, 54, 52, 50, 48, 45, 42, 38,
+ 36, 34, 31, 30, 27, 24, 21, 18, 16, 14, 12, 9, 7, 4, 1, -2,
+ -4, -7, -10, -11, -13, -16, -17, -18, -21, -24, -26, -27, -28, -30, -32, -33,
+ -35, -36, -38, -39, -41, -42, -43, -45, -45, -46, -47, -48, -49, -50, -51, -50,
+ -51, -52, -53, -53, -53, -53, -53, -53, -53, -54, -54, -54, -54, -53, -53, -52,
+ -52, -52, -51, -51, -51, -50, -50, -50, -48, -49, -48, -47, -46, -45, -45, -44,
+ -43, -42, -41, -41, -40, -39, -38, -37, -36, -35, -34, -33, -31, -30, -29, -28,
+ -27, -26, -24, -24, -23, -22, -21, -20, -19, -18, -17, -16, -15, -14, -13, -13,
+ -12, -11, -11, -10, -9, -9, -8, -8, -7, -6, -7, -6, -5, -5, -5, -4,
+ -4, -3, -3, -3, -3, -3, -2, -2, -2, -2, -2, -2, -2, -2, 0, 0,
+ 0, 0, -1, 0, 4, 9, 13, 13, 11, 5, -1, -10, -16, -17, -11, -5,
+ -2, -1, -2, -3, -2, -1, 0, 0, 6, 14, 19, 26, 36, 25, -5, -30,
+ -36, -29, -16, -4, -7, -13, -12, -7, -2, 1, 6, 7, 6, 11, 24, 36,
+ 46, 50, 26, -25, -60, -57, -36, -12, -3, -9, -14, -12, -3, 1, 4, 7,
+ 11, 10, 12, 23, 37, 49, 58, 31, -29, -67, -61, -36, -10, 0, -9, -20,
+ -19, -8, 3, 11, 11, 7, 8, 15, 24, 32, 41, 53, 45, -7, -60, -68,
+ -41, -16, -5, -11, -21, -20, -10, 4, 10, 10, 8, 9, 13, 19, 29, 42,
+ 54, 55, 6, -57, -77, -54, -21, -6, -6, -15, -19, -11, 1, 8, 13, 12,
+ 8, 7, 15, 29, 50, 73, 80, 5, -90, -109, -65, -13, 8, 4, -13, -18,
+ -10, 3, 11, 10, 4, 2, 8, 18, 36, 60, 82, 86, 1, -105, -121, -66,
+ -8, 13, 6, -14, -22, -15, -1, 12, 13, 9, 4, 3, 16, 36, 58, 78,
+ 81, 15, -91, -121, -74, -13, 12, 5, -11, -21, -16, -2, 11, 16, 12, 4,
+ 6, 15, 31, 46, 64, 79, 36, -66, -115, -81, -23, 9, 6, -11, -21, -17,
+ -4, 9, 16, 15, 8, 5, 9, 20, 37, 63, 83, 43, -57, -110, -83, -25,
+ 8, 7, -10, -20, -17, -5, 9, 15, 14, 8, 5, 8, 18, 37, 65, 91,
+ 50, -67, -124, -86, -19, 16, 9, -10, -21, -18, -5, 9, 15, 11, 8, 5,
+ 8, 22, 40, 65, 92, 48, -74, -128, -85, -16, 19, 11, -11, -23, -19, -4,
+ 10, 15, 11, 8, 7, 11, 19, 35, 57, 88, 60, -58, -125, -92, -24, 15,
+ 12, -8, -22, -20, -7, 9, 17, 17, 8, 4, 8, 18, 31, 51, 81, 67,
+ -38, -116, -96, -33, 9, 11, -6, -20, -19, -8, 7, 16, 16, 11, 5, 5,
+ 12, 26, 47, 80, 76, -26, -111, -99, -39, 7, 13, -3, -18, -19, -9, 5,
+ 16, 16, 8, 2, 4, 12, 25, 46, 79, 79, -23, -112, -101, -39, 9, 15,
+ -2, -18, -20, -9, 5, 16, 14, 7, 3, 5, 13, 25, 44, 79, 81, -25,
+ -113, -100, -37, 10, 16, -1, -18, -20, -11, 3, 15, 15, 7, 4, 6, 13,
+ 23, 40, 72, 86, -7, -107, -106, -46, 7, 16, 0, 16, 31, 47, 61, 75,
+ 87, 98, 107, 115, 121, 125, 127, 127, 125, 121, 116, 108, 99, 88, 75, 62,
+ 47, 32, 16, 0, -16, -31, -47, -61, -75, -87, -98, -108, -116, -122, -126, -128,
+ -128, -126, -123, -117, -109, -100, -89, -77, -64, -49, -34, -18, -2, 14, 29, 45,
+ 59, 73, 86, 97, 106, 114, 121, 125, 127, 127, 126, 122, 116, 109, 100, 89,
+ 77, 63, 49, 34, 18, 2, -14, -30, -45, -60, -73, -86, -97, -107, -115, -121,
+ -126, -128, -128, -127, -123, -118, -110, -101, -91, -79, -65, -51, -36, -20, -4, 12,
+ 28, 43, 58, 72, 84, 96, 106, 114, 120, 124, 127, 127, 126, 122, 117, 109,
+ 100, 90, 78, 64, 50, 35, 19, 3, -13, -29, -44, -59, -73, -85, -97, -107,
+ -115, -121, -125, -128, -128, -127, -123, -118, -110, -101, -91, -79, -65, -51, -36, -20,
+ -4, 12, 28, 43, 58, 72, 84, 96, 106, 114, 120, 124, 127, 127, 126, 122,
+ 117, 109, 100, 90, 78, 64, 50, 35, 19, 3, -13, -29, -44, -59, -73, -85,
+ -97, -107, -115, -121, -125, -128, -128, -127, -123, -118, -110, -101, -91, -79, -65, -51,
+ -36, -20, -4, 12, 28, 43, 58, 72, 84, 96, 106, 114, 120, 124, 127, 127,
+ 126, 122, 117, 109, 100, 90, 78, 64, 50, 35, 19, 3, -13, -29, -44, -59,
+ -73, -85, -97, -107, -115, -121, -125, -128, -128, -127, -123, -118, -110, -101, -91, -79,
+ -65, -51, -36, -20, -4, 12, 28, 43, 58, 72, 84, 96, 106, 114, 120, 124,
+ 127, 127, 126, 122, 117, 109, 100, 90, 78, 64, 50, 35, 19, 3, -13, -29,
+ -44, -59, -73, -85, -97, -107, -115, -121, -125, -128, -128, -127, -123, -118, -110, -101,
+ -91, -79, -65, -51, -36, -20, -4, 12, 0, -104, -55, -11, 24, 33, 30, 7,
+ -15, -31, -30, -25, -23, -20, -9, 10, 31, 59, 91, 111, 115, 92, 51, 7,
+ -33, -64, -81, -81, -71, -51, -22, 16, 52, 74, 82, 81, 68, 38, 0, -40,
+ -81, -112, -124, -102, -57, -11, 24, 33, 30, 7, -15, -31, -30, -25, -23, -20,
+ -9, 10, 31, 59, 91, 111, 115, 92, 51, 7, -33, -64, -81, -81, -71, -51,
+ -22, 16, 52, 74, 82, 81, 68, 38, 0, -40, -81, -112, -124, -102, -57, -11,
+ 24, 33, 30, 7, -15, -31, -30, -25, -23, -20, -9, 10, 31, 59, 91, 111,
+ 115, 92, 51, 7, -33, -64, -81, -81, -71, -51, -22, 16, 52, 74, 82, 81,
+ 68, 38, 0, -40, -81, -112, -124, -102, -57, -11, 24, 33, 30, 7, -15, -31,
+ -30, -25, -23, -20, -9, 10, 31, 59, 91, 111, 115, 92, 51, 7, -33, -64,
+ -81, -81, -71, -51, -22, 16, 52, 74, 82, 81, 68, 38, 0, -40, -81, -112,
+ -124, -102, -57, -11, 0
+};
+
+const EAS_U32 testSampleLengths[] =
+{
+ 1568, 784, 642, 392, 302, 172
+};
+
+const EAS_U32 testSampleOffsets[] =
+{
+ 0x00000000, 0x00000620, 0x00000930, 0x00000bb2, 0x00000d3a, 0x00000e68
+};
+
+/*----------------------------------------------------------------------------
+ * S_EAS
+ *----------------------------------------------------------------------------
+*/
+const S_EAS easTestLib =
+{
+ 0x01534145,
+ 0x00105622,
+ testBanks,
+ testPrograms,
+ testRegions,
+ testArticulations,
+ testSampleLengths,
+ testSampleOffsets,
+ testSamples,
+ 0,
+ 0,
+ 16,
+ 152,
+ 97,
+ 6,
+ 0
+}; /* end S_EAS */
+
+/*----------------------------------------------------------------------------
+ * Statistics
+ *
+ * Number of banks: 0
+ * Number of programs: 16
+ * Number of regions: 152
+ * Number of articulations: 97
+ * Number of samples: 6
+ * Size of sample pool: 3861
+ *----------------------------------------------------------------------------
+*/
+/* end ..\..\EASLib\WTLibrary\eastestv37.c */
diff --git a/arm-wt-22k/jetcreator_lib_src/darwin-x86/wt_44khz.c b/arm-wt-22k/jetcreator_lib_src/darwin-x86/wt_44khz.c
index 688c715..53cd952 100644
--- a/arm-wt-22k/jetcreator_lib_src/darwin-x86/wt_44khz.c
+++ b/arm-wt-22k/jetcreator_lib_src/darwin-x86/wt_44khz.c
@@ -1,14723 +1,14723 @@
-/*----------------------------------------------------------------------------
- *
- * Filename: wt_44khz.c
- * Purpose: Wavetable sound libary
- *
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-#include "eas_sndlib.h"
-
-/*----------------------------------------------------------------------------
- * Articulations
- *----------------------------------------------------------------------------
-*/
-const S_ARTICULATION eas_articulations[] =
-{
- { /* articulation 0 */
- { 32767, 31730, 0, 31730 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 1 */
- { 32767, 29669, 0, 29669 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 2 */
- { 32767, 31605, 0, 31701 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 3 */
- { 32767, 29434, 0, 29434 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 4 */
- { 32767, 0, 32767, 32742 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 5 */
- { 32767, 26439, 0, 26439 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 6 */
- { 32767, 32322, 0, 32350 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 7 */
- { 32767, 32715, 32767, 32715 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 8 */
- { 32767, 0, 32767, 0 },
- { 32767, 951, 0, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 9 */
- { 32767, 32558, 0, 32558 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 10 */
- { 32767, 0, 32767, 23749 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, -1
- },
- { /* articulation 11 */
- { 32767, 32245, 0, 32245 },
- { 32767, 380, 0, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, -44
- },
- { /* articulation 12 */
- { 32767, 27897, 0, 27897 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 56
- },
- { /* articulation 13 */
- { 32767, 32245, 0, 32245 },
- { 32767, 380, 0, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, -31
- },
- { /* articulation 14 */
- { 4755, 26439, 0, 26439 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 56
- },
- { /* articulation 15 */
- { 32767, 32187, 0, 32187 },
- { 32767, 380, 0, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, -6
- },
- { /* articulation 16 */
- { 32767, 32444, 0, 32480 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 56
- },
- { /* articulation 17 */
- { 32767, 32153, 0, 32153 },
- { 32767, 380, 0, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 6
- },
- { /* articulation 18 */
- { 32767, 32072, 0, 32072 },
- { 32767, 476, 0, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 31
- },
- { /* articulation 19 */
- { 32767, 32363, 0, 32363 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 25
- },
- { /* articulation 20 */
- { 32767, 31901, 0, 31901 },
- { 32767, 476, 0, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 63
- },
- { /* articulation 21 */
- { 32767, 32528, 0, 32518 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, -37
- },
- { /* articulation 22 */
- { 9511, 32322, 0, 32337 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, -37
- },
- { /* articulation 23 */
- { 32767, 32376, 0, 32398 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, -37
- },
- { /* articulation 24 */
- { 32767, 0, 32767, 32715 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 12
- },
- { /* articulation 25 */
- { 32767, 32052, 0, 32052 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, -25
- },
- { /* articulation 26 */
- { 32767, 0, 32767, 32715 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 25
- },
- { /* articulation 27 */
- { 32767, 32289, 0, 32271 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, -25
- },
- { /* articulation 28 */
- { 32767, 31730, 0, 31730 },
- { 32767, 48, 0, 0 },
- 0, 0, 476, 240, 0, 0, 0, 0, -56
- },
- { /* articulation 29 */
- { 32767, 32498, 0, 32492 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, -37
- },
- { /* articulation 30 */
- { 32767, 29434, 0, 29434 },
- { 32767, 1902, 0, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 50
- },
- { /* articulation 31 */
- { 32767, 27897, 0, 27897 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, -50
- },
- { /* articulation 32 */
- { 32767, 31056, 0, 31056 },
- { 32767, 1902, 0, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, -50
- },
- { /* articulation 33 */
- { 32767, 31479, 0, 31476 },
- { 32767, 1902, 0, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, -44
- },
- { /* articulation 34 */
- { 32767, 32663, 0, 32663 },
- { 32767, 127, 0, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 25
- },
- { /* articulation 35 */
- { 32767, 0, 32767, 32715 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, -63
- },
- { /* articulation 36 */
- { 1902, 27897, 0, 27897 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, -63
- },
- { /* articulation 37 */
- { 32767, 27897, 0, 27897 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, -59
- },
- { /* articulation 38 */
- { 32767, 31730, 0, 31730 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 50
- },
- { /* articulation 39 */
- { 32767, 30725, 0, 30725 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 44
- },
- { /* articulation 40 */
- { 951, 31730, 0, 31730 },
- { 32767, 190, 0, 0 },
- 0, 0, 476, -100, 0, 0, 0, 0, 44
- },
- { /* articulation 41 */
- { 32767, 17213, 0, 17213 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 25
- },
- { /* articulation 42 */
- { 32767, 31295, 0, 31295 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 63
- },
- { /* articulation 43 */
- { 32767, 31479, 0, 31476 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 63
- },
- { /* articulation 44 */
- { 9511, 25581, 0, 25581 },
- { 476, 32767, 32767, 0 },
- 0, 0, 476, 100, 0, 0, 0, 0, -25
- },
- { /* articulation 45 */
- { 1902, 23749, 0, 23749 },
- { 476, 32767, 32767, 0 },
- 0, 0, 476, 500, 0, 0, 0, 0, -25
- },
- { /* articulation 46 */
- { 32767, 23749, 0, 23749 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, -56
- },
- { /* articulation 47 */
- { 32767, 31730, 0, 31730 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, -56
- },
- { /* articulation 48 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 49 */
- { 32767, 31964, 0, 31964 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 50 */
- { 9511, 32363, 0, 32418 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 51 */
- { 32767, 31180, 0, 31180 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 52 */
- { 32767, 32251, 0, 32052 },
- { 32767, 147, 0, 0 },
- 0, 0, 476, 0, 10000, 7121, 0, 0, 0
- },
- { /* articulation 53 */
- { 32767, 0, 32767, 32072 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 778, 0, -2300, 11920, 0, 0, 0
- },
- { /* articulation 54 */
- { 587, 0, 32767, 32376 },
- { 32767, 63, 0, 0 },
- 0, 0, 778, 0, 2000, 10721, 0, 8, 15
- },
- { /* articulation 55 */
- { 587, 0, 32767, 32376 },
- { 476, 63, 0, 0 },
- 0, 0, 778, 0, 2000, 9023, 0, 5, 15
- },
- { /* articulation 56 */
- { 3804, 0, 32767, 31477 },
- { 32767, 34, 5898, 0 },
- 0, 0, 778, 0, 6000, 9080, 0, 0, -2
- },
- { /* articulation 57 */
- { 32767, 0, 32767, 31005 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 778, 0, 0, 0, 0, 0, 1
- },
- { /* articulation 58 */
- { 2570, 0, 32767, 31455 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 778, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 59 */
- { 32767, 32663, 0, 29434 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 60 */
- { 32767, 32558, 0, 29434 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 61 */
- { 32767, 32418, 0, 32418 },
- { 32767, 48, 0, 0 },
- 0, 69, 495, 0, 2400, 9521, 0, 0, 0
- },
- { /* articulation 62 */
- { 32767, 31476, 0, 31476 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 11738, 0, 16, 0
- },
- { /* articulation 63 */
- { 32767, 32558, 0, 31391 },
- { 32767, 317, 0, 0 },
- 0, 69, 476, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 64 */
- { 32767, 32245, 0, 32115 },
- { 32767, 317, 0, 0 },
- 0, 69, 476, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 65 */
- { 32767, 32593, 0, 28809 },
- { 32767, 48, 0, 0 },
- 0, 69, 495, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 66 */
- { 32767, 32408, 0, 32363 },
- { 32767, 317, 0, 0 },
- 0, 69, 476, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 67 */
- { 32767, 32350, 0, 32350 },
- { 32767, 317, 0, 0 },
- 0, 69, 476, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 68 */
- { 4755, 32715, 18820, 27897 },
- { 951, 29, 13107, 0 },
- 0, 0, 495, 0, 6000, 5535, 0, 4, 0
- },
- { /* articulation 69 */
- { 32767, 32257, 0, 32245 },
- { 32767, 951, 0, 0 },
- 0, 103, 495, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 70 */
- { 63, 32727, 3811, 32558 },
- { 48, 19, 32767, 0 },
- 0, 0, 495, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 71 */
- { 2378, 32715, 3566, 30725 },
- { 1902, 32767, 32767, 0 },
- 0, 0, 495, 100, 0, 11919, 0, 0, 0
- },
- { /* articulation 72 */
- { 32767, 32349, 0, 32349 },
- { 32767, 168, 0, 0 },
- 0, 34, 495, 0, 7000, 9023, 0, 0, 0
- },
- { /* articulation 73 */
- { 32767, 32072, 0, 32072 },
- { 32767, 168, 0, 0 },
- 0, 3, 476, 0, 7000, 9023, 0, 0, 0
- },
- { /* articulation 74 */
- { 32767, 32698, 6208, 32349 },
- { 190, 48, 0, 0 },
- 0, 0, 495, 0, 3840, 8302, 0, 8, 0
- },
- { /* articulation 75 */
- { 32767, 32418, 0, 32468 },
- { 32767, 190, 0, 0 },
- 0, 0, 495, 0, 5000, 8321, 0, 0, 0
- },
- { /* articulation 76 */
- { 32767, 32349, 0, 32349 },
- { 32767, 190, 0, 0 },
- 0, 0, 476, 0, 5000, 7934, 0, 0, 0
- },
- { /* articulation 77 */
- { 32767, 32441, 0, 31709 },
- { 32767, 32, 0, 0 },
- 0, 34, 495, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 78 */
- { 32767, 32505, 0, 27897 },
- { 32767, 951, 0, 0 },
- 0, 345, 495, 0, 1000, 11107, 0, 0, 0
- },
- { /* articulation 79 */
- { 32767, 32715, 6208, 32349 },
- { 48, 48, 0, 0 },
- 0, 69, 811, 0, 3560, 8834, 1, 8, 0
- },
- { /* articulation 80 */
- { 32767, 32564, 0, 29434 },
- { 32767, 95, 0, 0 },
- 0, 34, 495, 0, 6000, 9907, 0, 0, 0
- },
- { /* articulation 81 */
- { 32767, 32505, 0, 27897 },
- { 32767, 32, 0, 0 },
- 0, 34, 495, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 82 */
- { 32767, 32245, 18820, 17213 },
- { 32767, 32767, 32767, 0 },
- 0, 34, 495, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 83 */
- { 32767, 32742, 128, 32466 },
- { 32767, 63, 0, 0 },
- 0, 0, 495, 0, 0, 11920, 0, 8, 0
- },
- { /* articulation 84 */
- { 32767, 32418, 0, 32418 },
- { 32767, 33, 0, 0 },
- 3, 0, 286, 0, 5000, 5535, 0, 0, 0
- },
- { /* articulation 85 */
- { 1902, 32715, 18820, 27897 },
- { 32767, 1012, 0, 0 },
- 10, 69, 504, -30, 0, 0, 0, 0, 0
- },
- { /* articulation 86 */
- { 9511, 32715, 18820, 27897 },
- { 380, 48, 0, 0 },
- 0, 69, 495, 0, 4473, 7131, 0, 8, 0
- },
- { /* articulation 87 */
- { 951, 32698, 6208, 32468 },
- { 317, 19, 16384, 0 },
- 0, 0, 495, 0, 2987, 7877, 0, 12, 0
- },
- { /* articulation 88 */
- { 32767, 32680, 0, 32349 },
- { 32767, 48, 0, 0 },
- 0, 0, 581, 0, 4053, 7930, 2, 12, 0
- },
- { /* articulation 89 */
- { 190, 32726, 6208, 32349 },
- { 32767, 56, 0, 0 },
- 0, 0, 495, 0, 0, 8887, 0, 0, 0
- },
- { /* articulation 90 */
- { 9511, 32715, 18820, 27897 },
- { 634, 48, 0, 0 },
- 0, 69, 495, 0, 5113, 7981, 0, 4, 0
- },
- { /* articulation 91 */
- { 951, 32715, 6208, 31730 },
- { 951, 63, 0, 0 },
- 0, 69, 495, 0, 3500, 7877, 0, 5, 0
- },
- { /* articulation 92 */
- { 951, 32715, 6208, 31730 },
- { 634, 48, 0, 0 },
- 0, 69, 476, 0, 4773, 8355, 0, 5, 0
- },
- { /* articulation 93 */
- { 238, 32715, 10809, 32349 },
- { 32767, 32767, 32767, 0 },
- 0, 69, 495, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 94 */
- { 1902, 32715, 18820, 31476 },
- { 32767, 32767, 32767, 0 },
- 0, 69, 495, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 95 */
- { 3804, 32715, 18820, 23749 },
- { 1268, 130, 0, 0 },
- 0, 69, 495, 0, 1200, 11690, 0, 4, 0
- },
- { /* articulation 96 */
- { 19021, 32618, 15076, 31476 },
- { 32767, 32767, 32767, 0 },
- 0, 72, 1091, 0, 0, 11919, 1, 0, 0
- },
- { /* articulation 97 */
- { 32767, 0, 32767, 32715 },
- { 190, 32767, 32767, 0 },
- 0, 0, 495, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 98 */
- { 32767, 32072, 0, 32072 },
- { 32767, 317, 0, 0 },
- 0, 0, 495, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 99 */
- { 32767, 32663, 0, 27897 },
- { 634, 95, 13107, 0 },
- 0, 69, 495, 0, 3200, 8321, 0, 0, 0
- },
- { /* articulation 100 */
- { 32767, 0, 32767, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 495, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 101 */
- { 32767, 32418, 0, 27897 },
- { 32767, 543, 0, 0 },
- 0, 69, 495, 0, 8187, 5535, 0, 5, 0
- },
- { /* articulation 102 */
- { 19021, 32663, 0, 31056 },
- { 32767, 95, 7667, 0 },
- 5, 0, 495, 0, 6053, 5535, 0, 5, 0
- },
- { /* articulation 103 */
- { 32767, 32715, 18820, 27897 },
- { 951, 48, 0, 0 },
- 0, 0, 495, 0, 2700, 9852, 0, 0, 0
- },
- { /* articulation 104 */
- { 32767, 32715, 18820, 30234 },
- { 951, 48, 0, 0 },
- 0, 0, 495, 0, 2700, 9852, 0, 0, 0
- },
- { /* articulation 105 */
- { 32767, 32715, 18820, 27897 },
- { 32767, 634, 0, 0 },
- 0, 103, 476, 0, 2500, 10490, 1, 8, 0
- },
- { /* articulation 106 */
- { 32767, 32715, 23493, 27897 },
- { 32767, 190, 0, 0 },
- 0, 69, 494, 0, 4000, 10223, 1, 4, 0
- },
- { /* articulation 107 */
- { 32767, 32715, 18820, 30234 },
- { 32767, 63, 7667, 0 },
- 0, 0, 495, 0, 1813, 9154, 0, 0, 0
- },
- { /* articulation 108 */
- { 19021, 32245, 0, 32245 },
- { 32767, 190, 0, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 109 */
- { 32767, 31964, 0, 31605 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 11690, 0, 0, 0
- },
- { /* articulation 110 */
- { 32767, 31730, 0, 31730 },
- { 32767, 190, 0, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 111 */
- { 32767, 32558, 18820, 30234 },
- { 32767, 48, 0, 0 },
- 12, 69, 476, 0, 3000, 10223, 0, 0, 0
- },
- { /* articulation 112 */
- { 32767, 32558, 18820, 30234 },
- { 32767, 32, 0, 0 },
- 12, 69, 476, 0, 1900, 10031, 0, 0, 0
- },
- { /* articulation 113 */
- { 32767, 32715, 18820, 29434 },
- { 32767, 32, 0, 0 },
- 12, 69, 494, 0, 1000, 11107, 0, 0, 0
- },
- { /* articulation 114 */
- { 32767, 32715, 18820, 29434 },
- { 32767, 32, 0, 0 },
- 12, 69, 494, 0, 2000, 11107, 0, 0, 0
- },
- { /* articulation 115 */
- { 32767, 32636, 0, 29434 },
- { 32767, 95, 0, 0 },
- 0, 34, 495, 0, 4000, 8321, 0, 0, 0
- },
- { /* articulation 116 */
- { 32767, 32297, 19893, 17213 },
- { 32767, 238, 0, 0 },
- 0, 69, 726, 0, 0, 11919, 0, 0, 0
- },
- { /* articulation 117 */
- { 9511, 32418, 23493, 17213 },
- { 32767, 32767, 32767, 0 },
- 0, 69, 678, 0, 0, 11877, 1, 0, 0
- },
- { /* articulation 118 */
- { 32767, 32618, 0, 27897 },
- { 32767, 95, 0, 0 },
- 0, 69, 495, 0, 3500, 9023, 0, 0, 0
- },
- { /* articulation 119 */
- { 32767, 23749, 23493, 0 },
- { 32767, 32767, 32767, 0 },
- 0, 34, 761, 0, 0, 10925, 1, 0, 0
- },
- { /* articulation 120 */
- { 32767, 32636, 0, 29434 },
- { 32767, 95, 0, 0 },
- 0, 103, 495, 0, 3200, 8721, 0, 4, 0
- },
- { /* articulation 121 */
- { 1902, 32715, 18820, 27897 },
- { 32767, 32767, 32767, 0 },
- 0, 69, 495, 0, 0, 0, 1, 0, 0
- },
- { /* articulation 122 */
- { 4755, 32715, 18820, 28809 },
- { 32767, 32767, 32767, 0 },
- 0, 69, 495, 0, 0, 11877, 0, 8, 0
- },
- { /* articulation 123 */
- { 32767, 32715, 18820, 27897 },
- { 32767, 16, 0, 0 },
- 0, 34, 495, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 124 */
- { 32767, 32663, 0, 27897 },
- { 32767, 190, 0, 0 },
- 0, 69, 495, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 125 */
- { 32767, 32715, 18820, 27897 },
- { 32767, 12, 0, 0 },
- 0, 34, 495, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 126 */
- { 32767, 31730, 0, 31730 },
- { 32767, 380, 0, 0 },
- 0, 0, 495, 0, 3000, 10223, 0, 8, 0
- },
- { /* articulation 127 */
- { 63, 0, 32767, 32558 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 761, 0, 0, 11423, 4, 0, 0
- },
- { /* articulation 128 */
- { 476, 32595, 0, 32577 },
- { 32767, 10, 0, 0 },
- 0, 0, 495, 0, 0, 11423, 0, 0, 0
- },
- { /* articulation 129 */
- { 196, 0, 0, 31964 },
- { 95, 32767, 32767, 0 },
- 0, 0, 495, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 130 */
- { 32767, 31730, 0, 31730 },
- { 32767, 380, 0, 0 },
- 0, 0, 495, 1200, 0, 0, 0, 0, 0
- },
- { /* articulation 131 */
- { 32767, 32245, 0, 32349 },
- { 32767, 190, 0, 0 },
- 0, 0, 495, 50, 0, 0, 0, 0, 0
- },
- { /* articulation 132 */
- { 32767, 32418, 0, 32418 },
- { 32767, 9511, 0, 0 },
- 0, 0, 495, 0, 4700, 7769, 0, 0, 0
- },
- { /* articulation 133 */
- { 32767, 31391, 0, 31391 },
- { 32767, 19021, 0, 0 },
- 0, 0, 495, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 134 */
- { 32767, 32663, 32767, 32663 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 476, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 135 */
- { 32767, 32715, 18820, 23749 },
- { 32767, 95, 0, 0 },
- 10, 68, 476, 0, 2000, 10696, 0, 0, 0
- },
- { /* articulation 136 */
- { 32767, 32715, 10809, 23749 },
- { 32767, 95, 0, 0 },
- 12, 69, 491, 0, 0, 10910, 0, 0, 0
- },
- { /* articulation 137 */
- { 32767, 32715, 18820, 23749 },
- { 32767, 95, 0, 0 },
- 10, 69, 476, 0, 1200, 10218, 0, 0, 0
- },
- { /* articulation 138 */
- { 19021, 32715, 18820, 23749 },
- { 32767, 95, 0, 0 },
- 10, 69, 476, 0, 1100, 9525, 0, 0, 0
- },
- { /* articulation 139 */
- { 9511, 32663, 18820, 27897 },
- { 32767, 10, 0, 0 },
- 10, 69, 494, 0, 2000, 10962, 0, 0, 0
- },
- { /* articulation 140 */
- { 32767, 32558, 18820, 27897 },
- { 9511, 317, 0, 0 },
- 10, 63, 504, 0, 1200, 10090, 0, 0, 0
- },
- { /* articulation 141 */
- { 1268, 0, 32767, 30234 },
- { 951, 190, 0, 0 },
- 7, 69, 494, 0, 1620, 8933, 0, 0, 0
- },
- { /* articulation 142 */
- { 32767, 32558, 10809, 27897 },
- { 19021, 190, 0, 0 },
- 7, 69, 494, 0, 2200, 8994, 0, 0, 0
- },
- { /* articulation 143 */
- { 32767, 32715, 15076, 27897 },
- { 32767, 951, 0, 0 },
- 10, 69, 491, 0, 2500, 9525, 0, 0, 0
- },
- { /* articulation 144 */
- { 32767, 32715, 15076, 27897 },
- { 32767, 95, 0, 0 },
- 10, 69, 476, 0, 1500, 11423, 0, 0, 0
- },
- { /* articulation 145 */
- { 32767, 32715, 18820, 27897 },
- { 32767, 951, 0, 0 },
- 9, 69, 491, 0, 1500, 9521, 0, 0, 0
- },
- { /* articulation 146 */
- { 1902, 0, 32767, 30725 },
- { 32767, 32767, 32767, 0 },
- 0, 0, 761, 0, 0, 9521, 0, 0, 0
- },
- { /* articulation 147 */
- { 32767, 32663, 0, 27897 },
- { 32767, 9511, 0, 0 },
- 0, 34, 495, 0, 5000, 10223, 0, 0, 0
- },
- { /* articulation 148 */
- { 32767, 32715, 18820, 27897 },
- { 32767, 32, 0, 0 },
- 10, 69, 476, 0, 1500, 9907, 0, 0, 0
- },
- { /* articulation 149 */
- { 32767, 32733, 11682, 27897 },
- { 32767, 951, 0, 0 },
- 0, 69, 476, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 150 */
- { 32767, 32418, 0, 32418 },
- { 32767, 190, 0, 0 },
- 0, 34, 495, 0, 3440, 9260, 0, 0, 0
- },
- { /* articulation 151 */
- { 32767, 31476, 0, 31730 },
- { 32767, 951, 0, 0 },
- 0, 34, 495, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 152 */
- { 32767, 32245, 0, 31730 },
- { 32767, 190, 0, 0 },
- 0, 34, 495, 0, 4000, 7823, 0, 0, 0
- },
- { /* articulation 153 */
- { 32767, 32663, 3566, 27897 },
- { 391, 32767, 32767, 0 },
- 100, 0, 761, 500, 0, 11877, 0, 0, 0
- },
- { /* articulation 154 */
- { 32767, 32715, 18820, 23749 },
- { 32767, 951, 0, 0 },
- 8, 69, 495, -22, 0, 0, 0, 0, 0
- },
- { /* articulation 155 */
- { 9511, 30830, 6784, 27897 },
- { 32767, 951, 0, 0 },
- 0, 69, 476, 0, 5000, 9521, 1, 0, 0
- },
- { /* articulation 156 */
- { 32767, 32663, 0, 32349 },
- { 951, 127, 16384, 0 },
- 0, 103, 495, 0, 3627, 10547, 0, 5, 0
- },
- { /* articulation 157 */
- { 1902, 0, 32767, 27897 },
- { 951, 951, 0, 0 },
- 0, 69, 495, 27, 0, 11919, 0, 0, 0
- },
- { /* articulation 158 */
- { 32767, 0, 32767, 32245 },
- { 38, 33, 10092, 0 },
- 5, 0, 495, 0, 8007, 5535, 0, 8, 0
- },
- { /* articulation 159 */
- { 32767, 32618, 0, 31056 },
- { 32767, 63, 0, 0 },
- 0, 103, 495, 0, 2500, 9032, 0, 0, 0
- },
- { /* articulation 160 */
- { 4755, 32715, 10809, 28809 },
- { 32767, 32767, 32767, 0 },
- 0, 69, 495, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 161 */
- { 9511, 32663, 18820, 27897 },
- { 32767, 95, 0, 0 },
- 10, 69, 494, 0, 2600, 9513, 0, 0, 0
- },
- { /* articulation 162 */
- { 32767, 32435, 9568, 27897 },
- { 1174, 196, 0, 0 },
- 10, 103, 490, 0, 6500, 9023, 0, 0, 0
- },
- { /* articulation 163 */
- { 32767, 32663, 0, 29434 },
- { 32767, 32, 0, 0 },
- 0, 69, 495, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 164 */
- { 32767, 32418, 15076, 23749 },
- { 32767, 634, 0, 0 },
- 0, 0, 476, 0, 2000, 10223, 0, 0, 0
- },
- { /* articulation 165 */
- { 32767, 32663, 0, 27897 },
- { 32767, 190, 0, 0 },
- 0, 69, 495, 0, 3000, 9366, 0, 0, 0
- },
- { /* articulation 166 */
- { 32767, 32715, 18820, 27897 },
- { 951, 64, 10879, 0 },
- 0, 0, 495, 0, 6000, 7121, 0, 4, 0
- },
- { /* articulation 167 */
- { 32767, 32636, 0, 29434 },
- { 32767, 10, 0, 0 },
- 0, 103, 495, 0, 3500, 6236, 0, 5, 0
- },
- { /* articulation 168 */
- { 32767, 32636, 0, 29434 },
- { 32767, 95, 0, 0 },
- 0, 103, 495, 0, 2800, 7121, 0, 0, 0
- },
- { /* articulation 169 */
- { 32767, 32593, 0, 31056 },
- { 32767, 63, 0, 0 },
- 0, 103, 495, 0, 2100, 9626, 0, 0, 0
- },
- { /* articulation 170 */
- { 32767, 32558, 0, 31476 },
- { 32767, 63, 0, 0 },
- 0, 103, 495, 0, 3000, 9626, 0, 0, 0
- },
- { /* articulation 171 */
- { 32767, 32527, 0, 30506 },
- { 32767, 63, 0, 0 },
- 0, 103, 495, 0, 1000, 9032, 0, 0, 0
- },
- { /* articulation 172 */
- { 32767, 32418, 0, 30725 },
- { 32767, 63, 0, 0 },
- 0, 103, 495, 0, 1000, 9032, 0, 0, 0
- },
- { /* articulation 173 */
- { 1902, 32418, 15076, 23749 },
- { 32767, 634, 0, 0 },
- 0, 103, 496, 0, 0, 11107, 0, 8, 0
- },
- { /* articulation 174 */
- { 32767, 32558, 15076, 27897 },
- { 3804, 73, 0, 0 },
- 0, 0, 495, 0, 4500, 9521, 0, 8, 0
- },
- { /* articulation 175 */
- { 32767, 32715, 18820, 27897 },
- { 32767, 48, 0, 0 },
- 0, 0, 495, 0, 2000, 8321, 0, 8, 0
- },
- { /* articulation 176 */
- { 32767, 32742, 128, 31180 },
- { 32767, 865, 0, 0 },
- 0, 0, 495, 0, 6000, 7823, 0, 8, 0
- },
- { /* articulation 177 */
- { 9511, 32608, 0, 32322 },
- { 32767, 48, 0, 0 },
- 0, 0, 495, 0, 4500, 7121, 0, 8, 0
- },
- { /* articulation 178 */
- { 19021, 32664, 3646, 32436 },
- { 32767, 95, 0, 0 },
- 0, 0, 495, 0, 4000, 8321, 0, 8, 0
- },
- { /* articulation 179 */
- { 32767, 32685, 13644, 29434 },
- { 32767, 32, 0, 0 },
- 12, 69, 494, 0, 2000, 11107, 0, 0, 0
- },
- { /* articulation 180 */
- { 9511, 31605, 0, 27897 },
- { 32767, 951, 0, 0 },
- 0, 0, 495, 0, 5000, 8321, 1, 0, 0
- },
- { /* articulation 181 */
- { 130, 32617, 0, 32350 },
- { 32767, 317, 0, 0 },
- 0, 69, 476, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 182 */
- { 32767, 32593, 0, 32251 },
- { 1174, 20, 0, 0 },
- 0, 69, 495, 0, 3600, 7121, 0, 4, 0
- },
- { /* articulation 183 */
- { 32767, 32427, 0, 32427 },
- { 32767, 317, 0, 0 },
- 0, 69, 476, 0, 0, 0, 0, 0, 0
- },
- { /* articulation 184 */
- { 834, 32742, 19242, 31455 },
- { 32767, 148, 0, 0 },
- 0, 0, 778, 0, 3000, 9907, 0, 4, 0
- }
-}; /*end Articulations */
-
-/*----------------------------------------------------------------------------
- * Regions
- *----------------------------------------------------------------------------
-*/
-const S_WT_REGION eas_regions[] =
-{
- { { 0, 27, 27 }, -4068, 16422, 0, 0, 81, 0 }, /* region 0 */
- { { 0, 28, 28 }, -4768, 32767, 0, 0, 40, 0 }, /* region 1 */
- { { 0, 29, 29 }, -5753, 32767, 0, 0, 32, 1 }, /* region 2 */
- { { 0, 30, 30 }, -6053, 32767, 0, 0, 32, 2 }, /* region 3 */
- { { 0, 31, 31 }, -5068, 23197, 0, 0, 48, 3 }, /* region 4 */
- { { 1536, 32, 32 }, -4400, 20675, 0, 0, 137, 4 }, /* region 5 */
- { { 1537, 33, 33 }, -4903, 20675, 792, 879, 50, 5 }, /* region 6 */
- { { 1537, 34, 34 }, -5003, 16422, 792, 879, 50, 6 }, /* region 7 */
- { { 0, 35, 35 }, -6168, 32767, 0, 0, 83, 7 }, /* region 8 */
- { { 0, 36, 36 }, -6168, 32767, 0, 0, 83, 7 }, /* region 9 */
- { { 0, 37, 37 }, -5251, 18426, 0, 0, 53, 8 }, /* region 10 */
- { { 0, 38, 38 }, -5351, 23197, 0, 0, 16, 9 }, /* region 11 */
- { { 0, 39, 39 }, -4768, 32767, 0, 0, 40, 10 }, /* region 12 */
- { { 0, 40, 40 }, -5351, 23197, 0, 0, 16, 4 }, /* region 13 */
- { { 1, 41, 41 }, -7055, 26028, 798, 993, 45, 11 }, /* region 14 */
- { { 257, 42, 42 }, -5400, 26028, 4288, 7488, 7, 12 }, /* region 15 */
- { { 1, 43, 43 }, -6955, 26028, 798, 993, 45, 13 }, /* region 16 */
- { { 257, 44, 44 }, -5600, 26028, 4288, 7488, 7, 14 }, /* region 17 */
- { { 1, 45, 45 }, -6955, 26028, 798, 993, 45, 15 }, /* region 18 */
- { { 257, 46, 46 }, -5800, 26028, 4288, 7488, 7, 16 }, /* region 19 */
- { { 1, 47, 47 }, -6655, 26028, 798, 993, 45, 17 }, /* region 20 */
- { { 1, 48, 48 }, -6555, 26028, 798, 993, 45, 18 }, /* region 21 */
- { { 1, 49, 49 }, -6400, 16422, 1294, 5778, 8, 19 }, /* region 22 */
- { { 1, 50, 50 }, -6455, 26028, 798, 993, 45, 20 }, /* region 23 */
- { { 1, 51, 51 }, -6468, 16422, 6592, 9921, 6, 21 }, /* region 24 */
- { { 1, 52, 52 }, -6800, 32767, 1294, 5778, 8, 22 }, /* region 25 */
- { { 1, 53, 53 }, -6618, 14636, 6592, 9921, 6, 23 }, /* region 26 */
- { { 0, 54, 54 }, -6951, 26028, 0, 0, 39, 24 }, /* region 27 */
- { { 1, 55, 55 }, -6500, 32767, 1294, 5778, 8, 25 }, /* region 28 */
- { { 0, 56, 56 }, -8455, 32767, 0, 0, 90, 26 }, /* region 29 */
- { { 1, 57, 57 }, -6900, 32767, 1294, 5778, 8, 27 }, /* region 30 */
- { { 1, 58, 58 }, -8253, 23197, 0, 166, 113, 28 }, /* region 31 */
- { { 1, 59, 59 }, -7168, 16422, 6592, 9921, 6, 29 }, /* region 32 */
- { { 1, 60, 60 }, -7653, 23197, 432, 582, 63, 30 }, /* region 33 */
- { { 1, 61, 61 }, -8053, 16422, 432, 582, 63, 30 }, /* region 34 */
- { { 1, 62, 62 }, -8453, 20675, 432, 582, 63, 31 }, /* region 35 */
- { { 1, 63, 63 }, -8553, 23197, 432, 582, 63, 32 }, /* region 36 */
- { { 1, 64, 64 }, -9153, 23197, 432, 582, 63, 33 }, /* region 37 */
- { { 0, 65, 65 }, -8755, 32767, 0, 0, 14, 34 }, /* region 38 */
- { { 0, 66, 66 }, -9155, 20675, 0, 0, 14, 34 }, /* region 39 */
- { { 512, 67, 67 }, -8355, 18426, 0, 0, 90, 35 }, /* region 40 */
- { { 512, 68, 68 }, -8955, 18426, 0, 0, 90, 35 }, /* region 41 */
- { { 0, 69, 69 }, -8955, 32767, 0, 0, 86, 36 }, /* region 42 */
- { { 0, 70, 70 }, -8055, 21900, 0, 0, 86, 37 }, /* region 43 */
- { { 769, 71, 71 }, -7555, 23197, 0, 1226, 35, 38 }, /* region 44 */
- { { 769, 72, 72 }, -8155, 26028, 0, 1226, 35, 38 }, /* region 45 */
- { { 1024, 73, 73 }, -9155, 32767, 0, 0, 22, 39 }, /* region 46 */
- { { 1024, 74, 74 }, -9655, 32767, 0, 0, 22, 40 }, /* region 47 */
- { { 1, 75, 75 }, -9100, 23197, 0, 31, 139, 41 }, /* region 48 */
- { { 0, 76, 76 }, -11655, 23197, 0, 0, 134, 42 }, /* region 49 */
- { { 0, 77, 77 }, -11255, 23197, 0, 0, 134, 43 }, /* region 50 */
- { { 0, 78, 78 }, -10053, 16422, 0, 0, 89, 44 }, /* region 51 */
- { { 0, 79, 79 }, -11453, 16422, 0, 0, 89, 45 }, /* region 52 */
- { { 1281, 80, 80 }, -7500, 13045, 209, 230, 103, 46 }, /* region 53 */
- { { 1281, 81, 81 }, -7600, 16422, 209, 230, 103, 47 }, /* region 54 */
- { { 0, 82, 82 }, -9655, 20675, 0, 0, 87, 48 }, /* region 55 */
- { { 0, 83, 83 }, -10100, 32767, 0, 0, 13, 49 }, /* region 56 */
- { { 1, 84, 84 }, -9600, 23197, 0, 10294, 5, 50 }, /* region 57 */
- { { 0, 85, 85 }, -10855, 32767, 0, 0, 135, 4 }, /* region 58 */
- { { 0, 86, 86 }, -10268, 16422, 0, 0, 24, 51 }, /* region 59 */
- { { 32769, 87, 87 }, -10368, 32767, 1335, 1603, 24, 52 }, /* region 60 */
- { { 1, 12, 67 }, -7805, 23197, 437, 16584, 2, 48 }, /* region 61 */
- { { 1, 68, 73 }, -8396, 23197, 452, 16803, 0, 48 }, /* region 62 */
- { { 32769, 74, 108 }, -9667, 23197, 404, 16698, 1, 48 }, /* region 63 */
- { { 1, 12, 78 }, -7805, 16422, 437, 16584, 2, 48 }, /* region 64 */
- { { 1, 79, 91 }, -8396, 16422, 452, 16803, 0, 48 }, /* region 65 */
- { { 32769, 92, 108 }, -9667, 16422, 404, 16698, 1, 48 }, /* region 66 */
- { { 1, 12, 78 }, -7805, 16422, 437, 16584, 2, 48 }, /* region 67 */
- { { 1, 79, 91 }, -8396, 16422, 452, 16803, 0, 48 }, /* region 68 */
- { { 32769, 92, 108 }, -9667, 16422, 404, 16698, 1, 48 }, /* region 69 */
- { { 1, 12, 70 }, -7800, 23197, 437, 16584, 2, 48 }, /* region 70 */
- { { 1, 71, 88 }, -8391, 23197, 452, 16803, 0, 48 }, /* region 71 */
- { { 32769, 89, 108 }, -9662, 23197, 404, 16698, 1, 48 }, /* region 72 */
- { { 1, 12, 54 }, -7156, 13045, 639, 4368, 10, 48 }, /* region 73 */
- { { 32769, 55, 108 }, -7551, 18426, 702, 3112, 12, 48 }, /* region 74 */
- { { 1, 12, 66 }, -7811, 23197, 437, 16584, 2, 48 }, /* region 75 */
- { { 1, 67, 87 }, -8402, 23197, 452, 16803, 0, 48 }, /* region 76 */
- { { 32769, 88, 108 }, -9673, 16422, 404, 16698, 1, 48 }, /* region 77 */
- { { 1, 12, 43 }, -4255, 23197, 920, 1383, 30, 59 }, /* region 78 */
- { { 32769, 44, 96 }, -6260, 18426, 885, 1176, 37, 59 }, /* region 79 */
- { { 1, 12, 48 }, -4661, 18426, 1148, 1514, 26, 60 }, /* region 80 */
- { { 32769, 49, 96 }, -7453, 16422, 1347, 1420, 29, 60 }, /* region 81 */
- { { 1, 33, 56 }, -6800, 26028, 1064, 1170, 38, 61 }, /* region 82 */
- { { 1, 57, 72 }, -7200, 26028, 930, 1014, 44, 61 }, /* region 83 */
- { { 32769, 73, 108 }, -8800, 26028, 726, 826, 52, 61 }, /* region 84 */
- { { 1, 36, 96 }, -8800, 20675, 635, 735, 58, 62 }, /* region 85 */
- { { 32769, 97, 108 }, -11308, 13045, 0, 31, 139, 62 }, /* region 86 */
- { { 1, 36, 96 }, -8800, 14636, 635, 735, 58, 0 }, /* region 87 */
- { { 32769, 97, 108 }, -11308, 13045, 0, 31, 139, 0 }, /* region 88 */
- { { 1, 36, 83 }, -7206, 13045, 838, 922, 47, 63 }, /* region 89 */
- { { 1, 84, 93 }, -9606, 14636, 209, 230, 103, 63 }, /* region 90 */
- { { 32769, 94, 108 }, -11308, 13045, 0, 31, 139, 63 }, /* region 91 */
- { { 1, 36, 83 }, -7206, 13045, 838, 922, 47, 64 }, /* region 92 */
- { { 1, 84, 93 }, -9606, 13045, 209, 230, 103, 64 }, /* region 93 */
- { { 32769, 94, 108 }, -11308, 13045, 0, 31, 139, 64 }, /* region 94 */
- { { 1, 21, 56 }, -6795, 23197, 1064, 1170, 38, 65 }, /* region 95 */
- { { 1, 57, 72 }, -7195, 23197, 930, 1014, 44, 65 }, /* region 96 */
- { { 32769, 73, 108 }, -8798, 23197, 726, 826, 52, 65 }, /* region 97 */
- { { 1, 12, 83 }, -7206, 16422, 838, 922, 47, 66 }, /* region 98 */
- { { 1, 84, 93 }, -9606, 16422, 209, 230, 103, 66 }, /* region 99 */
- { { 32769, 94, 108 }, -11308, 16422, 0, 31, 139, 66 }, /* region 100 */
- { { 1, 24, 83 }, -7206, 16422, 838, 922, 47, 67 }, /* region 101 */
- { { 1, 84, 93 }, -9606, 16422, 209, 230, 103, 67 }, /* region 102 */
- { { 32769, 94, 108 }, -11308, 16422, 0, 31, 139, 67 }, /* region 103 */
- { { 1, 12, 83 }, -7220, 16422, 0, 83, 126, 68 }, /* region 104 */
- { { 1, 84, 90 }, -9682, 16422, 0, 20, 145, 68 }, /* region 105 */
- { { 32769, 91, 108 }, -10301, 16422, 6, 20, 147, 68 }, /* region 106 */
- { { 1, 21, 75 }, -8441, 16422, 419, 460, 76, 69 }, /* region 107 */
- { { 32769, 76, 108 }, -10890, 14636, 254, 264, 101, 69 }, /* region 108 */
- { { 32769, 36, 84 }, -8955, 16422, 0, 2775, 17, 70 }, /* region 109 */
- { { 32769, 12, 108 }, -7855, 23197, 30, 276, 100, 71 }, /* region 110 */
- { { 0, 12, 60 }, -9114, 26028, 0, 0, 15, 72 }, /* region 111 */
- { { 32768, 61, 96 }, -9114, 26028, 0, 0, 15, 73 }, /* region 112 */
- { { 1, 12, 65 }, -8253, 16422, 23, 10953, 4, 74 }, /* region 113 */
- { { 32769, 66, 108 }, -8955, 20675, 11, 11753, 3, 74 }, /* region 114 */
- { { 1, 12, 35 }, -6555, 16422, 2869, 3778, 11, 75 }, /* region 115 */
- { { 1, 36, 48 }, -7755, 20675, 2869, 3778, 11, 75 }, /* region 116 */
- { { 32769, 49, 72 }, -7755, 20675, 2869, 3778, 11, 76 }, /* region 117 */
- { { 1, 16, 55 }, -7424, 20675, 1045, 1119, 41, 77 }, /* region 118 */
- { { 32769, 56, 96 }, -7918, 20675, 907, 963, 46, 77 }, /* region 119 */
- { { 1, 16, 53 }, -7194, 29204, 1140, 1479, 27, 78 }, /* region 120 */
- { { 1, 54, 70 }, -8371, 29204, 726, 812, 55, 78 }, /* region 121 */
- { { 32769, 71, 108 }, -8988, 29204, 718, 748, 56, 78 }, /* region 122 */
- { { 1, 12, 65 }, -8253, 16422, 23, 10953, 4, 79 }, /* region 123 */
- { { 32769, 66, 108 }, -8955, 20675, 11, 11753, 3, 79 }, /* region 124 */
- { { 1, 16, 54 }, -6927, 20675, 5362, 5461, 9, 80 }, /* region 125 */
- { { 1, 55, 63 }, -7051, 26028, 1362, 1454, 28, 80 }, /* region 126 */
- { { 32769, 64, 108 }, -7944, 16422, 311, 366, 88, 80 }, /* region 127 */
- { { 1, 16, 48 }, -5998, 20675, 1132, 1301, 31, 81 }, /* region 128 */
- { { 32769, 49, 108 }, -7188, 20675, 1099, 1184, 36, 81 }, /* region 129 */
- { { 1, 21, 68 }, -9658, 20675, 87, 2170, 18, 82 }, /* region 130 */
- { { 1, 69, 82 }, -10160, 20675, 120, 2167, 19, 82 }, /* region 131 */
- { { 32769, 83, 108 }, -11360, 20675, 376, 2041, 20, 82 }, /* region 132 */
- { { 1, 12, 65 }, -8253, 16422, 23, 10953, 4, 83 }, /* region 133 */
- { { 32769, 66, 108 }, -8955, 20675, 11, 11753, 3, 83 }, /* region 134 */
- { { 32769, 55, 108 }, -8568, 20675, 0, 477, 75, 84 }, /* region 135 */
- { { 32769, 36, 96 }, -8100, 14636, 101, 151, 116, 85 }, /* region 136 */
- { { 1, 24, 83 }, -7220, 13045, 0, 83, 126, 86 }, /* region 137 */
- { { 1, 84, 90 }, -9682, 13045, 0, 20, 145, 86 }, /* region 138 */
- { { 32769, 91, 108 }, -10301, 13045, 6, 20, 147, 86 }, /* region 139 */
- { { 1, 12, 65 }, -8253, 16422, 23, 10953, 4, 87 }, /* region 140 */
- { { 32769, 66, 108 }, -8955, 20675, 11, 11753, 3, 87 }, /* region 141 */
- { { 1, 12, 65 }, -8253, 16422, 23, 10953, 4, 88 }, /* region 142 */
- { { 32769, 66, 108 }, -8955, 20675, 11, 11753, 3, 88 }, /* region 143 */
- { { 1, 12, 65 }, -8253, 16422, 23, 10953, 4, 89 }, /* region 144 */
- { { 32769, 66, 108 }, -8955, 20675, 11, 11753, 3, 89 }, /* region 145 */
- { { 1, 24, 83 }, -7220, 13045, 0, 83, 126, 90 }, /* region 146 */
- { { 1, 84, 90 }, -9682, 13045, 0, 20, 145, 90 }, /* region 147 */
- { { 32769, 91, 108 }, -10301, 13045, 6, 20, 147, 90 }, /* region 148 */
- { { 1, 12, 65 }, -8253, 16422, 23, 10953, 4, 91 }, /* region 149 */
- { { 32769, 66, 108 }, -8955, 20675, 11, 11753, 3, 91 }, /* region 150 */
- { { 1, 12, 65 }, -8253, 16422, 23, 10953, 4, 92 }, /* region 151 */
- { { 32769, 66, 108 }, -8955, 20675, 11, 11753, 3, 92 }, /* region 152 */
- { { 1, 12, 62 }, -8253, 16422, 23, 10953, 4, 93 }, /* region 153 */
- { { 32769, 63, 108 }, -8955, 20675, 11, 11753, 3, 93 }, /* region 154 */
- { { 1, 12, 62 }, -8253, 16422, 23, 10953, 4, 94 }, /* region 155 */
- { { 32769, 63, 108 }, -8955, 16422, 11, 11753, 3, 94 }, /* region 156 */
- { { 1, 24, 79 }, -7220, 13045, 0, 83, 126, 95 }, /* region 157 */
- { { 1, 80, 90 }, -9682, 13045, 0, 20, 145, 95 }, /* region 158 */
- { { 32769, 91, 108 }, -10301, 13045, 6, 20, 147, 95 }, /* region 159 */
- { { 1, 12, 65 }, -8253, 13045, 23, 10953, 4, 96 }, /* region 160 */
- { { 32769, 66, 108 }, -8955, 16422, 11, 11753, 3, 96 }, /* region 161 */
- { { 32768, 36, 84 }, -8700, 20675, 0, 0, 25, 97 }, /* region 162 */
- { { 32769, 36, 96 }, -10055, 20675, 1482, 1613, 23, 98 }, /* region 163 */
- { { 32769, 12, 96 }, -5566, 32767, 818, 1033, 42, 99 }, /* region 164 */
- { { 32769, 36, 84 }, -9768, 18426, 0, 293, 98, 100 }, /* region 165 */
- { { 32769, 12, 96 }, -7220, 26028, 0, 83, 125, 101 }, /* region 166 */
- { { 32769, 12, 96 }, -7220, 20675, 0, 83, 125, 102 }, /* region 167 */
- { { 1, 12, 83 }, -7220, 13045, 0, 83, 125, 104 }, /* region 168 */
- { { 1, 84, 90 }, -9682, 13045, 0, 20, 146, 104 }, /* region 169 */
- { { 32769, 91, 108 }, -10301, 13045, 6, 20, 148, 104 }, /* region 170 */
- { { 32769, 36, 108 }, -9770, 32767, 472, 491, 74, 105 }, /* region 171 */
- { { 32769, 36, 108 }, -9770, 20675, 472, 491, 74, 106 }, /* region 172 */
- { { 1, 12, 72 }, -7212, 7336, 2, 86, 124, 107 }, /* region 173 */
- { { 1, 73, 101 }, -9700, 8231, 2, 22, 143, 107 }, /* region 174 */
- { { 32769, 102, 108 }, -10883, 20675, 173, 183, 110, 107 }, /* region 175 */
- { { 1, 21, 96 }, -8968, 13045, 477, 507, 73, 108 }, /* region 176 */
- { { 32769, 97, 108 }, -10883, 13045, 173, 183, 110, 109 }, /* region 177 */
- { { 32769, 12, 108 }, -8971, 16422, 477, 507, 73, 110 }, /* region 178 */
- { { 1, 12, 53 }, -6171, 16422, 388, 541, 68, 111 }, /* region 179 */
- { { 32769, 54, 60 }, -7149, 11626, 473, 560, 65, 111 }, /* region 180 */
- { { 32769, 36, 72 }, -7149, 16422, 473, 560, 65, 112 }, /* region 181 */
- { { 1, 48, 58 }, -8253, 16422, 356, 402, 82, 113 }, /* region 182 */
- { { 1, 59, 65 }, -8774, 16422, 514, 548, 67, 113 }, /* region 183 */
- { { 1, 66, 78 }, -9374, 16422, 505, 529, 71, 113 }, /* region 184 */
- { { 32769, 79, 96 }, -10433, 16422, 178, 191, 109, 113 }, /* region 185 */
- { { 1, 55, 60 }, -8253, 16422, 356, 402, 82, 114 }, /* region 186 */
- { { 1, 61, 69 }, -8774, 16422, 514, 548, 67, 114 }, /* region 187 */
- { { 1, 70, 79 }, -9374, 16422, 505, 529, 71, 114 }, /* region 188 */
- { { 32769, 80, 108 }, -10433, 16422, 178, 191, 109, 114 }, /* region 189 */
- { { 1, 16, 82 }, -9229, 23197, 180, 206, 106, 115 }, /* region 190 */
- { { 32769, 83, 108 }, -8440, 18426, 3, 44, 131, 115 }, /* region 191 */
- { { 32769, 21, 108 }, -10069, 20675, 483, 515, 72, 116 }, /* region 192 */
- { { 1, 21, 89 }, -8405, 18426, 3, 45, 130, 117 }, /* region 193 */
- { { 32769, 90, 108 }, -10301, 10362, 6, 20, 148, 117 }, /* region 194 */
- { { 1, 21, 42 }, -5886, 20675, 0, 180, 111, 118 }, /* region 195 */
- { { 1, 43, 51 }, -6486, 23197, 0, 127, 120, 118 }, /* region 196 */
- { { 1, 52, 58 }, -7492, 26028, 0, 71, 127, 118 }, /* region 197 */
- { { 1, 59, 68 }, -8668, 23197, 0, 36, 136, 118 }, /* region 198 */
- { { 32769, 69, 108 }, -9774, 20675, 0, 19, 149, 118 }, /* region 199 */
- { { 1, 21, 89 }, -8399, 20675, 3, 45, 130, 119 }, /* region 200 */
- { { 32769, 90, 108 }, -10301, 14636, 6, 20, 148, 119 }, /* region 201 */
- { { 1, 21, 46 }, -6851, 26028, 236, 340, 92, 120 }, /* region 202 */
- { { 1, 47, 71 }, -7763, 20675, 824, 885, 49, 120 }, /* region 203 */
- { { 1, 72, 88 }, -9107, 18426, 719, 747, 57, 120 }, /* region 204 */
- { { 1, 89, 93 }, -10076, 16422, 83, 99, 122, 120 }, /* region 205 */
- { { 32769, 94, 108 }, -10889, 16422, 173, 183, 110, 120 }, /* region 206 */
- { { 1, 60, 71 }, -8405, 16422, 0, 42, 132, 121 }, /* region 207 */
- { { 1, 72, 78 }, -9103, 16422, 0, 28, 141, 121 }, /* region 208 */
- { { 32769, 79, 96 }, -9605, 16422, 0, 21, 144, 121 }, /* region 209 */
- { { 1, 48, 65 }, -7516, 11626, 0, 70, 128, 122 }, /* region 210 */
- { { 1, 66, 79 }, -8924, 14636, 0, 31, 138, 122 }, /* region 211 */
- { { 32769, 80, 96 }, -9230, 11626, 0, 26, 142, 122 }, /* region 212 */
- { { 1, 16, 44 }, -7068, 14636, 163, 254, 102, 123 }, /* region 213 */
- { { 1, 45, 51 }, -7618, 16422, 261, 393, 85, 123 }, /* region 214 */
- { { 1, 52, 58 }, -8533, 18426, 190, 229, 104, 123 }, /* region 215 */
- { { 1, 59, 66 }, -9300, 18426, 168, 193, 108, 123 }, /* region 216 */
- { { 1, 67, 70 }, -9776, 18426, 138, 157, 115, 123 }, /* region 217 */
- { { 1, 71, 80 }, -10303, 18426, 166, 180, 112, 123 }, /* region 218 */
- { { 32769, 81, 108 }, -11274, 18426, 135, 151, 117, 123 }, /* region 219 */
- { { 32769, 12, 96 }, -6204, 23197, 570, 719, 59, 124 }, /* region 220 */
- { { 1, 12, 48 }, -7068, 14636, 163, 254, 102, 125 }, /* region 221 */
- { { 1, 49, 54 }, -7618, 16422, 261, 393, 85, 125 }, /* region 222 */
- { { 1, 55, 63 }, -8533, 18426, 190, 229, 104, 125 }, /* region 223 */
- { { 1, 64, 70 }, -9300, 18426, 168, 193, 108, 125 }, /* region 224 */
- { { 1, 71, 75 }, -9776, 18426, 138, 157, 115, 125 }, /* region 225 */
- { { 1, 76, 82 }, -10303, 18426, 166, 180, 112, 125 }, /* region 226 */
- { { 32769, 83, 108 }, -11274, 18426, 135, 151, 117, 125 }, /* region 227 */
- { { 32770, 36, 84 }, -8400, 29204, 0, 0, 0, 126 }, /* region 228 */
- { { 32770, 36, 84 }, -8800, 8231, 0, 0, 0, 127 }, /* region 229 */
- { { 32770, 36, 84 }, -8400, 20675, 0, 0, 0, 128 }, /* region 230 */
- { { 32769, 36, 84 }, -7200, -24285, 1294, 5778, 8, 129 }, /* region 231 */
- { { 32769, 36, 84 }, -7755, 29204, 798, 993, 45, 130 }, /* region 232 */
- { { 32769, 36, 84 }, -8055, 20675, 798, 993, 45, 131 }, /* region 233 */
- { { 32769, 36, 84 }, -8955, 29204, 798, 993, 45, 132 }, /* region 234 */
- { { 32768, 36, 84 }, -9355, 32767, 0, 0, 133, 133 }, /* region 235 */
- { { 32768, 36, 84 }, -7755, 20675, 0, 0, 91, 134 }, /* region 236 */
- { { 1, 24, 62 }, -8200, 23197, 286, 333, 94, 135 }, /* region 237 */
- { { 1, 63, 66 }, -8564, 26028, 297, 335, 93, 135 }, /* region 238 */
- { { 1, 67, 72 }, -8922, 23197, 368, 399, 84, 135 }, /* region 239 */
- { { 32769, 73, 96 }, -9510, 23197, 116, 138, 119, 135 }, /* region 240 */
- { { 1, 24, 48 }, -6341, 23197, 309, 447, 77, 136 }, /* region 241 */
- { { 1, 49, 56 }, -7466, 26028, 211, 283, 99, 136 }, /* region 242 */
- { { 1, 57, 63 }, -8200, 26028, 286, 333, 94, 136 }, /* region 243 */
- { { 32769, 64, 84 }, -8922, 23197, 368, 399, 84, 136 }, /* region 244 */
- { { 1, 24, 56 }, -7466, 29204, 211, 283, 99, 137 }, /* region 245 */
- { { 1, 57, 63 }, -8200, 29204, 286, 333, 94, 137 }, /* region 246 */
- { { 1, 64, 69 }, -8922, 29204, 368, 399, 84, 137 }, /* region 247 */
- { { 32769, 70, 96 }, -9510, 29204, 116, 138, 119, 137 }, /* region 248 */
- { { 1, 24, 68 }, -8922, 18426, 368, 399, 84, 138 }, /* region 249 */
- { { 1, 69, 76 }, -9510, 26028, 116, 138, 119, 138 }, /* region 250 */
- { { 32769, 77, 108 }, -9958, 23197, 127, 144, 118, 138 }, /* region 251 */
- { { 1, 24, 82 }, -8813, 23197, 389, 422, 80, 139 }, /* region 252 */
- { { 32769, 83, 108 }, -9964, 26028, 146, 163, 114, 139 }, /* region 253 */
- { { 1, 12, 58 }, -8098, 29204, 386, 436, 78, 140 }, /* region 254 */
- { { 32769, 59, 96 }, -8571, 26028, 290, 328, 95, 140 }, /* region 255 */
- { { 1, 12, 58 }, -8098, 16422, 386, 436, 78, 141 }, /* region 256 */
- { { 32769, 59, 96 }, -8571, 18426, 290, 328, 95, 141 }, /* region 257 */
- { { 1, 12, 48 }, -8098, -28771, 386, 436, 78, 142 }, /* region 258 */
- { { 32769, 49, 84 }, -8571, 29204, 290, 328, 95, 142 }, /* region 259 */
- { { 1, 12, 60 }, -6653, 20675, 314, 430, 79, 143 }, /* region 260 */
- { { 32769, 61, 84 }, -7753, 18426, 263, 324, 96, 143 }, /* region 261 */
- { { 1, 24, 60 }, -7753, 16422, 263, 324, 96, 144 }, /* region 262 */
- { { 1, 61, 70 }, -8869, 20675, 279, 311, 97, 144 }, /* region 263 */
- { { 32769, 71, 96 }, -9298, 23197, 179, 204, 107, 144 }, /* region 264 */
- { { 1, 24, 84 }, -9683, 20675, 191, 211, 105, 145 }, /* region 265 */
- { { 32769, 85, 108 }, -10883, 20675, 92, 102, 121, 145 }, /* region 266 */
- { { 1, 21, 69 }, -7753, 13045, 263, 324, 96, 146 }, /* region 267 */
- { { 1, 70, 94 }, -8869, 20675, 279, 311, 97, 146 }, /* region 268 */
- { { 1, 95, 96 }, -9298, -24285, 179, 204, 107, 146 }, /* region 269 */
- { { 32769, 97, 108 }, -10883, -24285, 173, 183, 110, 146 }, /* region 270 */
- { { 1, 16, 55 }, -9300, 20675, 168, 193, 108, 147 }, /* region 271 */
- { { 1, 56, 74 }, -9776, 26028, 138, 157, 115, 147 }, /* region 272 */
- { { 32769, 75, 96 }, -11274, 26028, 135, 151, 117, 147 }, /* region 273 */
- { { 1, 24, 72 }, -9298, 26028, 179, 204, 107, 148 }, /* region 274 */
- { { 1, 73, 85 }, -9683, 20675, 191, 211, 105, 148 }, /* region 275 */
- { { 32769, 86, 108 }, -10883, 18426, 92, 102, 121, 148 }, /* region 276 */
- { { 32769, 36, 108 }, -8930, 18426, 1839, 1901, 21, 149 }, /* region 277 */
- { { 32769, 24, 108 }, -8473, 20675, 494, 534, 69, 150 }, /* region 278 */
- { { 32769, 12, 108 }, -8473, 20675, 494, 534, 69, 151 }, /* region 279 */
- { { 32769, 24, 108 }, -8473, 20675, 494, 534, 69, 152 }, /* region 280 */
- { { 1, 36, 60 }, -6100, 5193, 2, 22, 143, 153 }, /* region 281 */
- { { 32769, 61, 84 }, -7283, 20675, 173, 183, 110, 153 }, /* region 282 */
- { { 32769, 24, 96 }, -7753, 14636, 263, 324, 96, 154 }, /* region 283 */
- { { 32769, 36, 96 }, -8930, 26028, 1839, 1901, 21, 155 }, /* region 284 */
- { { 32769, 24, 108 }, -8473, 20675, 494, 534, 69, 156 }, /* region 285 */
- { { 1, 24, 58 }, -9051, 14636, 0, 29, 140, 157 }, /* region 286 */
- { { 32769, 59, 96 }, -9051, 14636, 0, 29, 140, 157 }, /* region 287 */
- { { 1, 12, 83 }, -7220, 13045, 0, 83, 125, 158 }, /* region 288 */
- { { 1, 84, 90 }, -9682, 13045, 0, 20, 146, 158 }, /* region 289 */
- { { 32769, 91, 108 }, -10301, 13045, 6, 20, 148, 158 }, /* region 290 */
- { { 1, 21, 42 }, -5863, 26028, 1047, 1229, 34, 159 }, /* region 291 */
- { { 1, 43, 48 }, -6656, 29204, 1138, 1253, 33, 159 }, /* region 292 */
- { { 1, 49, 53 }, -7045, 26028, 559, 651, 60, 159 }, /* region 293 */
- { { 1, 54, 60 }, -7932, 26028, 508, 563, 64, 159 }, /* region 294 */
- { { 1, 61, 65 }, -8280, 32767, 819, 864, 51, 159 }, /* region 295 */
- { { 1, 66, 70 }, -8066, 26942, 981, 1032, 43, 159 }, /* region 296 */
- { { 1, 71, 76 }, -9366, 26028, 790, 814, 54, 159 }, /* region 297 */
- { { 1, 77, 82 }, -9966, 26028, 592, 609, 61, 159 }, /* region 298 */
- { { 1, 83, 87 }, -10717, 23197, 543, 554, 66, 159 }, /* region 299 */
- { { 1, 88, 96 }, -11271, 18426, 601, 609, 62, 159 }, /* region 300 */
- { { 32769, 97, 108 }, -11766, 18426, 523, 529, 70, 159 }, /* region 301 */
- { { 1, 48, 69 }, -7513, 14636, 0, 70, 128, 160 }, /* region 302 */
- { { 1, 70, 79 }, -8924, 18426, 0, 31, 138, 160 }, /* region 303 */
- { { 32769, 80, 96 }, -9230, 14636, 0, 26, 142, 160 }, /* region 304 */
- { { 1, 36, 72 }, -8334, 29204, 0, 87, 123, 161 }, /* region 305 */
- { { 32769, 73, 96 }, -9160, 29204, 0, 54, 129, 161 }, /* region 306 */
- { { 32769, 36, 96 }, -8930, 26028, 1839, 1901, 21, 162 }, /* region 307 */
- { { 32769, 12, 96 }, -5572, 32767, 818, 1033, 42, 163 }, /* region 308 */
- { { 32769, 36, 108 }, -9770, 26028, 472, 491, 74, 164 }, /* region 309 */
- { { 32769, 12, 96 }, -6204, 29204, 570, 719, 59, 165 }, /* region 310 */
- { { 1, 12, 83 }, -7220, 13045, 0, 83, 125, 166 }, /* region 311 */
- { { 1, 84, 90 }, -9682, 13045, 0, 20, 146, 166 }, /* region 312 */
- { { 32769, 91, 108 }, -10301, 13045, 6, 20, 148, 166 }, /* region 313 */
- { { 1, 21, 46 }, -6851, 32767, 236, 340, 92, 167 }, /* region 314 */
- { { 1, 47, 75 }, -7763, 26028, 824, 885, 49, 167 }, /* region 315 */
- { { 1, 76, 84 }, -9107, 23197, 719, 747, 57, 167 }, /* region 316 */
- { { 1, 85, 93 }, -10076, 20675, 83, 99, 122, 167 }, /* region 317 */
- { { 32769, 94, 108 }, -10889, 20675, 173, 183, 110, 167 }, /* region 318 */
- { { 1, 21, 46 }, -6851, 26028, 236, 340, 92, 168 }, /* region 319 */
- { { 1, 47, 71 }, -7763, 20675, 824, 885, 49, 168 }, /* region 320 */
- { { 1, 72, 88 }, -9107, 18426, 719, 747, 57, 168 }, /* region 321 */
- { { 1, 89, 93 }, -10076, 16422, 83, 99, 122, 168 }, /* region 322 */
- { { 32769, 94, 108 }, -10889, 16422, 173, 183, 110, 168 }, /* region 323 */
- { { 1, 21, 45 }, -5863, 26028, 1047, 1229, 34, 169 }, /* region 324 */
- { { 1, 46, 51 }, -6656, 29204, 1138, 1253, 33, 169 }, /* region 325 */
- { { 1, 52, 54 }, -7045, 26028, 559, 651, 60, 169 }, /* region 326 */
- { { 1, 55, 63 }, -7932, 26028, 508, 563, 64, 169 }, /* region 327 */
- { { 1, 64, 68 }, -8280, 32767, 819, 864, 51, 169 }, /* region 328 */
- { { 1, 69, 73 }, -8066, 26942, 981, 1032, 43, 169 }, /* region 329 */
- { { 1, 74, 79 }, -9366, 26028, 790, 814, 54, 169 }, /* region 330 */
- { { 1, 80, 88 }, -9966, 23197, 592, 609, 61, 169 }, /* region 331 */
- { { 1, 89, 99 }, -11271, 18426, 601, 609, 62, 169 }, /* region 332 */
- { { 32769, 100, 108 }, -11766, 18426, 523, 529, 70, 169 }, /* region 333 */
- { { 1, 21, 45 }, -5863, 26028, 1047, 1229, 34, 170 }, /* region 334 */
- { { 1, 46, 51 }, -6656, 29204, 1138, 1253, 33, 170 }, /* region 335 */
- { { 1, 52, 54 }, -7045, 26028, 559, 651, 60, 170 }, /* region 336 */
- { { 1, 55, 63 }, -7932, 26028, 508, 563, 64, 170 }, /* region 337 */
- { { 1, 64, 68 }, -8280, 32767, 819, 864, 51, 170 }, /* region 338 */
- { { 1, 69, 73 }, -8066, 26942, 981, 1032, 43, 170 }, /* region 339 */
- { { 1, 74, 79 }, -9366, 26028, 790, 814, 54, 170 }, /* region 340 */
- { { 1, 80, 88 }, -9966, 23197, 592, 609, 61, 170 }, /* region 341 */
- { { 1, 89, 99 }, -11271, 18426, 601, 609, 62, 171 }, /* region 342 */
- { { 32769, 100, 108 }, -11766, 18426, 523, 529, 70, 172 }, /* region 343 */
- { { 32769, 36, 108 }, -9770, 20675, 472, 491, 74, 173 }, /* region 344 */
- { { 32769, 12, 108 }, -8930, 20675, 1839, 1901, 21, 174 }, /* region 345 */
- { { 1, 12, 44 }, -7068, 18426, 163, 254, 102, 175 }, /* region 346 */
- { { 1, 45, 51 }, -7618, 20675, 261, 393, 85, 175 }, /* region 347 */
- { { 1, 52, 58 }, -8533, 23197, 190, 229, 104, 175 }, /* region 348 */
- { { 1, 59, 66 }, -9300, 23197, 168, 193, 108, 175 }, /* region 349 */
- { { 1, 67, 70 }, -9776, 23197, 138, 157, 115, 175 }, /* region 350 */
- { { 1, 71, 80 }, -10303, 23197, 166, 180, 112, 175 }, /* region 351 */
- { { 32769, 81, 108 }, -11274, 23197, 135, 151, 117, 175 }, /* region 352 */
- { { 1, 12, 65 }, -8253, 16422, 23, 10953, 4, 176 }, /* region 353 */
- { { 32769, 66, 108 }, -8955, 20675, 11, 11753, 3, 176 }, /* region 354 */
- { { 1, 12, 48 }, -5998, 29204, 1132, 1301, 31, 177 }, /* region 355 */
- { { 32769, 49, 108 }, -7188, 29204, 1099, 1184, 36, 177 }, /* region 356 */
- { { 1, 12, 83 }, -8441, 20675, 419, 460, 76, 178 }, /* region 357 */
- { { 32769, 84, 108 }, -11323, 20675, 0, 31, 139, 178 }, /* region 358 */
- { { 1, 55, 60 }, -8253, 18426, 356, 402, 82, 179 }, /* region 359 */
- { { 1, 61, 69 }, -8774, 18426, 514, 548, 67, 179 }, /* region 360 */
- { { 1, 70, 79 }, -9374, 18426, 505, 529, 71, 179 }, /* region 361 */
- { { 32769, 80, 108 }, -10433, 23197, 178, 191, 109, 179 }, /* region 362 */
- { { 32769, 36, 96 }, -8930, -24285, 1839, 1901, 21, 180 }, /* region 363 */
- { { 1, 12, 83 }, -7206, 16422, 838, 922, 47, 181 }, /* region 364 */
- { { 1, 84, 93 }, -9606, 18426, 209, 230, 103, 181 }, /* region 365 */
- { { 32769, 94, 108 }, -11308, 16422, 0, 31, 139, 181 }, /* region 366 */
- { { 1, 12, 56 }, -6795, 23197, 1064, 1170, 38, 182 }, /* region 367 */
- { { 1, 57, 72 }, -7195, 23197, 930, 1014, 44, 182 }, /* region 368 */
- { { 32769, 73, 108 }, -8798, 23197, 726, 826, 52, 182 }, /* region 369 */
- { { 32769, 24, 108 }, -8800, 23197, 635, 735, 58, 62 }, /* region 370 */
- { { 1, 36, 83 }, -7206, 13045, 838, 922, 47, 183 }, /* region 371 */
- { { 1, 84, 93 }, -9606, 13045, 209, 230, 103, 183 }, /* region 372 */
- { { 32769, 94, 108 }, -11308, 13045, 0, 31, 139, 183 }, /* region 373 */
- { { 1, 12, 66 }, -7811, 23197, 437, 16584, 2, 184 }, /* region 374 */
- { { 1, 67, 87 }, -8402, 23197, 452, 16803, 0, 184 }, /* region 375 */
- { { 32769, 88, 108 }, -9673, 16422, 404, 16698, 1, 184 } /* region 376 */
-}; /* end Regions */
-
-/*----------------------------------------------------------------------------
- * Programs
- *----------------------------------------------------------------------------
-*/
-const S_PROGRAM eas_programs[] =
-{
- { 7864320, 0 } /* program 0 */
-}; /* end Programs */
-
-/*----------------------------------------------------------------------------
- * Banks
- *----------------------------------------------------------------------------
-*/
-const S_BANK eas_banks[] =
-{
- { /* bank 0 */
- 30976,
- {
- 291, 324, 314, 334, 202, 319, 95, 195,
- 107, 92, 371, 89, 87, 85, 135, 82,
- 200, 192, 130, 267, 193, 302, 207, 210,
- 128, 125, 190, 120, 118, 213, 221, 271,
- 80, 78, 308, 164, 220, 310, 166, 167,
- 186, 182, 181, 179, 160, 178, 176, 115,
- 155, 153, 151, 149, 75, 73, 374, 111,
- 252, 254, 258, 305, 256, 157, 146, 137,
- 249, 237, 245, 241, 274, 262, 260, 265,
- 172, 171, 309, 277, 284, 307, 136, 344,
- 173, 168, 345, 353, 346, 70, 110, 311,
- 357, 144, 104, 67, 364, 367, 64, 288,
- 142, 140, 98, 355, 133, 123, 61, 113,
- 285, 280, 279, 278, 370, 286, 359, 283,
- 101, 236, 163, 235, 234, 233, 232, 231,
- 162, 363, 230, 281, 165, 229, 109, 228
- }
- }
-}; /* end Banks */
-
-/*----------------------------------------------------------------------------
- * Samples
- *----------------------------------------------------------------------------
-*/
-
-const EAS_SAMPLE eas_samples[] =
-{
- 0, 0, -3, -4, -6, -8, -10, -12, -12, -11, -8, -3, 3, 7, 10, 14,
- 16, 16, 15, 12, 9, 4, -4, -12, -18, -21, -21, -19, -18, -15, -10, -3,
- 10, 20, 34, 44, 51, 52, 48, 43, 38, 26, 8, -15, -37, -52, -61, -64,
- -66, -64, -59, -47, -31, -13, 4, 18, 30, 37, 40, 36, 30, 24, 19, 11,
- -2, -17, -24, -28, -28, -21, -18, -16, -10, -3, 12, 27, 39, 49, 53, 53,
- 50, 43, 37, 25, 11, -11, -31, -46, -57, -63, -66, -63, -57, -46, -34, -19,
- -3, 13, 27, 35, 39, 37, 32, 26, 20, 11, 0, -13, -20, -24, -25, -21,
- -19, -14, -8, -2, 9, 23, 37, 47, 53, 52, 49, 42, 35, 25, 13, -6,
- -28, -48, -60, -67, -67, -64, -60, -51, -39, -23, -7, 10, 23, 35, 39, 38,
- 32, 26, 21, 15, 4, -9, -20, -22, -21, -19, -14, -11, -5, 1, 9, 19,
- 31, 45, 51, 52, 47, 39, 35, 25, 15, -3, -23, -42, -58, -70, -71, -66,
- -60, -51, -43, -30, -13, 6, 22, 32, 40, 40, 38, 33, 27, 19, 9, -5,
- -17, -25, -26, -22, -16, -11, -8, -4, 7, 21, 35, 48, 53, 56, 50, 43,
- 34, 22, 13, -2, -22, -44, -63, -75, -76, -69, -61, -51, -43, -29, -13, 6,
- 23, 32, 41, 43, 41, 37, 26, 18, 7, -8, -19, -25, -25, -22, -15, -9,
- -5, 0, 10, 24, 37, 44, 48, 52, 52, 46, 33, 20, 8, -5, -20, -38,
- -59, -74, -79, -73, -67, -55, -43, -26, -11, 4, 18, 29, 41, 45, 45, 38,
- 29, 21, 11, -3, -15, -25, -27, -22, -16, -11, -8, 0, 10, 25, 38, 44,
- 47, 50, 53, 49, 37, 20, 7, -5, -17, -34, -58, -74, -82, -76, -67, -59,
- -47, -29, -12, 3, 14, 25, 38, 50, 52, 46, 33, 23, 14, 3, -11, -25,
- -28, -27, -21, -16, -13, -7, 8, 27, 41, 44, 45, 47, 54, 55, 44, 25,
- 7, -7, -18, -32, -53, -71, -81, -81, -72, -67, -55, -37, -16, 3, 15, 23,
- 34, 48, 57, 56, 44, 30, 19, 5, -12, -26, -33, -31, -25, -19, -16, -11,
- 7, 25, 45, 49, 49, 52, 57, 59, 48, 32, 11, -5, -22, -39, -56, -73,
- -82, -88, -84, -75, -60, -38, -16, 5, 21, 30, 39, 52, 59, 61, 53, 37,
- 22, 7, -12, -28, -35, -36, -30, -22, -19, -16, -2, 21, 41, 52, 51, 52,
- 57, 62, 54, 40, 18, -2, -18, -36, -54, -70, -80, -86, -87, -81, -69, -48,
- -23, 0, 18, 28, 35, 45, 57, 64, 59, 46, 27, 9, -11, -24, -30, -32,
- -29, -25, -20, -16, -5, 15, 36, 47, 50, 49, 53, 57, 54, 43, 24, 5,
- -14, -32, -50, -65, -75, -82, -86, -86, -77, -58, -32, -8, 14, 25, 30, 41,
- 56, 69, 69, 57, 36, 17, -4, -20, -29, -32, -27, -28, -27, -23, -13, 10,
- 33, 46, 50, 48, 50, 54, 55, 48, 34, 16, -6, -29, -50, -68, -75, -78,
- -82, -86, -84, -72, -47, -16, 11, 28, 34, 41, 51, 64, 70, 64, 49, 27,
- 5, -17, -30, -33, -29, -29, -30, -30, -22, -2, 23, 41, 49, 51, 51, 54,
- 56, 50, 42, 25, 4, -20, -44, -62, -70, -76, -83, -87, -89, -78, -56, -29,
- 0, 19, 31, 38, 48, 63, 72, 71, 60, 40, 14, -12, -25, -29, -26, -27,
- -33, -37, -30, -12, 11, 31, 41, 48, 51, 53, 55, 55, 51, 39, 17, -12,
- -38, -58, -67, -74, -82, -92, -98, -89, -69, -41, -13, 10, 29, 41, 50, 64,
- 72, 78, 74, 57, 29, 0, -18, -26, -28, -32, -38, -42, -38, -23, -3, 18,
- 30, 42, 52, 58, 60, 61, 57, 48, 28, 2, -30, -51, -62, -70, -81, -94,
- -101, -93, -75, -49, -23, -2, 18, 36, 50, 61, 69, 77, 78, 66, 42, 11,
- -11, -22, -27, -32, -39, -46, -46, -36, -14, 8, 25, 41, 52, 59, 62, 63,
- 62, 57, 38, 11, -20, -47, -61, -69, -78, -89, -98, -94, -80, -60, -37, -12,
- 13, 33, 48, 62, 70, 78, 81, 72, 52, 23, 0, -14, -24, -33, -43, -49,
- -49, -39, -23, -2, 15, 33, 47, 57, 63, 62, 62, 57, 40, 20, -7, -34,
- -52, -65, -74, -83, -94, -92, -81, -63, -42, -22, 0, 21, 39, 54, 63, 73,
- 79, 76, 61, 37, 12, -5, -19, -28, -37, -46, -51, -47, -32, -13, 7, 25,
- 43, 54, 58, 60, 60, 61, 48, 27, 3, -25, -45, -60, -72, -81, -90, -92,
- -84, -71, -52, -32, -9, 14, 33, 50, 61, 74, 80, 78, 67, 47, 24, 6,
- -12, -26, -37, -50, -56, -52, -37, -19, -2, 16, 35, 52, 61, 63, 61, 59,
- 51, 35, 12, -15, -38, -55, -66, -77, -83, -83, -80, -68, -55, -39, -19, 4,
- 25, 41, 54, 66, 73, 75, 68, 52, 31, 11, -7, -22, -33, -46, -54, -51,
- -39, -24, -5, 12, 32, 48, 56, 60, 61, 58, 50, 36, 17, -8, -30, -46,
- -63, -74, -80, -80, -74, -69, -58, -43, -27, -5, 15, 31, 48, 60, 68, 72,
- 68, 57, 39, 20, 2, -16, -30, -44, -51, -50, -41, -27, -10, 9, 28, 43,
- 53, 57, 57, 54, 48, 37, 19, -3, -25, -41, -56, -69, -75, -73, -69, -63,
- -59, -49, -32, -13, 9, 25, 37, 48, 58, 66, 65, 58, 42, 25, 8, -9,
- -22, -36, -41, -43, -37, -26, -14, 4, 21, 37, 48, 52, 53, 47, 42, 34,
- 21, 3, -18, -39, -51, -64, -67, -62, -60, -60, -58, -50, -36, -16, 3, 17,
- 29, 41, 49, 58, 61, 60, 49, 29, 11, -7, -19, -28, -32, -33, -30, -25,
- -14, 2, 19, 33, 41, 45, 42, 38, 36, 29, 20, 6, -14, -28, -43, -54,
- -58, -55, -50, -51, -54, -51, -41, -22, -4, 11, 19, 30, 37, 47, 55, 56,
- 51, 34, 16, 0, -15, -19, -23, -22, -22, -21, -14, 0, 15, 29, 39, 43,
- 37, 31, 25, 21, 18, 6, -11, -28, -42, -50, -51, -48, -44, -41, -44, -43,
- -41, -25, -8, 9, 16, 22, 26, 35, 43, 50, 48, 33, 16, -3, -13, -16,
- -16, -15, -13, -11, -6, 5, 16, 28, 38, 41, 35, 24, 15, 12, 10, 4,
- -11, -27, -39, -46, -46, -45, -40, -36, -36, -37, -38, -29, -13, 6, 16, 19,
- 22, 27, 37, 43, 42, 32, 19, 2, -10, -13, -12, -7, -4, -2, 2, 10,
- 18, 27, 36, 38, 32, 20, 9, 4, -2, -4, -11, -23, -34, -42, -42, -38,
- -31, -28, -29, -32, -33, -30, -18, 0, 10, 12, 12, 17, 26, 35, 36, 31,
- 19, 5, -6, -11, -9, -2, 7, 14, 13, 13, 16, 23, 31, 34, 29, 15,
- -3, -8, -10, -10, -14, -20, -26, -30, -32, -30, -25, -18, -17, -24, -31, -32,
- -26, -11, 2, 7, 8, 9, 17, 25, 29, 28, 21, 9, -2, -7, -5, 4,
- 12, 21, 24, 23, 25, 26, 29, 31, 27, 15, -2, -15, -21, -23, -23, -23,
- -28, -30, -31, -27, -19, -10, -9, -13, -21, -22, -20, -11, -4, -3, -5, -2,
- 5, 13, 17, 17, 16, 10, 6, 0, 3, 11, 23, 32, 33, 30, 28, 27,
- 24, 24, 19, 9, -6, -19, -29, -29, -26, -20, -19, -22, -24, -23, -16, -10,
- -9, -14, -20, -24, -21, -16, -10, -6, -5, 1, 5, 11, 12, 13, 11, 8,
- 6, 1, 4, 9, 23, 33, 39, 36, 32, 32, 28, 22, 17, 7, -7, -22,
- -31, -33, -31, -24, -19, -18, -18, -16, -13, -7, -6, -8, -14, -21, -24, -20,
- -15, -12, -9, -6, 0, 4, 6, 8, 8, 5, 5, 2, 7, 15, 27, 37,
- 42, 45, 41, 39, 32, 22, 13, 3, -11, -26, -37, -41, -37, -29, -21, -18,
- -15, -11, -6, -2, -2, -4, -7, -13, -16, -20, -21, -16, -14, -10, -6, -3,
- -3, 0, 3, 2, 3, 3, 9, 18, 32, 41, 46, 49, 44, 43, 35, 24,
- 12, 1, -14, -27, -39, -40, -36, -31, -22, -16, -13, -6, -3, -3, -4, -9,
- -9, -13, -16, -20, -21, -16, -15, -11, -6, -4, -4, -5, -5, -3, -3, 0,
- 10, 19, 33, 44, 51, 56, 52, 50, 40, 23, 11, -6, -19, -30, -40, -43,
- -40, -35, -24, -16, -7, 2, 6, 5, 1, -6, -9, -9, -9, -12, -19, -21,
- -21, -17, -9, -7, -9, -11, -15, -14, -9, -7, 7, 19, 36, 51, 57, 61,
- 59, 56, 48, 33, 13, -8, -24, -35, -45, -51, -46, -38, -26, -14, -7, 3,
- 11, 15, 12, 3, -5, -7, -6, -9, -15, -22, -25, -23, -17, -13, -12, -16,
- -19, -21, -18, -12, 3, 21, 38, 50, 58, 67, 65, 64, 55, 41, 21, -4,
- -25, -38, -46, -50, -49, -43, -33, -23, -11, 3, 14, 19, 16, 8, 0, -2,
- -2, 0, -8, -19, -27, -30, -25, -22, -20, -20, -22, -25, -24, -16, 1, 22,
- 43, 56, 62, 67, 68, 65, 60, 46, 24, -3, -25, -40, -45, -49, -50, -46,
- -37, -23, -10, 1, 12, 20, 20, 14, 7, 2, 3, 3, -4, -15, -26, -31,
- -30, -27, -26, -26, -29, -33, -33, -25, -8, 17, 41, 57, 65, 71, 73, 73,
- 66, 53, 33, 5, -23, -41, -48, -50, -48, -48, -40, -30, -14, 1, 12, 21,
- 24, 18, 13, 6, 5, 5, 0, -11, -25, -37, -39, -35, -31, -31, -33, -38,
- -37, -29, -12, 15, 40, 59, 67, 71, 72, 73, 69, 59, 39, 14, -16, -38,
- -50, -51, -50, -48, -45, -36, -21, -4, 12, 25, 30, 25, 18, 11, 11, 10,
- 6, -8, -25, -39, -46, -42, -38, -37, -37, -40, -42, -34, -15, 13, 40, 57,
- 66, 71, 72, 72, 69, 61, 45, 19, -10, -34, -46, -48, -47, -45, -45, -41,
- -28, -12, 7, 23, 27, 25, 18, 15, 17, 17, 12, 1, -20, -37, -47, -50,
- -46, -45, -44, -45, -46, -41, -21, 7, 37, 60, 69, 73, 72, 72, 72, 67,
- 52, 25, -6, -33, -47, -50, -47, -47, -47, -45, -35, -16, 6, 23, 31, 30,
- 24, 23, 24, 25, 18, 4, -15, -33, -50, -56, -57, -53, -48, -49, -49, -45,
- -29, 2, 35, 58, 68, 71, 72, 74, 73, 68, 56, 34, 5, -26, -43, -48,
- -45, -42, -46, -46, -41, -24, 0, 21, 33, 34, 31, 25, 27, 27, 19, 6,
- -14, -36, -55, -64, -64, -60, -50, -47, -45, -44, -31, -4, 32, 58, 71, 72,
- 68, 70, 70, 66, 57, 36, 11, -20, -43, -50, -48, -41, -37, -42, -40, -28,
- -5, 21, 36, 38, 34, 26, 29, 28, 20, 8, -13, -33, -52, -68, -69, -65,
- -55, -49, -47, -44, -31, -3, 30, 55, 67, 70, 68, 70, 70, 65, 57, 39,
- 15, -13, -38, -49, -47, -40, -35, -39, -41, -30, -9, 17, 37, 44, 45, 38,
- 32, 29, 22, 9, -10, -34, -54, -70, -75, -73, -64, -52, -45, -43, -31, -7,
- 25, 53, 67, 72, 70, 72, 70, 62, 53, 38, 16, -10, -32, -49, -50, -43,
- -35, -33, -36, -29, -10, 16, 35, 46, 46, 41, 35, 30, 23, 10, -10, -34,
- -53, -69, -75, -74, -66, -53, -45, -42, -34, -13, 17, 46, 63, 68, 66, 63,
- 65, 63, 54, 43, 24, 0, -20, -40, -43, -42, -36, -32, -32, -28, -16, 7,
- 29, 47, 52, 47, 39, 31, 21, 10, -9, -30, -50, -66, -78, -77, -71, -59,
- -49, -42, -34, -17, 9, 37, 56, 66, 66, 62, 62, 61, 56, 45, 30, 7,
- -13, -31, -39, -40, -36, -33, -32, -28, -18, 1, 21, 41, 54, 52, 44, 36,
- 26, 13, -8, -29, -48, -66, -76, -80, -74, -64, -55, -45, -34, -18, 5, 29,
- 50, 65, 68, 66, 64, 60, 59, 47, 33, 15, -5, -23, -37, -43, -41, -37,
- -35, -31, -21, -4, 16, 36, 52, 59, 54, 45, 33, 17, -5, -25, -45, -60,
- -74, -83, -82, -71, -59, -49, -37, -23, -2, 22, 43, 59, 66, 65, 64, 60,
- 58, 50, 39, 23, 2, -17, -32, -39, -40, -38, -35, -32, -23, -6, 14, 33,
- 49, 59, 58, 49, 34, 16, -5, -25, -43, -60, -74, -83, -83, -76, -63, -53,
- -40, -24, -5, 16, 36, 54, 65, 67, 65, 61, 57, 52, 43, 27, 9, -12,
- -26, -37, -40, -39, -36, -32, -28, -13, 6, 27, 46, 58, 60, 52, 39, 23,
- 5, -16, -36, -53, -66, -77, -84, -81, -72, -60, -45, -32, -15, 5, 25, 48,
- 62, 69, 71, 69, 65, 58, 50, 34, 16, -6, -24, -36, -42, -45, -44, -39,
- -33, -21, -2, 22, 43, 59, 64, 60, 47, 34, 17, -6, -28, -50, -66, -76,
- -84, -86, -82, -72, -57, -40, -21, -2, 21, 42, 58, 66, 73, 76, 71, 64,
- 53, 40, 26, 4, -17, -34, -45, -49, -48, -43, -38, -28, -10, 15, 40, 58,
- 66, 64, 56, 42, 25, 4, -21, -44, -62, -73, -81, -87, -86, -78, -65, -47,
- -31, -9, 15, 34, 52, 62, 72, 79, 80, 72, 61, 49, 34, 12, -12, -32,
- -43, -49, -54, -55, -48, -36, -16, 10, 35, 56, 67, 71, 67, 54, 38, 15,
- -10, -34, -57, -72, -85, -93, -97, -89, -76, -59, -40, -20, 8, 32, 50, 67,
- 77, 87, 89, 81, 66, 52, 35, 16, -6, -30, -47, -58, -61, -57, -50, -37,
- -19, 6, 29, 51, 65, 73, 73, 62, 44, 18, -6, -28, -49, -67, -81, -93,
- -97, -94, -83, -65, -47, -28, -5, 19, 42, 61, 76, 87, 90, 88, 80, 66,
- 48, 27, 3, -17, -40, -56, -65, -66, -58, -49, -30, -6, 17, 41, 59, 71,
- 77, 70, 56, 36, 11, -13, -34, -53, -71, -89, -98, -100, -94, -79, -62, -44,
- -21, 3, 27, 52, 74, 90, 98, 95, 86, 75, 59, 37, 12, -14, -35, -54,
- -64, -67, -64, -51, -34, -10, 11, 32, 50, 65, 73, 71, 58, 37, 14, -10,
- -29, -48, -64, -81, -93, -98, -94, -82, -63, -45, -26, -5, 16, 40, 65, 83,
- 94, 94, 84, 75, 63, 46, 23, -3, -27, -47, -58, -64, -64, -56, -39, -17,
- 3, 20, 38, 57, 71, 72, 61, 45, 24, 1, -19, -37, -56, -73, -91, -99,
- -100, -92, -74, -53, -34, -16, 7, 31, 59, 82, 97, 101, 92, 78, 65, 48,
- 29, 6, -21, -43, -55, -64, -66, -58, -40, -18, 3, 17, 32, 51, 69, 71,
- 62, 45, 27, 6, -15, -34, -50, -64, -81, -93, -99, -96, -80, -59, -40, -23,
- -4, 21, 50, 77, 94, 100, 93, 81, 67, 53, 36, 14, -12, -36, -53, -58,
- -63, -56, -42, -22, -5, 10, 23, 42, 63, 70, 62, 47, 29, 13, -6, -27,
- -43, -57, -72, -84, -98, -99, -87, -66, -44, -27, -11, 10, 38, 67, 91, 99,
- 92, 82, 70, 57, 41, 21, -3, -27, -47, -58, -63, -58, -44, -23, -5, 7,
- 17, 35, 55, 66, 61, 46, 29, 13, -4, -22, -39, -51, -65, -78, -90, -95,
- -85, -69, -47, -30, -12, 9, 30, 57, 83, 96, 91, 81, 67, 57, 42, 26,
- 6, -18, -39, -55, -62, -58, -43, -24, -8, 2, 14, 30, 47, 60, 60, 49,
- 34, 17, 0, -16, -31, -43, -58, -71, -86, -93, -86, -72, -52, -32, -15, 3,
- 22, 48, 76, 90, 89, 78, 69, 59, 46, 32, 14, -6, -27, -47, -57, -56,
- -45, -29, -12, -5, 4, 18, 37, 54, 58, 51, 36, 21, 6, -8, -20, -33,
- -52, -68, -84, -90, -85, -74, -58, -42, -22, 0, 20, 42, 67, 83, 87, 80,
- 68, 58, 47, 34, 19, 0, -20, -40, -52, -53, -45, -27, -13, -4, 6, 17,
- 33, 47, 53, 52, 38, 21, 3, -11, -24, -35, -50, -65, -80, -89, -85, -71,
- -55, -39, -21, -2, 20, 39, 59, 74, 81, 75, 67, 57, 47, 38, 23, 4,
- -17, -32, -43, -45, -39, -26, -14, -4, 4, 12, 26, 38, 47, 48, 35, 19,
- 4, -10, -20, -29, -41, -56, -71, -78, -81, -71, -56, -43, -23, -6, 15, 35,
- 49, 62, 72, 69, 63, 54, 45, 41, 28, 11, -11, -27, -37, -40, -35, -24,
- -17, -7, 2, 9, 22, 35, 46, 49, 37, 21, 4, -9, -18, -27, -41, -55,
- -71, -79, -79, -70, -53, -38, -23, -8, 9, 31, 46, 58, 63, 63, 59, 52,
- 45, 40, 32, 14, -6, -24, -32, -31, -30, -23, -18, -12, 1, 9, 21, 31,
- 41, 44, 33, 21, 5, -6, -20, -29, -43, -57, -69, -77, -73, -65, -52, -41,
- -27, -8, 11, 32, 49, 57, 64, 61, 55, 47, 39, 36, 29, 13, -8, -25,
- -36, -35, -26, -16, -9, -5, 1, 9, 22, 36, 45, 43, 33, 17, 1, -11,
- -21, -32, -45, -57, -71, -78, -73, -61, -45, -33, -23, -8, 11, 31, 46, 53,
- 57, 54, 48, 40, 34, 31, 27, 14, -4, -20, -29, -28, -22, -12, -4, 1,
- 4, 8, 21, 34, 43, 43, 31, 17, 1, -11, -22, -31, -44, -59, -72, -78,
- -70, -54, -40, -28, -19, -8, 10, 28, 45, 53, 57, 53, 43, 34, 28, 27,
- 26, 18, 0, -18, -31, -29, -20, -11, -3, 2, 5, 10, 19, 31, 43, 44,
- 34, 19, 2, -13, -23, -32, -43, -55, -68, -77, -73, -57, -41, -26, -15, -6,
- 11, 28, 43, 52, 52, 49, 41, 33, 24, 22, 21, 14, 1, -14, -25, -24,
- -18, -7, -2, 2, 7, 10, 20, 31, 40, 43, 33, 18, 3, -13, -24, -35,
- -44, -55, -70, -78, -74, -59, -40, -26, -11, 1, 13, 29, 44, 53, 57, 54,
- 45, 32, 24, 18, 13, 9, -4, -16, -26, -29, -22, -10, 1, 8, 13, 18,
- 23, 35, 42, 45, 37, 21, 5, -14, -30, -41, -49, -57, -69, -77, -76, -61,
- -39, -20, -5, 9, 20, 34, 47, 53, 55, 48, 39, 27, 14, 8, 3, 2,
- -4, -15, -23, -24, -16, -3, 6, 11, 19, 24, 30, 34, 41, 43, 35, 18,
- 1, -17, -31, -44, -52, -59, -68, -75, -73, -61, -38, -19, 1, 13, 23, 30,
- 42, 52, 52, 47, 36, 23, 14, 7, 4, 0, -6, -11, -20, -24, -18, -5,
- 7, 15, 18, 22, 28, 36, 43, 43, 38, 24, 4, -13, -30, -44, -55, -64,
- -69, -77, -76, -65, -44, -19, 1, 15, 27, 35, 46, 53, 53, 46, 36, 23,
- 11, 3, -5, -7, -9, -14, -20, -23, -19, -7, 11, 18, 21, 25, 30, 40,
- 43, 43, 38, 24, 7, -14, -30, -41, -55, -65, -73, -77, -74, -66, -49, -24,
- -2, 17, 29, 35, 44, 51, 54, 49, 35, 23, 11, 1, -6, -12, -15, -16,
- -20, -24, -21, -10, 8, 21, 27, 33, 35, 42, 48, 47, 37, 23, 7, -12,
- -28, -44, -60, -69, -75, -78, -74, -65, -49, -25, -2, 17, 30, 40, 48, 54,
- 55, 48, 36, 20, 6, -4, -9, -14, -20, -22, -24, -21, -15, -6, 7, 21,
- 32, 39, 43, 44, 49, 50, 38, 21, 4, -13, -28, -47, -62, -74, -77, -78,
- -77, -65, -48, -26, -4, 15, 28, 40, 50, 56, 54, 46, 33, 20, 9, -2,
- -10, -16, -21, -21, -23, -21, -15, -5, 9, 19, 30, 38, 42, 44, 46, 47,
- 36, 22, 6, -10, -23, -39, -57, -74, -78, -79, -75, -65, -51, -33, -11, 9,
- 25, 37, 46, 55, 56, 48, 34, 21, 10, 4, -4, -14, -20, -25, -24, -21,
- -12, -3, 8, 17, 26, 36, 47, 50, 50, 47, 36, 25, 10, -5, -21, -40,
- -57, -75, -82, -79, -75, -64, -51, -37, -16, 5, 25, 40, 48, 55, 55, 49,
- 37, 25, 15, 6, -6, -18, -26, -29, -25, -20, -16, -7, 5, 17, 29, 39,
- 49, 56, 56, 51, 39, 28, 15, 0, -17, -38, -58, -75, -86, -86, -80, -70,
- -54, -37, -16, 7, 25, 42, 50, 55, 58, 52, 40, 25, 11, 2, -5, -14,
- -21, -26, -26, -18, -12, -5, 4, 13, 25, 34, 45, 53, 55, 48, 39, 25,
- 16, 3, -13, -31, -54, -70, -83, -85, -78, -68, -55, -38, -20, 1, 20, 36,
- 46, 51, 55, 48, 39, 27, 17, 7, -5, -13, -20, -23, -23, -18, -10, -4,
- 3, 10, 21, 29, 40, 48, 52, 50, 40, 28, 20, 10, -5, -24, -48, -67,
- -82, -87, -81, -73, -56, -44, -25, -5, 15, 34, 46, 52, 55, 51, 39, 27,
- 18, 7, -2, -13, -22, -25, -24, -16, -9, 1, 8, 13, 22, 30, 42, 48,
- 50, 47, 38, 26, 15, 6, -8, -22, -41, -61, -77, -86, -81, -70, -54, -40,
- -27, -8, 12, 31, 42, 49, 50, 48, 38, 26, 16, 7, -4, -11, -18, -22,
- -21, -16, -9, 0, 9, 15, 21, 26, 35, 47, 50, 46, 36, 28, 18, 7,
- -7, -22, -37, -53, -70, -81, -83, -72, -58, -43, -30, -14, 5, 22, 37, 44,
- 46, 44, 37, 26, 17, 8, 2, -7, -12, -17, -16, -12, -6, 3, 8, 13,
- 17, 22, 31, 42, 43, 43, 35, 29, 25, 14, 2, -17, -35, -51, -65, -77,
- -80, -75, -63, -47, -34, -18, 4, 21, 32, 38, 41, 41, 36, 28, 17, 8,
- 1, -9, -12, -16, -15, -9, -2, 8, 13, 15, 17, 23, 28, 39, 43, 38,
- 30, 21, 17, 11, 4, -12, -28, -45, -60, -68, -71, -66, -58, -49, -38, -23,
- -5, 15, 27, 34, 34, 32, 28, 23, 18, 13, 4, -2, -7, -9, -7, -4,
- 5, 14, 16, 16, 14, 15, 24, 35, 39, 35, 23, 17, 15, 11, 8, -4,
- -19, -37, -53, -62, -65, -62, -57, -53, -43, -31, -14, 5, 19, 27, 31, 28,
- 26, 23, 20, 18, 11, 5, -2, -5, 0, 3, 8, 14, 16, 15, 11, 7,
- 12, 23, 32, 32, 21, 12, 10, 13, 12, 6, -9, -27, -43, -50, -55, -53,
- -51, -52, -44, -38, -23, -6, 7, 18, 22, 19, 16, 15, 16, 19, 17, 12,
- 6, 3, 7, 10, 16, 20, 23, 20, 14, 8, 9, 17, 27, 26, 17, 6,
- 3, 7, 10, 7, -5, -18, -32, -41, -46, -45, -45, -45, -44, -40, -30, -16,
- -3, 8, 15, 12, 10, 11, 16, 19, 19, 16, 12, 10, 11, 15, 20, 25,
- 26, 24, 18, 11, 6, 11, 17, 21, 15, 3, -6, -2, 4, 7, 2, -14,
- -25, -32, -36, -38, -37, -37, -35, -33, -33, -25, -15, -4, 3, 4, 0, -3,
- 2, 13, 21, 21, 20, 17, 19, 23, 27, 31, 33, 31, 24, 16, 4, 2,
- 7, 13, 13, 3, -10, -9, 0, 8, 7, -3, -15, -22, -24, -30, -32, -37,
- -39, -38, -37, -34, -28, -17, -8, -2, -4, -4, 4, 16, 26, 30, 26, 22,
- 22, 25, 29, 31, 30, 29, 24, 17, 6, -2, 7, 10, 13, 4, -11, -15,
- -10, 3, 8, 2, -10, -17, -17, -17, -23, -29, -35, -37, -34, -36, -35, -28,
- -19, -10, -11, -14, -8, 8, 21, 26, 26, 21, 24, 31, 38, 40, 38, 37,
- 33, 26, 15, 4, 1, 2, 1, -6, -19, -24, -18, -7, 2, 5, -4, -10,
- -9, -6, -7, -16, -27, -33, -35, -38, -41, -38, -32, -22, -20, -18, -10, 4,
- 20, 29, 31, 30, 28, 32, 38, 43, 42, 39, 34, 28, 14, 4, 1, 3,
- 4, -5, -21, -30, -26, -14, 1, 3, -4, -8, -8, 0, 0, -8, -15, -26,
- -29, -35, -40, -40, -36, -30, -28, -29, -22, -10, 9, 22, 28, 28, 27, 30,
- 39, 46, 50, 50, 43, 33, 21, 9, 3, 3, 1, -10, -22, -35, -34, -22,
- -8, 2, 0, -6, -7, 0, 5, -2, -9, -18, -28, -34, -41, -43, -39, -35,
- -33, -33, -25, -12, 5, 19, 26, 29, 31, 31, 39, 46, 51, 52, 47, 38,
- 27, 18, 10, 5, -3, -13, -22, -33, -36, -28, -16, -4, -2, -4, -6, 0,
- 8, 7, 0, -12, -22, -33, -40, -42, -39, -37, -38, -39, -32, -17, 2, 15,
- 24, 25, 28, 33, 39, 47, 51, 53, 51, 44, 35, 23, 15, 8, 1, -12,
- -25, -37, -41, -33, -22, -11, -4, -5, -3, 3, 10, 13, 6, -5, -17, -28,
- -38, -43, -44, -44, -44, -43, -36, -23, -7, 7, 20, 26, 29, 35, 43, 51,
- 54, 58, 56, 52, 44, 29, 18, 9, -2, -12, -28, -39, -45, -38, -26, -16,
- -7, -3, 1, 6, 12, 15, 12, 3, -11, -25, -37, -41, -43, -46, -47, -46,
- -39, -28, -15, 0, 11, 21, 25, 31, 38, 46, 53, 60, 62, 59, 53, 42,
- 32, 19, 6, -10, -27, -41, -47, -47, -39, -31, -21, -9, -2, 5, 11, 16,
- 19, 13, 2, -15, -30, -35, -37, -43, -47, -49, -42, -32, -21, -11, 0, 8,
- 19, 27, 38, 47, 51, 58, 63, 63, 59, 50, 41, 28, 10, -9, -26, -37,
- -43, -44, -40, -33, -23, -11, 0, 6, 9, 14, 15, 13, 1, -15, -25, -32,
- -34, -43, -49, -50, -43, -30, -20, -13, -9, 0, 10, 23, 36, 46, 52, 55,
- 62, 65, 66, 61, 51, 36, 15, -7, -24, -34, -42, -45, -46, -42, -34, -20,
- -5, 5, 11, 14, 16, 13, 2, -10, -18, -24, -31, -39, -49, -48, -42, -34,
- -24, -18, -15, -8, 2, 13, 29, 42, 51, 57, 62, 65, 70, 69, 60, 45,
- 20, -3, -24, -37, -43, -46, -49, -48, -39, -24, -6, 5, 12, 17, 20, 16,
- 6, -9, -15, -21, -26, -38, -50, -56, -50, -37, -26, -23, -19, -14, -4, 11,
- 27, 42, 54, 58, 63, 65, 68, 70, 63, 50, 26, 1, -21, -37, -43, -44,
- -44, -44, -40, -28, -11, 5, 10, 16, 18, 14, 5, -12, -19, -22, -24, -33,
- -47, -52, -52, -38, -25, -17, -17, -16, -10, 4, 22, 39, 53, 59, 62, 63,
- 66, 68, 66, 55, 32, 9, -17, -34, -43, -42, -39, -38, -38, -31, -19, -3,
- 10, 17, 19, 12, 3, -12, -21, -24, -24, -31, -40, -49, -52, -41, -30, -18,
- -15, -17, -10, 0, 16, 33, 47, 59, 65, 64, 65, 67, 63, 56, 38, 13,
- -12, -32, -41, -39, -35, -33, -32, -27, -17, -4, 8, 15, 16, 13, 4, -11,
- -20, -25, -27, -32, -40, -48, -52, -46, -37, -25, -18, -16, -10, 1, 16, 33,
- 49, 59, 66, 67, 65, 66, 62, 51, 38, 15, -9, -30, -38, -41, -33, -29,
- -26, -23, -17, -5, 7, 16, 15, 14, 5, -9, -19, -27, -31, -34, -40, -47,
- -52, -49, -40, -30, -22, -16, -8, 4, 19, 32, 46, 59, 67, 71, 69, 64,
- 57, 49, 36, 17, -7, -27, -38, -40, -35, -28, -23, -19, -12, -5, 6, 12,
- 16, 15, 10, -5, -19, -28, -32, -36, -39, -46, -53, -52, -45, -34, -25, -18,
- -7, 6, 20, 33, 46, 60, 67, 74, 71, 65, 56, 46, 37, 18, -2, -20,
- -33, -38, -38, -30, -22, -16, -12, -6, 2, 6, 15, 15, 11, 1, -11, -19,
- -31, -37, -42, -46, -51, -54, -53, -46, -35, -26, -14, 3, 17, 33, 45, 57,
- 67, 75, 77, 71, 62, 50, 36, 18, 0, -19, -31, -36, -37, -31, -23, -17,
- -11, -6, 1, 6, 11, 15, 14, 8, -3, -16, -27, -37, -41, -47, -52, -58,
- -60, -55, -46, -32, -16, 0, 17, 32, 46, 59, 70, 79, 80, 75, 65, 51,
- 35, 20, 2, -15, -27, -38, -42, -36, -27, -17, -10, -4, 3, 7, 12, 18,
- 19, 14, 5, -7, -22, -37, -46, -53, -57, -62, -67, -65, -58, -43, -22, 1,
- 20, 35, 48, 60, 69, 79, 82, 79, 68, 53, 36, 21, 4, -11, -24, -36,
- -40, -38, -31, -21, -14, -5, 1, 5, 11, 17, 22, 19, 14, -2, -17, -35,
- -48, -55, -63, -67, -73, -72, -64, -49, -27, -4, 19, 36, 52, 64, 73, 81,
- 85, 82, 72, 56, 36, 20, 3, -14, -24, -33, -36, -35, -32, -22, -13, -6,
- 2, 7, 10, 15, 19, 19, 17, 6, -10, -29, -48, -58, -67, -71, -75, -78,
- -72, -58, -35, -10, 16, 35, 52, 65, 74, 80, 86, 87, 79, 62, 39, 21,
- 5, -11, -22, -33, -39, -39, -34, -25, -15, -7, 3, 8, 16, 17, 21, 22,
- 19, 9, -6, -27, -47, -60, -71, -77, -80, -81, -73, -61, -39, -12, 16, 36,
- 52, 63, 73, 80, 85, 87, 76, 59, 41, 23, 8, -7, -18, -29, -36, -38,
- -33, -23, -13, -8, 1, 6, 14, 18, 19, 23, 23, 17, 1, -20, -43, -57,
- -67, -78, -83, -89, -81, -67, -45, -19, 9, 35, 55, 67, 74, 80, 87, 91,
- 83, 68, 44, 24, 6, -9, -21, -29, -36, -39, -39, -31, -20, -10, 1, 13,
- 20, 26, 26, 27, 28, 22, 8, -16, -40, -60, -75, -86, -93, -95, -89, -75,
- -52, -24, 7, 37, 57, 69, 77, 83, 90, 93, 85, 70, 48, 27, 8, -8,
- -19, -26, -32, -35, -39, -37, -28, -17, -2, 9, 19, 21, 27, 31, 32, 29,
- 12, -9, -32, -54, -71, -86, -94, -96, -90, -82, -62, -33, 2, 34, 56, 69,
- 78, 87, 94, 94, 85, 69, 49, 29, 9, -10, -21, -27, -30, -33, -37, -36,
- -29, -17, -5, 9, 19, 25, 27, 31, 33, 33, 21, -2, -25, -51, -71, -86,
- -95, -95, -92, -85, -69, -42, -8, 27, 52, 67, 74, 83, 92, 95, 89, 75,
- 56, 35, 16, -6, -17, -26, -28, -34, -41, -39, -37, -25, -9, 6, 20, 28,
- 31, 37, 37, 34, 24, 3, -20, -46, -69, -85, -96, -99, -97, -89, -73, -47,
- -11, 21, 45, 61, 73, 84, 92, 95, 89, 77, 61, 41, 20, -2, -13, -20,
- -28, -36, -43, -46, -40, -30, -16, 0, 12, 24, 30, 38, 43, 41, 33, 13,
- -14, -39, -63, -80, -93, -98, -100, -94, -76, -52, -19, 14, 38, 56, 70, 80,
- 90, 94, 88, 75, 58, 40, 22, 6, -8, -19, -25, -33, -39, -41, -38, -31,
- -19, -5, 7, 21, 31, 39, 45, 42, 32, 15, -8, -32, -55, -77, -93, -102,
- -101, -94, -80, -57, -29, 5, 34, 54, 70, 78, 88, 96, 92, 80, 62, 41,
- 24, 8, -9, -21, -32, -35, -38, -41, -39, -35, -22, -6, 6, 21, 31, 39,
- 46, 44, 35, 18, -5, -27, -49, -70, -86, -97, -102, -96, -84, -58, -30, -2,
- 26, 45, 62, 74, 82, 89, 89, 80, 66, 46, 28, 12, -3, -14, -26, -36,
- -39, -42, -40, -36, -28, -15, 0, 17, 30, 37, 45, 48, 40, 23, 3, -20,
- -43, -64, -81, -93, -98, -96, -85, -65, -38, -8, 20, 40, 55, 68, 80, 88,
- 88, 82, 68, 54, 35, 18, 2, -12, -24, -35, -40, -45, -45, -41, -33, -20,
- -4, 15, 31, 41, 49, 52, 48, 32, 13, -14, -38, -59, -77, -92, -101, -102,
- -91, -70, -45, -15, 15, 38, 53, 65, 77, 89, 91, 85, 71, 52, 38, 21,
- 5, -12, -26, -36, -42, -45, -45, -43, -34, -22, -7, 9, 26, 39, 50, 56,
- 50, 34, 14, -7, -29, -50, -69, -84, -96, -98, -90, -72, -50, -24, 7, 32,
- 48, 57, 68, 84, 91, 88, 74, 58, 44, 30, 11, -9, -26, -38, -41, -46,
- -45, -44, -38, -23, -7, 9, 24, 36, 49, 55, 51, 35, 18, -3, -24, -45,
- -64, -78, -89, -93, -90, -75, -54, -29, 0, 23, 42, 54, 67, 80, 90, 91,