added a rewind on desync option
This commit is contained in:
parent
e570f86c0f
commit
7edb78295c
@ -209,7 +209,7 @@ class SyncplayClient(object):
|
||||
self._lastGlobalUpdate = time.time()
|
||||
if (doSeek):
|
||||
madeChangeOnPlayer = self._serverSeeked(position, setBy)
|
||||
if (diff > constants.REWIND_THRESHOLD and not doSeek):
|
||||
if (diff > constants.REWIND_THRESHOLD and not doSeek and not self._config['rewindOnDesync'] == False):
|
||||
madeChangeOnPlayer = self._rewindPlayerDueToTimeDifference(position, setBy)
|
||||
if (self._player.speedSupported and not doSeek and not paused and not self._config['slowOnDesync'] == False):
|
||||
madeChangeOnPlayer = self._slowDownToCoverTimeDifference(diff, setBy)
|
||||
|
||||
@ -34,6 +34,7 @@ class ConfigurationGetter(object):
|
||||
"playerArgs": [],
|
||||
"playerClass": None,
|
||||
"slowOnDesync": True,
|
||||
"rewindOnDesync": True,
|
||||
"malUsername": "",
|
||||
"malPassword": ""
|
||||
}
|
||||
@ -55,12 +56,13 @@ class ConfigurationGetter(object):
|
||||
"forceGuiPrompt",
|
||||
"noGui",
|
||||
"noStore",
|
||||
"slowOnDesync"
|
||||
"slowOnDesync",
|
||||
"rewindOnDesync"
|
||||
]
|
||||
|
||||
self._iniStructure = {
|
||||
"server_data": ["host", "port", "password"],
|
||||
"client_settings": ["name", "room", "playerPath", "slowOnDesync", "forceGuiPrompt"],
|
||||
"client_settings": ["name", "room", "playerPath", "slowOnDesync", "rewindOnDesync", "forceGuiPrompt"],
|
||||
"mal": ["malPassword", "malUsername"]
|
||||
}
|
||||
|
||||
|
||||
@ -169,6 +169,10 @@ class ConfigDialog(QtGui.QDialog):
|
||||
self.config['slowOnDesync'] = True
|
||||
else:
|
||||
self.config['slowOnDesync'] = False
|
||||
if self.rewindCheckbox.isChecked() == True:
|
||||
self.config['rewindOnDesync'] = True
|
||||
else:
|
||||
self.config['rewindOnDesync'] = False
|
||||
self.config['malUsername'] = self.malusernameTextbox.text()
|
||||
if self.malSettingsGroup.isChecked():
|
||||
self.config['malPassword'] = self.malpasswordTextbox.text()
|
||||
@ -261,6 +265,7 @@ class ConfigDialog(QtGui.QDialog):
|
||||
self.mediabrowseButton = QtGui.QPushButton(QtGui.QIcon(resourcespath + 'folder_explore.png'),"Browse")
|
||||
self.mediabrowseButton.clicked.connect(self.browseMediapath)
|
||||
self.slowdownCheckbox = QCheckBox("Slow down on desync")
|
||||
self.rewindCheckbox = QCheckBox("Rewind on desync")
|
||||
self.mediaplayerSettingsLayout = QtGui.QGridLayout()
|
||||
self.mediaplayerSettingsLayout.addWidget(self.executablepathLabel, 0, 0)
|
||||
self.mediaplayerSettingsLayout.addWidget(self.executablepathCombobox , 0, 1)
|
||||
@ -269,9 +274,12 @@ class ConfigDialog(QtGui.QDialog):
|
||||
self.mediaplayerSettingsLayout.addWidget(self.mediapathTextbox , 1, 1)
|
||||
self.mediaplayerSettingsLayout.addWidget(self.mediabrowseButton , 1, 2)
|
||||
self.mediaplayerSettingsLayout.addWidget(self.slowdownCheckbox, 2, 0)
|
||||
self.mediaplayerSettingsLayout.addWidget(self.rewindCheckbox, 3, 0)
|
||||
self.mediaplayerSettingsGroup.setLayout(self.mediaplayerSettingsLayout)
|
||||
if config['slowOnDesync'] == True:
|
||||
self.slowdownCheckbox.setChecked(True)
|
||||
if config['rewindOnDesync'] == True:
|
||||
self.rewindCheckbox.setChecked(True)
|
||||
|
||||
self.malSettingsGroup = QtGui.QGroupBox("Enable MyAnimeList updater (EXPERIMENTAL)")
|
||||
self.malSettingsGroup.setCheckable(True)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user