comparison src/MainWindow.cpp @ 220:834f7880947e

removed icon widgets, placed icons on top of show toggle button, hiding layer disables play button
author Justin Salamon <justin.salamon@nyu.edu>
date Thu, 06 Mar 2014 15:00:06 -0500
parents cf542e56d891
children 50122e9b817e
comparison
equal deleted inserted replaced
219:7b6e61585910 220:834f7880947e
229 m_gainAudio = new AudioDial(frame); 229 m_gainAudio = new AudioDial(frame);
230 m_gainAudio->setMinimum(-50); 230 m_gainAudio->setMinimum(-50);
231 m_gainAudio->setMaximum(50); 231 m_gainAudio->setMaximum(50);
232 m_gainAudio->setValue(0); 232 m_gainAudio->setValue(0);
233 m_gainAudio->setDefaultValue(0); 233 m_gainAudio->setDefaultValue(0);
234 //m_gainAudio->setFixedWidth(40);
234 m_gainAudio->setFixedWidth(24); 235 m_gainAudio->setFixedWidth(24);
235 m_gainAudio->setFixedHeight(24); 236 m_gainAudio->setFixedHeight(24);
236 m_gainAudio->setNotchesVisible(true); 237 m_gainAudio->setNotchesVisible(true);
237 m_gainAudio->setPageStep(10); 238 m_gainAudio->setPageStep(10);
238 m_gainAudio->setObjectName(tr("Audio Track Gain")); 239 m_gainAudio->setObjectName(tr("Audio Track Gain"));
283 m_panAudio->setMinimum(-100); 284 m_panAudio->setMinimum(-100);
284 m_panAudio->setMaximum(100); 285 m_panAudio->setMaximum(100);
285 m_panAudio->setValue(-100); 286 m_panAudio->setValue(-100);
286 m_panAudio->setDefaultValue(-100); 287 m_panAudio->setDefaultValue(-100);
287 m_panAudio->setFixedWidth(24); 288 m_panAudio->setFixedWidth(24);
289 //m_panAudio->setFixedWidth(40);
288 m_panAudio->setFixedHeight(24); 290 m_panAudio->setFixedHeight(24);
289 m_panAudio->setNotchesVisible(true); 291 m_panAudio->setNotchesVisible(true);
290 m_panAudio->setPageStep(10); 292 m_panAudio->setPageStep(10);
291 m_panAudio->setObjectName(tr("Audio Track Pan")); 293 m_panAudio->setObjectName(tr("Audio Track Pan"));
292 m_panAudio->setRangeMapper(new LinearRangeMapper(-100, 100, -100, 100, tr(""))); 294 m_panAudio->setRangeMapper(new LinearRangeMapper(-100, 100, -100, 100, tr("")));
911 connect(m_playNotes, SIGNAL(triggered()), this, SLOT(playNotesToggled())); 913 connect(m_playNotes, SIGNAL(triggered()), this, SLOT(playNotesToggled()));
912 connect(this, SIGNAL(canPlay(bool)), m_playNotes, SLOT(setEnabled(bool))); 914 connect(this, SIGNAL(canPlay(bool)), m_playNotes, SLOT(setEnabled(bool)));
913 */ 915 */
914 916
915 // Audio 917 // Audio
918 /*
916 QLabel *icon_audio = new QLabel; 919 QLabel *icon_audio = new QLabel;
917 icon_audio->setFixedWidth(40); 920 icon_audio->setFixedWidth(40);
918 icon_audio->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 921 icon_audio->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
919 icon_audio->setPixmap(il.loadPixmap("waveform")); 922 icon_audio->setPixmap(il.loadPixmap("waveform"));
920 toolbar->addWidget(icon_audio); 923 toolbar->addWidget(icon_audio);
921 924 */
922 m_showAudio = toolbar->addAction(il.load("eye"), tr("Show Audio")); 925
926 //m_showAudio = toolbar->addAction(il.load("eye"), tr("Show Audio"))
927 m_showAudio = toolbar->addAction(il.load("waveform"), tr("Show Audio"));
923 m_showAudio->setCheckable(true); 928 m_showAudio->setCheckable(true);
924 connect(m_showAudio, SIGNAL(triggered()), this, SLOT(showAudioToggled())); 929 connect(m_showAudio, SIGNAL(triggered()), this, SLOT(showAudioToggled()));
925 connect(this, SIGNAL(canPlay(bool)), m_showAudio, SLOT(setEnabled(bool))); 930 connect(this, SIGNAL(canPlay(bool)), m_showAudio, SLOT(setEnabled(bool)));
926 931
927 m_playAudio = toolbar->addAction(il.load("speaker"), tr("Play Audio")); 932 m_playAudio = toolbar->addAction(il.load("speaker"), tr("Play Audio"));
934 939
935 // Pitch (f0) 940 // Pitch (f0)
936 QLabel *icon_pitch = new QLabel; 941 QLabel *icon_pitch = new QLabel;
937 icon_pitch->setFixedWidth(40); 942 icon_pitch->setFixedWidth(40);
938 icon_pitch->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 943 icon_pitch->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
939 icon_pitch->setPixmap(il.loadPixmap("values")); 944 //icon_pitch->setPixmap(il.loadPixmap("values"));
940 toolbar->addWidget(icon_pitch); 945 toolbar->addWidget(icon_pitch);
941 946
942 m_showPitch = toolbar->addAction(il.load("eye"), tr("Show Pitch Track")); 947 // m_showPitch = toolbar->addAction(il.load("eye"), tr("Show Pitch Track"));
948 m_showPitch = toolbar->addAction(il.load("values"), tr("Show Pitch Track"));
943 m_showPitch->setCheckable(true); 949 m_showPitch->setCheckable(true);
944 connect(m_showPitch, SIGNAL(triggered()), this, SLOT(showPitchToggled())); 950 connect(m_showPitch, SIGNAL(triggered()), this, SLOT(showPitchToggled()));
945 connect(this, SIGNAL(canPlay(bool)), m_showPitch, SLOT(setEnabled(bool))); 951 connect(this, SIGNAL(canPlay(bool)), m_showPitch, SLOT(setEnabled(bool)));
946 952
947 m_playPitch = toolbar->addAction(il.load("speaker"), tr("Play Pitch Track")); 953 m_playPitch = toolbar->addAction(il.load("speaker"), tr("Play Pitch Track"));
954 960
955 // Notes 961 // Notes
956 QLabel *icon_notes = new QLabel; 962 QLabel *icon_notes = new QLabel;
957 icon_notes->setFixedWidth(40); 963 icon_notes->setFixedWidth(40);
958 icon_notes->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 964 icon_notes->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
959 icon_notes->setPixmap(il.loadPixmap("notes")); 965 //icon_notes->setPixmap(il.loadPixmap("notes"));
960 toolbar->addWidget(icon_notes); 966 toolbar->addWidget(icon_notes);
961 967
962 m_showNotes = toolbar->addAction(il.load("eye"), tr("Show Notes")); 968
969 //m_showNotes = toolbar->addAction(il.load("eye"), tr("Show Notes"));
970 m_showNotes = toolbar->addAction(il.load("notes"), tr("Show Notes"));
963 m_showNotes->setCheckable(true); 971 m_showNotes->setCheckable(true);
964 connect(m_showNotes, SIGNAL(triggered()), this, SLOT(showNotesToggled())); 972 connect(m_showNotes, SIGNAL(triggered()), this, SLOT(showNotesToggled()));
965 connect(this, SIGNAL(canPlay(bool)), m_showNotes, SLOT(setEnabled(bool))); 973 connect(this, SIGNAL(canPlay(bool)), m_showNotes, SLOT(setEnabled(bool)));
966 974
967 m_playNotes = toolbar->addAction(il.load("speaker"), tr("Play Notes")); 975 m_playNotes = toolbar->addAction(il.load("speaker"), tr("Play Notes"));
974 982
975 // Spectrogram 983 // Spectrogram
976 QLabel *icon_spectrogram = new QLabel; 984 QLabel *icon_spectrogram = new QLabel;
977 icon_spectrogram->setFixedWidth(40); 985 icon_spectrogram->setFixedWidth(40);
978 icon_spectrogram->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 986 icon_spectrogram->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
979 icon_spectrogram->setPixmap(il.loadPixmap("spectrogram")); 987 //icon_spectrogram->setPixmap(il.loadPixmap("spectrogram"));
980 toolbar->addWidget(icon_spectrogram); 988 toolbar->addWidget(icon_spectrogram);
981 989
982 m_showSpect = toolbar->addAction(il.load("eye"), tr("Show Spectrogram")); 990 //m_showSpect = toolbar->addAction(il.load("eye"), tr("Show Spectrogram"));
991 m_showSpect = toolbar->addAction(il.load("spectrogram"), tr("Show Spectrogram"));
983 m_showSpect->setCheckable(true); 992 m_showSpect->setCheckable(true);
984 connect(m_showSpect, SIGNAL(triggered()), this, SLOT(showSpectToggled())); 993 connect(m_showSpect, SIGNAL(triggered()), this, SLOT(showSpectToggled()));
985 connect(this, SIGNAL(canPlay(bool)), m_showSpect, SLOT(setEnabled(bool))); 994 connect(this, SIGNAL(canPlay(bool)), m_showSpect, SLOT(setEnabled(bool)));
986 995
987 Pane::registerShortcuts(*m_keyReference); 996 Pane::registerShortcuts(*m_keyReference);
1080 1089
1081 void 1090 void
1082 MainWindow::showAudioToggled() 1091 MainWindow::showAudioToggled()
1083 { 1092 {
1084 m_analyser->toggleVisible(Analyser::Audio); 1093 m_analyser->toggleVisible(Analyser::Audio);
1094
1095 // JTEST
1096 if (!m_analyser->isVisible(Analyser::Audio))
1097 {
1098 m_analyser->setAudible(Analyser::Audio,false);
1099 m_playAudio->setChecked(false);
1100 m_playAudio->setEnabled(false);
1101 }
1102 else
1103 {
1104 m_playAudio->setEnabled(true);
1105 }
1085 } 1106 }
1086 1107
1087 void 1108 void
1088 MainWindow::showPitchToggled() 1109 MainWindow::showPitchToggled()
1089 { 1110 {
1110 1131
1111 void 1132 void
1112 MainWindow::showNotesToggled() 1133 MainWindow::showNotesToggled()
1113 { 1134 {
1114 m_analyser->toggleVisible(Analyser::Notes); 1135 m_analyser->toggleVisible(Analyser::Notes);
1136
1137 // JTEST
1138 if (!m_analyser->isVisible(Analyser::Notes))
1139 {
1140 m_analyser->setAudible(Analyser::Notes,false);
1141 m_playNotes->setChecked(false);
1142 m_playNotes->setEnabled(false);
1143 }
1144 else
1145 {
1146 m_playNotes->setEnabled(true);
1147 }
1115 } 1148 }
1116 1149
1117 void 1150 void
1118 MainWindow::playAudioToggled() 1151 MainWindow::playAudioToggled()
1119 { 1152 {