Created
October 8, 2014 12:08
-
-
Save Sciss/9257fb455dea088257cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import osc.Implicits._ | |
val c = osc.UDP.Client(localhost -> 17737) | |
var marks = Vector.empty[Long] | |
c.action = { | |
case osc.Message("/query.reply", 1, count: Int) => | |
c ! osc.Message("/doc/active/markers", "get", 2, "range", 0, count) | |
case osc.Message("/get.reply", 2, info @ _*) => | |
marks = info.sliding(1, 2).flatten.collect { | |
case p: Int => p.toLong | |
} .toVector | |
println(marks.size) | |
case other => println(s"Not handled: $other") | |
} | |
c.connect() | |
c ! osc.Message("/doc/active/markers", "query", 1, "count") | |
marks // result |
markers are now (1.4.2) also printed via Debug > Dump Region Structure.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TCP variant