Commits

Vladimir Kolev committed c425f03

Synchronisation with the repo

Comments (0)

Files changed (3)

data/gsharkdown.ini

 show_stat_icon = 0
 repeat_playlist = 1
 shuffle_playlist = 0
-completition = Roni Size|Eminem|Madonna|Skillet|DMX|Dr. Dre|Ceca|Ceca Velickovic|Syrenia|Within temptation|Lady Gaga|EMinem|Beatles|Scorpions|Deep Purple|
+completition = Roni Size|Eminem|Madonna|Skillet|DMX|Dr. Dre|Ceca|Ceca Velickovic|Syrenia|Within temptation|Lady Gaga|EMinem|Beatles|Scorpions|Deep Purple|Na Inat|
         Plays the next item from the playlist
         """
         if self.playing == None:
+            print "starting at the start"
             self.play_selected(self.play_button)
         else:
             index = self.playing + 1
                 self.player.set_state(gst.STATE_NULL)
                 song = self.playitems[index]
                 self.set_songinfos(song)
-                t = t_play(self, song)
+                t = t_play(self, song, int(CONFIG['repeat_playlist']))
                 t.start()
 
     def play_previous(self, widget, data=None):
                     self.player.set_state(gst.STATE_NULL)
                     song = self.playitems[len(self.playitems) - 1]
                     self.set_songinfos(song)
-                    t = t_play(self, song)
+                    t = t_play(self, song, int(CONFIG['repeat_playlist']))
                     t.start()
                 else:
                     self.player.set_state(gst.STATE_NULL)
                 self.player.set_state(gst.STATE_NULL)
                 song = self.playitems[index]
                 self.set_songinfos(song)
-                t = t_play(self, song)
+                t = t_play(self, song, int(CONFIG['repeat_playlist']))
                 t.start()
 
     def on_volume_change(self, widget, data=0.5):
                 song = self.playitems[0]
                 self.set_songinfos(song)
                 self.playing = 0
-                t = t_play(self, song)
+                t = t_play(self, song, int(CONFIG['repeat_playlist']))
                 t.start()
         else:
             self.player.set_state(gst.STATE_NULL)
     print "You don't have python-gstreamer installed!"
     sys.exit(0)
 
-try:
-    from configobj import ConfigObj
-except:
-    print "You don't have python-configobj installed!"
-    sys.exit()
-
 basepath = os.path.abspath(os.path.dirname(sys.argv[0]).strip("/lib"))
 
-config = ConfigObj("%s/data/gsharkdown.ini" % basepath)
-
 
 class t_init(threading.Thread):
     def __init__(self, _frame):
 
 class t_play(threading.Thread):
 
-    def __init__(self, _window, _song):
+    def __init__(self, _window, _song, _conf):
         threading.Thread.__init__(self)
         self.win = _window
         self.songid = _song["SongID"]
+        self.repeat = _conf
 
     def run(self):
         try:
             self.update_buttons(new)
         return gst.BUS_PASS
 
-    def on_stopped(self, widget=None, data=None):
-        if int(config['repeat_playlist']) == 1:
+    def on_stopped(self, config, widget=None, data=None):
+        if self.repeat == 1:
             self.win.playing = None
             self.win.play_next(self.win.ff_button)
         else: