~noskcaj/ubuntu/saucy/sflphone/merge-1.2.3-2

« back to all changes in this revision

Viewing changes to daemon/src/audio/audiorecord.h

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2012-05-19 21:46:37 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20120519214637-la8rbrford5kj6m3
Tags: 1.1.0-1
* New upstream release 
  - Fixes "FTBFS with libccrtp-dev/2.0.2 from experimental" (Closes: #663282)
* NEW Maintainer: Debian VoIP Team - Thanks Francois for your work.
  - (Closes: #665789: O: sflphone -- SIP and IAX2 compatible VoIP phone)
* Added Build-Depends: libdbus-c++-bin
* Add gcc47-fixes.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 
34
34
#include <string>
35
35
#include <cstdlib>
 
36
#include <memory>
36
37
 
37
 
#include "global.h"
 
38
#include "sfl_types.h"
38
39
#include "noncopyable.h"
39
40
 
40
41
class AudioRecord {
44
45
 
45
46
        AudioRecord();
46
47
 
47
 
        ~AudioRecord();
48
 
 
49
48
        void setSndSamplingRate(int smplRate);
50
 
        /**
51
 
         * Get the recrding sampling rate
52
 
         */
53
 
        int getSndSamplingRate() const;
54
 
 
55
49
        void setRecordingOption(FILE_TYPE type, int sndSmplRate, const std::string &path);
56
50
 
57
51
        /**
96
90
        /**
97
91
         * Set recording flag
98
92
         */
99
 
        bool setRecording();
 
93
        void setRecording();
100
94
 
101
95
        /**
102
96
         * Stop recording flag
103
97
         */
104
98
        void stopRecording();
105
99
 
106
 
 
107
 
        /**
108
 
         * Record a chunk of data in an internal buffer
109
 
         * @param buffer  The data chunk to be recorded
110
 
         * @param nSamples Number of samples (number of bytes) to be recorded
111
 
         */
112
 
        void recSpkrData(SFLDataFormat* buffer, int nSamples);
113
 
 
114
 
        /**
115
 
         * Record a chunk of data in an internal buffer
116
 
         * @param buffer  The data chunk to be recorded
117
 
         * @param nSamples Number of samples (number of bytes) to be recorded
118
 
         */
119
 
        void recMicData(SFLDataFormat* buffer, int nSamples);
120
 
 
121
100
        /**
122
101
         * Record a chunk of data in an openend file
123
102
         * @param buffer  The data chunk to be recorded
124
103
         * @param nSamples Number of samples (number of bytes) to be recorded
125
104
         */
126
 
        void recData(SFLDataFormat* buffer, int nSamples);
127
 
 
128
 
        /**
129
 
         * Record a chunk of data in an openend file, Mix two differnet buffer
130
 
         * @param buffer_1  The first data chunk to be recorded
131
 
         * @param buffer_2  The second data chunk to be recorded
132
 
         * @param nSamples_1 Number of samples (number of bytes) of buffer_1
133
 
         * @param nSamples_2 Number of samples (number of bytes) of buffer_2
134
 
         */
135
 
        void recData(SFLDataFormat* buffer_1, SFLDataFormat* buffer_2, int nSamples_1, int nSamples_2);
136
 
 
 
105
        void recData(SFLDataFormat* buffer, size_t nSamples);
137
106
 
138
107
    protected:
139
108
 
206
175
        /**
207
176
         * Maximum number of samples
208
177
         */
209
 
        int nbSamplesMax_;
 
178
        static const int NB_SAMPLES_MAX = 3000;
210
179
 
211
180
        /**
212
181
         * Recording flage
216
185
        /**
217
186
         * Buffer used for mixing two channels
218
187
         */
219
 
        SFLDataFormat* mixBuffer_;
 
188
        SFLDataFormat mixBuffer_[NB_SAMPLES_MAX];
220
189
 
221
190
        /**
222
191
         * Buffer used to copy mic info
223
192
         */
224
 
        SFLDataFormat* micBuffer_;
 
193
        SFLDataFormat micBuffer_[NB_SAMPLES_MAX];
225
194
 
226
195
        /**
227
196
         * Buffer used to copy spkr info
228
197
         */
229
 
        SFLDataFormat* spkBuffer_;
 
198
        SFLDataFormat spkBuffer_[NB_SAMPLES_MAX];
230
199
 
231
200
        /**
232
201
         * Filename for this recording