X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5b781a6729859abc77e6ca5b1f81cbaad974a78f..050c9e3c90c58b05d5b3f7384d1556ca9669f13e:/src/mac/wave.cpp diff --git a/src/mac/wave.cpp b/src/mac/wave.cpp index 5df346f825..f0891a6546 100644 --- a/src/mac/wave.cpp +++ b/src/mac/wave.cpp @@ -15,15 +15,15 @@ #include "wx/object.h" #include "wx/string.h" -#include "wx/mac/wave.h" +#include "wx/wave.h" wxWave::wxWave() - : m_hSnd(NULL), m_waveLength(0), m_isResource(true), m_sndChan(0) + : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(true) { } wxWave::wxWave(const wxString& sFileName, bool isResource) - : m_hSnd(NULL), m_waveLength(0), m_isResource(true), m_sndChan(0) + : m_sndChan(0), m_hSnd(NULL), m_waveLength(0), m_isResource(true) { Create(sFileName, isResource); } @@ -126,14 +126,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(m_sndChan, hSnd, async) == noErr)) + ret = true; } return ret;