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"))
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)
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)
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
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")
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"))
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)