Ejemplo n.º 1
0
 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"))
Ejemplo n.º 2
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)
Ejemplo n.º 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)
Ejemplo n.º 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 
Ejemplo n.º 5
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.showErrorMessage("Invalid offset value")
Ejemplo n.º 6
0
 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"))
Ejemplo n.º 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)