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