comparison rdf/RDFImporter.cpp @ 843:e802e550a1f2

Drop std:: from cout, cerr, endl -- pull these in through Debug.h
author Chris Cannam
date Tue, 26 Nov 2013 13:35:08 +0000
parents 547b03533375
children f5cd33909744
comparison
equal deleted inserted replaced
842:23d3a6eca5c3 843:e802e550a1f2
45 using Dataquay::Triple; 45 using Dataquay::Triple;
46 using Dataquay::Triples; 46 using Dataquay::Triples;
47 using Dataquay::BasicStore; 47 using Dataquay::BasicStore;
48 using Dataquay::PropertyObject; 48 using Dataquay::PropertyObject;
49 49
50 using std::cerr;
51 using std::endl;
52
53 class RDFImporterImpl 50 class RDFImporterImpl
54 { 51 {
55 public: 52 public:
56 RDFImporterImpl(QString url, int sampleRate); 53 RDFImporterImpl(QString url, int sampleRate);
57 virtual ~RDFImporterImpl(); 54 virtual ~RDFImporterImpl();
178 175
179 getDataModelsAudio(models, reporter); 176 getDataModelsAudio(models, reporter);
180 177
181 if (m_sampleRate == 0) { 178 if (m_sampleRate == 0) {
182 m_errorString = QString("Invalid audio data model (is audio file format supported?)"); 179 m_errorString = QString("Invalid audio data model (is audio file format supported?)");
183 std::cerr << m_errorString << std::endl; 180 cerr << m_errorString << endl;
184 return models; 181 return models;
185 } 182 }
186 183
187 QString error; 184 QString error;
188 185
219 Node file = m_store->complete(Triple(Node(), expand("mo:encodes"), sig)); 216 Node file = m_store->complete(Triple(Node(), expand("mo:encodes"), sig));
220 if (file == Node()) { 217 if (file == Node()) {
221 file = m_store->complete(Triple(sig, expand("mo:available_as"), Node())); 218 file = m_store->complete(Triple(sig, expand("mo:available_as"), Node()));
222 } 219 }
223 if (file == Node()) { 220 if (file == Node()) {
224 std::cerr << "RDFImporterImpl::getDataModelsAudio: ERROR: No source for signal " << sig << std::endl; 221 cerr << "RDFImporterImpl::getDataModelsAudio: ERROR: No source for signal " << sig << endl;
225 continue; 222 continue;
226 } 223 }
227 224
228 QString signal = sig.value; 225 QString signal = sig.value;
229 QString source = file.value; 226 QString source = file.value;
252 if (ff) { 249 if (ff) {
253 QString path = ff->find(FileFinder::AudioFile, 250 QString path = ff->find(FileFinder::AudioFile,
254 fs->getLocation(), 251 fs->getLocation(),
255 m_uristring); 252 m_uristring);
256 if (path != "") { 253 if (path != "") {
257 std::cerr << "File finder returns: \"" << path.toStdString() 254 cerr << "File finder returns: \"" << path.toStdString()
258 << "\"" << std::endl; 255 << "\"" << endl;
259 delete fs; 256 delete fs;
260 fs = new FileSource(path, reporter); 257 fs = new FileSource(path, reporter);
261 if (!fs->isAvailable()) { 258 if (!fs->isAvailable()) {
262 delete fs; 259 delete fs;
263 m_errorString = QString("Signal source \"%1\" is not available").arg(source); 260 m_errorString = QString("Signal source \"%1\" is not available").arg(source);
272 reporter->setMessage(RDFImporter::tr("Importing audio referenced in RDF...")); 269 reporter->setMessage(RDFImporter::tr("Importing audio referenced in RDF..."));
273 } 270 }
274 fs->waitForData(); 271 fs->waitForData();
275 WaveFileModel *newModel = new WaveFileModel(*fs, m_sampleRate); 272 WaveFileModel *newModel = new WaveFileModel(*fs, m_sampleRate);
276 if (newModel->isOK()) { 273 if (newModel->isOK()) {
277 std::cerr << "Successfully created wave file model from source at \"" << source << "\"" << std::endl; 274 cerr << "Successfully created wave file model from source at \"" << source << "\"" << endl;
278 models.push_back(newModel); 275 models.push_back(newModel);
279 m_audioModelMap[signal] = newModel; 276 m_audioModelMap[signal] = newModel;
280 if (m_sampleRate == 0) { 277 if (m_sampleRate == 0) {
281 m_sampleRate = newModel->getSampleRate(); 278 m_sampleRate = newModel->getSampleRate();
282 } 279 }
667 } 664 }
668 665
669 model->setRDFTypeURI(type); 666 model->setRDFTypeURI(type);
670 667
671 if (m_audioModelMap.find(source) != m_audioModelMap.end()) { 668 if (m_audioModelMap.find(source) != m_audioModelMap.end()) {
672 std::cerr << "source model for " << model << " is " << m_audioModelMap[source] << std::endl; 669 cerr << "source model for " << model << " is " << m_audioModelMap[source] << endl;
673 model->setSourceModel(m_audioModelMap[source]); 670 model->setSourceModel(m_audioModelMap[source]);
674 } 671 }
675 672
676 QString title = m_store->complete 673 QString title = m_store->complete
677 (Triple(typ, expand("dc:title"), Node())).value; 674 (Triple(typ, expand("dc:title"), Node())).value;
796 rm->addPoint(point); 793 rm->addPoint(point);
797 } 794 }
798 return; 795 return;
799 } 796 }
800 797
801 std::cerr << "WARNING: RDFImporterImpl::fillModel: Unknown or unexpected model type" << std::endl; 798 cerr << "WARNING: RDFImporterImpl::fillModel: Unknown or unexpected model type" << endl;
802 return; 799 return;
803 } 800 }
804 801
805 RDFImporter::RDFDocumentType 802 RDFImporter::RDFDocumentType
806 RDFImporter::identifyDocumentType(QString url) 803 RDFImporter::identifyDocumentType(QString url)