comparison src/MainWindow.cpp @ 290:634e9adfdc84

Tidy
author Chris Cannam
date Tue, 03 Jun 2014 14:52:47 +0100
parents d1770a8ae921
children cddada03e222
comparison
equal deleted inserted replaced
289:68cb363f7513 290:634e9adfdc84
1009 toolbar->addWidget(m_playSpeed); 1009 toolbar->addWidget(m_playSpeed);
1010 toolbar->addWidget(m_fader); 1010 toolbar->addWidget(m_fader);
1011 1011
1012 toolbar = addToolBar(tr("Show and Play")); 1012 toolbar = addToolBar(tr("Show and Play"));
1013 addToolBar(Qt::BottomToolBarArea, toolbar); 1013 addToolBar(Qt::BottomToolBarArea, toolbar);
1014
1015 /* ORIGINAL DESIGN
1016 QLabel *eye = new QLabel;
1017 eye->setFixedWidth(40);
1018 eye->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
1019 eye->setPixmap(il.loadPixmap("eye"));
1020 toolbar->addWidget(eye);
1021 1014
1022 m_showAudio = toolbar->addAction(il.load("waveform"), tr("Show Audio")); 1015 m_showAudio = toolbar->addAction(il.load("waveform"), tr("Show Audio"));
1023 m_showAudio->setCheckable(true); 1016 m_showAudio->setCheckable(true);
1024 connect(m_showAudio, SIGNAL(triggered()), this, SLOT(showAudioToggled())); 1017 connect(m_showAudio, SIGNAL(triggered()), this, SLOT(showAudioToggled()));
1025 connect(this, SIGNAL(canPlay(bool)), m_showAudio, SLOT(setEnabled(bool))); 1018 connect(this, SIGNAL(canPlay(bool)), m_showAudio, SLOT(setEnabled(bool)));
1026 1019
1027 m_showSpect = toolbar->addAction(il.load("spectrogram"), tr("Show Spectrogram")); 1020 m_playAudio = toolbar->addAction(il.load("speaker"), tr("Play Audio"));
1028 m_showSpect->setCheckable(true); 1021 m_playAudio->setCheckable(true);
1029 connect(m_showSpect, SIGNAL(triggered()), this, SLOT(showSpectToggled())); 1022 connect(m_playAudio, SIGNAL(triggered()), this, SLOT(playAudioToggled()));
1030 connect(this, SIGNAL(canPlay(bool)), m_showSpect, SLOT(setEnabled(bool))); 1023 connect(this, SIGNAL(canPlay(bool)), m_playAudio, SLOT(setEnabled(bool)));
1024
1025 toolbar->addWidget(m_gainAudio);
1026 toolbar->addWidget(m_panAudio);
1027
1028 // Pitch (f0)
1029 QLabel *spacer = new QLabel; // blank
1030 spacer->setFixedWidth(40);
1031 toolbar->addWidget(spacer);
1031 1032
1032 m_showPitch = toolbar->addAction(il.load("values"), tr("Show Pitch Track")); 1033 m_showPitch = toolbar->addAction(il.load("values"), tr("Show Pitch Track"));
1033 m_showPitch->setCheckable(true); 1034 m_showPitch->setCheckable(true);
1034 connect(m_showPitch, SIGNAL(triggered()), this, SLOT(showPitchToggled())); 1035 connect(m_showPitch, SIGNAL(triggered()), this, SLOT(showPitchToggled()));
1035 connect(this, SIGNAL(canPlay(bool)), m_showPitch, SLOT(setEnabled(bool))); 1036 connect(this, SIGNAL(canPlay(bool)), m_showPitch, SLOT(setEnabled(bool)));
1036 1037
1038 m_playPitch = toolbar->addAction(il.load("speaker"), tr("Play Pitch Track"));
1039 m_playPitch->setCheckable(true);
1040 connect(m_playPitch, SIGNAL(triggered()), this, SLOT(playPitchToggled()));
1041 connect(this, SIGNAL(canPlay(bool)), m_playPitch, SLOT(setEnabled(bool))); // JTEST: this resets the enabled state of m_playPitch.
1042
1043 toolbar->addWidget(m_gainPitch);
1044 toolbar->addWidget(m_panPitch);
1045
1046 // Notes
1047 spacer = new QLabel;
1048 spacer->setFixedWidth(40);
1049 toolbar->addWidget(spacer);
1050
1037 m_showNotes = toolbar->addAction(il.load("notes"), tr("Show Notes")); 1051 m_showNotes = toolbar->addAction(il.load("notes"), tr("Show Notes"));
1038 m_showNotes->setCheckable(true); 1052 m_showNotes->setCheckable(true);
1039 connect(m_showNotes, SIGNAL(triggered()), this, SLOT(showNotesToggled())); 1053 connect(m_showNotes, SIGNAL(triggered()), this, SLOT(showNotesToggled()));
1040 connect(this, SIGNAL(canPlay(bool)), m_showNotes, SLOT(setEnabled(bool))); 1054 connect(this, SIGNAL(canPlay(bool)), m_showNotes, SLOT(setEnabled(bool)));
1041
1042 QLabel *speaker = new QLabel;
1043 speaker->setFixedWidth(40);
1044 speaker->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
1045 speaker->setPixmap(il.loadPixmap("speaker"));
1046 toolbar->addWidget(speaker);
1047
1048 m_playAudio = toolbar->addAction(il.load("waveform"), tr("Play Audio"));
1049 m_playAudio->setCheckable(true);
1050 connect(m_playAudio, SIGNAL(triggered()), this, SLOT(playAudioToggled()));
1051 connect(this, SIGNAL(canPlay(bool)), m_playAudio, SLOT(setEnabled(bool)));
1052
1053 m_playPitch = toolbar->addAction(il.load("values"), tr("Play Pitch Track"));
1054 m_playPitch->setCheckable(true);
1055 connect(m_playPitch, SIGNAL(triggered()), this, SLOT(playPitchToggled()));
1056 connect(this, SIGNAL(canPlay(bool)), m_playPitch, SLOT(setEnabled(bool)));
1057
1058 m_playNotes = toolbar->addAction(il.load("notes"), tr("Play Notes"));
1059 m_playNotes->setCheckable(true);
1060 connect(m_playNotes, SIGNAL(triggered()), this, SLOT(playNotesToggled()));
1061 connect(this, SIGNAL(canPlay(bool)), m_playNotes, SLOT(setEnabled(bool)));
1062 */
1063
1064 // Audio
1065 /*
1066 QLabel *icon_audio = new QLabel;
1067 icon_audio->setFixedWidth(40);
1068 icon_audio->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
1069 icon_audio->setPixmap(il.loadPixmap("waveform"));
1070 toolbar->addWidget(icon_audio);
1071 */
1072
1073 //m_showAudio = toolbar->addAction(il.load("eye"), tr("Show Audio"))
1074 m_showAudio = toolbar->addAction(il.load("waveform"), tr("Show Audio"));
1075 m_showAudio->setCheckable(true);
1076 connect(m_showAudio, SIGNAL(triggered()), this, SLOT(showAudioToggled()));
1077 connect(this, SIGNAL(canPlay(bool)), m_showAudio, SLOT(setEnabled(bool)));
1078
1079 m_playAudio = toolbar->addAction(il.load("speaker"), tr("Play Audio"));
1080 m_playAudio->setCheckable(true);
1081 connect(m_playAudio, SIGNAL(triggered()), this, SLOT(playAudioToggled()));
1082 connect(this, SIGNAL(canPlay(bool)), m_playAudio, SLOT(setEnabled(bool)));
1083
1084 toolbar->addWidget(m_gainAudio);
1085 toolbar->addWidget(m_panAudio);
1086
1087 // Pitch (f0)
1088 QLabel *icon_pitch = new QLabel;
1089 icon_pitch->setFixedWidth(40);
1090 icon_pitch->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
1091 //icon_pitch->setPixmap(il.loadPixmap("values"));
1092 toolbar->addWidget(icon_pitch);
1093
1094 // m_showPitch = toolbar->addAction(il.load("eye"), tr("Show Pitch Track"));
1095 m_showPitch = toolbar->addAction(il.load("values"), tr("Show Pitch Track"));
1096 m_showPitch->setCheckable(true);
1097 connect(m_showPitch, SIGNAL(triggered()), this, SLOT(showPitchToggled()));
1098 connect(this, SIGNAL(canPlay(bool)), m_showPitch, SLOT(setEnabled(bool)));
1099
1100 m_playPitch = toolbar->addAction(il.load("speaker"), tr("Play Pitch Track"));
1101 m_playPitch->setCheckable(true);
1102 connect(m_playPitch, SIGNAL(triggered()), this, SLOT(playPitchToggled()));
1103 connect(this, SIGNAL(canPlay(bool)), m_playPitch, SLOT(setEnabled(bool))); // JTEST: this resets the enabled state of m_playPitch.
1104
1105 toolbar->addWidget(m_gainPitch);
1106 toolbar->addWidget(m_panPitch);
1107
1108 // Notes
1109 QLabel *icon_notes = new QLabel;
1110 icon_notes->setFixedWidth(40);
1111 icon_notes->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
1112 //icon_notes->setPixmap(il.loadPixmap("notes"));
1113 toolbar->addWidget(icon_notes);
1114
1115
1116 //m_showNotes = toolbar->addAction(il.load("eye"), tr("Show Notes"));
1117 m_showNotes = toolbar->addAction(il.load("notes"), tr("Show Notes"));
1118 m_showNotes->setCheckable(true);
1119 connect(m_showNotes, SIGNAL(triggered()), this, SLOT(showNotesToggled()));
1120 connect(this, SIGNAL(canPlay(bool)), m_showNotes, SLOT(setEnabled(bool)));
1121 1055
1122 m_playNotes = toolbar->addAction(il.load("speaker"), tr("Play Notes")); 1056 m_playNotes = toolbar->addAction(il.load("speaker"), tr("Play Notes"));
1123 m_playNotes->setCheckable(true); 1057 m_playNotes->setCheckable(true);
1124 connect(m_playNotes, SIGNAL(triggered()), this, SLOT(playNotesToggled())); 1058 connect(m_playNotes, SIGNAL(triggered()), this, SLOT(playNotesToggled()));
1125 connect(this, SIGNAL(canPlay(bool)), m_playNotes, SLOT(setEnabled(bool))); 1059 connect(this, SIGNAL(canPlay(bool)), m_playNotes, SLOT(setEnabled(bool)));
1126 1060
1127 toolbar->addWidget(m_gainNotes); 1061 toolbar->addWidget(m_gainNotes);
1128 toolbar->addWidget(m_panNotes); 1062 toolbar->addWidget(m_panNotes);
1129 1063
1130 // Spectrogram 1064 // Spectrogram
1131 QLabel *icon_spectrogram = new QLabel; 1065 spacer = new QLabel;
1132 icon_spectrogram->setFixedWidth(40); 1066 spacer->setFixedWidth(40);
1133 icon_spectrogram->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 1067 toolbar->addWidget(spacer);
1134 //icon_spectrogram->setPixmap(il.loadPixmap("spectrogram")); 1068
1135 toolbar->addWidget(icon_spectrogram);
1136
1137 //m_showSpect = toolbar->addAction(il.load("eye"), tr("Show Spectrogram"));
1138 m_showSpect = toolbar->addAction(il.load("spectrogram"), tr("Show Spectrogram")); 1069 m_showSpect = toolbar->addAction(il.load("spectrogram"), tr("Show Spectrogram"));
1139 m_showSpect->setCheckable(true); 1070 m_showSpect->setCheckable(true);
1140 connect(m_showSpect, SIGNAL(triggered()), this, SLOT(showSpectToggled())); 1071 connect(m_showSpect, SIGNAL(triggered()), this, SLOT(showSpectToggled()));
1141 connect(this, SIGNAL(canPlay(bool)), m_showSpect, SLOT(setEnabled(bool))); 1072 connect(this, SIGNAL(canPlay(bool)), m_showSpect, SLOT(setEnabled(bool)));
1142 1073