]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/wave.h
* prgodlgg.h: Update() use wxString instead of 'char *'
[wxWidgets.git] / include / wx / gtk / wave.h
CommitLineData
cbb8c1d3
MR
1/////////////////////////////////////////////////////////////////////////////
2// Name: wave.h
3// Purpose: wxWave class
4// Author: Julian Smart
5// Modified by:
6// Created: 25/10/98
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_WAVE_H_
13#define _WX_WAVE_H_
14
15#ifdef __GNUG__
16#pragma interface "wave.h"
17#endif
18
cbb8c1d3
MR
19#include "wx/object.h"
20
21#ifndef AUDIODEV
22#define AUDIODEV "/dev/dsp" // Default path for audio device
23#endif
24
25class wxWave : public wxObject
26{
27public:
28 wxWave();
29 wxWave(const wxString& fileName, bool isResource = FALSE);
57c208c5 30 wxWave(int size, const wxByte* data);
cbb8c1d3
MR
31 ~wxWave();
32
33public:
34 // Create from resource or file
35 bool Create(const wxString& fileName, bool isResource = FALSE);
36 // Create from data
57c208c5 37 bool Create(int size, const wxByte* data);
cbb8c1d3
MR
38
39 bool IsOk() const { return (m_waveData ? TRUE : FALSE); };
40 bool Play(bool async = TRUE, bool looped = FALSE);
41
42protected:
43 bool Free();
44
45private:
57c208c5 46 wxByte* m_waveData;
cbb8c1d3
MR
47 int m_waveLength;
48 bool m_isResource;
49
50
51 int OpenDSP(void);
52 bool InitDSP(int dev, int iDataBits, int iChannel,unsigned long ulSamplingRate);
53 int m_DSPblkSize; // Size of the DSP buffer
54 char *m_data;
55 int m_sizeData;
56};
57
58#endif
59