diff --git a/src/audiomixerboard.cpp b/src/audiomixerboard.cpp index 127711e6..8036a358 100644 --- a/src/audiomixerboard.cpp +++ b/src/audiomixerboard.cpp @@ -447,6 +447,9 @@ void CChannelFader::SetChannelInfos ( const CChannelInfo& cChanInfo ) // 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; @@ -769,6 +772,7 @@ void CAudioMixerBoard::HideAll() // use original order of channel (by server ID) ChangeFaderOrder ( false ); + ChangeFaderOrderByInstrument ( false ); // emit status of connected clients emit NumClientsChanged ( 0 ); // -> no clients connected @@ -799,6 +803,29 @@ void CAudioMixerBoard::ChangeFaderOrder ( const bool bDoSort ) } } +void CAudioMixerBoard::ChangeFaderOrderByInstrument ( const bool bDoSort ) +{ + // create a pair list of instruments ID and fader ID for each channel + QList > PairList; + + for ( int i = 0; i < MAX_NUM_CHANNELS; i++ ) + { + PairList << QPair ( vecpChanFader[i]->GetReceivedInstrument(), i ); + } + + // if requested, sort the channels + if ( bDoSort ) + { + qStableSort ( PairList.begin(), PairList.end() ); + } + + // add channels to the layout in the new order + for ( int i = 0; i < MAX_NUM_CHANNELS; i++ ) + { + pMainLayout->insertWidget ( 0, vecpChanFader[PairList[i].second]->GetMainWidget() ); + } +} + void CAudioMixerBoard::ApplyNewConClientList ( CVector& vecChanInfo ) { // we want to set the server name only if the very first faders appear diff --git a/src/audiomixerboard.h b/src/audiomixerboard.h index 1e955ccd..20e4b2c6 100644 --- a/src/audiomixerboard.h +++ b/src/audiomixerboard.h @@ -50,6 +50,7 @@ public: CChannelFader ( QWidget* pNW ); QString GetReceivedName() { return strReceivedName; } + int GetReceivedInstrument() { return iReceivedInstrument; } void SetChannelInfos ( const CChannelInfo& cChanInfo ); void Show() { pFrame->show(); } void Hide() { pFrame->hide(); } @@ -103,6 +104,9 @@ protected: QString strReceivedName; + int iReceivedInstrument; + + bool bOtherChannelIsSolo; bool bIsMyOwnFader; @@ -147,6 +151,7 @@ public: 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 ); diff --git a/src/clientdlg.cpp b/src/clientdlg.cpp index 4b0c5611..89c3d59a 100755 --- a/src/clientdlg.cpp +++ b/src/clientdlg.cpp @@ -282,9 +282,12 @@ CClientDlg::CClientDlg ( CClient* pNCliP, // Edit menu -------------------------------------------------------------- pEditMenu = new QMenu ( tr ( "&Edit" ), this ); - pEditMenu->addAction ( tr ( "&Sort Channel Users by Name" ), this, + pEditMenu->addAction ( tr ( "Sort Channel Users by &Name" ), this, SLOT ( OnSortChannelsByName() ), QKeySequence ( Qt::CTRL + Qt::Key_N ) ); + pEditMenu->addAction ( tr ( "Sort Channel Users by &Instrument" ), this, + SLOT ( OnSortChannelsByInstrument() ), QKeySequence ( Qt::CTRL + Qt::Key_I ) ); + // Main menu bar ----------------------------------------------------------- pMenu = new QMenuBar ( this ); diff --git a/src/clientdlg.h b/src/clientdlg.h index 2489ed33..9767d043 100755 --- a/src/clientdlg.h +++ b/src/clientdlg.h @@ -153,6 +153,7 @@ public slots: void OnOpenChatDialog() { ShowChatWindow(); } void OnOpenAnalyzerConsole() { ShowAnalyzerConsole(); } void OnSortChannelsByName() { MainMixerBoard->ChangeFaderOrder ( true ); } + void OnSortChannelsByInstrument() { MainMixerBoard->ChangeFaderOrderByInstrument ( true ); } void OnSettingsStateChanged ( int value ); void OnChatStateChanged ( int value ); diff --git a/src/res/translation/translation_de_DE.qm b/src/res/translation/translation_de_DE.qm index 92eb290f..56d35893 100644 Binary files a/src/res/translation/translation_de_DE.qm and b/src/res/translation/translation_de_DE.qm differ diff --git a/src/res/translation/translation_de_DE.ts b/src/res/translation/translation_de_DE.ts index dc3211ad..da776a61 100644 --- a/src/res/translation/translation_de_DE.ts +++ b/src/res/translation/translation_de_DE.ts @@ -190,17 +190,17 @@ CAudioMixerBoard - + Server - + T R Y I N G T O C O N N E C T V E R B I N D U N G S A U F B A U - + Personal Mix at the Server: Eigener Mix am Server: @@ -367,44 +367,44 @@ - + Alias/Name - + Instrument - + Location Standort - - - + + + Skill Level Spielstärke - + Beginner Anfänger - + Intermediate Mittlere Spielstärke - + Expert Experte - + Musician Profile Profil des Musikers @@ -715,7 +715,7 @@ - + C&onnect &Verbinden @@ -760,28 +760,27 @@ B&earbeiten - &Sort Channel Users by Name - &Sortiere Kanäle nach Namen + &Sortiere Kanäle nach Namen - + None Keine - + Center Mitte - + R - + L @@ -856,22 +855,32 @@ Die CPU des Computers ist voll ausgelastet. - + + Sort Channel Users by &Name + Sortiere Kanäle nach &Namen + + + + Sort Channel Users by &Instrument + Sortiere Kanäle nach &Instrument + + + Central Server Zentralserver - + user Musiker - + users Musiker - + D&isconnect &Trennen diff --git a/src/res/translation/translation_es_ES.qm b/src/res/translation/translation_es_ES.qm index 89bebdb9..0d5c7ce9 100644 Binary files a/src/res/translation/translation_es_ES.qm and b/src/res/translation/translation_es_ES.qm differ diff --git a/src/res/translation/translation_es_ES.ts b/src/res/translation/translation_es_ES.ts index 84e93f55..1c18d4dd 100644 --- a/src/res/translation/translation_es_ES.ts +++ b/src/res/translation/translation_es_ES.ts @@ -194,17 +194,17 @@ CAudioMixerBoard - + Server Servidor - + T R Y I N G T O C O N N E C T I N T E N T A N D O C O N E C T A R - + Personal Mix at the Server: Mezcla Personal en el Servidor: @@ -371,44 +371,44 @@ - + Alias/Name Alias/Nombre - + Instrument Instrumento - + Location Ubicación - - - + + + Skill Level Nivel Habilidad - + Beginner Principiante - + Intermediate Intermedio - + Expert Experto - + Musician Profile Perfil Músico @@ -727,7 +727,7 @@ - + C&onnect C&onectar @@ -772,28 +772,23 @@ &Editar - - &Sort Channel Users by Name - &Ordenar Canales por Nombre - - - + None Ninguno - + Center Centro - + R R - + L L @@ -868,22 +863,32 @@ El procesador del cliente o del servidor está al 100%. - + + Sort Channel Users by &Name + Ordenar Canales por &Nombre + + + + Sort Channel Users by &Instrument + Ordenar Canales por &Instrumento + + + Central Server Servidor Central - + user usuario - + users usuarios - + D&isconnect D&esconectar @@ -2350,7 +2355,7 @@ Vocal Bass - Voz bajo + Voz Bajo