diff src/MainWindow.cpp @ 290:634e9adfdc84

Tidy
author Chris Cannam
date Tue, 03 Jun 2014 14:52:47 +0100
parents d1770a8ae921
children cddada03e222
line wrap: on
line diff
--- a/src/MainWindow.cpp	Tue Jun 03 11:16:21 2014 +0100
+++ b/src/MainWindow.cpp	Tue Jun 03 14:52:47 2014 +0100
@@ -1011,113 +1011,47 @@
 
     toolbar = addToolBar(tr("Show and Play"));
     addToolBar(Qt::BottomToolBarArea, toolbar);
-    
-    /* ORIGINAL DESIGN
-    QLabel *eye = new QLabel;
-    eye->setFixedWidth(40);
-    eye->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
-    eye->setPixmap(il.loadPixmap("eye"));
-    toolbar->addWidget(eye);
 
     m_showAudio = toolbar->addAction(il.load("waveform"), tr("Show Audio"));
     m_showAudio->setCheckable(true);
     connect(m_showAudio, SIGNAL(triggered()), this, SLOT(showAudioToggled()));
     connect(this, SIGNAL(canPlay(bool)), m_showAudio, SLOT(setEnabled(bool)));
 
-    m_showSpect = toolbar->addAction(il.load("spectrogram"), tr("Show Spectrogram"));
-    m_showSpect->setCheckable(true);
-    connect(m_showSpect, SIGNAL(triggered()), this, SLOT(showSpectToggled()));
-    connect(this, SIGNAL(canPlay(bool)), m_showSpect, SLOT(setEnabled(bool)));
+    m_playAudio = toolbar->addAction(il.load("speaker"), tr("Play Audio"));
+    m_playAudio->setCheckable(true);
+    connect(m_playAudio, SIGNAL(triggered()), this, SLOT(playAudioToggled()));
+    connect(this, SIGNAL(canPlay(bool)), m_playAudio, SLOT(setEnabled(bool)));
+
+    toolbar->addWidget(m_gainAudio);
+    toolbar->addWidget(m_panAudio);
+
+    // Pitch (f0)
+    QLabel *spacer = new QLabel; // blank
+    spacer->setFixedWidth(40);
+    toolbar->addWidget(spacer);
 
     m_showPitch = toolbar->addAction(il.load("values"), tr("Show Pitch Track"));
     m_showPitch->setCheckable(true);
     connect(m_showPitch, SIGNAL(triggered()), this, SLOT(showPitchToggled()));
     connect(this, SIGNAL(canPlay(bool)), m_showPitch, SLOT(setEnabled(bool)));
 
+    m_playPitch = toolbar->addAction(il.load("speaker"), tr("Play Pitch Track"));
+    m_playPitch->setCheckable(true);
+    connect(m_playPitch, SIGNAL(triggered()), this, SLOT(playPitchToggled()));
+    connect(this, SIGNAL(canPlay(bool)), m_playPitch, SLOT(setEnabled(bool))); // JTEST: this resets the enabled state of m_playPitch.
+
+    toolbar->addWidget(m_gainPitch);
+    toolbar->addWidget(m_panPitch);
+
+    // Notes
+    spacer = new QLabel;
+    spacer->setFixedWidth(40);
+    toolbar->addWidget(spacer);
+
     m_showNotes = toolbar->addAction(il.load("notes"), tr("Show Notes"));
     m_showNotes->setCheckable(true);
     connect(m_showNotes, SIGNAL(triggered()), this, SLOT(showNotesToggled()));
     connect(this, SIGNAL(canPlay(bool)), m_showNotes, SLOT(setEnabled(bool)));
-        
-    QLabel *speaker = new QLabel;
-    speaker->setFixedWidth(40);
-    speaker->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
-    speaker->setPixmap(il.loadPixmap("speaker"));
-    toolbar->addWidget(speaker);
-    
-    m_playAudio = toolbar->addAction(il.load("waveform"), tr("Play Audio"));
-    m_playAudio->setCheckable(true);
-    connect(m_playAudio, SIGNAL(triggered()), this, SLOT(playAudioToggled()));
-    connect(this, SIGNAL(canPlay(bool)), m_playAudio, SLOT(setEnabled(bool)));
-
-    m_playPitch = toolbar->addAction(il.load("values"), tr("Play Pitch Track"));
-    m_playPitch->setCheckable(true);
-    connect(m_playPitch, SIGNAL(triggered()), this, SLOT(playPitchToggled()));
-    connect(this, SIGNAL(canPlay(bool)), m_playPitch, SLOT(setEnabled(bool)));
-
-    m_playNotes = toolbar->addAction(il.load("notes"), tr("Play Notes"));
-    m_playNotes->setCheckable(true);
-    connect(m_playNotes, SIGNAL(triggered()), this, SLOT(playNotesToggled()));
-    connect(this, SIGNAL(canPlay(bool)), m_playNotes, SLOT(setEnabled(bool)));
-    */
-
-    // Audio
-    /*
-    QLabel *icon_audio = new QLabel;
-    icon_audio->setFixedWidth(40);
-    icon_audio->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
-    icon_audio->setPixmap(il.loadPixmap("waveform"));
-    toolbar->addWidget(icon_audio);
-    */
-
-    //m_showAudio = toolbar->addAction(il.load("eye"), tr("Show Audio"))
-    m_showAudio = toolbar->addAction(il.load("waveform"), tr("Show Audio"));
-    m_showAudio->setCheckable(true);
-    connect(m_showAudio, SIGNAL(triggered()), this, SLOT(showAudioToggled()));
-    connect(this, SIGNAL(canPlay(bool)), m_showAudio, SLOT(setEnabled(bool)));
-
-    m_playAudio = toolbar->addAction(il.load("speaker"), tr("Play Audio"));
-    m_playAudio->setCheckable(true);
-    connect(m_playAudio, SIGNAL(triggered()), this, SLOT(playAudioToggled()));
-    connect(this, SIGNAL(canPlay(bool)), m_playAudio, SLOT(setEnabled(bool)));
-
-    toolbar->addWidget(m_gainAudio);
-    toolbar->addWidget(m_panAudio);
-
-    // Pitch (f0)
-    QLabel *icon_pitch = new QLabel;
-    icon_pitch->setFixedWidth(40);
-    icon_pitch->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
-    //icon_pitch->setPixmap(il.loadPixmap("values"));
-    toolbar->addWidget(icon_pitch);
-
-    // m_showPitch = toolbar->addAction(il.load("eye"), tr("Show Pitch Track"));
-    m_showPitch = toolbar->addAction(il.load("values"), tr("Show Pitch Track"));
-    m_showPitch->setCheckable(true);
-    connect(m_showPitch, SIGNAL(triggered()), this, SLOT(showPitchToggled()));
-    connect(this, SIGNAL(canPlay(bool)), m_showPitch, SLOT(setEnabled(bool)));
-
-    m_playPitch = toolbar->addAction(il.load("speaker"), tr("Play Pitch Track"));
-    m_playPitch->setCheckable(true);
-    connect(m_playPitch, SIGNAL(triggered()), this, SLOT(playPitchToggled()));
-    connect(this, SIGNAL(canPlay(bool)), m_playPitch, SLOT(setEnabled(bool))); // JTEST: this resets the enabled state of m_playPitch.
-
-    toolbar->addWidget(m_gainPitch);
-    toolbar->addWidget(m_panPitch);
-
-    // Notes
-    QLabel *icon_notes = new QLabel;
-    icon_notes->setFixedWidth(40);
-    icon_notes->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
-    //icon_notes->setPixmap(il.loadPixmap("notes"));
-    toolbar->addWidget(icon_notes);
-
-
-    //m_showNotes = toolbar->addAction(il.load("eye"), tr("Show Notes"));
-    m_showNotes = toolbar->addAction(il.load("notes"), tr("Show Notes"));
-    m_showNotes->setCheckable(true);
-    connect(m_showNotes, SIGNAL(triggered()), this, SLOT(showNotesToggled()));
-    connect(this, SIGNAL(canPlay(bool)), m_showNotes, SLOT(setEnabled(bool)));
 
     m_playNotes = toolbar->addAction(il.load("speaker"), tr("Play Notes"));
     m_playNotes->setCheckable(true);
@@ -1128,13 +1062,10 @@
     toolbar->addWidget(m_panNotes);
 
     // Spectrogram
-    QLabel *icon_spectrogram = new QLabel;
-    icon_spectrogram->setFixedWidth(40);
-    icon_spectrogram->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
-    //icon_spectrogram->setPixmap(il.loadPixmap("spectrogram"));
-    toolbar->addWidget(icon_spectrogram);
-
-    //m_showSpect = toolbar->addAction(il.load("eye"), tr("Show Spectrogram"));
+    spacer = new QLabel;
+    spacer->setFixedWidth(40);
+    toolbar->addWidget(spacer);
+
     m_showSpect = toolbar->addAction(il.load("spectrogram"), tr("Show Spectrogram"));
     m_showSpect->setCheckable(true);
     connect(m_showSpect, SIGNAL(triggered()), this, SLOT(showSpectToggled()));