Channel sorting
The order how channels should be display in the GUI is defined by the
channel variable CHANNEL_ORDER
, which can be queried with
ts3client_getChannelVariableAsUInt64()
and changed with
ts3client_setChannelVariableAsUInt64()
.
The channel order is the ID of the predecessor channel after which the given channel should be sorted. An order of 0 means the channel is sorted on the top of its hirarchy.
Channel_1 (ID = 1, order = 0)
Channel_2 (ID = 2, order = 1)
Subchannel_1 (ID = 4, order = 0)
Subsubchannel_1 (ID = 6, order = 0)
Subsubchannel_2 (ID = 7, order = 6)
Subchannel_2 (ID = 5, order = 4)
Channel_3 (ID = 3, order = 2)
Important
When a new channel is created, the client is responsible to set a proper channel order. With the default value of 0 the channel will be sorted on the top of its hirarchy right after its parent channel.
When moving a channel to a new parent, the desired channel order can be
passed to ts3client_requestChannelMove()
.
To move the channel to another position within the current hirarchy -
the parent channel stays the same -, adjust the CHANNEL_ORDER
variable with ts3client_setChannelVariableAsUInt64()
.
After connecting to a TeamSpeak 3 server, the client will be informed of
all channels by the onNewChannelEvent()
callback.
The order how channels are propagated to the client is:
First the complete channel path to the default channel, which is either the servers default channel with the flag
CHANNEL_FLAG_DEFAULT
or the users default channel passed tots3client_startConnection()
. This ensures the channel joined on login is visible as soon as possible.In the above example, assuming the default channel is “Subsubchannel_2”, the channels would be announced in the following order: Channel_2, Subchannel_1, Subsubchannel_2.
After the default channel path has completely arrived, the connection status (see
ConnectStatus
annouced to the client by the callbackonConnectStatusChangeEvent()
) changes toSTATUS_CONNECTION_ESTABLISHING
.Next all other channels in the given order, where subchannels are announced right after the parent channel.
To continue the example, the remaining channels would be announced in the order of: Channel_1, Subsubchannel_1, Subchannel_2, Channel_3 (Channel_2, Subchannel_1, Subsubchannel_2 already were announced in the previous step).
When all channels have arrived, the connection status switches to
STATUS_CONNECTION_ESTABLISHED
.