comparison audioio/AudioPortAudioTarget.cpp @ 450:d9d132c0e240 alignment_view

Merge from default branch
author Chris Cannam
date Mon, 20 Apr 2015 09:21:32 +0100
parents 72c662fe7ea3
children
comparison
equal deleted inserted replaced
430:adfb2948fabf 450:d9d132c0e240
50 } 50 }
51 51
52 m_bufferSize = 2048; 52 m_bufferSize = 2048;
53 m_sampleRate = 44100; 53 m_sampleRate = 44100;
54 if (m_source && (m_source->getSourceSampleRate() != 0)) { 54 if (m_source && (m_source->getSourceSampleRate() != 0)) {
55 m_sampleRate = m_source->getSourceSampleRate(); 55 m_sampleRate = int(m_source->getSourceSampleRate());
56 } 56 }
57 57
58 PaStreamParameters op; 58 PaStreamParameters op;
59 op.device = Pa_GetDefaultOutputDevice(); 59 op.device = Pa_GetDefaultOutputDevice();
60 op.channelCount = 2; 60 op.channelCount = 2;
183 m_source->setTargetSampleRate(m_sampleRate); 183 m_source->setTargetSampleRate(m_sampleRate);
184 } 184 }
185 185
186 int 186 int
187 AudioPortAudioTarget::process(const void *, void *outputBuffer, 187 AudioPortAudioTarget::process(const void *, void *outputBuffer,
188 int nframes, 188 sv_frame_t nframes,
189 const PaStreamCallbackTimeInfo *, 189 const PaStreamCallbackTimeInfo *,
190 PaStreamCallbackFlags) 190 PaStreamCallbackFlags)
191 { 191 {
192 #ifdef DEBUG_AUDIO_PORT_AUDIO_TARGET 192 #ifdef DEBUG_AUDIO_PORT_AUDIO_TARGET
193 SVDEBUG << "AudioPortAudioTarget::process(" << nframes << ")" << endl; 193 SVDEBUG << "AudioPortAudioTarget::process(" << nframes << ")" << endl;
242 for (int i = 0; i < tmpbufch; ++i) { 242 for (int i = 0; i < tmpbufch; ++i) {
243 tmpbuf[i] = new float[tmpbufsz]; 243 tmpbuf[i] = new float[tmpbufsz];
244 } 244 }
245 } 245 }
246 246
247 int received = m_source->getSourceSamples(nframes, tmpbuf); 247 sv_frame_t received = m_source->getSourceSamples(nframes, tmpbuf);
248 248
249 float peakLeft = 0.0, peakRight = 0.0; 249 float peakLeft = 0.0, peakRight = 0.0;
250 250
251 for (int ch = 0; ch < 2; ++ch) { 251 for (int ch = 0; ch < 2; ++ch) {
252 252