X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/926c550dc5347b149be7a5f02dd452865a8a524d..9f06bcb3b8aea7aa709754a217c26e94fe2d5954:/utils/wxMMedia/sndfrmt.h diff --git a/utils/wxMMedia/sndfrmt.h b/utils/wxMMedia/sndfrmt.h index 1e4249bf9e..6a67db7de2 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__ @@ -27,6 +36,7 @@ class wxSoundDataFormat { void SetChannels(int channels); void SetStereo(bool on); void SetCodecNo(int no); + int GetCodecNo() { return m_codno; } void SetCodecCreate(bool create) { m_codcreate = create; } int GetSampleRate() const { return m_srate; } @@ -62,6 +72,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(); @@ -70,8 +86,7 @@ class wxSoundCodec : public wxObject, public wxStreamBase { size_t Available(); void InitIO(const wxSoundDataFormat& format); - void InitMode(int mode); - void ExitMode(); + virtual void InitWith(const wxSoundDataFormat& format) {} inline void SetInStream(wxStreamBuffer *s) { m_in_sound = s; } @@ -87,6 +102,8 @@ class wxSoundCodec : public wxObject, public wxStreamBase { 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; @@ -113,11 +130,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