adds path method to OscMsg that return the OSC path

pull/5/head
Spencer Russell 2015-07-16 10:55:32 -04:00
parent 67c26b7742
commit 50027a0dcb
2 changed files with 9 additions and 1 deletions

View File

@ -16,7 +16,7 @@
module OSC
import Base.show
export OscMsg
export OscMsg, path
macro incfp(x) quote begin
local gensym_ = $(esc(x))
$(esc(x)) = $(esc(x))+1
@ -27,6 +27,8 @@ type OscMsg
data::Array{Uint8}
end
path(msg::OscMsg) = stringify(msg.data)
function stringify(data::Array{Uint8})
zeroInd = find(data.== 0)
if(length(zeroInd) == 0)

View File

@ -124,8 +124,14 @@ function test_it_osc_spec()
show(osc)
end
function test_path()
osc = OscMsg("/foo", "f", float32(1.234))
@test path(osc) == "/foo"
end
if test_type in ["ALL", "TEST", "INSTALL"]
test_it_osc_spec()
test_it_fat()
test_path()
println("Done...")
end