1 // --------------------------------------------------------------------------
5 // Author: Guilhem Lavaux <lavaux@easynet.fr> (C) 1999
7 // License: wxWindows license
8 // --------------------------------------------------------------------------
13 #include "wx/mmedia/defs.h"
14 #include "wx/mmedia/sndbase.h"
16 typedef struct _wxSoundInternal wxSoundInternal
;
17 typedef struct _wxSoundInfoHeader wxSoundInfoHeader
;
19 // class WXDLLIMPEXP_MMEDIA wxSoundInternal;
20 class WXDLLIMPEXP_MMEDIA wxSoundStreamWin
: public wxSoundStream
{
25 wxSoundStream
& Write(const void *buffer
, wxUint32 len
);
26 wxSoundStream
& Read(void *buffer
, wxUint32 len
);
28 bool SetSoundFormat(const wxSoundFormatBase
& base
);
30 bool StartProduction(int evt
);
31 bool StopProduction();
33 bool QueueFilled() const;
35 // Internal but defined as public
36 void NotifyDoneBuffer(wxUint32 dev_handle
, int flag
);
38 wxUint32
GetBestSize() const { return 4096; }
41 wxSoundInternal
*m_internal
;
42 wxUint32 m_current_frag_in
, m_current_frag_out
;
43 wxUint32 m_input_frag_in
, m_output_frag_out
;
44 wxSoundInfoHeader
**m_headers_play
, **m_headers_rec
;
46 bool m_production_started
, m_queue_filled
, m_waiting_for
;
49 void CreateSndWindow();
50 void DestroySndWindow();
51 bool OpenDevice(int mode
);
54 wxSoundInfoHeader
*AllocHeader(int mode
);
55 void FreeHeader(wxSoundInfoHeader
*header
, int mode
);
56 bool AllocHeaders(int mode
);
57 void FreeHeaders(int mode
);
59 void WaitFor(wxSoundInfoHeader
*info
);
60 bool AddToQueue(wxSoundInfoHeader
*info
);
61 void ClearHeader(wxSoundInfoHeader
*info
);
63 wxSoundInfoHeader
*NextFragmentOutput();
64 wxSoundInfoHeader
*NextFragmentInput();