1 // /////////////////////////////////////////////////////////////////////////////
4 // Author: Guilhem Lavaux
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__
17 #include <wx/thread.h>
23 class wxUssSound
: public wxSound
, public wxThread
{
25 DECLARE_DYNAMIC_CLASS(wxUssSound
)
29 virtual ~wxUssSound();
35 virtual bool Wakeup(wxSndBuffer
& buf
);
39 virtual void StopBuffer(wxSndBuffer
& buf
);
42 bool OnSetupDriver(wxSndBuffer
& buf
, wxSndMode mode
);
45 bool SetupSound(wxUint16 srate
, wxUint8 bps
, bool stereo
);
48 wxUint32
GetNbFragments();
50 wxUint32
GetFragmentSize();
52 void ThreadEntryPoint();
60 wxUint32 m_max_bufsize
;
66 wxSoundDataFormat m_ussformat
;
68 wxStreamBuffer
*m_sndbuf
;
70 bool m_stop_thrd
, m_sleeping
;
71 /// Sound file descriptor.
73 /// Thread sleep mutexes and conditions.
75 wxCondition m_sleep_cond
;
78 bool InitBuffer(wxSndBuffer
*buf
);
79 bool DoInput(wxSndBuffer
*buf
);
80 bool DoOutput(wxSndBuffer
*buf
);
83 virtual void *Entry();