Skip to content

Commit 09e73a3

Browse files
authored
Merge pull request #36 from ua0lnj/master
Version 1.6.0.
2 parents ac80df6 + b00503d commit 09e73a3

File tree

10 files changed

+85
-27
lines changed

10 files changed

+85
-27
lines changed

config.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ cMpvPluginConfig::cMpvPluginConfig()
2525
ShowMediaTitle = 0;
2626
ShowSubtitles = 0;
2727
ExitAtEnd = 1;
28+
ShowAfterStop = 0;
2829
SavePos = 0;
2930
SoftVol = 0;
3031

@@ -179,6 +180,8 @@ bool cMpvPluginConfig::SetupParse(const char *name, const char *value)
179180
ShowSubtitles = atoi(value);
180181
else if (!strcasecmp(name, "ExitAtEnd"))
181182
ExitAtEnd = atoi(value);
183+
else if (!strcasecmp(name, "ShowAfterStop"))
184+
ShowAfterStop = atoi(value);
182185
else if (!strcasecmp(name, "SavePos"))
183186
SavePos = atoi(value);
184187
else if (!strcasecmp(name, "SoftVol"))

config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class cMpvPluginConfig
4040
int ShowMediaTitle; // show title from media file instead of filename
4141
int ShowSubtitles; // show subtitles
4242
int ExitAtEnd; // exit at the end
43+
int ShowAfterStop; // show after stop: 0 - black screen, 1 - filebrowser
4344
int SavePos; // save position on quit
4445
int SoftVol; // software volume
4546

control.c

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,15 @@ void cMpvControl::ShowProgress(int playlist)
129129
DisplayReplay->SetMode(!Player->IsPaused(), true, Speed);
130130

