comparison audioio/AudioCallbackPlaySource.cpp @ 25:4593a7ebad93

* Ensure plugin parameters for a transform are saved in the .sv file and restored in case the plugin has to be run again * Make plugin dialog offer options for mixdown/single-channel use if the file has more than one channels but the plugin only accepts one * Fix incorrect samplerate playback for second file loaded if its samplerate differed from first * Add Zoom to Fit and Select Visible Range menu options, split out Import Audio into main model and secondary model options * Add stubs for cut, copy and paste operations (not implemented yet)
author Chris Cannam
date Thu, 30 Mar 2006 13:18:11 +0000
parents a0900900a6f6
children ca4ee67b2358
comparison
equal deleted inserted replaced
24:a0900900a6f6 25:4593a7ebad93
115 << "New model sample rate does not match" << std::endl 115 << "New model sample rate does not match" << std::endl
116 << "existing model(s) (new " << model->getSampleRate() 116 << "existing model(s) (new " << model->getSampleRate()
117 << " vs " << m_sourceSampleRate 117 << " vs " << m_sourceSampleRate
118 << "), playback will be wrong" 118 << "), playback will be wrong"
119 << std::endl; 119 << std::endl;
120 emit sampleRateMismatch(model->getSampleRate(), m_sourceSampleRate,
121 false);
120 } 122 }
121 123
122 size_t modelChannels = 1; 124 size_t modelChannels = 1;
123 DenseTimeValueModel *dtvm = dynamic_cast<DenseTimeValueModel *>(model); 125 DenseTimeValueModel *dtvm = dynamic_cast<DenseTimeValueModel *>(model);
124 if (dtvm) modelChannels = dtvm->getChannelCount(); 126 if (dtvm) modelChannels = dtvm->getChannelCount();
517 getTargetChannelCount(), &err); 519 getTargetChannelCount(), &err);
518 if (!m_converter) { 520 if (!m_converter) {
519 std::cerr 521 std::cerr
520 << "AudioCallbackPlaySource::setModel: ERROR in creating samplerate converter: " 522 << "AudioCallbackPlaySource::setModel: ERROR in creating samplerate converter: "
521 << src_strerror(err) << std::endl; 523 << src_strerror(err) << std::endl;
522 } 524
523 525 emit sampleRateMismatch(getSourceSampleRate(),
524 emit sampleRateMismatch(getSourceSampleRate(), getTargetSampleRate()); 526 getTargetSampleRate(),
527 false);
528 } else {
529
530 emit sampleRateMismatch(getSourceSampleRate(),
531 getTargetSampleRate(),
532 true);
533 }
525 } 534 }
526 } 535 }
527 536
528 size_t 537 size_t
529 AudioCallbackPlaySource::getTargetSampleRate() const 538 AudioCallbackPlaySource::getTargetSampleRate() const