RTP Audio System  2.0.0
AudioClient Class Reference

Audio Client. More...

#include <audioclient.h>

Inheritance diagram for AudioClient:
AdjustableAudioQualityInterface AudioQualityInterface

List of all members.

Public Member Functions

 AudioClient (AudioWriterInterface *audioOutput)
virtual ~AudioClient ()
bool play (const char *url)
bool change (const char *mediaName)
void stop ()
card64 getPosition ()
card64 getMaxPosition () const
card16 getSamplingRate () const
card8 getBits () const
card8 getChannels () const
card16 getByteOrder () const
cardinal getBytesPerSecond () const
cardinal getBitsPerSample () const
cardinal getRawBytesPerSecond ()
MediaInfo getMediaInfo () const
card8 getErrorCode () const
const char * getEncoding () const
card32 getBandwidthLimit () const
card8 getIPVersion () const
bool playing () const
String getServerAddressString (const InternetAddress::PrintFormat format=InternetAddress::PF_Address) const
String getOurAddressString (const InternetAddress::PrintFormat format=InternetAddress::PF_Address) const
cardinal getLayers () const
card64 getBytesReceived (const cardinal layer=0) const
card64 getPacketsReceived (const cardinal layer=0) const
InternetFlow getInternetFlow (const cardinal layer=0) const
card32 getFlowLabel (const cardinal layer=0) const
card8 getTrafficClass (const cardinal layer=0) const
card32 getServerSSRC (const cardinal layer=0) const
card32 getOurSSRC () const
card64 getPacketsLost (const cardinal layer=0) const
double getFractionLost (const cardinal layer=0) const
double getJitter (const cardinal layer=0) const
const char * getEncodingName (const cardinal index)
void setPosition (const card64 position)
void setPause (const bool on)
card16 setSamplingRate (const card16 rate)
card8 setChannels (const card8 channels)
card8 setBits (const card8 bits)
card16 setByteOrder (const card16 byteOrder)
void setEncoding (const cardinal index)
void setBandwidthLimit (const card32 bandwidthLimit)

Private Member Functions

void sendCommand (const bool updateRestartPosition=true)

Private Attributes

AudioWriterInterfaceAudioOutput
RTPReceiverReceiver
RTCPSenderSender
Socket SenderSocket
Socket ReceiverSocket
InternetFlow Flow
InternetAddress ServerAddress
InternetAddress OurAddress
card32 OurSSRC
std::multimap< const cardinal,
AudioDecoderInterface * > 
DecoderSet
AudioDecoderRepository Decoders
AudioClientAppPacket Status
card64 OldPosition
card64 ChangeTimeStamp
bool IsPlaying

Static Private Attributes

static const card64 RestartPositionUpdateDelay = 5000000

Detailed Description

Audio Client.

This class is an audio client.

Author:
Thomas Dreibholz
Version:
1.0

Constructor & Destructor Documentation

Constructor for a new audio client.

Parameters:
audioOutputAudioWriter to write the output to.

Destructor.


Member Function Documentation

bool AudioClient::change ( const char *  mediaName)

Change media of an established connection.

Parameters:
mediaNameNew media name (e.g. ../AudioFiles/Test2.list)
Returns:
true, if play request has been sent to server.
See also:
play

Get bandwidth limit.

Returns:
Bandwidth limit.
card64 AudioClient::getBytesReceived ( const cardinal  layer = 0) const [inline]

Get number of bytes received.

Parameters:
layerLayer number or (cardinal)-1 for sum of all layers.
Returns:
Number of bytes received
const char* AudioClient::getEncoding ( ) const [inline]

Get encoding name.

Returns:
Encoding name.
const char * AudioClient::getEncodingName ( const cardinal  index)

Get encoding name for a given index of the client's decoder repository.

Parameters:
indexRepository index.
Returns:
Encoding name or NULL, if index is too high.
card8 AudioClient::getErrorCode ( ) const [inline]

Get error code.

Returns:
Error code.
card32 AudioClient::getFlowLabel ( const cardinal  layer = 0) const [inline]

Get flow label of last received packet in given layer.

Parameters:
layerLayer number.
Returns:
Flow label.
See also:
getLayers
double AudioClient::getFractionLost ( const cardinal  layer = 0) const

Get fraction of packets lost for given layer.

