TeamTalk 5 .NET DLL  Version 5.14A
Client Initialization

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...
 

Enumerations

enum class  BearWare.ClientFlag : uint {
  BearWare.CLIENT_CLOSED = 0x00000000 , BearWare.CLIENT_SNDINPUT_READY = 0x00000001 , BearWare.CLIENT_SNDOUTPUT_READY = 0x00000002 , BearWare.CLIENT_SNDINOUTPUT_DUPLEX = 0x00000004 ,
  BearWare.CLIENT_SNDINPUT_VOICEACTIVATED = 0x00000008 , BearWare.CLIENT_SNDINPUT_VOICEACTIVE = 0x00000010 , BearWare.CLIENT_SNDOUTPUT_MUTE = 0x00000020 , BearWare.CLIENT_SNDOUTPUT_AUTO3DPOSITION = 0x00000040 ,
  BearWare.CLIENT_VIDEOCAPTURE_READY = 0x00000080 , BearWare.CLIENT_TX_VOICE = 0x00000100 , BearWare.CLIENT_TX_VIDEOCAPTURE = 0x00000200 , BearWare.CLIENT_TX_DESKTOP = 0x00000400 ,
  BearWare.CLIENT_DESKTOP_ACTIVE = 0x00000800 , BearWare.CLIENT_MUX_AUDIOFILE = 0x00001000 , BearWare.CLIENT_CONNECTING = 0x00002000 , BearWare.CLIENT_CONNECTED = 0x00004000 ,
  BearWare.CLIENT_CONNECTION = CLIENT_CONNECTING | CLIENT_CONNECTED , BearWare.CLIENT_AUTHORIZED = 0x00008000 , BearWare.CLIENT_STREAM_AUDIO = 0x00010000 , BearWare.CLIENT_STREAM_VIDEO = 0x00020000
}
 Flags used to describe the the client instance current state. More...
 

Functions

static string BearWare.TeamTalkBase.GetVersion ()
 Get the DLL's version number. More...
 
 BearWare.TeamTalkBase.TeamTalkBase (bool poll_based)
 Create a new TeamTalk client instance. More...
 
void BearWare.TeamTalkBase.Dispose ()
 
bool BearWare.TeamTalkBase.GetMessage (ref TTMessage pMsg, int nWaitMs)
 Poll for events in the client instance. More...
 
bool BearWare.TeamTalkBase.PumpMessage (ClientEvent nClientEvent, int nIdentifier)
 Cause client instance event thread to schedule an update event. More...
 
BearWare.ClientFlag BearWare.TeamTalkBase.GetFlags ()
 Get a bitmask describing the client's current state. More...
 
static bool BearWare.TeamTalkBase.SetLicenseInformation (string szRegName, string szRegKey)
 Set license information to disable trial mode. More...
 
void BearWare.TeamTalkBase.ProcessMsg (TTMessage msg)
 Event handler for BearWare.TTMessage. More...
 

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. More...
 
const int BearWare.TeamTalkBase.TT_USERID_MAX = 0xFFF
 The highest user ID. More...
 
const int BearWare.TeamTalkBase.TT_CHANNELID_MAX = 0xFFF
 The highest channel ID. Also used for TT_CLASSROOM_FREEFORALL. More...
 
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. More...
 
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. More...
 
const int BearWare.TeamTalkBase.TT_MUXED_USERID = 0x1001
 User ID used to identify muxed audio that has been mixed into a single stream. More...
 

Properties

ClientFlag BearWare.TeamTalkBase.Flags [get]
 Same as GetFlags(). More...
 

Detailed Description

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.

Enumeration Type Documentation

◆ ClientFlag

enum BearWare.ClientFlag : uint
strong

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 TeamTalkBase.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 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 ClientEvent.CLIENTEVENT_VOICE_ACTIVATION is posted when voice activation initiates transmission.

See also
TeamTalkBase.SetVoiceActivationLevel()
TeamTalkBase.EnableVoiceActivation()
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 ClientFlag.CLIENT_SNDINPUT_VOICEACTIVATED.

See also
TeamTalkBase.SetVoiceActivationLevel()
TeamTalkBase.EnableVoiceActivation()
CLIENT_SNDOUTPUT_MUTE 

If set the client instance has muted all users.

See also
TeamTalkBase.SetSoundOutputMute()
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.

See also
TeamTalkBase.SetUserPosition()
TeamTalkBase.Enable3DSoundPositioning()
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.

See also
TeamTalkBase.EnableVoiceTransmission()
CLIENT_TX_VIDEOCAPTURE 

