1999-01-01 11:05:26 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wave.h
|
|
|
|
// Purpose: wxWave class (loads and plays short Windows .wav files).
|
|
|
|
// Optional on non-Windows platforms.
|
2003-02-28 16:54:04 -05:00
|
|
|
// Author: Stefan Csomor
|
1999-01-01 11:05:26 -05:00
|
|
|
// Modified by:
|
2003-02-28 16:54:04 -05:00
|
|
|
// Created: 1998-01-01
|
1999-01-01 11:05:26 -05:00
|
|
|
// RCS-ID: $Id$
|
2003-02-28 16:54:04 -05:00
|
|
|
// Copyright: (c) Stefan Csomor
|
2003-02-28 18:48:13 -05:00
|
|
|
// Licence: wxWindows licence
|
1999-01-01 11:05:26 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_WAVE_H_
|
|
|
|
#define _WX_WAVE_H_
|
|
|
|
|
2002-08-31 07:29:13 -04:00
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
1999-01-01 11:05:26 -05:00
|
|
|
#pragma interface "wave.h"
|
|
|
|
#endif
|
|
|
|
|
2002-12-17 16:26:21 -05:00
|
|
|
#if wxUSE_WAVE
|
|
|
|
|
1999-01-01 11:05:26 -05:00
|
|
|
#include "wx/object.h"
|
|
|
|
|
2002-01-20 11:10:45 -05:00
|
|
|
class WXDLLEXPORT wxWave : public wxObject
|
1999-01-01 11:05:26 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxWave();
|
|
|
|
wxWave(const wxString& fileName, bool isResource = FALSE);
|
2002-01-20 11:10:45 -05:00
|
|
|
wxWave(int size, const wxByte* data);
|
1999-01-01 11:05:26 -05:00
|
|
|
~wxWave();
|
|
|
|
|
|
|
|
public:
|
|
|
|
bool Create(const wxString& fileName, bool isResource = FALSE);
|
2001-02-08 16:13:12 -05:00
|
|
|
bool IsOk() const { return !m_sndname.IsEmpty(); }
|
1999-01-01 11:05:26 -05:00
|
|
|
bool Play(bool async = TRUE, bool looped = FALSE) const;
|
|
|
|
|
|
|
|
protected:
|
2002-06-29 12:25:18 -04:00
|
|
|
// prevent collision with some BSD definitions of macro Free()
|
|
|
|
bool FreeData();
|
1999-01-01 11:05:26 -05:00
|
|
|
|
|
|
|
private:
|
2002-01-04 12:13:39 -05:00
|
|
|
void* m_sndChan;
|
2002-12-17 16:26:21 -05:00
|
|
|
|
2001-02-08 16:13:12 -05:00
|
|
|
wxString m_sndname;
|
2002-01-04 12:13:39 -05:00
|
|
|
void* m_hSnd;
|
1999-01-01 11:05:26 -05:00
|
|
|
int m_waveLength;
|
|
|
|
bool m_isResource;
|
|
|
|
};
|
|
|
|
|
2002-12-17 16:26:21 -05:00
|
|
|
#endif
|
1999-01-01 11:05:26 -05:00
|
|
|
#endif
|
|
|
|
// _WX_WAVE_H_
|