• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/amule/wxWidgets-2.8.12/contrib/include/wx/mmedia/
1// --------------------------------------------------------------------------
2// Name: sndulaw.h
3// Purpose:
4// Date: 08/11/1999
5// Author: Guilhem Lavaux <lavaux@easynet.fr> (C) 1999
6// CVSID: $Id: sndulaw.h 35650 2005-09-23 12:56:45Z MR $
7// License:    wxWindows license
8// --------------------------------------------------------------------------
9#ifndef _WX_SNDULAW_H
10#define _WX_SNDULAW_H
11
12#include "wx/defs.h"
13#include "wx/mmedia/defs.h"
14#include "wx/mmedia/sndcodec.h"
15#include "wx/mmedia/sndbase.h"
16
17//
18// ULAW format
19//
20class WXDLLIMPEXP_MMEDIA wxSoundFormatUlaw: public wxSoundFormatBase {
21public:
22    wxSoundFormatUlaw();
23    ~wxSoundFormatUlaw();
24
25    void SetSampleRate(wxUint32 srate);
26    wxUint32 GetSampleRate() const;
27
28    void SetChannels(wxUint8 channels);
29    wxUint8 GetChannels() const;
30
31    wxSoundFormatType GetType() const { return wxSOUND_ULAW; }
32    wxSoundFormatBase *Clone() const;
33
34    wxUint32 GetTimeFromBytes(wxUint32 bytes) const;
35    wxUint32 GetBytesFromTime(wxUint32 time) const;
36
37    bool operator !=(const wxSoundFormatBase& frmt2) const;
38
39protected:
40    wxUint32 m_srate;
41    wxUint8 m_channels;
42};
43
44//
45// ULAW converter class
46//
47
48class WXDLLIMPEXP_MMEDIA wxSoundRouterStream;
49class WXDLLIMPEXP_MMEDIA wxSoundStreamUlaw: public wxSoundStreamCodec {
50public:
51    wxSoundStreamUlaw(wxSoundStream& sndio);
52    ~wxSoundStreamUlaw();
53
54    wxSoundStream& Read(void *buffer, wxUint32 len);
55    wxSoundStream& Write(const void *buffer, wxUint32 len);
56
57    bool SetSoundFormat(const wxSoundFormatBase& format);
58
59    wxUint32 GetBestSize() const;
60
61protected:
62    wxSoundRouterStream *m_router;
63};
64
65#endif
66