Net::LibLO - Perl interface for liblo Lightweight OSC library
use Net::LibLO; my $lo = new Net::LibLO( ); $lo->add_method( "/reply", 's', \&my_handler ); $lo->send( 'osc://localhost:5600/', '/foo/bar', 's', 'Hello World' );
Net::LibLO class is used to send and recieve OSC messages using LibLO (the Lightweight OSC library). The coding style is slightly different to the C interface to LibLO, because it makes use of perl's Object Oriented functionality.
Create a new LibLO object for sending a recieving messages. If the port is missing, then a random port number is chosen. If the protocol is missing, than UDP is used.
port
protocol
Send a bundle to the sepecified destination.
dest can either be a Net::LibLO::Address object, a URL or a port.
dest
bundle should be a Net::LibLO::Bundle object.
bundle
Send a message to the sepecified destination.
message should be a Net::LibLO::Message object.
message
Construct and send a message to the sepecified destination.
path is the path to send the message to.
path
typespec and params are passed through to create the new message.
typespec
params
Block and wait to receive a single message. Returns the length of the message in bytes or number less than 1 on failure. Length of message is returned, whether the message has been handled by a method or not.
Look for an OSC message waiting to be received. Waits for timeout milliseconds for a message and then returns the length of the message, or 0 if there was no message. Use a value of 0 to return immediatly.
timeout
Add an OSC method to the specifed server.
path is the OSC path to register the method to. If undef is passed the method will match all paths.
undef
typespec is OSC typespec that the method accepts. Incoming messages with similar typespecs (e.g. ones with numerical types in the same position) will be coerced to the typespec given here.
handler is a reference to the method handler callback subroutine that will be called if a matching message is received.
handler
user_data is a value that will be passed to the callback subroutine, when its invoked matching from this method.
user_data
This is order of parameters that will be passed to your method handler subroutines.
serv is the Net::LibLO object that the method is registered with.
serv
mesg is a Net::LibLO::Message object for the incoming message.
mesg
path is the path the incoming message was sent to.
typespec If you specided types in your method creation call then this will match those and the incoming types will have been coerced to match, otherwise it will be the types of the arguments of the incoming message.
userdata This contains the userdata value passed in the call to add_method
userdata
add_method
params is an array of values associated with the message
Returns the port the socket is bound to.
Returns the full URL for talking to this server.
Net::LibLO::Address
Net::LibLO::Bundle
Net::LibLO::Message
http://liblo.sourceforge.net/
Nicholas J. Humfrey <njh@aelius.com>
Copyright (C) 2005 Nicholas J. Humfrey
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
To install Net::LibLO, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::LibLO
CPAN shell
perl -MCPAN -e shell install Net::LibLO
For more information on module installation, please visit the detailed CPAN module installation guide.