1 // /////////////////////////////////////////////////////////////////////////////
4 // Author: Guilhem Lavaux
7 // Copyright: (C) 1997, 1998, Guilhem Lavaux
8 // License: wxWindows license
9 // /////////////////////////////////////////////////////////////////////////////
10 /* Real -*- C++ -*- */
17 #ifdef WXMMEDIA_INTERNAL
18 #include <wx/msw/private.h>
22 typedef struct wxWinSoundInternal
{
28 typedef struct wxSndWinInfo
{
29 HGLOBAL h_data
, h_hdr
;
37 /** Sound buffer fragmenter: windows specific implementation
38 * @author Guilhem Lavaux
40 class wxSndWinFragment
: public wxFragmentBuffer
{
42 wxSndWinFragment(wxSound
& io_drv
);
43 virtual ~wxSndWinFragment(void);
45 virtual void AllocIOBuffer(void);
46 virtual void FreeIOBuffer(void);
48 virtual bool OnBufferFilled(wxFragBufPtr
*ptr
, wxSndMode mode
);
54 class wxWinSound
: public wxSound
{
56 DECLARE_DYNAMIC_CLASS(wxWinSound
)
58 struct wxWinSoundInternal
*internal
;
61 bool wout_opened
, win_opened
;
63 wxUint32 curr_o_srate
, curr_i_srate
;
65 wxUint8 curr_o_bps
, curr_i_bps
;
67 bool curr_o_stereo
, curr_i_stereo
;
72 wxSndWinFragment fragments
;
74 #ifdef WXMMEDIA_INTERNAL
76 friend LRESULT APIENTRY _EXPORT
wxSoundHandlerWndProc(HWND win
,
78 WPARAM wParam
, LPARAM lParam
);
86 virtual ~wxWinSound(void);
89 void OnNeedBuffer(wxSndMode mode
);
91 void StopBuffer(wxSndBuffer
& buf
);
94 virtual bool Wakeup(wxSndBuffer
& buf
);
97 bool Reopen(wxSndBuffer
& buf
, bool force
);
100 friend class wxSndWinFragment
;
103 void PrepareHeader(wxFragmentBuffer::wxFragBufPtr
& frag
, wxSndMode mode
);
105 void UnprepareHeader(wxFragmentBuffer::wxFragBufPtr
& frag
, wxSndMode mode
);