changeset 228:67cea66bd588 debug-output

Remove most toStdString calls (no longer needed, with debug header)
author Chris Cannam
date Thu, 12 May 2011 17:31:56 +0100
parents 85e59c901de9
children 8c13e8219903
files audioio/AudioGenerator.cpp audioio/AudioTargetFactory.cpp audioio/AudioTargetFactory.h framework/Document.cpp framework/MainWindowBase.cpp framework/SVFileReader.cpp framework/TransformUserConfigurator.cpp
diffstat 7 files changed, 35 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/audioio/AudioGenerator.cpp	Thu Apr 14 15:21:41 2011 +0100
+++ b/audioio/AudioGenerator.cpp	Thu May 12 17:31:56 2011 +0100
@@ -97,7 +97,7 @@
             std::cerr << "WARNING: AudioGenerator::getSampleDir: "
                       << "Unable to copy " << fileName.toStdString()
                       << " into temporary directory \""
-                      << m_sampleDir.toStdString() << "\"" << std::endl;
+                      << m_sampleDir << "\"" << std::endl;
         } else {
             QFile tf(target);
             tf.setPermissions(tf.permissions() |
@@ -240,7 +240,7 @@
 	(pluginId, 0, 0, m_sourceSampleRate, m_pluginBlockSize, m_targetChannelCount);
 
     if (!instance) {
-	std::cerr << "Failed to instantiate plugin " << pluginId.toStdString() << std::endl;
+	std::cerr << "Failed to instantiate plugin " << pluginId << std::endl;
         return 0;
     }
 
@@ -255,7 +255,7 @@
         instance->selectProgram(defaultProgram);
     }
     if (program != "") {
-//        std::cerr << "now selecting desired program " << program.toStdString() << std::endl;
+//        std::cerr << "now selecting desired program " << program << std::endl;
         instance->selectProgram(program.toStdString());
     }
     instance->setIdealChannelCount(m_targetChannelCount); // reset!
--- a/audioio/AudioTargetFactory.cpp	Thu Apr 14 15:21:41 2011 +0100
+++ b/audioio/AudioTargetFactory.cpp	Thu May 12 17:31:56 2011 +0100
@@ -135,7 +135,7 @@
 #endif
 
         if (!target || !target->isOK()) {
-            std::cerr << "WARNING: AudioTargetFactory::createCallbackTarget: Failed to open the requested target (\"" << m_default.toStdString() << "\")" << std::endl;
+            std::cerr << "WARNING: AudioTargetFactory::createCallbackTarget: Failed to open the requested target (\"" << m_default << "\")" << std::endl;
             delete target;
             return 0;
         } else {
--- a/audioio/AudioTargetFactory.h	Thu Apr 14 15:21:41 2011 +0100
+++ b/audioio/AudioTargetFactory.h	Thu May 12 17:31:56 2011 +0100
@@ -19,6 +19,8 @@
 #include <vector>
 #include <QString>
 
+#include "base/Debug.h"
+
 class AudioCallbackPlaySource;
 class AudioCallbackPlayTarget;
 
--- a/framework/Document.cpp	Thu Apr 14 15:21:41 2011 +0100
+++ b/framework/Document.cpp	Thu May 12 17:31:56 2011 +0100
@@ -220,7 +220,7 @@
 	LayerFactory::getInstance()->getValidLayerTypes(newModel);
 
     if (types.empty()) {
-	std::cerr << "WARNING: Document::createLayerForTransformer: no valid display layer for output of transform " << transform.getIdentifier().toStdString() << std::endl;
+	std::cerr << "WARNING: Document::createLayerForTransformer: no valid display layer for output of transform " << transform.getIdentifier() << std::endl;
         newModel->aboutToDelete();
         emit modelAboutToBeDeleted(newModel);
         m_models.erase(newModel);
@@ -299,7 +299,7 @@
 #ifdef DEBUG_DOCUMENT
         std::cerr << "Document::setMainModel: inspecting model "
                   << (model ? model->objectName().toStdString() : "(null)") << " in layer "
-                  << layer->objectName().toStdString() << std::endl;
+                  << layer->objectName() << std::endl;
 #endif
 
 	if (model == oldMainModel) {
@@ -351,7 +351,7 @@
 	    
 	    if (!replacementModel) {
 		std::cerr << "WARNING: Document::setMainModel: Failed to regenerate model for transform \""
-			  << transformId.toStdString() << "\"" << " in layer " << layer << std::endl;
+			  << transformId << "\"" << " in layer " << layer << std::endl;
                 if (failedTransformers.find(transformId)
                     == failedTransformers.end()) {
                     emit modelRegenerationFailed(layer->objectName(),
@@ -371,7 +371,7 @@
                           << typeid(*model).name() << ") with model "
                           << replacementModel << " (type "
                           << typeid(*replacementModel).name() << ") in layer "
-                          << layer << " (name " << layer->objectName().toStdString() << ")"
+                          << layer << " (name " << layer->objectName() << ")"
                           << std::endl;
 #endif
                 RangeSummarisableTimeValueModel *rm =
@@ -398,7 +398,7 @@
 
 #ifdef DEBUG_DOCUMENT
         std::cerr << "considering alignment for model " << m << " (name \""
-                  << m->objectName().toStdString() << "\")" << std::endl;
+                  << m->objectName() << "\")" << std::endl;
 #endif
 
         if (m_autoAlignment) {
@@ -438,7 +438,7 @@
     }
 
 #ifdef DEBUG_DOCUMENT
-    std::cerr << "Document::addDerivedModel: source is " << input.getModel() << " \"" << input.getModel()->objectName().toStdString() << "\"" << std::endl;
+    std::cerr << "Document::addDerivedModel: source is " << input.getModel() << " \"" << input.getModel()->objectName() << "\"" << std::endl;
 #endif
 
     ModelRecord rec;
@@ -526,7 +526,7 @@
          .getPluginVersion());
 
     if (!model) {
-	std::cerr << "WARNING: Document::addDerivedModel: no output model for transform " << transform.getIdentifier().toStdString() << std::endl;
+	std::cerr << "WARNING: Document::addDerivedModel: no output model for transform " << transform.getIdentifier() << std::endl;
     } else {
 	addDerivedModel(applied, input, model);
     }
@@ -605,7 +605,7 @@
 	m_layerViewMap[layer].size() > 0) {
 
 	std::cerr << "WARNING: Document::deleteLayer: Layer "
-		  << layer << " [" << layer->objectName().toStdString() << "]"
+		  << layer << " [" << layer->objectName() << "]"
 		  << " is still used in " << m_layerViewMap[layer].size()
 		  << " views!" << std::endl;
 
@@ -970,7 +970,7 @@
 {
 #ifdef DEBUG_DOCUMENT
     std::cerr << "Document::AddLayerCommand::getName(): Name is "
-              << m_name.toStdString() << std::endl;
+              << m_name << std::endl;
 #endif
     return m_name;
 }
@@ -1030,7 +1030,7 @@
 {
 #ifdef DEBUG_DOCUMENT
     std::cerr << "Document::RemoveLayerCommand::getName(): Name is "
-              << m_name.toStdString() << std::endl;
+              << m_name << std::endl;
 #endif
     return m_name;
 }
--- a/framework/MainWindowBase.cpp	Thu Apr 14 15:21:41 2011 +0100
+++ b/framework/MainWindowBase.cpp	Thu May 12 17:31:56 2011 +0100
@@ -1073,7 +1073,7 @@
 MainWindowBase::FileOpenStatus
 MainWindowBase::openAudio(FileSource source, AudioFileOpenMode mode, QString templateName)
 {
-//    std::cerr << "MainWindowBase::openAudio(" << source.getLocation().toStdString() << ")" << std::endl;
+//    std::cerr << "MainWindowBase::openAudio(" << source.getLocation() << ")" << std::endl;
 
     if (!source.isAvailable()) return FileOpenFailed;
     source.waitForData();
@@ -1158,7 +1158,7 @@
     bool loadedTemplate = false;
     if ((mode == ReplaceMainModel) && (templateName.length() != 0)) {
         QString tplPath = "file::templates/" + templateName + ".xml";
-        std::cerr << "SV looking for template " << tplPath.toStdString() << std::endl;
+        std::cerr << "SV looking for template " << tplPath << std::endl;
         FileOpenStatus tplStatus = openSessionFile(tplPath);
         if(tplStatus != FileOpenFailed) {
             loadedTemplate = true;
@@ -1280,7 +1280,7 @@
 MainWindowBase::FileOpenStatus
 MainWindowBase::openPlaylist(FileSource source, AudioFileOpenMode mode)
 {
-    std::cerr << "MainWindowBase::openPlaylist(" << source.getLocation().toStdString() << ")" << std::endl;
+    std::cerr << "MainWindowBase::openPlaylist(" << source.getLocation() << ")" << std::endl;
 
     std::set<QString> extensions;
     PlaylistFileReader::getSupportedExtensions(extensions);
@@ -1321,7 +1321,7 @@
 MainWindowBase::FileOpenStatus
 MainWindowBase::openLayer(FileSource source)
 {
-    std::cerr << "MainWindowBase::openLayer(" << source.getLocation().toStdString() << ")" << std::endl;
+    std::cerr << "MainWindowBase::openLayer(" << source.getLocation() << ")" << std::endl;
 
     Pane *pane = m_paneStack->getCurrentPane();
     
@@ -1382,7 +1382,7 @@
             std::cerr << "ERROR: MainWindowBase::openLayer("
                       << source.getLocation().toStdString()
                       << "): Failed to read XML file: "
-                      << reader.getErrorString().toStdString() << std::endl;
+                      << reader.getErrorString() << std::endl;
             return FileOpenFailed;
         }
 
@@ -1453,7 +1453,7 @@
 MainWindowBase::FileOpenStatus
 MainWindowBase::openImage(FileSource source)
 {
-    std::cerr << "MainWindowBase::openImage(" << source.getLocation().toStdString() << ")" << std::endl;
+    std::cerr << "MainWindowBase::openImage(" << source.getLocation() << ")" << std::endl;
 
     Pane *pane = m_paneStack->getCurrentPane();
     
@@ -1485,7 +1485,7 @@
 
     // We don't put the image file in Recent Files
 
-    std::cerr << "openImage: trying location \"" << source.getLocation().toStdString() << "\" in image layer" << std::endl;
+    std::cerr << "openImage: trying location \"" << source.getLocation() << "\" in image layer" << std::endl;
 
     if (!il->addImage(m_viewManager->getGlobalCentreFrame(), source.getLocation())) {
         if (newLayer) {
@@ -1513,7 +1513,7 @@
 MainWindowBase::FileOpenStatus
 MainWindowBase::openSession(FileSource source)
 {
-    std::cerr << "MainWindowBase::openSession(" << source.getLocation().toStdString() << ")" << std::endl;
+    std::cerr << "MainWindowBase::openSession(" << source.getLocation() << ")" << std::endl;
 
     if (!source.isAvailable()) return FileOpenFailed;
     source.waitForData();
@@ -1633,7 +1633,7 @@
 MainWindowBase::FileOpenStatus
 MainWindowBase::openSessionFromRDF(FileSource source)
 {
-    std::cerr << "MainWindowBase::openSessionFromRDF(" << source.getLocation().toStdString() << ")" << std::endl;
+    std::cerr << "MainWindowBase::openSessionFromRDF(" << source.getLocation() << ")" << std::endl;
 
     if (!source.isAvailable()) return FileOpenFailed;
     source.waitForData();
@@ -1901,7 +1901,7 @@
             std::cerr << "Failed to open session file \""
                       << temp.getTemporaryFilename().toStdString()
                       << "\" for writing: "
-                      << bzFile.errorString().toStdString() << std::endl;
+                      << bzFile.errorString() << std::endl;
             return false;
         }
 
--- a/framework/SVFileReader.cpp	Thu Apr 14 15:21:41 2011 +0100
+++ b/framework/SVFileReader.cpp	Thu May 12 17:31:56 2011 +0100
@@ -442,7 +442,7 @@
 
     QString name = attributes.value("name");
 
-    std::cerr << "SVFileReader::readModel: model name \"" << name.toStdString() << "\"" << std::endl;
+    std::cerr << "SVFileReader::readModel: model name \"" << name << "\"" << std::endl;
 
     READ_MANDATORY(int, sampleRate, toInt);
 
@@ -462,9 +462,9 @@
         file.waitForStatus();
 
         if (!file.isOK()) {
-            std::cerr << "SVFileReader::readModel: Failed to retrieve file \"" << path.toStdString() << "\" for wave file model: " << file.getErrorString().toStdString() << std::endl;
+            std::cerr << "SVFileReader::readModel: Failed to retrieve file \"" << path << "\" for wave file model: " << file.getErrorString() << std::endl;
         } else if (!file.isAvailable()) {
-            std::cerr << "SVFileReader::readModel: Failed to retrieve file \"" << path.toStdString() << "\" for wave file model: Source unavailable" << std::endl;
+            std::cerr << "SVFileReader::readModel: Failed to retrieve file \"" << path << "\" for wave file model: Source unavailable" << std::endl;
         } else {
 
             file.waitForData();
@@ -1016,7 +1016,7 @@
 	float height = 0.0;
 	height = attributes.value("height").trimmed().toFloat(&ok);
 	QString label = attributes.value("label");
-//        std::cerr << "SVFileReader::addPointToDataset: TextModel: frame = " << frame << ", height = " << height << ", label = " << label.toStdString() << ", ok = " << ok << std::endl;
+//        std::cerr << "SVFileReader::addPointToDataset: TextModel: frame = " << frame << ", height = " << height << ", label = " << label << ", ok = " << ok << std::endl;
 	tm->addPoint(TextModel::Point(frame, height, label));
 	return ok;
     }
@@ -1037,7 +1037,7 @@
 //        std::cerr << "Current dataset is an image model" << std::endl;
 	QString image = attributes.value("image");
 	QString label = attributes.value("label");
-//        std::cerr << "SVFileReader::addPointToDataset: ImageModel: frame = " << frame << ", image = " << image.toStdString() << ", label = " << label.toStdString() << ", ok = " << ok << std::endl;
+//        std::cerr << "SVFileReader::addPointToDataset: ImageModel: frame = " << frame << ", image = " << image << ", label = " << label << ", ok = " << ok << std::endl;
 	im->addPoint(ImageModel::Point(frame, image, label));
 	return ok;
     }
--- a/framework/TransformUserConfigurator.cpp	Thu Apr 14 15:21:41 2011 +0100
+++ b/framework/TransformUserConfigurator.cpp	Thu May 12 17:31:56 2011 +0100
@@ -81,7 +81,7 @@
 	std::vector<Vamp::Plugin::OutputDescriptor> od =
 	    vp->getOutputDescriptors();
 
-	std::cerr << "configure: looking for output: " << output.toStdString() << std::endl;
+	std::cerr << "configure: looking for output: " << output << std::endl;
 
 	if (od.size() > 1) {
 	    for (size_t i = 0; i < od.size(); ++i) {
@@ -173,12 +173,12 @@
     if (selectedInput != "") {
 	if (modelMap.contains(selectedInput)) {
 	    inputModel = modelMap.value(selectedInput);
-	    std::cerr << "Found selected input \"" << selectedInput.toStdString() << "\" in model map, result is " << inputModel << std::endl;
+	    std::cerr << "Found selected input \"" << selectedInput << "\" in model map, result is " << inputModel << std::endl;
 	} else {
-	    std::cerr << "Failed to find selected input \"" << selectedInput.toStdString() << "\" in model map" << std::endl;
+	    std::cerr << "Failed to find selected input \"" << selectedInput << "\" in model map" << std::endl;
 	}
     } else {
-	std::cerr << "Selected input empty: \"" << selectedInput.toStdString() << "\"" << std::endl;
+	std::cerr << "Selected input empty: \"" << selectedInput << "\"" << std::endl;
     }
         
     // Write parameters back to transform object