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
);
27 bool StartProduction(int evt
);
28 bool StopProduction();
30 bool QueueFilled() const;
32 // Internal but defined as public
33 void NotifyDoneBuffer(wxUint32 dev_handle
, int flag
);
35 wxUint32
GetBestSize() const { return 4096; }
38 wxSoundInternal
*m_internal
;
39 wxUint32 m_current_frag_in
, m_current_frag_out
;
40 wxUint32 m_input_frag_in
, m_output_frag_out
;
41 wxSoundInfoHeader
**m_headers_play
, **m_headers_rec
;
43 bool m_production_started
, m_queue_filled
, m_waiting_for
;
46 void CreateSndWindow();
47 void DestroySndWindow();
48 bool OpenDevice(int mode
);
51 wxSoundInfoHeader
*AllocHeader(int mode
);
52 void FreeHeader(wxSoundInfoHeader
*header
, int mode
);
53 bool AllocHeaders(int mode
);
54 void FreeHeaders(int mode
);
56 void WaitFor(wxSoundInfoHeader
*info
);
57 bool AddToQueue(wxSoundInfoHeader
*info
);
58 void ClearHeader(wxSoundInfoHeader
*info
);
60 wxSoundInfoHeader
*NextFragmentOutput();
61 wxSoundInfoHeader
*NextFragmentInput();