]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/core/sound.cpp
adding NSImage to CGImageRef conversion
[wxWidgets.git] / src / osx / core / sound.cpp
index 79ba5ffd621b15aa47dd93cb7e81e2601ba9625e..fd9d6d4b768c55814a37479394ed43c6484cb5ea 100644 (file)
 
 #if wxUSE_SOUND
 
-#if wxOSX_USE_AUDIOTOOLBOX
-
 #include "wx/sound.h"
 
+#if wxOSX_USE_AUDIOTOOLBOX
+
 #ifndef WX_PRECOMP
     #include "wx/object.h"
     #include "wx/string.h"
 
 #include "wx/file.h"
 
+#include "wx/osx/private.h"
+
+#include <AudioToolbox/AudioToolbox.h>
+
 class wxOSXAudioToolboxSoundData : public wxSoundData
 {
 public:
@@ -52,7 +56,14 @@ wxOSXAudioToolboxSoundData::wxOSXAudioToolboxSoundData(const wxString& fileName)
     m_sndname = fileName;
 }
 
-void wxOSXAudioToolboxSoundData::CompletionCallback(SystemSoundID  mySSID, void * soundRef)
+wxOSXAudioToolboxSoundData::~wxOSXAudioToolboxSoundData()
+{
+    DoStop();
+}
+
+void
+wxOSXAudioToolboxSoundData::CompletionCallback(SystemSoundID WXUNUSED(mySSID),
+                                               void * soundRef)
 {
     wxOSXAudioToolboxSoundData* data = (wxOSXAudioToolboxSoundData*) soundRef;
     
@@ -87,7 +98,7 @@ void wxOSXAudioToolboxSoundData::DoStop()
     }
 }
 
-bool wxOSXAudioToolboxSoundData::DoPlay(unsigned flags) const
+bool wxOSXAudioToolboxSoundData::Play(unsigned flags)
 {
     Stop();
 
@@ -115,6 +126,21 @@ bool wxOSXAudioToolboxSoundData::DoPlay(unsigned flags) const
     return true;
 }
 
+bool wxSound::Create(int WXUNUSED(size), const wxByte* WXUNUSED(data))
+{
+    wxFAIL_MSG( "not implemented" );
+
+    return false;
+}
+
+bool wxSound::Create(const wxString& fileName, bool isResource)
+{
+    wxCHECK_MSG( !isResource, false, "not implemented" );
+    
+    m_data = new wxOSXAudioToolboxSoundData(fileName);
+    return true;
+}
+
 #endif // wxOSX_USE_AUDIOTOOLBOX
 
 #endif //wxUSE_SOUND