-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.c
65 lines (56 loc) · 2.9 KB
/
setup.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//////////////////////////////////////////////////////////////////////////////
/// ///
/// This file is part of the VDR mpv plugin and licensed under AGPLv3 ///
/// ///
/// See the README file for copyright information ///
/// ///
//////////////////////////////////////////////////////////////////////////////
#include "setup.h"
#include "config.h"
cMpvPluginSetup::cMpvPluginSetup()
{
SetupHideMainMenuEntry = MpvPluginConfig->HideMainMenuEntry;
SetupUsePassthrough = MpvPluginConfig->UsePassthrough;
SetupUseDtsHdPassthrough = MpvPluginConfig->UseDtsHdPassthrough;
SetupPlaylistOnNextKey = MpvPluginConfig->PlaylistOnNextKey;
SetupPlaylistIfNoChapters = MpvPluginConfig->PlaylistIfNoChapters;
SetupStereoDownmix = MpvPluginConfig->StereoDownmix;
SetupShowMediaTitle = MpvPluginConfig->ShowMediaTitle;
Setup();
}
eOSState cMpvPluginSetup::ProcessKey(eKeys key)
{
int oldUsePassthrough = SetupUsePassthrough;
int oldPlaylistOnNextKey = SetupPlaylistOnNextKey;
eOSState state = cMenuSetupPage::ProcessKey(key);
if (key != kNone && (SetupUsePassthrough != oldUsePassthrough || SetupPlaylistOnNextKey != oldPlaylistOnNextKey))
Setup();
return state;
}
void cMpvPluginSetup::Setup()
{
int current = Current();
Clear();
Add(new cMenuEditBoolItem(tr("Hide main menu entry"), &SetupHideMainMenuEntry, trVDR("no"), trVDR("yes")));
Add(new cMenuEditBoolItem(tr("Audio Passthrough"), &SetupUsePassthrough));
if (SetupUsePassthrough)
Add(new cMenuEditBoolItem(tr("DTS-HD Passthrough"), &SetupUseDtsHdPassthrough));
else
Add(new cMenuEditBoolItem(tr("Enable stereo downmix"), &SetupStereoDownmix));
Add(new cMenuEditBoolItem(tr("Use prev/next keys for playlist control"), &SetupPlaylistOnNextKey));
if (!SetupPlaylistOnNextKey)
Add(new cMenuEditBoolItem(tr("Control playlist if no chapters in file"), &SetupPlaylistIfNoChapters));
Add(new cMenuEditBoolItem(tr("Show media title instead of filename"), &SetupShowMediaTitle));
SetCurrent(Get(current));
Display();
}
void cMpvPluginSetup::Store()
{
SetupStore("HideMainMenuEntry", MpvPluginConfig->HideMainMenuEntry = SetupHideMainMenuEntry);
SetupStore("UsePassthrough", MpvPluginConfig->UsePassthrough = SetupUsePassthrough);
SetupStore("UseDtsHdPassthrough", MpvPluginConfig->UseDtsHdPassthrough = SetupUseDtsHdPassthrough);
SetupStore("StereoDownmix", MpvPluginConfig->StereoDownmix = SetupStereoDownmix);
SetupStore("PlaylistOnNextKey", MpvPluginConfig->PlaylistOnNextKey = SetupPlaylistOnNextKey);
SetupStore("PlaylistIfNoChapters", MpvPluginConfig->PlaylistIfNoChapters = SetupPlaylistIfNoChapters);
SetupStore("ShowMediaTitle", MpvPluginConfig->ShowMediaTitle = SetupShowMediaTitle);
}