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,
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: --showallservers ping column sort is alphabetic (#201)

View File

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

View File

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

View File

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