Skip to content

Commit 1791c43

Browse files
committed
Add explanatory comment to CClient::ReorderLevelList()
1 parent 2d15a81 commit 1791c43

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/client.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,6 +1558,24 @@ int CClient::FindClientChannel ( const int iServerChannelID, const bool bCreateI
15581558
return INVALID_INDEX;
15591559
}
15601560

1561+
// When the client receives a channel level list from the server, the list contains one value
1562+
// for each currently-active channel, ordered by the channel ID assigned by the server.
1563+
// The values will correspond to the active channels in the last client list that was sent.
1564+
// This list is passed up to the mixer board, which will interpret the values in the order
1565+
// of channels that it knows about.
1566+
//
1567+
// Since CClient is now translating server channel IDs to local client channel IDs before
1568+
// passing the client list up to the mixer board, it is also necessary to re-order the values
1569+
// in the level list so that they are in order of mapped client channel ID.
1570+
// This function performs that re-ordering by scanning the server channels in order, once,
1571+
// for active channels, and storing the level value in the corresponding client channel.
1572+
// Then the function scans the client channels in order, fetching the level values and putting
1573+
// them back into vecLevelList in order of client channel. The mixer board will then display
1574+
// the levels against the correct channels.
1575+
//
1576+
// The list size is checked against the current number of active channels to guard against
1577+
// any unexpected temporary mismatch in size due to potential out-of-order message delivery.
1578+
15611579
bool CClient::ReorderLevelList ( CVector<uint16_t>& vecLevelList )
15621580
{
15631581
QMutexLocker locker ( &MutexChannels );

0 commit comments

Comments
 (0)