#include <ModelTransformerFactory.h>
Collaboration diagram for ModelTransformerFactory:

Definition at line 31 of file ModelTransformerFactory.h.
Public Member Functions | |
| virtual | ~ModelTransformerFactory () |
| ModelTransformer::Input | getConfigurationForTransform (Transform &transform, const std::vector< Model * > &candidateInputModels, Model *defaultInputModel, AudioCallbackPlaySource *source=0, size_t startFrame=0, size_t duration=0) |
| Fill out the configuration for the given transform (by asking the user, most likely). | |
| Model * | transform (const Transform &transform, const ModelTransformer::Input &input, QString &message) |
| Return the output model resulting from applying the named transform to the given input model. | |
Static Public Member Functions | |
| static ModelTransformerFactory * | getInstance () |
Protected Types | |
| typedef std::map< TransformId, QString > | TransformerConfigurationMap |
| typedef std::set< ModelTransformer * > | TransformerSet |
Protected Slots | |
| void | transformerFinished () |
| void | modelAboutToBeDeleted (Model *) |
Protected Member Functions | |
| ModelTransformer * | createTransformer (const Transform &transform, const ModelTransformer::Input &input) |
| bool | getChannelRange (TransformId identifier, Vamp::PluginBase *plugin, int &min, int &max) |
Protected Attributes | |
| TransformerConfigurationMap | m_lastConfigurations |
| TransformerSet | m_runningTransformers |
Static Protected Attributes | |
| static ModelTransformerFactory * | m_instance |
typedef std::map<TransformId, QString> ModelTransformerFactory::TransformerConfigurationMap [protected] |
Definition at line 83 of file ModelTransformerFactory.h.
typedef std::set<ModelTransformer *> ModelTransformerFactory::TransformerSet [protected] |
Definition at line 86 of file ModelTransformerFactory.h.
| ModelTransformerFactory::~ModelTransformerFactory | ( | ) | [virtual] |
Definition at line 49 of file ModelTransformerFactory.cpp.
| ModelTransformerFactory * ModelTransformerFactory::getInstance | ( | ) | [static] |
Definition at line 44 of file ModelTransformerFactory.cpp.
References m_instance.
Referenced by Document::addDerivedModel(), MainWindow::addLayer(), Document::alignModel(), and Document::Document().
| ModelTransformer::Input ModelTransformerFactory::getConfigurationForTransform | ( | Transform & | transform, | |
| const std::vector< Model * > & | candidateInputModels, | |||
| Model * | defaultInputModel, | |||
| AudioCallbackPlaySource * | source = 0, |
|||
| size_t | startFrame = 0, |
|||
| size_t | duration = 0 | |||
| ) |
Fill out the configuration for the given transform (by asking the user, most likely).
Returns the selected input model and channel if the transform is acceptable, or an input with a null model if the operation should be cancelled. Audio callback play source may be used to audition effects plugins, if provided.
!! This will need revision -- we'll have to have a callback
!! no longer saved! [was context.channel]
!! The dialog ought to be taking & returning transform
Definition at line 71 of file ModelTransformerFactory.cpp.
References RealTimePluginDescriptor::audioInputPortCount, RealTimePluginDescriptor::audioOutputPortCount, RealTimePluginDescriptor::controlOutputPortCount, RealTimePluginDescriptor::controlOutputPortNames, RealTime::frame2RealTime(), PluginParameterDialog::getChannel(), getChannelRange(), PluginParameterDialog::getInputModel(), TransformFactory::getInstance(), RealTimePluginFactory::getPluginDescriptor(), PluginParameterDialog::getProcessingParameters(), Model::getSampleRate(), PluginParameterDialog::getSelectionOnly(), AudioCallbackPlaySource::getTargetBlockSize(), AudioCallbackPlaySource::getTargetChannelCount(), AudioCallbackPlaySource::getTargetSampleRate(), HanningWindow, RealTimePluginFactory::instanceFor(), FeatureExtractionPluginFactory::instanceFor(), RealTimePluginFactory::instantiatePlugin(), FeatureExtractionPluginFactory::instantiatePlugin(), RealTimePluginDescriptor::isSynth, m_lastConfigurations, AudioCallbackPlaySource::setAuditioningPlugin(), PluginParameterDialog::setCandidateInputModels(), ModelTransformer::Input::setChannel(), PluginParameterDialog::setChannelArrangement(), ModelTransformer::Input::setModel(), PluginParameterDialog::setOutputLabel(), PluginParameterDialog::setShowProcessingOptions(), PluginParameterDialog::setShowSelectionOnlyOption(), and transform().
| Model * ModelTransformerFactory::transform | ( | const Transform & | transform, | |
| const ModelTransformer::Input & | input, | |||
| QString & | message | |||
| ) |
Return the output model resulting from applying the named transform to the given input model.
The transform may still be working in the background when the model is returned; check the output model's isReady completion status for more details.
If the transform is unknown or the input model is not an appropriate type for the given transform, or if some other problem occurs, return 0. Set message if there is any error or warning to report.
The returned model is owned by the caller and must be deleted when no longer needed.
Definition at line 360 of file ModelTransformerFactory.cpp.
References createTransformer(), ModelTransformer::detachOutputModel(), TransformFactory::getInstance(), ModelTransformer::getMessage(), ModelTransformer::Input::getModel(), TransformFactory::getTransformFriendlyName(), m_runningTransformers, Thread::start(), and transformerFinished().
Referenced by Document::addDerivedModel(), Document::alignModel(), createTransformer(), and getConfigurationForTransform().
| void ModelTransformerFactory::transformerFinished | ( | ) | [protected, slot] |
Definition at line 398 of file ModelTransformerFactory.cpp.
References m_runningTransformers.
Referenced by transform().
| void ModelTransformerFactory::modelAboutToBeDeleted | ( | Model * | ) | [protected, slot] |
| ModelTransformer * ModelTransformerFactory::createTransformer | ( | const Transform & | transform, | |
| const ModelTransformer::Input & | input | |||
| ) | [protected] |
!! PluginTransformer::ExecutionContext ModelTransformerFactory::getDefaultContextForTransformer(TransformId identifier, Model *inputModel) { PluginTransformer::ExecutionContext context(-1);
QString id = identifier.section(':', 0, 2);
if (FeatureExtractionPluginFactory::instanceFor(id)) {
Vamp::Plugin *vp = FeatureExtractionPluginFactory::instanceFor(id)->instantiatePlugin (id, inputModel ? inputModel->getSampleRate() : 48000);
if (vp) { context = PluginTransformer::ExecutionContext(-1, vp); delete vp; } }
return context; }
Definition at line 332 of file ModelTransformerFactory.cpp.
References RealTimePluginFactory::instanceFor(), FeatureExtractionPluginFactory::instanceFor(), and transform().
Referenced by transform().
| bool ModelTransformerFactory::getChannelRange | ( | TransformId | identifier, | |
| Vamp::PluginBase * | plugin, | |||
| int & | min, | |||
| int & | max | |||
| ) | [protected] |
Definition at line 54 of file ModelTransformerFactory.cpp.
References TransformFactory::getInstance().
Referenced by getConfigurationForTransform().
Definition at line 84 of file ModelTransformerFactory.h.
Referenced by getConfigurationForTransform().
Definition at line 87 of file ModelTransformerFactory.h.
Referenced by modelAboutToBeDeleted(), transform(), and transformerFinished().
ModelTransformerFactory * ModelTransformerFactory::m_instance [static, protected] |
1.5.1