changeset 174:aaf806ce329a

* Fix #1757772 tempo, dynamic related plug-ins bug -- make auto-align only auto-align if there is a unit involved * Fix #1755366 text layer bug in retrieved session * Fix input model selection in plugin parameter dialog (was being ignored) * Use lighter background than the standard widget one for panes (assuming the widget background is light but not white) -- similarly darker if dark * Fix colour reference counting in loaded session in SingleColourLayer * Reset overview pane colour when switching dark background on or off
author Chris Cannam
date Tue, 14 Aug 2007 13:58:53 +0000
parents 102317ae3970
children 2599f0ffb89b
files document/SVFileReader.cpp main/MainWindow.cpp transform/TransformFactory.cpp
diffstat 3 files changed, 26 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/document/SVFileReader.cpp	Fri Aug 10 16:36:50 2007 +0000
+++ b/document/SVFileReader.cpp	Tue Aug 14 13:58:53 2007 +0000
@@ -812,10 +812,13 @@
 
     READ_MANDATORY(int, frame, toInt);
 
+//    std::cerr << "SVFileReader::addPointToDataset: frame = " << frame << std::endl;
+
     SparseOneDimensionalModel *sodm = dynamic_cast<SparseOneDimensionalModel *>
 	(m_currentDataset);
 
     if (sodm) {
+//        std::cerr << "Current dataset is a sparse one dimensional model" << std::endl;
 	QString label = attributes.value("label");
 	sodm->addPoint(SparseOneDimensionalModel::Point(frame, label));
 	return true;
@@ -825,6 +828,7 @@
 	(m_currentDataset);
 
     if (stvm) {
+//        std::cerr << "Current dataset is a sparse time-value model" << std::endl;
 	float value = 0.0;
 	value = attributes.value("value").trimmed().toFloat(&ok);
 	QString label = attributes.value("label");
@@ -835,6 +839,7 @@
     NoteModel *nm = dynamic_cast<NoteModel *>(m_currentDataset);
 
     if (nm) {
+//        std::cerr << "Current dataset is a note model" << std::endl;
 	float value = 0.0;
 	value = attributes.value("value").trimmed().toFloat(&ok);
 	size_t duration = 0;
@@ -847,9 +852,11 @@
     TextModel *tm = dynamic_cast<TextModel *>(m_currentDataset);
 
     if (tm) {
+//        std::cerr << "Current dataset is a text model" << std::endl;
 	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;
 	tm->addPoint(TextModel::Point(frame, height, label));
 	return ok;
     }
--- a/main/MainWindow.cpp	Fri Aug 10 16:36:50 2007 +0000
+++ b/main/MainWindow.cpp	Tue Aug 14 13:58:53 2007 +0000
@@ -213,7 +213,14 @@
     m_panLayer->setChannelMode(WaveformLayer::MergeChannels);
     m_panLayer->setAggressiveCacheing(true);
     m_overview->addLayer(m_panLayer);
-    m_panLayer->setBaseColour(ColourDatabase::getInstance()->getColourIndex(Qt::darkGreen));
+
+    if (m_viewManager->getGlobalDarkBackground()) {
+        m_panLayer->setBaseColour
+            (ColourDatabase::getInstance()->getColourIndex(tr("Bright Green")));
+    } else {
+        m_panLayer->setBaseColour
+            (ColourDatabase::getInstance()->getColourIndex(tr("Green")));
+    }        
 
     m_playSource = new AudioCallbackPlaySource(m_viewManager);
 
@@ -3535,8 +3542,17 @@
 MainWindow::toggleDarkBackground()
 {
     if (!m_viewManager) return;
+
     m_viewManager->setGlobalDarkBackground
         (!m_viewManager->getGlobalDarkBackground());
+
+    if (m_viewManager->getGlobalDarkBackground()) {
+        m_panLayer->setBaseColour
+            (ColourDatabase::getInstance()->getColourIndex(tr("Bright Green")));
+    } else {
+        m_panLayer->setBaseColour
+            (ColourDatabase::getInstance()->getColourIndex(tr("Green")));
+    }        
 }
 
 void
--- a/transform/TransformFactory.cpp	Fri Aug 10 16:36:50 2007 +0000
+++ b/transform/TransformFactory.cpp	Tue Aug 14 13:58:53 2007 +0000
@@ -668,6 +668,8 @@
             } else {
                 std::cerr << "Failed to find selected input \"" << selectedInput.toStdString() << "\" in model map" << std::endl;
             }
+        } else {
+            std::cerr << "Selected input empty: \"" << selectedInput.toStdString() << "\"" << std::endl;
         }
 
         configurationXml = PluginXml(plugin).toXmlString();