1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wave.h
|
|
|
|
// Purpose: wxWave class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
1998-08-07 23:52:45 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 23:52:45 +00:00
|
|
|
#ifndef _WX_WAVE_H_
|
|
|
|
#define _WX_WAVE_H_
|
1998-05-20 14:12:05 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface "wave.h"
|
|
|
|
#endif
|
|
|
|
|
2001-07-14 03:25:40 +00:00
|
|
|
#if wxUSE_WAVE
|
|
|
|
|
1998-06-14 12:15:13 +00:00
|
|
|
#include "wx/object.h"
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-01-08 15:21:26 +00:00
|
|
|
class WXDLLEXPORT wxWave : public wxObject
|
1998-05-20 14:12:05 +00:00
|
|
|
{
|
|
|
|
public:
|
1998-06-14 12:15:13 +00:00
|
|
|
wxWave();
|
1998-05-20 14:12:05 +00:00
|
|
|
wxWave(const wxString& fileName, bool isResource = FALSE);
|
1999-01-19 18:23:02 +00:00
|
|
|
wxWave(int size, const wxByte* data);
|
1998-06-14 12:15:13 +00:00
|
|
|
~wxWave();
|
1998-05-20 14:12:05 +00:00
|
|
|
|
|
|
|
public:
|
1998-10-23 18:22:30 +00:00
|
|
|
// Create from resource or file
|
1998-06-14 12:15:13 +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
|
|
|
|
1998-06-14 12:15:13 +00:00
|
|
|
bool IsOk() const { return (m_waveData ? TRUE : FALSE); };
|
1998-05-20 14:12:05 +00:00
|
|
|
bool Play(bool async = TRUE, bool looped = FALSE) const;
|
|
|
|
|
|
|
|
protected:
|
1998-06-14 12:15:13 +00:00
|
|
|
bool Free();
|
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;
|
|
|
|
};
|
2001-07-14 03:25:40 +00:00
|
|
|
#endif
|
1998-05-20 14:12:05 +00:00
|
|
|
#endif
|
|
|
|
|