Seek Time Adjustment

Added mapping and action to change the seek time using fn + </>.
Parameter added to the sampler settings called SEEK_TIME_JUMP. This parameter sets how much the seek time is adjusted by each time fn + </> is pressed. SEEK_TIME_JUMP also stores the custom seek time.
This commit is contained in:
TanSaturn
2018-10-17 23:30:06 -07:00
parent fa92acca63
commit 9f9f07b2d6
4 changed files with 39 additions and 5 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -112,11 +112,33 @@ class Actions(object):
elif self.data.player_mode == 'next':
self.video_driver.next_player.toggle_show()
def increase_seek_time(self):
seek_time = self.data.settings['sampler']['SEEK_TIME_JUMP']['seconds']
jump = self.data.settings['sampler']['SEEK_TIME_JUMP']['value']
if seek_time < 60:
seek_time += jump
else:
seek_time = 0.5
self.data.settings['sampler']['SEEK_TIME_JUMP']['seconds'] = seek_time
self.message_handler.set_message('INFO', 'The Seek Time is now ' + str(seek_time) + 's')
def decrease_seek_time(self):
seek_time = self.data.settings['sampler']['SEEK_TIME_JUMP']['seconds']
jump = self.data.settings['sampler']['SEEK_TIME_JUMP']['value']
if seek_time > 0.5:
seek_time -= jump
else:
seek_time = 0.5
self.data.settings['sampler']['SEEK_TIME_JUMP']['seconds'] = seek_time
self.message_handler.set_message('INFO', 'The Seek Time is now ' + str(seek_time) + 's')
def seek_forward_on_player(self):
self.video_driver.current_player.seek(30)
self.video_driver.current_player.seek(self.data.settings['sampler']['SEEK_TIME_JUMP']['seconds'])
def seek_back_on_player(self):
self.video_driver.current_player.seek(-30)
self.video_driver.current_player.seek(-(self.data.settings['sampler']['SEEK_TIME_JUMP']['seconds']))
def toggle_function(self):
self.data.function_on = not self.data.function_on

View File

@@ -1,13 +1,13 @@
{
"a": {
"NAV_BROWSER": ["move_browser_selection_up"],
"PLAYER": ["seek_back_on_player"],
"PLAYER": ["seek_back_on_player", "decrease_seek_time"],
"NAV_SETTINGS": ["move_settings_selection_up"],
"LENGTH_SET": ["return_to_default_control_mode"]
},
"b": {
"NAV_BROWSER": ["move_browser_selection_down"],
"PLAYER": ["seek_forward_on_player"],
"PLAYER": ["seek_forward_on_player", "increase_seek_time"],
"NAV_SETTINGS": ["move_settings_selection_down"],
"LENGTH_SET": ["return_to_default_control_mode"]
},

View File

@@ -198,7 +198,19 @@
"off"
],
"value": "off"
}
},
"SEEK_TIME_JUMP": {
"action": null,
"options": [
0.5,
1,
5,
10,
30
],
"value": 5,
"seconds": 30
}
},
"video": {
"BACKGROUND_COLOUR": {