1 // --------------------------------------------------------------------------
5 // Author: Guilhem Lavaux <lavaux@easynet.fr> (C) 1999
7 // --------------------------------------------------------------------------
12 #include "wx/mmedia/defs.h"
13 #include "wx/mmedia/sndbase.h"
15 typedef struct _wxSoundInternal wxSoundInternal
;
16 typedef struct _wxSoundInfoHeader wxSoundInfoHeader
;
18 // class WXDLLIMPEXP_MMEDIA wxSoundInternal;
19 class WXDLLIMPEXP_MMEDIA wxSoundStreamWin
: public wxSoundStream
{
24 wxSoundStream
& Write(const void *buffer
, wxUint32 len
);
25 wxSoundStream
& Read(void *buffer
, wxUint32 len
);
27 bool SetSoundFormat(const wxSoundFormatBase
& base
);
29 bool StartProduction(int evt
);
30 bool StopProduction();
32 bool QueueFilled() const;
34 // Internal but defined as public
35 void NotifyDoneBuffer(wxUint32 dev_handle
, int flag
);
37 wxUint32
GetBestSize() const { return 4096; }
40 wxSoundInternal
*m_internal
;
41 wxUint32 m_current_frag_in
, m_current_frag_out
;
42 wxUint32 m_input_frag_in
, m_output_frag_out
;
43 wxSoundInfoHeader
**m_headers_play
, **m_headers_rec
;
45 bool m_production_started
, m_queue_filled
, m_waiting_for
;
48 void CreateSndWindow();
49 void DestroySndWindow();
50 bool OpenDevice(int mode
);
53 wxSoundInfoHeader
*AllocHeader(int mode
);
54 void FreeHeader(wxSoundInfoHeader
*header
, int mode
);
55 bool AllocHeaders(int mode
);
56 void FreeHeaders(int mode
);
58 void WaitFor(wxSoundInfoHeader
*info
);
59 bool AddToQueue(wxSoundInfoHeader
*info
);
60 void ClearHeader(wxSoundInfoHeader
*info
);
62 wxSoundInfoHeader
*NextFragmentOutput();
63 wxSoundInfoHeader
*NextFragmentInput();