]> git.saurik.com Git - wxWidgets.git/blob - contrib/include/wx/mmedia/sndwin.h
Copy some missing samples, and contrib for Motif/Mac
[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 // --------------------------------------------------------------------------
8 #ifndef _WX_SNDWIN_H
9 #define _WX_SNDWIN_H
10
11 #include "wx/defs.h"
12 #include "wx/mmedia/defs.h"
13 #include "wx/mmedia/sndbase.h"
14
15 typedef struct _wxSoundInternal wxSoundInternal;
16 typedef struct _wxSoundInfoHeader wxSoundInfoHeader;
17
18 // class WXDLLIMPEXP_MMEDIA wxSoundInternal;
19 class WXDLLIMPEXP_MMEDIA wxSoundStreamWin : public wxSoundStream {
20 public:
21 wxSoundStreamWin();
22 ~wxSoundStreamWin();
23
24 wxSoundStream& Write(const void *buffer, wxUint32 len);
25 wxSoundStream& Read(void *buffer, wxUint32 len);
26
27 bool SetSoundFormat(wxSoundFormatBase& base);
28
29 bool StartProduction(int evt);
30 bool StopProduction();
31
32 bool QueueFilled() const;
33
34 // Internal but defined as public
35 void NotifyDoneBuffer(wxUint32 dev_handle, int flag);
36
37 wxUint32 GetBestSize() const { return 4096; }
38
39 protected:
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;
44
45 bool m_production_started, m_queue_filled, m_waiting_for;
46
47 protected:
48 void CreateSndWindow();
49 void DestroySndWindow();
50 bool OpenDevice(int mode);
51 void CloseDevice();
52
53 wxSoundInfoHeader *AllocHeader(int mode);
54 void FreeHeader(wxSoundInfoHeader *header, int mode);
55 bool AllocHeaders(int mode);
56 void FreeHeaders(int mode);
57
58 void WaitFor(wxSoundInfoHeader *info);
59 bool AddToQueue(wxSoundInfoHeader *info);
60 void ClearHeader(wxSoundInfoHeader *info);
61
62 wxSoundInfoHeader *NextFragmentOutput();
63 wxSoundInfoHeader *NextFragmentInput();
64 };
65
66 #endif