comparison audio/AudioCallbackPlaySource.cpp @ 498:cd9dec2f47e8 recording

Fix suspending/resuming audio device; it wasn't suspending when playback reached the end, only when the user stopped explicitly
author Chris Cannam
date Tue, 22 Sep 2015 17:12:37 +0100
parents fdce8a452b19
children 39e94df71d24
comparison
equal deleted inserted replaced
487:66b92c188cbd 498:cd9dec2f47e8
405 } 405 }
406 406
407 void 407 void
408 AudioCallbackPlaySource::play(sv_frame_t startFrame) 408 AudioCallbackPlaySource::play(sv_frame_t startFrame)
409 { 409 {
410 if (m_target) m_target->resume();
411
410 if (!m_sourceSampleRate) { 412 if (!m_sourceSampleRate) {
411 cerr << "AudioCallbackPlaySource::play: No source sample rate available, not playing" << endl; 413 cerr << "AudioCallbackPlaySource::play: No source sample rate available, not playing" << endl;
412 return; 414 return;
413 } 415 }
414 416
516 emit activity(tr("Stop at %1").arg 518 emit activity(tr("Stop at %1").arg
517 (RealTime::frame2RealTime 519 (RealTime::frame2RealTime
518 (m_lastCurrentFrame, m_sourceSampleRate).toText().c_str())); 520 (m_lastCurrentFrame, m_sourceSampleRate).toText().c_str()));
519 } 521 }
520 m_lastCurrentFrame = 0; 522 m_lastCurrentFrame = 0;
523
524 if (m_target) m_target->suspend();
521 } 525 }
522 526
523 void 527 void
524 AudioCallbackPlaySource::selectionChanged() 528 AudioCallbackPlaySource::selectionChanged()
525 { 529 {