comparison rdf/RDFExporter.cpp @ 1069:32ab6c48efaa

Merge from branch tonioni
author Chris Cannam
date Mon, 20 Apr 2015 09:11:34 +0100
parents a1cd5abcb38b
children 7a23dfe65d66
comparison
equal deleted inserted replaced
1036:682d64f05e72 1069:32ab6c48efaa
76 std::string summaryType; // nil 76 std::string summaryType; // nil
77 77
78 Vamp::Plugin::FeatureList features; 78 Vamp::Plugin::FeatureList features;
79 features.push_back(Vamp::Plugin::Feature()); 79 features.push_back(Vamp::Plugin::Feature());
80 Vamp::Plugin::Feature &f = features[0]; 80 Vamp::Plugin::Feature &f = features[0];
81 int sr = m_model->getSampleRate(); 81 sv_samplerate_t sr = m_model->getSampleRate();
82 82
83 { 83 {
84 RegionModel *m = dynamic_cast<RegionModel *>(m_model); 84 RegionModel *m = dynamic_cast<RegionModel *>(m_model);
85 if (m) { 85 if (m) {
86 f.hasTimestamp = true; 86 f.hasTimestamp = true;
87 f.hasDuration = true; 87 f.hasDuration = true;
88 const RegionModel::PointList &pl(m->getPoints()); 88 const RegionModel::PointList &pl(m->getPoints());
89 for (RegionModel::PointList::const_iterator i = pl.begin(); 89 for (RegionModel::PointList::const_iterator i = pl.begin();
90 i != pl.end(); ++i) { 90 i != pl.end(); ++i) {
91 f.timestamp = Vamp::RealTime::frame2RealTime(i->frame, sr); 91 f.timestamp = RealTime::frame2RealTime(i->frame, sr).toVampRealTime();
92 f.duration = Vamp::RealTime::frame2RealTime(i->duration, sr); 92 f.duration = RealTime::frame2RealTime(i->duration, sr).toVampRealTime();
93 f.values.clear(); 93 f.values.clear();
94 f.values.push_back(i->value); 94 f.values.push_back(i->value);
95 f.label = i->label.toStdString(); 95 f.label = i->label.toStdString();
96 m_fw->write(trackId, transform, output, features, summaryType); 96 m_fw->write(trackId, transform, output, features, summaryType);
97 } 97 }
104 f.hasTimestamp = true; 104 f.hasTimestamp = true;
105 f.hasDuration = true; 105 f.hasDuration = true;
106 const NoteModel::PointList &pl(m->getPoints()); 106 const NoteModel::PointList &pl(m->getPoints());
107 for (NoteModel::PointList::const_iterator i = pl.begin(); 107 for (NoteModel::PointList::const_iterator i = pl.begin();
108 i != pl.end(); ++i) { 108 i != pl.end(); ++i) {
109 f.timestamp = Vamp::RealTime::frame2RealTime(i->frame, sr); 109 f.timestamp = RealTime::frame2RealTime(i->frame, sr).toVampRealTime();
110 f.duration = Vamp::RealTime::frame2RealTime(i->duration, sr); 110 f.duration = RealTime::frame2RealTime(i->duration, sr).toVampRealTime();
111 f.values.clear(); 111 f.values.clear();
112 f.values.push_back(i->value); 112 f.values.push_back(i->value);
113 f.values.push_back(i->level); 113 f.values.push_back(i->level);
114 f.label = i->label.toStdString(); 114 f.label = i->label.toStdString();
115 m_fw->write(trackId, transform, output, features, summaryType); 115 m_fw->write(trackId, transform, output, features, summaryType);
123 f.hasTimestamp = true; 123 f.hasTimestamp = true;
124 f.hasDuration = false; 124 f.hasDuration = false;
125 const SparseOneDimensionalModel::PointList &pl(m->getPoints()); 125 const SparseOneDimensionalModel::PointList &pl(m->getPoints());
126 for (SparseOneDimensionalModel::PointList::const_iterator i = pl.begin(); 126 for (SparseOneDimensionalModel::PointList::const_iterator i = pl.begin();
127 i != pl.end(); ++i) { 127 i != pl.end(); ++i) {
128 f.timestamp = Vamp::RealTime::frame2RealTime(i->frame, sr); 128 f.timestamp = RealTime::frame2RealTime(i->frame, sr).toVampRealTime();
129 f.values.clear(); 129 f.values.clear();
130 f.label = i->label.toStdString(); 130 f.label = i->label.toStdString();
131 m_fw->write(trackId, transform, output, features, summaryType); 131 m_fw->write(trackId, transform, output, features, summaryType);
132 } 132 }
133 return; 133 return;
139 f.hasTimestamp = true; 139 f.hasTimestamp = true;
140 f.hasDuration = false; 140 f.hasDuration = false;
141 const SparseTimeValueModel::PointList &pl(m->getPoints()); 141 const SparseTimeValueModel::PointList &pl(m->getPoints());
142 for (SparseTimeValueModel::PointList::const_iterator i = pl.begin(); 142 for (SparseTimeValueModel::PointList::const_iterator i = pl.begin();
143 i != pl.end(); ++i) { 143 i != pl.end(); ++i) {
144 f.timestamp = Vamp::RealTime::frame2RealTime(i->frame, sr); 144 f.timestamp = RealTime::frame2RealTime(i->frame, sr).toVampRealTime();
145 f.values.clear(); 145 f.values.clear();
146 f.values.push_back(i->value); 146 f.values.push_back(i->value);
147 f.label = i->label.toStdString(); 147 f.label = i->label.toStdString();
148 m_fw->write(trackId, transform, output, features, summaryType); 148 m_fw->write(trackId, transform, output, features, summaryType);
149 } 149 }
157 f.hasDuration = false; 157 f.hasDuration = false;
158 const TextModel::PointList &pl(m->getPoints()); 158 const TextModel::PointList &pl(m->getPoints());
159 m_fw->setFixedEventTypeURI("af:Text"); 159 m_fw->setFixedEventTypeURI("af:Text");
160 for (TextModel::PointList::const_iterator i = pl.begin(); 160 for (TextModel::PointList::const_iterator i = pl.begin();
161 i != pl.end(); ++i) { 161 i != pl.end(); ++i) {
162 f.timestamp = Vamp::RealTime::frame2RealTime(i->frame, sr); 162 f.timestamp = RealTime::frame2RealTime(i->frame, sr).toVampRealTime();
163 f.values.clear(); 163 f.values.clear();
164 f.values.push_back(i->height); 164 f.values.push_back(i->height);
165 f.label = i->label.toStdString(); 165 f.label = i->label.toStdString();
166 m_fw->write(trackId, transform, output, features, summaryType); 166 m_fw->write(trackId, transform, output, features, summaryType);
167 } 167 }