class AFPlayer

This class represents a player for audio files

Public Methods

AFPlayer(string server)
checks and opens connection to AF server if possible
void play(const AudioFile& audata, const int device, const float delay, const int gain, const long length)
plays the given audio file on audio-device specified by the given number from now in "delay" seconds and "gain" loudness for "length" buffer-entities
~AFPlayer()
Destructs the object.

Private Fields

char* _server
Name of the connected server.
AC ac
Audio conntext.
AFAudioConn* aud
AF audio connection to the server.
static const float BUFSIZE
Buffer size, in hundreth seconds.
static const int MAXTRIES
Maximum number of failed connections.
ATime t1
Remember timing.
static int tries
Number of failed tries to open connection.

Private Methods

AEncodeType Au2AFEncodeType(FormatCode format)
find the encode type associated with the given format
int findDefaultDevice(const uint32 channels, const uint32 freq)
find suitable default device
void initializeAC(const AudioFile& audata, const int device, const int gain)
creates AF audio context for the given audio file

Documentation

This class represents a player for audio files. AFPlayer builds up connection to AF server and creates Audio Context.
AFPlayer(string server)
checks and opens connection to AF server if possible.
Throws:
Exception , if the connection is not possible.
Parameters:
server - name of the AF server

~AFPlayer()
Destructs the object.

void play(const AudioFile& audata, const int device, const float delay, const int gain, const long length)
plays the given audio file on audio-device specified by the given number from now in "delay" seconds and "gain" loudness for "length" buffer-entities.
Throws:
Exception , if memory allocation faild.
Parameters:
audata - audio file to play
device - audio-device to play on
delay - time to wait
gain - loudness
length - play time

void initializeAC(const AudioFile& audata, const int device, const int gain)
creates AF audio context for the given audio file.
Throws:
Exception , if the device can not play the file.
Parameters:
audata - audio file
device - audio-device to play on
gain - loudness

int findDefaultDevice(const uint32 channels, const uint32 freq)
find suitable default device. It is the first device not connected to phone.
Throws:
Exception , if no device could be found.
Returns:
device number
Parameters:
channels - channels to play
freq - sampling rate

AEncodeType Au2AFEncodeType(FormatCode format)
find the encode type associated with the given format.
Returns:
encode type
Parameters:
format - sample format

char* _server
Name of the connected server.

AFAudioConn* aud
AF audio connection to the server.

AC ac
Audio conntext.

ATime t1
Remember timing.

static int tries
Number of failed tries to open connection.

static const int MAXTRIES
Maximum number of failed connections.

static const float BUFSIZE
Buffer size, in hundreth seconds.


This class has no child classes.
Author:
Silvia Pfeiffer, Peter Tomczyk
Version:
$Id: afplayer.h,v 1.5 1998/01/13 15:02:47 tomczyk Exp $

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de