Closing devices

To close the capture device on a given connection use

unsigned int ts3client_closeCaptureDevice(uint64 serverConnectionHandlerID)

Immediately close the current capture device on a connection handler.

This will instantly shut down the device.

Parameters:
  • serverConnectionHandlerID – the connection handler on which to shut down the capture device

Returns:

An Error code from the Ts3ErrorType enum indicating either success or the failure reason

To close the playback device on a given connection use

unsigned int ts3client_closePlaybackDevice(uint64 serverConnectionHandlerID)

Immediately close the current playback device on a connection handler.

This will instantly shut down the device. Any sounds currently playing will be interrupted.

Parameters:
  • serverConnectionHandlerID – the connection handler on which to shut down the playback device

Returns:

An Error code from the Ts3ErrorType enum indicating either success or the failure reason

Note

Closing the playback device this way will not wait for sounds that are currently playing to finish, but rather close the device instantly.

To close the playback device on a given connection after all sounds that are currently playing through it have finished use

unsigned int ts3client_initiateGracefulPlaybackShutdown(uint64 serverConnectionHandlerID)

Close the playback device after all currently playing sounds are done playing.

A more user friendly way of closing a playback device. The client lib will monitor and ensure that any sounds that have already started playing have completely played before closing the device. New sounds are not allowed to be played after calling this function. This function will return right away, regardless of whether the device has been closed already or not.

Parameters:
  • serverConnectionHandlerID – the connection handler on which to shut down the playback device

Returns:

An Error code from the Ts3ErrorType enum indicating either success or the failure reason

Caution

This function will return before the device is actually closed!

While ts3client_initiateGracefulPlaybackShutdown() will not block until all sounds have finished playing, it will notify the client when the playback device has been closed by calling the following callback

struct ClientUIFunctions

Defines available callbacks that you can receive.

Set the members of this struct to a function to call when the specific event happens.

Public Members

void (*onPlaybackShutdownCompleteEvent)(uint64 serverConnectionHandlerID)

called once the playback device was closed on a connection

Param serverConnectionHandlerID:

specifies on which connection the callback was called

Note

Devices are closed automatically upon destroying the connection handler by calling ts3client_destroyServerConnectionHandler()