[gcompris/gcomprismusic] Desktop file changed to be used dynamically



commit 4a3bfb45762841aa5d245d80647259363323629c
Author: Karthik Subramanian <itskarthik s gmail com>
Date:   Sat Jul 16 11:35:06 2011 +0530

    Desktop file changed to be used dynamically

 .../resources/singalong/activity.desktop           |  329 ++++++++++----------
 src/singalong-activity/singalong.py                |    8 +-
 2 files changed, 169 insertions(+), 168 deletions(-)
---
diff --git a/src/singalong-activity/resources/singalong/activity.desktop b/src/singalong-activity/resources/singalong/activity.desktop
index fb2ea8a..80cc7e9 100644
--- a/src/singalong-activity/resources/singalong/activity.desktop
+++ b/src/singalong-activity/resources/singalong/activity.desktop
@@ -1,168 +1,167 @@
-[twinklesong]
-0 = ..
-1 = Twinkle
-2 = Twinkle
-3 = Twinkle
-4 = Twinkle
-5 = Little
-6 = Little
-7 = Star
-8 = ..
-9 = How I
-10 = How I
-11 = Wonder
-12 = Wonder
-13 = What you
-14 = What You
-15 = Are
-16 = ..
-17 = Up above the
-18 = Up above the
-19 = Up above the
-20 = Up above the
-21 = World so
-22 = World so
-23 = High
-24 = ..
-25 = Like a
-26 = Like a
-27 = Diamond
-28 = Diamond
-29 = in the
-30 = in the
-31 = sky
-32 = ..
-33 = Twinkle
-34 = Twinkle
-35 = Twinkle
-36 = Twinkle
-37 = Little
-38 = Little
-39 = Star
-40 = ..
-41 = How I
-42 = How I
-43 = Wonder
-44 = Wonder
-45 = What you
-46 = What You
-47 = Are
+[1]
 
