Addded sort by instrument

This commit is contained in:
Alberstein8 2020-06-13 01:14:43 +02:00
parent 4c94633c1a
commit 0aea018a61
8 changed files with 103 additions and 53 deletions

View file

@ -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<QPair<int, int> > PairList;
for ( int i = 0; i < MAX_NUM_CHANNELS; i++ )
{
PairList << QPair<int, int> ( 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<CChannelInfo>& vecChanInfo )
{
// we want to set the server name only if the very first faders appear

View file

@ -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<CChannelInfo>& vecChanInfo );
void SetServerName ( const QString& strNewServerName );
void SetGUIDesign ( const EGUIDesign eNewDesign );

View file

@ -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 );

View file

@ -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 );

View file

@ -190,17 +190,17 @@
<context>
<name>CAudioMixerBoard</name>
<message>
<location filename="../../audiomixerboard.cpp" line="697"/>
<location filename="../../audiomixerboard.cpp" line="700"/>
<source>Server</source>
<translation></translation>
</message>
<message>
<location filename="../../audiomixerboard.cpp" line="706"/>
<location filename="../../audiomixerboard.cpp" line="709"/>
<source>T R Y I N G T O C O N N E C T</source>
<translation>V E R B I N D U N G S A U F B A U</translation>
</message>
<message>
<location filename="../../audiomixerboard.cpp" line="808"/>
<location filename="../../audiomixerboard.cpp" line="835"/>
<source>Personal Mix at the Server: </source>
<translation>Eigener Mix am Server: </translation>
</message>
@ -367,44 +367,44 @@
<translation></translation>
</message>
<message>
<location filename="../../audiomixerboard.cpp" line="526"/>
<location filename="../../audiomixerboard.cpp" line="529"/>
<source>Alias/Name</source>
<translation></translation>
</message>
<message>
<location filename="../../audiomixerboard.cpp" line="532"/>
<location filename="../../audiomixerboard.cpp" line="535"/>
<source>Instrument</source>
<translation></translation>
</message>
<message>
<location filename="../../audiomixerboard.cpp" line="540"/>
<location filename="../../audiomixerboard.cpp" line="543"/>
<source>Location</source>
<translation>Standort</translation>
</message>
<message>
<location filename="../../audiomixerboard.cpp" line="562"/>
<location filename="../../audiomixerboard.cpp" line="566"/>
<location filename="../../audiomixerboard.cpp" line="570"/>
<location filename="../../audiomixerboard.cpp" line="565"/>
<location filename="../../audiomixerboard.cpp" line="569"/>
<location filename="../../audiomixerboard.cpp" line="573"/>
<source>Skill Level</source>
<translation>Spielstärke</translation>
</message>
<message>
<location filename="../../audiomixerboard.cpp" line="562"/>
<location filename="../../audiomixerboard.cpp" line="565"/>
<source>Beginner</source>
<translation>Anfänger</translation>
</message>
<message>
<location filename="../../audiomixerboard.cpp" line="566"/>
<location filename="../../audiomixerboard.cpp" line="569"/>
<source>Intermediate</source>
<translation>Mittlere Spielstärke</translation>
</message>
<message>
<location filename="../../audiomixerboard.cpp" line="570"/>
<location filename="../../audiomixerboard.cpp" line="573"/>
<source>Expert</source>
<translation>Experte</translation>
</message>
<message>
<location filename="../../audiomixerboard.cpp" line="581"/>
<location filename="../../audiomixerboard.cpp" line="584"/>
<source>Musician Profile</source>
<translation>Profil des Musikers</translation>
</message>
@ -715,7 +715,7 @@
</message>
<message>
<location filename="../../clientdlg.cpp" line="203"/>
<location filename="../../clientdlg.cpp" line="1108"/>
<location filename="../../clientdlg.cpp" line="1111"/>
<source>C&amp;onnect</source>
<translation>&amp;Verbinden</translation>
</message>
@ -760,28 +760,27 @@
<translation>B&amp;earbeiten</translation>
</message>
<message>
<location filename="../../clientdlg.cpp" line="285"/>
<source>&amp;Sort Channel Users by Name</source>
<translation>&amp;Sortiere Kanäle nach Namen</translation>
<translation type="vanished">&amp;Sortiere Kanäle nach Namen</translation>
</message>
<message>
<location filename="../../clientdlg.cpp" line="334"/>
<location filename="../../clientdlg.cpp" line="337"/>
<source>None</source>
<translation>Keine</translation>
</message>
<message>
<location filename="../../clientdlg.cpp" line="616"/>
<location filename="../../clientdlg.cpp" line="619"/>
<source>Center</source>
<translation>Mitte</translation>
</message>
<message>
<location filename="../../clientdlg.cpp" line="623"/>
<location filename="../../clientdlg.cpp" line="626"/>
<source>R</source>
<translation></translation>
</message>
<message>
<location filename="../../clientdlg.cpp" line="107"/>
<location filename="../../clientdlg.cpp" line="629"/>
<location filename="../../clientdlg.cpp" line="632"/>
<source>L</source>
<translation></translation>
</message>
@ -856,22 +855,32 @@
<translation>Die CPU des Computers ist voll ausgelastet.</translation>
</message>
<message>
<location filename="../../clientdlg.cpp" line="715"/>
<location filename="../../clientdlg.cpp" line="285"/>
<source>Sort Channel Users by &amp;Name</source>
<translation>Sortiere Kanäle nach &amp;Namen</translation>
</message>
<message>
<location filename="../../clientdlg.cpp" line="288"/>
<source>Sort Channel Users by &amp;Instrument</source>
<translation>Sortiere Kanäle nach &amp;Instrument</translation>
</message>
<message>
<location filename="../../clientdlg.cpp" line="718"/>
<source>Central Server</source>
<translation>Zentralserver</translation>
</message>
<message>
<location filename="../../clientdlg.cpp" line="842"/>
<location filename="../../clientdlg.cpp" line="845"/>
<source>user</source>
<translation>Musiker</translation>
</message>
<message>
<location filename="../../clientdlg.cpp" line="847"/>
<location filename="../../clientdlg.cpp" line="850"/>
<source>users</source>
<translation>Musiker</translation>
</message>
<message>
<location filename="../../clientdlg.cpp" line="1084"/>
<location filename="../../clientdlg.cpp" line="1087"/>
<source>D&amp;isconnect</source>
<translation>&amp;Trennen</translation>
</message>

