1999-07-29 05:11:30 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2004-02-02 13:15:51 +00:00
|
|
|
// Name: sound.h
|
|
|
|
// Purpose: wxSound class (loads and plays short Windows .wav files).
|
1999-07-29 05:11:30 +00:00
|
|
|
// Optional on non-Windows platforms.
|
1999-10-18 03:30:47 +00:00
|
|
|
// Author: David Webster
|
1999-07-29 05:11:30 +00:00
|
|
|
// Modified by:
|
1999-10-18 03:30:47 +00:00
|
|
|
// Created: 10/17/99
|
1999-07-29 05:11:30 +00:00
|
|
|
// RCS-ID: $Id$
|
1999-10-18 03:30:47 +00:00
|
|
|
// Copyright: (c) David Webster
|
2004-05-23 14:56:36 +00:00
|
|
|
// Licence: wxWidgets licence
|
1999-07-29 05:11:30 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2004-02-02 13:15:51 +00:00
|
|
|
#ifndef _WX_SOUND_H_
|
|
|
|
#define _WX_SOUND_H_
|
1999-07-29 05:11:30 +00:00
|
|
|
|
|
|
|
#include "wx/object.h"
|
|
|
|
|
2004-02-02 13:15:51 +00:00
|
|
|
class wxSound : public wxSoundBase
|
1999-07-29 05:11:30 +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();
|
1999-07-29 05:11:30 +00:00
|
|
|
|
|
|
|
public:
|
1999-10-18 03:30:47 +00:00
|
|
|
// Create from resource or file
|
1999-07-29 05:11:30 +00:00
|
|
|
bool Create(const wxString& fileName, bool isResource = FALSE);
|
1999-10-18 03:30:47 +00:00
|
|
|
// Create from data
|
|
|
|
bool Create(int size, const wxByte* data);
|
|
|
|
|
1999-07-29 05:11:30 +00:00
|
|
|
bool IsOk() const { return (m_waveData ? TRUE : FALSE); };
|
|
|
|
|
|
|
|
protected:
|
|
|
|
bool Free();
|
2004-02-02 13:15:51 +00:00
|
|
|
|
|
|
|
bool DoPlay(unsigned flags) const;
|
1999-07-29 05:11:30 +00:00
|
|
|
|
|
|
|
private:
|
1999-10-18 03:30:47 +00:00
|
|
|
wxByte* m_waveData;
|
1999-07-29 05:11:30 +00:00
|
|
|
int m_waveLength;
|
|
|
|
bool m_isResource;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
2004-02-02 13:15:51 +00:00
|
|
|
// _WX_SOUND_H_
|