Example #1
0
        def recordLoopFlag(evt):
            """ record the loopflag position """

            evt.Skip()
            # send player status change to player thread
            data = self.getPanelSettings()
            PLAYERMANAGER.put(data)
            # save loopflag to configuration file
            GSMCONF.set("playercontrol", "loopflag", evt.IsChecked())
Example #2
0
    def OnForward(self, evt):
        """ forward a bit """

        maxval = self.rightpost.GetValue()
        curval = self.progres.GetValue()

        # forward 10 frames with cognizance of current maximum value
        if curval + SKIPVAL <= maxval:
            self.progres.SetValue(curval + SKIPVAL)
        else:
            return
            
        data = self.getPanelSettings()
        data["progres"] = curval + SKIPVAL
        PLAYERMANAGER.put(data)
Example #3
0
    def OnBackward(self, evt):
        """ rewind a bit """
        
        minval = self.leftpost.GetValue()
        curval = self.progres.GetValue()

        # rewind 10 frames with cognizance of current minimum value
        if curval - SKIPVAL >= minval:
            self.progres.SetValue(curval - SKIPVAL)
        else:
            return
        
        data = self.getPanelSettings()
        data["progres"] = curval - SKIPVAL
        PLAYERMANAGER.put(data)
Example #4
0
    def OnPlay(self, evt):
        """ Play btn pressed"""

        # if previously paused, continue at last play point
        if self.paused:
            PLAYERMANAGER.put({"pause":False})
            self.paused = False
            return
            
        self.progres.SetValue(0)

        panel = Registry.get("SELECT_LIST_PANEL")
        if not panel: return
        
        selection = panel.slist.GetSelection()
        tablename = panel.slist.tablename
        
        # for play btn play firs in selection
        if len(selection) == 0:            
            return
        
        item, oid = selection[0]  
        PLAYERMANAGER.PlaySelection(tablename, oid, immediate=True)
Example #5
0
    def OnScroll(self, evt):
        """ handle end of scroll events"""

        # lock the volume controls if asked to
        vollist = [self.leftvol, self.rightvol]
        if evt.GetEventObject() in vollist:
            if self.vollockCB.GetValue() == True:
                val = evt.GetEventObject().GetValue()
                for o in vollist:
                    o.SetValue(val)


        # fence the progress controll in
        if evt.GetEventObject() == self.progres:
            maxval = self.rightpost.GetValue()
            minval = self.leftpost.GetValue()
            val = self.progres.GetValue()
            if val >= maxval: self.progres.SetValue(maxval)                
            if val <= minval: self.progres.SetValue(minval)                


        # fencing controll            
        if evt.GetEventObject() == self.leftpost:
            if self.leftpost.GetValue() >= self.rightpost.GetValue():
                self.rightpost.SetValue(self.leftpost.GetValue())
            if self.progres.GetValue() <=  self.leftpost.GetValue():
                self.progres.SetValue(self.leftpost.GetValue())
                
        if evt.GetEventObject() == self.rightpost:
            if self.rightpost.GetValue() <= self.leftpost.GetValue():
                self.leftpost.SetValue(self.rightpost.GetValue())
            if self.progres.GetValue() >=  self.rightpost.GetValue():
                self.progres.SetValue(self.rightpost.GetValue())

        data = self.getPanelSettings()
        PLAYERMANAGER.put(data)
Example #6
0
    def OnPause(self, evt):
        """ Pause btn pressed"""

        PLAYERMANAGER.put({"pause":True})
        self.paused = True
Example #7
0
    def OnStop(self, evt):
        """ Stop btn pressed"""

        self.progres.SetValue(0)
        PLAYERMANAGER.put({"stop":True})