From d56ef5f64ee19976a93b40f354a203c6d427db99 Mon Sep 17 00:00:00 2001 From: jakob Date: Tue, 20 Aug 2019 13:34:49 +0200 Subject: [PATCH] Exclude single-track-types from normal loop & Blacken --- campatmo.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/campatmo.py b/campatmo.py index 4720a8a..d26783b 100755 --- a/campatmo.py +++ b/campatmo.py @@ -34,7 +34,9 @@ class CampAtmo: v(f"{mixer.get_num_channels()} channels set") for name in type_files: self.types[name] = [] - for k in range(1 if name in self.single_track_types else self.tracks_per_type): + for k in range( + 1 if name in self.single_track_types else self.tracks_per_type + ): self.types[name].append(mixer.Channel(i)) i += 1 self.sounds = {} @@ -69,7 +71,7 @@ class CampAtmo: def run_forever(self): while True: for name, type_channels in self.types.items(): - if len(self.sounds[name]) == 0: + if len(self.sounds[name]) == 0 or name in self.single_track_types: continue self.manage_type_queue(name, type_channels) time.sleep(1)