changeset 1390:4c5533df5d72 levelpanwidget

Merge from branch 3.0-integration
author Chris Cannam
date Mon, 05 Dec 2016 17:03:09 +0000
parents 05d35ce6ea72 (diff) 032bf0b11de9 (current diff)
children a49b1cbedb5f
files .hgsubstate main/MainWindow.cpp
diffstat 5 files changed, 53 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/.hgsubstate	Mon Dec 05 16:39:03 2016 +0000
+++ b/.hgsubstate	Mon Dec 05 17:03:09 2016 +0000
@@ -1,13 +1,13 @@
-da88a268a477c7d24d715ce5cc041157ce4907ac bqaudioio
+523a466726ea153feca116a89579b3dfdd7cf4e1 bqaudioio
 f8f6b66b9875e6a9f153c1692b9f6cb241d51bf0 bqfft
 6b0cbfca8fb7cf64f89b0a0026b63bc212b156af bqresample
 68f8e88d6d76fc4ca074166cb80979ccbfc2b6c9 bqvec
 1eefc20919cd080b684b2bbbc0af7270b8facb54 checker
 3768bdde6fdf866aa63fff5bde8d9fa64a8979ef dataquay
-c37b5598a4beb570417716e30aa649c78312169f icons/scalable
+5359bc0783c637ba486a335fbc6757e64f4e83ac icons/scalable
 3257ddb6fff110cc88f3ffeaeefa0f29d5eb3b6f piper-cpp
 5f67a29f0fc7f1b908f7cde4866173a7af337862 sv-dependency-builds
-167d37937436f87a1836c0933d51404767ecd6ce svapp
+fcac6c6b8deb3c78c4c453b4271a198775bd71d7 svapp
 ea28ee929034977f941b9713e82583fc3d9b1312 svcore
-db90fee630bc756c3c64a6f904b551acb13e000f svgui
+916b62baf7ac87aa5cd2db9c26b51fdefddfc897 svgui
 0eebd22a081a824067bf3d5de65326696feab653 vamp-plugin-sdk
--- a/main/MainWindow.cpp	Mon Dec 05 16:39:03 2016 +0000
+++ b/main/MainWindow.cpp	Mon Dec 05 17:03:09 2016 +0000
@@ -47,6 +47,7 @@
 #include "widgets/PropertyBox.h"
 #include "widgets/PropertyStack.h"
 #include "widgets/AudioDial.h"
+#include "widgets/LevelPanWidget.h"
 #include "widgets/IconLoader.h"
 #include "widgets/LayerTreeDialog.h"
 #include "widgets/ListInputDialog.h"
@@ -210,7 +211,7 @@
 
     m_overview = new Overview(frame);
     m_overview->setViewManager(m_viewManager);
-    m_overview->setFixedHeight(40);
+    m_overview->setFixedHeight(m_viewManager->scalePixelSize(40));
 #ifndef _WIN32
     // For some reason, the contents of the overview never appear if we
     // make this setting on Windows.  I have no inclination at the moment
@@ -233,16 +234,12 @@
             (ColourDatabase::getInstance()->getColourIndex(tr("Green")));
     }
 
-    m_fader = new Fader(frame, false);
-    connect(m_fader, SIGNAL(mouseEntered()), this, SLOT(mouseEnteredWidget()));
-    connect(m_fader, SIGNAL(mouseLeft()), this, SLOT(mouseLeftWidget()));
-
     m_playSpeed = new AudioDial(frame);
     m_playSpeed->setMinimum(0);
     m_playSpeed->setMaximum(120);
     m_playSpeed->setValue(60);
-    m_playSpeed->setFixedWidth(32);
-    m_playSpeed->setFixedHeight(32);
+    m_playSpeed->setFixedWidth(m_viewManager->scalePixelSize(32));
+    m_playSpeed->setFixedHeight(m_viewManager->scalePixelSize(32));
     m_playSpeed->setNotchesVisible(true);
     m_playSpeed->setPageStep(10);
     m_playSpeed->setObjectName(tr("Playback Speed"));
