1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2004-02-02 08:15:51 -05:00
|
|
|
// Name: sound.h
|
|
|
|
// 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
|
|
|
|
// 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
|
|
|
|
2003-08-09 08:38:21 -04:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
2004-02-02 08:15:51 -05:00
|
|
|
#pragma interface "sound.h"
|
1998-05-20 10:12:05 -04:00
|
|
|
#endif
|
|
|
|
|
2004-02-02 08:15:51 -05:00
|
|
|
#if wxUSE_SOUND
|
2001-07-13 23:25:40 -04:00
|
|
|
|
1998-06-14 08:15:13 -04:00
|
|
|
#include "wx/object.h"
|
1998-05-20 10:12:05 -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:
|
2004-02-02 08:15:51 -05:00
|
|
|
wxSound();
|
|
|
|
wxSound(const wxString& fileName, bool isResource = false);
|
|
|
|
wxSound(int size, const wxByte* data);
|
|
|
|
~wxSound();
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
public:
|
1998-10-23 14:22:30 -04:00
|
|
|
// Create from resource or file
|
2004-02-02 08:15:51 -05:00
|
|
|
bool Create(const wxString& fileName, bool isResource = false);
|
1998-10-23 14:22:30 -04:00
|
|
|
// Create from data
|
1999-01-19 13:23:02 -05:00
|
|
|
bool Create(int size, const wxByte* data);
|
1998-10-23 14:22:30 -04:00
|
|
|
|
2004-02-02 08:15:51 -05:00
|
|
|
bool IsOk() const { return (m_waveData ? true : false); };
|
|
|
|
|
|
|
|
static void Stop();
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
protected:
|
1998-06-14 08:15:13 -04:00
|
|
|
bool Free();
|
2004-02-02 08:15:51 -05:00
|
|
|
|
|
|
|
bool DoPlay(unsigned flags) const;
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
private:
|
1999-01-19 13:23:02 -05:00
|
|
|
wxByte* m_waveData;
|
1998-05-20 10:12:05 -04:00
|
|
|
int m_waveLength;
|
|
|
|
bool m_isResource;
|
2003-01-02 18:38:11 -05:00
|
|
|
|
2004-02-02 08:15:51 -05:00
|
|
|
DECLARE_NO_COPY_CLASS(wxSound)
|
1998-05-20 10:12:05 -04:00
|
|
|
};
|
2001-07-13 23:25:40 -04:00
|
|
|
#endif
|
1998-05-20 10:12:05 -04:00
|
|
|
#endif
|
|
|
|
|