From 847fc24200a8e9c50c287ba757db918c681b4fb2 Mon Sep 17 00:00:00 2001 From: Peter L Jones Date: Sat, 26 Oct 2024 11:32:41 +0100 Subject: [PATCH] Use INVALID_MIDI_CH for Mixer UI switch --- src/client.h | 2 ++ src/clientdlg.cpp | 3 +-- src/clientdlg.h | 1 - src/main.cpp | 1 - src/sound/soundbase.h | 2 ++ 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/client.h b/src/client.h index 3f9e30be6d..ca017a9147 100644 --- a/src/client.h +++ b/src/client.h @@ -272,6 +272,8 @@ class CClient : public QObject Channel.GetBufErrorRates ( vecErrRates, dLimit, dMaxUpLimit ); } + bool IsMIDIEnabled() { return Sound.IsMIDIEnabled(); } + // settings CChannelCoreInfo ChannelInfo; QString strClientName; diff --git a/src/clientdlg.cpp b/src/clientdlg.cpp index cb6b134bf7..a5d491012f 100644 --- a/src/clientdlg.cpp +++ b/src/clientdlg.cpp @@ -28,7 +28,6 @@ CClientDlg::CClientDlg ( CClient* pNCliP, CClientSettings* pNSetP, const QString& strConnOnStartupAddress, - const QString& strMIDISetup, const bool bNewShowComplRegConnList, const bool bShowAnalyzerConsole, const bool bMuteStream, @@ -219,7 +218,7 @@ CClientDlg::CClientDlg ( CClient* pNCliP, MainMixerBoard->SetNumMixerPanelRows ( pSettings->iNumMixerPanelRows ); // Pass through flag for MIDICtrlUsed - MainMixerBoard->SetMIDICtrlUsed ( !strMIDISetup.isEmpty() ); + MainMixerBoard->SetMIDICtrlUsed ( pClient->IsMIDIEnabled() ); // reset mixer board MainMixerBoard->HideAll(); diff --git a/src/clientdlg.h b/src/clientdlg.h index 2a9062a58d..f0e0d3292d 100644 --- a/src/clientdlg.h +++ b/src/clientdlg.h @@ -77,7 +77,6 @@ class CClientDlg : public CBaseDlg, private Ui_CClientDlgBase CClientDlg ( CClient* pNCliP, CClientSettings* pNSetP, const QString& strConnOnStartupAddress, - const QString& strMIDISetup, const bool bNewShowComplRegConnList, const bool bShowAnalyzerConsole, const bool bMuteStream, diff --git a/src/main.cpp b/src/main.cpp index 42d17a8dea..a306257b18 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -953,7 +953,6 @@ int main ( int argc, char** argv ) CClientDlg ClientDlg ( &Client, &Settings, strConnOnStartupAddress, - strMIDISetup, bShowComplRegConnList, bShowAnalyzerConsole, bMuteStream, diff --git a/src/sound/soundbase.h b/src/sound/soundbase.h index 0c3adb3b93..a37e2066bd 100644 --- a/src/sound/soundbase.h +++ b/src/sound/soundbase.h @@ -115,6 +115,8 @@ class CSoundBase : public QThread // in a callback function it has to be public -> better solution void EmitReinitRequestSignal ( const ESndCrdResetType eSndCrdResetType ) { emit ReinitRequest ( eSndCrdResetType ); } + bool IsMIDIEnabled() { return iCtrlMIDIChannel != INVALID_MIDI_CH; } + protected: virtual QString LoadAndInitializeDriver ( QString, bool ) { return ""; } virtual void UnloadCurrentDriver() {}