TeamTalk 5 .NET DLL Version 5.15A
|
This section explains how to instantiate a new client instance and query its current state. More...
Classes | |
class | BearWare.TeamTalkBase |
Abstract class which encapsulates the TeamTalk 5 client. Instantiate either BearWare.TeamTalk5 (TeamTalk 5 SDK Standard Edition) or BearWare.TeamTalk5Pro (TeamTalk 5 SDK Professional Edition) to create the TeamTalk instance. More... | |
class | BearWare.TeamTalk5 |
Class used to load TeamTalk5.dll and instantiate a TeamTalk client in TeamTalk 5 SDK Standard Edition. More... | |
class | BearWare.TeamTalk5Pro |
Class used to load TeamTalk5Pro.dll and instantiate a TeamTalk client in TeamTalk 5 SDK Professional Edition. More... | |
Functions | |
static string | BearWare.TeamTalkBase.GetVersion () |
Get the DLL's version number. | |
BearWare.TeamTalkBase.TeamTalkBase (bool poll_based) | |
Create a new TeamTalk client instance. | |
void | BearWare.TeamTalkBase.Dispose () |
bool | BearWare.TeamTalkBase.GetMessage (ref TTMessage pMsg, int nWaitMs) |
Poll for events in the client instance. | |
bool | BearWare.TeamTalkBase.PumpMessage (ClientEvent nClientEvent, int nIdentifier) |
Cause client instance event thread to schedule an update event. | |
BearWare.ClientFlag | BearWare.TeamTalkBase.GetFlags () |
Get a bitmask describing the client's current state. | |
static bool | BearWare.TeamTalkBase.SetLicenseInformation (string szRegName, string szRegKey) |
Set license information to disable trial mode. | |
void | BearWare.TeamTalkBase.ProcessMsg (TTMessage msg) |
Event handler for BearWare.TTMessage. | |
Variables | |
const int | BearWare.TeamTalkBase.TT_STRLEN = 512 |
The maximum length of all strings used in TeamTalkBase. This value includes the zero terminator, so 511 characters. Note that Unicode characters are converted to UTF-8 internally and limited once again to 512 if the string gets longer. | |
const int | BearWare.TeamTalkBase.TT_USERID_MAX = 0xFFF |
The highest user ID. | |
const int | BearWare.TeamTalkBase.TT_CHANNELID_MAX = 0xFFF |
The highest channel ID. Also used for BearWare.TeamTalkBase.TT_CLASSROOM_FREEFORALL. | |
const int | BearWare.TeamTalkBase.TT_LOCAL_USERID = 0 |
User ID passed to TeamTalkBase.EnableAudioBlockEvent() in order to receive BearWare.AudioBlock directly from sound input device after joining a channel. | |
const int | BearWare.TeamTalkBase.TT_LOCAL_TX_USERID = 0x1002 |
User ID passed to TeamTalkBase.EnableAudioBlockEvent() in order to receive BearWare.AudioBlock when voice transmission is activated. | |
const int | BearWare.TeamTalkBase.TT_MUXED_USERID = 0x1001 |
User ID used to identify muxed audio that has been mixed into a single stream. | |
Properties | |
ClientFlag | BearWare.TeamTalkBase.Flags [get] |
Same as GetFlags(). | |
This section explains how to instantiate a new client instance and query its current state.
To instantiate a client in TeamTalk 5 SDK Standard Edition call the constructor TeamTalk5.TeamTalk5() and in TeamTalk 5 Professional Edition call TeamTalk5Pro.TeamTalk5Pro(). In both cases the constructor has the parameter poll_events which should be 'false' for Windows Forms applications and 'true' for console applications. The poll_events parameter tells how the client instance should post its events. Since a Windows Forms application has its own message-loop it does not need to "poll" for events. This is, however, needed by console applications which should call TeamTalkBase.GetMessage() to get events.
When a new client instance is created a user application can call to TeamTalkBase.GetFlags() to query the client instance's current state. Initially the client instance's state will be ClientFlag ClientFlag.CLIENT_CLOSED. This means that no operation has been performed on the client.
enum BearWare.ClientFlag : uint |
Flags used to describe the the client instance current state.
The client's state is a bitmask of the flags in BearWare.ClientFlag.
The state of the client instance can be retrieved by calling TeamTalkBase.GetFlags() This enables the user application to display the possible options to the end user. If e.g. the flag BearWare.ClientFlag.CLIENT_AUTHORIZED is not set it will not be possible to perform any other commands except TeamTalkBase.DoLogin(). Doing so will make the server return an error message to the client.
Enumerator | |
---|---|
CLIENT_CLOSED | The client instance is in closed state, i.e. no operations has been performed on it. |
CLIENT_SNDINPUT_READY | If set the client instance's sound input device has been initialized, i.e. TeamTalkBase.InitSoundInputDevice() has been called successfully. |
CLIENT_SNDOUTPUT_READY | If set the client instance's sound output device has been initialized, i.e. TeamTalkBase.InitSoundOutputDevice() has been called successfully. |
CLIENT_SNDINOUTPUT_DUPLEX | If set the client instance is running in sound duplex mode where multiple audio output streams are mixed into a single stream. This option must be enabled to support echo cancellation (see BearWare.SpeexDSP). Call TeamTalkBase.InitSoundDuplexDevices() to enable duplex mode. |
CLIENT_SNDINPUT_VOICEACTIVATED | If set the client instance will start transmitting audio if the sound level is above the voice activation level. The event BearWare.ClientEvent.CLIENTEVENT_VOICE_ACTIVATION is posted when voice activation initiates transmission. |
CLIENT_SNDINPUT_VOICEACTIVE | If set GetSoundInputLevel() is higher than the voice activation level. To enable voice transmission if voice level is higher than actication level also enable BearWare.ClientFlag.CLIENT_SNDINPUT_VOICEACTIVATED. |
CLIENT_SNDOUTPUT_MUTE | If set the client instance has muted all users. |
CLIENT_SNDOUTPUT_AUTO3DPOSITION | If set the client instance will auto position users in a 180 degree circle using 3D-sound. This option is only available with BearWare.SoundSystem.SOUNDSYSTEM_DSOUND. |
CLIENT_VIDEOCAPTURE_READY | If set the client instance's video device has been initialized, i.e. TeamTalkBase.InitVideoCaptureDevice() has been called successfuly. |
CLIENT_TX_VOICE | If set the client instance is currently transmitting audio. |
CLIENT_TX_VIDEOCAPTURE | If set the client instance is currently transmitting video. |
CLIENT_TX_DESKTOP | If set the client instance is currently transmitting a desktop window. A desktop window update is issued by calling TeamTalkBase.SendDesktopWindow(). The event BearWare.ClientEvent.CLIENTEVENT_DESKTOPWINDOW_TRANSFER is triggered when a desktop window transmission completes. |
CLIENT_DESKTOP_ACTIVE | If set the client instance current have an active desktop session, i.e. TeamTalkBase.SendDesktopWindow() has been called. Call TeamTalkBase.CloseDesktopWindow() to close the desktop session. |
CLIENT_MUX_AUDIOFILE | If set the client instance is currently muxing audio streams into a single file. This is enabled by calling TeamTalkBase.StartRecordingMuxedAudioFile(). |
CLIENT_CONNECTING | If set the client instance is currently try to connect to a server, i.e. TeamTalkBase.Connect() has been called. |
CLIENT_CONNECTED | If set the client instance is connected to a server, i.e. BearWare.ClientEvent.CLIENTEVENT_CON_SUCCESS event has been issued after doing a TeamTalkBase.Connect(). Valid commands in this state: TeamTalkBase.DoLogin() |
CLIENT_CONNECTION | Helper for BearWare.ClientFlag.CLIENT_CONNECTING and BearWare.ClientFlag.CLIENT_CONNECTED to see if TeamTalkBase.Disconnect() should be called. |
CLIENT_AUTHORIZED | If set the client instance is logged on to a server, i.e. got BearWare.ClientEvent.CLIENTEVENT_CMD_MYSELF_LOGGEDIN event after issueing TeamTalkBase.DoLogin(). |
CLIENT_STREAM_AUDIO | If set the client is currently streaming the audio of a media file. When streaming a video file the BearWare.ClientFlag.CLIENT_STREAM_VIDEO flag is also typically set. |
CLIENT_STREAM_VIDEO | If set the client is currently streaming the video of a media file. When streaming a video file the BearWare.ClientFlag.CLIENT_STREAM_AUDIO flag is also typically set. |
Definition at line 4101 of file TeamTalk.cs.
|
static |
Get the DLL's version number.
Definition at line 4328 of file TeamTalk.cs.
|
protected |
Create a new TeamTalk client instance.
poll_based | If the application using this class is a Windows Forms application poll_based should be 'false' since events will be posted using the Windows message loop. In Console applications on the other hand, the user application will have to 'poll' for events using GetMessage(). Remember to put the [STAThread] macro on the Main method if building a console application. |
Definition at line 4340 of file TeamTalk.cs.
void BearWare.TeamTalkBase.Dispose | ( | ) |
Definition at line 4423 of file TeamTalk.cs.
bool BearWare.TeamTalkBase.GetMessage | ( | ref TTMessage | pMsg, |
int | nWaitMs | ||
) |
Poll for events in the client instance.
In a Windows Forms application events can be processed using the application message-loop, but in Console application the application must process the events itself. The most common way to do this is to start a timer which calls TeamTalkBase.GetMessage() every now and then to ensure the UI is updated with the latest events.
pMsg | Reference to a TTMessage instance which will hold the event that has occured. |
nWaitMs | The amount of time to wait for the event. If -1 the function will block forever or until the next event occurs. |
Definition at line 4456 of file TeamTalk.cs.
bool BearWare.TeamTalkBase.PumpMessage | ( | ClientEvent | nClientEvent, |
int | nIdentifier | ||
) |
Cause client instance event thread to schedule an update event.
Normally all events are due to a state change in the client instance. The state change (BearWare.ClientEvent) is submitted by the client instance's internal thread. In some cases it's, however, convenient to make the internal thread submit the latest properties of an object. One example is after having changed the volume of a BearWare.User. Then your local copy of BearWare.User will no longer contain the latest nVolumeVoice
.
Calling PumpMessage() will make the client instance's internal thread queue an update of BearWare.User so the latest properties of the user can be retrieved from GetMessage().
It's also possible to simply use GetUser() but the problem with this approach is that this call is from a separate thread and therefore doesn't take the event queue into account.
nClientEvent | The event which should be queued. Currently only BearWare.ClientEvent.CLIENTEVENT_USER_STATECHANGE is supported. |
nIdentifier | The ID of the object to retrieve. Currently only nUserID is supported. |
Definition at line 4487 of file TeamTalk.cs.
BearWare.ClientFlag BearWare.TeamTalkBase.GetFlags | ( | ) |
Get a bitmask describing the client's current state.
Checks whether the client is connecting, connected, authorized, etc. The current state can be checked by and'ing the returned bitmask which is based on BearWare.ClientFlag.
Definition at line 4501 of file TeamTalk.cs.
|
static |
Set license information to disable trial mode.
This function must be called before instantiating either the BearWare.TeamTalk5 or BearWare.TeamTalk5Pro-class.
szRegName | The registration name provided by BearWare.dk. |
szRegKey | The registration key provided by BearWare.dk. |
Definition at line 4523 of file TeamTalk.cs.
void BearWare.TeamTalkBase.ProcessMsg | ( | TTMessage | msg | ) |
Event handler for BearWare.TTMessage.
msg | The BearWare.TTMessage retrieved by TeamTalkBase.GetMessage() |
Definition at line 4532 of file TeamTalk.cs.
|
static |
The maximum length of all strings used in TeamTalkBase. This value includes the zero terminator, so 511 characters. Note that Unicode characters are converted to UTF-8 internally and limited once again to 512 if the string gets longer.
Definition at line 4212 of file TeamTalk.cs.
|
static |
The highest user ID.
Definition at line 4215 of file TeamTalk.cs.
|
static |
The highest channel ID. Also used for BearWare.TeamTalkBase.TT_CLASSROOM_FREEFORALL.
Definition at line 4219 of file TeamTalk.cs.
|
static |
User ID passed to TeamTalkBase.EnableAudioBlockEvent() in order to receive BearWare.AudioBlock directly from sound input device after joining a channel.
When this user ID is passed then the BearWare.AudioBlock received will be prior to audio preprocessing (BearWare.AudioPreprocessor).
Note, however, that BearWare.ClientEvent.CLIENTEVENT_USER_AUDIOBLOCK will not be triggered until the TeamTalk instance is in a channel. This is because the sound input device is not started until it knows the BearWare.AudioCodec's sample rate, number of channels and transmit interval.
Definition at line 4275 of file TeamTalk.cs.
|
static |
User ID passed to TeamTalkBase.EnableAudioBlockEvent() in order to receive BearWare.AudioBlock when voice transmission is activated.
Either through TeamTalkBase.EnableVoiceActivation() or TeamTalkBase.EnableVoiceTransmission().
Definition at line 4284 of file TeamTalk.cs.
|
static |
User ID used to identify muxed audio that has been mixed into a single stream.
This user ID is passed to TeamTalkBase.EnableAudioBlockEvent() in order to receive BearWare.AudioBlock of audio that is played in the TeamTalk instance.
Definition at line 4293 of file TeamTalk.cs.
|
get |
Same as GetFlags().
Definition at line 4509 of file TeamTalk.cs.