AudioRenderer.h
上传用户:tuheem
上传日期:2007-05-01
资源大小:21889k
文件大小:2k
- /**************************************************************************************
- * *
- * *
- **************************************************************************************/
- #ifndef AUDIO_RENDERER_H
- #define AUDIO_RENDERER_H
- #include "MediaClasses.h"
- #include "DebugFile.h"
- /*
- * 包括直接音频
- */
- #include <math.h>
- #include <dsound.h>
- /*
- * Audio Renderer Class
- *
- * ——某一刻只有一个可用
- *
- */
- class MediaAudioRenderer : public MediaItemAudioRenderer {
- public:
- LPDIRECTSOUND lpDirectSound;
- LPDIRECTSOUNDBUFFER lpBuffer;
- WAVEFORMATEX *ourFormat;
- DWORD dwBufferSize;
- DWORD dwNextWriteOffset;
- DWORD dwProgress;
- DWORD dwLastPlayPos;
-
- unsigned long dwPlayed;
-
- HANDLE audioThread;
- UINT uTimerID;
- LONG lInTimer;
- DWORD id;
-
- MediaAudioCallback callback;
- void *lpData;
- int paused;
- /*
- * 方法
- *
- */
- MediaAudioRenderer();
- ~MediaAudioRenderer();
- /*
- * 媒体项方法
- */
- media_type_t GetType();
- char *GetName();
-
- MP_RESULT Connect(MediaItem *item);
- MP_RESULT ReleaseConnections();
- DWORD GetCaps();
- MP_RESULT Configure(HINSTANCE hInstance, HWND hwnd);
- /*
- * 音频补偿方法
- */
- MP_RESULT Open(HWND hwnd, WAVEFORMATEX *inFormat);
- MP_RESULT SetCallback(void *lpData, MediaAudioCallback callback);
- MP_RESULT SetVolume(unsigned int volume);
- unsigned long GetAudioTime();
- MP_RESULT Bufferize();
- MP_RESULT Start();
- MP_RESULT Pause();
- MP_RESULT Stop();
- MP_RESULT Close();
- };
- #endif