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
|
|
|
|
1999-01-08 10:21:26 -05:00
|
|
|
class WXDLLEXPORT wxWave : public wxObject
|
1998-05-20 10:12:05 -04:00
|
|
|
{
|
|
|
|
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);
|
1999-01-19 13:23:02 -05:00
|
|
|
wxWave(int size, const wxByte* 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
|
1999-01-19 13:23:02 -05:00
|
|
|
bool Create(int size, const wxByte* data);
|
1998-10-23 14:22:30 -04:00
|
|
|
|
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:
|
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;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|