Add audio and subtitle offset settings to prefs

This commit is contained in:
Rafostar
2020-11-20 21:19:23 +01:00
parent ac27c364f3
commit 7ccd6ad424
5 changed files with 70 additions and 4 deletions

View File

@@ -82,6 +82,8 @@ class ClapperPlayerBase extends GstPlayer.Player
{
let settingsToSet = [
'seeking-mode',
'audio-offset',
'subtitle-offset',
];
for(let key of settingsToSet)
@@ -176,6 +178,8 @@ class ClapperPlayerBase extends GstPlayer.Player
_onSettingsKeyChanged(settings, key)
{
let value;
switch(key) {
case 'seeking-mode':
let isSeekMode = (typeof this.set_seek_mode !== 'undefined');
@@ -219,6 +223,16 @@ class ClapperPlayerBase extends GstPlayer.Player
root[action + '_css_class'](cssClass);
}
break;
case 'audio-offset':
value = Math.round(settings.get_double(key) * -1000000);
this.set_audio_video_offset(value);
debug(`set audio-video offset: ${value}`);
break;
case 'subtitle-offset':
value = Math.round(settings.get_double(key) * -1000000);
this.set_subtitle_video_offset(value);
debug(`set subtitle-video offset: ${value}`);
break;
default:
break;
}