Mercurial > hg > tony
changeset 414:333cb8a2514b
Introduce level/pan toolbar buttons
author | Chris Cannam |
---|---|
date | Wed, 25 Mar 2015 10:33:19 +0000 |
parents | 762ea5130a2c |
children | d993ab460e5a |
files | .hgsubstate src/MainWindow.cpp src/MainWindow.h |
diffstat | 3 files changed, 11 insertions(+), 30 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgsubstate Wed Mar 25 09:08:55 2015 +0000 +++ b/.hgsubstate Wed Mar 25 10:33:19 2015 +0000 @@ -4,4 +4,4 @@ 55ece8862b6d3a54aad271a53f9c1615e5d3bcf8 sv-dependency-builds 88ae0e53a5da2fdab673fb1f3921c2d57071ca7a svapp 5c5d4863b42849fdc0e2062858a0c4acc725047b svcore -3fb91da7d98d6b82a9be6f824239abe50790ab76 svgui +20698aa6a5179f4763ad373f950e8e6f1e212feb svgui
--- a/src/MainWindow.cpp Wed Mar 25 09:08:55 2015 +0000 +++ b/src/MainWindow.cpp Wed Mar 25 10:33:19 2015 +0000 @@ -41,7 +41,7 @@ #include "widgets/AudioDial.h" #include "widgets/IconLoader.h" #include "widgets/KeyReference.h" -#include "widgets/LevelPanWidget.h" +#include "widgets/LevelPanToolButton.h" #include "audioio/AudioCallbackPlaySource.h" #include "audioio/AudioCallbackPlayTarget.h" #include "audioio/PlaySpeedRangeMapper.h" @@ -241,19 +241,19 @@ connect(m_playSpeed, SIGNAL(mouseEntered()), this, SLOT(mouseEnteredWidget())); connect(m_playSpeed, SIGNAL(mouseLeft()), this, SLOT(mouseLeftWidget())); - m_audioLPW = new LevelPanWidget(frame); + m_audioLPW = new LevelPanToolButton(frame); m_audioLPW->setObjectName(tr("Audio Track Level and Pan")); connect(m_audioLPW, SIGNAL(levelChanged(float)), this, SLOT(audioGainChanged(float))); connect(m_audioLPW, SIGNAL(panChanged(float)), this, SLOT(audioPanChanged(float))); if (m_withSonification) { - m_pitchLPW = new LevelPanWidget(frame); + m_pitchLPW = new LevelPanToolButton(frame); m_pitchLPW->setObjectName(tr("Pitch Track Level and Pan")); connect(m_pitchLPW, SIGNAL(levelChanged(float)), this, SLOT(pitchGainChanged(float))); connect(m_pitchLPW, SIGNAL(panChanged(float)), this, SLOT(pitchPanChanged(float))); - m_notesLPW = new LevelPanWidget(frame); + m_notesLPW = new LevelPanToolButton(frame); m_notesLPW->setObjectName(tr("Note Track Level and Pan")); connect(m_notesLPW, SIGNAL(levelChanged(float)), this, SLOT(notesGainChanged(float))); connect(m_notesLPW, SIGNAL(panChanged(float)), this, SLOT(notesPanChanged(float))); @@ -1075,23 +1075,8 @@ connect(m_showAudio, SIGNAL(triggered()), this, SLOT(showAudioToggled())); connect(this, SIGNAL(canPlay(bool)), m_showAudio, SLOT(setEnabled(bool))); - int lpwSize = m_viewManager->scalePixelSize(30); - - m_audioLPW->setFixedWidth(lpwSize*2); - m_audioLPW->setFixedHeight(lpwSize*2); -// toolbar->addWidget(m_audioLPW); - - QMenu *alpwm = new QMenu(); - QWidgetAction *alpwmwa = new QWidgetAction(alpwm); - alpwmwa->setDefaultWidget(m_audioLPW); - alpwm->addAction(alpwmwa); - alpwm->addAction("Done"); - QToolButton *alpwtb = new QToolButton(); - alpwtb->setPopupMode(QToolButton::MenuButtonPopup); - alpwtb->setText("blah"); - alpwtb->setMenu(alpwm); - toolbar->addWidget(alpwtb); - + toolbar->addWidget(m_audioLPW); + // Pitch (f0) QLabel *spacer = new QLabel; // blank spacer->setFixedWidth(40); @@ -1103,8 +1088,6 @@ connect(this, SIGNAL(canPlay(bool)), m_showPitch, SLOT(setEnabled(bool))); if (m_withSonification) { - m_pitchLPW->setFixedWidth(lpwSize); - m_pitchLPW->setFixedHeight(lpwSize); toolbar->addWidget(m_pitchLPW); } @@ -1119,8 +1102,6 @@ connect(this, SIGNAL(canPlay(bool)), m_showNotes, SLOT(setEnabled(bool))); if (m_withSonification) { - m_notesLPW->setFixedWidth(lpwSize); - m_notesLPW->setFixedHeight(lpwSize); toolbar->addWidget(m_notesLPW); }
--- a/src/MainWindow.h Wed Mar 25 09:08:55 2015 +0000 +++ b/src/MainWindow.h Wed Mar 25 10:33:19 2015 +0000 @@ -21,7 +21,7 @@ class VersionTester; class ActivityLog; -class LevelPanWidget; +class LevelPanToolButton; class MainWindow : public MainWindowBase { @@ -196,9 +196,9 @@ QAction *m_showSpect; QAction *m_showPitch; QAction *m_showNotes; - LevelPanWidget *m_audioLPW; - LevelPanWidget *m_pitchLPW; - LevelPanWidget *m_notesLPW; + LevelPanToolButton *m_audioLPW; + LevelPanToolButton *m_pitchLPW; + LevelPanToolButton *m_notesLPW; ActivityLog *m_activityLog; KeyReference *m_keyReference;