support sorting by group ID

This commit is contained in:
Volker Fischer 2020-07-04 11:52:09 +02:00
parent dc577891b4
commit 68389457bf
5 changed files with 21 additions and 3 deletions

View file

@ -916,10 +916,22 @@ void CAudioMixerBoard::ChangeFaderOrder ( const bool bDoSort,
{ {
PairList << QPair<QString, int> ( vecpChanFader[i]->GetReceivedName().toLower(), i ); PairList << QPair<QString, int> ( vecpChanFader[i]->GetReceivedName().toLower(), i );
} }
else // ST_BY_INSTRUMENT else if ( eChSortType == ST_BY_INSTRUMENT )
{ {
PairList << QPair<QString, int> ( CInstPictures::GetName ( vecpChanFader[i]->GetReceivedInstrument() ), i ); PairList << QPair<QString, int> ( CInstPictures::GetName ( vecpChanFader[i]->GetReceivedInstrument() ), i );
} }
else // ST_BY_GROUPID
{
if ( vecpChanFader[i]->GetGroupID() == INVALID_INDEX )
{
// put channels without a group at the end
PairList << QPair<QString, int> ( "z", i ); // group IDs are numbers, use letter to put it at the end
}
else
{
PairList << QPair<QString, int> ( QString::number ( vecpChanFader[i]->GetGroupID() ), i );
}
}
} }
// if requested, sort the channels // if requested, sort the channels

View file

@ -289,6 +289,9 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
pEditMenu->addAction ( tr ( "Sort Channel Users by &Instrument" ), this, pEditMenu->addAction ( tr ( "Sort Channel Users by &Instrument" ), this,
SLOT ( OnSortChannelsByInstrument() ), QKeySequence ( Qt::CTRL + Qt::Key_I ) ); SLOT ( OnSortChannelsByInstrument() ), QKeySequence ( Qt::CTRL + Qt::Key_I ) );
pEditMenu->addAction ( tr ( "Sort Channel Users by &Group" ), this,
SLOT ( OnSortChannelsByGroupID() ), QKeySequence ( Qt::CTRL + Qt::Key_G ) );
// Main menu bar ----------------------------------------------------------- // Main menu bar -----------------------------------------------------------
pMenu = new QMenuBar ( this ); pMenu = new QMenuBar ( this );

View file

@ -157,6 +157,7 @@ public slots:
void OnOpenAnalyzerConsole() { ShowAnalyzerConsole(); } void OnOpenAnalyzerConsole() { ShowAnalyzerConsole(); }
void OnSortChannelsByName() { MainMixerBoard->ChangeFaderOrder ( true, ST_BY_NAME ); } void OnSortChannelsByName() { MainMixerBoard->ChangeFaderOrder ( true, ST_BY_NAME ); }
void OnSortChannelsByInstrument() { MainMixerBoard->ChangeFaderOrder ( true, ST_BY_INSTRUMENT ); } void OnSortChannelsByInstrument() { MainMixerBoard->ChangeFaderOrder ( true, ST_BY_INSTRUMENT ); }
void OnSortChannelsByGroupID() { MainMixerBoard->ChangeFaderOrder ( true, ST_BY_GROUPID ); }
void OnSettingsStateChanged ( int value ); void OnSettingsStateChanged ( int value );
void OnChatStateChanged ( int value ); void OnChatStateChanged ( int value );

View file

@ -281,9 +281,10 @@ void CClientSettings::ReadFromXML ( const QDomDocument& IniXMLDocument )
// stored fader group ID // stored fader group ID
for ( iIdx = 0; iIdx < MAX_NUM_STORED_FADER_SETTINGS; iIdx++ ) for ( iIdx = 0; iIdx < MAX_NUM_STORED_FADER_SETTINGS; iIdx++ )
{ {
// note that we only apply valid group numbers here
if ( GetNumericIniSet ( IniXMLDocument, "client", if ( GetNumericIniSet ( IniXMLDocument, "client",
QString ( "storedgroupid%1" ).arg ( iIdx ), QString ( "storedgroupid%1" ).arg ( iIdx ),
0, MAX_NUM_FADER_GROUPS, iValue ) ) 0, MAX_NUM_FADER_GROUPS - 1, iValue ) )
{ {
pClient->vecStoredFaderGroupID[iIdx] = iValue; pClient->vecStoredFaderGroupID[iIdx] = iValue;
} }

View file

@ -581,7 +581,8 @@ enum ERecorderState
enum EChSortType enum EChSortType
{ {
ST_BY_NAME, ST_BY_NAME,
ST_BY_INSTRUMENT ST_BY_INSTRUMENT,
ST_BY_GROUPID
}; };