Skip to content

Commit 4afc115

Browse files
committed
Fix for osc port display in the UI
Bug #2757 The osc port was cached locally in mainwindow from the old API; the better way to do this is to just ask the API for it. Since the old API code seems to have been removed, there is more cleanup that can be done.
1 parent 3db9bd3 commit 4afc115

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

app/gui/qt/mainwindow.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ MainWindow::MainWindow(QApplication& app, bool i18n, QSplashScreen* splash)
137137
bool startupOK = false;
138138

139139
m_spAPI->Init(rootPath().toStdString());
140+
guiID = QString::fromStdString(m_spAPI->GetGuid());
140141

141142
std::cout << "[GUI] - hiding main window" << std::endl;
142143
hide();
@@ -170,9 +171,6 @@ MainWindow::MainWindow(QApplication& app, bool i18n, QSplashScreen* splash)
170171
QThreadPool::globalInstance()->setMaxThreadCount(3);
171172

172173
startupOK = m_spAPI->WaitForServer();
173-
guiID = QString::fromStdString(m_spAPI->GetGuid());
174-
server_osc_cues_port = m_spAPI->GetPort(SonicPiPortId::server_osc_cues);
175-
scsynth_port = m_spAPI->GetPort(SonicPiPortId::scsynth);
176174

177175
if (startupOK)
178176
{
@@ -350,7 +348,7 @@ void MainWindow::setupWindowStructure()
350348
prefsWidget->setAllowedAreas(Qt::RightDockWidgetArea);
351349
prefsWidget->setFeatures(QDockWidget::DockWidgetClosable);
352350

353-
settingsWidget = new SettingsWidget(server_osc_cues_port, piSettings, this);
351+
settingsWidget = new SettingsWidget(m_spAPI->GetPort(SonicPiPortId::server_osc_cues), piSettings, this);
354352
connect(settingsWidget, SIGNAL(volumeChanged(int)), this, SLOT(changeSystemPreAmp(int)));
355353
connect(settingsWidget, SIGNAL(mixerSettingsChanged()), this, SLOT(mixerSettingsChanged()));
356354
connect(settingsWidget, SIGNAL(midiSettingsChanged()), this, SLOT(toggleMidi()));
@@ -2783,7 +2781,7 @@ void MainWindow::createToolBar()
27832781
}
27842782

27852783
QMenu* incomingOSCPortMenu = ioMenu->addMenu(tr("Incoming OSC Port"));
2786-
incomingOSCPortMenu->addAction(QString::number(server_osc_cues_port));
2784+
incomingOSCPortMenu->addAction(QString::number(m_spAPI->GetPort(SonicPiPortId::server_osc_cues)));
27872785

27882786
viewMenu = menuBar()->addMenu(tr("View"));
27892787

app/gui/qt/mainwindow.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,6 @@ class MainWindow : public QMainWindow
333333
QSettings *gui_settings;
334334
SonicPiSettings *piSettings;
335335

336-
int server_osc_cues_port;
337-
int scsynth_port;
338-
339336
bool focusMode;
340337
QCheckBox *startup_error_reported;
341338
bool is_recording;

0 commit comments

Comments
 (0)