@@ -254,28 +251,34 @@
     connect(m_playSpeed, SIGNAL(mouseEntered()), this, SLOT(mouseEnteredWidget()));
     connect(m_playSpeed, SIGNAL(mouseLeft()), this, SLOT(mouseLeftWidget()));
 
-    IconLoader il;
+    m_mainLevelPan = new LevelPanWidget(frame);
+    connect(m_mainLevelPan, SIGNAL(mouseEntered()), this, SLOT(mouseEnteredWidget()));
+    connect(m_mainLevelPan, SIGNAL(mouseLeft()), this, SLOT(mouseLeftWidget()));
+    
+/*!!!
+    m_fader = new Fader(frame, false);
+    connect(m_fader, SIGNAL(mouseEntered()), this, SLOT(mouseEnteredWidget()));
+    connect(m_fader, SIGNAL(mouseLeft()), this, SLOT(mouseLeftWidget()));
+*/
 
     m_playControlsSpacer = new QFrame;
 
-    layout->setSpacing(4);
-    layout->addWidget(m_mainScroll, 0, 0, 1, 5);
-    layout->addWidget(m_overview, 1, 1);
-    layout->addWidget(m_playControlsSpacer, 1, 2);
-    layout->addWidget(m_playSpeed, 1, 3);
-    layout->addWidget(m_fader, 1, 4);
+    layout->setSpacing(m_viewManager->scalePixelSize(4));
+    layout->addWidget(m_mainScroll, 0, 0, 1, 4);
+    layout->addWidget(m_overview, 1, 0);
+    layout->addWidget(m_playControlsSpacer, 1, 1);
+    layout->addWidget(m_playSpeed, 1, 2);
+//    layout->addWidget(m_fader, 1, 3);
+    layout->addWidget(m_mainLevelPan, 1, 3);
 
     m_playControlsWidth = 
-        m_fader->width() + m_playSpeed->width() + layout->spacing() * 2;
-
-    layout->setColumnMinimumWidth(0, 14);
-    layout->setColumnStretch(0, 0);
+        m_mainLevelPan->width() + m_playSpeed->width() + layout->spacing() * 2;
 
     m_paneStack->setPropertyStackMinWidth(m_playControlsWidth
                                           + 2 + layout->spacing());
     m_playControlsSpacer->setFixedSize(QSize(2, 2));
 
-    layout->setColumnStretch(1, 10);
+    layout->setColumnStretch(0, 10);
 
     connect(m_paneStack, SIGNAL(propertyStacksResized(int)),
             this, SLOT(propertyStacksResized(int)));
@@ -4137,8 +4140,7 @@
 void
 MainWindow::outputLevelsChanged(float left, float right)
 {
-    m_fader->setPeakLeft(left);
-    m_fader->setPeakRight(right);
+    m_mainLevelPan->setMonitoringLevels(left, right);
 }
 
 void
@@ -4334,8 +4336,10 @@
     MainWindowBase::mainModelChanged(model);
 
     if (m_playTarget || m_audioIO) {
-        connect(m_fader, SIGNAL(valueChanged(float)),
+        connect(m_mainLevelPan, SIGNAL(levelChanged(float)),
                 this, SLOT(mainModelGainChanged(float)));
+        connect(m_mainLevelPan, SIGNAL(panChanged(float)),
+                this, SLOT(mainModelPanChanged(float)));
     }
 }
 
@@ -4350,6 +4354,17 @@
 }
 
 void
