Exclude single-track-types from normal loop & Blacken

This commit is contained in:
Jakob 2019-08-20 13:34:49 +02:00
parent d4765556fc
commit d56ef5f64e
1 changed files with 4 additions and 2 deletions

View File

@ -34,7 +34,9 @@ class CampAtmo:
v(f"{mixer.get_num_channels()} channels set") v(f"{mixer.get_num_channels()} channels set")
for name in type_files: for name in type_files:
self.types[name] = [] 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)) self.types[name].append(mixer.Channel(i))
i += 1 i += 1
self.sounds = {} self.sounds = {}
@ -69,7 +71,7 @@ class CampAtmo:
def run_forever(self): def run_forever(self):
while True: while True:
for name, type_channels in self.types.items(): 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 continue
self.manage_type_queue(name, type_channels) self.manage_type_queue(name, type_channels)
time.sleep(1) time.sleep(1)