diff --git a/src/audiomixerboard.cpp b/src/audiomixerboard.cpp index 8036a358..307a53c8 100644 --- a/src/audiomixerboard.cpp +++ b/src/audiomixerboard.cpp @@ -314,7 +314,7 @@ void CChannelFader::Reset() plblInstrument->setToolTip ( "" ); plblCountryFlag->setVisible ( false ); plblCountryFlag->setToolTip ( "" ); - strReceivedName = ""; + cReceivedChanInfo = CChannelInfo(); SetupFaderTag ( SL_NOT_SET ); // set a defined tool tip time out @@ -438,17 +438,15 @@ void CChannelFader::SetChannelLevel ( const uint16_t iLevel ) void CChannelFader::SetChannelInfos ( const CChannelInfo& cChanInfo ) { + // store received channel info + cReceivedChanInfo = cChanInfo; + // init properties for the tool tip int iTTInstrument = CInstPictures::GetNotUsedInstrument(); QLocale::Country eTTCountry = QLocale::AnyCountry; // Label text -------------------------------------------------------------- - // store original received name - strReceivedName = cChanInfo.strName; - - // store received instrument for sorting - iReceivedInstrument = cChanInfo.iInstrument; // break text at predefined position const int iBreakPos = MAX_LEN_FADER_TAG / 2; @@ -524,9 +522,9 @@ void CChannelFader::SetChannelInfos ( const CChannelInfo& cChanInfo ) QString strToolTip = ""; // alias/name - if ( !strReceivedName.isEmpty() ) + if ( !cChanInfo.strName.isEmpty() ) { - strToolTip += "

" + tr ( "Alias/Name" ) + "

" + strReceivedName; + strToolTip += "

" + tr ( "Alias/Name" ) + "

