]> git.saurik.com Git - wxWidgets.git/blob - utils/wxMMedia/snduss.h
10b9cb3945ad1646b2a06da6016caa17e1ed3a1b
[wxWidgets.git] / utils / wxMMedia / snduss.h
1 // /////////////////////////////////////////////////////////////////////////////
2 // Name: snduss.h
3 // Purpose: wxMMedia
4 // Author: Guilhem Lavaux
5 // Created: 1997
6 // Updated: 1998
7 // Copyright: (C) 1997, 1998, Guilhem Lavaux
8 // License: wxWindows license
9 // /////////////////////////////////////////////////////////////////////////////
10 /* Real -*- C++ -*- */
11 #ifndef __SND_ussnd_H__
12 #define __SND_ussnd_H__
13 #ifdef __GNUG__
14 #pragma interface
15 #endif
16
17 #include <wx/thread.h>
18 #include "sndsnd.h"
19 #include "sndfrag.h"
20 #include "sndfrmt.h"
21
22 ///
23 class wxUssSound : public wxSound, public wxThread {
24 ///
25 DECLARE_DYNAMIC_CLASS(wxUssSound)
26 public:
27 wxUssSound();
28 ///
29 virtual ~wxUssSound();
30
31 ///
32 void OnNeedBuffer();
33 protected:
34 ///
35 virtual bool Wakeup(wxSndBuffer& buf);
36 ///
37 void USS_Sleep();
38 ///
39 virtual void StopBuffer(wxSndBuffer& buf);
40
41 ///
42 bool OnSetupDriver(wxSndBuffer& buf, wxSndMode mode);
43
44 ///
45 bool SetupSound(wxUint16 srate, wxUint8 bps, bool stereo);
46
47 ///
48 wxUint32 GetNbFragments();
49 ///
50 wxUint32 GetFragmentSize();
51 ///
52 void ThreadEntryPoint();
53
54 protected:
55 ///
56 wxUint16 m_srate;
57 ///
58 wxUint8 m_bps;
59 ///
60 wxUint32 m_max_bufsize;
61 ///
62 bool m_stereo;
63 ///
64 wxSndMode m_mode;
65 ///
66 wxSoundDataFormat m_ussformat;
67 ///
68 wxStreamBuffer *m_sndbuf;
69 ///
70 bool m_stop_thrd, m_sleeping;
71 /// Sound file descriptor.
72 int m_fd;
73 /// Thread sleep mutexes and conditions.
74 wxMutex m_sleep_mtx;
75 wxCondition m_sleep_cond;
76
77 ///
78 bool InitBuffer(wxSndBuffer *buf);
79 bool DoInput(wxSndBuffer *buf);
80 bool DoOutput(wxSndBuffer *buf);
81
82 ///
83 virtual void *Entry();
84 };
85
86 #endif