1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wave.h
|
|
|
|
// Purpose: wxWave class (loads and plays short Windows .wav files).
|
|
|
|
// Optional on non-Windows platforms.
|
1999-10-17 23:30:47 -04:00
|
|
|
// Author: David Webster
|
1999-07-29 01:11:30 -04:00
|
|
|
// Modified by:
|
1999-10-17 23:30:47 -04:00
|
|
|
// Created: 10/17/99
|
1999-07-29 01:11:30 -04:00
|
|
|
// RCS-ID: $Id$
|
1999-10-17 23:30:47 -04:00
|
|
|
// Copyright: (c) David Webster
|
|
|
|
// Licence: wxWindows licence
|
1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_WAVE_H_
|
|
|
|
#define _WX_WAVE_H_
|
|
|
|
|
|
|
|
#include "wx/object.h"
|
|
|
|
|
|
|
|
class wxWave : public wxObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxWave();
|
|
|
|
wxWave(const wxString& fileName, bool isResource = FALSE);
|
1999-10-17 23:30:47 -04:00
|
|
|
wxWave(int size, const wxByte* data);
|
1999-07-29 01:11:30 -04:00
|
|
|
~wxWave();
|
|
|
|
|
|
|
|
public:
|
1999-10-17 23:30:47 -04:00
|
|
|
// Create from resource or file
|
1999-07-29 01:11:30 -04:00
|
|
|
bool Create(const wxString& fileName, bool isResource = FALSE);
|
1999-10-17 23:30:47 -04:00
|
|
|
// Create from data
|
|
|
|
bool Create(int size, const wxByte* data);
|
|
|
|
|
1999-07-29 01:11:30 -04:00
|
|
|
bool IsOk() const { return (m_waveData ? TRUE : FALSE); };
|
|
|
|
bool Play(bool async = TRUE, bool looped = FALSE) const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
bool Free();
|
|
|
|
|
|
|
|
private:
|
1999-10-17 23:30:47 -04:00
|
|
|
wxByte* m_waveData;
|
1999-07-29 01:11:30 -04:00
|
|
|
int m_waveLength;
|
|
|
|
bool m_isResource;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_WAVE_H_
|