summaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
authorManiac <na@na.na>2015-07-03 22:29:41 +0200
committerManiac <na@na.na>2015-07-03 22:29:41 +0200
commitda407909879f82c15f786bda3fedda0cae892100 (patch)
tree143c2b842028c38e8f7facfe576567039459afd9 /setup.c
downloadvdr-plugin-mpv-da407909879f82c15f786bda3fedda0cae892100.tar.gz
vdr-plugin-mpv-da407909879f82c15f786bda3fedda0cae892100.tar.bz2
import 0.0.40.0.4
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/setup.c b/setup.c
new file mode 100644
index 0000000..a8a68ec
--- /dev/null
+++ b/setup.c
@@ -0,0 +1,65 @@
+//////////////////////////////////////////////////////////////////////////////
+/// ///
+/// 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);
+}
+