Lines Matching refs:pWaveData
89 static EAS_RESULT WaveParseHeader (S_EAS_DATA *pEASData, EAS_FILE_HANDLE fileHandle, S_WAVE_STATE *pWaveData);
93 static EAS_RESULT SaveFmtChunk (S_EAS_DATA *pEASData, EAS_FILE_HANDLE fileHandle, S_WAVE_STATE *pWaveData, EAS_I32 size);
139 S_WAVE_STATE *pWaveData;
150 pWaveData = EAS_CMEnumData(EAS_CM_WAVE_DATA);
152 pWaveData = EAS_HWMalloc(pEASData->hwInstData, sizeof(S_WAVE_STATE));
153 if (!pWaveData)
155 EAS_HWMemSet(pWaveData, 0, sizeof(S_WAVE_STATE));
158 pWaveData->fileHandle = fileHandle;
159 pWaveData->fileOffset = offset;
160 *pHandle = pWaveData;
185 S_WAVE_STATE *pWaveData;
189 pWaveData = (S_WAVE_STATE*) pInstData;
190 if (pWaveData->streamHandle != NULL)
194 pWaveData->time = 0;
195 if ((result = EAS_HWFileSeek(pEASData->hwInstData, pWaveData->fileHandle, pWaveData->fileOffset)) != EAS_SUCCESS)
199 if ((result = WaveParseHeader(pEASData, pWaveData->fileHandle, pWaveData)) != EAS_SUCCESS)
227 S_WAVE_STATE *pWaveData;
230 pWaveData = (S_WAVE_STATE*) pInstData;
231 if (pWaveData->streamHandle)
232 return EAS_PEState(pEASData, pWaveData->streamHandle, pState);
235 if (pWaveData->time > 0)
261 S_WAVE_STATE *pWaveData;
264 pWaveData = (S_WAVE_STATE*) pInstData;
267 if (pWaveData->streamHandle)
269 if ((result = EAS_PEClose(pEASData, pWaveData->streamHandle)) != EAS_SUCCESS)
271 pWaveData->streamHandle = NULL;
280 if (pWaveData->fmtChunk != NULL)
281 EAS_HWFree(pEASData->hwInstData, pWaveData->fmtChunk);
285 EAS_HWFree(pEASData->hwInstData, pWaveData);
428 S_WAVE_STATE *pWaveData = (S_WAVE_STATE*) pInstData;
434 EAS_HWMemCpy(&pWaveData->metadata, (void*) value, sizeof(S_METADATA_CB));
439 return EAS_PEUpdatePitch(pEASData, pWaveData->streamHandle, (EAS_I16) value);
442 return EAS_PEUpdateVolume(pEASData, pWaveData->streamHandle, (EAS_I16) value);
468 S_WAVE_STATE *pWaveData;
470 pWaveData = (S_WAVE_STATE*) pInstData;
475 *pValue = pWaveData->fileType;
481 *pValue = (EAS_I32) pWaveData->fmtChunk;
513 pWaveData)
557 if (pWaveData == NULL)
561 pWaveData->flags = 0;
562 pWaveData->mediaLength = -1;
563 pWaveData->infoChunkPos = -1;
564 pWaveData->infoChunkSize = -1;
567 pWaveData->flags |= PCM_FLAGS_STREAMING;
592 if ((result = SaveFmtChunk(pEASData, fileHandle, pWaveData, (EAS_I32) size)) != EAS_SUCCESS)
602 pWaveData->fileType = EAS_FILE_WAVE_PCM;
607 pWaveData->fileType = EAS_FILE_WAVE_IMA_ADPCM;
616 pWaveData->flags |= PCM_FLAGS_STEREO;
641 pWaveData->flags |= PCM_FLAGS_8_BIT | PCM_FLAGS_UNSIGNED;
649 if ((usTemp != 4) || (pWaveData->flags & PCM_FLAGS_STEREO))
657 if (pWaveData->flags & PCM_FLAGS_STREAMING)
668 pWaveData->mediaLength = (EAS_I32) ((size * 1000) / avgBytesPerSec);
670 pWaveData->mediaLength = (EAS_I32) (size / (avgBytesPerSec / 1000));
680 pWaveData->infoChunkPos = pos + 4;
681 pWaveData->infoChunkSize = (EAS_I32) size - 4;
724 pWaveData->audioOffset = audioOffset;
725 params.flags = pWaveData->flags;
732 return EAS_PEOpenStream(pEASData, ¶ms, &pWaveData->streamHandle);
744 S_WAVE_STATE *pWaveData;
755 pWaveData = (S_WAVE_STATE*) pInstData;
758 *pMediaLength = pWaveData->mediaLength;
761 if (pWaveData->infoChunkPos < 0)
764 if ((result = EAS_HWFilePos(pEASData->hwInstData, pWaveData->fileHandle, &restorePos)) != EAS_SUCCESS)
768 pos = pWaveData->infoChunkPos;
769 infoSize = pWaveData->infoChunkSize;
776 if ((result = EAS_HWFileSeek(pEASData->hwInstData, pWaveData->fileHandle, pos)) != EAS_SUCCESS)
780 if ((result = EAS_HWGetDWord(pEASData->hwInstData, pWaveData->fileHandle, &tag, EAS_TRUE)) != EAS_FALSE)
782 if ((result = EAS_HWGetDWord(pEASData->hwInstData, pWaveData->fileHandle, &size, EAS_FALSE)) != EAS_FALSE)
811 metaLen = pWaveData->metadata.bufferSize - 1;
814 if ((result = EAS_HWReadFile(pEASData->hwInstData, pWaveData->fileHandle, pWaveData->metadata.buffer, metaLen, &metaLen)) != EAS_SUCCESS)
816 pWaveData->metadata.buffer[metaLen] = 0;
817 pWaveData->metadata.callback(metaType, pWaveData->metadata.buffer, pWaveData->metadata.pUserData);
831 return EAS_HWFileSeek(pEASData->hwInstData, pWaveData->fileHandle, restorePos);
842 static EAS_RESULT SaveFmtChunk (S_EAS_DATA *pEASData, EAS_FILE_HANDLE fileHandle, S_WAVE_STATE *pWaveData, EAS_I32 fmtSize)
853 pWaveData->fmtChunk = EAS_HWMalloc(pEASData->hwInstData, fmtSize);
854 if (!pWaveData->fmtChunk)
858 if ((result = EAS_HWReadFile(pEASData->hwInstData, fileHandle, pWaveData->fmtChunk, fmtSize, &count)) != EAS_SUCCESS)