131131
if (playlist)
132-
{
133-
DisplayReplay->SetCurrent(itoa(Player->CurrentListPos()));
134-
DisplayReplay->SetTotal(itoa(Player->TotalListPos()));
135-
}
136-
else
137-
{
138-
DisplayReplay->SetCurrent(IndexToHMSF(Player->CurrentPlayTime(), false, 1));
139-
DisplayReplay->SetTotal(IndexToHMSF(Player->TotalPlayTime(), false, 1));
140-
}
132+
{
133+
DisplayReplay->SetCurrent(itoa(Player->CurrentListPos()));
134+
DisplayReplay->SetTotal(itoa(Player->TotalListPos()));
135+
}
136+
else
137+
{
138+
DisplayReplay->SetCurrent(IndexToHMSF(Player->CurrentPlayTime(), false, 1));
139+
DisplayReplay->SetTotal(IndexToHMSF(Player->TotalPlayTime(), false, 1));
140+
}
141141
SetNeedsFastResponse(true);
142142
Skins.Flush();
143143
}
@@ -318,6 +318,11 @@ eOSState cMpvControl::ProcessKey(eKeys key)
318318
if (MpvPluginConfig->SavePos && !Player->NetworkPlay())
319319
Player->SavePosPlayer();
320320
Player->StopPlayer();
321+
if (MpvPluginConfig->ShowAfterStop == 1)
322+
{
323+
MpvPluginConfig->ShowOptions = 0;
324+
cRemote::CallPlugin("mpv");
325+
}
321326
}
322327
else
323328
{

filebrowser.c

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ eOSState cMpvFilebrowser::ProcessKey(eKeys Key)
168168
string newPath = "";
169169
cMpvFilebrowserMenuItem *item;
170170
eOSState State;
171+
int index = 0;
171172
switch (Key)
172173
{
173174
case kOk:
@@ -265,6 +266,7 @@ eOSState cMpvFilebrowser::ProcessKey(eKeys Key)
265266
item = (cMpvFilebrowserMenuItem *) Get(Current());
266267
if (!item) break;
267268
newPath = item->Path() + "/" + item->Text();
269+
index = item->Index();
268270
if (item->IsDirectory())
269271
{
270272
int res;
@@ -279,39 +281,45 @@ eOSState cMpvFilebrowser::ProcessKey(eKeys Key)
279281
if (Skins.Message(mtWarning, tr("Remove empty directory?"), 5) == kOk)
280282
{
281283
res = rmdir(newPath.c_str());
284+
dsyslog("[mpv] remove %s %d\n", newPath.c_str(), res);
282285
if (res)
283286
{
284287
Skins.Message(mtError, tr("Unable to remove directory!"));
285-
ShowDirectory(currentDir);
286288
}
287289
else
288290
{
289-
State = cOsdMenu::ProcessKey(kUp);
290-
item = (cMpvFilebrowserMenuItem *) Get(Current());
291-
if (!item) break;
292-
currentItem = item->Text();
293-
ShowDirectory(currentDir);
294-
return State;
291+
if (index)
292+
{
293+
item = (cMpvFilebrowserMenuItem *) Get(index-1);
294+
if (!item) break;
295+
currentItem = item->Text();
296+
}
295297
}
296298
}
297299
}
300+
ShowDirectory(currentDir);
298301
}
299302
else
300303
{
301304
if (Skins.Message(mtWarning, tr("Remove file?"), 5) == kOk)
302305
{
303306
int res;
304307
res = remove(newPath.c_str());
305-
ShowDirectory(currentDir);
308+
dsyslog("[mpv] remove %s %d\n", newPath.c_str(), res);
306309
if (res)
307310
{
308311
Skins.Message(mtError, tr("Unable to remove file!"));
309312
}
310313
else
311314
{
312-
State = cOsdMenu::ProcessKey(kUp);
313-
return State;
315+
if (index)
316+
{
317+
item = (cMpvFilebrowserMenuItem *) Get(index-1);
318+
if (!item) break;
319+
currentItem = item->Text();
320+
}
314321
}
322+
ShowDirectory(currentDir);
315323
}
316324
}
317325
return osContinue;

menu_options.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ eOSState cMpvMenuOptions::ProcessKey(eKeys Key)
3636
switch (Key)
3737
{
3838
case kOk:
39-
if(State == osUser1)
40-
AddSubMenu(new cMpvMenuChapters(player));
41-
if(State == osUser2)
42-
AddSubMenu(new cMpvMenuPlaylist(player));
39+
if(State == osUser1)
40+
AddSubMenu(new cMpvMenuChapters(player));
41+
if(State == osUser2)
42+
AddSubMenu(new cMpvMenuPlaylist(player));
4343
break;
4444

4545
default:

mpv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "menu_options.h"
2020
#include "mpv_service.h"
2121

22-
static const char *VERSION = "1.5.2"
22+
static const char *VERSION = "1.6.0"
2323
#ifdef GIT_REV
2424
"-GIT" GIT_REV
2525
#endif

po/it_IT.po

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: VDR \n"
99
"Report-Msgid-Bugs-To: <see README>\n"
10-
"POT-Creation-Date: 2021-02-11 22:27+1000\n"
10+
"POT-Creation-Date: 2024-01-28 01:08+1000\n"
1111
"PO-Revision-Date: \n"
1212
"Last-Translator: fiveten_59\n"
1313
"Language-Team: fiveten_59\n"
@@ -56,12 +56,30 @@ msgstr "Disco"
5656
msgid "PlayDir"
5757
msgstr "Riproduzione continua"
5858

59+
msgid "Remove"
60+
msgstr ""
61+
5962
msgid "Shuffle"
6063
msgstr "Riproduzione casuale"
6164

6265
msgid "Playlist cannot be created!"
6366
msgstr "La playlist non può essere creata!"
6467

68+
msgid "Not empty directory, can't remove!"
69+
msgstr ""
70+
71+
msgid "Remove empty directory?"
72+
msgstr ""
73+
74+
msgid "Unable to remove directory!"
75+
msgstr ""
76+
77+
msgid "Remove file?"
78+
msgstr ""
79+
80+
msgid "Unable to remove file!"
81+
msgstr ""
82+
6583
msgid "Options"
6684
msgstr "Opzioni"
6785

@@ -83,6 +101,9 @@ msgstr "Registrazione in corso - play non disponibile!"
83101
msgid "mpv player plugin"
84102
msgstr "mpv player plugin"
85103

104+
msgid "Black screen"
105+
msgstr "Schermo nero"
106+
86107
msgid "Hide main menu entry"
87108
msgstr "Nascondere menù principale"
88109

@@ -116,5 +137,8 @@ msgstr "Mostra sottotitoli"
116137
msgid "Exit at the end"
117138
msgstr "Uscire al termine"
118139

140+
msgid "Show after stop"
141+
msgstr "Mostra dopo fermata"
142+
119143
msgid "Save position on quit"
120144
msgstr "Salva la posizione all'uscita"

po/ru_RU.po

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: vdr-mpv 0.0.4\n"
99
"Report-Msgid-Bugs-To: <see README>\n"
10-
"POT-Creation-Date: 2024-01-07 14:59+1000\n"
10+
"POT-Creation-Date: 2024-01-28 01:08+1000\n"
1111
"PO-Revision-Date: 2020-01-12 01:04+1000\n"
1212
"Last-Translator: ua0lnj\n"
1313
"Language-Team: ua0lnj\n"
@@ -101,6 +101,9 @@ msgstr "Запись - нельзя проиграть!"
101101
msgid "mpv player plugin"
102102
msgstr "MPV плагин"
103103

104+
msgid "Black screen"
105+
msgstr "Чёрный экран"
106+
104107
msgid "Hide main menu entry"
105108
msgstr "Скрыть основное меню"
106109

@@ -134,5 +137,8 @@ msgstr "Показ субтитров"
134137
msgid "Exit at the end"
135138
msgstr "Выход в конце"
136139

140+
msgid "Show after stop"
141+
msgstr "Показать после остановки"
142+
137143
msgid "Save position on quit"
138144
msgstr "Запомнить позицию"

setup.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ cMpvPluginSetup::cMpvPluginSetup()
2121
SetupShowMediaTitle = MpvPluginConfig->ShowMediaTitle;
2222
SetupShowSubtitles = MpvPluginConfig->ShowSubtitles;
2323
SetupExitAtEnd = MpvPluginConfig->ExitAtEnd;
24+
SetupShowAfterStop = MpvPluginConfig->ShowAfterStop;
2425
SetupSavePos = MpvPluginConfig->SavePos;
2526
SetupSoftVol = MpvPluginConfig->SoftVol;
2627
Setup();
@@ -31,17 +32,23 @@ eOSState cMpvPluginSetup::ProcessKey(eKeys key)
3132
int oldUsePassthrough = SetupUsePassthrough;
3233
int oldSoftVol = SetupSoftVol;
3334
int oldPlaylistOnNextKey = SetupPlaylistOnNextKey;
35+
int oldSetupExitAtEnd = SetupExitAtEnd;
3436
eOSState state = cMenuSetupPage::ProcessKey(key);
3537

3638
if (key != kNone && (SetupUsePassthrough != oldUsePassthrough || SetupPlaylistOnNextKey != oldPlaylistOnNextKey ||
37-
SetupSoftVol != oldSoftVol))
39+
SetupSoftVol != oldSoftVol || SetupExitAtEnd != oldSetupExitAtEnd))
3840
Setup();
3941

