]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/wave.cpp
since DoScreenToClient and ClientToScreen in toplvlcmn are implemented by calling...
[wxWidgets.git] / src / mac / carbon / wave.cpp
index ac2dcac7e0975e69eb810911937494416c4b9258..205c5d5ceb2a0b96a8df316ffadef31710a1272a 100644 (file)
 #include "wx/string.h"
 #include "wx/wave.h"
 
+#ifdef __WXMAC__
+#include "wx/mac/private.h"
+#ifndef __DARWIN__
+#include <Sound.h>
+#endif
+#endif
+
 wxWave::wxWave()
   : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(true)
 {
@@ -126,14 +133,18 @@ bool wxWave::Play(bool async, bool looped) const
        
        if (m_isResource) 
        {
-               strcpy(lpSnd, m_sndname); 
-               c2pstr((char *) lpSnd);
-               SndListHandle hSnd;
-               
-               hSnd = (SndListHandle) GetNamedResource('snd ',(const unsigned char *) lpSnd);
+#if TARGET_CARBON
+         c2pstrcpy((unsigned char *)lpSnd, m_sndname);
+#else
+         strcpy(lpSnd, m_sndname);
+         c2pstr((char *) lpSnd);
+#endif
+         SndListHandle hSnd;
+         
+         hSnd = (SndListHandle) GetNamedResource('snd ',(const unsigned char *) lpSnd);
 
-               if ((hSnd != NULL) && (SndPlay(m_sndChan, hSnd, async) == noErr))
-                       ret = true;
+         if ((hSnd != NULL) && (SndPlay((SndChannelPtr)m_sndChan, (SndListHandle) hSnd, async) == noErr))
+           ret = true;
        } 
        
        return ret;