X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/03e11df5470fd64d9d9a669d0b50b84c2d714736..66ce9e0609ac419e6eeff665b1087193954ed84a:/src/mac/wave.cpp?ds=sidebyside diff --git a/src/mac/wave.cpp b/src/mac/wave.cpp index ac2dcac7e0..7cc1c23534 100644 --- a/src/mac/wave.cpp +++ b/src/mac/wave.cpp @@ -17,6 +17,13 @@ #include "wx/string.h" #include "wx/wave.h" +#ifdef __WXMAC__ +#include "wx/mac/private.h" +#ifndef __DARWIN__ +#include +#endif +#endif + wxWave::wxWave() : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(true) { @@ -34,6 +41,11 @@ wxWave::~wxWave() Free(); } +wxWave::wxWave(int size, const wxByte* data) + : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(false) +{ + //TODO convert data +} bool wxWave::Create(const wxString& fileName, bool isResource) { @@ -126,14 +138,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;