From 306d10392c3b29977f63f2aa463e11bb35be2097 Mon Sep 17 00:00:00 2001 From: Maniac Date: Sat, 4 Jul 2015 00:12:34 +0200 Subject: added argument to override the main menu text --- HISTORY | 3 +++ README | 3 +++ config.c | 7 ++++++- config.h | 1 + mpv.c | 3 +-- po/de_DE.po | 5 +---- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/HISTORY b/HISTORY index c7287b2..210a6ba 100644 --- a/HISTORY +++ b/HISTORY @@ -1,3 +1,6 @@ +2015-XX-XX vdr-mpv-0.0.5 +- added argument to override the main menu text + 2015-06-29: vdr-mpv-0.0.4 - start playback even when audio or video fails, this should give a better user feedback to see what's configured wrong diff --git a/README b/README index 143b9c8..1e87520 100644 --- a/README +++ b/README @@ -70,6 +70,9 @@ Command line arguments xrandr is needed for this to work. If no xrandr is detected during compile time this feature will be deactivated. +-m text + the text displayed in VDR main menu (Default: MPV) + Plugin setup options -------------------- diff --git a/config.c b/config.c index 9fdc834..b56a45b 100644 --- a/config.c +++ b/config.c @@ -31,6 +31,7 @@ cMpvPluginConfig::cMpvPluginConfig() DiscDevice = "/dev/dvd"; Languages = "deu,de,ger,eng,en"; PlayListExtString = "m3u,ini,pls,txt,playlist"; + MainMenuEntry = "MPV"; X11Display = ":0.0"; } @@ -61,7 +62,7 @@ int cMpvPluginConfig::ProcessArgs(int argc, char *const argv[]) for (;;) { - switch (getopt(argc, argv, "a:v:h:d:b:l:x:r")) + switch (getopt(argc, argv, "a:v:h:d:b:l:x:rm:")) { case 'a': // audio out AudioOut = optarg; @@ -87,6 +88,9 @@ int cMpvPluginConfig::ProcessArgs(int argc, char *const argv[]) case 'r': // refresh rate RefreshRate = 1; continue; + case 'm': + MainMenuEntry = optarg; + continue; case EOF: break; case ':': @@ -123,6 +127,7 @@ const char *cMpvPluginConfig::CommandLineHelp(void) #ifdef USE_XRANDR " -r\t\tswitch modeline to refresh rate of played file\n" #endif + " -m text\ttext displayed in VDR main menu (Default: MPV)\n" ; } diff --git a/config.h b/config.h index b36f7a3..7a09ed9 100644 --- a/config.h +++ b/config.h @@ -47,6 +47,7 @@ class cMpvPluginConfig string DiscDevice; // optical disc device string Languages; // language string for audio and subtitle TODO move to Setup menu vector PlaylistExtensions; // file extensions which are recognized as a playlist + string MainMenuEntry; // the text displayed in VDR main menu string X11Display; // X11 display used for mpv string TitleOverride; // title to display (ovveride used via service interface) diff --git a/mpv.c b/mpv.c index e8a200b..fae3986 100644 --- a/mpv.c +++ b/mpv.c @@ -26,7 +26,6 @@ static const char *VERSION = "0.0.4" using std::string; static const char *DESCRIPTION = trNOOP("mpv player plugin"); -static const char *MAINMENUENTRY = trNOOP("MPV"); class cMpvPlugin:public cPlugin { @@ -44,7 +43,7 @@ class cMpvPlugin:public cPlugin virtual bool ProcessArgs(int argc, char *argv[]) { return MpvPluginConfig->ProcessArgs(argc, argv); } virtual bool Initialize(void) { return true; } virtual void MainThreadHook(void) {} - virtual const char *MainMenuEntry(void) { return MpvPluginConfig->HideMainMenuEntry ? NULL : tr(MAINMENUENTRY); } + virtual const char *MainMenuEntry(void) { return MpvPluginConfig->HideMainMenuEntry ? NULL : MpvPluginConfig->MainMenuEntry.c_str(); } virtual cOsdObject *MainMenuAction(void); virtual cMenuSetupPage *SetupMenu(void) { return new cMpvPluginSetup; } virtual bool SetupParse(const char *Name, const char *Value) { return MpvPluginConfig->SetupParse(Name, Value); } diff --git a/po/de_DE.po b/po/de_DE.po index 47837f5..9dd6004 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-mpv 0.0.3\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-06-29 22:14+0200\n" +"POT-Creation-Date: 2015-07-03 22:39+0200\n" "PO-Revision-Date: 2015-06-29 22:14+0200\n" "Last-Translator: Maniac\n" "Language-Team: Maniac\n" @@ -23,9 +23,6 @@ msgstr "" msgid "mpv player plugin" msgstr "" -msgid "MPV" -msgstr "" - msgid "Browse" msgstr "" -- cgit v1.2.3