Remove spurious #pragma once from DSound audio player, and add a comment about it needing rewrite once again. (It's doing COM wrong.)

Originally committed to SVN as r1806.
This commit is contained in:
Niels Martin Hansen 2008-01-21 20:56:39 +00:00
parent 6a811254e3
commit 27e5fdc3ce
1 changed files with 19 additions and 3 deletions

View File

@ -34,9 +34,6 @@
//
#pragma once
///////////
// Headers
#ifdef WITH_DIRECTSOUND
@ -71,6 +68,21 @@ public:
wxThread::ExitCode Entry();
};
/*
TODO: Rewrite playback thread to manage all of the buffer, and properly marshal the IDirectSound8
object into the thread for creating the buffer there.
The thread should own the buffer and manage all of the playback.
It must be created with start and duration set, and begins playback at the given position.
New functions:
* Seek(pos) : Restart playback from the given position
* SetEnd(pos) : Set new end point
* GetPosition() : Get the current sample number being played
* Stop() : Stop playback immediately
Instead of using a stop event, use a playback parameters changed event. When that one's fired,
detect which were actually changed and act accordingly.
All but GetPosition() set appropriate fields and then raise the parameters changed event.
*/
////////////////////
@ -430,6 +442,8 @@ DirectSoundPlayerThread::~DirectSoundPlayerThread() {
//////////////////////
// Thread entry point
wxThread::ExitCode DirectSoundPlayerThread::Entry() {
CoInitialize(0);
// Wake up thread every half second to fill buffer as needed
// This more or less assumes the buffer is at least one second long
while (WaitForSingleObject(stopnotify, 50) == WAIT_TIMEOUT) {
@ -469,6 +483,8 @@ wxThread::ExitCode DirectSoundPlayerThread::Entry() {
parent->playing = false;
parent->buffer->Stop();
CoUninitialize();
return 0;
}