\section{Out\-Channel encoder}
\label{group__outchannel}\index{OutChannel encoder@{OutChannel encoder}}


\subsection{Detailed Description}
The following methods and properties are publicly available to control the behaviour or a {\bf Out\-Channel} instance.

{\bf Out\-Channel} offers you:

uniformed settings for the parameters of each codec:

\begin{itemize}
\item bps ( Kbit/s )\item freq ( samplerate in Hz )\item channels (1 is mono, 2 is stereo)\item quality (VALUE from 0.1 to 9.0)\item lowpass (lowpass in Hz, only with MP3)\item highpass (highpass in Hz, only with MP3)\end{itemize}


methods to create instances of the Shouter class ($\ast$\_\-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. 

\subsection*{Functions}
\begin{CompactItemize}
\item 
{\bf Out\-Channel} (char $\ast$myname)
\begin{CompactList}\small\item\em the Out\-Channel class constructor\item\end{CompactList}\item 
virtual {\bf $\sim$Out\-Channel} ()\label{group__outchannel_a11}

\begin{CompactList}\small\item\em the Out\-Channel class destructor\item\end{CompactList}\item 
int {\bf create\_\-ice} ()
\begin{CompactList}\small\item\em Create a Shouter instance.\item\end{CompactList}\item 
bool {\bf delete\_\-ice} (int iceid)
\begin{CompactList}\small\item\em delete a Shouter with ID\item\end{CompactList}\item 
Shouter $\ast$ {\bf get\_\-ice} (int iceid)
\begin{CompactList}\small\item\em get a Shouter instance with ID\item\end{CompactList}\item 
bool {\bf apply\_\-ice} (int iceid)
\begin{CompactList}\small\item\em Applica la configurazione corrente.\item\end{CompactList}\item 
bool {\bf connect\_\-ice} (int iceid, bool on)
\begin{CompactList}\small\item\em Connette o disconnette il server ID a seconda del flag.\item\end{CompactList}\item 
{\bf INT\_\-SET} (bps, \_\-bps)\label{group__outchannel_a17}

\begin{CompactList}\small\item\em Kbit/s.\item\end{CompactList}\item 
{\bf INT\_\-SET} (freq, \_\-freq)\label{group__outchannel_a18}

\begin{CompactList}\small\item\em samplerate in Hz\item\end{CompactList}\item 
{\bf INT\_\-SET} (channels, \_\-channels)\label{group__outchannel_a19}

\begin{CompactList}\small\item\em channels (1 is mono, 2 is stereo)\item\end{CompactList}\item 
{\bf FLOAT\_\-SET} (quality, \_\-quality)\label{group__outchannel_a20}

\begin{CompactList}\small\item\em VALUE from 0.1 to 9.0.\item\end{CompactList}\item 
{\bf INT\_\-SET} (lowpass, \_\-lowpass)\label{group__outchannel_a21}

\begin{CompactList}\small\item\em lowpass in Hz\item\end{CompactList}\item 
{\bf INT\_\-SET} (highpass, \_\-highpass)\label{group__outchannel_a22}

\begin{CompactList}\small\item\em highpass in Hz\item\end{CompactList}\item 
char $\ast$ {\bf guess\_\-bps} ()
\begin{CompactList}\small\item\em setup the bps encoder value\item\end{CompactList}\item 
unsigned int {\bf get\_\-bitrate} ()
\begin{CompactList}\small\item\em get the size of encoded audio in bytes\item\end{CompactList}\item 
bool {\bf dump\_\-start} (char $\ast$file)
\begin{CompactList}\small\item\em Start encoding to a file.\item\end{CompactList}\item 
bool {\bf dump\_\-stop} ()
\begin{CompactList}\small\item\em Stop encoding to a file.\item\end{CompactList}\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
char {\bf name} [128]\label{group__outchannel_a0}

\begin{CompactList}\small\item\em name string of the encoder type (read only)\item\end{CompactList}\item 
char {\bf version} [128]\label{group__outchannel_a1}

\begin{CompactList}\small\item\em version string of the encoder type (read only)\item\end{CompactList}\item 
enum {\bf codec} {\bf tipo}\label{group__outchannel_a2}

\begin{CompactList}\small\item\em codec type (read only)\item\end{CompactList}\item 
bool {\bf quit}\label{group__outchannel_a3}

\begin{CompactList}\small\item\em set to true to exit the Out\-Channel thread\item\end{CompactList}\item 
bool {\bf running}\label{group__outchannel_a4}

\begin{CompactList}\small\item\em if true the Out\-Channel thread is running (read only)\item\end{CompactList}\item 
bool {\bf initialized}\label{group__outchannel_a5}

\begin{CompactList}\small\item\em if true all buffers have been allocated (read only)\item\end{CompactList}\item 
Linklist {\bf icelist}
\begin{CompactList}\small\item\em the Linklist of Shouter instances\item\end{CompactList}\item 
char {\bf quality\_\-desc} [256]\label{group__outchannel_a7}

\begin{CompactList}\small\item\em string rendered to describe the quality of encoding\item\end{CompactList}\item 
FILE $\ast$ {\bf fd}\label{group__outchannel_a8}

\begin{CompactList}\small\item\em if non-zero a file is opened for dumping\item\end{CompactList}\item 
char {\bf fd\_\-name} [MAX\_\-PATH\_\-SIZE]\label{group__outchannel_a9}

\begin{CompactList}\small\item\em full path filename for dumping\item\end{CompactList}\end{CompactItemize}


\subsection{Function Documentation}
\index{apply_ice@{apply\_\-ice}!outchannel@{outchannel}}\index{outchannel@{outchannel}!apply_ice@{apply\_\-ice}}\index{outchannel@{outchannel}!apply_ice@{apply\_\-ice}}
\index{apply_ice@{apply\_\-ice}!outchannel@{outchannel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Out\-Channel::apply\_\-ice (int {\em iceid})\hspace{0.3cm}{\tt  [inherited]}}\label{group__outchannel_a15}


Applica la configurazione corrente.

Se gia' connesso, resta connesso

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em iceid}]Shouter ID \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true on success, false otherwise \end{Desc}


