#include <DeviceMM.h>
Inheritance diagram for MMDevice:

Public Member Functions | |
| MMDevice () | |
| Constructor. | |
| virtual | ~MMDevice () |
| Destructor. | |
| virtual const wxString & | Name () const |
| Get the name of the device. | |
| virtual bool | Init (const format_ex_t &fmt, DeviceCallback &callback) |
| Open the device. | |
| virtual void | Play () |
| Start playback. | |
| virtual void | Pause () |
| Pause playback. | |
| virtual void | Done () |
| Close the device. | |
| virtual samples_t | GetPosition () |
| Get current position. | |
| virtual void | Configure (wxWindow *parent) |
| Open configure dialog. | |
Static Public Member Functions | |
| Device * | RegisterDevice () |
| Create device object instance. | |
Private Member Functions | |
| void | done () |
| Cleanup. | |
Private Attributes | |
| DeviceCallback * | cb |
| Data callback. | |
| format_ex_t | pfmt |
| Playback format. | |
| HANDLE | play |
| Playback thread handle. | |
| DWORD | play_id |
| Playback thread id. | |
| HANDLE | push |
| Push thread handle. | |
| DWORD | push_id |
| Push thread id. | |
| HWAVEOUT | handle |
| Playback device handle. | |
| bool | opened |
| Opended flag. | |
| bool | playing |
| Playing flag. | |
| bool | paused |
| Paused flag. | |
| HANDLE | buf_mutex |
| Shared structures mutex. | |
| size_t | buf_count |
| Number of cyclic buffer blocks. | |
| size_t | buf_start |
| Starting data offset of the cyclic buffer. | |
| size_t | buf_size |
| Size of data in the cyclic buffer. | |
| size_t | latency |
| Cyclic buffer block size. | |
| void * | buf |
| Cyclic buffer. | |
| samples_t | position |
| Buffer position. | |
| samples_t | rpos |
| Real-time (playback) position. | |
| DWORD | oldpos |
| Previous real-time position by waveOutGetPosition. | |
| WAVEHDR * | fragments |
| Wave fragments headers. | |
Friends | |
| DWORD __stdcall | play_thread (LPVOID data) |
| Playback thread code. | |
| DWORD __stdcall | push_thread (LPVOID data) |
| Push thread code. | |
Device for accessing Microsoft Windows MultiMedia sound devices.
Uses standard win32 threads.
|
|
Constructor. Create MM device. |
|
|
Destructor. Cleanup. |
|
|
Open configure dialog. Show the device configure dialog.
Implements Device. |
|
|
Cleanup. Stop playback (if playing), close the wave device, unprepare fragments, dispose threads, cleanup. |
|
|
Close the device. Stop playback, close device and do cleanup. Implements Device. |
|
|
Get current position. Get the index of the sample currently playing. The accuracy is not great and depends on the low-level MM driver.
Implements Device. |
|
||||||||||||
|
Open the device. Prepare the device for playback.
Implements Device. |
|
|
Get the name of the device.
Implements Device. |
|
|
Pause playback. Pause (or resume paused) playback. Implements Device. |
|
|
Start playback. Start the playback of an initialized device. Implements Device. |
|
|
Create device object instance.
|
|
|
Playback thread code. This thread plays the head of the cyclic buffer with the wave device.
|
|
|
Push thread code. This thread uses the supplied callback function to generate wave data and push it to the cyclic buffer.
|
|
|
Cyclic buffer.
|
|
|
Number of cyclic buffer blocks.
|
|
|
Shared structures mutex.
|
|
|
Size of data in the cyclic buffer.
|
|
|
Starting data offset of the cyclic buffer.
|
|
|
Data callback.
|
|
|
Wave fragments headers.
|
|
|
Playback device handle.
|
|
|
Cyclic buffer block size.
|
|
|
Previous real-time position by waveOutGetPosition.
|
|
|
Opended flag.
|
|
|
Paused flag.
|
|
|
Playback format.
|
|
|
Playback thread handle.
|
|
|
Playback thread id.
|
|
|
Playing flag.
|
|
|
Buffer position.
|
|
|
Push thread handle.
|
|
|
Push thread id.
|
|
|
Real-time (playback) position.
|
1.3.5