예제 #1
0
파일: gui.py 프로젝트: SLKTH/syncplay
 def seekPosition(self, seekTime):
     s = re.match(constants.UI_SEEK_REGEX, seekTime)
     if s:
         sign = self._extractSign(s.group('sign'))
         t = utils.parseTime(s.group('time'))
         if t is None:
             return
         if sign:
             t = self._syncplayClient.getGlobalPosition() + sign * t
         self._syncplayClient.setPosition(t)
     else:
         self.showErrorMessage(getMessage("invalid-seek-value"))
예제 #2
0
파일: gui.py 프로젝트: blaenk/syncplay
    def seekPosition(self):
        s = re.match(constants.UI_SEEK_REGEX, self.seekInput.text())
        if(s):
            sign = self._extractSign(s.group('sign'))
            t = utils.parseTime(s.group('time'))
            if(t is None):
                return
            if(sign):
                t = self._syncplayClient.getGlobalPosition() + sign * t 
            self._syncplayClient.setPosition(t)

        else:
            self.showMessage("Invalid seek value", True)
예제 #3
0
    def seekPosition(self):
        s = re.match(constants.UI_SEEK_REGEX, self.seekInput.text())
        if (s):
            sign = self._extractSign(s.group('sign'))
            t = utils.parseTime(s.group('time'))
            if (t is None):
                return
            if (sign):
                t = self._syncplayClient.getGlobalPosition() + sign * t
            self._syncplayClient.setPosition(t)

        else:
            self.showMessage("Invalid seek value", True)
예제 #4
0
 def _tryAdvancedCommands(self, data):
     o = re.match(constants.UI_OFFSET_REGEX, data)
     s = re.match(constants.UI_SEEK_REGEX, data)
     if(o):
         sign = self._extractSign(o.group('sign'))
         t = utils.parseTime(o.group('time'))
         if(t is None):
             return
         if (o.group('sign') == "/"):
                 t =  self._syncplayClient.getPlayerPosition() - t
         elif(sign):
                 t = self._syncplayClient.getUserOffset() + sign * t
         self._syncplayClient.setUserOffset(t)
         return True
     elif s:
         sign = self._extractSign(s.group('sign'))
         t = utils.parseTime(s.group('time'))
         if(t is None):
             return
         if(sign):
             t = self._syncplayClient.getGlobalPosition() + sign * t 
         self._syncplayClient.setPosition(t)
         return True
     return False 
예제 #5
0
파일: gui.py 프로젝트: blaenk/syncplay
 def setOffset(self):
     newoffset, ok = QtGui.QInputDialog.getText(self,"Set offset",
             "Offset (see http://syncplay.pl/guide/ for usage instructions):", QtGui.QLineEdit.Normal,
             "")
     if ok and newoffset != '':
         o = re.match(constants.UI_OFFSET_REGEX, "o " + newoffset)
         if(o):
             sign = self._extractSign(o.group('sign'))
             t = utils.parseTime(o.group('time'))
             if(t is None):
                 return
             if (o.group('sign') == "/"):
                     t =  self._syncplayClient.getPlayerPosition() - t
             elif(sign):
                     t = self._syncplayClient.getUserOffset() + sign * t
             self._syncplayClient.setUserOffset(t)
         else:
             self.showErrorMessage("Invalid offset value")
예제 #6
0
파일: gui.py 프로젝트: SLKTH/syncplay
 def setOffset(self):
     newoffset, ok = QtGui.QInputDialog.getText(self, getMessage("setoffset-msgbox-label"),
                                                getMessage("offsetinfo-msgbox-label"), QtGui.QLineEdit.Normal,
                                                "")
     if ok and newoffset != '':
         o = re.match(constants.UI_OFFSET_REGEX, "o " + newoffset)
         if o:
             sign = self._extractSign(o.group('sign'))
             t = utils.parseTime(o.group('time'))
             if t is None:
                 return
             if o.group('sign') == "/":
                 t = self._syncplayClient.getPlayerPosition() - t
             elif sign:
                 t = self._syncplayClient.getUserOffset() + sign * t
             self._syncplayClient.setUserOffset(t)
         else:
             self.showErrorMessage(getMessage("invalid-offset-value"))
예제 #7
0
 def setOffset(self):
     newoffset, ok = QtGui.QInputDialog.getText(
         self, "Set offset",
         "Offset (see http://syncplay.pl/guide/ for usage instructions):",
         QtGui.QLineEdit.Normal, "")
     if ok and newoffset != '':
         o = re.match(constants.UI_OFFSET_REGEX, "o " + newoffset)
         if (o):
             sign = self._extractSign(o.group('sign'))
             t = utils.parseTime(o.group('time'))
             if (t is None):
                 return
             if (o.group('sign') == "/"):
                 t = self._syncplayClient.getPlayerPosition() - t
             elif (sign):
                 t = self._syncplayClient.getUserOffset() + sign * t
             self._syncplayClient.setUserOffset(t)
         else:
             self.showMessage("Invalid offset value", True)