[LAD] Overloading OSC Arguments

Dave Robillard dave at drobilla.net
Thu Dec 20 22:06:44 UTC 2007


On Mon, 2007-12-10 at 07:46 -0500, Fred Gleason wrote:
> Howdy Folks:
> 
> I'm in the midst of laying out an OSC namespace for a new app, and have come 
> across a couple of places where it might make sense to 'overload' different 
> argument parameters onto the same command node (in the same sense that 
> different argument lists can be overloaded into identically-named methods in 
> C++).
> 
> An example may help make it clear.  Consider the following OSC path:
> 
> 	/daw/cursor/set_position
> 
> This would be a command to set a cursor position.  If the supplied argument 
> were a float32, the unit would be assumed to be seconds.  If it were a
> string, a broken-down time representation ("HH:MM:SS") would be assumed, and 
> so on.
> 
> While I can find nothing in the OSC spec that would specifically forbid this 
> sort of behavior, I'd like to be sure that, as a practical matter, the 
> 'real-world' apps that are already out there would be able to deal with this 
> sort of construct.  Would anyone be aware of reasons why this sort of layout 
> would not be a good idea?

I use it.   Think it's a good idea in general, as long as you're not
actively stupid about it (i.e. what swh said).

Certainly beeats set_position_float, set_position_time_string, ....

Though, for absolute time you should probably use the OSC timestamp type
(maybe with a different epoch, but that's just semantics)

-DR-





More information about the Linux-audio-dev mailing list