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
;
58 wxSoundDataFormat m_drvformat
;
61 wxFragmentBuffer(wxSound
& io_drv
);
63 virtual ~wxFragmentBuffer();
66 virtual void AllocIOBuffer() = 0;
68 virtual void FreeIOBuffer() = 0;
71 void AbortBuffer(wxSndBuffer
*buf
);
74 wxFragBufPtr
*FindFreeBuffer(wxFragBufPtr
*list
, wxUint8 max_queue
);
76 bool NotifyOutputBuffer(wxSndBuffer
*buf
);
78 bool NotifyInputBuffer(wxSndBuffer
*buf
);
81 void OnBufferFinished(wxFragBufPtr
*ptr
);
84 virtual bool OnBufferFilled(wxFragBufPtr
*ptr
, wxSndMode mode
) = 0;
87 inline wxSndBuffer
*LastBuffer() {
88 wxNode
*node
= m_iodrv
->m_buffers
.Last();
90 if (!node
) return NULL
;
91 return (wxSndBuffer
*)node
->Data();
94 inline wxSndBuffer
*FirstBuffer() {
95 wxNode
*node
= m_iodrv
->m_buffers
.First();
97 if (!node
) return NULL
;
98 return (wxSndBuffer
*)node
->Data();
101 void FreeBufToFree(bool force
= FALSE
);
102 void ClearBuffer(wxFragBufPtr
*ptr
);