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