sipxmedialib  Version 3.3
MpodBufferRecorder.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2007 SIPez LLC.
3 // Licensed to SIPfoundry under a Contributor Agreement.
4 //
5 // Copyright (C) 2007 SIPfoundry Inc.
6 // Licensed by SIPfoundry under the LGPL license.
7 //
8 // $$
10 
11 // Author: Alexander Chemeris <Alexander DOT Chemeris AT SIPez DOT com>
12 
13 #ifndef _MpodBufferRecorder_h_
14 #define _MpodBufferRecorder_h_
15 
16 // SYSTEM INCLUDES
17 //#include <utl/UtlDefs.h>
18 #include <os/OsStatus.h>
19 #include <utl/UtlString.h>
20 
21 // APPLICATION INCLUDES
23 
24 // DEFINES
25 // MACROS
26 // EXTERNAL FUNCTIONS
27 // EXTERNAL VARIABLES
28 // CONSTANTS
29 // STRUCTS
30 // TYPEDEFS
31 // FORWARD DECLARATIONS
32 class OsNotification;
33 class OsTimer;
34 
40 {
41 /* //////////////////////////// PUBLIC //////////////////////////////////// */
42 public:
43 
44 /* ============================ CREATORS ================================== */
46 
47 
49  explicit
50  MpodBufferRecorder(const UtlString& name, MpFrameTime bufferLength);
57  virtual
60 
62 
63 /* ============================ MANIPULATORS ============================== */
65 
66 
68  virtual OsStatus enableDevice(unsigned samplesPerFrame,
69  unsigned samplesPerSec,
70  MpFrameTime currentFrameTime,
71  OsCallback &frameTicker);
72 
74  virtual OsStatus disableDevice();
75 
77  virtual
78  OsStatus pushFrame(unsigned int numSamples,
79  const MpAudioSample* samples,
80  MpFrameTime frameTime);
81 
83 
84 /* ============================ ACCESSORS ================================= */
86 
87 
88  inline
89  const MpAudioSample *getBufferData() const;
90 
91  inline
92  unsigned getBufferLength() const;
93 
94  inline
95  unsigned getBufferEnd() const;
96 
98 
99 /* ============================ INQUIRY =================================== */
101 
102 
104 
105 /* //////////////////////////// PROTECTED ///////////////////////////////// */
106 protected:
107 
109  unsigned mBufferLength;
111  unsigned mBufferEnd;
112 
113  OsTimer *mpTickerTimer;
114 
115 /* //////////////////////////// PRIVATE /////////////////////////////////// */
116 private:
117 
119  MpodBufferRecorder(const MpodBufferRecorder& rMpodBufferRecorder);
120 
123 };
124 
125 
126 /* ============================ INLINE METHODS ============================ */
127 
129 {
130  return mpBuffer;
131 }
132 
134 {
135  return mBufferLength;
136 }
137 
139 {
140  return mBufferEnd;
141 }
142 
143 #endif // _MpodBufferRecorder_h_
int samplesPerFrame
uint32_t MpFrameTime
Definition: MpTypes.h:53
unsigned mBufferLength
Definition: MpodBufferRecorder.h:109
unsigned getBufferEnd() const
Definition: MpodBufferRecorder.h:138
MpAudioSample * mpBuffer
Definition: MpodBufferRecorder.h:110
virtual OsStatus enableDevice(unsigned samplesPerFrame, unsigned samplesPerSec, MpFrameTime currentFrameTime, OsCallback &frameTicker)
Initialize device driver and state.
Definition: MpodBufferRecorder.cpp:68
int16_t MpAudioSample
Definition: MpTypes.h:44
virtual ~MpodBufferRecorder()
Destructor.
Definition: MpodBufferRecorder.cpp:51
MpodBufferRecorder(const UtlString &name, MpFrameTime bufferLength)
Default constructor.
Definition: MpodBufferRecorder.cpp:40
MpFrameTime mBufferLengthMS
Definition: MpodBufferRecorder.h:108
OsTimer * mpTickerTimer
Definition: MpodBufferRecorder.h:113
const MpAudioSample * getBufferData() const
Definition: MpodBufferRecorder.h:128
Container for device specific output driver.
Definition: MpodBufferRecorder.h:39
virtual OsStatus pushFrame(unsigned int numSamples, const MpAudioSample *samples, MpFrameTime frameTime)
Send data to output device.
Definition: MpodBufferRecorder.cpp:143
unsigned getBufferLength() const
Definition: MpodBufferRecorder.h:133
virtual OsStatus disableDevice()
Uninitialize device driver.
Definition: MpodBufferRecorder.cpp:103
MpodBufferRecorder & operator=(const MpodBufferRecorder &rhs)
Assignment operator (not implemented for this class)
unsigned mBufferEnd
Definition: MpodBufferRecorder.h:111
Container for device specific output driver.
Definition: MpOutputDeviceDriver.h:53