]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/sound.cpp
implementation for mac added
[wxWidgets.git] / src / unix / sound.cpp
index 76e04c483a6bf522294c1a50b6ba5b1acacf7119..63dd28625877cacd00d5577c943eb2cdce20f255 100644 (file)
@@ -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 <stdio.h>
 #include <unistd.h>
@@ -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();