If set the client instance is currently transmitting video.

See also
TeamTalkBase.StartVideoCaptureTransmission()
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 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. ClientEvent.CLIENTEVENT_CON_SUCCESS event has been issued after doing a TeamTalkBase.Connect(). Valid commands in this state: TeamTalkBase.DoLogin()

CLIENT_CONNECTION 

Helper for ClientFlag.CLIENT_CONNECTING and 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 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 ClientFlag.CLIENT_STREAM_VIDEO flag is also typically set.

See also
TeamTalkBase.StartStreamingMediaFileToChannel()
CLIENT_STREAM_VIDEO 

If set the client is currently streaming the video of a media file. When streaming a video file the ClientFlag.CLIENT_STREAM_AUDIO flag is also typically set.

See also
TeamTalkBase.StartStreamingMediaFileToChannel()

Definition at line 4077 of file TeamTalk.cs.

Function Documentation

◆ GetVersion()

static string BearWare.TeamTalkBase.GetVersion ( )
static

Get the DLL's version number.

Definition at line 4304 of file TeamTalk.cs.

◆ TeamTalkBase()

BearWare.TeamTalkBase.TeamTalkBase ( bool  poll_based)
protected

Create a new TeamTalk client instance.

Parameters
poll_basedIf 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 4316 of file TeamTalk.cs.

◆ Dispose()

void BearWare.TeamTalkBase.Dispose ( )

Definition at line 4399 of file TeamTalk.cs.

◆ GetMessage()

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.

Parameters
pMsgReference to a TTMessage instance which will hold the event that has occured.
nWaitMsThe amount of time to wait for the event. If -1 the function will block forever or until the next event occurs.
Returns
Returns TRUE if an event has occured otherwise FALSE.
See also
TeamTalk()
ClientEvent

Definition at line 4432 of file TeamTalk.cs.

◆ PumpMessage()

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 (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.

Parameters
nClientEventThe event which should be queued. Currently only ClientEvent.CLIENTEVENT_USER_STATECHANGE is supported.
nIdentifierThe ID of the object to retrieve. Currently only nUserID is supported.
Returns
Returns true if the event has been scheduled.

Definition at line 4463 of file TeamTalk.cs.

◆ GetFlags()

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 ClientFlag.

Returns
A bitmask describing the current state.

Definition at line 4477 of file TeamTalk.cs.

◆ SetLicenseInformation()

static bool BearWare.TeamTalkBase.SetLicenseInformation ( string  szRegName,
string  szRegKey 
)
static

Set license information to disable trial mode.

This function must be called before instantiating either the BearWare.TeamTalk5 or BearWare.TeamTalk5Pro-class.

Parameters
szRegNameThe registration name provided by BearWare.dk.
szRegKeyThe registration key provided by BearWare.dk.
Returns
True if the provided registration is acceptable.

Definition at line 4499 of file TeamTalk.cs.

◆ ProcessMsg()

void BearWare.TeamTalkBase.ProcessMsg ( TTMessage  msg)

Event handler for BearWare.TTMessage.

Parameters
msgThe BearWare.TTMessage retrieved by TeamTalkBase.GetMessage()

Definition at line 4508 of file TeamTalk.cs.

Variable Documentation

◆ TT_STRLEN

const int BearWare.TeamTalkBase.TT_STRLEN = 512
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 4188 of file TeamTalk.cs.

◆ TT_USERID_MAX

const int BearWare.TeamTalkBase.TT_USERID_MAX = 0xFFF
static

The highest user ID.

Definition at line 4191 of file TeamTalk.cs.

◆ TT_CHANNELID_MAX

const int BearWare.TeamTalkBase.TT_CHANNELID_MAX = 0xFFF
static

The highest channel ID. Also used for TT_CLASSROOM_FREEFORALL.

Definition at line 4195 of file TeamTalk.cs.

◆ TT_LOCAL_USERID

const int BearWare.TeamTalkBase.TT_LOCAL_USERID = 0
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 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 4251 of file TeamTalk.cs.

◆ TT_LOCAL_TX_USERID

const int BearWare.TeamTalkBase.TT_LOCAL_TX_USERID = 0x1002
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 4260 of file TeamTalk.cs.

◆ TT_MUXED_USERID

const int BearWare.TeamTalkBase.TT_MUXED_USERID = 0x1001
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 4269 of file TeamTalk.cs.

Properties

◆ Flags

ClientFlag BearWare.TeamTalkBase.Flags
get

Same as GetFlags().

Definition at line 4485 of file TeamTalk.cs.