1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2005-07-29 09:19:32 -04:00
|
|
|
// Name: wx/msw/sound.h
|
2004-02-02 08:15:51 -05:00
|
|
|
// Purpose: wxSound class
|
1998-05-20 10:12:05 -04:00
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
1998-08-07 19:52:45 -04:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-09-03 21:53:42 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2004-02-02 08:15:51 -05:00
|
|
|
#ifndef _WX_SOUND_H_
|
|
|
|
#define _WX_SOUND_H_
|
1998-05-20 10:12:05 -04:00
|
|
|
|
2004-02-02 08:15:51 -05:00
|
|
|
#if wxUSE_SOUND
|
2001-07-13 23:25:40 -04:00
|
|
|
|
2004-02-02 08:15:51 -05:00
|
|
|
class WXDLLIMPEXP_ADV wxSound : public wxSoundBase
|
1998-05-20 10:12:05 -04:00
|
|
|
{
|
|
|
|
public:
|
2005-07-29 09:19:32 -04:00
|
|
|
wxSound();
|
|
|
|
wxSound(const wxString& fileName, bool isResource = false);
|
|
|
|
wxSound(int size, const wxByte* data);
|
|
|
|
virtual ~wxSound();
|
1998-05-20 10:12:05 -04:00
|
|
|
|
2005-07-29 09:19:32 -04:00
|
|
|
// Create from resource or file
|
|
|
|
bool Create(const wxString& fileName, bool isResource = false);
|
1998-10-23 14:22:30 -04:00
|
|
|
|
2005-07-29 09:19:32 -04:00
|
|
|
// Create from data
|
|
|
|
bool Create(int size, const wxByte* data);
|
2004-09-03 21:53:42 -04:00
|
|
|
|
2005-07-29 09:19:32 -04:00
|
|
|
bool IsOk() const { return m_data != NULL; }
|
|
|
|
|
|
|
|
static void Stop();
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
protected:
|
2005-07-29 09:19:32 -04:00
|
|
|
void Init() { m_data = NULL; }
|
|
|
|
bool CheckCreatedOk();
|
|
|
|
void Free();
|
2004-09-03 21:53:42 -04:00
|
|
|
|
2005-07-29 09:19:32 -04:00
|
|
|
virtual bool DoPlay(unsigned flags) const;
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
private:
|
2005-07-29 09:19:32 -04:00
|
|
|
// data of this object
|
|
|
|
class wxSoundData *m_data;
|
2003-01-02 18:38:11 -05:00
|
|
|
|
2009-02-08 06:45:59 -05:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxSound);
|
1998-05-20 10:12:05 -04:00
|
|
|
};
|
2005-07-29 09:19:32 -04:00
|
|
|
|
|
|
|
#endif // wxUSE_SOUND
|
|
|
|
|
|
|
|
#endif // _WX_SOUND_H_
|
1998-05-20 10:12:05 -04:00
|
|
|
|