Mercurial > hg > svcore
comparison transform/ModelTransformerFactory.h @ 1766:85b9b466a59f
Merge from branch by-id
author | Chris Cannam |
---|---|
date | Wed, 17 Jul 2019 14:24:51 +0100 |
parents | fe3f7f8df3a3 |
children | 5f8fbbde08ff |
comparison
equal
deleted
inserted
replaced
1730:649ac57c5a2d | 1766:85b9b466a59f |
---|---|
44 class UserConfigurator { | 44 class UserConfigurator { |
45 public: | 45 public: |
46 virtual bool configure(ModelTransformer::Input &input, | 46 virtual bool configure(ModelTransformer::Input &input, |
47 Transform &transform, | 47 Transform &transform, |
48 Vamp::PluginBase *plugin, | 48 Vamp::PluginBase *plugin, |
49 Model *&inputModel, | 49 ModelId &inputModel, |
50 AudioPlaySource *source, | 50 AudioPlaySource *source, |
51 sv_frame_t startFrame, | 51 sv_frame_t startFrame, |
52 sv_frame_t duration, | 52 sv_frame_t duration, |
53 const QMap<QString, Model *> &modelMap, | 53 const QMap<QString, ModelId> &modelMap, |
54 QStringList candidateModelNames, | 54 QStringList candidateModelNames, |
55 QString defaultModelName) = 0; | 55 QString defaultModelName) = 0; |
56 }; | 56 }; |
57 | 57 |
58 /** | 58 /** |
59 * Fill out the configuration for the given transform (may include | 59 * Fill out the configuration for the given transform (may include |
60 * asking the user by calling back on the UserConfigurator). | 60 * asking the user by calling back on the UserConfigurator). |
61 * Returns the selected input model and channel if the transform | 61 * Returns the selected input model and channel if the transform |
62 * is acceptable, or an input with a null model if the operation | 62 * is acceptable, or an input with no model if the operation |
63 * should be cancelled. Audio play source may be used to audition | 63 * should be cancelled. Audio play source may be used to audition |
64 * effects plugins, if provided. | 64 * effects plugins, if provided. |
65 */ | 65 */ |
66 ModelTransformer::Input | 66 ModelTransformer::Input |
67 getConfigurationForTransform(Transform &transform, | 67 getConfigurationForTransform(Transform &transform, |
68 const std::vector<Model *> &candidateInputModels, | 68 std::vector<ModelId> candidateInputModels, |
69 Model *defaultInputModel, | 69 ModelId defaultInputModel, |
70 AudioPlaySource *source = 0, | 70 AudioPlaySource *source = 0, |
71 sv_frame_t startFrame = 0, | 71 sv_frame_t startFrame = 0, |
72 sv_frame_t duration = 0, | 72 sv_frame_t duration = 0, |
73 UserConfigurator *configurator = 0); | 73 UserConfigurator *configurator = 0); |
74 | 74 |
75 class AdditionalModelHandler { | 75 class AdditionalModelHandler { |
76 public: | 76 public: |
77 virtual ~AdditionalModelHandler() { } | 77 virtual ~AdditionalModelHandler() { } |
78 | 78 |
79 // Exactly one of these functions will be called | 79 // Exactly one of these functions will be called |
80 virtual void moreModelsAvailable(std::vector<Model *> models) = 0; | 80 virtual void moreModelsAvailable(std::vector<ModelId> models) = 0; |
81 virtual void noMoreModelsAvailable() = 0; | 81 virtual void noMoreModelsAvailable() = 0; |
82 }; | 82 }; |
83 | 83 |
84 /** | 84 /** |
85 * Return the output model resulting from applying the named | 85 * Return the output model resulting from applying the named |
102 * handler is null) any such models will be discarded. | 102 * handler is null) any such models will be discarded. |
103 * | 103 * |
104 * The returned model is owned by the caller and must be deleted | 104 * The returned model is owned by the caller and must be deleted |
105 * when no longer needed. | 105 * when no longer needed. |
106 */ | 106 */ |
107 Model *transform(const Transform &transform, | 107 ModelId transform(const Transform &transform, |
108 const ModelTransformer::Input &input, | 108 const ModelTransformer::Input &input, |
109 QString &message, | 109 QString &message, |
110 AdditionalModelHandler *handler = 0); | 110 AdditionalModelHandler *handler = 0); |
111 | 111 |
112 /** | 112 /** |
113 * Return the multiple output models resulting from applying the | 113 * Return the multiple output models resulting from applying the |
114 * named transforms to the given input model. The transforms may | 114 * named transforms to the given input model. The transforms may |
115 * differ only in output identifier for the plugin: they must all | 115 * differ only in output identifier for the plugin: they must all |
139 * transform activity associated with these output models. | 139 * transform activity associated with these output models. |
140 * | 140 * |
141 * The returned models are owned by the caller and must be deleted | 141 * The returned models are owned by the caller and must be deleted |
142 * when no longer needed. | 142 * when no longer needed. |
143 */ | 143 */ |
144 std::vector<Model *> transformMultiple(const Transforms &transform, | 144 std::vector<ModelId> transformMultiple(const Transforms &transform, |
145 const ModelTransformer::Input &input, | 145 const ModelTransformer::Input &input, |
146 QString &message, | 146 QString &message, |
147 AdditionalModelHandler *handler = 0); | 147 AdditionalModelHandler *handler = 0); |
148 | 148 |
149 bool haveRunningTransformers() const; | 149 bool haveRunningTransformers() const; |
151 signals: | 151 signals: |
152 void transformFailed(QString transformName, QString message); | 152 void transformFailed(QString transformName, QString message); |
153 | 153 |
154 protected slots: | 154 protected slots: |
155 void transformerFinished(); | 155 void transformerFinished(); |
156 | |
157 void modelAboutToBeDeleted(Model *); | |
158 | 156 |
159 protected: | 157 protected: |
160 ModelTransformer *createTransformer(const Transforms &transforms, | 158 ModelTransformer *createTransformer(const Transforms &transforms, |
161 const ModelTransformer::Input &input); | 159 const ModelTransformer::Input &input); |
162 | 160 |