X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4d6306eb4da8cdac4b5dee9784959672c233eec8..ba681060f36767a2682b8547871af2c6f8159955:/utils/wxMMedia/sndfrmt.h diff --git a/utils/wxMMedia/sndfrmt.h b/utils/wxMMedia/sndfrmt.h index feb0ad62d2..69635c0e6d 100644 --- a/utils/wxMMedia/sndfrmt.h +++ b/utils/wxMMedia/sndfrmt.h @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////////// +// Name: sndfrmt.h +// Purpose: wxMMedia +// Author: Guilhem Lavaux +// Created: 1998 +// Updated: December 1998 +// Copyright: (C) 1997, 1998, Guilhem Lavaux +// License: wxWindows license +//////////////////////////////////////////////////////////////////////////////// #ifndef __SNDFRMT_H__ #define __SNDFRMT_H__ @@ -6,6 +15,7 @@ #endif #include +#include class wxSndBuffer; @@ -19,6 +29,7 @@ class wxSoundCodec; class wxSoundDataFormat { public: wxSoundDataFormat(); + wxSoundDataFormat(const wxSoundDataFormat& format); ~wxSoundDataFormat(); void SetSampleRate(int srate) { m_srate = srate; } @@ -60,6 +71,12 @@ class wxSoundDataFormat { class wxSoundCodec : public wxObject, public wxStreamBase { DECLARE_ABSTRACT_CLASS(wxSoundCodec) + public: + typedef enum { + WAITING = 0, + ENCODING, + DECODING + } ModeType; public: wxSoundCodec(); virtual ~wxSoundCodec(); @@ -68,8 +85,6 @@ class wxSoundCodec : public wxObject, public wxStreamBase { size_t Available(); void InitIO(const wxSoundDataFormat& format); - void InitMode(int mode); - void ExitMode(); inline void SetInStream(wxStreamBuffer *s) { m_in_sound = s; } @@ -78,11 +93,15 @@ class wxSoundCodec : public wxObject, public wxStreamBase { inline wxStreamBuffer *GetInStream() const { return m_in_sound; } inline wxStreamBuffer *GetOutStream() const { return m_out_sound; } - inline bool Good() const { return (m_in_sound->Stream()->LastError() == wxStream_NOERROR) && (m_out_sound->Stream()->LastError() == wxStream_NOERROR); } + inline bool StreamOk() const + { return (m_in_sound->Stream()->LastError() == wxStream_NOERROR) && + (m_out_sound->Stream()->LastError() == wxStream_NOERROR); } virtual size_t GetByteRate() const = 0; virtual wxSoundDataFormat GetPreferredFormat(int codec = 0) const = 0; + virtual void InitMode(ModeType mode); + virtual void ExitMode(); virtual void Decode() = 0; virtual void Encode() = 0; @@ -109,11 +128,7 @@ class wxSoundCodec : public wxObject, public wxStreamBase { wxStreamBuffer *m_in_sound, *m_out_sound; wxSoundCodec *m_chain_codec; bool m_init, m_chain_before; - - enum { - ENCODING = 0, - DECODING - } m_mode; + ModeType m_mode; }; #endif