X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/83f7f12df24a6699fbff014c8c2cc642a1d206ce..cc0bffacebe299b312ce7fdf49a8825f466cf73f:/src/unix/sound.cpp diff --git a/src/unix/sound.cpp b/src/unix/sound.cpp index 76e04c483a..63dd286258 100644 --- a/src/unix/sound.cpp +++ b/src/unix/sound.cpp @@ -5,7 +5,7 @@ // Modified by: // Created: 25/10/98 // RCS-ID: $Id$ -// Copyright: (c) Julian Smart, Vaclav Slavik +// Copyright: (c) Julian Smart, Open Source Applications Foundation // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -23,7 +23,7 @@ #pragma hdrstop #endif -#if wxUSE_WAVE +#if wxUSE_SOUND #include #include @@ -340,6 +340,8 @@ bool wxSoundSyncOnlyAdaptor::Play(wxSoundData *data, unsigned flags, void wxSoundSyncOnlyAdaptor::Stop() { wxLogTrace(_T("sound"), _T("asking audio to stop")); + +#if wxUSE_THREADS // tell the player thread (if running) to stop playback ASAP: m_status.m_stopRequested = true; @@ -350,11 +352,16 @@ void wxSoundSyncOnlyAdaptor::Stop() m_mutexRightToPlay.Lock(); m_mutexRightToPlay.Unlock(); wxLogTrace(_T("sound"), _T("audio was stopped")); +#endif } bool wxSoundSyncOnlyAdaptor::IsPlaying() const { +#if wxUSE_THREADS return m_status.m_playing; +#else + return FALSE; +#endif } @@ -515,10 +522,8 @@ bool wxSound::Create(int size, const wxByte* data) } } -bool wxSound::DoPlay(unsigned flags) +bool wxSound::DoPlay(unsigned flags) const { - wxASSERT_MSG( (flags & wxSOUND_LOOP) == 0 || (flags & wxSOUND_ASYNC) != 0, - _T("sound can only be looped asynchronously") ); wxCHECK_MSG( IsOk(), false, _T("Attempt to play invalid wave data") ); EnsureBackend();