| 7 | class Space(val r: RemoteServer) { |
| 8 | |
| 9 | inner class Layer(val name: String) { |
| 10 | |
| 11 | fun play(time: Double) { |
| 12 | r.execute("channelMap['$name'].LaudioElement.currentTime=$time; channelMap['$name'].LaudioElement.play()") |
| 13 | } |
| 14 | |
| 15 | fun play() { |
| 16 | r.execute(" channelMap['$name'].LaudioElement.play()") |
| 17 | } |
| 18 | |
| 19 | fun pause() { |
| 20 | r.execute(" channelMap['$name'].LaudioElement.pause()") |
| 21 | } |
| 22 | |
| 23 | fun position(x: Double, y: Double, z: Double) { |
| 24 | position(Vec3(x, y, z)) |
| 25 | } |
| 26 | |
| 27 | fun position(v: Vec3) { |
| 28 | r.execute("channelMap['$name'].Lsource.setPosition(${v.x},${-v.y},${v.z})") |
| 29 | } |
| 30 | |
| 31 | fun volume(v: Double) { |
| 32 | r.execute("channelMap['$name'].LaudioElement.volume=$v") |
| 33 | } |
| 34 | |
| 35 | fun loop(b: Boolean) { |
| 36 | r.execute("channelMap['$name'].LaudioElement.loop=$b") |
| 37 | } |
| 38 | |
| 39 | } |
| 40 | |
| 41 | /* |
| 42 | n.send("songbird.setListenerPosition(0,0,0)") |
| 43 | n.send("songbird.setListenerOrientation(0,1,0, 0,0,1)") |
| 44 | |
| 45 | |