mplayer.c
branchtrunk
changeset 2 4c1f7b705009
parent 0 474a1293c3c0
child 9 dc75c2890a31
equal deleted inserted replaced
1:a6fedb9b8528 2:4c1f7b705009
    73 #include "version.h"
    73 #include "version.h"
    74 #include "service.h"
    74 #include "service.h"
    75 
    75 
    76 const char *sourcesSub=0;
    76 const char *sourcesSub=0;
    77 cFileSources MPlaySources;
    77 cFileSources MPlaySources;
       
    78 
       
    79 static const char *plugin_name=0;
    78 
    80 
    79 // --- cMenuSetupMPlayer --------------------------------------------------------
    81 // --- cMenuSetupMPlayer --------------------------------------------------------
    80 
    82 
    81 class cMenuSetupMPlayer : public cMenuSetupPage {
    83 class cMenuSetupMPlayer : public cMenuSetupPage {
    82 private:
    84 private:
   414 }
   416 }
   415 
   417 
   416 void cMPlayerControl::JumpDisplay(void)
   418 void cMPlayerControl::JumpDisplay(void)
   417 {
   419 {
   418   char buf[64];
   420   char buf[64];
   419   const char *j=tr("Jump: "), u=jumpmode?'%':'m';
   421   const char *j=trVDR("Jump: "), u=jumpmode?'%':'m';
   420   if(!jumpval) sprintf(buf,"%s- %c",  j,u);
   422   if(!jumpval) sprintf(buf,"%s- %c",  j,u);
   421   else         sprintf(buf,"%s%d- %c",j,jumpval,u);
   423   else         sprintf(buf,"%s%d- %c",j,jumpval,u);
   422 #if APIVERSNUM >= 10307
   424 #if APIVERSNUM >= 10307
   423   display->SetJump(buf);
   425   display->SetJump(buf);
   424 #else
   426 #else
   537   //    case kYellow:  player->SkipNext(); break;
   539   //    case kYellow:  player->SkipNext(); break;
   538 
   540 
   539       case kBack:
   541       case kBack:
   540 #if APIVERSNUM >= 10332
   542 #if APIVERSNUM >= 10332
   541                      Hide();
   543                      Hide();
   542                      cRemote::CallPlugin(i18n_name);
   544                      cRemote::CallPlugin(plugin_name);
   543                      return osBack;
   545                      return osBack;
   544 #endif
   546 #endif
   545       case kStop:
   547       case kStop:
   546       case kBlue:    Hide(); Stop(); return osEnd;
   548       case kBlue:    Hide(); Stop(); return osEnd;
   547 
   549 
   627 
   629 
   628 void cMenuMPlayBrowse::SetButtons(void)
   630 void cMenuMPlayBrowse::SetButtons(void)
   629 {
   631 {
   630   static char blue[12];
   632   static char blue[12];
   631   snprintf(blue,sizeof(blue),MPlayerAid>=0 ? "AID:%d" : "AID:def",MPlayerAid);
   633   snprintf(blue,sizeof(blue),MPlayerAid>=0 ? "AID:%d" : "AID:def",MPlayerAid);
   632   SetHelp(tr(BUTTON"Play"), MPlayerSetup.ResumeMode ? tr(BUTTON"Rewind"):0, tr("Source"), blue);
   634   SetHelp(trVDR(BUTTON"Play"), MPlayerSetup.ResumeMode ? trVDR(BUTTON"Rewind"):0, tr("Source"), blue);
   633   Display();
   635   Display();
   634 }
   636 }
   635 
   637 
   636 eOSState cMenuMPlayBrowse::Source(bool second)
   638 eOSState cMenuMPlayBrowse::Source(bool second)
   637 {
   639 {
   725 }
   727 }
   726 
   728 
   727 // --- cPluginMPlayer ----------------------------------------------------------
   729 // --- cPluginMPlayer ----------------------------------------------------------
   728 
   730 
   729 static const char *VERSION        = PLUGIN_VERSION;
   731 static const char *VERSION        = PLUGIN_VERSION;
   730 static const char *DESCRIPTION    = "Media replay via MPlayer";
   732 static const char *DESCRIPTION    = trNOOP("Media replay via MPlayer");
   731 static const char *MAINMENUENTRY  = "MPlayer";
   733 static const char *MAINMENUENTRY  = "MPlayer";
   732 
   734 
   733 class cPluginMPlayer : public cPlugin {
   735 class cPluginMPlayer : public cPlugin {
   734 private:
   736 private:
   735 #if APIVERSNUM >= 10330
   737 #if APIVERSNUM >= 10330
   822 #else
   824 #else
   823 bool cPluginMPlayer::Start(void)
   825 bool cPluginMPlayer::Start(void)
   824 #endif
   826 #endif
   825 {
   827 {
   826   if(!CheckVDRVersion(1,1,16,"mplayer")) return false;
   828   if(!CheckVDRVersion(1,1,16,"mplayer")) return false;
   827   i18n_name=Name();
   829   plugin_name="mplayer";
       
   830 #if APIVERSNUM < 10507
       
   831   i18n_name="mplayer";
       
   832 #else
       
   833   i18n_name="vdr-mplayer";
       
   834 #endif
   828   MPlaySources.Load(AddDirectory(ConfigDirectory(sourcesSub),"mplayersources.conf"));
   835   MPlaySources.Load(AddDirectory(ConfigDirectory(sourcesSub),"mplayersources.conf"));
   829   if(MPlaySources.Count()<1) {
   836   if(MPlaySources.Count()<1) {
   830     esyslog("ERROR: you must have defined at least one source in mplayersources.conf");
   837     esyslog("ERROR: you must have defined at least one source in mplayersources.conf");
   831     fprintf(stderr,"No source(s) defined in mplayersources.conf\n");
   838     fprintf(stderr,"No source(s) defined in mplayersources.conf\n");
   832     return false;
   839     return false;
   833     }
   840     }
       
   841 #if APIVERSNUM < 10507
   834   RegisterI18n(Phrases);
   842   RegisterI18n(Phrases);
       
   843 #endif
   835   if(!(status=new cMPlayerStatus)) return false;
   844   if(!(status=new cMPlayerStatus)) return false;
   836   return true;
   845   return true;
   837 }
   846 }
   838 
   847 
   839 const char *cPluginMPlayer::MainMenuEntry(void)
   848 const char *cPluginMPlayer::MainMenuEntry(void)