|
|
|
@ -50,17 +50,38 @@ tth@debian:~$
|
|
|
|
|
|
|
|
|
|
\section{Exemple de code}
|
|
|
|
|
|
|
|
|
|
Ecouter :
|
|
|
|
|
\textbf{Ecouter :}
|
|
|
|
|
|
|
|
|
|
Attention, là, nous arrivons sur un domaine plus
|
|
|
|
|
hardu\footnote{Un beau néoligisme, n'est-il pas ?}.
|
|
|
|
|
En effet, la mécanique interne de \texttt{liblo}
|
|
|
|
|
utilise un thread d'écoute qui appelle des
|
|
|
|
|
\textsl{callbacks} préalablement "accrochés",
|
|
|
|
|
\textsl{hooked} en vrai langue.
|
|
|
|
|
|
|
|
|
|
\lstinputlisting[language=c]{code/listen-osc.c}
|
|
|
|
|
|
|
|
|
|
Envoyer :
|
|
|
|
|
\textbf{Envoyer :}
|
|
|
|
|
|
|
|
|
|
Cette partie là est beaucoup plus simple.
|
|
|
|
|
|
|
|
|
|
\lstinputlisting[language=c]{code/send-osc.c}
|
|
|
|
|
|
|
|
|
|
J'avoue ne pas encore savoir ce que veut bien dire la
|
|
|
|
|
valeur de retour.
|
|
|
|
|
|
|
|
|
|
% ------------------------------------------------
|
|
|
|
|
\section{En Perl} \index{Perl}
|
|
|
|
|
|
|
|
|
|
\begin{verbatim}
|
|
|
|
|
use Net::OpenSoundControl::Client;
|
|
|
|
|
|
|
|
|
|
$client = Net::OpenSoundControl::Client->new(
|
|
|
|
|
Host => $target, Port => $port)
|
|
|
|
|
or die "Could not start client: $@\n";
|
|
|
|
|
|
|
|
|
|
$client->send(['/proc/kcore', 'i', 61, 's', "bla"]);
|
|
|
|
|
\end{verbatim}
|
|
|
|
|
|
|
|
|
|
% ------------------------------------------------
|
|
|
|
|
|
|
|
|
|