Definition at line 254 of file outchannels.cpp.\index{connect_ice@{connect\_\-ice}!outchannel@{outchannel}}\index{outchannel@{outchannel}!connect_ice@{connect\_\-ice}}\index{outchannel@{outchannel}!connect_ice@{connect\_\-ice}}
\index{connect_ice@{connect\_\-ice}!outchannel@{outchannel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Out\-Channel::connect\_\-ice (int {\em iceid}, bool {\em on})\hspace{0.3cm}{\tt  [inherited]}}\label{group__outchannel_a16}


Connette o disconnette il server ID a seconda del flag.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em iceid}]Shouter ID \item[{\em on}]on/off flag \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if connected, false otherwise \end{Desc}


Definition at line 267 of file outchannels.cpp.\index{create_ice@{create\_\-ice}!outchannel@{outchannel}}\index{outchannel@{outchannel}!create_ice@{create\_\-ice}}\index{outchannel@{outchannel}!create_ice@{create\_\-ice}}
\index{create_ice@{create\_\-ice}!outchannel@{outchannel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Out\-Channel::create\_\-ice ()\hspace{0.3cm}{\tt  [inherited]}}\label{group__outchannel_a12}


Create a Shouter instance.

\begin{Desc}
\item[Returns:]ID of the new Shouter instance, or -1 on error \end{Desc}


Definition at line 190 of file outchannels.cpp.\index{delete_ice@{delete\_\-ice}!outchannel@{outchannel}}\index{outchannel@{outchannel}!delete_ice@{delete\_\-ice}}\index{outchannel@{outchannel}!delete_ice@{delete\_\-ice}}
\index{delete_ice@{delete\_\-ice}!outchannel@{outchannel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Out\-Channel::delete\_\-ice (int {\em iceid})\hspace{0.3cm}{\tt  [inherited]}}\label{group__outchannel_a13}


delete a Shouter with ID

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em iceid}]Shouter ID \end{description}
\end{Desc}


Definition at line 230 of file outchannels.cpp.\index{dump_start@{dump\_\-start}!outchannel@{outchannel}}\index{outchannel@{outchannel}!dump_start@{dump\_\-start}}\index{outchannel@{outchannel}!dump_start@{dump\_\-start}}
\index{dump_start@{dump\_\-start}!outchannel@{outchannel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Out\-Channel::dump\_\-start (char $\ast$ {\em file})\hspace{0.3cm}{\tt  [inherited]}}\label{group__outchannel_a25}


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.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em file}]full path to the encoded file, including extension \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true on success, false otherwise \end{Desc}


Definition at line 317 of file outchannels.cpp.\index{dump_stop@{dump\_\-stop}!outchannel@{outchannel}}\index{outchannel@{outchannel}!dump_stop@{dump\_\-stop}}\index{outchannel@{outchannel}!dump_stop@{dump\_\-stop}}
\index{dump_stop@{dump\_\-stop}!outchannel@{outchannel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Out\-Channel::dump\_\-stop ()\hspace{0.3cm}{\tt  [inherited]}}\label{group__outchannel_a26}


Stop encoding to a file.

\begin{Desc}
\item[Returns:]true on success, false otherwise \end{Desc}


Definition at line 348 of file outchannels.cpp.\index{get_bitrate@{get\_\-bitrate}!outchannel@{outchannel}}\index{outchannel@{outchannel}!get_bitrate@{get\_\-bitrate}}\index{outchannel@{outchannel}!get_bitrate@{get\_\-bitrate}}
\index{get_bitrate@{get\_\-bitrate}!outchannel@{outchannel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned int Out\-Channel::get\_\-bitrate ()\hspace{0.3cm}{\tt  [inline, inherited]}}\label{group__outchannel_a24}


get the size of encoded audio in bytes

\begin{Desc}
\item[Returns:]the size of the encoded audio in bytes \end{Desc}


Definition at line 201 of file outchannels.h.\index{get_ice@{get\_\-ice}!outchannel@{outchannel}}\index{outchannel@{outchannel}!get_ice@{get\_\-ice}}\index{outchannel@{outchannel}!get_ice@{get\_\-ice}}
\index{get_ice@{get\_\-ice}!outchannel@{outchannel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Shouter $\ast$ Out\-Channel::get\_\-ice (int {\em iceid})\hspace{0.3cm}{\tt  [inherited]}}\label{group__outchannel_a14}


get a Shouter instance with ID

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em iceid}]Shouter ID \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]il puntatore ad uno Shouter \end{Desc}


Definition at line 250 of file outchannels.cpp.\index{guess_bps@{guess\_\-bps}!outchannel@{outchannel}}\index{outchannel@{outchannel}!guess_bps@{guess\_\-bps}}\index{outchannel@{outchannel}!guess_bps@{guess\_\-bps}}
\index{guess_bps@{guess\_\-bps}!outchannel@{outchannel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char $\ast$ Out\-Channel::guess\_\-bps ()\hspace{0.3cm}{\tt  [inherited]}}\label{group__outchannel_a23}


setup the bps encoder value

This method is used internally by the {\bf 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.

\begin{Desc}
\item[Returns:]pointer to quality desc \end{Desc}


Definition at line 399 of file outchannels.cpp.\index{OutChannel@{OutChannel}!outchannel@{outchannel}}\index{outchannel@{outchannel}!OutChannel@{OutChannel}}\index{outchannel@{outchannel}!OutChannel@{OutChannel}}
\index{OutChannel@{OutChannel}!outchannel@{outchannel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Out\-Channel::Out\-Channel (char $\ast$ {\em myname})\hspace{0.3cm}{\tt  [inherited]}}\label{group__outchannel_a10}


the Out\-Channel class constructor

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em myname}]given at creation by {\bf Stream\_\-mixer} \end{description}
\end{Desc}


Definition at line 61 of file outchannels.cpp.

\subsection{Variable Documentation}
\index{icelist@{icelist}!outchannel@{outchannel}}\index{outchannel@{outchannel}!icelist@{icelist}}\index{outchannel@{outchannel}!icelist@{icelist}}
\index{icelist@{icelist}!outchannel@{outchannel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Linklist Out\-Channel::icelist\hspace{0.3cm}{\tt  [inherited]}}\label{group__outchannel_a6}


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.