• Home
  • Raw
  • Download

Lines Matching refs:pData

95 static EAS_RESULT OTA_ParseHeader (S_EAS_DATA *pEASData, S_OTA_DATA* pData);
96 static EAS_RESULT OTA_FetchBitField (EAS_HW_DATA_HANDLE hwInstData, S_OTA_DATA *pData, EAS_I32 numB…
97 static EAS_RESULT OTA_SavePosition (EAS_HW_DATA_HANDLE hwInstData, S_OTA_DATA *pData, S_OTA_LOC *pL…
98 static EAS_RESULT OTA_RestorePosition (EAS_HW_DATA_HANDLE hwInstData, S_OTA_DATA *pData, S_OTA_LOC …
163 S_OTA_DATA* pData; in OTA_CheckFileType() local
199 pData = EAS_CMEnumData(EAS_CM_OTA_DATA); in OTA_CheckFileType()
201 pData = EAS_HWMalloc(pEASData->hwInstData, sizeof(S_OTA_DATA)); in OTA_CheckFileType()
202 if (!pData) in OTA_CheckFileType()
207 EAS_HWMemSet(pData, 0, sizeof(S_OTA_DATA)); in OTA_CheckFileType()
210 pData->fileHandle = fileHandle; in OTA_CheckFileType()
211 pData->fileOffset = offset; in OTA_CheckFileType()
212 pData->state = EAS_STATE_OPEN; in OTA_CheckFileType()
213 *ppHandle = pData; in OTA_CheckFileType()
246 S_OTA_DATA* pData; in OTA_Prepare() local
250 pData = (S_OTA_DATA*) pInstData; in OTA_Prepare()
251 if (pData->state != EAS_STATE_OPEN) in OTA_Prepare()
255 if ((result = VMInitMIDI(pEASData, &pData->pSynth)) != EAS_SUCCESS) in OTA_Prepare()
261 pData->state = EAS_STATE_ERROR; in OTA_Prepare()
262 if ((result = OTA_ParseHeader(pEASData, pData)) != EAS_SUCCESS) in OTA_Prepare()
265 pData->state = EAS_STATE_READY; in OTA_Prepare()
290 S_OTA_DATA *pData; in OTA_Time() local
292 pData = (S_OTA_DATA*) pInstData; in OTA_Time()
296 *pTime = pData->time >> 8; in OTA_Time()
319 S_OTA_DATA* pData; in OTA_Event() local
324 pData = (S_OTA_DATA*) pInstData; in OTA_Event()
325 if (pData->state >= EAS_STATE_OPEN) in OTA_Event()
329 if (pData->time == 0) in OTA_Event()
333 VMProgramChange(pEASData->pVoiceMgr, pData->pSynth, OTA_CHANNEL, OTA_PROGRAM); in OTA_Event()
337 VMControlChange(pEASData->pVoiceMgr, pData->pSynth, OTA_CHANNEL, 7, 127); in OTA_Event()
341 if (pData->note) in OTA_Event()
344 VMStopNote(pEASData->pVoiceMgr, pData->pSynth, OTA_CHANNEL, pData->note, 0); in OTA_Event()
345 pData->note = 0; in OTA_Event()
348 if (pData->restTicks) in OTA_Event()
350 pData->time += (EAS_I32) pData->restTicks; in OTA_Event()
351 pData->restTicks = 0; in OTA_Event()
357 while (pData->current.patternLen == 0) in OTA_Event()
361 …if (pData->loopCount && ((parserMode == eParserModePlay) || (pData->loopCount != OTA_INFINITE_LOOP… in OTA_Event()
364 if (pData->loopCount != OTA_INFINITE_LOOP) in OTA_Event()
365 pData->loopCount--; in OTA_Event()
368 …if ((result = OTA_RestorePosition(pEASData->hwInstData, pData, &pData->patterns[pData->currentPatt… in OTA_Event()
373 else if (pData->restore.fileOffset < 0) in OTA_Event()
377 if (pData->numPatterns == 0) in OTA_Event()
379 pData->state = EAS_STATE_STOPPING; in OTA_Event()
380 VMReleaseAllVoices(pEASData->pVoiceMgr, pData->pSynth); in OTA_Event()
385 if ((result = OTA_FetchBitField(pEASData->hwInstData, pData, 3, &temp)) != EAS_SUCCESS) in OTA_Event()
394 …if ((result = OTA_FetchBitField(pEASData->hwInstData, pData, 2, &pData->currentPattern)) != EAS_SU… in OTA_Event()
398 …if ((result = OTA_FetchBitField(pEASData->hwInstData, pData, 4, &pData->loopCount)) != EAS_SUCCESS) in OTA_Event()
402 …if ((result = OTA_FetchBitField(pEASData->hwInstData, pData, 8, &pData->current.patternLen)) != EA… in OTA_Event()
406 if (pData->current.patternLen) in OTA_Event()
408 …if ((result = OTA_SavePosition(pEASData->hwInstData, pData, &pData->patterns[pData->currentPattern… in OTA_Event()
416 if (pData->patterns[pData->currentPattern].fileOffset < 0) in OTA_Event()
423 … if ((result = OTA_SavePosition(pEASData->hwInstData, pData, &pData->restore)) != EAS_SUCCESS) in OTA_Event()
427 …if ((result = OTA_RestorePosition(pEASData->hwInstData, pData, &pData->patterns[pData->currentPatt… in OTA_Event()
432 pData->numPatterns--; in OTA_Event()
438 … if ((result = OTA_RestorePosition(pEASData->hwInstData, pData, &pData->restore)) != EAS_SUCCESS) in OTA_Event()
444 if ((result = OTA_FetchBitField(pEASData->hwInstData, pData, 3, &temp)) != EAS_SUCCESS) in OTA_Event()
451 … if ((result = OTA_FetchBitField(pEASData->hwInstData, pData, 4, &pData->note)) != EAS_SUCCESS) in OTA_Event()
455 if ((result = OTA_FetchBitField(pEASData->hwInstData, pData, 3, &temp)) != EAS_SUCCESS) in OTA_Event()
457 duration = pData->tick * (0x20 >> temp); in OTA_Event()
460 if ((result = OTA_FetchBitField(pEASData->hwInstData, pData, 2, &temp)) != EAS_SUCCESS) in OTA_Event()
485 if (pData->note) in OTA_Event()
489 switch (pData->style) in OTA_Event()
492 pData->restTicks = duration >> 4; in OTA_Event()
495 pData->restTicks = 0; in OTA_Event()
498 pData->restTicks = duration >> 1; in OTA_Event()
505 pData->note += pData->octave; in OTA_Event()
507 … VMStartNote(pEASData->pVoiceMgr, pData->pSynth, OTA_CHANNEL, pData->note, pData->velocity); in OTA_Event()
508 pData->time += (EAS_I32) duration - (EAS_I32) pData->restTicks; in OTA_Event()
513 pData->time += (EAS_I32) duration; in OTA_Event()
518 if ((result = OTA_FetchBitField(pEASData->hwInstData, pData, 2, &temp)) != EAS_SUCCESS) in OTA_Event()
520 pData->octave = (EAS_U8) (temp * 12 + 59); in OTA_Event()
525 … if ((result = OTA_FetchBitField(pEASData->hwInstData, pData, 2, &pData->style)) != EAS_SUCCESS) in OTA_Event()
531 if ((result = OTA_FetchBitField(pEASData->hwInstData, pData, 5, &temp)) != EAS_SUCCESS) in OTA_Event()
533 pData->tick = bpmTable[temp]; in OTA_Event()
538 if ((result = OTA_FetchBitField(pEASData->hwInstData, pData, 4, &temp)) != EAS_SUCCESS) in OTA_Event()
540 pData->velocity = temp ? (EAS_U8) (temp * OTA_VEL_MUL + OTA_VEL_OFS) : 0; in OTA_Event()
549 pData->current.patternLen--; in OTA_Event()
574 S_OTA_DATA* pData; in OTA_State() local
577 pData = (S_OTA_DATA*) pInstData; in OTA_State()
580 if (pData->state == EAS_STATE_STOPPING) in OTA_State()
582 if (VMActiveVoices(pData->pSynth) == 0) in OTA_State()
583 pData->state = EAS_STATE_STOPPED; in OTA_State()
586 if (pData->state == EAS_STATE_PAUSING) in OTA_State()
588 if (VMActiveVoices(pData->pSynth) == 0) in OTA_State()
589 pData->state = EAS_STATE_PAUSED; in OTA_State()
593 *pState = pData->state; in OTA_State()
616 S_OTA_DATA* pData; in OTA_Close() local
619 pData = (S_OTA_DATA*) pInstData; in OTA_Close()
622 if ((result = EAS_HWCloseFile(pEASData->hwInstData, pData->fileHandle)) != EAS_SUCCESS) in OTA_Close()
626 if (pData->pSynth != NULL) in OTA_Close()
627 VMMIDIShutdown(pEASData, pData->pSynth); in OTA_Close()
631 EAS_HWFree(pEASData->hwInstData, pData); in OTA_Close()
655 S_OTA_DATA* pData; in OTA_Reset() local
658 pData = (S_OTA_DATA*) pInstData; in OTA_Reset()
661 VMReset(pEASData->pVoiceMgr, pData->pSynth, EAS_TRUE); in OTA_Reset()
662 pData->note = 0; in OTA_Reset()
665 pData->state = EAS_STATE_ERROR; in OTA_Reset()
666 if ((result = OTA_ParseHeader (pEASData, pData)) != EAS_SUCCESS) in OTA_Reset()
669 pData->state = EAS_STATE_READY; in OTA_Reset()
692 S_OTA_DATA *pData; in OTA_Pause() local
695 pData = (S_OTA_DATA*) pInstData; in OTA_Pause()
696 if (pData->state == EAS_STATE_STOPPED) in OTA_Pause()
700 VMMuteAllVoices(pEASData->pVoiceMgr, pData->pSynth); in OTA_Pause()
701 pData->state = EAS_STATE_PAUSING; in OTA_Pause()
725 S_OTA_DATA *pData; in OTA_Resume() local
728 pData = (S_OTA_DATA*) pInstData; in OTA_Resume()
729 if (pData->state == EAS_STATE_STOPPED) in OTA_Resume()
733 pData->state = EAS_STATE_PLAY; in OTA_Resume()
757 S_OTA_DATA *pData; in OTA_SetData() local
759 pData = (S_OTA_DATA *) pInstData; in OTA_SetData()
765 EAS_HWMemCpy(&pData->metadata, (void*) value, sizeof(S_METADATA_CB)); in OTA_SetData()
795 S_OTA_DATA *pData; in OTA_GetData() local
797 pData = (S_OTA_DATA*) pInstData; in OTA_GetData()
808 *pValue = pData->transposition; in OTA_GetData()
813 *pValue = (EAS_I32) pData->pSynth; in OTA_GetData()
844 static EAS_RESULT OTA_ParseHeader (S_EAS_DATA *pEASData, S_OTA_DATA* pData) in OTA_ParseHeader() argument
853 pData->flags = 0; in OTA_ParseHeader()
854 pData->time = 0; in OTA_ParseHeader()
855 pData->tick = DEFAULT_TICK_CONV; in OTA_ParseHeader()
856 pData->patterns[0].fileOffset = pData->patterns[1].fileOffset = in OTA_ParseHeader()
857 pData->patterns[2].fileOffset = pData->patterns[3].fileOffset = -1; in OTA_ParseHeader()
858 pData->current.bitCount = 0; in OTA_ParseHeader()
859 pData->current.patternLen = 0; in OTA_ParseHeader()
860 pData->loopCount = 0; in OTA_ParseHeader()
861 pData->restore.fileOffset = -1; in OTA_ParseHeader()
862 pData->note = 0; in OTA_ParseHeader()
863 pData->restTicks = 0; in OTA_ParseHeader()
864 pData->velocity = OTA_VEL_DEFAULT; in OTA_ParseHeader()
865 pData->style = 0; in OTA_ParseHeader()
866 pData->octave = 59; in OTA_ParseHeader()
869 …if ((result = EAS_HWFileSeek(pEASData->hwInstData, pData->fileHandle, pData->fileOffset)) != EAS_S… in OTA_ParseHeader()
873 if ((result = EAS_HWGetByte(pEASData->hwInstData, pData->fileHandle, &temp)) != EAS_SUCCESS) in OTA_ParseHeader()
883 pData->current.bitCount = 0; in OTA_ParseHeader()
884 if ((result = OTA_FetchBitField(pEASData->hwInstData, pData, 7, &temp)) != EAS_SUCCESS) in OTA_ParseHeader()
903 pData->flags |= OTA_FLAGS_UNICODE; in OTA_ParseHeader()
913 if ((result = OTA_FetchBitField(pEASData->hwInstData, pData, 3, &temp)) != EAS_SUCCESS) in OTA_ParseHeader()
920 if ((result = OTA_FetchBitField(pEASData->hwInstData, pData, 4, &titleLen)) != EAS_SUCCESS) in OTA_ParseHeader()
924 if (pData->flags & OTA_FLAGS_UNICODE) in OTA_ParseHeader()
928 if (pData->metadata.buffer) in OTA_ParseHeader()
929 EAS_HWMemSet(pData->metadata.buffer, 0, pData->metadata.bufferSize); in OTA_ParseHeader()
935 if ((result = OTA_FetchBitField(pEASData->hwInstData, pData, 8, &temp)) != EAS_SUCCESS) in OTA_ParseHeader()
939 if (pData->metadata.callback) in OTA_ParseHeader()
941 if (i < (pData->metadata.bufferSize - 1)) in OTA_ParseHeader()
942 pData->metadata.buffer[i] = (char) temp; in OTA_ParseHeader()
947 if (pData->metadata.callback) in OTA_ParseHeader()
948 …(*pData->metadata.callback)(EAS_METADATA_TITLE, pData->metadata.buffer, pData->metadata.pUserData); in OTA_ParseHeader()
959 …if ((result = OTA_FetchBitField(pEASData->hwInstData, pData, 8, &pData->numPatterns)) != EAS_SUCCE… in OTA_ParseHeader()
963 if (pData->numPatterns == 0) in OTA_ParseHeader()
989 static EAS_RESULT OTA_FetchBitField (EAS_HW_DATA_HANDLE hwInstData, S_OTA_DATA *pData, EAS_I32 numB… in OTA_FetchBitField() argument
998 bitsLeft = pData->current.bitCount - numBits; in OTA_FetchBitField()
1004 if (pData->current.bitCount) in OTA_FetchBitField()
1006 value = pData->current.dataByte << -bitsLeft; in OTA_FetchBitField()
1009 …if ((result = EAS_HWGetByte(hwInstData, pData->fileHandle, &pData->current.dataByte)) != EAS_SUCCE… in OTA_FetchBitField()
1017 value |= pData->current.dataByte >> bitsLeft; in OTA_FetchBitField()
1018 pData->current.bitCount = (EAS_U8) bitsLeft; in OTA_FetchBitField()
1019 pData->current.dataByte = pData->current.dataByte & (0xff >> (8 - bitsLeft)); in OTA_FetchBitField()
1025 value |= pData->current.dataByte; in OTA_FetchBitField()
1026 pData->current.bitCount = 0; in OTA_FetchBitField()
1049 static EAS_RESULT OTA_SavePosition (EAS_HW_DATA_HANDLE hwInstData, S_OTA_DATA *pData, S_OTA_LOC *pL… in OTA_SavePosition() argument
1051 EAS_HWMemCpy(pLoc, &pData->current, sizeof(S_OTA_LOC)); in OTA_SavePosition()
1052 return EAS_HWFilePos(hwInstData, pData->fileHandle, &pLoc->fileOffset); in OTA_SavePosition()
1071 static EAS_RESULT OTA_RestorePosition (EAS_HW_DATA_HANDLE hwInstData, S_OTA_DATA *pData, S_OTA_LOC … in OTA_RestorePosition() argument
1073 EAS_HWMemCpy(&pData->current, pLoc, sizeof(S_OTA_LOC)); in OTA_RestorePosition()
1074 pData->restore.fileOffset = -1; in OTA_RestorePosition()
1075 return EAS_HWFileSeek(hwInstData, pData->fileHandle, pLoc->fileOffset); in OTA_RestorePosition()