ToiAudioOutputService Interface Reference


Description

Service:
This is a service and can be accessed through toi.audioOutputService

ToiAudioOutputService is used for controlling audio outputs. It allows the client to control how to decode and mix audio content and route the modified/unmodified content to the outputs.

import "ToiAudioOutputService.idl";

List of all members.

Public Member Functions

TToiAudioConnectionDescriptorSequence getConnections ()
ToiAudioOutputConfiguration getConfiguration ()
ToiAudioOutputConfigurationSession createConfigurationSession () raises (TToiInvalidArgumentException, TToiInvalidPreconditionException)
void setVolume (in TToiAudioConnectionId connectionId, in unsigned long level) raises (TToiInvalidArgumentException, TToiOperationNotSupportedException)
unsigned long getVolume (in TToiAudioConnectionId connectionId) raises (TToiInvalidArgumentException, TToiOperationNotSupportedException)
void setMuteState (in TToiAudioConnectionId connectionId, in boolean state) raises (TToiInvalidArgumentException, TToiOperationNotSupportedException)
boolean getMuteState (in TToiAudioConnectionId connectionId) raises (TToiInvalidArgumentException, TToiOperationNotSupportedException)
void setLatency (in TToiAudioConnectionId connectionId, in long latency) raises (TToiInvalidArgumentException, TToiOperationNotSupportedException)
long getLatency (in TToiAudioConnectionId connectionId) raises (TToiInvalidArgumentException, TToiOperationNotSupportedException)
void addEventListener (in long type, in ToiEventListener listener) raises (TToiInvalidArgumentException)
void removeEventListener (in long type, in ToiEventListener listener) raises (TToiInvalidArgumentException)

Public Attributes

Events

const long ON_CONFIGURATION_CHANGED = 3100
const long ON_VOLUME_CHANGED = 3101
const long ON_MUTE_STATE_CHANGED = 3102
const long ON_HDMI_CONNECTION_STATUS_CHANGED = 3103
const long ON_LATENCY_CHANGED = 3104
TToiAudioConnectionType

const TToiAudioConnectionType AUDIO_CONNECTION_TYPE_ANALOG = 0
const TToiAudioConnectionType AUDIO_CONNECTION_TYPE_SPDIF = 1
const TToiAudioConnectionType AUDIO_CONNECTION_TYPE_HDMI = 2
const TToiAudioConnectionType AUDIO_CONNECTION_TYPE_DECODER = 3
const TToiAudioConnectionType AUDIO_CONNECTION_TYPE_BUFFER = 4
const TToiAudioConnectionType AUDIO_CONNECTION_TYPE_I2S = 5
TToiAudioConnectionDirection

const TToiAudioConnectionDirection AUDIO_CONNECTION_DIRECTION_INPUT = 0
const TToiAudioConnectionDirection AUDIO_CONNECTION_DIRECTION_OUTPUT = 1

Public Types

typedef long TToiAudioConnectionId
typedef long TToiAudioConnectionType
typedef long TToiAudioConnectionDirection
typedef sequence
< ToiAudioOutputServiceAudioConnectionDescriptor
TToiAudioConnectionDescriptorSequence

Member Typedef Documentation

Input or output connection direction.

Audio connection identifier type.

Audio connection types.


Member Function Documentation

void ToiEventTarget::addEventListener ( in long  type,
in ToiEventListener  listener 
) raises (TToiInvalidArgumentException) [inherited]

This method registers an event listener for a specific event. Multiple listeners can be added for the same event. Events are broadcast to all registered listeners.

Parameters:
type The event type of the event to subscribe to.
listener The JavaScript function that will receive events.
Exceptions:
TInvalidArgumentException Raised if the event type is not supported by this object or if the listener is not a valid JavaScript function. This exception is also raised if the application calls addEventListener with the same combination of type and listener twice.
ToiAudioOutputConfigurationSession ToiAudioOutputService::createConfigurationSession (  )  raises (TToiInvalidArgumentException, TToiInvalidPreconditionException)

Creates and returns a session to change the audio output configuration. The session is active between this call and either ToiAudioOutputConfigurationSession::apply() or ToiAudioOutputConfigurationSession::revert().

Return values:
IToiAudioOutputConfigurationSession 
Exceptions:
TToiInvalidArgumentException Raised if the application identifier is invalid.
TToiInvalidPreconditionException Raised if another session is active.
ToiAudioOutputConfiguration ToiAudioOutputService::getConfiguration (  ) 

Returns the audio output configuration.

Return values:
IToiAudioOutputConfiguration 
TToiAudioConnectionDescriptorSequence ToiAudioOutputService::getConnections (  ) 

Returns available audio connections.

Return values:
connectionList The list available audio connections.
long ToiAudioOutputService::getLatency ( in TToiAudioConnectionId  connectionId  )  raises (TToiInvalidArgumentException, TToiOperationNotSupportedException)
Technical Preview:
This method is a TECHNICAL PREVIEW, it may change. Returns the audio latency of a connection.
Parameters:
connectionId The identifier of the connection to query.
Return values:
latency The audio latency in milliseconds.
Exceptions:
TToiInvalidArgumentException Raised if there is no such connection.
TToiOperationNotSupportedException Raised if the latency for the connection is not adjustable.
boolean ToiAudioOutputService::getMuteState ( in TToiAudioConnectionId  connectionId  )  raises (TToiInvalidArgumentException, TToiOperationNotSupportedException)

Returns the mutes state of a connection.