-[twinklenotes]
-len = 48
-0 = X
-1 = C
-2 = C
-3 = G
-4 = G
-5 = A
-6 = A
-7 = G 
-8 = X
-9 = F
-10 = F
-11 = E
-12 = E
-13 = D
-14 = D
-15 = C
-16 = X
-17 = G
-18 = G
-19 = F
-20 = F
-21 = E
-22 = E
-23 = D
-24 = X
-25 = G
-26 = G
-27 = F
-28 = F
-29 = E
-30 = E
-31 = D
-32 = X
-33 = C
-34 = C
-35 = G
-36 = G
-37 = A
-38 = A
-39 = G
-40 = X
-41 = F
-42 = F
-43 = E
-44 = E
-45 = D
-46 = D
-47 = C
+song_name = Twinkle Twinkle little star
+notes_len = 48
+song_0 = ..
+song_1 = Twinkle
+song_2 = Twinkle
+song_3 = Twinkle
+song_4 = Twinkle
+song_5 = Little
+song_6 = Little
+song_7 = Star
+song_8 = ..
+song_9 = How I
+song_10 = How I
+song_11 = Wonder
+song_12 = Wonder
+song_13 = What you
+song_14 = What you
+song_15 = Are
+song_16 = ..
+song_17 = Up above the
+song_18 = Up above the
+song_19 = Up above the
+song_20 = Up above the
+song_21 = World so
+song_22 = World so
+song_23 = High
+song_24 = ..
+song_25 = Like a
+song_26 = Like a
+song_27 = Diamond
+song_28 = Diamond
+song_29 = in the
+song_30 = in the
+song_31 = sky
+song_32 = ..
+song_33 = Twinkle
+song_34 = Twinkle
+song_35 = Twinkle
+song_36 = Twinkle
+song_37 = Little
+song_38 = Little
+song_39 = Star
+song_40 = ..
+song_41 = How I
+song_42 = How I
+song_43 = Wonder
+song_44 = Wonder
+song_45 = What you
+song_46 = What you
+song_47 = Are
+note_0 = X
+note_1 = C
+note_2 = C
+note_3 = G
+note_4 = G
+note_5 = A
+note_6 = A
+note_7 = G 
+note_8 = X
+note_9 = F
+note_10 = F
+note_11 = E
+note_12 = E
+note_13 = D
+note_14 = D
+note_15 = C
+note_16 = X
+note_17 = G
+note_18 = G
+note_19 = F
+note_20 = F
+note_21 = E
+note_22 = E
+note_23 = D
+note_24 = X
+note_25 = G
+note_26 = G
+note_27 = F
+note_28 = F
+note_29 = E
+note_30 = E
+note_31 = D
+note_32 = X
+note_33 = C
+note_34 = C
+note_35 = G
+note_36 = G
+note_37 = A
+note_38 = A
+note_39 = G
+note_40 = X
+note_41 = F
+note_42 = F
+note_43 = E
+note_44 = E
+note_45 = D
+note_46 = D
+note_47 = C
 
 
-[londonsong]
-0 = ..
-1 = London
-2 = London
-3 = Bridge 
-4 = is
-5 = Falling
-6 = Falling
-7 = Down 
-8 = ..
-9 = Falling
-10 = Falling
-11 = Down
-12 = ..
-13 = Falling
-14 = Falling
-15 = Down
-16 = ..
-17 = London
-18 = London
-19 = Bridge
-20 = is
-21 = Falling
-22 = Falling
-23 = Down
-24 = ..
-25 = My
-26 = ..
-27 = Fair
-28 = ..
-29 = Lady
-30 = Lady
-
-[londonnotes]
-len = 31
-0 = X
-1 = G
-2 = A
-3 = G
-4 = F
-5 = E
-6 = F
-7 = G 
-8 = X
-9 = D
-10 = E
-11 = F
-12 = X
-13 = E
-14 = F
-15 = G
-16 = X
-17 = G
-18 = A
-19 = G
-20 = F
-21 = E
-22 = F
-23 = G
-24 = X
-25 = D
-26 = X
-27 = G
-28 = X
-29 = E
-30 = C
+[2]
+song_name = London Bridge is falling down
+notes_len = 31 
+song_0 = ..
+song_1 = London
+song_2 = London
+song_3 = Bridge 
+song_4 = is
+song_5 = Falling
+song_6 = Falling
+song_7 = Down 
+song_8 = ..
+song_9 = Falling
+song_10 = Falling
+song_11 = Down
+song_12 = ..
+song_13 = Falling
+song_14 = Falling
+song_15 = Down
+song_16 = ..
+song_17 = London
+song_18 = London
+song_19 = Bridge
+song_20 = is
+song_21 = Falling
+song_22 = Falling
+song_23 = Down
+song_24 = ..
+song_25 = My
+song_26 = ..
+song_27 = Fair
+song_28 = ..
+song_29 = Lady
+song_30 = Lady
+note_0 = X
+note_1 = G
+note_2 = A
+note_3 = G
+note_4 = F
+note_5 = E
+note_6 = F
+note_7 = G 
+note_8 = X
+note_9 = D
+note_10 = E
+note_11 = F
+note_12 = X
+note_13 = E
+note_14 = F
+note_15 = G
+note_16 = X
+note_17 = G
+note_18 = A
+note_19 = G
+note_20 = F
+note_21 = E
+note_22 = F
+note_23 = G
+note_24 = X
+note_25 = D
+note_26 = X
+note_27 = G
+note_28 = X
+note_29 = E
+note_30 = C
diff --git a/src/singalong-activity/singalong.py b/src/singalong-activity/singalong.py
index 9eedabd..79bd0e2 100644
--- a/src/singalong-activity/singalong.py
+++ b/src/singalong-activity/singalong.py
@@ -138,6 +138,7 @@ class Gcompris_singalong:
   
   def play_again(self, item, event, attr):
     self.count = 0
+    self.pause(1)
     self.play_song()
       
   def read_data(self):
@@ -169,17 +170,18 @@ class Gcompris_singalong:
 
   def timer_loop(self):
     self.status_timer = self.status_timer - 1
-    length = int(self.lyrics_dataset.get(self.currentsong+'notes','len'))
+    
+    length = int(self.lyrics_dataset.get(str(self.gcomprisBoard.level), 'notes_len'))
     if(self.status_timer == 0 and self.count < length-1):
       self.status_timer = self.delay
       self.count+=1
-      note = self.lyrics_dataset.get(self.currentsong+'notes',str(self.count))
+      note = self.lyrics_dataset.get(str(self.gcomprisBoard.level),'note_'+str(self.count))
       if note != 'X':     
         self.notetext.props.text = note
         self.notetext.props.x = int(self.mapping[note]) + 30
         self.ball.props.visibility = goocanvas.ITEM_INVISIBLE
         self.ball.props.x = int(self.mapping[note])
-        self.songlyrics.props.text = self.lyrics_dataset.get(self.currentsong+"song",str(self.count))
+        self.songlyrics.props.text = self.lyrics_dataset.get(str(self.gcomprisBoard.level), 'song_'+str(self.count))
         print self.ball.props.x
         self.ball.props.visibility = goocanvas.ITEM_VISIBLE
         gcompris.sound.play_ogg('singalong/'+note+'.wav')



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]