aboutsummaryrefslogtreecommitdiff
path: root/helpers/music_file.py
diff options
context:
space:
mode:
Diffstat (limited to 'helpers/music_file.py')
-rw-r--r--helpers/music_file.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/helpers/music_file.py b/helpers/music_file.py
index a37a708..cff897a 100644
--- a/helpers/music_file.py
+++ b/helpers/music_file.py
@@ -128,7 +128,10 @@ class MusicFile(Machine):
128 self.set_gain(gain(volume) + self.mapping.master_gain, absolute=True) 128 self.set_gain(gain(volume) + self.mapping.master_gain, absolute=True)
129 self.volume = volume 129 self.volume = volume
130 self.current_loop = 0 130 self.current_loop = 0
131 self.loop_left = loop 131 if loop < 0:
132 self.last_loop = float('inf')
133 else:
134 self.last_loop = loop
132 135
133 with self.music_lock: 136 with self.music_lock:
134 self.current_audio_segment = self.audio_segment 137 self.current_audio_segment = self.audio_segment
@@ -166,8 +169,8 @@ class MusicFile(Machine):
166 with self.music_lock: 169 with self.music_lock:
167 [data, nb_frames] = self.get_next_sample(frame_count) 170 [data, nb_frames] = self.get_next_sample(frame_count)
168 if nb_frames < frame_count: 171 if nb_frames < frame_count:
169 if self.is_loaded_playing() and self.loop_left != 0: 172 if self.is_loaded_playing() and\
170 self.loop_left -= 1 173 self.current_loop < self.last_loop:
171 self.current_loop += 1 174 self.current_loop += 1
172 self.current_frame = 0 175 self.current_frame = 0
173 [new_data, new_nb_frames] = self.get_next_sample( 176 [new_data, new_nb_frames] = self.get_next_sample(