[gcompris] gcomprismusic, now playcomposition is not recursive
- From: Bruno Coudoin <bcoudoin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcompris] gcomprismusic, now playcomposition is not recursive
- Date: Mon, 17 Sep 2012 23:16:02 +0000 (UTC)
commit 5aa591069ede6a958ac5a0820eac0537eadd3a55
Author: Bruno Coudoin <bruno coudoin free fr>
Date: Tue Sep 18 01:14:01 2012 +0200
gcomprismusic, now playcomposition is not recursive
It was possible for the children to call several times playcomposition()
which was resulting in having the music play several times creating a real
mess.
src/piano_composition-activity/gcomprismusic.py | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/piano_composition-activity/gcomprismusic.py b/src/piano_composition-activity/gcomprismusic.py
index bdfc64b..38acf98 100644
--- a/src/piano_composition-activity/gcomprismusic.py
+++ b/src/piano_composition-activity/gcomprismusic.py
@@ -466,9 +466,9 @@ class Staff():
'''
if noteIndexToPlay >= len(self.noteList):
+ self.notReadyToPlay = False
if hasattr(self, 'verticalPlayLine'):
self.verticalPlayLine.remove()
- self.notReadyToPlay = False
return
note = self.noteList[noteIndexToPlay]
@@ -501,8 +501,9 @@ class Staff():
>>> self.newStaff.playComposition()
'''
- #if not self.noteList or self.notReadyToPlay:
- # return
+ if not self.noteList or self.notReadyToPlay:
+ return
+
self.notReadyToPlay = True
self.timers = []
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]