Mercurial > hg > svcore
comparison rdf/RDFImporter.cpp @ 687:06f13a3b9e9e debug-output
Convert many cerrs to DEBUGs
author | Chris Cannam |
---|---|
date | Mon, 16 May 2011 17:19:09 +0100 |
parents | b4a8d8221eaf |
children | 1424aa29ae95 |
comparison
equal
deleted
inserted
replaced
686:b4a8d8221eaf | 687:06f13a3b9e9e |
---|---|
217 for (int i = 0; i < (int)results.size(); ++i) { | 217 for (int i = 0; i < (int)results.size(); ++i) { |
218 | 218 |
219 QString signal = results[i]["signal"].value; | 219 QString signal = results[i]["signal"].value; |
220 QString source = results[i]["source"].value; | 220 QString source = results[i]["source"].value; |
221 | 221 |
222 std::cerr << "NOTE: Seeking signal source \"" << source.toStdString() | 222 DEBUG << "NOTE: Seeking signal source \"" << source << "\"..." << endl; |
223 << "\"..." << std::endl; | |
224 | 223 |
225 FileSource *fs = new FileSource(source, reporter); | 224 FileSource *fs = new FileSource(source, reporter); |
226 if (fs->isAvailable()) { | 225 if (fs->isAvailable()) { |
227 std::cerr << "NOTE: Source is available: Local filename is \"" | 226 DEBUG << "NOTE: Source is available: Local filename is \"" |
228 << fs->getLocalFilename().toStdString() | 227 << fs->getLocalFilename() << "\"..." << endl; |
229 << "\"..." << std::endl; | |
230 } | 228 } |
231 | 229 |
232 #ifdef NO_SV_GUI | 230 #ifdef NO_SV_GUI |
233 if (!fs->isAvailable()) { | 231 if (!fs->isAvailable()) { |
234 m_errorString = QString("Signal source \"%1\" is not available").arg(source); | 232 m_errorString = QString("Signal source \"%1\" is not available").arg(source); |
235 delete fs; | 233 delete fs; |
236 continue; | 234 continue; |
237 } | 235 } |
238 #else | 236 #else |
239 if (!fs->isAvailable()) { | 237 if (!fs->isAvailable()) { |
240 std::cerr << "NOTE: Signal source \"" << source.toStdString() | 238 DEBUG << "NOTE: Signal source \"" << source << "\" is not available, using file finder..." << endl; |
241 << "\" is not available, using file finder..." << std::endl; | |
242 FileFinder *ff = FileFinder::getInstance(); | 239 FileFinder *ff = FileFinder::getInstance(); |
243 if (ff) { | 240 if (ff) { |
244 QString path = ff->find(FileFinder::AudioFile, | 241 QString path = ff->find(FileFinder::AudioFile, |
245 fs->getLocation(), | 242 fs->getLocation(), |
246 m_uristring); | 243 m_uristring); |
426 (SimpleSPARQLQuery::QueryFromSingleSource, | 423 (SimpleSPARQLQuery::QueryFromSingleSource, |
427 titleQuery.arg(featureUri), | 424 titleQuery.arg(featureUri), |
428 "title"); | 425 "title"); |
429 | 426 |
430 if (v.value != "") { | 427 if (v.value != "") { |
431 std::cerr << "RDFImporterImpl::getDenseModelTitle: Title (from signal) \"" << v.value << "\"" << std::endl; | 428 DEBUG << "RDFImporterImpl::getDenseModelTitle: Title (from signal) \"" << v.value << "\"" << endl; |
432 m->setObjectName(v.value); | 429 m->setObjectName(v.value); |
433 return; | 430 return; |
434 } | 431 } |
435 | 432 |
436 v = SimpleSPARQLQuery::singleResultQuery | 433 v = SimpleSPARQLQuery::singleResultQuery |
437 (SimpleSPARQLQuery::QueryFromSingleSource, | 434 (SimpleSPARQLQuery::QueryFromSingleSource, |
438 titleQuery.arg(featureTypeUri), | 435 titleQuery.arg(featureTypeUri), |
439 "title"); | 436 "title"); |
440 | 437 |
441 if (v.value != "") { | 438 if (v.value != "") { |
442 std::cerr << "RDFImporterImpl::getDenseModelTitle: Title (from signal type) \"" << v.value << "\"" << std::endl; | 439 DEBUG << "RDFImporterImpl::getDenseModelTitle: Title (from signal type) \"" << v.value << "\"" << endl; |
443 m->setObjectName(v.value); | 440 m->setObjectName(v.value); |
444 return; | 441 return; |
445 } | 442 } |
446 | 443 |
447 std::cerr << "RDFImporterImpl::getDenseModelTitle: No title available for feature <" << featureUri << ">" << std::endl; | 444 DEBUG << "RDFImporterImpl::getDenseModelTitle: No title available for feature <" << featureUri << ">" << endl; |
448 } | 445 } |
449 | 446 |
450 void | 447 void |
451 RDFImporterImpl::getDenseFeatureProperties(QString featureUri, | 448 RDFImporterImpl::getDenseFeatureProperties(QString featureUri, |
452 int &sampleRate, int &windowLength, | 449 int &sampleRate, int &windowLength, |
742 haveTime = true; | 739 haveTime = true; |
743 haveDuration = true; | 740 haveDuration = true; |
744 } else { | 741 } else { |
745 QString timestring = SimpleSPARQLQuery::singleResultQuery | 742 QString timestring = SimpleSPARQLQuery::singleResultQuery |
746 (s, timeQueryString.arg(thinguri), "time").value; | 743 (s, timeQueryString.arg(thinguri), "time").value; |
747 // std::cerr << "timestring = " << timestring << std::endl; | 744 // DEBUG << "timestring = " << timestring << endl; |
748 if (timestring != "") { | 745 if (timestring != "") { |
749 time = RealTime::fromXsdDuration(timestring.toStdString()); | 746 time = RealTime::fromXsdDuration(timestring.toStdString()); |
750 haveTime = true; | 747 haveTime = true; |
751 } | 748 } |
752 } | 749 } |
771 | 768 |
772 if (modelMap[timeline][type][dimensions].find(haveDuration) == | 769 if (modelMap[timeline][type][dimensions].find(haveDuration) == |
773 modelMap[timeline][type][dimensions].end()) { | 770 modelMap[timeline][type][dimensions].end()) { |
774 | 771 |
775 /* | 772 /* |
776 std::cerr << "Creating new model: source = " << source.toStdString() | 773 DEBUG << "Creating new model: source = " << source << ", type = " << type << ", dimensions = " |
777 << ", type = " << type << ", dimensions = " | |
778 << dimensions << ", haveDuration = " << haveDuration | 774 << dimensions << ", haveDuration = " << haveDuration |
779 << ", time = " << time << ", duration = " << duration | 775 << ", time = " << time << ", duration = " << duration |
780 << std::endl; | 776 << endl; |
781 */ | 777 */ |
782 | 778 |
783 if (!haveDuration) { | 779 if (!haveDuration) { |
784 | 780 |
785 if (dimensions == 1) { | 781 if (dimensions == 1) { |
876 long fduration, | 872 long fduration, |
877 bool haveDuration, | 873 bool haveDuration, |
878 std::vector<float> &values, | 874 std::vector<float> &values, |
879 QString label) | 875 QString label) |
880 { | 876 { |
881 // std::cerr << "RDFImporterImpl::fillModel: adding point at frame " << ftime << std::endl; | 877 // DEBUG << "RDFImporterImpl::fillModel: adding point at frame " << ftime << endl; |
882 | 878 |
883 SparseOneDimensionalModel *sodm = | 879 SparseOneDimensionalModel *sodm = |
884 dynamic_cast<SparseOneDimensionalModel *>(model); | 880 dynamic_cast<SparseOneDimensionalModel *>(model); |
885 if (sodm) { | 881 if (sodm) { |
886 SparseOneDimensionalModel::Point point(ftime, label); | 882 SparseOneDimensionalModel::Point point(ftime, label); |
1028 if (value.type == SimpleSPARQLQuery::URIValue) { | 1024 if (value.type == SimpleSPARQLQuery::URIValue) { |
1029 haveAudio = true; | 1025 haveAudio = true; |
1030 } | 1026 } |
1031 } | 1027 } |
1032 | 1028 |
1033 std::cerr << "NOTE: RDFImporter::identifyDocumentType: haveAudio = " | 1029 DEBUG << "NOTE: RDFImporter::identifyDocumentType: haveAudio = " |
1034 << haveAudio << std::endl; | 1030 << haveAudio << endl; |
1035 | 1031 |
1036 value = | 1032 value = |
1037 SimpleSPARQLQuery::singleResultQuery | 1033 SimpleSPARQLQuery::singleResultQuery |
1038 (SimpleSPARQLQuery::QueryFromSingleSource, | 1034 (SimpleSPARQLQuery::QueryFromSingleSource, |
1039 QString | 1035 QString |
1062 if (value.type == SimpleSPARQLQuery::URIValue) { | 1058 if (value.type == SimpleSPARQLQuery::URIValue) { |
1063 haveAnnotations = true; | 1059 haveAnnotations = true; |
1064 } | 1060 } |
1065 } | 1061 } |
1066 | 1062 |
1067 std::cerr << "NOTE: RDFImporter::identifyDocumentType: haveAnnotations = " | 1063 DEBUG << "NOTE: RDFImporter::identifyDocumentType: haveAnnotations = " |
1068 << haveAnnotations << std::endl; | 1064 << haveAnnotations << endl; |
1069 | 1065 |
1070 SimpleSPARQLQuery::closeSingleSource(url); | 1066 SimpleSPARQLQuery::closeSingleSource(url); |
1071 | 1067 |
1072 if (haveAudio) { | 1068 if (haveAudio) { |
1073 if (haveAnnotations) { | 1069 if (haveAnnotations) { |