8000 Track: Return send index from /live/track/get/send · steeltrack/AbletonOSC@3f45fca · GitHub
[go: up one dir, main page]

Skip to content

Commit

Permalink
Track: Return send index from /live/track/get/send
Browse files Browse the repository at this point in the history
  • Loading branch information
ideoforms committed Jan 7, 2024
1 parent a7b98d9 commit 3f45fca
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ To query the properties of multiple tracks, see [Song: Properties of cue points,
| /live/track/get/name | track_id | track_id, name | Query track name |
| /live/track/get/panning | track_id | track_id, panning | Query track panning |
| /live/track/get/playing_slot_index | track_id | track_id, index | Query currently-playing slot |
| /live/track/get/send | track_id, send_id | track_id, value | Query track send |
| /live/track/get/send | track_id, send_id | track_id, send_id, value | Query track send |
| /live/track/get/solo | track_id | track_id, solo | Query track solo on/off |
| /live/track/get/volume | track_id | track_id, volume | Query track volume |

Expand Down
2 changes: 1 addition & 1 deletion abletonosc/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def track_callback(params: Tuple[Any]):
# Might want to find a better approach that unifies volume and sends
def track_get_send(track, params: Tuple[Any] = ()):
send_id, = params
return track.mixer_device.sends[send_id].value,
return send_id, track.mixer_device.sends[send_id].value

def track_set_send(track, params: Tuple[Any] = ()):
send_id, value = params
Expand Down
22 changes: 13 additions & 9 deletions
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@
import pytest
import itertools

def test_track_get_send(client):
track_id = 2
send_id = 1

for value in [0.5, 0.0]:
client.send_message("/live/track/set/send", [track_id, send_id, value])
wait_one_tick()
assert client.query("/live/track/get/send", (track_id, send_id)) == (track_id, value,)

#--------------------------------------------------------------------------------
# Test track properties
#--------------------------------------------------------------------------------
Expand Down Expand Up @@ -41,6 +32,19 @@ def test_track_property_solo(client):
def test_track_property_name(client):
_test_track_property(client, 2, "name", ["Test", "Track"])

#--------------------------------------------------------------------------------
# Test track properties - sends
#--------------------------------------------------------------------------------

def test_track_get_send(client):
track_id = 2
send_id = 1

for value in [0.5, 0.0]:
client.send_message("/live/track/set/send", [track_id, send_id, value])
wait_one_tick()
assert client.query("/live/track/get/send", (track_id, send_id)) == (track_id, send_id, value,)

#--------------------------------------------------------------------------------
# Test track properties - clips
#--------------------------------------------------------------------------------
Expand Down

0 comments on commit 3f45fca

Please sign in to comment.
0