View file

@ -194,17 +194,17 @@
<context>
<name>CAudioMixerBoard</name>
<message>
<location filename="../../audiomixerboard.cpp" line="697"/>
<location filename="../../audiomixerboard.cpp" line="700"/>
<source>Server</source>
<translation>Servidor</translation>
</message>
<message>
<location filename="../../audiomixerboard.cpp" line="706"/>
<location filename="../../audiomixerboard.cpp" line="709"/>
<source>T R Y I N G T O C O N N E C T</source>
<translation>I N T E N T A N D O C O N E C T A R</translation>
</message>
<message>
<location filename="../../audiomixerboard.cpp" line="808"/>
<location filename="../../audiomixerboard.cpp" line="835"/>
<source>Personal Mix at the Server: </source>
<translation>Mezcla Personal en el Servidor: </translation>
</message>
@ -371,44 +371,44 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../audiomixerboard.cpp" line="526"/>
<location filename="../../audiomixerboard.cpp" line="529"/>
<source>Alias/Name</source>
<translation>Alias/Nombre</translation>
</message>
<message>
<location filename="../../audiomixerboard.cpp" line="532"/>
<location filename="../../audiomixerboard.cpp" line="535"/>
<source>Instrument</source>
<translation>Instrumento</translation>
</message>
<message>
<location filename="../../audiomixerboard.cpp" line="540"/>
<location filename="../../audiomixerboard.cpp" line="543"/>
<source>Location</source>
<translation>Ubicación</translation>
</message>
<message>
<location filename="../../audiomixerboard.cpp" line="562"/>
<location filename="../../audiomixerboard.cpp" line="566"/>
<location filename="../../audiomixerboard.cpp" line="570"/>
<location filename="../../audiomixerboard.cpp" line="565"/>
<location filename="../../audiomixerboard.cpp" line="569"/>
<location filename="../../audiomixerboard.cpp" line="573"/>
<source>Skill Level</source>
<translation>Nivel Habilidad</translation>
</message>
<message>
<location filename="../../audiomixerboard.cpp" line="562"/>
<location filename="../../audiomixerboard.cpp" line="565"/>
<source>Beginner</source>
<translation>Principiante</translation>
</message>
<message>
<location filename="../../audiomixerboard.cpp" line="566"/>
<location filename="../../audiomixerboard.cpp" line="569"/>
<source>Intermediate</source>
<translation>Intermedio</translation>
</message>
<message>
<location filename="../../audiomixerboard.cpp" line="570"/>
<location filename="../../audiomixerboard.cpp" line="573"/>
<source>Expert</source>
<translation>Experto</translation>
</message>
<message>
<location filename="../../audiomixerboard.cpp" line="581"/>
<location filename="../../audiomixerboard.cpp" line="584"/>
<source>Musician Profile</source>
<translation>Perfil Músico</translation>
</message>
@ -727,7 +727,7 @@
</message>
<message>
<location filename="../../clientdlg.cpp" line="203"/>
<location filename="../../clientdlg.cpp" line="1108"/>
<location filename="../../clientdlg.cpp" line="1111"/>
<source>C&amp;onnect</source>
<translation>C&amp;onectar</translation>
</message>
@ -772,28 +772,23 @@
<translation>&amp;Editar</translation>
</message>
<message>
<location filename="../../clientdlg.cpp" line="285"/>
<source>&amp;Sort Channel Users by Name</source>
<translation>&amp;Ordenar Canales por Nombre</translation>
</message>
<message>
<location filename="../../clientdlg.cpp" line="334"/>
<location filename="../../clientdlg.cpp" line="337"/>
<source>None</source>
<translation>Ninguno</translation>
</message>
<message>
<location filename="../../clientdlg.cpp" line="616"/>
<location filename="../../clientdlg.cpp" line="619"/>
<source>Center</source>
<translation>Centro</translation>
</message>
<message>
<location filename="../../clientdlg.cpp" line="623"/>
<location filename="../../clientdlg.cpp" line="626"/>
<source>R</source>
<translation>R</translation>
</message>
<message>
<location filename="../../clientdlg.cpp" line="107"/>
<location filename="../../clientdlg.cpp" line="629"/>
<location filename="../../clientdlg.cpp" line="632"/>
<source>L</source>
<translation>L</translation>
</message>
@ -868,22 +863,32 @@
<translation>El procesador del cliente o del servidor está al 100%.</translation>
</message>
<message>
<location filename="../../clientdlg.cpp" line="715"/>
<location filename="../../clientdlg.cpp" line="285"/>
<source>Sort Channel Users by &amp;Name</source>
<translation>Ordenar Canales por &amp;Nombre</translation>
</message>
<message>
<location filename="../../clientdlg.cpp" line="288"/>
<source>Sort Channel Users by &amp;Instrument</source>
<translation>Ordenar Canales por &amp;Instrumento</translation>
</message>
<message>
<location filename="../../clientdlg.cpp" line="718"/>
<source>Central Server</source>
<translation>Servidor Central</translation>
</message>
<message>
<location filename="../../clientdlg.cpp" line="842"/>
<location filename="../../clientdlg.cpp" line="845"/>
<source>user</source>
<translation>usuario</translation>
</message>
<message>
<location filename="../../clientdlg.cpp" line="847"/>
<location filename="../../clientdlg.cpp" line="850"/>
<source>users</source>
<translation>usuarios</translation>
</message>
<message>
<location filename="../../clientdlg.cpp" line="1084"/>
<location filename="../../clientdlg.cpp" line="1087"/>
<source>D&amp;isconnect</source>
<translation>D&amp;esconectar</translation>
</message>
@ -2350,7 +2355,7 @@
<message>
<location filename="../../util.cpp" line="1014"/>
<source>Vocal Bass</source>
<translation>Voz bajo</translation>
<translation>Voz Bajo</translation>
</message>
<message>
<location filename="../../util.cpp" line="1015"/>