+MainWindow::mainModelPanChanged(float balance)
+{
+    // this is indeed stereo balance rather than pan
+    if (m_playTarget) {
+        m_playTarget->setOutputBalance(balance);
+    } else if (m_audioIO) {
+        m_audioIO->setOutputBalance(balance);
+    }
+}
+
+void
 MainWindow::modelAboutToBeDeleted(Model *model)
 {
     if (model == m_panLayer->getModel()) {
@@ -4610,8 +4625,8 @@
     QWidget *w = dynamic_cast<QWidget *>(sender());
     if (!w) return;
 
-    if (w == m_fader) {
-        contextHelpChanged(tr("Adjust the master playback level"));
+    if (w == m_mainLevelPan) {
+        contextHelpChanged(tr("Adjust the master playback level and pan"));
     } else if (w == m_playSpeed) {
         contextHelpChanged(tr("Adjust the master playback speed"));
     }
--- a/main/MainWindow.h	Mon Dec 05 16:39:03 2016 +0000
+++ b/main/MainWindow.h	Mon Dec 05 17:03:09 2016 +0000
@@ -137,6 +137,7 @@
 
     virtual void mainModelChanged(WaveFileModel *);
     virtual void mainModelGainChanged(float);
+    virtual void mainModelPanChanged(float);
     virtual void modelAdded(Model *);
     virtual void modelAboutToBeDeleted(Model *);
 
@@ -164,7 +165,8 @@
 
 protected:
     Overview                *m_overview;
-    Fader                   *m_fader;
+//!!!    Fader                   *m_fader;
+    LevelPanWidget          *m_mainLevelPan;
     AudioDial               *m_playSpeed;
     WaveformLayer           *m_panLayer;
     
--- a/main/OSCHandler.cpp	Mon Dec 05 16:39:03 2016 +0000
+++ b/main/OSCHandler.cpp	Mon Dec 05 17:03:09 2016 +0000
@@ -26,7 +26,7 @@
 #include "framework/Document.h"
 #include "data/fileio/WavFileWriter.h"
 #include "transform/TransformFactory.h"
-#include "widgets/Fader.h"
+#include "widgets/LevelPanWidget.h"
 #include "widgets/AudioDial.h"
 
 #include <bqaudioio/SystemPlaybackTarget.h>
@@ -342,7 +342,7 @@
 
             if (property == "gain") {
                 if (value < 0.0) value = 0.0;
-                m_fader->setValue(value);
+                m_mainLevelPan->setLevel(value);
                 if (m_playTarget) m_playTarget->setOutputGain(value);
             } else if (property == "speedup") {
                 m_playSpeed->setMappedValue(value);
--- a/sonic-visualiser.qrc	Mon Dec 05 16:39:03 2016 +0000
+++ b/sonic-visualiser.qrc	Mon Dec 05 17:03:09 2016 +0000
@@ -4,6 +4,7 @@
     <file>icons/scalable/colour3d.svg</file>
     <file>icons/scalable/cross.svg</file>
     <file>icons/scalable/dataedit.svg</file>
+    <file>icons/scalable/datadelete.svg</file>
     <file>icons/scalable/draw.svg</file>
     <file>icons/scalable/erase.svg</file>
     <file>icons/scalable/editcopy.svg</file>
@@ -20,10 +21,13 @@
     <file>icons/scalable/ffwd.svg</file>
     <file>icons/scalable/navigate.svg</file>
     <file>icons/scalable/move.svg</file>
+    <file>icons/scalable/normalise.svg</file>
+    <file>icons/scalable/normalise-columns.svg</file>
     <file>icons/scalable/pause.svg</file>
     <file>icons/scalable/playloop.svg</file>
     <file>icons/scalable/playpause.svg</file>
     <file>icons/scalable/playselection.svg</file>
+    <file>icons/scalable/playfollow.svg</file>
     <file>icons/scalable/solo.svg</file>
     <file>icons/scalable/play.svg</file>
     <file>icons/scalable/record.svg</file>
@@ -40,6 +44,7 @@
     <file>icons/scalable/regions.svg</file>
     <file>icons/scalable/spectrogram.svg</file>
     <file>icons/scalable/spectrum.svg</file>
+    <file>icons/scalable/pane.svg</file>
     <file>icons/scalable/text.svg</file>
     <file>icons/scalable/timeruler.svg</file>
     <file>icons/scalable/zoom.svg</file>
@@ -71,9 +76,7 @@
     <file>icons/playselection.png</file>
     <file>icons/playselection-on.png</file>
     <file>icons/playloop.png</file>
-    <file>icons/playloop-on.png</file>
     <file>icons/playfollow.png</file>
-    <file>icons/playfollow-on.png</file>
     <file>icons/solo.png</file>
     <file>icons/solo-on.png</file>
     <file>icons/align.png</file>