Mercurial > hg > sonic-visualiser
changeset 437:9de86c1b980e
Merge from debug-output branch
author | Chris Cannam |
---|---|
date | Tue, 14 Jun 2011 14:50:08 +0100 (2011-06-14) |
parents | 5f22e0bbe4ba (current diff) ae68fc09bf16 (diff) |
children | 868f73825b37 |
files | main/MainWindow.cpp main/OSCHandler.cpp |
diffstat | 4 files changed, 39 insertions(+), 39 deletions(-) [+] |
line wrap: on
line diff
--- a/main/MainWindow.cpp Wed May 11 11:05:10 2011 +0100 +++ b/main/MainWindow.cpp Tue Jun 14 14:50:08 2011 +0100 @@ -310,12 +310,12 @@ MainWindow::~MainWindow() { -// std::cerr << "MainWindow::~MainWindow" << std::endl; +// DEBUG << "MainWindow::~MainWindow" << endl; delete m_keyReference; delete m_preferencesDialog; delete m_layerTreeDialog; Profiles::getInstance()->dump(); -// std::cerr << "MainWindow::~MainWindow finishing" << std::endl; +// DEBUG << "MainWindow::~MainWindow finishing" << endl; } void @@ -1459,7 +1459,7 @@ QString name = transforms[i].name; if (name == "") name = transforms[i].identifier; -// std::cerr << "Plugin Name: " << name.toStdString() << std::endl; +// std::cerr << "Plugin Name: " << name << std::endl; TransformDescription::Type type = transforms[i].type; QString typeStr = factory->getTransformTypeName(type); @@ -1495,8 +1495,8 @@ if (categoryMenus[type].find(category) == categoryMenus[type].end()) { std::cerr << "WARNING: MainWindow::setupMenus: Internal error: " << "No category menu for transform \"" - << name.toStdString() << "\" (category = \"" - << category.toStdString() << "\")" << std::endl; + << name << "\" (category = \"" + << category << "\")" << std::endl; } else { categoryMenus[type][category]->addAction(action); } @@ -1504,8 +1504,8 @@ if (makerMenus[type].find(maker) == makerMenus[type].end()) { std::cerr << "WARNING: MainWindow::setupMenus: Internal error: " << "No maker menu for transform \"" - << name.toStdString() << "\" (maker = \"" - << maker.toStdString() << "\")" << std::endl; + << name << "\" (maker = \"" + << maker << "\")" << std::endl; } else { makerMenus[type][maker]->addAction(action); } @@ -1516,7 +1516,7 @@ connect(this, SIGNAL(canAddLayer(bool)), action, SLOT(setEnabled(bool))); action->setStatusTip(transforms[i].longDescription); -// cerr << "Transform: \"" << name.toStdString() << "\": plugin name \"" << pluginName.toStdString() << "\"" << endl; +// cerr << "Transform: \"" << name << "\": plugin name \"" << pluginName << "\"" << endl; if (pluginNameMenus[type].find(pluginName) == pluginNameMenus[type].end()) { @@ -1648,7 +1648,7 @@ { if (!m_existingLayersMenu) return; // should have been created by setupMenus -// std::cerr << "MainWindow::setupExistingLayersMenu" << std::endl; +// DEBUG << "MainWindow::setupExistingLayersMenu" << endl; m_existingLayersMenu->clear(); m_existingLayerActions.clear(); @@ -1679,7 +1679,7 @@ } // std::cerr << "found new layer " << layer << " (name = " -// << layer->getLayerPresentationName().toStdString() << ")" << std::endl; +// << layer->getLayerPresentationName() << ")" << std::endl; orderedLayers.push_back(layer); observedLayers.insert(layer); @@ -2186,12 +2186,12 @@ for (int j = 0; j < pane->getLayerCount(); ++j) { Layer *layer = pane->getLayer(j); if (!layer) continue; - cerr << "layer = " << layer->objectName().toStdString() << endl; + cerr << "layer = " << layer->objectName() << endl; Model *m = layer->getModel(); RangeSummarisableTimeValueModel *wm = dynamic_cast<RangeSummarisableTimeValueModel *>(m); if (wm) { - cerr << "found: " << wm->objectName().toStdString() << endl; + cerr << "found: " << wm->objectName() << endl; otherModels.insert(wm); if (pane == m_paneStack->getCurrentPane()) { current = wm; @@ -2817,7 +2817,7 @@ void MainWindow::closeEvent(QCloseEvent *e) { -// std::cerr << "MainWindow::closeEvent" << std::endl; +// DEBUG << "MainWindow::closeEvent" << endl; if (m_openingAudioFile) { // std::cerr << "Busy - ignoring close event" << std::endl; @@ -2826,7 +2826,7 @@ } if (!m_abandoning && !checkSaveModified()) { -// std::cerr << "Ignoring close event" << std::endl; +// DEBUG << "Ignoring close event" << endl; e->ignore(); return; } @@ -3034,13 +3034,13 @@ void MainWindow::propertyStacksResized(int width) { -// std::cerr << "MainWindow::propertyStacksResized(" << width << ")" << std::endl; +// DEBUG << "MainWindow::propertyStacksResized(" << width << ")" << endl; if (!m_playControlsSpacer) return; int spacerWidth = width - m_playControlsWidth - 4; -// std::cerr << "resizing spacer from " << m_playControlsSpacer->width() << " to " << spacerWidth << std::endl; +// DEBUG << "resizing spacer from " << m_playControlsSpacer->width() << " to " << spacerWidth << endl; m_playControlsSpacer->setFixedSize(QSize(spacerWidth, 2)); } @@ -3061,7 +3061,7 @@ if (i == m_paneActions.end()) { std::cerr << "WARNING: MainWindow::addPane: unknown action " - << action->objectName().toStdString() << std::endl; + << action->objectName() << std::endl; return; } @@ -3093,7 +3093,7 @@ (LayerFactory::TimeRuler); } -// std::cerr << "adding time ruler layer " << m_timeRulerLayer << std::endl; +// DEBUG << "adding time ruler layer " << m_timeRulerLayer << endl; m_document->addLayerToView(pane, m_timeRulerLayer); } @@ -3133,8 +3133,8 @@ m_paneStack->setCurrentPane(pane); m_paneStack->setCurrentLayer(pane, newLayer); -// std::cerr << "MainWindow::addPane: global centre frame is " -// << m_viewManager->getGlobalCentreFrame() << std::endl; +// DEBUG << "MainWindow::addPane: global centre frame is " +// << m_viewManager->getGlobalCentreFrame() << endl; // pane->setCentreFrame(m_viewManager->getGlobalCentreFrame()); CommandHistory::getInstance()->endCompoundOperation(); @@ -3198,7 +3198,7 @@ if (i == m_layerActions.end()) { std::cerr << "WARNING: MainWindow::addLayer: unknown action " - << action->objectName().toStdString() << std::endl; + << action->objectName() << std::endl; return; } @@ -3340,7 +3340,7 @@ if (!input.getModel()) return; -// std::cerr << "MainWindow::addLayer: Input model is " << input.getModel() << " \"" << input.getModel()->objectName().toStdString() << "\"" << std::endl << "transform:" << std::endl << transform.toXmlString().toStdString() << std::endl; +// DEBUG << "MainWindow::addLayer: Input model is " << input.getModel() << " \"" << input.getModel()->objectName() << "\"" << endl << "transform:" << endl << transform.toXmlString() << endl; Layer *newLayer = m_document->createDerivedLayer(transform, input); @@ -3884,7 +3884,7 @@ void MainWindow::rightButtonMenuRequested(Pane *pane, QPoint position) { -// std::cerr << "MainWindow::rightButtonMenuRequested(" << pane << ", " << position.x() << ", " << position.y() << ")" << std::endl; +// DEBUG << "MainWindow::rightButtonMenuRequested(" << pane << ", " << position.x() << ", " << position.y() << ")" << endl; m_paneStack->setCurrentPane(pane); m_rightButtonMenu->popup(position); }
--- a/main/OSCHandler.cpp Wed May 11 11:05:10 2011 +0100 +++ b/main/OSCHandler.cpp Tue Jun 14 14:50:08 2011 +0100 @@ -35,8 +35,8 @@ void MainWindow::handleOSCMessage(const OSCMessage &message) { - std::cerr << "MainWindow::handleOSCMessage: thread id = " - << QThread::currentThreadId() << std::endl; + DEBUG << "MainWindow::handleOSCMessage: thread id = " + << QThread::currentThreadId() << endl; // This large function should really be abstracted out. @@ -47,7 +47,7 @@ QString path = message.getArg(0).toString(); if (open(path, ReplaceMainModel) != FileOpenSucceeded) { std::cerr << "MainWindow::handleOSCMessage: File open failed for path \"" - << path.toStdString() << "\"" << std::endl; + << path << "\"" << std::endl; } //!!! we really need to spin here and not return until the // file has been completely decoded... @@ -60,7 +60,7 @@ QString path = message.getArg(0).toString(); if (open(path, CreateAdditionalModel) != FileOpenSucceeded) { std::cerr << "MainWindow::handleOSCMessage: File open failed for path \"" - << path.toStdString() << "\"" << std::endl; + << path << "\"" << std::endl; } } @@ -77,7 +77,7 @@ if (n >= 0 && n < int(recent.size())) { if (open(recent[n], ReplaceMainModel) != FileOpenSucceeded) { std::cerr << "MainWindow::handleOSCMessage: File open failed for path \"" - << recent[n].toStdString() << "\"" << std::endl; + << recent[n] << "\"" << std::endl; } } @@ -88,7 +88,7 @@ message.getArg(0).canConvert(QVariant::String)) { path = message.getArg(0).toString(); if (QFileInfo(path).exists()) { - std::cerr << "MainWindow::handleOSCMessage: Refusing to overwrite existing file in save" << std::endl; + DEBUG << "MainWindow::handleOSCMessage: Refusing to overwrite existing file in save" << endl; } else { saveSessionFile(path); } @@ -102,7 +102,7 @@ message.getArg(0).canConvert(QVariant::String)) { path = message.getArg(0).toString(); if (QFileInfo(path).exists()) { - std::cerr << "MainWindow::handleOSCMessage: Refusing to overwrite existing file in export" << std::endl; + DEBUG << "MainWindow::handleOSCMessage: Refusing to overwrite existing file in export" << endl; } else { WavFileWriter writer(path, getMainModel()->getSampleRate(), @@ -307,7 +307,7 @@ if (type == LayerFactory::UnknownLayer) { std::cerr << "WARNING: MainWindow::handleOSCMessage: unknown layer " - << "type " << str.toStdString() << std::endl; + << "type " << str << std::endl; } else { LayerConfiguration configuration(type, @@ -431,7 +431,7 @@ } else { - std::cerr << "WARNING: MainWindow::handleOSCMessage: Unknown delete target " << target.toStdString() << std::endl; + std::cerr << "WARNING: MainWindow::handleOSCMessage: Unknown delete target " << target << std::endl; } }
--- a/main/PreferencesDialog.cpp Wed May 11 11:05:10 2011 +0100 +++ b/main/PreferencesDialog.cpp Tue Jun 14 14:50:08 2011 +0100 @@ -347,7 +347,7 @@ PreferencesDialog::~PreferencesDialog() { - std::cerr << "PreferencesDialog::~PreferencesDialog()" << std::endl; + DEBUG << "PreferencesDialog::~PreferencesDialog()" << endl; } void
--- a/main/main.cpp Wed May 11 11:05:10 2011 +0100 +++ b/main/main.cpp Tue Jun 14 14:50:08 2011 +0100 @@ -245,7 +245,7 @@ if (args.contains("--help") || args.contains("-h") || args.contains("-?")) { std::cerr << QApplication::tr( - "\nSonic Visualiser is a program for viewing and exploring audio data\nfor semantic music analysis and annotation.\n\nUsage:\n\n %1 [--no-audio] [--no-osc] [<file> ...]\n\n --no-audio: Do not attempt to open an audio output device\n --no-osc: Do not provide an Open Sound Control port for remote control\n <file>: One or more Sonic Visualiser (.sv) and audio files may be provided.\n").arg(argv[0]).toStdString() << std::endl; + "\nSonic Visualiser is a program for viewing and exploring audio data\nfor semantic music analysis and annotation.\n\nUsage:\n\n %1 [--no-audio] [--no-osc] [<file> ...]\n\n --no-audio: Do not attempt to open an audio output device\n --no-osc: Do not provide an Open Sound Control port for remote control\n <file>: One or more Sonic Visualiser (.sv) and audio files may be provided.\n").arg(argv[0]) << std::endl; exit(2); } @@ -297,7 +297,7 @@ QTranslator qtTranslator; QString qtTrName = QString("qt_%1").arg(language); - std::cerr << "Loading " << qtTrName.toStdString() << "... "; + DEBUG << "Loading " << qtTrName << "... "; bool success = false; if (!(success = qtTranslator.load(qtTrName))) { QString qtDir = getenv("QTDIR"); @@ -307,7 +307,7 @@ } } if (!success) { - std::cerr << "Failed\nFailed to load Qt translation for locale" << std::endl; + DEBUG << "Failed\nFailed to load Qt translation for locale" << endl; } else { std::cerr << "Done" << std::endl; } @@ -315,9 +315,9 @@ QTranslator svTranslator; QString svTrName = QString("sonic-visualiser_%1").arg(language); - std::cerr << "Loading " << svTrName.toStdString() << "... "; + DEBUG << "Loading " << svTrName << "... "; svTranslator.load(svTrName, ":i18n"); - std::cerr << "Done" << std::endl; + DEBUG << "Done" << endl; application.installTranslator(&svTranslator); StoreStartupLocale(); @@ -462,7 +462,7 @@ haveMainModel = true; } } else { - std::cerr << "WARNING: Ignoring additional session file argument \"" << path.toStdString() << "\"" << std::endl; + std::cerr << "WARNING: Ignoring additional session file argument \"" << path << "\"" << std::endl; status = MainWindow::FileOpenSucceeded; } }