1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wave.h
|
|
|
|
// Purpose: wxWave class
|
|
|
|
// 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
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 19:52:45 -04:00
|
|
|
#ifndef _WX_WAVE_H_
|
|
|
|
#define _WX_WAVE_H_
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface "wave.h"
|
|
|
|
#endif
|
|
|
|
|
1998-06-14 08:15:13 -04:00
|
|
|
#include "wx/object.h"
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
class wxWave : public wxObject
|
|
|
|
{
|
|
|
|
public:
|
1998-06-14 08:15:13 -04:00
|
|
|
wxWave();
|
1998-05-20 10:12:05 -04:00
|
|
|
wxWave(const wxString& fileName, bool isResource = FALSE);
|
1998-10-23 14:22:30 -04:00
|
|
|
wxWave(int size, const byte* data);
|
1998-06-14 08:15:13 -04:00
|
|
|
~wxWave();
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
public:
|
1998-10-23 14:22:30 -04:00
|
|
|
// Create from resource or file
|
1998-06-14 08:15:13 -04:00
|
|
|
bool Create(const wxString& fileName, bool isResource = FALSE);
|
1998-10-23 14:22:30 -04:00
|
|
|
// Create from data
|
|
|
|
bool Create(int size, const byte* data);
|
|
|
|
|
1998-06-14 08:15:13 -04:00
|
|
|
bool IsOk() const { return (m_waveData ? TRUE : FALSE); };
|
1998-05-20 10:12:05 -04:00
|
|
|
bool Play(bool async = TRUE, bool looped = FALSE) const;
|
|
|
|
|
|
|
|
protected:
|
1998-06-14 08:15:13 -04:00
|
|
|
bool Free();
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
byte* m_waveData;
|
|
|
|
int m_waveLength;
|
|
|
|
bool m_isResource;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|