comparison transform/TransformFactory.cpp @ 184:ebd906049fb6

* Change WaveFileModel API from getValues(start,end) to getData(start,count). It's much less error-prone to pass in frame counts instead of start/end locations. Should have done this ages ago. This closes #1794563. * Add option to apply a transform to only the selection region, instead of the whole audio. * (to make the above work properly) Add start frame offset to wave models
author Chris Cannam
date Mon, 01 Oct 2007 13:48:38 +0000
parents 21a76c9ed5c3
children
comparison
equal deleted inserted replaced
183:3fdaf3157eea 184:ebd906049fb6
514 Model * 514 Model *
515 TransformFactory::getConfigurationForTransform(TransformId identifier, 515 TransformFactory::getConfigurationForTransform(TransformId identifier,
516 const std::vector<Model *> &candidateInputModels, 516 const std::vector<Model *> &candidateInputModels,
517 PluginTransform::ExecutionContext &context, 517 PluginTransform::ExecutionContext &context,
518 QString &configurationXml, 518 QString &configurationXml,
519 AudioCallbackPlaySource *source) 519 AudioCallbackPlaySource *source,
520 size_t startFrame,
521 size_t duration)
520 { 522 {
521 if (candidateInputModels.empty()) return 0; 523 if (candidateInputModels.empty()) return 0;
522 524
523 //!!! This will need revision -- we'll have to have a callback 525 //!!! This will need revision -- we'll have to have a callback
524 //from the dialog for when the candidate input model is changed, 526 //from the dialog for when the candidate input model is changed,
649 651
650 if (candidateModelNames.size() > 1 && !generator) { 652 if (candidateModelNames.size() > 1 && !generator) {
651 dialog->setCandidateInputModels(candidateModelNames); 653 dialog->setCandidateInputModels(candidateModelNames);
652 } 654 }
653 655
656 if (startFrame != 0 || duration != 0) {
657 dialog->setShowSelectionOnlyOption(true);
658 }
659
654 if (targetChannels > 0) { 660 if (targetChannels > 0) {
655 dialog->setChannelArrangement(sourceChannels, targetChannels, 661 dialog->setChannelArrangement(sourceChannels, targetChannels,
656 defaultChannel); 662 defaultChannel);
657 } 663 }
658 664
676 std::cerr << "Selected input empty: \"" << selectedInput.toStdString() << "\"" << std::endl; 682 std::cerr << "Selected input empty: \"" << selectedInput.toStdString() << "\"" << std::endl;
677 } 683 }
678 684
679 configurationXml = PluginXml(plugin).toXmlString(); 685 configurationXml = PluginXml(plugin).toXmlString();
680 context.channel = dialog->getChannel(); 686 context.channel = dialog->getChannel();
687
688 if (startFrame != 0 || duration != 0) {
689 if (dialog->getSelectionOnly()) {
690 context.startFrame = startFrame;
691 context.duration = duration;
692 }
693 }
681 694
682 dialog->getProcessingParameters(context.stepSize, 695 dialog->getProcessingParameters(context.stepSize,
683 context.blockSize, 696 context.blockSize,
684 context.windowType); 697 context.windowType);
685 698