diff options
author | Eddy Pedroni <eddy@0xf7.com> | 2022-01-04 13:49:38 +0100 |
---|---|---|
committer | Eddy Pedroni <eddy@0xf7.com> | 2022-01-04 13:49:38 +0100 |
commit | edb2ffc66231702c931429ab44ad5009abb8c128 (patch) | |
tree | 6b1ad17f45aaf35a8cf0f3cedf03ac71c6611d6c /solo_tool_integrationtest.py | |
parent | 67f07cf01155b98321f590e3c18e378018c0a624 (diff) |
Added proper volume and playback rate feedback, changed volume steps in MIDI interface
Diffstat (limited to 'solo_tool_integrationtest.py')
-rw-r--r-- | solo_tool_integrationtest.py | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/solo_tool_integrationtest.py b/solo_tool_integrationtest.py index 117e539..98dd31b 100644 --- a/solo_tool_integrationtest.py +++ b/solo_tool_integrationtest.py @@ -291,6 +291,12 @@ def test_getters(uut, mockPlayer): mockPlayer.position = 0.8 assert uut.getPlaybackPosition() == 0.8 + mockPlayer.volume = 0.8 + assert uut.getPlaybackVolume() == 0.8 + + mockPlayer.rate = 0.5 + assert uut.getPlaybackRate() == 0.5 + def test_setTemporaryLimits(uut, mockPlayer): song = "test.flac" abLimits = [ @@ -359,3 +365,45 @@ def test_playingStateNotification(uut, mockPlayer): called = False uut.stop() assert not called + +def test_playbackVolumeNotification(uut, mockPlayer): + song = "test.flac" + uut.addSong(song) + uut.setSong(0) + + called = False + def callback(): + nonlocal called + called = True + + uut.registerPlaybackVolumeCallback(callback) + + assert not called + + uut.setPlaybackVolume(0.0) + assert called + called = False + + uut.setPlaybackVolume(0.0) + assert not called + +def test_playbackRateNotification(uut, mockPlayer): + song = "test.flac" + uut.addSong(song) + uut.setSong(0) + + called = False + def callback(): + nonlocal called + called = True + + uut.registerPlaybackRateCallback(callback) + + assert not called + + uut.setPlaybackRate(0.5) + assert called + called = False + + uut.setPlaybackRate(0.5) + assert not called |