4042
return state;
4143
}
4244

4345
void cMpvPluginSetup::Setup()
4446
{
47+
static const char *const show_after_stop[] = {
48+
tr("Black screen"), tr("Filebrowser"),
49+
};
50+
51+
4552
int current = Current();
4653
Clear();
4754

@@ -59,6 +66,8 @@ void cMpvPluginSetup::Setup()
5966
Add(new cMenuEditBoolItem(tr("Show media title instead of filename"), &SetupShowMediaTitle));
6067
Add(new cMenuEditBoolItem(tr("Show subtitles"), &SetupShowSubtitles));
6168
Add(new cMenuEditBoolItem(tr("Exit at the end"), &SetupExitAtEnd));
69+
if (!SetupExitAtEnd)
70+
Add(new cMenuEditStraItem(tr("Show after stop"), &SetupShowAfterStop, 2, show_after_stop));
6271
Add(new cMenuEditBoolItem(tr("Save position on quit"), &SetupSavePos));
6372
SetCurrent(Get(current));
6473
Display();
@@ -76,6 +85,7 @@ void cMpvPluginSetup::Store()
7685
SetupStore("ShowMediaTitle", MpvPluginConfig->ShowMediaTitle = SetupShowMediaTitle);
7786
SetupStore("ShowSubtitles", MpvPluginConfig->ShowSubtitles = SetupShowSubtitles);
7887
SetupStore("ExitAtEnd", MpvPluginConfig->ExitAtEnd = SetupExitAtEnd);
88+
SetupStore("ShowAfterStop", MpvPluginConfig->ShowAfterStop = SetupShowAfterStop);
7989
SetupStore("SavePos", MpvPluginConfig->SavePos = SetupSavePos);
8090
SetupStore("SoftVol", MpvPluginConfig->SoftVol = SetupSoftVol);
8191
}

setup.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class cMpvPluginSetup:public cMenuSetupPage
2727
int SetupShowMediaTitle;
2828
int SetupShowSubtitles;
2929
int SetupExitAtEnd;
30+
int SetupShowAfterStop;
3031
int SetupSavePos;
3132
int SetupSoftVol;
3233

0 commit comments

Comments
 (0)