mirror of
https://github.com/cyberboy666/r_e_c_u_r.git
synced 2025-12-05 16:00:06 +01:00
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:
26
actions.py
26
actions.py
@@ -112,11 +112,33 @@ class Actions(object):
|
|||||||
elif self.data.player_mode == 'next':
|
elif self.data.player_mode == 'next':
|
||||||
self.video_driver.next_player.toggle_show()
|
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):
|
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):
|
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):
|
def toggle_function(self):
|
||||||
self.data.function_on = not self.data.function_on
|
self.data.function_on = not self.data.function_on
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"a": {
|
"a": {
|
||||||
"NAV_BROWSER": ["move_browser_selection_up"],
|
"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"],
|
"NAV_SETTINGS": ["move_settings_selection_up"],
|
||||||
"LENGTH_SET": ["return_to_default_control_mode"]
|
"LENGTH_SET": ["return_to_default_control_mode"]
|
||||||
},
|
},
|
||||||
"b": {
|
"b": {
|
||||||
"NAV_BROWSER": ["move_browser_selection_down"],
|
"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"],
|
"NAV_SETTINGS": ["move_settings_selection_down"],
|
||||||
"LENGTH_SET": ["return_to_default_control_mode"]
|
"LENGTH_SET": ["return_to_default_control_mode"]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -198,7 +198,19 @@
|
|||||||
"off"
|
"off"
|
||||||
],
|
],
|
||||||
"value": "off"
|
"value": "off"
|
||||||
}
|
},
|
||||||
|
"SEEK_TIME_JUMP": {
|
||||||
|
"action": null,
|
||||||
|
"options": [
|
||||||
|
0.5,
|
||||||
|
1,
|
||||||
|
5,
|
||||||
|
10,
|
||||||
|
30
|
||||||
|
],
|
||||||
|
"value": 5,
|
||||||
|
"seconds": 30
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"video": {
|
"video": {
|
||||||
"BACKGROUND_COLOUR": {
|
"BACKGROUND_COLOUR": {
|
||||||
|
|||||||
Reference in New Issue
Block a user