]>
git.saurik.com Git - wxWidgets.git/blob - utils/wxMMedia/sndfrag.h
8acb31f9cf4a34548b71b49a5a13e9bae6f97b04
1 // /////////////////////////////////////////////////////////////////////////////
4 // Author: Guilhem Lavaux
7 // Copyright: (C) 1997, 1998, Guilhem Lavaux
8 // License: wxWindows license
9 // /////////////////////////////////////////////////////////////////////////////
10 #ifndef __SND_frag_H__
11 #define __SND_frag_H__
24 class wxFragmentBuffer
{
29 wxUint8 m_maxoq
, m_maxiq
;
52 wxFragBufPtr
*m_optrs
, *m_iptrs
;
54 wxFragBufPtr
*m_lstoptrs
, *m_lstiptrs
;
56 bool m_buf2free
, m_dontq
, m_freeing
;
59 wxFragmentBuffer(wxSound
& io_drv
);
61 virtual ~wxFragmentBuffer();
64 virtual void AllocIOBuffer() = 0;
66 virtual void FreeIOBuffer() = 0;
69 void AbortBuffer(wxSndBuffer
*buf
);
72 wxFragBufPtr
*FindFreeBuffer(wxFragBufPtr
*list
, wxUint8 max_queue
);
74 bool NotifyOutputBuffer(wxSndBuffer
*buf
);
76 bool NotifyInputBuffer(wxSndBuffer
*buf
);
79 void OnBufferFinished(wxFragBufPtr
*ptr
);
82 virtual bool OnBufferFilled(wxFragBufPtr
*ptr
, wxSndMode mode
) = 0;
85 inline wxSndBuffer
*LastBuffer() {
86 wxNode
*node
= m_iodrv
->m_buffers
.Last();
88 if (!node
) return NULL
;
89 return (wxSndBuffer
*)node
->Data();
92 inline wxSndBuffer
*FirstBuffer() {
93 wxNode
*node
= m_iodrv
->m_buffers
.First();
95 if (!node
) return NULL
;
96 return (wxSndBuffer
*)node
->Data();
99 void FreeBufToFree(bool force
= FALSE
);
100 void ClearBuffer(wxFragBufPtr
*ptr
);