@@ -1092,39 +1092,47 @@ void CAudioMixerBoard::ChangeFaderOrder ( const EChSortType eChSortType )
1092
1092
iMyFader = static_cast <int > ( i );
1093
1093
}
1094
1094
1095
- if ( eChSortType == ST_BY_NAME )
1095
+ switch ( eChSortType )
1096
1096
{
1097
+ case ST_BY_NAME:
1097
1098
PairList << QPair<QString, size_t > ( vecpChanFader[i]->GetReceivedName ().toLower (), i );
1098
- }
1099
- else if ( eChSortType == ST_BY_CITY )
1100
- {
1101
- PairList << QPair<QString, size_t > ( vecpChanFader[i]->GetReceivedCity ().toLower (), i );
1102
- }
1103
- else if ( eChSortType == ST_BY_INSTRUMENT )
1104
- {
1099
+ break ;
1100
+ case ST_BY_CITY:
1101
+ // sort first "by city" and second "by name" by adding the name after the city
1102
+ PairList << QPair<QString, size_t > ( vecpChanFader[i]->GetReceivedCity ().toLower () + vecpChanFader[i]->GetReceivedName ().toLower (), i );
1103
+ break ;
1104
+ case ST_BY_INSTRUMENT:
1105
1105
// sort first "by instrument" and second "by name" by adding the name after the instrument
1106
1106
PairList << QPair<QString, size_t > ( CInstPictures::GetName ( vecpChanFader[i]->GetReceivedInstrument () ) +
1107
1107
vecpChanFader[i]->GetReceivedName ().toLower (),
1108
1108
i );
1109
- }
1110
- else if ( eChSortType == ST_BY_GROUPID )
1111
- {
1109
+ break ;
1110
+ case ST_BY_GROUPID:
1111
+ // sort first "by group" and second "by name" by adding the name after the group
1112
1112
if ( vecpChanFader[i]->GetGroupID () == INVALID_INDEX )
1113
1113
{
1114
1114
// put channels without a group at the end
1115
- PairList << QPair<QString, size_t > ( " z" , i ); // group IDs are numbers, use letter to put it at the end
1115
+ PairList << QPair<QString, size_t > ( " 999" + vecpChanFader[i]->GetReceivedName ().toLower (),
1116
+ i ); // worst case is one group per channel (current max is 8)
1116
1117
}
1117
1118
else
1118
1119
{
1119
- PairList << QPair<QString, size_t > ( QString::number ( vecpChanFader[i]->GetGroupID () ), i );
1120
+ PairList << QPair<QString, size_t > ( QString ( " %1" ).arg ( vecpChanFader[i]->GetGroupID (), 3 , 10 , QLatin1Char ( ' 0' ) ) +
1121
+ vecpChanFader[i]->GetReceivedName ().toLower (),
1122
+ i );
1120
1123
}
1121
- }
1122
- else // ST_NO_SORT
1123
- {
1124
+ break ;
1125
+ case ST_BY_SERVER_CHANNEL:
1126
+ PairList << QPair<QString, size_t > ( QString ( " %1" ).arg ( vecpChanFader[i]->GetReceivedChID (), 3 , 10 , QLatin1Char ( ' 0' ) ) +
1127
+ vecpChanFader[i]->GetReceivedName ().toLower (),
1128
+ i );
1129
+ break ;
1130
+ default : // ST_NO_SORT
1124
1131
// per definition for no sort: faders are sorted in the order they appeared (note that we
1125
1132
// pad to a total of 11 characters with zeros to make sure the sorting is done correctly)
1126
1133
PairList << QPair<QString, size_t > ( QString ( " %1" ).arg ( vecpChanFader[i]->GetRunningNewClientCnt (), 11 , 10 , QLatin1Char ( ' 0' ) ),
1127
1134
i );
1135
+ break ;
1128
1136
}
1129
1137
1130
1138
// count the number of visible faders
0 commit comments