diff --git a/config.c b/config.c index 1aa1969..f63bb23 100644 --- a/config.c +++ b/config.c @@ -25,6 +25,7 @@ cMpvPluginConfig::cMpvPluginConfig() ShowMediaTitle = 0; ShowSubtitles = 0; ExitAtEnd = 1; + ShowAfterStop = 0; SavePos = 0; SoftVol = 0; @@ -179,6 +180,8 @@ bool cMpvPluginConfig::SetupParse(const char *name, const char *value) ShowSubtitles = atoi(value); else if (!strcasecmp(name, "ExitAtEnd")) ExitAtEnd = atoi(value); + else if (!strcasecmp(name, "ShowAfterStop")) + ShowAfterStop = atoi(value); else if (!strcasecmp(name, "SavePos")) SavePos = atoi(value); else if (!strcasecmp(name, "SoftVol")) diff --git a/config.h b/config.h index 981c4d6..0629c78 100644 --- a/config.h +++ b/config.h @@ -40,6 +40,7 @@ class cMpvPluginConfig int ShowMediaTitle; // show title from media file instead of filename int ShowSubtitles; // show subtitles int ExitAtEnd; // exit at the end + int ShowAfterStop; // show after stop: 0 - black screen, 1 - filebrowser int SavePos; // save position on quit int SoftVol; // software volume diff --git a/control.c b/control.c index f28179b..407cd5a 100644 --- a/control.c +++ b/control.c @@ -129,15 +129,15 @@ void cMpvControl::ShowProgress(int playlist) DisplayReplay->SetMode(!Player->IsPaused(), true, Speed); if (playlist) -{ - DisplayReplay->SetCurrent(itoa(Player->CurrentListPos())); - DisplayReplay->SetTotal(itoa(Player->TotalListPos())); -} -else -{ - DisplayReplay->SetCurrent(IndexToHMSF(Player->CurrentPlayTime(), false, 1)); - DisplayReplay->SetTotal(IndexToHMSF(Player->TotalPlayTime(), false, 1)); -} + { + DisplayReplay->SetCurrent(itoa(Player->CurrentListPos())); + DisplayReplay->SetTotal(itoa(Player->TotalListPos())); + } + else + { + DisplayReplay->SetCurrent(IndexToHMSF(Player->CurrentPlayTime(), false, 1)); + DisplayReplay->SetTotal(IndexToHMSF(Player->TotalPlayTime(), false, 1)); + } SetNeedsFastResponse(true); Skins.Flush(); } @@ -318,6 +318,11 @@ eOSState cMpvControl::ProcessKey(eKeys key) if (MpvPluginConfig->SavePos && !Player->NetworkPlay()) Player->SavePosPlayer(); Player->StopPlayer(); + if (MpvPluginConfig->ShowAfterStop == 1) + { + MpvPluginConfig->ShowOptions = 0; + cRemote::CallPlugin("mpv"); + } } else { diff --git a/filebrowser.c b/filebrowser.c index 99d1c86..2dc594b 100644 --- a/filebrowser.c +++ b/filebrowser.c @@ -168,6 +168,7 @@ eOSState cMpvFilebrowser::ProcessKey(eKeys Key) string newPath = ""; cMpvFilebrowserMenuItem *item; eOSState State; + int index = 0; switch (Key) { case kOk: @@ -265,6 +266,7 @@ eOSState cMpvFilebrowser::ProcessKey(eKeys Key) item = (cMpvFilebrowserMenuItem *) Get(Current()); if (!item) break; newPath = item->Path() + "/" + item->Text(); + index = item->Index(); if (item->IsDirectory()) { int res; @@ -279,22 +281,23 @@ eOSState cMpvFilebrowser::ProcessKey(eKeys Key) if (Skins.Message(mtWarning, tr("Remove empty directory?"), 5) == kOk) { res = rmdir(newPath.c_str()); + dsyslog("[mpv] remove %s %d\n", newPath.c_str(), res); if (res) { Skins.Message(mtError, tr("Unable to remove directory!")); - ShowDirectory(currentDir); } else { - State = cOsdMenu::ProcessKey(kUp); - item = (cMpvFilebrowserMenuItem *) Get(Current()); - if (!item) break; - currentItem = item->Text(); - ShowDirectory(currentDir); - return State; + if (index) + { + item = (cMpvFilebrowserMenuItem *) Get(index-1); + if (!item) break; + currentItem = item->Text(); + } } } } + ShowDirectory(currentDir); } else { @@ -302,16 +305,21 @@ eOSState cMpvFilebrowser::ProcessKey(eKeys Key) { int res; res = remove(newPath.c_str()); - ShowDirectory(currentDir); + dsyslog("[mpv] remove %s %d\n", newPath.c_str(), res); if (res) { Skins.Message(mtError, tr("Unable to remove file!")); } else { - State = cOsdMenu::ProcessKey(kUp); - return State; + if (index) + { + item = (cMpvFilebrowserMenuItem *) Get(index-1); + if (!item) break; + currentItem = item->Text(); + } } + ShowDirectory(currentDir); } } return osContinue; diff --git a/menu_options.c b/menu_options.c index c82487f..a652308 100644 --- a/menu_options.c +++ b/menu_options.c @@ -36,10 +36,10 @@ eOSState cMpvMenuOptions::ProcessKey(eKeys Key) switch (Key) { case kOk: -if(State == osUser1) - AddSubMenu(new cMpvMenuChapters(player)); -if(State == osUser2) - AddSubMenu(new cMpvMenuPlaylist(player)); + if(State == osUser1) + AddSubMenu(new cMpvMenuChapters(player)); + if(State == osUser2) + AddSubMenu(new cMpvMenuPlaylist(player)); break; default: diff --git a/mpv.c b/mpv.c index 6d0e1d7..7ba479c 100644 --- a/mpv.c +++ b/mpv.c @@ -19,7 +19,7 @@ #include "menu_options.h" #include "mpv_service.h" -static const char *VERSION = "1.5.2" +static const char *VERSION = "1.6.0" #ifdef GIT_REV "-GIT" GIT_REV #endif diff --git a/po/it_IT.po b/po/it_IT.po index 31fb8c1..37efd71 100644 --- a/po/it_IT.po +++ b/po/it_IT.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-02-11 22:27+1000\n" +"POT-Creation-Date: 2024-01-28 01:08+1000\n" "PO-Revision-Date: \n" "Last-Translator: fiveten_59\n" "Language-Team: fiveten_59\n" @@ -56,12 +56,30 @@ msgstr "Disco" msgid "PlayDir" msgstr "Riproduzione continua" +msgid "Remove" +msgstr "" + msgid "Shuffle" msgstr "Riproduzione casuale" msgid "Playlist cannot be created!" msgstr "La playlist non può essere creata!" +msgid "Not empty directory, can't remove!" +msgstr "" + +msgid "Remove empty directory?" +msgstr "" + +msgid "Unable to remove directory!" +msgstr "" + +msgid "Remove file?" +msgstr "" + +msgid "Unable to remove file!" +msgstr "" + msgid "Options" msgstr "Opzioni" @@ -83,6 +101,9 @@ msgstr "Registrazione in corso - play non disponibile!" msgid "mpv player plugin" msgstr "mpv player plugin" +msgid "Black screen" +msgstr "Schermo nero" + msgid "Hide main menu entry" msgstr "Nascondere menù principale" @@ -116,5 +137,8 @@ msgstr "Mostra sottotitoli" msgid "Exit at the end" msgstr "Uscire al termine" +msgid "Show after stop" +msgstr "Mostra dopo fermata" + msgid "Save position on quit" msgstr "Salva la posizione all'uscita" diff --git a/po/ru_RU.po b/po/ru_RU.po index 005640d..eea11c7 100644 --- a/po/ru_RU.po +++ b/po/ru_RU.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-mpv 0.0.4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-07 14:59+1000\n" +"POT-Creation-Date: 2024-01-28 01:08+1000\n" "PO-Revision-Date: 2020-01-12 01:04+1000\n" "Last-Translator: ua0lnj\n" "Language-Team: ua0lnj\n" @@ -101,6 +101,9 @@ msgstr "Запись - нельзя проиграть!" msgid "mpv player plugin" msgstr "MPV плагин" +msgid "Black screen" +msgstr "Чёрный экран" + msgid "Hide main menu entry" msgstr "Скрыть основное меню" @@ -134,5 +137,8 @@ msgstr "Показ субтитров" msgid "Exit at the end" msgstr "Выход в конце" +msgid "Show after stop" +msgstr "Показать после остановки" + msgid "Save position on quit" msgstr "Запомнить позицию" diff --git a/setup.c b/setup.c index 40953b0..080a7c7 100644 --- a/setup.c +++ b/setup.c @@ -21,6 +21,7 @@ cMpvPluginSetup::cMpvPluginSetup() SetupShowMediaTitle = MpvPluginConfig->ShowMediaTitle; SetupShowSubtitles = MpvPluginConfig->ShowSubtitles; SetupExitAtEnd = MpvPluginConfig->ExitAtEnd; + SetupShowAfterStop = MpvPluginConfig->ShowAfterStop; SetupSavePos = MpvPluginConfig->SavePos; SetupSoftVol = MpvPluginConfig->SoftVol; Setup(); @@ -31,10 +32,11 @@ eOSState cMpvPluginSetup::ProcessKey(eKeys key) int oldUsePassthrough = SetupUsePassthrough; int oldSoftVol = SetupSoftVol; int oldPlaylistOnNextKey = SetupPlaylistOnNextKey; + int oldSetupExitAtEnd = SetupExitAtEnd; eOSState state = cMenuSetupPage::ProcessKey(key); if (key != kNone && (SetupUsePassthrough != oldUsePassthrough || SetupPlaylistOnNextKey != oldPlaylistOnNextKey || - SetupSoftVol != oldSoftVol)) + SetupSoftVol != oldSoftVol || SetupExitAtEnd != oldSetupExitAtEnd)) Setup(); return state; @@ -42,6 +44,11 @@ eOSState cMpvPluginSetup::ProcessKey(eKeys key) void cMpvPluginSetup::Setup() { + static const char *const show_after_stop[] = { + tr("Black screen"), tr("Filebrowser"), + }; + + int current = Current(); Clear(); @@ -59,6 +66,8 @@ void cMpvPluginSetup::Setup() Add(new cMenuEditBoolItem(tr("Show media title instead of filename"), &SetupShowMediaTitle)); Add(new cMenuEditBoolItem(tr("Show subtitles"), &SetupShowSubtitles)); Add(new cMenuEditBoolItem(tr("Exit at the end"), &SetupExitAtEnd)); + if (!SetupExitAtEnd) + Add(new cMenuEditStraItem(tr("Show after stop"), &SetupShowAfterStop, 2, show_after_stop)); Add(new cMenuEditBoolItem(tr("Save position on quit"), &SetupSavePos)); SetCurrent(Get(current)); Display(); @@ -76,6 +85,7 @@ void cMpvPluginSetup::Store() SetupStore("ShowMediaTitle", MpvPluginConfig->ShowMediaTitle = SetupShowMediaTitle); SetupStore("ShowSubtitles", MpvPluginConfig->ShowSubtitles = SetupShowSubtitles); SetupStore("ExitAtEnd", MpvPluginConfig->ExitAtEnd = SetupExitAtEnd); + SetupStore("ShowAfterStop", MpvPluginConfig->ShowAfterStop = SetupShowAfterStop); SetupStore("SavePos", MpvPluginConfig->SavePos = SetupSavePos); SetupStore("SoftVol", MpvPluginConfig->SoftVol = SetupSoftVol); } diff --git a/setup.h b/setup.h index 026596f..e85b86b 100644 --- a/setup.h +++ b/setup.h @@ -27,6 +27,7 @@ class cMpvPluginSetup:public cMenuSetupPage int SetupShowMediaTitle; int SetupShowSubtitles; int SetupExitAtEnd; + int SetupShowAfterStop; int SetupSavePos; int SetupSoftVol;