option to set "Mute Myself" on with a command line argument (#495)

This commit is contained in:
Volker Fischer 2020-08-07 16:59:46 +02:00
parent 91d99fbd81
commit a3c53afdcb
4 changed files with 26 additions and 0 deletions

View file

@ -18,6 +18,8 @@
- support multi-threading in the server to better support multi-core CPUs, - support multi-threading in the server to better support multi-core CPUs,
use qmake "CONFIG+=multithreading" to enable the new multi-threading (#339) use qmake "CONFIG+=multithreading" to enable the new multi-threading (#339)
- option to set "Mute Myself" on with a command line argument (#495)
- bug fix: added more mutex in the server (should fix #480) - bug fix: added more mutex in the server (should fix #480)
- bug fix: --showallservers ping column sort is alphabetic (#201) - bug fix: --showallservers ping column sort is alphabetic (#201)

View file

@ -32,6 +32,7 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
const int iCtrlMIDIChannel, const int iCtrlMIDIChannel,
const bool bNewShowComplRegConnList, const bool bNewShowComplRegConnList,
const bool bShowAnalyzerConsole, const bool bShowAnalyzerConsole,
const bool bMuteStream,
QWidget* parent, QWidget* parent,
Qt::WindowFlags f ) : Qt::WindowFlags f ) :
QDialog ( parent, f ), QDialog ( parent, f ),
@ -506,6 +507,12 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
{ {
ShowConnectionSetupDialog(); ShowConnectionSetupDialog();
} }
// mute stream on startup (must be done after the signal connections)
if ( bMuteStream )
{
chbLocalMute->setCheckState ( Qt::Checked );
}
} }
void CClientDlg::closeEvent ( QCloseEvent* Event ) void CClientDlg::closeEvent ( QCloseEvent* Event )

View file

@ -79,6 +79,7 @@ public:
const int iCtrlMIDIChannel, const int iCtrlMIDIChannel,
const bool bNewShowComplRegConnList, const bool bNewShowComplRegConnList,
const bool bShowAnalyzerConsole, const bool bShowAnalyzerConsole,
const bool bMuteStream,
QWidget* parent = nullptr, QWidget* parent = nullptr,
Qt::WindowFlags f = nullptr ); Qt::WindowFlags f = nullptr );

View file

@ -66,6 +66,7 @@ int main ( int argc, char** argv )
bool bDisconnectAllClientsOnQuit = false; bool bDisconnectAllClientsOnQuit = false;
bool bUseDoubleSystemFrameSize = true; // default is 128 samples frame size bool bUseDoubleSystemFrameSize = true; // default is 128 samples frame size
bool bShowAnalyzerConsole = false; bool bShowAnalyzerConsole = false;
bool bMuteStream = false;
bool bCentServPingServerInList = false; bool bCentServPingServerInList = false;
bool bNoAutoJackConnect = false; bool bNoAutoJackConnect = false;
bool bUseTranslation = true; bool bUseTranslation = true;
@ -468,6 +469,18 @@ int main ( int argc, char** argv )
} }
// Mute stream on startup ----------------------------------------------
if ( GetFlagArgument ( argv,
i,
"-M",
"--mutestream" ) )
{
bMuteStream = true;
tsConsole << "- mute stream activated" << endl;
continue;
}
// Version number ------------------------------------------------------ // Version number ------------------------------------------------------
if ( ( !strcmp ( argv[i], "--version" ) ) || if ( ( !strcmp ( argv[i], "--version" ) ) ||
( !strcmp ( argv[i], "-v" ) ) ) ( !strcmp ( argv[i], "-v" ) ) )
@ -509,6 +522,7 @@ int main ( int argc, char** argv )
Q_UNUSED ( bStartMinimized ) // avoid compiler warnings Q_UNUSED ( bStartMinimized ) // avoid compiler warnings
Q_UNUSED ( bShowComplRegConnList ) // avoid compiler warnings Q_UNUSED ( bShowComplRegConnList ) // avoid compiler warnings
Q_UNUSED ( bShowAnalyzerConsole ) // avoid compiler warnings Q_UNUSED ( bShowAnalyzerConsole ) // avoid compiler warnings
Q_UNUSED ( bMuteStream ) // avoid compiler warnings
#endif #endif
@ -619,6 +633,7 @@ int main ( int argc, char** argv )
iCtrlMIDIChannel, iCtrlMIDIChannel,
bShowComplRegConnList, bShowComplRegConnList,
bShowAnalyzerConsole, bShowAnalyzerConsole,
bMuteStream,
nullptr, nullptr,
Qt::Window ); Qt::Window );
@ -768,6 +783,7 @@ QString UsageArguments ( char **argv )
" -y, --history enable connection history and set file name\n" " -y, --history enable connection history and set file name\n"
" -z, --startminimized start minimizied\n" " -z, --startminimized start minimizied\n"
"\nClient only:\n" "\nClient only:\n"
" -M, --mutestream starts the application in muted state\n"
" -c, --connect connect to given server address on startup\n" " -c, --connect connect to given server address on startup\n"
" -j, --nojackconnect disable auto Jack connections\n" " -j, --nojackconnect disable auto Jack connections\n"
" --ctrlmidich MIDI controller channel to listen\n" " --ctrlmidich MIDI controller channel to listen\n"