]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/sound.cpp
use wx-style header and commets; fix indentation to be 4 spaces; move Doxygen comment...
[wxWidgets.git] / src / mac / carbon / sound.cpp
index b4ecddd1e0a376bf397f59dac051d71f34943d98..b3ff384fc86d9544d2b81cede45cca6357e8de31 100644 (file)
 #endif
 #endif
 
-#if defined __WXMAC__ && defined __DARWIN__/*TARGET_CARBON*/
-#ifdef __APPLE_CC__
 #include <Carbon/Carbon.h>
-#else
-#include <Carbon.h>
-#endif
-#else
-#include <Sound.h>
-#endif
 
 //quicktime media layer only required for mac emulation on pc
 #ifndef __WXMAC__
 static wxTimer* lastSoundTimer=NULL;
 static bool lastSoundIsPlaying=false;
 
+#if !defined(__LP64__)
+#define USE_QUICKTIME 1
+#else
+#define USE_QUICKTIME 0
+#endif
+
+#if USE_QUICKTIME
 // ------------------------------------------------------------------
 //          wxQTTimer - Handle Asyncronous Playing
 // ------------------------------------------------------------------
@@ -244,6 +243,8 @@ inline bool wxInitQT ()
     }
 }
 
+#endif
+
 wxSound::wxSound()
 : m_hSnd(NULL), m_waveLength(0), m_pTimer(NULL), m_type(wxSound_NONE)
 {
@@ -296,6 +297,8 @@ bool wxSound::DoPlay(unsigned flags) const
 {
     Stop();
 
+#if USE_QUICKTIME
+
     Movie movie;
 
     switch(m_type)
@@ -390,7 +393,7 @@ bool wxSound::DoPlay(unsigned flags) const
             Handle dataRef = NULL;
             OSType dataRefType;
 
-            err = QTNewDataReferenceFromFullPathCFString(wxMacCFStringHolder(m_sndname,wxLocale::GetSystemEncoding()),
+            err = QTNewDataReferenceFromFullPathCFString(wxCFStringRef(m_sndname,wxLocale::GetSystemEncoding()),
                 (UInt32)kQTNativeDefaultPathStyle, 0, &dataRef, &dataRefType);
 
             wxASSERT(err == noErr);
@@ -439,6 +442,7 @@ bool wxSound::DoPlay(unsigned flags) const
 
         DisposeMovie(movie);
     }
+#endif
 
     return true;
 }
@@ -460,10 +464,13 @@ void wxSound::Stop()
 
 void* wxSound::GetHandle()
 {
+#if USE_QUICKTIME
     if(m_type == wxSound_RESOURCE)
         return (void*)  ((wxSMTimer*)m_pTimer)->GetChannel();
 
     return (void*) ((wxQTTimer*) m_pTimer)->GetMovie();
+#endif
+    return NULL;
 }
 
 #endif //wxUSE_SOUND