]> git.saurik.com Git - wxWidgets.git/blob - contrib/include/wx/mmedia/sndwin.h
generate makefile.unx files using bakefile
[wxWidgets.git] / contrib / include / wx / mmedia / sndwin.h
1 // --------------------------------------------------------------------------
2 // Name: sndwin.h
3 // Purpose:
4 // Date: 08/11/1999
5 // Author: Guilhem Lavaux <lavaux@easynet.fr> (C) 1999
6 // CVSID: $Id$
7 // License: wxWindows license
8 // --------------------------------------------------------------------------
9 #ifndef _WX_SNDWIN_H
10 #define _WX_SNDWIN_H
11
12 #include "wx/defs.h"
13 #include "wx/mmedia/defs.h"
14 #include "wx/mmedia/sndbase.h"
15
16 typedef struct _wxSoundInternal wxSoundInternal;
17 typedef struct _wxSoundInfoHeader wxSoundInfoHeader;
18
19 // class WXDLLIMPEXP_MMEDIA wxSoundInternal;
20 class WXDLLIMPEXP_MMEDIA wxSoundStreamWin : public wxSoundStream {
21 public:
22 wxSoundStreamWin();
23 ~wxSoundStreamWin();
24
25 wxSoundStream& Write(const void *buffer, wxUint32 len);
26 wxSoundStream& Read(void *buffer, wxUint32 len);
27
28 bool SetSoundFormat(const wxSoundFormatBase& base);
29
30 bool StartProduction(int evt);
31 bool StopProduction();
32
33 bool QueueFilled() const;
34
35 // Internal but defined as public
36 void NotifyDoneBuffer(wxUint32 dev_handle, int flag);
37
38 wxUint32 GetBestSize() const { return 4096; }
39
40 protected:
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;
45
46 bool m_production_started, m_queue_filled, m_waiting_for;
47
48 protected:
49 void CreateSndWindow();
50 void DestroySndWindow();
51 bool OpenDevice(int mode);
52 void CloseDevice();
53
54 wxSoundInfoHeader *AllocHeader(int mode);
55 void FreeHeader(wxSoundInfoHeader *header, int mode);
56 bool AllocHeaders(int mode);
57 void FreeHeaders(int mode);
58
59 void WaitFor(wxSoundInfoHeader *info);
60 bool AddToQueue(wxSoundInfoHeader *info);
61 void ClearHeader(wxSoundInfoHeader *info);
62
63 wxSoundInfoHeader *NextFragmentOutput();
64 wxSoundInfoHeader *NextFragmentInput();
65 };
66
67 #endif