]>
git.saurik.com Git - wxWidgets.git/blob - utils/wxMMedia/sndfile.h
1 // /////////////////////////////////////////////////////////////////////////////
4 // Author: Guilhem Lavaux
7 // Copyright: (C) 1997, 1998, Guilhem Lavaux
8 // License: wxWindows license
9 // /////////////////////////////////////////////////////////////////////////////
10 /* Real -*- C++ -*- */
11 #ifndef __SND_file_H__
12 #define __SND_file_H__
22 class wxSndFileCodec
: public wxMMediaFile
, public wxSndBuffer
{
24 DECLARE_ABSTRACT_CLASS(wxSndFileCodec
)
34 wxUint32 m_fsize
, m_fpos
, m_fdone
;
42 wxSndFileCodec(wxInputStream
& s
, bool preload
, bool seekable
);
44 wxSndFileCodec(wxOutputStream
& s
, bool seekable
);
46 wxSndFileCodec(const wxString
& fname
);
48 virtual ~wxSndFileCodec();
51 void Play(wxSound
& snd
);
53 void Stop(wxSound
& snd
);
55 void Record(wxSound
& snd
,
56 const wxSoundDataFormat
& format
, wxUint32 seconds
);
59 void OnNeedOutputData(char *data
, wxUint32
& size
);
61 void OnBufferInFinished(char *iobuf
, wxUint32
& size
);
64 virtual bool OnNeedData(char *buf
, wxUint32 size
) = 0;
66 virtual bool OnWriteData(char *buf
, wxUint32 size
) = 0;
68 virtual wxUint32
PrepareToPlay() = 0;
70 virtual bool PrepareToRecord(wxUint32 file_size
) = 0;
72 virtual bool TranslateBuffer(wxSndBuffer
& buf
);
74 virtual bool RestartBuffer(wxSndMode mode
);
76 virtual wxUint32
GetSize() const;
78 virtual wxUint32
Available() const;
80 virtual wxMMtime
GetLength();
83 wxMMtime
GetPosition();
86 virtual bool StartPlay();
88 virtual void StopPlay();