From f20d7feab1a6e9d4b7915e3f5aac4d761f2aff58 Mon Sep 17 00:00:00 2001 From: Peter L Jones Date: Sat, 21 Mar 2020 18:56:53 +0000 Subject: [PATCH] Accept number of items and days as arguments --- src/main.cpp | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 85bcb444..e43f1a28 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -53,6 +53,8 @@ int main ( int argc, char** argv ) bool bCentServPingServerInList = false; bool bNoAutoJackConnect = false; int iNumServerChannels = DEFAULT_USED_NUM_CHANNELS; + int iNumItemsHistory = NUM_ITEMS_HISTORY; + int iMaxDaysHistory = MAX_DAYS_HISTORY; int iCtrlMIDIChannel = INVALID_MIDI_CH; quint16 iPortNumber = LLCON_DEFAULT_PORT_NUMBER; ELicenceType eLicenceType = LT_NO_LICENCE; @@ -129,6 +131,45 @@ int main ( int argc, char** argv ) } + // Maximum items in history display ------------------------------------ + if ( GetNumericArgument ( tsConsole, + argc, + argv, + i, + "-I", + "--histitems", + 1, + 65535, + rDbleArgument ) ) + { + iNumItemsHistory = static_cast ( rDbleArgument ); + + tsConsole << "- maximum items in history display: " + << iNumItemsHistory << endl; + + continue; + } + + + // Maximum days in history display ------------------------------------ + if ( GetNumericArgument ( tsConsole, + argc, + argv, + i, + "-D", + "--histdays", + 1, + 366, + rDbleArgument ) ) + { + iMaxDaysHistory = static_cast ( rDbleArgument ); + + tsConsole << "- maximum days in history display: " + << iMaxDaysHistory << endl; + + continue; + } + // Start minimized ----------------------------------------------------- if ( GetFlagArgument ( argv, @@ -496,6 +537,8 @@ int main ( int argc, char** argv ) // Server: // actual server object CServer Server ( iNumServerChannels, + iNumItemsHistory, + iMaxDaysHistory, strLoggingFileName, iPortNumber, strHTMLStatusFileName, @@ -610,6 +653,8 @@ QString UsageArguments ( char **argv ) " -w, --welcomemessage welcome message on connect (server only)\n" " -y, --history enable connection history and set file\n" " name (server only)\n" + " -I, --histitems number of history items to display (server only)\n" + " -D, --histdays number of days of history to display (server only)\n" " -z, --startminimized start minimizied (server only)\n" " --ctrlmidich MIDI controller channel to listen (client only)" "\nExample: " + QString ( argv[0] ) + " -l -inifile myinifile.ini\n";