1 // --------------------------------------------------------------------------
5 // Author: Guilhem Lavaux <lavaux@easynet.fr> (C) 1999
7 // --------------------------------------------------------------------------
11 #include <wx/wxprec.h>
14 typedef struct _wxSoundInternal wxSoundInternal
;
15 typedef struct _wxSoundInfoHeader wxSoundInfoHeader
;
17 class WXDLLEXPORT wxSoundStreamWin
: public wxSoundStream
{
22 wxSoundStream
& Write(const void *buffer
, wxUint32 len
);
23 wxSoundStream
& Read(void *buffer
, wxUint32 len
);
25 bool SetSoundFormat(wxSoundFormatBase
& base
);
26 void SetDuplexMode(bool on
) {}
28 bool StartProduction(int evt
);
29 bool StopProduction();
31 bool QueueFilled() const;
33 // Internal but defined as public
34 void NotifyDoneBuffer(wxUint32 dev_handle
);
37 wxSoundInternal
*m_internal
;
38 wxUint32 m_current_frag_in
, m_current_frag_out
;
39 wxUint32 m_input_frag_in
, m_output_frag_out
;
40 wxSoundInfoHeader
**m_headers_play
, **m_headers_rec
;
42 bool m_production_started
, m_queue_filled
;
45 void CreateSndWindow();
46 void DestroySndWindow();
47 bool OpenDevice(int mode
);
50 wxSoundInfoHeader
*AllocHeader(int mode
);
51 void FreeHeader(wxSoundInfoHeader
*header
, int mode
);
52 bool AllocHeaders(int mode
);
53 void FreeHeaders(int mode
);
55 void WaitFor(wxSoundInfoHeader
*info
);
56 bool AddToQueue(wxSoundInfoHeader
*info
);
57 void ClearHeader(wxSoundInfoHeader
*info
);
59 wxSoundInfoHeader
*NextFragmentOutput();
60 wxSoundInfoHeader
*NextFragmentInput();