From edb2ffc66231702c931429ab44ad5009abb8c128 Mon Sep 17 00:00:00 2001 From: Eddy Pedroni Date: Tue, 4 Jan 2022 13:49:38 +0100 Subject: Added proper volume and playback rate feedback, changed volume steps in MIDI interface --- solo_tool_integrationtest.py | 48 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'solo_tool_integrationtest.py') 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 -- cgit v1.2.3