Parameters:
layerLayer number.
Returns:
Fraction of packets lost.
See also:
getLayers
InternetFlow AudioClient::getInternetFlow ( const cardinal  layer = 0) const [inline]

Get InternetFlow of last received packet in given layer.

Parameters:
layerLayer number.
Returns:
InternetFlow.
See also:
getLayers

Get IP version.

Returns:
IP Version.
double AudioClient::getJitter ( const cardinal  layer = 0) const

Get jitter for given layer.

Parameters:
layerLayer number.
Returns:
Jitter.
See also:
getLayers
cardinal AudioClient::getLayers ( ) const [inline]

Get number of layers in last transmission.

card64 AudioClient::getMaxPosition ( ) const [inline]

Get maximum media position.

Returns:
Maximum position in nanoseconds.

Get client address string.

Parameters:
formatPrint format.
Returns:
Client address.
See also:
InternetAddress::PrintFormat
card32 AudioClient::getOurSSRC ( ) const [inline]

Get client SSRC.

Returns:
Client SSRC.
card64 AudioClient::getPacketsLost ( const cardinal  layer = 0) const

Get number of packets lost for given layer.

Parameters:
layerLayer number.
Returns:
Number of packets lost.
See also:
getLayers
card64 AudioClient::getPacketsReceived ( const cardinal  layer = 0) const [inline]

Get number of packets received in given layer.

Parameters:
layerLayer number or (cardinal)-1 for sum of all layers.
Returns:
Number of packets received
See also:
getLayers

Get current media position. This will automatically the RestartPosition value in the next AudioClientAppPacket. The server will restart from the current position, if the server is restarted.

Returns:
Position in nanoseconds.

Get number of raw bytes (incl. IPv6/UDP/RTP/RTPAudio headers) per second.

Returns:
Number of raw bytes per second.

Get server address string.

Parameters:
formatPrint format.
Returns:
Server address.
See also:
InternetAddress::PrintFormat
card32 AudioClient::getServerSSRC ( const cardinal  layer = 0) const

Get server SSRC for given layer.

Parameters:
layerLayer number.
Returns:
Server SSRC.
See also:
getLayers
card8 AudioClient::getTrafficClass ( const cardinal  layer = 0) const [inline]

Get traffic class of last received packet in given layer.

Parameters:
layerLayer number.
Returns:
Traffic class.
See also:
getLayers
bool AudioClient::play ( const char *  url)

Start playing given media from given server.

Parameters:
urlMedia URL (e.g. "rtpa+sctp://gaffel:7500/Test1.list").
Returns:
true, if play request has been sent to server.
bool AudioClient::playing ( ) const [inline]

Check, if audio client is playing.

Returns:
true, if client is playing; false otherwise.
void AudioClient::sendCommand ( const bool  updateRestartPosition = true) [private]
void AudioClient::setBandwidthLimit ( const card32  bandwidthLimit) [inline]

Set bandwidth limit.

Parameters:
bandwidthLimitBandwidth limit.
card8 AudioClient::setBits ( const card8  bits) [virtual]

Set number of audio bits.

Parameters:
bitsNew number of audio bits.

Implements AdjustableAudioQualityInterface.

card16 AudioClient::setByteOrder ( const card16  byteOrder) [virtual]

Set audio byte order.

Parameters:
rateNew audio byte order.

Implements AdjustableAudioQualityInterface.

card8 AudioClient::setChannels ( const card8  channels) [virtual]

Set number of audio channels

Parameters:
channelsNew number of audio channels.

Implements AdjustableAudioQualityInterface.

void AudioClient::setEncoding ( const cardinal  index)

Set encoding by index in client's decoder repository.

Parameters:
indexIndex in decoder repository.
void AudioClient::setPause ( const bool  on)

Set pause.

Parameters:
ontrue for pause on; false for pause off.
void AudioClient::setPosition ( const card64  position) [inline]

Set media position.

Parameters:
positionNew media position in nanoseconds.
card16 AudioClient::setSamplingRate ( const card16  rate) [virtual]

Set audio sampling rate.

Parameters:
rateNew audio sampling rate.

Implements AdjustableAudioQualityInterface.

Stop playing.


Member Data Documentation

std::multimap<const cardinal,AudioDecoderInterface*> AudioClient::DecoderSet [private]
bool AudioClient::IsPlaying [private]
const card64 AudioClient::RestartPositionUpdateDelay = 5000000 [static, private]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines