From bae90c4cd512c351cc2b4b663e0ac1a649911746 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Mon, 2 Feb 2004 13:15:51 +0000 Subject: [PATCH] renamed wxWave to wxSound git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25471 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/mac/{wave.h => sound.h} | 27 ++++++++++++------------ include/wx/msw/{wave.h => sound.h} | 33 ++++++++++++++++-------------- include/wx/os2/{wave.h => sound.h} | 23 +++++++++++---------- 3 files changed, 44 insertions(+), 39 deletions(-) rename include/wx/mac/{wave.h => sound.h} (65%) rename include/wx/msw/{wave.h => sound.h} (53%) rename include/wx/os2/{wave.h => sound.h} (67%) diff --git a/include/wx/mac/wave.h b/include/wx/mac/sound.h similarity index 65% rename from include/wx/mac/wave.h rename to include/wx/mac/sound.h index dcd8095e72..18a84d101b 100644 --- a/include/wx/mac/wave.h +++ b/include/wx/mac/sound.h @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: wave.h -// Purpose: wxWave class (loads and plays short Windows .wav files). +// Name: sound.h +// Purpose: wxSound class (loads and plays short Windows .wav files). // Optional on non-Windows platforms. // Author: Stefan Csomor // Modified by: @@ -10,33 +10,34 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef _WX_WAVE_H_ -#define _WX_WAVE_H_ +#ifndef _WX_SOUND_H_ +#define _WX_SOUND_H_ #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "wave.h" +#pragma interface "sound.h" #endif -#if wxUSE_WAVE +#if wxUSE_SOUND #include "wx/object.h" -class WXDLLEXPORT wxWave : public wxObject +class WXDLLEXPORT wxSound : public wxSoundBase { public: - wxWave(); - wxWave(const wxString& fileName, bool isResource = FALSE); - wxWave(int size, const wxByte* data); - ~wxWave(); + wxSound(); + wxSound(const wxString& fileName, bool isResource = FALSE); + wxSound(int size, const wxByte* data); + ~wxSound(); public: bool Create(const wxString& fileName, bool isResource = FALSE); bool IsOk() const { return !m_sndname.IsEmpty(); } - bool Play(bool async = TRUE, bool looped = FALSE) const; protected: // prevent collision with some BSD definitions of macro Free() bool FreeData(); + + bool DoPlay(unsigned flags) const; private: void* m_sndChan; @@ -49,4 +50,4 @@ private: #endif #endif - // _WX_WAVE_H_ + // _WX_SOUND_H_ diff --git a/include/wx/msw/wave.h b/include/wx/msw/sound.h similarity index 53% rename from include/wx/msw/wave.h rename to include/wx/msw/sound.h index af07fc412c..cdfa05d8d4 100644 --- a/include/wx/msw/wave.h +++ b/include/wx/msw/sound.h @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: wave.h -// Purpose: wxWave class +// Name: sound.h +// Purpose: wxSound class // Author: Julian Smart // Modified by: // Created: 01/02/97 @@ -9,43 +9,46 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef _WX_WAVE_H_ -#define _WX_WAVE_H_ +#ifndef _WX_SOUND_H_ +#define _WX_SOUND_H_ #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "wave.h" +#pragma interface "sound.h" #endif -#if wxUSE_WAVE +#if wxUSE_SOUND #include "wx/object.h" -class WXDLLIMPEXP_ADV wxWave : public wxObject +class WXDLLIMPEXP_ADV wxSound : public wxSoundBase { public: - wxWave(); - wxWave(const wxString& fileName, bool isResource = FALSE); - wxWave(int size, const wxByte* data); - ~wxWave(); + wxSound(); + wxSound(const wxString& fileName, bool isResource = false); + wxSound(int size, const wxByte* data); + ~wxSound(); public: // Create from resource or file - bool Create(const wxString& fileName, bool isResource = FALSE); + bool Create(const wxString& fileName, bool isResource = false); // Create from data bool Create(int size, const wxByte* data); - bool IsOk() const { return (m_waveData ? TRUE : FALSE); }; - bool Play(bool async = TRUE, bool looped = FALSE) const; + bool IsOk() const { return (m_waveData ? true : false); }; + + static void Stop(); protected: bool Free(); + + bool DoPlay(unsigned flags) const; private: wxByte* m_waveData; int m_waveLength; bool m_isResource; - DECLARE_NO_COPY_CLASS(wxWave) + DECLARE_NO_COPY_CLASS(wxSound) }; #endif #endif diff --git a/include/wx/os2/wave.h b/include/wx/os2/sound.h similarity index 67% rename from include/wx/os2/wave.h rename to include/wx/os2/sound.h index fdfce64dc7..c5b39444e4 100644 --- a/include/wx/os2/wave.h +++ b/include/wx/os2/sound.h @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: wave.h -// Purpose: wxWave class (loads and plays short Windows .wav files). +// Name: sound.h +// Purpose: wxSound class (loads and plays short Windows .wav files). // Optional on non-Windows platforms. // Author: David Webster // Modified by: @@ -10,18 +10,18 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef _WX_WAVE_H_ -#define _WX_WAVE_H_ +#ifndef _WX_SOUND_H_ +#define _WX_SOUND_H_ #include "wx/object.h" -class wxWave : public wxObject +class wxSound : public wxSoundBase { public: - wxWave(); - wxWave(const wxString& fileName, bool isResource = FALSE); - wxWave(int size, const wxByte* data); - ~wxWave(); + wxSound(); + wxSound(const wxString& fileName, bool isResource = FALSE); + wxSound(int size, const wxByte* data); + ~wxSound(); public: // Create from resource or file @@ -30,10 +30,11 @@ public: bool Create(int size, const wxByte* data); bool IsOk() const { return (m_waveData ? TRUE : FALSE); }; - bool Play(bool async = TRUE, bool looped = FALSE) const; protected: bool Free(); + + bool DoPlay(unsigned flags) const; private: wxByte* m_waveData; @@ -42,4 +43,4 @@ private: }; #endif - // _WX_WAVE_H_ + // _WX_SOUND_H_ -- 2.45.2