Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- Added "Show MIDI Player" item to the tray icon menu

- Improved tab behaviour, new tab gets active now
- Synth details show / hide behaviour made more reasonable in context of tabs
  • Loading branch information...
commit bda89212ca5caca0eaba0da1de3ee2223b829cc2 1 parent a8370ff
@sergm sergm authored
View
8 mt32emu_qt/src/MainWindow.cpp
@@ -88,6 +88,10 @@ void MainWindow::on_actionAbout_triggered()
);
}
+void MainWindow::on_synthTabs_currentChanged() {
+ emit currentTabChanged(ui->synthTabs->currentWidget());
+}
+
void MainWindow::refreshTabNames()
{
QWidget *widget;
@@ -103,7 +107,9 @@ void MainWindow::refreshTabNames()
void MainWindow::handleSynthRouteAdded(SynthRoute *synthRoute, const AudioDevice *audioDevice) {
SynthWidget *synthWidget = new SynthWidget(master, synthRoute, audioDevice, this);
+ int newTabIx = ui->synthTabs->count();
ui->synthTabs->addTab(synthWidget, QString().sprintf("Synth &%i", ui->synthTabs->count() + 1));
+ ui->synthTabs->setCurrentIndex(newTabIx);
}
void MainWindow::handleSynthRouteRemoved(SynthRoute *synthRoute) {
@@ -124,6 +130,7 @@ void MainWindow::handleSynthRouteRemoved(SynthRoute *synthRoute) {
}
}
+
void MainWindow::on_menuMIDI_aboutToShow() {
ui->actionNew_MIDI_port->setEnabled(master->canCreateMidiPort());
}
@@ -204,6 +211,7 @@ void MainWindow::trayIconContextMenu() {
QFont bold;
bold.setBold(true);
menu->addAction("Show/Hide", this, SLOT(showHideMainWindow()))->setFont(bold);
+ menu->addAction("Show MIDI Player", this, SLOT(on_actionPlay_MIDI_file_triggered()));
menu->addAction(ui->actionStart_iconized);
ui->actionStart_iconized->setChecked(master->getSettings()->value("Master/startIconized", "0").toBool());
#ifdef WITH_WINCONSOLE
View
4 mt32emu_qt/src/MainWindow.h
@@ -49,10 +49,14 @@ private slots:
void on_actionShow_LCD_balloons_toggled(bool checked);
void on_actionShow_connection_balloons_toggled(bool checked);
void on_actionROM_Configuration_triggered();
+ void on_synthTabs_currentChanged();
void refreshTabNames();
void showHideMainWindow();
void handleTrayIconActivated(QSystemTrayIcon::ActivationReason reason);
void toggleShowConsole();
+
+signals:
+ void currentTabChanged(QWidget *currentSynthWidget);
};
#endif // MAINWINDOW_H
View
13 mt32emu_qt/src/SynthWidget.cpp
@@ -53,6 +53,7 @@ SynthWidget::SynthWidget(Master *master, SynthRoute *useSynthRoute, const AudioD
connect(synthRoute, SIGNAL(midiSessionRemoved(MidiSession *)), SLOT(handleMIDISessionRemoved(MidiSession *)));
connect(synthRoute, SIGNAL(midiSessionNameChanged(MidiSession *)), SLOT(handleMIDISessionNameChanged(MidiSession *)));
connect(master, SIGNAL(synthRoutePinned()), SLOT(handleSynthRoutePinned()));
+ connect(parent, SIGNAL(currentTabChanged(QWidget *)), SLOT(handleCurrentTabChanged(QWidget *)));
connect(ui->synthPropertiesButton, SIGNAL(clicked()), &spd, SLOT(exec()));
connect(&timer, SIGNAL(timeout()), SLOT(adjustMainWindowSize()));
@@ -260,6 +261,18 @@ void SynthWidget::adjustMainWindowSize() {
if (newHeight != oldHeight) timer.stop();
}
+void SynthWidget::handleCurrentTabChanged(QWidget *currentSynthWidget) {
+ if (currentSynthWidget == this && Master::getInstance()->getSettings()->value("Master/showSynthDetails", "0").toBool()) {
+ ui->detailsFrame->setVisible(true);
+ ui->detailsButton->setIcon(QIcon(":/images/DetailsHide.gif"));
+ synthStateMonitor->connectSignals(true);
+ } else {
+ ui->detailsFrame->setVisible(false);
+ ui->detailsButton->setIcon(QIcon(":/images/Details.gif"));
+ synthStateMonitor->connectSignals(false);
+ }
+}
+
void SynthWidget::on_detailsButton_clicked() {
bool newVisible = !ui->detailsFrame->isVisible();
ui->detailsFrame->setVisible(newVisible);
View
1  mt32emu_qt/src/SynthWidget.h
@@ -80,6 +80,7 @@ private slots:
void on_midiRecord_clicked();
void on_masterVolumeSlider_valueChanged(int newValue);
void on_detailsButton_clicked();
+ void handleCurrentTabChanged(QWidget *currentSynthWidget);
void handleSynthRouteState(SynthRouteState state);
void handleSynthRoutePinned();
void handleMIDISessionAdded(MidiSession *midiSession);
Please sign in to comment.
Something went wrong with that request. Please try again.