TeamTalk 4 .NET DLL
Version 4.5A
|
The first thing a user application must to is instantiate the TeamTalk4 class. More...
Classes | |
class | BearWare.TeamTalk4 |
The class which encapsulates the TeamTalk 4 client. More... | |
Functions | |
BearWare.TeamTalk4.TeamTalk4 (bool poll_based) | |
Create a new TeamTalk client instance. More... | |
BearWare.TeamTalk4.~TeamTalk4 () | |
Close the TeamTalk client instance and release its resources. More... | |
void | BearWare.TeamTalk4.Dispose () |
void | BearWare.TeamTalk4.DeleteMe () |
bool | BearWare.TeamTalk4.GetMessage (int nWaitMs) |
Poll for events in the client instance. More... | |
BearWare.ClientFlag | BearWare.TeamTalk4.GetFlags () |
Get a bitmask describing the client's current state. More... | |
static bool | BearWare.TeamTalk4.SetLicenseInformation (string szRegName, long nRegKey) |
Set license information to disable trial mode. More... | |
void | BearWare.TeamTalk4.processMsg (ref TTMessage msg) |
Variables | |
const int | BearWare.TeamTalk4.TT_STRLEN = 512 |
The maximum length of all strings used in TeamTalk. 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. More... | |
const int | BearWare.TeamTalk4.DEFAULT_TCPPORT = 10333 |
const int | BearWare.TeamTalk4.DEFAULT_UDPPORT = 10333 |
const int | BearWare.TeamTalk4.DEFAULT_AGC_GAINLEVEL = 8000 |
const int | BearWare.TeamTalk4.DEFAULT_AGC_INC_MAXDB = 12 |
const int | BearWare.TeamTalk4.DEFAULT_AGC_DEC_MAXDB = -40 |
const int | BearWare.TeamTalk4.DEFAULT_AGC_GAINMAXDB = 30 |
const int | BearWare.TeamTalk4.DEFAULT_DENOISE_SUPPRESS = -30 |
Properties | |
ClientFlag | BearWare.TeamTalk4.Flags [get] |
Same as GetFlags(). More... | |
The first thing a user application must to is instantiate the TeamTalk4 class.
The TeamTalk4.TeamTalk4() 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 TeamTalk4.GetMessage() to get events.
When a new client instance is created a call to TeamTalk4.GetFlags() will show that the client initially is in state ClientFlag CLIENT_CLOSED. This means that no operation has been performed on the client.
Querying TeamTalk4.GetFlags() call can be used by a user application as a state-machine to show which actions are currently possible for the user application. The ClientFlag enumeration shows the information which can be retrived though TeamTalk4.GetFlags().
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 ClientFlag.
The state of the client instance can be retrieved by calling TeamTalk4.GetFlags() This enables the user application to display the possible options to the end user. If e.g. the flag ClientFlag CLIENT_AUTHORIZED is not set it will not be possible to perform any other commands except TeamTalk4.DoLogin(). Doing so will make the server return an error message to the client.
Enumerator | |
---|---|
CLIENT_CLOSED |
If no bits are set the client instance is in closed state, in other words no operations has been performed on it. |
CLIENT_SNDINPUT_READY |
If set the client instance's sound input device has been initialized, i.e. TeamTalk4.InitSoundInputDevice() has been called successfully. |
CLIENT_SNDOUTPUT_READY |
If set the client instance's sound output device has been initialized, i.e. TeamTalk4.InitSoundOutputDevice() has been called successfully. |
CLIENT_VIDEO_READY |
If set the client instance's video device has been initialized, i.e. TeamTalk4.InitVideoCaptureDevice() has been called successfuly. |
CLIENT_DESKTOP_ACTIVE |
If set the client instance current have an active desktop session, i.e. TeamTalk4.SendDesktopWindow() has been called. Call TeamTalk4.CloseDesktopWindow() to close the desktop session. |
CLIENT_SNDINPUT_VOICEACTIVATED |
If set the client instance will start transmitting audio if the sound level is above the voice activation level. The event TeamTalk4.OnVoiceActivation() is posted when voice activation initiates transmission. |
CLIENT_SNDINPUT_DENOISING |
If set the client instance will try to remove noise from recorded audio.
|
CLIENT_SNDINPUT_AGC |
If set the client instance is using automatic gain control.
|
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 SoundSystem SOUNDSYSTEM_DSOUND. |
CLIENT_SNDINPUT_AEC |
If set the client instance will try to eliminate echo from speakers. To enable echo cancellation first make the client run on sound duplex mode by calling TeamTalk4.InitSoundDuplexDevices() and afterwards call TeamTalk4.EnableEchoCancellation(). |
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 (ClientFlag CLIENT_SNDINPUT_AEC). Call TeamTalk4.InitSoundDuplexDevices() to enable duplex mode. |
CLIENT_TX_AUDIO |
If set the client instance is currently transmitting audio.
|
CLIENT_TX_VIDEO |
If set the client instance is currently transmitting video.
|
CLIENT_MUX_AUDIOFILE |
If set the client instance is currently muxing audio streams into a single file. This is enabled by calling TeamTalk4.StartRecordingMuxedAudioFile(). |
CLIENT_TX_DESKTOP |
If set the client instance is currently transmitting a desktop window. A desktop window update is issued by calling TeamTalk4.SendDesktopWindow(). The event OnDesktopTransferUpdate() is triggered when a desktop window transmission completes. |
CLIENT_CONNECTING |
If set the client instance is currently try to connect to a server, i.e. TeamTalk4.Connect() has been called. |
CLIENT_CONNECTED |
If set the client instance is connected to a server, i.e. TeamTalk4.OnConnectSuccess() event has been issued after doing a TeamTalk4.Connect(). Valid commands in this state: TeamTalk4.DoLogin() |
CLIENT_CONNECTION |
Helper for ClientFlag CLIENT_CONNECTING and ClientFlag CLIENT_CONNECTED to see if TeamTalk4.Disconnect() should be called. |
CLIENT_AUTHORIZED |
If set the client instance is logged on to a server, i.e. got TeamTalk4.OnCmdMyselfLoggedIn() event after issueing TeamTalk4.DoLogin(). |
CLIENT_P2P_AUDIO |
If set the client instance will try and connect to other users using peer to peer connections. Audio will be broadcast to users instead of forwarded through server (thereby increasing the bandwith usage). Note that if UserRight USERRIGHT_FORWARD_AUDIO is disabled and no peer to peer connection could be established, i.e. event TeamTalk4.OnConnectionP2P() was posted with failure, then data cannot be transferred to a user. |
CLIENT_P2P_VIDEO |
If set the client instance will try and connect to other users using peer to peer connections. Video will be broadcast to users instead of forwarded through server (thereby increasing the bandwith usage). Note that if UserRight USERRIGHT_FORWARD_VIDEO is disabled and no peer to peer connection could be established, i.e. event TeamTalk4.OnConnectionP2P() was posted with failure, then data cannot be transferred to a user. |
CLIENT_P2P |
Helper for ClientFlag CLIENT_P2P_AUDIO and ClientFlag CLIENT_P2P_VIDEO to see if the client instance is currently attempting P2P connections. |
CLIENT_STREAM_AUDIO |
If set the client is currently streaming the audio of a media file. When streaming a video file the 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 CLIENT_STREAM_AUDIO flag is also typically set. |
BearWare.TeamTalk4.TeamTalk4 | ( | bool | poll_based | ) |
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. |
|
private |
Close the TeamTalk client instance and release its resources.
void BearWare.TeamTalk4.Dispose | ( | ) |
|
private |
bool BearWare.TeamTalk4.GetMessage | ( | 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 GetMessage every now and then to ensure the UI is updated with the latest events.
nWaitMs | The amount of time to wait for the event. If -1 the function will block forever or until the next event occurs. |
BearWare.ClientFlag BearWare.TeamTalk4.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 ClientFlag.
|
static |
Set license information to disable trial mode.
This function must be called before instantiating the TeamTalk4-class.
szRegName | The registration name provided by BearWare.dk. |
nRegKey | The registration key provided by BearWare.dk. |
void BearWare.TeamTalk4.processMsg | ( | ref TTMessage | msg | ) |
const int BearWare.TeamTalk4.TT_STRLEN = 512 |
The maximum length of all strings used in TeamTalk. 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.TeamTalk4.DEFAULT_TCPPORT = 10333 |
const int BearWare.TeamTalk4.DEFAULT_UDPPORT = 10333 |
const int BearWare.TeamTalk4.DEFAULT_AGC_GAINLEVEL = 8000 |
const int BearWare.TeamTalk4.DEFAULT_AGC_INC_MAXDB = 12 |
const int BearWare.TeamTalk4.DEFAULT_AGC_DEC_MAXDB = -40 |
const int BearWare.TeamTalk4.DEFAULT_AGC_GAINMAXDB = 30 |
const int BearWare.TeamTalk4.DEFAULT_DENOISE_SUPPRESS = -30 |
|
get |
Same as GetFlags().