# HG changeset patch # User Chris Cannam # Date 1481818396 0 # Node ID 3e77e9ecc520adc483ef07a953ca2c7381a184b9 # Parent ae5c314ac557d6a5f54581f1aab85a9f64f51f06# Parent 2879f30ae067e5948ec2ab0c32b5ebd9216f46aa Merge from branch levelpanwidget diff -r ae5c314ac557 -r 3e77e9ecc520 .hgsubstate --- a/.hgsubstate Thu Dec 15 08:58:43 2016 +0000 +++ b/.hgsubstate Thu Dec 15 16:13:16 2016 +0000 @@ -4,10 +4,10 @@ dca061781357caf0500b89ccf73d8801de5d2636 bqvec 1eefc20919cd080b684b2bbbc0af7270b8facb54 checker 3768bdde6fdf866aa63fff5bde8d9fa64a8979ef dataquay -9b913ebff56264e6a10bef85a3f36a271ccab40a icons/scalable +7d46098431f39c265e47254e420576559587b3fe icons/scalable 3257ddb6fff110cc88f3ffeaeefa0f29d5eb3b6f piper-cpp 5f67a29f0fc7f1b908f7cde4866173a7af337862 sv-dependency-builds -ce3818cd16c578fb40dd2d30f2c94090026582aa svapp -5b04b8bc88ca83b0951ab4a0da6a960c1288c385 svcore -f32828ea63d9d7fa18ccdd44822960735b2adc9b svgui +be83e81d915603712fb32b434f19945b7694811b svapp +491a992f856ead12337fa66012590d335eed0140 svcore +54e6be7ebe11c78ce4cd46ffdff35c05689dc1f8 svgui 0eebd22a081a824067bf3d5de65326696feab653 vamp-plugin-sdk diff -r ae5c314ac557 -r 3e77e9ecc520 deploy/osx/copy-qt.sh --- a/deploy/osx/copy-qt.sh Thu Dec 15 08:58:43 2016 +0000 +++ b/deploy/osx/copy-qt.sh Thu Dec 15 16:13:16 2016 +0000 @@ -29,6 +29,12 @@ echo echo "Copying frameworks..." for fwk in $frameworks; do + if [ ! -d "$qtdir/lib/$fwk.framework" ]; then + if [ "$fwk" = "QtDBus" ]; then + echo "QtDBus.framework not found, assuming Qt was built without DBus support" + continue + fi + fi cp -v "$qtdir/lib/$fwk.framework/$fwk" "$fdir" || exit 2 done diff -r ae5c314ac557 -r 3e77e9ecc520 main/MainWindow.cpp --- a/main/MainWindow.cpp Thu Dec 15 08:58:43 2016 +0000 +++ b/main/MainWindow.cpp Thu Dec 15 16:13:16 2016 +0000 @@ -42,11 +42,12 @@ #include "layer/SliceableLayer.h" #include "layer/ImageLayer.h" #include "layer/RegionLayer.h" -#include "widgets/Fader.h" #include "view/Overview.h" #include "widgets/PropertyBox.h" #include "widgets/PropertyStack.h" #include "widgets/AudioDial.h" +#include "widgets/LevelPanWidget.h" +#include "widgets/LevelPanToolButton.h" #include "widgets/IconLoader.h" #include "widgets/LayerTreeDialog.h" #include "widgets/ListInputDialog.h" @@ -119,6 +120,7 @@ #include #include #include +#include #include #include #include @@ -210,7 +212,9 @@ m_overview = new Overview(frame); m_overview->setViewManager(m_viewManager); - m_overview->setFixedHeight(40); + int overviewHeight = m_viewManager->scalePixelSize(35); + if (overviewHeight < 40) overviewHeight = 40; + m_overview->setFixedHeight(overviewHeight); #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 +237,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(overviewHeight); + m_playSpeed->setFixedHeight(overviewHeight); m_playSpeed->setNotchesVisible(true); m_playSpeed->setPageStep(10); m_playSpeed->setObjectName(tr("Playback Speed")); @@ -254,28 +254,31 @@ connect(m_playSpeed, SIGNAL(mouseEntered()), this, SLOT(mouseEnteredWidget())); connect(m_playSpeed, SIGNAL(mouseLeft()), this, SLOT(mouseLeftWidget())); - IconLoader il; + m_mainLevelPan = new LevelPanToolButton(frame); + connect(m_mainLevelPan, SIGNAL(mouseEntered()), this, SLOT(mouseEnteredWidget())); + connect(m_mainLevelPan, SIGNAL(mouseLeft()), this, SLOT(mouseLeftWidget())); + m_mainLevelPan->setFixedHeight(overviewHeight); + m_mainLevelPan->setFixedWidth(overviewHeight); + m_mainLevelPan->setImageSize((overviewHeight * 3) / 4); + m_mainLevelPan->setBigImageSize(overviewHeight * 3); m_playControlsSpacer = new QFrame; - layout->setSpacing(4); - layout->addWidget(m_mainScroll, 0, 0, 1, 5); - layout->addWidget(m_overview, 1, 1); + layout->setSpacing(m_viewManager->scalePixelSize(4)); + layout->addWidget(m_mainScroll, 0, 0, 1, 4); + layout->addWidget(m_overview, 1, 0); + layout->addWidget(m_playSpeed, 1, 1); layout->addWidget(m_playControlsSpacer, 1, 2); - layout->addWidget(m_playSpeed, 1, 3); - layout->addWidget(m_fader, 1, 4); + 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))); @@ -3320,7 +3323,7 @@ if (m_preferencesDialog && m_preferencesDialog->isVisible()) { closeSession(); // otherwise we'll have to wait for prefs changes - m_preferencesDialog->applicationClosing(false); + m_preferencesDialog->applicationClosing(true); } closeSession(); @@ -4140,8 +4143,7 @@ void MainWindow::outputLevelsChanged(float left, float right) { - m_fader->setPeakLeft(left); - m_fader->setPeakRight(right); + m_mainLevelPan->setMonitoringLevels(left, right); } void @@ -4337,8 +4339,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))); } } @@ -4353,6 +4357,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()) { @@ -4616,8 +4631,8 @@ QWidget *w = dynamic_cast(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")); } diff -r ae5c314ac557 -r 3e77e9ecc520 main/MainWindow.h --- a/main/MainWindow.h Thu Dec 15 08:58:43 2016 +0000 +++ b/main/MainWindow.h Thu Dec 15 16:13:16 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; + LevelPanToolButton *m_mainLevelPan; AudioDial *m_playSpeed; WaveformLayer *m_panLayer; diff -r ae5c314ac557 -r 3e77e9ecc520 main/OSCHandler.cpp --- a/main/OSCHandler.cpp Thu Dec 15 08:58:43 2016 +0000 +++ b/main/OSCHandler.cpp Thu Dec 15 16:13:16 2016 +0000 @@ -26,7 +26,8 @@ #include "framework/Document.h" #include "data/fileio/WavFileWriter.h" #include "transform/TransformFactory.h" -#include "widgets/Fader.h" +#include "widgets/LevelPanWidget.h" +#include "widgets/LevelPanToolButton.h" #include "widgets/AudioDial.h" #include @@ -342,7 +343,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); diff -r ae5c314ac557 -r 3e77e9ecc520 main/PreferencesDialog.cpp --- a/main/PreferencesDialog.cpp Thu Dec 15 08:58:43 2016 +0000 +++ b/main/PreferencesDialog.cpp Thu Dec 15 16:13:16 2016 +0000 @@ -353,55 +353,11 @@ hms->setCheckState(m_showHMS ? Qt::Checked : Qt::Unchecked); connect(hms, SIGNAL(stateChanged(int)), this, SLOT(showHMSChanged(int))); - - // General tab - QFrame *frame = new QFrame; - - QGridLayout *subgrid = new QGridLayout; - frame->setLayout(subgrid); - + QFrame *frame = 0; + QGridLayout *subgrid = 0; int row = 0; - subgrid->addWidget(new QLabel(tr("%1:").arg(tr("User interface language"))), - row, 0); - subgrid->addWidget(locale, row++, 1, 1, 1); - - subgrid->addWidget(new QLabel(tr("%1:").arg(tr("Allow network usage"))), - row, 0); - subgrid->addWidget(networkPermish, row++, 1, 1, 1); - - subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel - ("Temporary Directory Root"))), - row, 0); - subgrid->addWidget(m_tempDirRootEdit, row, 1, 1, 1); - subgrid->addWidget(tempDirButton, row, 2, 1, 1); - row++; - - subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel - ("Resample On Load"))), - row, 0); - subgrid->addWidget(resampleOnLoad, row++, 1, 1, 1); - - subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel - ("Use Gapless Mode"))), - row, 0); - subgrid->addWidget(gaplessMode, row++, 1, 1, 1); - - subgrid->addWidget(new QLabel(tr("Audio service:")), row, 0); - subgrid->addWidget(audioImplementation, row++, 1, 1, 2); - - subgrid->addWidget(new QLabel(tr("Audio playback device:")), row, 0); - subgrid->addWidget(m_audioPlaybackDeviceCombo, row++, 1, 1, 2); - - subgrid->addWidget(new QLabel(tr("Audio record device:")), row, 0); - subgrid->addWidget(m_audioRecordDeviceCombo, row++, 1, 1, 2); - - subgrid->setRowStretch(row, 10); - - m_tabOrdering[GeneralTab] = m_tabs->count(); - m_tabs->addTab(frame, tr("&General")); - // Appearance tab frame = new QFrame; @@ -409,11 +365,6 @@ frame->setLayout(subgrid); row = 0; - subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel - ("Show Splash Screen"))), - row, 0); - subgrid->addWidget(showSplash, row++, 1, 1, 1); - #ifdef Q_OS_MAC if (devicePixelRatio() > 1) { subgrid->addWidget(new QLabel(tr("Draw layers at Retina resolution:")), row, 0); @@ -516,7 +467,7 @@ frame->setLayout(subgrid); row = 0; - subgrid->addWidget(new QLabel(tr("Default session template for audio files:")), row++, 0); + subgrid->addWidget(new QLabel(tr("Default session template when loading audio files:")), row++, 0); QListWidget *lw = new QListWidget(); subgrid->addWidget(lw, row, 0); @@ -558,6 +509,69 @@ m_tabOrdering[TemplateTab] = m_tabs->count(); m_tabs->addTab(frame, tr("Session &Template")); + // Audio IO tab + + frame = new QFrame; + subgrid = new QGridLayout; + frame->setLayout(subgrid); + row = 0; + + subgrid->addWidget(new QLabel(tr("Audio service:")), row, 0); + subgrid->addWidget(audioImplementation, row++, 1, 1, 2); + + subgrid->addWidget(new QLabel(tr("Audio playback device:")), row, 0); + subgrid->addWidget(m_audioPlaybackDeviceCombo, row++, 1, 1, 2); + + subgrid->addWidget(new QLabel(tr("Audio record device:")), row, 0); + subgrid->addWidget(m_audioRecordDeviceCombo, row++, 1, 1, 2); + + subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel + ("Use Gapless Mode"))), + row, 0); + subgrid->addWidget(gaplessMode, row++, 1, 1, 1); + + subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel + ("Resample On Load"))), + row, 0); + subgrid->addWidget(resampleOnLoad, row++, 1, 1, 1); + + subgrid->setRowStretch(row, 10); + + m_tabOrdering[AudioIOTab] = m_tabs->count(); + m_tabs->addTab(frame, tr("A&udio I/O")); + + // General tab + + frame = new QFrame; + subgrid = new QGridLayout; + frame->setLayout(subgrid); + row = 0; + + subgrid->addWidget(new QLabel(tr("%1:").arg(tr("User interface language"))), + row, 0); + subgrid->addWidget(locale, row++, 1, 1, 1); + + subgrid->addWidget(new QLabel(tr("%1:").arg(tr("Allow network usage"))), + row, 0); + subgrid->addWidget(networkPermish, row++, 1, 1, 1); + + subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel + ("Show Splash Screen"))), + row, 0); + subgrid->addWidget(showSplash, row++, 1, 1, 1); + + subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel + ("Temporary Directory Root"))), + row, 0); + subgrid->addWidget(m_tempDirRootEdit, row, 1, 1, 1); + subgrid->addWidget(tempDirButton, row, 2, 1, 1); + row++; + + subgrid->setRowStretch(row, 10); + + m_tabOrdering[GeneralTab] = m_tabs->count(); + m_tabs->addTab(frame, tr("&Other")); + QDialogButtonBox *bb = new QDialogButtonBox(Qt::Horizontal); grid->addWidget(bb, 1, 0); diff -r ae5c314ac557 -r 3e77e9ecc520 main/PreferencesDialog.h --- a/main/PreferencesDialog.h Thu Dec 15 08:58:43 2016 +0000 +++ b/main/PreferencesDialog.h Thu Dec 15 16:13:16 2016 +0000 @@ -37,6 +37,7 @@ enum Tab { GeneralTab, + AudioIOTab, AppearanceTab, AnalysisTab, TemplateTab diff -r ae5c314ac557 -r 3e77e9ecc520 sonic-visualiser.qrc --- a/sonic-visualiser.qrc Thu Dec 15 08:58:43 2016 +0000 +++ b/sonic-visualiser.qrc Thu Dec 15 16:13:16 2016 +0000 @@ -4,6 +4,7 @@ icons/scalable/colour3d.svg icons/scalable/cross.svg icons/scalable/dataedit.svg + icons/scalable/datadelete.svg icons/scalable/draw.svg icons/scalable/erase.svg icons/scalable/editcopy.svg @@ -20,10 +21,13 @@ icons/scalable/ffwd.svg icons/scalable/navigate.svg icons/scalable/move.svg + icons/scalable/normalise.svg + icons/scalable/normalise-columns.svg icons/scalable/pause.svg icons/scalable/playloop.svg icons/scalable/playpause.svg icons/scalable/playselection.svg + icons/scalable/playfollow.svg icons/scalable/solo.svg icons/scalable/play.svg icons/scalable/record.svg @@ -40,18 +44,21 @@ icons/scalable/regions.svg icons/scalable/spectrogram.svg icons/scalable/spectrum.svg + icons/scalable/pane.svg icons/scalable/text.svg icons/scalable/timeruler.svg icons/scalable/zoom.svg icons/scalable/zoom-in.svg icons/scalable/zoom-out.svg icons/scalable/zoom-fit.svg + icons/scalable/zoom-reset.svg icons/scalable/sv-icon-light.svg icons/scalable/sv-icon.svg icons/scalable/sv-splash.svg icons/scalable/sv-splash.png icons/scalable/sv-splash@2x.png icons/scalable/waveform.svg + icons/scalable/faders.svg icons/waveform.png icons/spectrum.png icons/spectrogram.png @@ -71,9 +78,7 @@ icons/playselection.png icons/playselection-on.png icons/playloop.png - icons/playloop-on.png icons/playfollow.png - icons/playfollow-on.png icons/solo.png icons/solo-on.png icons/align.png