Parameters:
connectionId The identifier of the connection to query.
Return values:
state The mute state.
Exceptions:
TToiInvalidArgumentException Raised if there is no such connection.
TToiOperationNotSupportedException Raised if the connection is not mutable.
unsigned long ToiAudioOutputService::getVolume ( in TToiAudioConnectionId  connectionId  )  raises (TToiInvalidArgumentException, TToiOperationNotSupportedException)

Returns the audio volume level of a connection. Possible level range from 0 and 100 where 0 is the lowest volume and 100 the highest volume.

Parameters:
connectionId The identifier of the connection to query.
Return values:
level The volume level.
Exceptions:
TToiInvalidArgumentException Raised if there is no such connection.
TToiOperationNotSupportedException Raised if the volume for the connection is not adjustable.
void ToiEventTarget::removeEventListener ( in long  type,
in ToiEventListener  listener 
) raises (TToiInvalidArgumentException) [inherited]

This method removes an event listener for a specific event.

Parameters:
type The event type of the event to remove the listener from.
listener The JavaScript function that was previously added as an event listener.
Exceptions:
TInvalidArgumentException Raised if the event type is not supported by this object or if the listener is not a valid JavaScript function. This exception is also raised if the listener had not previously been added.
void ToiAudioOutputService::setLatency ( in TToiAudioConnectionId  connectionId,
in long  latency 
) raises (TToiInvalidArgumentException, TToiOperationNotSupportedException)
Technical Preview:
This method is a TECHNICAL PREVIEW, it may change. Set an audio connection audio latency. latency is in milliseconds. This should affect all audio formats. If the latency parameter is out of range, the closest supported value is set. Setting the latency for one connection may impact the latency for other connections. In this case, the ToiAudioOutputLatencyChangedEvent will be called for all the impacted connections.
Parameters:
connectionId The identifier of the connection for which the audio latency will be changed.
latency The desired audio latency in milliseconds.
Exceptions:
TToiInvalidArgumentException Raised if there is no such connection.
TToiOperationNotSupportedException Raised if the latency for the connection is not adjustable.
void ToiAudioOutputService::setMuteState ( in TToiAudioConnectionId  connectionId,
in boolean  state 
) raises (TToiInvalidArgumentException, TToiOperationNotSupportedException)

Sets the mute state of a connection.

Parameters:
connectionId The identifier of the connection to query.
state The desired mute state.
Exceptions:
TToiInvalidArgumentException Raised if there is no such connection.
TToiOperationNotSupportedException Raised if the connection is not mutable.
void ToiAudioOutputService::setVolume ( in TToiAudioConnectionId  connectionId,
in unsigned long  level 
) raises (TToiInvalidArgumentException, TToiOperationNotSupportedException)

Set an audio connection volume level. The level can be adjusted between 0 and 100 where 0 is the lowest volume and 100 the highest volume. The volume is only affected if the content is decoded or non compressed.

Parameters:
connectionId The identifier of the connection for which the volume will be changed.
level The desired volume level.
Exceptions:
TToiInvalidArgumentException Raised if there is no such connection or if the level is outside the allowed interval.
TToiOperationNotSupportedException Raised if the volume for the connection is not adjustable.

Member Data Documentation

The connection is an input.

This constant can also be accessed from toi.consts.ToiAudioOutputService.AUDIO_CONNECTION_DIRECTION_INPUT.

The connection is an output.

This constant can also be accessed from toi.consts.ToiAudioOutputService.AUDIO_CONNECTION_DIRECTION_OUTPUT.

Analog connection.

This constant can also be accessed from toi.consts.ToiAudioOutputService.AUDIO_CONNECTION_TYPE_ANALOG.

Memory buffer connection, one of the inputs to the audio mixer. If audio overlay is supported, it is stored in this memory buffer.

This constant can also be accessed from toi.consts.ToiAudioOutputService.AUDIO_CONNECTION_TYPE_BUFFER.

Decoder connection, one of the inputs to the audio mixer. If digital audio is decoded to PCM it is done by the decoder.

This constant can also be accessed from toi.consts.ToiAudioOutputService.AUDIO_CONNECTION_TYPE_DECODER.

HDMI connection.

This constant can also be accessed from toi.consts.ToiAudioOutputService.AUDIO_CONNECTION_TYPE_HDMI.

I2S connection.

This constant can also be accessed from toi.consts.ToiAudioOutputService.AUDIO_CONNECTION_TYPE_I2S.

S/PDIF connection.

This constant can also be accessed from toi.consts.ToiAudioOutputService.AUDIO_CONNECTION_TYPE_SPDIF.

This is an Event identifier for ToiAudioOutputConfigurationChangedEvent.

This constant can also be accessed from toi.consts.ToiAudioOutputService.ON_CONFIGURATION_CHANGED.

This is an Event identifier for ToiAudioOutputHdmiConnectionStatusChangedEvent.

This constant can also be accessed from toi.consts.ToiAudioOutputService.ON_HDMI_CONNECTION_STATUS_CHANGED.

This is an Event identifier for ToiAudioOutputLatencyChangedEvent.

This constant can also be accessed from toi.consts.ToiAudioOutputService.ON_LATENCY_CHANGED.

This is an Event identifier for ToiAudioOutputMuteStateChangedEvent.

This constant can also be accessed from toi.consts.ToiAudioOutputService.ON_MUTE_STATE_CHANGED.

This is an Event identifier for ToiAudioOutputVolumeChangedEvent.

This constant can also be accessed from toi.consts.ToiAudioOutputService.ON_VOLUME_CHANGED.