comparison transform/FeatureExtractionModelTransformer.h @ 1211:5a1198083d9a piper

Pull out model creation into the transformer thread run(), so that all communications with the plugin server happen on a single thread. Then make the model accessor wait for them to be created (which still happens right at the start of processing) before returning.
author Chris Cannam
date Mon, 17 Oct 2016 14:18:23 +0100
parents b14064bd1f97
children fe391a7b8376
comparison
equal deleted inserted replaced
1210:584b2d7d7cd9 1211:5a1198083d9a
17 #define _FEATURE_EXTRACTION_MODEL_TRANSFORMER_H_ 17 #define _FEATURE_EXTRACTION_MODEL_TRANSFORMER_H_
18 18
19 #include "ModelTransformer.h" 19 #include "ModelTransformer.h"
20 20
21 #include <QString> 21 #include <QString>
22 #include <QMutex>
23 #include <QWaitCondition>
22 24
23 #include <vamp-hostsdk/Plugin.h> 25 #include <vamp-hostsdk/Plugin.h>
24 26
25 #include <iostream> 27 #include <iostream>
26 #include <map> 28 #include <map>
72 void setCompletion(int, int); 74 void setCompletion(int, int);
73 75
74 void getFrames(int channelCount, sv_frame_t startFrame, sv_frame_t size, 76 void getFrames(int channelCount, sv_frame_t startFrame, sv_frame_t size,
75 float **buffer); 77 float **buffer);
76 78
77 // just casts 79 bool m_haveOutputs;
80 QMutex m_outputMutex;
81 QWaitCondition m_outputsCondition;
82 void awaitOutputModels();
83
84 // just casts:
78 85
79 DenseTimeValueModel *getConformingInput(); 86 DenseTimeValueModel *getConformingInput();
80 87
81 template <typename ModelClass> bool isOutput(int n) { 88 template <typename ModelClass> bool isOutput(int n) {
82 return dynamic_cast<ModelClass *>(m_outputs[n]) != 0; 89 return dynamic_cast<ModelClass *>(m_outputs[n]) != 0;