TeamTalk 5 C-API DLL
Version 5.8B
|
This section explains how to handle events generated by the client instance. More...
Classes | |
struct | TTMessage |
A struct containing the properties of an event. More... | |
Typedefs | |
typedef enum ClientEvent | ClientEvent |
TeamTalk client event messages. More... | |
typedef enum TTType | TTType |
typedef struct TTMessage | TTMessage |
A struct containing the properties of an event. More... | |
This section explains how to handle events generated by the client instance.
When events occur in the client instance, like e.g. if a new user joins a channel, the client instance queues a TTMessage which the user application must retrieve using TT_GetMessage(). The message queue for events is limited to 1 MB. If the queue grows above the maximum size then event handling is suspended and will not be resumed until the queue size is again below the maximum size. The event INTERR_TTMESSAGE_QUEUE_OVERFLOW will be posted to the message queue if an overflow has taken place.
If TT_InitTeamTalk is used with a HWND then the events are sent to the user application with WinAPI's PostMessage(...) function and is retrieved through GetMessage(...).
Note that when an event occurs the TeamTalk client instance doesn't wait for the user application to process the event. So if e.g. a user sends a text-message and immediately after disconnects from the server, then the User, who sent the message, cannot be retrieved using TT_GetUser() since the user is no longer available when the user application starts processing the new text-message event. This is, of course, annoying when designing the user application, but the reason for this design choice it that the client instance is a realtime component which cannot wait for the UI to process data, since audio playback and recording would then be halted.
The section Client Programming Guide gives a good idea of how events are processed in a user application.
typedef enum ClientEvent ClientEvent |
TeamTalk client event messages.
Events are retrieved using TT_GetMessage().
A struct containing the properties of an event.
The event can be retrieved by called TT_GetMessage. This struct is only required on non-Windows systems.
Section Client Event Handling explains event handling in the local client instance.
enum ClientEvent |
TeamTalk client event messages.
Events are retrieved using TT_GetMessage().
Enumerator | |||||||
---|---|---|---|---|---|---|---|
CLIENTEVENT_NONE | |||||||
CLIENTEVENT_CON_SUCCESS | Connected successfully to the server. This event is posted if TT_Connect() was successful. TT_DoLogin can now be called in order to logon to the server.
| ||||||
CLIENTEVENT_CON_FAILED | Failed to connect to server. This event is posted if TT_Connect fails. Ensure to call TT_Disconnect before calling TT_Connect again.
| ||||||
CLIENTEVENT_CON_LOST | Connection to server has been lost. The server is not responding to requests from the local client instance and the connection has been dropped. TT_GetClientStatistics can be used to check when data was last received from the server. Ensure to call TT_Disconnect before calling TT_Connect again.
| ||||||
CLIENTEVENT_CON_MAX_PAYLOAD_UPDATED | The maximum size of the payload put into UDP packets has been updated.
| ||||||
CLIENTEVENT_CMD_PROCESSING | A command issued by Read section Client/Server Command Processing on how to use command processing in the user application. | ||||||
CLIENTEVENT_CMD_ERROR | The server rejected a command issued by the local client instance. To figure out which command failed use the command ID returned by the TT_Do* command. Section Client/Server Command Processing explains how to use command ID.
| ||||||
CLIENTEVENT_CMD_SUCCESS | The server successfully processed a command issued by the local client instance. To figure out which command succeeded use the command ID returned by the TT_Do* command. Section Client/Server Command Processing explains how to use command ID.
| ||||||
CLIENTEVENT_CMD_MYSELF_LOGGEDIN | The client instance successfully logged on to server. The call to TT_DoLogin was successful and all channels on the server will be posted in the event CLIENTEVENT_CMD_CHANNEL_NEW immediately following this event. If USERRIGHT_VIEW_ALL_USERS is enabled the client instance will also receive the events CLIENTEVENT_CMD_USER_LOGGEDIN and CLIENTEVENT_CMD_USER_JOINED for every user on the server.
| ||||||
CLIENTEVENT_CMD_MYSELF_LOGGEDOUT | The client instance logged out of the server. A response to TT_DoLogout.
| ||||||
CLIENTEVENT_CMD_MYSELF_KICKED | The client instance was kicked from a channel. | ||||||
CLIENTEVENT_CMD_USER_LOGGEDIN | A new user logged on to the server.
| ||||||
CLIENTEVENT_CMD_USER_LOGGEDOUT | A client logged out of the server. This event is called when a user logs out with TT_DoLogout or disconnects with TT_Disconnect. | ||||||
CLIENTEVENT_CMD_USER_UPDATE | User changed properties.
| ||||||
CLIENTEVENT_CMD_USER_JOINED | A user has joined a channel.
| ||||||
CLIENTEVENT_CMD_USER_LEFT | User has left a channel. | ||||||
CLIENTEVENT_CMD_USER_TEXTMSG | A user has sent a text-message.
| ||||||
CLIENTEVENT_CMD_CHANNEL_NEW | A new channel has been created.
| ||||||
CLIENTEVENT_CMD_CHANNEL_UPDATE | A channel's properties has been updated.
| ||||||
CLIENTEVENT_CMD_CHANNEL_REMOVE | A channel has been removed. Note that calling the TT_GetChannel with the channel ID will fail because the channel is no longer there. | ||||||
CLIENTEVENT_CMD_SERVER_UPDATE | Server has updated its settings (server name, MOTD, etc.) Get new settings in
| ||||||
CLIENTEVENT_CMD_SERVERSTATISTICS | Server statistics available. This is a response to TT_DoServerStatistics()
| ||||||
CLIENTEVENT_CMD_FILE_NEW | A new file is added to a channel. Use TT_GetChannelFile() to get information about the file.
| ||||||
CLIENTEVENT_CMD_FILE_REMOVE | A file has been removed from a channel.
| ||||||
CLIENTEVENT_CMD_USERACCOUNT | A user account has been received from the server. This message is posted as a result of TT_DoListUserAccounts()
| ||||||
CLIENTEVENT_CMD_BANNEDUSER | A banned user has been received from the server. This message is posted as a result of TT_DoListBans()
| ||||||
CLIENTEVENT_USER_STATECHANGE | A user state has changed. The uUserState has changed for a user due to playback of an incoming stream. The user state changes if:
| ||||||
CLIENTEVENT_USER_VIDEOCAPTURE | A new video frame from a video capture device was received from a user. Use TT_AcquireUserVideoCaptureFrame to display the video frame. | ||||||
CLIENTEVENT_USER_MEDIAFILE_VIDEO | A new video frame from a video media file was received from a user. Use TT_AcquireUserMediaVideoFrame() to display the video frame. | ||||||
CLIENTEVENT_USER_DESKTOPWINDOW | A new or updated desktop window has been received from a user. Use TT_AcquireUserDesktopWindow() to retrieve the bitmap of the desktop window.
| ||||||
CLIENTEVENT_USER_DESKTOPCURSOR | A user has sent the position of the mouse cursor. Use TT_SendDesktopCursorPosition() to send the position of the mouse cursor.
| ||||||
CLIENTEVENT_USER_DESKTOPINPUT | Desktop input (mouse or keyboard input) has been received from a user. Desktop input is used in combination with a shared desktop window, see Desktop Sharing. This event is generated if a remote user has called TT_SendDesktopInput(). In order for the local client instance to receive desktop input it must have enabled the subscription SUBSCRIBE_DESKTOPINPUT. Due to different keyboard layout it might be a good idea to look into the key-translation function TT_DesktopInput_KeyTranslate(). See Receive Desktop Input for more information on receiving desktop input.
| ||||||
CLIENTEVENT_USER_RECORD_MEDIAFILE | A media file recording has changed status. TT_SetUserMediaStorageDir makes the client instance store all audio from a user to a specified folder. Every time an audio file is being processed this event is posted.
| ||||||
CLIENTEVENT_USER_AUDIOBLOCK | A new audio block can be extracted. The AudioBlock can either be of STREAMTYPE_VOICE, STREAMTYPE_LOCALMEDIAPLAYBACK_AUDIO or STREAMTYPE_MEDIAFILE_AUDIO. This event is only generated if TT_EnableAudioBlockEvent() is first called. Call TT_AcquireUserAudioBlock() to extract the AudioBlock.
| ||||||
CLIENTEVENT_INTERNAL_ERROR | An internal error occurred in the client instance. This can e.g. happen if a new user joins a channel and a sound output device fails to start a new audio stream. For at list of internal error messages check out ClientError with errors prefixed
| ||||||
CLIENTEVENT_VOICE_ACTIVATION | Voice activation has triggered transmission.
| ||||||
CLIENTEVENT_HOTKEY | A hotkey has been acticated or deactivated.
| ||||||
CLIENTEVENT_HOTKEY_TEST | A button was pressed or released on the user's keyboard or mouse. When TT_HotKey_InstallTestHook is called a hook is installed in Windows which intercepts all keyboard and mouse presses. Every time a key or mouse is pressed or released this event is posted. Use TT_HotKey_GetKeyString to get a key description of the pressed key.
| ||||||
CLIENTEVENT_FILETRANSFER | A file transfer is processing. Use TT_GetFileTransferInfo to get information about the file transfer. Ensure to check if the file transfer is completed, because the file transfer instance will be removed from the client instance when the user application reads the FileTransfer object and it has completed the transfer.
| ||||||
CLIENTEVENT_DESKTOPWINDOW_TRANSFER | Used for tracking when a desktop window has been transmitted to the server. When the transmission has completed the flag CLIENT_TX_DESKTOP will be cleared from the local client instance.
| ||||||
CLIENTEVENT_STREAM_MEDIAFILE | Media file being streamed to a channel is processing. This event is called as a result of TT_StartStreamingMediaFileToChannel() to monitor progress of streaming.
| ||||||
CLIENTEVENT_LOCAL_MEDIAFILE | Media file played locally is processing. This event is called as a result of TT_InitLocalPlayback() to monitor progress of playback.
| ||||||
CLIENTEVENT_AUDIOINPUT | Progress is audio being injected as STREAMTYPE_VOICE.
When
| ||||||
CLIENTEVENT_USER_FIRSTVOICESTREAMPACKET | The first voice packet of a new voice stream has been received. This time of this event may differ significantly from the start of the voice playout that is notified via CLIENTEVENT_USER_STATECHANGE due to jitter buffering. The time between CLIENTEVENT_USER_FIRSTVOICESTREAMPACKET and CLIENTEVENT_USER_STATECHANGE is the fixed jitter delay configuration plus the currently active adaptive jitter buffering in the nActiveAdaptiveDelayMSec member of the User struct
|
Definition at line 3059 of file TeamTalk.h.
enum TTType |
Definition at line 3619 of file TeamTalk.h.