Main Page Modules Class Hierarchy Compound List File List Compound Members File Members

# OutChannel encoder

## Detailed Description

The following methods and properties are publicly available to control the behaviour or a OutChannel instance.

OutChannel offers you:

uniformed settings for the parameters of each codec:

- bps ( Kbit/s )
- freq ( samplerate in Hz )
- channels (1 is mono, 2 is stereo)
- quality (VALUE from 0.1 to 9.0)
- lowpass (lowpass in Hz, only with MP3)
- highpass (highpass in Hz, only with MP3)

methods to create instances of the Shouter class (*_ice)

methods to start/stop the file dumping of the encoded audio to a certain file.

The codec parameters are declared thru defines like INT_SET or CHAR_SET or FLOAT_SET: they basically define two overloaded functions to set and get the named parameter.

## Functions
| OutChannel (char *myname)
| the OutChannel class constructor
virtual | ~OutChannel ()
| the OutChannel class destructor
int | create_ice ()
| Create a Shouter instance.
bool | delete_ice (int iceid)
| delete a Shouter with ID
Shouter * | get_ice (int iceid)
| get a Shouter instance with ID
bool | apply_ice (int iceid)
| Applica la configurazione corrente.
bool | connect_ice (int iceid, bool on)
| Connette o disconnette il server ID a seconda del flag.
| INT_SET (bps, _bps)
| Kbit/s.
| INT_SET (freq, _freq)
| samplerate in Hz
| INT_SET (channels, _channels)
| channels (1 is mono, 2 is stereo)
| FLOAT_SET (quality, _quality)
| VALUE from 0.1 to 9.0.
| INT_SET (lowpass, _lowpass)
| lowpass in Hz
| INT_SET (highpass, _highpass)
| highpass in Hz
char * | guess_bps ()
| setup the bps encoder value
unsigned int | get_bitrate ()
| get the size of encoded audio in bytes
bool | dump_start (char *file)
| Start encoding to a file.
bool | dump_stop ()
| Stop encoding to a file.
## Variables
char | name [128]
| name string of the encoder type (read only)
char | version [128]
| version string of the encoder type (read only)
enum codec | tipo
| codec type (read only)
bool | quit
| set to true to exit the OutChannel thread
bool | running
| if true the OutChannel thread is running (read only)
bool | initialized
| if true all buffers have been allocated (read only)
Linklist | icelist
| the Linklist of Shouter instances
char | quality_desc [256]
| string rendered to describe the quality of encoding
FILE * | fd
| if non-zero a file is opened for dumping
char | fd_name [MAX_PATH_SIZE]
| full path filename for dumping

## Function Documentation

bool OutChannel::apply_ice | ( | int | iceid | ) | `[inherited]`

  | Applica la configurazione corrente. Se gia' connesso, resta connesso Parameters:
  iceid | Shouter ID
Returns: true on success, false otherwise Definition at line 254 of file outchannels.cpp.

bool OutChannel::connect_ice | ( | int | iceid,
|  | bool | on
| ) | `[inherited]`

  | Connette o disconnette il server ID a seconda del flag. Parameters:
  iceid | Shouter ID
  on | on/off flag
Returns: true if connected, false otherwise Definition at line 267 of file outchannels.cpp.

int OutChannel::create_ice | ( |  | ) | `[inherited]`

| Create a Shouter instance. Returns: ID of the new Shouter instance, or -1 on error Definition at line 190 of file outchannels.cpp.

bool OutChannel::delete_ice | ( | int | iceid | ) | `[inherited]`

  | delete a Shouter with ID Parameters:
  iceid | Shouter ID
Definition at line 230 of file outchannels.cpp.

bool OutChannel::dump_start | ( | char * | file | ) | `[inherited]`

  | Start encoding to a file. Starts to dump the encoded audio inside a local file. If the file is allready existing, it creates a new one with a slightly different name, without overwriting. If it was allready dumping, it keeps on: to change the filename to another file you must stop and then restart. Parameters:
  file | full path to the encoded file, including extension
Returns: true on success, false otherwise Definition at line 317 of file outchannels.cpp.

bool OutChannel::dump_stop | ( |  | ) | `[inherited]`

| Stop encoding to a file. Returns: true on success, false otherwise Definition at line 348 of file outchannels.cpp.

unsigned int OutChannel::get_bitrate | ( |  | ) | `[inline, inherited]`

| get the size of encoded audio in bytes Returns: the size of the encoded audio in bytes Definition at line 201 of file outchannels.h.

Shouter * OutChannel::get_ice | ( | int | iceid | ) | `[inherited]`

  | get a Shouter instance with ID Parameters:
  iceid | Shouter ID
Returns: il puntatore ad uno Shouter Definition at line 250 of file outchannels.cpp.

char * OutChannel::guess_bps | ( |  | ) | `[inherited]`

| setup the bps encoder value This method is used internally by the apply_profile() It guesses the bps and samplerate parameters of the encoder from quality value, then it renders the quality_desc string with a human readable description of the setting. You can internally tweak this function to modify the mapping of quality values to bps and samplerate. Returns: pointer to quality desc Definition at line 399 of file outchannels.cpp.

OutChannel::OutChannel | ( | char * | myname | ) | `[inherited]`

  | the OutChannel class constructor Parameters:
  myname | given at creation by Stream_mixer
Definition at line 61 of file outchannels.cpp.

## Variable Documentation

Linklist OutChannel::icelist`[inherited]`

| the Linklist of Shouter instances This is directly accessible: position operations on the Linklist class are thread safe. Definition at line 156 of file outchannels.h.