Lines Matching refs:pData

76 static EAS_RESULT RTTTL_GetStyle (EAS_HW_DATA_HANDLE hwInstData, S_RTTTL_DATA *pData);
77 static EAS_RESULT RTTTL_GetDuration (EAS_HW_DATA_HANDLE hwInstData, S_RTTTL_DATA *pData, EAS_I8 *pD…
78 static EAS_RESULT RTTTL_GetOctave (EAS_HW_DATA_HANDLE hwInstData, S_RTTTL_DATA *pData, EAS_U8 *pOct…
79 static EAS_RESULT RTTTL_GetTempo (EAS_HW_DATA_HANDLE hwInstData, S_RTTTL_DATA *pData);
80 static EAS_RESULT RTTTL_GetNumber (EAS_HW_DATA_HANDLE hwInstData, S_RTTTL_DATA *pData, EAS_I32 *pVa…
81 static EAS_RESULT RTTTL_ParseHeader (S_EAS_DATA *pEASData, S_RTTTL_DATA* pData, EAS_BOOL metaData);
82 static EAS_RESULT RTTTL_GetNextChar (EAS_HW_DATA_HANDLE hwInstData, S_RTTTL_DATA *pData, EAS_I8 *pV…
83 static EAS_RESULT RTTTL_PeekNextChar (EAS_HW_DATA_HANDLE hwInstData, S_RTTTL_DATA *pData, EAS_I8 *p…
86 EAS_INLINE void RTTTL_PutBackChar (S_RTTTL_DATA *pData, EAS_I8 value) { pData->dataByte = value; } in RTTTL_PutBackChar() argument
136 S_RTTTL_DATA *pData; in RTTTL_CheckFileType() local
147 pData = EAS_CMEnumData(EAS_CM_RTTTL_DATA); in RTTTL_CheckFileType()
149 pData = EAS_HWMalloc(pEASData->hwInstData, sizeof(S_RTTTL_DATA)); in RTTTL_CheckFileType()
150 if (!pData) in RTTTL_CheckFileType()
152 EAS_HWMemSet(pData, 0, sizeof(S_RTTTL_DATA)); in RTTTL_CheckFileType()
155 pData->fileHandle = fileHandle; in RTTTL_CheckFileType()
156 pData->fileOffset = offset; in RTTTL_CheckFileType()
157 pData->state = EAS_STATE_OPEN; in RTTTL_CheckFileType()
158 *ppHandle = pData; in RTTTL_CheckFileType()
184 S_RTTTL_DATA* pData; in RTTTL_Prepare() local
188 pData = (S_RTTTL_DATA*) pInstData; in RTTTL_Prepare()
189 if (pData->state != EAS_STATE_OPEN) in RTTTL_Prepare()
193 if ((result = VMInitMIDI(pEASData, &pData->pSynth)) != EAS_SUCCESS) in RTTTL_Prepare()
199 pData->state = EAS_STATE_ERROR; in RTTTL_Prepare()
200 …if ((result = RTTTL_ParseHeader (pEASData, pData, (EAS_BOOL) (pData->metadata.callback != NULL)))… in RTTTL_Prepare()
204 EAS_HWFree(pEASData->hwInstData, pData); in RTTTL_Prepare()
208 pData->state = EAS_STATE_READY; in RTTTL_Prepare()
233 S_RTTTL_DATA *pData; in RTTTL_Time() local
235 pData = (S_RTTTL_DATA*) pInstData; in RTTTL_Time()
239 *pTime = pData->time >> 8; in RTTTL_Time()
262 S_RTTTL_DATA* pData; in RTTTL_Event() local
270 pData = (S_RTTTL_DATA*) pInstData; in RTTTL_Event()
271 if (pData->state >= EAS_STATE_OPEN) in RTTTL_Event()
275 if (pData->time == 0) in RTTTL_Event()
278 VMProgramChange(pEASData->pVoiceMgr, pData->pSynth, RTTTL_CHANNEL, RTTTL_PROGRAM); in RTTTL_Event()
281 VMControlChange(pEASData->pVoiceMgr, pData->pSynth, RTTTL_CHANNEL, 7, 127); in RTTTL_Event()
285 if (pData->note) in RTTTL_Event()
288 VMStopNote(pEASData->pVoiceMgr, pData->pSynth, RTTTL_CHANNEL, pData->note, 0); in RTTTL_Event()
289 pData->note = 0; in RTTTL_Event()
292 if (pData->restTicks) in RTTTL_Event()
294 pData->time += pData->restTicks; in RTTTL_Event()
295 pData->restTicks = 0; in RTTTL_Event()
301 octave = pData->octave; in RTTTL_Event()
303 ticks = pData->duration * pData->tick; in RTTTL_Event()
308 if ((result = RTTTL_GetNextChar(pEASData->hwInstData, pData, &c)) != EAS_SUCCESS) in RTTTL_Event()
317 if (pData->repeatCount == 0) in RTTTL_Event()
319 pData->state = EAS_STATE_STOPPING; in RTTTL_Event()
320 VMReleaseAllVoices(pEASData->pVoiceMgr, pData->pSynth); in RTTTL_Event()
325 if (pData->repeatCount != RTTTL_INFINITE_LOOP) in RTTTL_Event()
326 pData->repeatCount--; in RTTTL_Event()
331 pData->state = EAS_STATE_STOPPING; in RTTTL_Event()
332 VMReleaseAllVoices(pEASData->pVoiceMgr, pData->pSynth); in RTTTL_Event()
337 …if ((result = EAS_HWFileSeek(pEASData->hwInstData, pData->fileHandle, pData->repeatOffset)) != EAS… in RTTTL_Event()
351 if ((result = RTTTL_PeekNextChar(pEASData->hwInstData, pData, &c)) != EAS_SUCCESS) in RTTTL_Event()
357 if ((result = RTTTL_GetNumber(pEASData->hwInstData, pData, &temp)) != EAS_SUCCESS) in RTTTL_Event()
369 pData->tick = TICK_CONVERT / (EAS_U32) temp; in RTTTL_Event()
387 … if ((result = RTTTL_GetOctave(pEASData->hwInstData, pData, &pData->octave)) != EAS_SUCCESS) in RTTTL_Event()
394 if ((result = RTTTL_GetStyle(pEASData->hwInstData, pData)) != EAS_SUCCESS) in RTTTL_Event()
401 RTTTL_PutBackChar(pData, c); in RTTTL_Event()
406 if ((result = RTTTL_GetDuration(pEASData->hwInstData, pData, &c)) != EAS_SUCCESS) in RTTTL_Event()
408 ticks = c * pData->tick; in RTTTL_Event()
414 if ((result = RTTTL_GetOctave(pEASData->hwInstData, pData, &octave)) != EAS_SUCCESS) in RTTTL_Event()
453 pData->note = note + octave; in RTTTL_Event()
455 … VMStartNote(pEASData->pVoiceMgr, pData->pSynth, RTTTL_CHANNEL, pData->note, RTTTL_VELOCITY); in RTTTL_Event()
458 switch (pData->style) in RTTTL_Event()
463 pData->restTicks = ticks >> 4; in RTTTL_Event()
468 pData->restTicks = 0; in RTTTL_Event()
474 pData->restTicks = ticks >> 1; in RTTTL_Event()
483 pData->time += ticks - pData->restTicks; in RTTTL_Event()
488 pData->time += ticks; in RTTTL_Event()
495 pData->state = EAS_STATE_PLAY; in RTTTL_Event()
520 S_RTTTL_DATA* pData; in RTTTL_State() local
523 pData = (S_RTTTL_DATA*) pInstData; in RTTTL_State()
526 if (pData->state == EAS_STATE_STOPPING) in RTTTL_State()
528 if (VMActiveVoices(pData->pSynth) == 0) in RTTTL_State()
529 pData->state = EAS_STATE_STOPPED; in RTTTL_State()
532 if (pData->state == EAS_STATE_PAUSING) in RTTTL_State()
534 if (VMActiveVoices(pData->pSynth) == 0) in RTTTL_State()
535 pData->state = EAS_STATE_PAUSED; in RTTTL_State()
539 *pState = pData->state; in RTTTL_State()
562 S_RTTTL_DATA* pData; in RTTTL_Close() local
565 pData = (S_RTTTL_DATA*) pInstData; in RTTTL_Close()
568 if ((result = EAS_HWCloseFile(pEASData->hwInstData, pData->fileHandle)) != EAS_SUCCESS) in RTTTL_Close()
572 if (pData->pSynth != NULL) in RTTTL_Close()
573 VMMIDIShutdown(pEASData, pData->pSynth); in RTTTL_Close()
577 EAS_HWFree(pEASData->hwInstData, pData); in RTTTL_Close()
601 S_RTTTL_DATA* pData; in RTTTL_Reset() local
604 pData = (S_RTTTL_DATA*) pInstData; in RTTTL_Reset()
607 VMReset(pEASData->pVoiceMgr, pData->pSynth, EAS_TRUE); in RTTTL_Reset()
610 pData->time = 0; in RTTTL_Reset()
611 pData->note = 0; in RTTTL_Reset()
614 pData->state = EAS_STATE_ERROR; in RTTTL_Reset()
615 …if ((result = EAS_HWFileSeek(pEASData->hwInstData, pData->fileHandle, pData->fileOffset)) != EAS_S… in RTTTL_Reset()
617 if ((result = RTTTL_ParseHeader (pEASData, pData, EAS_TRUE)) != EAS_SUCCESS) in RTTTL_Reset()
620 pData->state = EAS_STATE_READY; in RTTTL_Reset()
643 S_RTTTL_DATA *pData; in RTTTL_Pause() local
646 pData = (S_RTTTL_DATA*) pInstData; in RTTTL_Pause()
647 if (pData->state == EAS_STATE_STOPPED) in RTTTL_Pause()
651 VMMuteAllVoices(pEASData->pVoiceMgr, pData->pSynth); in RTTTL_Pause()
652 pData->state = EAS_STATE_PAUSING; in RTTTL_Pause()
676 S_RTTTL_DATA *pData; in RTTTL_Resume() local
679 pData = (S_RTTTL_DATA*) pInstData; in RTTTL_Resume()
680 if (pData->state == EAS_STATE_STOPPED) in RTTTL_Resume()
684 pData->state = EAS_STATE_PLAY; in RTTTL_Resume()
708 S_RTTTL_DATA *pData; in RTTTL_SetData() local
710 pData = (S_RTTTL_DATA *) pInstData; in RTTTL_SetData()
716 EAS_HWMemCpy(&pData->metadata, (void*) value, sizeof(S_METADATA_CB)); in RTTTL_SetData()
746 S_RTTTL_DATA *pData; in RTTTL_GetData() local
748 pData = (S_RTTTL_DATA *) pInstData; in RTTTL_GetData()
759 *pValue = pData->transposition; in RTTTL_GetData()
764 *pValue = (EAS_I32) pData->pSynth; in RTTTL_GetData()
793 static EAS_RESULT RTTTL_GetStyle (EAS_HW_DATA_HANDLE hwInstData, S_RTTTL_DATA *pData) in RTTTL_GetStyle() argument
799 if ((result = RTTTL_GetNextChar(hwInstData, pData, &style)) != EAS_SUCCESS) in RTTTL_GetStyle()
805 pData->style = style; in RTTTL_GetStyle()
825 static EAS_RESULT RTTTL_GetDuration (EAS_HW_DATA_HANDLE hwInstData, S_RTTTL_DATA *pData, EAS_I8 *pD… in RTTTL_GetDuration() argument
832 if ((result = RTTTL_GetNumber(hwInstData, pData, &duration)) != EAS_SUCCESS) in RTTTL_GetDuration()
867 static EAS_RESULT RTTTL_GetOctave (EAS_HW_DATA_HANDLE hwInstData, S_RTTTL_DATA *pData, EAS_U8 *pOct… in RTTTL_GetOctave() argument
873 if ((result = RTTTL_GetNumber(hwInstData, pData, &octave)) != EAS_SUCCESS) in RTTTL_GetOctave()
899 static EAS_RESULT RTTTL_GetTempo (EAS_HW_DATA_HANDLE hwInstData, S_RTTTL_DATA *pData) in RTTTL_GetTempo() argument
905 if ((result = RTTTL_GetNumber(hwInstData, pData, &tempo)) != EAS_SUCCESS) in RTTTL_GetTempo()
911 pData->tick = TICK_CONVERT / (EAS_U32) tempo; in RTTTL_GetTempo()
931 static EAS_RESULT RTTTL_GetNumber (EAS_HW_DATA_HANDLE hwInstData, S_RTTTL_DATA *pData, EAS_I32 *pVa… in RTTTL_GetNumber() argument
941 if ((result = RTTTL_PeekNextChar(hwInstData, pData, &c)) != EAS_SUCCESS) in RTTTL_GetNumber()
950 pData->dataByte = 0; in RTTTL_GetNumber()
977 static EAS_RESULT RTTTL_ParseHeader (S_EAS_DATA *pEASData, S_RTTTL_DATA* pData, EAS_BOOL metaData) in RTTTL_ParseHeader() argument
985 pData->time = 0; in RTTTL_ParseHeader()
986 pData->tick = DEFAULT_TICK_CONV; in RTTTL_ParseHeader()
987 pData->note = 0; in RTTTL_ParseHeader()
988 pData->duration = 4; in RTTTL_ParseHeader()
989 pData ->restTicks = 0; in RTTTL_ParseHeader()
990 pData->octave = 60; in RTTTL_ParseHeader()
991 pData->repeatOffset = -1; in RTTTL_ParseHeader()
992 pData->repeatCount = 0; in RTTTL_ParseHeader()
993 pData->style = 'n'; in RTTTL_ParseHeader()
994 pData->dataByte = 0; in RTTTL_ParseHeader()
996 metaData = metaData && (pData->metadata.buffer != NULL) && (pData->metadata.callback != NULL); in RTTTL_ParseHeader()
999 …if ((result = EAS_HWFileSeek(pEASData->hwInstData, pData->fileHandle, pData->fileOffset)) != EAS_S… in RTTTL_ParseHeader()
1004 EAS_HWMemSet(pData->metadata.buffer, 0, pData->metadata.bufferSize); in RTTTL_ParseHeader()
1009 if ((result = EAS_HWGetByte(pEASData->hwInstData, pData->fileHandle, &temp)) != EAS_SUCCESS) in RTTTL_ParseHeader()
1018 if (i < (pData->metadata.bufferSize- 1)) in RTTTL_ParseHeader()
1019 pData->metadata.buffer[i] = (char) temp; in RTTTL_ParseHeader()
1029 …(*pData->metadata.callback)(EAS_METADATA_TITLE, pData->metadata.buffer, pData->metadata.pUserData); in RTTTL_ParseHeader()
1036 if ((result = RTTTL_GetNextChar(pEASData->hwInstData, pData, &control)) != EAS_SUCCESS) in RTTTL_ParseHeader()
1040 if ((result = RTTTL_GetNextChar(pEASData->hwInstData, pData, &temp)) != EAS_SUCCESS) in RTTTL_ParseHeader()
1051 if ((result = RTTTL_GetTempo(pEASData->hwInstData, pData)) != EAS_SUCCESS) in RTTTL_ParseHeader()
1057 if ((result = RTTTL_GetDuration(pEASData->hwInstData, pData, &temp)) != EAS_SUCCESS) in RTTTL_ParseHeader()
1059 pData->duration = temp; in RTTTL_ParseHeader()
1064 if ((result = RTTTL_GetNumber(pEASData->hwInstData, pData, &i)) != EAS_SUCCESS) in RTTTL_ParseHeader()
1068 pData->repeatCount = (EAS_U8) i; in RTTTL_ParseHeader()
1073 … if ((result = RTTTL_GetOctave(pEASData->hwInstData, pData, &pData->octave)) != EAS_SUCCESS) in RTTTL_ParseHeader()
1079 if ((result = RTTTL_GetStyle(pEASData->hwInstData, pData)) != EAS_SUCCESS) in RTTTL_ParseHeader()
1089 if ((result = RTTTL_GetNextChar(pEASData->hwInstData, pData, &temp)) != EAS_SUCCESS) in RTTTL_ParseHeader()
1102 …if ((result = EAS_HWFilePos(pEASData->hwInstData, pData->fileHandle, &pData->repeatOffset)) != EAS… in RTTTL_ParseHeader()
1124 static EAS_RESULT RTTTL_GetNextChar (EAS_HW_DATA_HANDLE hwInstData, S_RTTTL_DATA *pData, EAS_I8 *pV… in RTTTL_GetNextChar() argument
1134 if (pData->dataByte) in RTTTL_GetNextChar()
1136 temp = pData->dataByte; in RTTTL_GetNextChar()
1137 pData->dataByte = 0; in RTTTL_GetNextChar()
1141 if ((result = EAS_HWGetByte(hwInstData, pData->fileHandle, &temp)) != EAS_SUCCESS) in RTTTL_GetNextChar()
1170 static EAS_RESULT RTTTL_PeekNextChar (EAS_HW_DATA_HANDLE hwInstData, S_RTTTL_DATA *pData, EAS_I8 *p… in RTTTL_PeekNextChar() argument
1180 if (!pData->dataByte) in RTTTL_PeekNextChar()
1182 … if ((result = EAS_HWGetByte(hwInstData, pData->fileHandle, &pData->dataByte)) != EAS_SUCCESS) in RTTTL_PeekNextChar()
1186 temp = pData->dataByte; in RTTTL_PeekNextChar()
1194 pData->dataByte = 0; in RTTTL_PeekNextChar()