Mercurial > hg > svcore
comparison transform/ModelTransformerFactory.h @ 653:12578237b99c
* Move the plugin dialog configuration guff out into a callback
author | Chris Cannam |
---|---|
date | Fri, 08 Oct 2010 11:19:16 +0100 |
parents | 4c000e196bf1 |
children | c3dee40e77d2 |
comparison
equal
deleted
inserted
replaced
652:8676bacf228f | 653:12578237b99c |
---|---|
21 | 21 |
22 #include "ModelTransformer.h" | 22 #include "ModelTransformer.h" |
23 | 23 |
24 #include <vamp-hostsdk/PluginBase.h> | 24 #include <vamp-hostsdk/PluginBase.h> |
25 | 25 |
26 #include <QMap> | |
26 #include <map> | 27 #include <map> |
27 #include <set> | 28 #include <set> |
28 | 29 |
29 class AudioPlaySource; | 30 class AudioPlaySource; |
30 | 31 |
35 public: | 36 public: |
36 virtual ~ModelTransformerFactory(); | 37 virtual ~ModelTransformerFactory(); |
37 | 38 |
38 static ModelTransformerFactory *getInstance(); | 39 static ModelTransformerFactory *getInstance(); |
39 | 40 |
41 class UserConfigurator { | |
42 public: | |
43 virtual bool configure(ModelTransformer::Input &input, | |
44 Transform &transform, | |
45 Vamp::PluginBase *plugin, | |
46 Model *inputModel, | |
47 AudioPlaySource *source, | |
48 size_t startFrame, | |
49 size_t duration, | |
50 const QMap<QString, Model *> &modelMap, | |
51 QStringList candidateModelNames, | |
52 QString defaultModelName) = 0; | |
53 }; | |
54 | |
40 /** | 55 /** |
41 * Fill out the configuration for the given transform (by asking | 56 * Fill out the configuration for the given transform (may include |
42 * the user, most likely). Returns the selected input model and | 57 * asking the user by calling back on the UserConfigurator). |
43 * channel if the transform is acceptable, or an input with a null | 58 * Returns the selected input model and channel if the transform |
44 * model if the operation should be cancelled. Audio play source | 59 * is acceptable, or an input with a null model if the operation |
45 * may be used to audition effects plugins, if provided. | 60 * should be cancelled. Audio play source may be used to audition |
61 * effects plugins, if provided. | |
46 */ | 62 */ |
47 ModelTransformer::Input | 63 ModelTransformer::Input |
48 getConfigurationForTransform(Transform &transform, | 64 getConfigurationForTransform(Transform &transform, |
49 const std::vector<Model *> &candidateInputModels, | 65 const std::vector<Model *> &candidateInputModels, |
50 Model *defaultInputModel, | 66 Model *defaultInputModel, |
51 AudioPlaySource *source = 0, | 67 AudioPlaySource *source = 0, |
52 size_t startFrame = 0, | 68 size_t startFrame = 0, |
53 size_t duration = 0); | 69 size_t duration = 0, |
70 UserConfigurator *configurator = 0); | |
54 | 71 |
55 /** | 72 /** |
56 * Return the output model resulting from applying the named | 73 * Return the output model resulting from applying the named |
57 * transform to the given input model. The transform may still be | 74 * transform to the given input model. The transform may still be |
58 * working in the background when the model is returned; check the | 75 * working in the background when the model is returned; check the |
83 TransformerConfigurationMap m_lastConfigurations; | 100 TransformerConfigurationMap m_lastConfigurations; |
84 | 101 |
85 typedef std::set<ModelTransformer *> TransformerSet; | 102 typedef std::set<ModelTransformer *> TransformerSet; |
86 TransformerSet m_runningTransformers; | 103 TransformerSet m_runningTransformers; |
87 | 104 |
88 bool getChannelRange(TransformId identifier, | |
89 Vamp::PluginBase *plugin, int &min, int &max); | |
90 | |
91 static ModelTransformerFactory *m_instance; | 105 static ModelTransformerFactory *m_instance; |
92 }; | 106 }; |
93 | 107 |
94 | 108 |
95 #endif | 109 #endif |