# HG changeset patch # User nathan # Date 1292151180 -3600 # Node ID ba6464ebc3f90741361357f83d79137a5cbb4fc6 # Parent 79b272a68eb42a18a145cf7b9b55d284e1df5f4e add setup option to switch prev/next key function diff -r 79b272a68eb4 -r ba6464ebc3f9 mplayer.c --- a/mplayer.c Sun Dec 12 11:31:54 2010 +0100 +++ b/mplayer.c Sun Dec 12 11:53:00 2010 +0100 @@ -1,7 +1,7 @@ /* * MP3/MPlayer plugin to VDR (C++) * - * (C) 2001-2009 Stefan Huelswitt + * (C) 2001-2010 Stefan Huelswitt * * This code is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -69,6 +69,7 @@ data=MPlayerSetup; SetSection(tr("MPlayer")); Add(new cMenuEditBoolItem(tr("Setup.MPlayer$Control mode"), &data.SlaveMode, tr("Traditional"), tr("Slave"))); + Add(new cMenuEditBoolItem(tr("Setup.MPlayer$Prev/Next keys"),&data.PrevNextKeyMode, tr("Chapter"), tr("Playlist"))); res[0]=tr("disabled"); res[1]=tr("global only"); res[2]=tr("local first"); @@ -88,6 +89,7 @@ SetupStore("ControlMode", MPlayerSetup.SlaveMode); SetupStore("HideMainMenu",MPlayerSetup.HideMainMenu); SetupStore("ResumeMode", MPlayerSetup.ResumeMode); + SetupStore("PrevNextMode",MPlayerSetup.PrevNextKeyMode); for(int i=0; i<10; i++) { char name[16]; snprintf(name,sizeof(name),"KeyCmd%d",i); @@ -368,17 +370,15 @@ case kRed: Jump(); break; - case kGreen|k_Repeat: // temporary use + case kGreen|k_Repeat: case kGreen: player->SkipSeconds(-60); break; case kYellow|k_Repeat: case kYellow: player->SkipSeconds(60); break; - // case kGreen|k_Repeat: // reserved for future use - // case kGreen: player->SkipPrev(); break; - // case kYellow|k_Repeat: - // case kYellow: player->SkipNext(); break; - - case kBack: - Hide(); + + case kNext: player->SkipTrack(1,MPlayerSetup.PrevNextKeyMode!=0); break; + case kPrev: player->SkipTrack(-1,MPlayerSetup.PrevNextKeyMode!=0); break; + + case kBack: Hide(); cRemote::CallPlugin(plugin_name); return osBack; case kStop: @@ -393,12 +393,6 @@ case kAudio: player->KeyCmd("switch_audio"); break; - case kNext: - player->KeyCmd("seek_chapter +1"); - break; - case kPrev: - player->KeyCmd("seek_chapter -1"); - break; case k0: case k1: case k2: @@ -696,6 +690,7 @@ if( !strcasecmp(Name, "ControlMode")) MPlayerSetup.SlaveMode = atoi(Value); else if (!strcasecmp(Name, "HideMainMenu")) MPlayerSetup.HideMainMenu = atoi(Value); else if (!strcasecmp(Name, "ResumeMode")) MPlayerSetup.ResumeMode = atoi(Value); + else if (!strcasecmp(Name, "PrevNextMode")) MPlayerSetup.PrevNextKeyMode = atoi(Value); else if (!strncasecmp(Name,"KeyCmd", 6) && strlen(Name)==7 && isdigit(Name[6])) strn0cpy(MPlayerSetup.KeyCmd[Name[6]-'0'],Value,sizeof(MPlayerSetup.KeyCmd[0])); else return false; diff -r 79b272a68eb4 -r ba6464ebc3f9 player-mplayer.c --- a/player-mplayer.c Sun Dec 12 11:31:54 2010 +0100 +++ b/player-mplayer.c Sun Dec 12 11:53:00 2010 +0100 @@ -1,7 +1,7 @@ /* * MP3/MPlayer plugin to VDR (C++) * - * (C) 2001-2009 Stefan Huelswitt + * (C) 2001-2010 Stefan Huelswitt * * This code is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -665,6 +665,17 @@ } } +void cMPlayerPlayer::SkipTrack(int dir, bool chapter) +{ + if(slave) { + bool p=false; + if(playMode==pmPaused) { Play(); p=true; } + MPlayerControl("%s %d",chapter ? "seek_chapter":"pt_step",dir); + if(p) Pause(); + saveIndex=-1; + } +} + void cMPlayerPlayer::KeyCmd(const char *cmd) { if(slave) MPlayerControl(cmd); diff -r 79b272a68eb4 -r ba6464ebc3f9 player-mplayer.h --- a/player-mplayer.h Sun Dec 12 11:31:54 2010 +0100 +++ b/player-mplayer.h Sun Dec 12 11:53:00 2010 +0100 @@ -1,7 +1,7 @@ /* * MP3/MPlayer plugin to VDR (C++) * - * (C) 2001-2006 Stefan Huelswitt + * (C) 2001-2010 Stefan Huelswitt * * This code is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -80,6 +80,7 @@ void Play(void); void Goto(int Index, bool percent, bool still); void SkipSeconds(int secs); + void SkipTrack(int dir, bool chapter); void KeyCmd(const char *cmd); char *GetCurrentName(void); virtual bool GetIndex(int &Current, int &Total, bool SnapToIFrame); diff -r 79b272a68eb4 -r ba6464ebc3f9 po/ca_ES.po --- a/po/ca_ES.po Sun Dec 12 11:31:54 2010 +0100 +++ b/po/ca_ES.po Sun Dec 12 11:53:00 2010 +0100 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: VDR 1.5.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-08-17 09:00-0400\n" +"POT-Creation-Date: 2010-12-12 11:45+0100\n" "PO-Revision-Date: 2007-08-27 16:33+0200\n" "Last-Translator: Stefan Huelswitt \n" "Language-Team: \n" @@ -324,6 +324,15 @@ msgid "Slave" msgstr "Esclau" +msgid "Setup.MPlayer$Prev/Next keys" +msgstr "" + +msgid "Chapter" +msgstr "" + +msgid "Playlist" +msgstr "" + msgid "global only" msgstr "" diff -r 79b272a68eb4 -r ba6464ebc3f9 po/de_DE.po --- a/po/de_DE.po Sun Dec 12 11:31:54 2010 +0100 +++ b/po/de_DE.po Sun Dec 12 11:53:00 2010 +0100 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: VDR 1.5.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-08-17 09:00-0400\n" +"POT-Creation-Date: 2010-12-12 11:45+0100\n" "PO-Revision-Date: 2007-08-27 16:33+0200\n" "Last-Translator: Stefan Huelswitt \n" "Language-Team: \n" @@ -324,6 +324,15 @@ msgid "Slave" msgstr "Slave" +msgid "Setup.MPlayer$Prev/Next keys" +msgstr "Vor/Zurќck Taste" + +msgid "Chapter" +msgstr "Kapitel" + +msgid "Playlist" +msgstr "Abspielliste" + msgid "global only" msgstr "nur global" diff -r 79b272a68eb4 -r ba6464ebc3f9 po/el_GR.po --- a/po/el_GR.po Sun Dec 12 11:31:54 2010 +0100 +++ b/po/el_GR.po Sun Dec 12 11:53:00 2010 +0100 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: VDR 1.5.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-08-17 09:00-0400\n" +"POT-Creation-Date: 2010-12-12 11:45+0100\n" "PO-Revision-Date: 2007-08-27 16:33+0200\n" "Last-Translator: Stefan Huelswitt \n" "Language-Team: \n" @@ -324,6 +324,15 @@ msgid "Slave" msgstr "" +msgid "Setup.MPlayer$Prev/Next keys" +msgstr "" + +msgid "Chapter" +msgstr "" + +msgid "Playlist" +msgstr "" + msgid "global only" msgstr "" diff -r 79b272a68eb4 -r ba6464ebc3f9 po/es_ES.po --- a/po/es_ES.po Sun Dec 12 11:31:54 2010 +0100 +++ b/po/es_ES.po Sun Dec 12 11:53:00 2010 +0100 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: VDR 1.5.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-08-17 09:00-0400\n" +"POT-Creation-Date: 2010-12-12 11:45+0100\n" "PO-Revision-Date: 2007-08-27 16:33+0200\n" "Last-Translator: Stefan Huelswitt \n" "Language-Team: \n" @@ -324,6 +324,15 @@ msgid "Slave" msgstr "Esclavo" +msgid "Setup.MPlayer$Prev/Next keys" +msgstr "" + +msgid "Chapter" +msgstr "" + +msgid "Playlist" +msgstr "" + msgid "global only" msgstr "" diff -r 79b272a68eb4 -r ba6464ebc3f9 po/fi_FI.po --- a/po/fi_FI.po Sun Dec 12 11:31:54 2010 +0100 +++ b/po/fi_FI.po Sun Dec 12 11:53:00 2010 +0100 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: VDR 1.5.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-08-17 09:00-0400\n" +"POT-Creation-Date: 2010-12-12 11:45+0100\n" "PO-Revision-Date: 2007-08-27 16:33+0200\n" "Last-Translator: Stefan Huelswitt \n" "Language-Team: \n" @@ -325,6 +325,15 @@ msgid "Slave" msgstr "orja" +msgid "Setup.MPlayer$Prev/Next keys" +msgstr "" + +msgid "Chapter" +msgstr "" + +msgid "Playlist" +msgstr "" + msgid "global only" msgstr "globaali" diff -r 79b272a68eb4 -r ba6464ebc3f9 po/fr_FR.po --- a/po/fr_FR.po Sun Dec 12 11:31:54 2010 +0100 +++ b/po/fr_FR.po Sun Dec 12 11:53:00 2010 +0100 @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: VDR 1.5.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-08-17 09:00-0400\n" +"POT-Creation-Date: 2010-12-12 11:45+0100\n" "PO-Revision-Date: 2007-08-27 16:33+0200\n" "Last-Translator: Stefan Huelswitt \n" "Language-Team: \n" @@ -326,6 +326,15 @@ msgid "Slave" msgstr "Esclave" +msgid "Setup.MPlayer$Prev/Next keys" +msgstr "" + +msgid "Chapter" +msgstr "" + +msgid "Playlist" +msgstr "" + msgid "global only" msgstr "Global seulement" diff -r 79b272a68eb4 -r ba6464ebc3f9 po/it_IT.po --- a/po/it_IT.po Sun Dec 12 11:31:54 2010 +0100 +++ b/po/it_IT.po Sun Dec 12 11:53:00 2010 +0100 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: VDR 1.5.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-08-17 09:00-0400\n" +"POT-Creation-Date: 2010-12-12 11:45+0100\n" "PO-Revision-Date: 2008-06-25 23:37+0100\n" "Last-Translator: Diego Pierotto \n" "Language-Team: \n" @@ -324,6 +324,15 @@ msgid "Slave" msgstr "Esclavo" +msgid "Setup.MPlayer$Prev/Next keys" +msgstr "" + +msgid "Chapter" +msgstr "" + +msgid "Playlist" +msgstr "" + msgid "global only" msgstr "solo globale" diff -r 79b272a68eb4 -r ba6464ebc3f9 po/ru_RU.po --- a/po/ru_RU.po Sun Dec 12 11:31:54 2010 +0100 +++ b/po/ru_RU.po Sun Dec 12 11:53:00 2010 +0100 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: VDR 1.5.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-08-17 09:00-0400\n" +"POT-Creation-Date: 2010-12-12 11:45+0100\n" "PO-Revision-Date: 2008-03-12 19:50+0100\n" "Last-Translator: Alexander \n" "Language-Team: \n" @@ -326,6 +326,15 @@ msgid "Slave" msgstr "расширенный" +msgid "Setup.MPlayer$Prev/Next keys" +msgstr "" + +msgid "Chapter" +msgstr "" + +msgid "Playlist" +msgstr "" + msgid "global only" msgstr "только глобально" diff -r 79b272a68eb4 -r ba6464ebc3f9 po/sl_SI.po --- a/po/sl_SI.po Sun Dec 12 11:31:54 2010 +0100 +++ b/po/sl_SI.po Sun Dec 12 11:53:00 2010 +0100 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: VDR 1.5.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-08-17 09:00-0400\n" +"POT-Creation-Date: 2010-12-12 11:45+0100\n" "PO-Revision-Date: 2007-08-27 16:33+0200\n" "Last-Translator: Stefan Huelswitt \n" "Language-Team: \n" @@ -324,6 +324,15 @@ msgid "Slave" msgstr "" +msgid "Setup.MPlayer$Prev/Next keys" +msgstr "" + +msgid "Chapter" +msgstr "" + +msgid "Playlist" +msgstr "" + msgid "global only" msgstr "" diff -r 79b272a68eb4 -r ba6464ebc3f9 po/sv_SE.po --- a/po/sv_SE.po Sun Dec 12 11:31:54 2010 +0100 +++ b/po/sv_SE.po Sun Dec 12 11:53:00 2010 +0100 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: VDR 1.5.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-08-17 09:00-0400\n" +"POT-Creation-Date: 2010-12-12 11:45+0100\n" "PO-Revision-Date: 2007-08-27 16:33+0200\n" "Last-Translator: Stefan Huelswitt \n" "Language-Team: \n" @@ -324,6 +324,15 @@ msgid "Slave" msgstr "Slav" +msgid "Setup.MPlayer$Prev/Next keys" +msgstr "" + +msgid "Chapter" +msgstr "" + +msgid "Playlist" +msgstr "" + msgid "global only" msgstr "" diff -r 79b272a68eb4 -r ba6464ebc3f9 setup-mplayer.c --- a/setup-mplayer.c Sun Dec 12 11:31:54 2010 +0100 +++ b/setup-mplayer.c Sun Dec 12 11:53:00 2010 +0100 @@ -1,7 +1,7 @@ /* * MP3/MPlayer plugin to VDR (C++) * - * (C) 2001-2009 Stefan Huelswitt + * (C) 2001-2010 Stefan Huelswitt * * This code is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -33,6 +33,7 @@ SlaveMode = 1; ResumeMode = 2; HideMainMenu = 0; + PrevNextKeyMode = 0; memset(KeyCmd,0,sizeof(KeyCmd)); strcpy(KeyCmd[1],"audio_delay +0.1"); strcpy(KeyCmd[7],"audio_delay -0.1"); diff -r 79b272a68eb4 -r ba6464ebc3f9 setup-mplayer.h --- a/setup-mplayer.h Sun Dec 12 11:31:54 2010 +0100 +++ b/setup-mplayer.h Sun Dec 12 11:53:00 2010 +0100 @@ -1,7 +1,7 @@ /* * MP3/MPlayer plugin to VDR (C++) * - * (C) 2001-2009 Stefan Huelswitt + * (C) 2001-2010 Stefan Huelswitt * * This code is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -33,6 +33,7 @@ int SlaveMode; int ResumeMode; int HideMainMenu; + int PrevNextKeyMode; char KeyCmd[10][MAX_KEYCMD]; public: cMPlayerSetup(void);