diff --git a/include/wx/osx/sound.h b/include/wx/osx/sound.h index f406537927..b395e0ba20 100644 --- a/include/wx/osx/sound.h +++ b/include/wx/osx/sound.h @@ -27,19 +27,25 @@ public : virtual bool Play(unsigned int flags) = 0; // stops the sound and deletes the optional timer virtual void Stop(); - // can be called by a timer for repeated tasks during playback - virtual void SoundTask(); // mark this to be deleted virtual void MarkForDeletion(); virtual bool IsMarkedForDeletion() const { return m_markedForDeletion; } // does the true work of stopping and cleaning up virtual void DoStop() = 0; + +#if wxOSX_USE_CARBON + // can be called by a timer for repeated tasks during playback + virtual void SoundTask(); + protected : void CreateAndStartTimer(); - unsigned int m_flags; wxSoundTimer* m_pTimer; +#endif // wxOSX_USE_CARBON + +protected: + unsigned int m_flags; bool m_markedForDeletion; } ; diff --git a/src/osx/sound_osx.cpp b/src/osx/sound_osx.cpp index 3a125eded7..950eb5f84b 100644 --- a/src/osx/sound_osx.cpp +++ b/src/osx/sound_osx.cpp @@ -20,13 +20,16 @@ #include "wx/string.h" #include "wx/intl.h" #include "wx/log.h" - #include "wx/timer.h" #endif #include "wx/file.h" #include "wx/vector.h" +#if wxOSX_USE_CARBON + +#include "wx/timer.h" + class wxSoundTimer : public wxTimer { public: @@ -52,11 +55,15 @@ protected: wxSoundData* m_sound; }; +#endif // wxOSX_USE_CARBON + wxVector s_soundsPlaying; wxSoundData::wxSoundData() { +#if wxOSX_USE_CARBON m_pTimer = NULL; +#endif // wxOSX_USE_CARBON m_markedForDeletion = false; } @@ -72,9 +79,13 @@ void wxSoundData::MarkForDeletion() void wxSoundData::Stop() { DoStop(); +#if wxOSX_USE_CARBON wxDELETE(m_pTimer); +#endif // wxOSX_USE_CARBON } +#if wxOSX_USE_CARBON + //Time between timer calls #define MOVIE_DELAY 100 @@ -89,6 +100,8 @@ void wxSoundData::CreateAndStartTimer() m_pTimer->Start(MOVIE_DELAY, wxTIMER_CONTINUOUS); } +#endif // wxOSX_USE_CARBON + wxSound::wxSound() { Init();