comparison transform/TransformFactory.cpp @ 54:ec77936c268e

* Add system-specific LADSPA and DSSI plugin paths (for OS/X and Windows) * Add ability to open more than one audio file at once from the command line * Add plugin input source selection (with some caveats) * Show name of file being decoded in Ogg/mp3 decode progress dialog
author Chris Cannam
date Thu, 12 Oct 2006 14:56:28 +0000
parents 94f1c2747de4
children ca1e3f5657d5
comparison
equal deleted inserted replaced
53:94f1c2747de4 54:ec77936c268e
448 QString &configurationXml, 448 QString &configurationXml,
449 AudioCallbackPlaySource *source) 449 AudioCallbackPlaySource *source)
450 { 450 {
451 if (candidateInputModels.empty()) return 0; 451 if (candidateInputModels.empty()) return 0;
452 452
453 //!!! This will need revision -- we'll have to have a callback
454 //from the dialog for when the candidate input model is changed,
455 //as we'll need to reinitialise the channel settings in the dialog
453 Model *inputModel = candidateInputModels[0]; //!!! for now 456 Model *inputModel = candidateInputModels[0]; //!!! for now
457 QStringList candidateModelNames;
458 std::map<QString, Model *> modelMap;
459 for (size_t i = 0; i < candidateInputModels.size(); ++i) {
460 QString modelName = candidateInputModels[i]->objectName();
461 QString origModelName = modelName;
462 int dupcount = 1;
463 while (modelMap.find(modelName) != modelMap.end()) {
464 modelName = tr("%1 <%2>").arg(origModelName).arg(++dupcount);
465 }
466 modelMap[modelName] = candidateInputModels[i];
467 candidateModelNames.push_back(modelName);
468 }
454 469
455 QString id = name.section(':', 0, 2); 470 QString id = name.section(':', 0, 2);
456 QString output = name.section(':', 3); 471 QString output = name.section(':', 3);
457 QString outputLabel = ""; 472 QString outputLabel = "";
458 473
551 566
552 int defaultChannel = context.channel; 567 int defaultChannel = context.channel;
553 568
554 PluginParameterDialog *dialog = new PluginParameterDialog(plugin); 569 PluginParameterDialog *dialog = new PluginParameterDialog(plugin);
555 570
571 if (candidateModelNames.size() > 1) {
572 dialog->setCandidateInputModels(candidateModelNames);
573 }
574
556 dialog->setChannelArrangement(sourceChannels, targetChannels, 575 dialog->setChannelArrangement(sourceChannels, targetChannels,
557 defaultChannel); 576 defaultChannel);
558 577
559 dialog->setOutputLabel(outputLabel); 578 dialog->setOutputLabel(outputLabel);
560 579
561 dialog->setShowProcessingOptions(true, frequency); 580 dialog->setShowProcessingOptions(true, frequency);
562 581
563 if (dialog->exec() == QDialog::Accepted) { 582 if (dialog->exec() == QDialog::Accepted) {
564 ok = true; 583 ok = true;
584 }
585
586 QString selectedInput = dialog->getInputModel();
587 if (selectedInput != "") {
588 if (modelMap.find(selectedInput) != modelMap.end()) {
589 inputModel = modelMap[selectedInput];
590 std::cerr << "Found selected input \"" << selectedInput.toStdString() << "\" in model map, result is " << inputModel << std::endl;
591 } else {
592 std::cerr << "Failed to find selected input \"" << selectedInput.toStdString() << "\" in model map" << std::endl;
593 }
565 } 594 }
566 595
567 configurationXml = PluginXml(plugin).toXmlString(); 596 configurationXml = PluginXml(plugin).toXmlString();
568 context.channel = dialog->getChannel(); 597 context.channel = dialog->getChannel();
569 598