Skip to content
Extraits de code Groupes Projets
Valider 27e5fdc3 rédigé par Niels Martin Hansen's avatar Niels Martin Hansen
Parcourir les fichiers

Remove spurious #pragma once from DSound audio player, and add a comment about...

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.
parent 6a811254
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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;
}
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter