\section{Out\-Channel Class Reference}
\label{classOutChannel}\index{OutChannel@{OutChannel}}
{\tt \#include $<$outchannels.h$>$}

Inherits Entry.

Inheritance diagram for Out\-Channel:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=53pt]{classOutChannel__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for Out\-Channel:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=109pt]{classOutChannel__coll__graph}
\end{center}
\end{figure}


\subsection{Detailed Description}
the Output Channel class

Instances of the Out\-Channel class can be crieated via the method create\_\-enc method found in the {\bf Stream\_\-mixer} class.



Definition at line 58 of file outchannels.h.\subsection*{Public Member 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{classOutChannel_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{classOutChannel_a17}

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

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

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

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

\begin{CompactList}\small\item\em lowpass in Hz\item\end{CompactList}\item 
{\bf INT\_\-SET} (highpass, \_\-highpass)\label{classOutChannel_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}\item 
virtual bool {\bf apply\_\-profile} ()=0
\begin{CompactList}\small\item\em apply changes to the parameters // INTERNAL USE, use {\bf Stream\_\-mixer::apply\_\-enc} instead\item\end{CompactList}\item 
virtual bool {\bf init} ()=0\label{classOutChannel_a18}

\begin{CompactList}\small\item\em pure virtual function (INTERNAL)\item\end{CompactList}\item 
virtual int {\bf encode} ()=0\label{classOutChannel_a19}

\begin{CompactList}\small\item\em pure virtual function (INTERNAL)\item\end{CompactList}\item 
virtual void {\bf flush} ()=0\label{classOutChannel_a20}

\begin{CompactList}\small\item\em pure virtual function (INVERNAL)\item\end{CompactList}\item 
int {\bf shout} ()\label{classOutChannel_a21}

\begin{CompactList}\small\item\em strimma fuori l'encodato a tutti gli Shouter // INTERNAL USE by {\bf run()}\item\end{CompactList}\item 
bool {\bf dump} ()\label{classOutChannel_a22}

\begin{CompactList}\small\item\em scrive fuori l'encodato nel file // INTERNAL USE by {\bf run()}\item\end{CompactList}\item 
void {\bf push} (void $\ast$data, int len)
\begin{CompactList}\small\item\em feeds the pipe for encoding // INTERNAL USE by {\bf jmixer.cpp} carfudda()\item\end{CompactList}\item 
void {\bf start} ()\label{classOutChannel_a24}

\begin{CompactList}\small\item\em start Out\-Channel thread\item\end{CompactList}\item 
void {\bf run} ()\label{classOutChannel_a25}

\begin{CompactList}\small\item\em running loop called by {\bf start()}\item\end{CompactList}\item 
void {\bf lock} ()\label{classOutChannel_a26}

\item 
void {\bf unlock} ()\label{classOutChannel_a27}

\item 
void {\bf wait} ()\label{classOutChannel_a28}

\item 
void {\bf signal} ()\label{classOutChannel_a29}

\item 
void {\bf lock\_\-ice} ()\label{classOutChannel_a30}

\item 
void {\bf unlock\_\-ice} ()\label{classOutChannel_a31}

\item 
void {\bf destroy} ()\label{classOutChannel_a32}

\end{CompactItemize}
\subsection*{Public Attributes}
\begin{CompactItemize}
\item 
char {\bf name} [128]\label{classOutChannel_a0}

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

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

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

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

\begin{CompactList}\small\item\em if true the Out\-Channel thread is running (read only)\item\end{CompactList}\item 
bool {\bf initialized}\label{classOutChannel_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{classOutChannel_a7}

\begin{CompactList}\small\item\em string rendered to describe the quality of encoding\item\end{CompactList}\item 
FILE $\ast$ {\bf fd}\label{classOutChannel_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{classOutChannel_a9}

\begin{CompactList}\small\item\em full path filename for dumping\item\end{CompactList}\item 
{\bf Pipe} $\ast$ {\bf erbapipa}\label{classOutChannel_m10}

\begin{CompactList}\small\item\em {\bf Pipe} instance to feed the encoder // INTERNAL USE by {\bf run()}.\item\end{CompactList}\item 
bool {\bf encoding}\label{classOutChannel_m11}

\begin{CompactList}\small\item\em flag checked by run, (streaming$|$$|$fd) ? true : false // INTERNAL USE by {\bf run()}\item\end{CompactList}\item 
int16\_\-t {\bf buffer} [ENC\_\-BUFFER]\label{classOutChannel_m12}

\begin{CompactList}\small\item\em buffer holding the encoded audio\item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
bool {\bf calc\_\-bitrate} (int enc)\label{classOutChannel_b0}

\begin{CompactList}\small\item\em bitrate calculus\item\end{CompactList}\end{CompactItemize}
\subsection*{Static Protected Member Functions}
\begin{CompactItemize}
\item 
void $\ast$ {\bf kickoff} (void $\ast$arg)
\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
int {\bf encoded}\label{classOutChannel_n0}

\begin{CompactList}\small\item\em encoded buffer size in bytes\item\end{CompactList}\item 
int {\bf bitrate}\label{classOutChannel_n1}

\begin{CompactList}\small\item\em bits per second\item\end{CompactList}\item 
double {\bf now}\label{classOutChannel_n2}

\begin{CompactList}\small\item\em time now (for bitrate calculus)\item\end{CompactList}\item 
double {\bf prev}\label{classOutChannel_n3}

\begin{CompactList}\small\item\em time previous encoding (for bitrate calculus)\item\end{CompactList}\item 
unsigned int {\bf bytes\_\-accu}\label{classOutChannel_n4}

\begin{CompactList}\small\item\em bytes accuracy\item\end{CompactList}\end{CompactItemize}


\subsection{Member Function Documentation}
\index{apply_profile@{apply\_\-profile}!OutChannel@{OutChannel}}\index{OutChannel@{OutChannel}!apply_profile@{apply\_\-profile}}\index{OutChannel@{Out\-Channel}!apply_profile@{apply\_\-profile}}
\index{apply_profile@{apply\_\-profile}!OutChannel@{Out\-Channel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual bool Out\-Channel::apply\_\-profile ()\hspace{0.3cm}{\tt  [pure virtual]}}\label{classOutChannel_a17}


apply changes to the parameters // INTERNAL USE, use {\bf Stream\_\-mixer::apply\_\-enc} instead

Used to activate the settings, after every change.

To be able to change the Out\-Channel settings on the fly while encoding thread is running you should never call this directly, but only thru the {\bf Stream\_\-mixer::apply\_\-enc} method.

This is a pure virtual function, the implementation is defined inside the codec classes inheriting Out\-Channel.

\begin{Desc}
\item[Returns:]true on success, false otherwise \end{Desc}
\index{kickoff@{kickoff}!OutChannel@{OutChannel}}\index{OutChannel@{OutChannel}!kickoff@{kickoff}}\index{OutChannel@{Out\-Channel}!kickoff@{kickoff}}
\index{kickoff@{kickoff}!OutChannel@{Out\-Channel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ Out\-Channel::kickoff (void $\ast$ {\em arg})\hspace{0.3cm}{\tt  [inline, static, protected]}}\label{classOutChannel_e0}


\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
arg}]lock Out\-Channel main thread mutex \end{description}
\end{Desc}


Definition at line 315 of file outchannels.h.\index{push@{push}!OutChannel@{OutChannel}}\index{OutChannel@{OutChannel}!push@{push}}\index{OutChannel@{Out\-Channel}!push@{push}}
\index{push@{push}!OutChannel@{Out\-Channel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Out\-Channel::push (void $\ast$ {\em data}, int {\em len})}\label{classOutChannel_a23}


feeds the pipe for encoding // INTERNAL USE by {\bf jmixer.cpp} carfudda()

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em data}]audio buffer to be encoded \item[{\em len}]length in bytes of audio buffer to encode \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]\begin{itemize}
\item int$>$0 = quantity of data pushed into the pipe\item 0 = no need to feed in data: no encoding is configured\item -1 = pipe locked, wait a bit \end{itemize}
\end{Desc}


Definition at line 427 of file outchannels.cpp.

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
{\bf outchannels.h}\item 
outchannels.cpp\end{CompactItemize}
