\hypertarget{simple__client_8c}{
\section{simple\_\-client.c File Reference}
\label{simple__client_8c}\index{simple_client.c@{simple\_\-client.c}}
}
This simple client demonstrates the basic features of JACK as they would be used by many applications. 

{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$errno.h$>$}\par
{\tt \#include $<$unistd.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$string.h$>$}\par
{\tt \#include $<$jack/jack.h$>$}\par
\subsection*{Enumerations}
\begin{CompactItemize}
\item 
enum \{ \hyperlink{simple__client_8c_dca29a1140aadadfd92b34a02fa516ef95b19f7739b0b7ea7d6b07586be54f36}{Init}, 
\hyperlink{simple__client_8c_dca29a1140aadadfd92b34a02fa516efc5301693c4e792bcd5a479ef38fb8f8d}{Run}, 
\hyperlink{simple__client_8c_dca29a1140aadadfd92b34a02fa516effef46e5063ce3dc78b8ae64fa474241d}{Exit}
 \}
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{simple__client_8c_ec08ae186cb5b9cb1ba57ea741d55b23}{process} (\hyperlink{types_8h_fe9972a13782c1e282747fdb4bc46f9c}{jack\_\-nframes\_\-t} nframes, void $\ast$arg)
\item 
void \hyperlink{simple__client_8c_a74561ff1353e3db73944cce59ea57f4}{jack\_\-shutdown} (void $\ast$arg)
\item 
int \hyperlink{simple__client_8c_966a4db44645785f9b5546c176fc22ea}{main} (int argc, char $\ast$argv\mbox{[}$\,$\mbox{]})
\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
\hyperlink{types_8h_fcd71bfba86b3023634d3bb97a454648}{jack\_\-port\_\-t} $\ast$ \hyperlink{simple__client_8c_aeb84bda18e3a96d76d7263e75baaac0}{input\_\-port}
\item 
\hyperlink{types_8h_fcd71bfba86b3023634d3bb97a454648}{jack\_\-port\_\-t} $\ast$ \hyperlink{simple__client_8c_ab6b78920773b8e03ea02816beb0bec2}{output\_\-port}
\item 
\hyperlink{types_8h_44245b219e977ef0a840ee16dbd95b50}{jack\_\-client\_\-t} $\ast$ \hyperlink{simple__client_8c_62608e08adc29a8d6dbc9754e659f125}{client}
\item 
volatile enum  \{ ... \}  \hyperlink{simple__client_8c_e711aeca7aab90119594f2e928dc691b}{client\_\-state}
\end{CompactItemize}


\subsection{Detailed Description}
This simple client demonstrates the basic features of JACK as they would be used by many applications. 



\subsection{Enumeration Type Documentation}
\hypertarget{simple__client_8c_dca29a1140aadadfd92b34a02fa516ef}{
\subsubsection["@0]{\setlength{\rightskip}{0pt plus 5cm}anonymous enum}}
\label{simple__client_8c_dca29a1140aadadfd92b34a02fa516ef}


\begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{Init@{Init}!simple_client.c@{simple\_\-client.c}}\index{simple_client.c@{simple\_\-client.c}!Init@{Init}}\item[{\em 
\hypertarget{simple__client_8c_dca29a1140aadadfd92b34a02fa516ef95b19f7739b0b7ea7d6b07586be54f36}{
Init}
\label{simple__client_8c_dca29a1140aadadfd92b34a02fa516ef95b19f7739b0b7ea7d6b07586be54f36}
}]\index{Run@{Run}!simple_client.c@{simple\_\-client.c}}\index{simple_client.c@{simple\_\-client.c}!Run@{Run}}\item[{\em 
\hypertarget{simple__client_8c_dca29a1140aadadfd92b34a02fa516efc5301693c4e792bcd5a479ef38fb8f8d}{
Run}
\label{simple__client_8c_dca29a1140aadadfd92b34a02fa516efc5301693c4e792bcd5a479ef38fb8f8d}
}]\index{Exit@{Exit}!simple_client.c@{simple\_\-client.c}}\index{simple_client.c@{simple\_\-client.c}!Exit@{Exit}}\item[{\em 
\hypertarget{simple__client_8c_dca29a1140aadadfd92b34a02fa516effef46e5063ce3dc78b8ae64fa474241d}{
Exit}
\label{simple__client_8c_dca29a1140aadadfd92b34a02fa516effef46e5063ce3dc78b8ae64fa474241d}
}]\end{description}
\end{Desc}



\subsection{Function Documentation}
\hypertarget{simple__client_8c_a74561ff1353e3db73944cce59ea57f4}{
\index{simple_client.c@{simple\_\-client.c}!jack_shutdown@{jack\_\-shutdown}}
\index{jack_shutdown@{jack\_\-shutdown}!simple_client.c@{simple\_\-client.c}}
\subsubsection[jack\_\-shutdown]{\setlength{\rightskip}{0pt plus 5cm}void jack\_\-shutdown (void $\ast$ {\em arg})}}
\label{simple__client_8c_a74561ff1353e3db73944cce59ea57f4}


JACK calls this shutdown\_\-callback if the server ever shuts down or decides to disconnect the client. \hypertarget{simple__client_8c_966a4db44645785f9b5546c176fc22ea}{
\index{simple_client.c@{simple\_\-client.c}!main@{main}}
\index{main@{main}!simple_client.c@{simple\_\-client.c}}
\subsubsection[main]{\setlength{\rightskip}{0pt plus 5cm}int main (int {\em argc}, char $\ast$ {\em argv}\mbox{[}$\,$\mbox{]})}}
\label{simple__client_8c_966a4db44645785f9b5546c176fc22ea}


\hypertarget{simple__client_8c_ec08ae186cb5b9cb1ba57ea741d55b23}{
\index{simple_client.c@{simple\_\-client.c}!process@{process}}
\index{process@{process}!simple_client.c@{simple\_\-client.c}}
\subsubsection[process]{\setlength{\rightskip}{0pt plus 5cm}int process (\hyperlink{types_8h_fe9972a13782c1e282747fdb4bc46f9c}{jack\_\-nframes\_\-t} {\em nframes}, void $\ast$ {\em arg})}}
\label{simple__client_8c_ec08ae186cb5b9cb1ba57ea741d55b23}


The process callback for this JACK application is called in a special realtime thread once for each audio cycle.

This client follows a simple rule: when the JACK transport is running, copy the input port to the output. When it stops, exit. 

\subsection{Variable Documentation}
\hypertarget{simple__client_8c_62608e08adc29a8d6dbc9754e659f125}{
\index{simple_client.c@{simple\_\-client.c}!client@{client}}
\index{client@{client}!simple_client.c@{simple\_\-client.c}}
\subsubsection[client]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{types_8h_44245b219e977ef0a840ee16dbd95b50}{jack\_\-client\_\-t}$\ast$ \hyperlink{simple__client_8c_62608e08adc29a8d6dbc9754e659f125}{client}}}
\label{simple__client_8c_62608e08adc29a8d6dbc9754e659f125}


\hypertarget{simple__client_8c_e711aeca7aab90119594f2e928dc691b}{
\index{simple_client.c@{simple\_\-client.c}!client_state@{client\_\-state}}
\index{client_state@{client\_\-state}!simple_client.c@{simple\_\-client.c}}
\subsubsection[client\_\-state]{\setlength{\rightskip}{0pt plus 5cm}volatile \{ ... \}   \hyperlink{simple__client_8c_e711aeca7aab90119594f2e928dc691b}{client\_\-state}}}
\label{simple__client_8c_e711aeca7aab90119594f2e928dc691b}


\hypertarget{simple__client_8c_aeb84bda18e3a96d76d7263e75baaac0}{
\index{simple_client.c@{simple\_\-client.c}!input_port@{input\_\-port}}
\index{input_port@{input\_\-port}!simple_client.c@{simple\_\-client.c}}
\subsubsection[input\_\-port]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{types_8h_fcd71bfba86b3023634d3bb97a454648}{jack\_\-port\_\-t}$\ast$ \hyperlink{simple__client_8c_aeb84bda18e3a96d76d7263e75baaac0}{input\_\-port}}}
\label{simple__client_8c_aeb84bda18e3a96d76d7263e75baaac0}


\hypertarget{simple__client_8c_ab6b78920773b8e03ea02816beb0bec2}{
\index{simple_client.c@{simple\_\-client.c}!output_port@{output\_\-port}}
\index{output_port@{output\_\-port}!simple_client.c@{simple\_\-client.c}}
\subsubsection[output\_\-port]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{types_8h_fcd71bfba86b3023634d3bb97a454648}{jack\_\-port\_\-t}$\ast$ \hyperlink{simple__client_8c_ab6b78920773b8e03ea02816beb0bec2}{output\_\-port}}}
\label{simple__client_8c_ab6b78920773b8e03ea02816beb0bec2}


