]> git.saurik.com Git - wxWidgets.git/blame - utils/wxMMedia2/lib/sndwin.h
Major changes in wxVidXANIM (support for output filtering)
[wxWidgets.git] / utils / wxMMedia2 / lib / sndwin.h
CommitLineData
503aa33d
GL
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/wxprec.h>
12#include "sndbase.h"
13
14typedef struct _wxSoundInternal wxSoundInternal;
15typedef struct _wxSoundInfoHeader wxSoundInfoHeader;
16
17class WXDLLEXPORT wxSoundStreamWin : public wxSoundStream {
18 public:
19 wxSoundStreamWin();
20 ~wxSoundStreamWin();
21
0662cd32
GL
22 wxSoundStream& Write(const void *buffer, wxUint32 len);
23 wxSoundStream& Read(void *buffer, wxUint32 len);
503aa33d
GL
24
25 bool SetSoundFormat(wxSoundFormatBase& base);
503aa33d
GL
26
27 bool StartProduction(int evt);
28 bool StopProduction();
29
30 bool QueueFilled() const;
31
32 // Internal but defined as public
56dc1ffd 33 void NotifyDoneBuffer(wxUint32 dev_handle, int flag);
503aa33d 34
e3367904
GL
35 wxUint32 GetBestSize() const { return 4096; }
36
503aa33d
GL
37 protected:
38 wxSoundInternal *m_internal;
39 wxUint32 m_current_frag_in, m_current_frag_out;
40 wxUint32 m_input_frag_in, m_output_frag_out;
41 wxSoundInfoHeader **m_headers_play, **m_headers_rec;
42
e3367904 43 bool m_production_started, m_queue_filled, m_waiting_for;
503aa33d
GL
44
45 protected:
46 void CreateSndWindow();
47 void DestroySndWindow();
48 bool OpenDevice(int mode);
49 void CloseDevice();
50
51 wxSoundInfoHeader *AllocHeader(int mode);
52 void FreeHeader(wxSoundInfoHeader *header, int mode);
53 bool AllocHeaders(int mode);
54 void FreeHeaders(int mode);
55
56 void WaitFor(wxSoundInfoHeader *info);
57 bool AddToQueue(wxSoundInfoHeader *info);
58 void ClearHeader(wxSoundInfoHeader *info);
59
60 wxSoundInfoHeader *NextFragmentOutput();
61 wxSoundInfoHeader *NextFragmentInput();
62};
63
64#endif