further preparation for #356

This commit is contained in:
Volker Fischer 2020-06-13 08:51:05 +02:00
parent e4b01fa395
commit b078bfd7b8
4 changed files with 26 additions and 5 deletions

View File

@ -768,20 +768,31 @@ void CAudioMixerBoard::HideAll()
iMyChannelID = INVALID_INDEX;
// use original order of channel (by server ID)
ChangeFaderOrder ( 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<QPair<QString, int> > PairList;
for ( int i = 0; i < MAX_NUM_CHANNELS; i++ )
{
PairList << QPair<QString, int> ( vecpChanFader[i]->GetReceivedName().toLower(), i );
if ( eChSortType == ST_BY_NAME )
{
PairList << QPair<QString, int> ( vecpChanFader[i]->GetReceivedName().toLower(), i );
}
else // ST_BY_INSTRUMENT
{
// note that the sorting will not be the same as we would use QPair<int, int>
// but this is not a problem since the order of the instrument IDs are arbitrary
// anyway
PairList << QPair<QString, int> ( QString::number ( vecpChanFader[i]->GetReceivedInstrument() ), i );
}
}
// if requested, sort the channels

View File

@ -147,7 +147,6 @@ public:
CAudioMixerBoard ( QWidget* parent = nullptr, Qt::WindowFlags f = nullptr );
void HideAll();
void ChangeFaderOrder ( const bool bDoSort );
void ApplyNewConClientList ( CVector<CChannelInfo>& vecChanInfo );
void SetServerName ( const QString& strNewServerName );
void SetGUIDesign ( const EGUIDesign eNewDesign );
@ -160,6 +159,9 @@ public:
void SetFaderLevel ( const int iChannelIdx,
const int iValue );
void ChangeFaderOrder ( const bool bDoSort,
const EChSortType eChSortType );
void SetChannelLevels ( const CVector<uint16_t>& vecChannelLevel );
// settings

View File

@ -152,7 +152,7 @@ public slots:
void OnOpenGeneralSettings() { ShowGeneralSettings(); }
void OnOpenChatDialog() { ShowChatWindow(); }
void OnOpenAnalyzerConsole() { ShowAnalyzerConsole(); }
void OnSortChannelsByName() { MainMixerBoard->ChangeFaderOrder ( true ); }
void OnSortChannelsByName() { MainMixerBoard->ChangeFaderOrder ( true, ST_BY_NAME ); }
void OnSettingsStateChanged ( int value );
void OnChatStateChanged ( int value );

View File

@ -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
{