renamed wxWave to wxSound

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25471 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2004-02-02 13:15:51 +00:00
parent d93966b92a
commit bae90c4cd5
3 changed files with 44 additions and 39 deletions

View File

@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: wave.h // Name: sound.h
// Purpose: wxWave class (loads and plays short Windows .wav files). // Purpose: wxSound class (loads and plays short Windows .wav files).
// Optional on non-Windows platforms. // Optional on non-Windows platforms.
// Author: Stefan Csomor // Author: Stefan Csomor
// Modified by: // Modified by:
@@ -10,33 +10,34 @@
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifndef _WX_WAVE_H_ #ifndef _WX_SOUND_H_
#define _WX_WAVE_H_ #define _WX_SOUND_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "wave.h" #pragma interface "sound.h"
#endif #endif
#if wxUSE_WAVE #if wxUSE_SOUND
#include "wx/object.h" #include "wx/object.h"
class WXDLLEXPORT wxWave : public wxObject class WXDLLEXPORT wxSound : public wxSoundBase
{ {
public: public:
wxWave(); wxSound();
wxWave(const wxString& fileName, bool isResource = FALSE); wxSound(const wxString& fileName, bool isResource = FALSE);
wxWave(int size, const wxByte* data); wxSound(int size, const wxByte* data);
~wxWave(); ~wxSound();
public: public:
bool Create(const wxString& fileName, bool isResource = FALSE); bool Create(const wxString& fileName, bool isResource = FALSE);
bool IsOk() const { return !m_sndname.IsEmpty(); } bool IsOk() const { return !m_sndname.IsEmpty(); }
bool Play(bool async = TRUE, bool looped = FALSE) const;
protected: protected:
// prevent collision with some BSD definitions of macro Free() // prevent collision with some BSD definitions of macro Free()
bool FreeData(); bool FreeData();
bool DoPlay(unsigned flags) const;
private: private:
void* m_sndChan; void* m_sndChan;
@@ -49,4 +50,4 @@ private:
#endif #endif
#endif #endif
// _WX_WAVE_H_ // _WX_SOUND_H_

View File

@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: wave.h // Name: sound.h
// Purpose: wxWave class // Purpose: wxSound class
// Author: Julian Smart // Author: Julian Smart
// Modified by: // Modified by:
// Created: 01/02/97 // Created: 01/02/97
@@ -9,43 +9,46 @@
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifndef _WX_WAVE_H_ #ifndef _WX_SOUND_H_
#define _WX_WAVE_H_ #define _WX_SOUND_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "wave.h" #pragma interface "sound.h"
#endif #endif
#if wxUSE_WAVE #if wxUSE_SOUND
#include "wx/object.h" #include "wx/object.h"
class WXDLLIMPEXP_ADV wxWave : public wxObject class WXDLLIMPEXP_ADV wxSound : public wxSoundBase
{ {
public: public:
wxWave(); wxSound();
wxWave(const wxString& fileName, bool isResource = FALSE); wxSound(const wxString& fileName, bool isResource = false);
wxWave(int size, const wxByte* data); wxSound(int size, const wxByte* data);
~wxWave(); ~wxSound();
public: public:
// Create from resource or file // Create from resource or file
bool Create(const wxString& fileName, bool isResource = FALSE); bool Create(const wxString& fileName, bool isResource = false);
// Create from data // Create from data
bool Create(int size, const wxByte* data); bool Create(int size, const wxByte* data);
bool IsOk() const { return (m_waveData ? TRUE : FALSE); }; bool IsOk() const { return (m_waveData ? true : false); };
bool Play(bool async = TRUE, bool looped = FALSE) const;
static void Stop();
protected: protected:
bool Free(); bool Free();
bool DoPlay(unsigned flags) const;
private: private:
wxByte* m_waveData; wxByte* m_waveData;
int m_waveLength; int m_waveLength;
bool m_isResource; bool m_isResource;
DECLARE_NO_COPY_CLASS(wxWave) DECLARE_NO_COPY_CLASS(wxSound)
}; };
#endif #endif
#endif #endif

View File

@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: wave.h // Name: sound.h
// Purpose: wxWave class (loads and plays short Windows .wav files). // Purpose: wxSound class (loads and plays short Windows .wav files).
// Optional on non-Windows platforms. // Optional on non-Windows platforms.
// Author: David Webster // Author: David Webster
// Modified by: // Modified by:
@@ -10,18 +10,18 @@
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifndef _WX_WAVE_H_ #ifndef _WX_SOUND_H_
#define _WX_WAVE_H_ #define _WX_SOUND_H_
#include "wx/object.h" #include "wx/object.h"
class wxWave : public wxObject class wxSound : public wxSoundBase
{ {
public: public:
wxWave(); wxSound();
wxWave(const wxString& fileName, bool isResource = FALSE); wxSound(const wxString& fileName, bool isResource = FALSE);
wxWave(int size, const wxByte* data); wxSound(int size, const wxByte* data);
~wxWave(); ~wxSound();
public: public:
// Create from resource or file // Create from resource or file
@@ -30,10 +30,11 @@ public:
bool Create(int size, const wxByte* data); bool Create(int size, const wxByte* data);
bool IsOk() const { return (m_waveData ? TRUE : FALSE); }; bool IsOk() const { return (m_waveData ? TRUE : FALSE); };
bool Play(bool async = TRUE, bool looped = FALSE) const;
protected: protected:
bool Free(); bool Free();
bool DoPlay(unsigned flags) const;
private: private:
wxByte* m_waveData; wxByte* m_waveData;
@@ -42,4 +43,4 @@ private:
}; };
#endif #endif
// _WX_WAVE_H_ // _WX_SOUND_H_