19 #include <vamp-hostsdk/Plugin.h> 32 if (dynamic_cast<RegionModel *>(m))
return true;
33 if (dynamic_cast<NoteModel *>(m))
return true;
34 if (dynamic_cast<SparseTimeValueModel *>(m))
return true;
35 if (dynamic_cast<SparseOneDimensionalModel *>(m))
return true;
36 if (dynamic_cast<TextModel *>(m))
return true;
47 map<string, string> params;
48 params[
"one-file"] = path.toStdString();
49 params[
"force"] =
"true";
75 Vamp::Plugin::OutputDescriptor output;
76 std::string summaryType;
78 Vamp::Plugin::FeatureList features;
79 features.push_back(Vamp::Plugin::Feature());
80 Vamp::Plugin::Feature &f = features[0];
86 f.hasTimestamp =
true;
89 for (RegionModel::PointList::const_iterator i = pl.begin();
91 f.timestamp = Vamp::RealTime::frame2RealTime(i->frame, sr);
92 f.duration = Vamp::RealTime::frame2RealTime(i->duration, sr);
94 f.values.push_back(i->value);
95 f.label = i->label.toStdString();
96 m_fw->
write(trackId, transform, output, features, summaryType);
104 f.hasTimestamp =
true;
105 f.hasDuration =
true;
107 for (NoteModel::PointList::const_iterator i = pl.begin();
108 i != pl.end(); ++i) {
109 f.timestamp = Vamp::RealTime::frame2RealTime(i->frame, sr);
110 f.duration = Vamp::RealTime::frame2RealTime(i->duration, sr);
112 f.values.push_back(i->value);
113 f.values.push_back(i->level);
114 f.label = i->label.toStdString();
115 m_fw->
write(trackId, transform, output, features, summaryType);
123 f.hasTimestamp =
true;
124 f.hasDuration =
false;
126 for (SparseOneDimensionalModel::PointList::const_iterator i = pl.begin();
127 i != pl.end(); ++i) {
128 f.timestamp = Vamp::RealTime::frame2RealTime(i->frame, sr);
130 f.label = i->label.toStdString();
131 m_fw->
write(trackId, transform, output, features, summaryType);
139 f.hasTimestamp =
true;
140 f.hasDuration =
false;
142 for (SparseTimeValueModel::PointList::const_iterator i = pl.begin();
143 i != pl.end(); ++i) {
144 f.timestamp = Vamp::RealTime::frame2RealTime(i->frame, sr);
146 f.values.push_back(i->value);
147 f.label = i->label.toStdString();
148 m_fw->
write(trackId, transform, output, features, summaryType);
156 f.hasTimestamp =
true;
157 f.hasDuration =
false;
160 for (TextModel::PointList::const_iterator i = pl.begin();
161 i != pl.end(); ++i) {
162 f.timestamp = Vamp::RealTime::frame2RealTime(i->frame, sr);
164 f.values.push_back(i->height);
165 f.label = i->label.toStdString();
166 m_fw->
write(trackId, transform, output, features, summaryType);
std::multiset< RegionRec, typename RegionRec ::OrderComparator > PointList
virtual void setParameters(map< string, string > ¶ms)
virtual QString getError() const
static bool canExportModel(Model *)
virtual void setFixedEventTypeURI(QString uri)
virtual SparseValueModel< PointType >::PointList getPoints(long start, long end) const
PointTypes have a duration, so this returns all points that span any of the given range (as well as t...
virtual bool isOK() const
virtual const PointList & getPoints() const
Get all points.
virtual int getSampleRate() const =0
Return the frame rate in frames per second.
Model is the base class for all data models that represent any sort of data on a time scale based on ...
static QString getSupportedExtensions()
Return the file extensions that we can write, in a format suitable for use with QFileDialog.
virtual void write(QString trackid, const Transform &transform, const Vamp::Plugin::OutputDescriptor &output, const Vamp::Plugin::FeatureList &features, std::string summaryType="")
RDFExporter(QString path, Model *model)