more work on osc
This commit is contained in:
		
							parent
							
								
									2d3bd8ed8b
								
							
						
					
					
						commit
						f19fefe41d
					
				
							
								
								
									
										25
									
								
								chap/OSC.tex
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								chap/OSC.tex
									
									
									
									
									
								
							| @ -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} | ||||
| 
 | ||||
| %	------------------------------------------------ | ||||
| 
 | ||||
|  | ||||
| @ -5,10 +5,11 @@ | ||||
| 
 | ||||
| #define LOCAL_PORT	"9000" | ||||
| 
 | ||||
| 
 | ||||
| int main(int argc, char *argv[]) | ||||
| { | ||||
| lo_server_thread st; | ||||
| 
 | ||||
| st = lo_server_thread_new(LOCAL_PORT, NULL); | ||||
| 
 | ||||
| return 0; | ||||
| } | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 tth
						tth