]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/wave.h
little doc updates
[wxWidgets.git] / include / wx / gtk1 / wave.h
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
19 #include "wx/object.h"
20
21 #ifndef AUDIODEV
22 #define AUDIODEV "/dev/dsp" // Default path for audio device
23 #endif
24
25 class wxWave : public wxObject
26 {
27 public:
28 wxWave();
29 wxWave(const wxString& fileName, bool isResource = FALSE);
30 wxWave(int size, const wxByte* data);
31 ~wxWave();
32
33 public:
34 // Create from resource or file
35 bool Create(const wxString& fileName, bool isResource = FALSE);
36 // Create from data
37 bool Create(int size, const wxByte* data);
38
39 bool IsOk() const { return (m_waveData ? TRUE : FALSE); };
40 bool Play(bool async = TRUE, bool looped = FALSE);
41
42 protected:
43 bool Free();
44
45 private:
46 wxByte* m_waveData;
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