" + cChanInfo.strName; } // instrument @@ -771,21 +769,33 @@ void CAudioMixerBoard::HideAll() iMyChannelID = INVALID_INDEX; // use original order of channel (by server ID) - ChangeFaderOrder ( false ); - ChangeFaderOrderByInstrument ( false ); + + ChangeFaderOrder ( false, ST_BY_NAME ); + // emit status of connected clients emit NumClientsChanged ( 0 ); // -> no clients connected } -void CAudioMixerBoard::ChangeFaderOrder ( const bool bDoSort ) +void CAudioMixerBoard::ChangeFaderOrder ( const bool bDoSort, + const EChSortType eChSortType ) { // create a pair list of lower strings and fader ID for each channel QList > PairList; for ( int i = 0; i < MAX_NUM_CHANNELS; i++ ) { - PairList << QPair ( vecpChanFader[i]->GetReceivedName().toLower(), i ); + if ( eChSortType == ST_BY_NAME ) + { + PairList << QPair ( vecpChanFader[i]->GetReceivedName().toLower(), i ); + } + else // ST_BY_INSTRUMENT + { + // note that the sorting will not be the same as we would use QPair + // but this is not a problem since the order of the instrument IDs are arbitrary + // anyway + PairList << QPair ( QString::number ( vecpChanFader[i]->GetReceivedInstrument() ), i ); + } } // if requested, sort the channels diff --git a/src/audiomixerboard.h b/src/audiomixerboard.h index 20e4b2c6..1ee8d810 100644 --- a/src/audiomixerboard.h +++ b/src/audiomixerboard.h @@ -49,8 +49,9 @@ class CChannelFader : public QObject public: CChannelFader ( QWidget* pNW ); - QString GetReceivedName() { return strReceivedName; } - int GetReceivedInstrument() { return iReceivedInstrument; } + + QString GetReceivedName() { return cReceivedChanInfo.strName; } + int GetReceivedInstrument() { return cReceivedChanInfo.iInstrument; } void SetChannelInfos ( const CChannelInfo& cChanInfo ); void Show() { pFrame->show(); } void Hide() { pFrame->hide(); } @@ -102,7 +103,7 @@ protected: QLabel* plblInstrument; QLabel* plblCountryFlag; - QString strReceivedName; + CChannelInfo cReceivedChanInfo; int iReceivedInstrument; @@ -150,8 +151,6 @@ public: CAudioMixerBoard ( QWidget* parent = nullptr, Qt::WindowFlags f = nullptr ); void HideAll(); - void ChangeFaderOrder ( const bool bDoSort ); - void ChangeFaderOrderByInstrument (const bool bDoSort ); void ApplyNewConClientList ( CVector& vecChanInfo ); void SetServerName ( const QString& strNewServerName ); void SetGUIDesign ( const EGUIDesign eNewDesign ); @@ -164,6 +163,9 @@ public: void SetFaderLevel ( const int iChannelIdx, const int iValue ); + void ChangeFaderOrder ( const bool bDoSort, + const EChSortType eChSortType ); + void SetChannelLevels ( const CVector& vecChannelLevel ); // settings diff --git a/src/clientdlg.h b/src/clientdlg.h index 9767d043..87c981c7 100755 --- a/src/clientdlg.h +++ b/src/clientdlg.h @@ -152,8 +152,8 @@ public slots: void OnOpenGeneralSettings() { ShowGeneralSettings(); } void OnOpenChatDialog() { ShowChatWindow(); } void OnOpenAnalyzerConsole() { ShowAnalyzerConsole(); } - void OnSortChannelsByName() { MainMixerBoard->ChangeFaderOrder ( true ); } - void OnSortChannelsByInstrument() { MainMixerBoard->ChangeFaderOrderByInstrument ( true ); } + void OnSortChannelsByName() { MainMixerBoard->ChangeFaderOrder ( true, ST_BY_NAME ); } + void OnSettingsStateChanged ( int value ); void OnChatStateChanged ( int value ); diff --git a/src/res/homepage/manual.md b/src/res/homepage/manual.md index 34dfe39d..c88aa61c 100644 --- a/src/res/homepage/manual.md +++ b/src/res/homepage/manual.md @@ -93,7 +93,7 @@ in a direction where the label above the fader shows L -x, where x is the curren In the audio mixer frame, a fader is shown for each connected client at the server (including yourself). The faders allow you to adjust the level of what you hear without affecting what others hear. -The VU meter shows the input level at the server - that is, the sound you are sending. +The VU meter shows the input level at the server - that is, the sound being sent. If you have set your Audio Channel to Stereo or Stereo Out in your Settings, you will also see a pan control. @@ -103,6 +103,7 @@ Using the **Mute button** prevents the indicated channel being heard in your loc The **Solo button** allows you to hear one or more musicians on their own. Those not soloed will be muted. Note also that those musicians who are not soloed will see a "muted" icon above your fader. +Channels are listed left to right in the order that clients connect until they leave, at which point their "slot" is filled by the next new arrival. You can change the sort order using the Edit option in the application menu. diff --git a/src/server.cpp b/src/server.cpp index e52aa3e8..1df29a55 100755 --- a/src/server.cpp +++ b/src/server.cpp @@ -240,6 +240,7 @@ CServer::CServer ( const int iNewMaxNumChan, Logging ( iMaxDaysHistory ), iFrameCount ( 0 ), JamRecorder ( strRecordingDirName ), + bEnableRecording ( false ), bWriteStatusHTMLFile ( false ), HighPrecisionTimer ( bNUseDoubleSystemFrameSize ), ServerListManager ( iPortNumber, @@ -405,7 +406,7 @@ CServer::CServer ( const int iNewMaxNumChan, if ( !strRecordingDirName.isEmpty() ) { bRecorderInitialised = JamRecorder.Init ( this, iServerFrameSizeSamples ); - bEnableRecording = bRecorderInitialised; + SetEnableRecording ( bRecorderInitialised ); } // enable all channels (for the server all channel must be enabled the @@ -665,6 +666,10 @@ void CServer::OnAboutToQuit() void CServer::OnHandledSignal ( int sigNum ) { + // show the signal number on the command line (note that this does not work for the Windows command line) +// TODO we should use the ConsoleWriterFactory() instead of qDebug() + qDebug() << "OnHandledSignal: " << sigNum; + #ifdef _WIN32 // Windows does not actually get OnHandledSignal triggered QCoreApplication::instance()->exit(); @@ -705,8 +710,16 @@ void CServer::SetEnableRecording ( bool bNewEnableRecording ) { if ( bRecorderInitialised ) { + // note that this block executes regardless of whether + // what appears to be a change is being applied, to ensure + // the requested state is the result bEnableRecording = bNewEnableRecording; +#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) +// TODO we should use the ConsoleWriterFactory() instead of qInfo() + qInfo() << "Recording state " << ( bEnableRecording ? "enabled" : "disabled" ); +#endif + if ( !bEnableRecording ) { emit StopRecorder(); diff --git a/src/serverdlgbase.ui b/src/serverdlgbase.ui index e00bb4db..418a07c3 100755 --- a/src/serverdlgbase.ui +++ b/src/serverdlgbase.ui @@ -7,7 +7,7 @@ 0 0 588 - 415 + 419 @@ -69,9 +69,27 @@ + + + + + + + + Genre + + + + + + + STATUS + + + @@ -88,13 +106,6 @@ - - - - STATUS - - - diff --git a/src/util.h b/src/util.h index 935ebd02..6e24312b 100755 --- a/src/util.h +++ b/src/util.h @@ -563,6 +563,14 @@ enum ELicenceType }; +// Channel sort type ----------------------------------------------------------- +enum EChSortType +{ + ST_BY_NAME = 0, + ST_BY_INSTRUMENT = 1 +}; + + // Central server address type ------------------------------------------------- enum ECSAddType {