Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prevent crash on sound_player with placeholder
- Loading branch information
Showing
5 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#config_version=5 | ||
sound_system: | ||
buffer: 2048 | ||
frequency: 44100 | ||
channels: 2 | ||
master_volume: 0.9 | ||
tracks: | ||
music: | ||
volume: 0.5 | ||
simultaneous_sounds: 1 | ||
sfx: | ||
volume: 0.4 | ||
simultaneous_sounds: 8 | ||
preload: yes | ||
voice: | ||
volume: 0.6 | ||
simultaneous_sounds: 1 | ||
preload: yes | ||
|
||
assets: | ||
sounds: | ||
default: | ||
load: preload | ||
voice: | ||
load: preload | ||
track: voice | ||
sfx: | ||
load: preload | ||
track: sfx | ||
music: | ||
load: on_demand | ||
track: music | ||
loops: | ||
load: preload | ||
track: sfx | ||
playlist: | ||
load: on_demand | ||
track: sfx | ||
|
||
sound_player: | ||
machine_var_factory_reset_current_selection{machine.factory_reset_current_selection==2}: 210871_synthping |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
All sounds used in these tests were downloaded from www.freesound.org and are licensed under the | ||
Create Commons 0 License (http://creativecommons.org/publicdomain/zero/1.0/). |
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from mpfmc.tests.MpfIntegrationTestCase import MpfIntegrationTestCase | ||
|
||
|
||
class TestSound(MpfIntegrationTestCase): | ||
|
||
def get_machine_path(self): | ||
return 'integration/machine_files/sound' | ||
|
||
def get_config_file(self): | ||
return 'config.yaml' | ||
|
||
def test_sound_player_with_conditionals(self): | ||
self.machine.variables.set_machine_var("factory_reset_current_selection", 1) | ||
self.mock_mc_event("sounds_play") | ||
self.advance_time_and_run(1) | ||
self.assertMcEventNotCalled("sounds_play") | ||
self.machine.variables.set_machine_var("factory_reset_current_selection", 2) | ||
self.advance_time_and_run(1) | ||
self.assertMcEventCalled("sounds_play") |