Ejemplo n.º 1
0
bool cMenuSearchResultsForList::BuildList()
{
   time_t now = time(NULL);
   int current = Current();

   Clear();
   eventObjects.Clear();
   searchResults->SortBy(m_bSort? CompareEventTime: CompareEventChannel);

   for (cSearchResult* pResultObj = searchResults->First();
        pResultObj;
        pResultObj = searchResults->Next(pResultObj))
   {
      if (ignoreRunning && now > pResultObj->event->StartTime())
         continue;
      Add(new cMenuSearchResultsItem(pResultObj->event, modeYellow == showEpisode, false, menuTemplate, pResultObj->search));
      eventObjects.Add(pResultObj->event);
   }
   if (Count())
      SetCurrent(Get(0));

   SetHelpKeys();

   SetCurrent(Get(current));
   Display();

   return true;
}
Ejemplo n.º 2
0
// --- cMenuSearchMain ---------------------------------------------------------
cMenuSearchMain::cMenuSearchMain(void)
:cOsdMenu("", GetTab(1), GetTab(2), GetTab(3), GetTab(4), GetTab(5))
{
#if VDRVERSNUM >= 10728
  SetMenuCategory(mcSchedule);
#endif
  helpKeys = -1;
  otherChannel = 0;
  toggleKeys = 0;
  shiftTime = 0;
  InWhatsOnMenu = false;
  InFavoritesMenu = false;
  cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel());
  schedules = cSchedules::Schedules(schedulesLock);
  if (channel) {
    cMenuWhatsOnSearch::SetCurrentChannel(channel->Number());
    if (EPGSearchConfig.StartMenu == 0 || forceMenu != 0)
      PrepareSchedule(channel);
    SetHelpKeys();
    cMenuWhatsOnSearch::currentShowMode = showNow;
    //    timeb tnow;
    //ftime(&tnow);
    //isyslog("duration epgs sched:  %d", tnow.millitm - gl_time.millitm + ((tnow.millitm - gl_time.millitm<0)?1000:0));

  }
  if ((EPGSearchConfig.StartMenu == 1 || forceMenu == 1) && forceMenu != 2)
    {
      InWhatsOnMenu = true;
      AddSubMenu(new cMenuWhatsOnSearch(schedules, cDevice::CurrentChannel()));
    }
  if (forceMenu == 3)
      ShowSummary();
}
Ejemplo n.º 3
0
cMenuEpgTimers::cMenuEpgTimers(void)
    :cOsdMenu(tr("Timers"), 2, CHNUMWIDTH, 10, 6, 6), SwitchTimersLock(&SwitchTimers)
{

  if (strcmp(Skins.Current()->Name(), "Reel") == 0)
#if APIVERSNUM < 10700
      SetCols(3, 10, 6, 10, 6);
#else

#if REELVDR && APIVERSNUM >= 10718
      SetCols(3, 12, 7, 6);
#else
      SetCols(3, 12, 7, 12, 7);
#endif /* REELVDR && APIVERSNUM >= 10718 */

#endif
#if REELVDR && APIVERSNUM >= 10718
  EnableSideNote(true);
#endif
  helpKeys = -1;
  Set();
  SetCurrent(First());
  SetHelpKeys();

  /* get timer state */
  TimerState_=0;
  Timers.Modified(TimerState_);
#ifdef USEMYSQL
  LastEventID_ = -1;
  LastEventID_ = Timers.GetLastEventID();
#endif


}
Ejemplo n.º 4
0
bool cMenuSearchResultsForBlacklist::BuildList()
{
   int current = Current();
   time_t now = time(NULL);
   cSearchResults* pSearchResults = blacklist->Run();
   Clear();
   eventObjects.Clear();
   if (pSearchResults)
   {
      pSearchResults->SortBy(m_bSort? CompareEventTime: CompareEventChannel);

      for (cSearchResult* pResultObj = pSearchResults->First();
           pResultObj;
           pResultObj = pSearchResults->Next(pResultObj))
      {
         if (ignoreRunning && now > pResultObj->event->StartTime())
            continue;
         Add(new cMenuSearchResultsItem(pResultObj->event, modeYellow == showEpisode, false));
         eventObjects.Add(pResultObj->event);
      }

      delete pSearchResults;
   }
   if (Count())
      SetCurrent(Get(0));
   SetHelpKeys();
   cString szTitle = cString::sprintf("%d %s - %s", Count(), tr("Blacklist results"), blacklist->search);
   SetTitle(szTitle);

   SetCurrent(Get(current));
   Display();

   return true;
}
Ejemplo n.º 5
0
eOSState cMenuSetupTimers::ProcessKey(eKeys Key)
{
    eOSState state = cMenuSetupSubMenu::ProcessKey(Key);

    const char* ItemText = Get(Current())->Text();
    int iOnDefRecDir = 0;
    int iOnDefTimerCheck = 0;
    if (!HasSubMenu())
    {
	if (strstr(ItemText, tr("Default recording dir")) == ItemText)
	    iOnDefRecDir = 1;
	else if (strstr(ItemText, tr("Default timer check method")) == ItemText)
	    iOnDefTimerCheck = 1;
    }
    SetHelpKeys();

    if (state == osUnknown) {
	switch (Key) {
	  case kBlue:
	      if (!HasSubMenu())
	      {
		  if (iOnDefRecDir == 1)
		      state = AddSubMenu(new cMenuDirSelect(data->defrecdir));
		  if (iOnDefTimerCheck == 1)
		      state = AddSubMenu(new cMenuDefTimerCheckMethod());
	      }
	      break;
	    case kOk:
		return osBack;
	    default: break;
	}
    }

    return state;
}
Ejemplo n.º 6
0
eOSState cMenuSetupMailNotification::ProcessKey(eKeys Key)
{
   int iTemp_MailUseAuth = data->MailUseAuth;
   int iTemp_sendMailOnSearchtimers = data->sendMailOnSearchtimers;
   int iTemp_mailViaScript = data->mailViaScript;

   const char* ItemText = Get(Current())->Text();
   bool bAuthPassWasInEditMode = false;
   if (ItemText && strlen(ItemText) > 0 && strstr(ItemText, IndentMenuItem(tr("Auth password"))) == ItemText)
      bAuthPassWasInEditMode = InEditMode(ItemText, IndentMenuItem(tr("Auth password")), tmpMailAuthPass);

   eOSState state = cMenuSetupSubMenu::ProcessKey(Key);

   ItemText = Get(Current())->Text();
   bool bAuthPassIsInEditMode = false;
   if (ItemText && strlen(ItemText) > 0 && strstr(ItemText, IndentMenuItem(tr("Auth password"))) == ItemText)
      bAuthPassIsInEditMode = InEditMode(ItemText, IndentMenuItem(tr("Auth password")), tmpMailAuthPass);

   if (bAuthPassWasInEditMode && !bAuthPassIsInEditMode)
   {
      strcpy(data->MailAuthPass, tmpMailAuthPass);
      string strHidden(strlen(data->MailAuthPass), '*');
      strcpy(tmpMailAuthPass, strHidden.c_str());
      Set();
      Display();
   }
   if (!bAuthPassWasInEditMode && bAuthPassIsInEditMode)
   {
      strcpy(tmpMailAuthPass, "");
      Set();
      Display();
      state = cMenuSetupSubMenu::ProcessKey(Key);
   }

   if (iTemp_MailUseAuth != data->MailUseAuth ||
       iTemp_mailViaScript != data->mailViaScript ||
       iTemp_sendMailOnSearchtimers != data->sendMailOnSearchtimers)
   {
      Set();
      Display();
   }

   SetHelpKeys();

   if (state == osUnknown) {
      switch (Key) {
         case kOk:
            return osBack;
         case kBlue:
            if (data->mailViaScript)
               return TestMailAccount();
            else
               return osContinue;
         default: break;
      }
   }

   return state;
}
Ejemplo n.º 7
0
eOSState cMenuSearchMain::Shift(int iMinutes)
{
    shiftTime += iMinutes;
    cChannel *channel = Channels.GetByNumber(currentChannel);
    PrepareSchedule(channel);
    Display();
    SetHelpKeys();
    return osContinue;
}
Ejemplo n.º 8
0
void cMenuSetupSearchtimers::Set()
{
  int current = Current();
  Clear();
  helpTexts.clear();

  Add(new cMenuEditBoolItem(tr("Use search timers"), &data->useSearchTimers, trVDR("no"), trVDR("yes")));
  AddHelp(tr("Help$'Search timers' can be used to automatically create timers for events that match your search criterions."));
  if (data->useSearchTimers)
  {
      Add(new cMenuEditIntItem(tr("  Update interval [min]"), &data->UpdateIntervall, 1, 9999));
      AddHelp(tr("Help$Specify here the time intervall to be used when searching for events in the background."));
      Add(new cMenuEditIntItem(tr("  SVDRP port"), &data->SVDRPPort, 1, 99999));
      AddHelp(tr("Help$Programming of new timers or timer changes is done with SVDRP. The default value should be correct, so change it only if you know what you are doing."));
      Add(new cMenuEditIntItem(IndentMenuItem(trVDR("Setup.Recording$Default priority")), &data->DefPriority, 0, MAXPRIORITY));
      AddHelp(tr("Help$Specify here the default priority of timers created with this plugin. This value can also be adjusted for each search itself."));
      Add(new cMenuEditIntItem(IndentMenuItem(trVDR("Setup.Recording$Default lifetime (d)")), &data->DefLifetime, 0, MAXLIFETIME));
      AddHelp(tr("Help$Specify here the default lifetime of timers/recordings created with this plugin. This value can also be adjusted for each search itself."));
      Add(new cMenuEditIntItem(IndentMenuItem(trVDR("Setup.Recording$Margin at start (min)")), &data->DefMarginStart));
      AddHelp(tr("Help$Specify here the default start recording margin of timers/recordings created with this plugin. This value can also be adjusted for each search itself."));
      Add(new cMenuEditIntItem(IndentMenuItem(trVDR("Setup.Recording$Margin at stop (min)")), &data->DefMarginStop));
      AddHelp(tr("Help$Specify here the default stop recording margin of timers/recordings created with this plugin. This value can also be adjusted for each search itself."));
      Add(new cMenuEditBoolItem(IndentMenuItem(tr("No announcements when replaying")), &data->noAnnounceWhileReplay, trVDR("no"), trVDR("yes")));
      AddHelp(tr("Help$Set this to 'yes' if you don't like to get any announcements of broadcasts if you currently replay anything."));
      Add(new cMenuEditBoolItem(IndentMenuItem(tr("Recreate timers after deletion")), &data->TimerProgRepeat, trVDR("no"), trVDR("yes")));
      AddHelp(tr("Help$Set this to 'yes' if you want timers to be recreated with the next search timer update after deleting them."));
      Add(new cMenuEditIntItem(IndentMenuItem(tr("Check if EPG exists for ... [h]")), &data->checkEPGHours, 0, 999));
      AddHelp(tr("Help$Specify how many hours of future EPG there should be and get warned else after a search timer update."));
      if (data->checkEPGHours > 0)
      {
	Add(new cMenuEditBoolItem(IndentMenuItem(tr("Warn by OSD"),2), &data->checkEPGWarnByOSD, trVDR("no"), trVDR("yes")));
	AddHelp(tr("Help$Set this to 'yes' if you want get warnings from the EPG check via OSD."));
	Add(new cMenuEditBoolItem(IndentMenuItem(tr("Warn by mail"),2), &data->checkEPGWarnByMail, trVDR("no"), trVDR("yes")));
	AddHelp(tr("Help$Set this to 'yes' if you want get warnings from the EPG check by mail."));

	// create the char array for the menu display
	if (menuitemsChGr) delete [] menuitemsChGr;
	menuitemsChGr = ChannelGroups.CreateMenuitemsList();
	Add(new cMenuEditStraItem(IndentMenuItem(tr("Channel group to check"),2), &data->checkEPGchannelGroupNr, ChannelGroups.Count()+1, menuitemsChGr));
	AddHelp(tr("Help$Specify the channel group to check."));
      }
  }

  Add(new cMenuEditBoolItem(  tr("Ignore PayTV channels"), &data->ignorePayTV, trVDR("no"), trVDR("yes")));
  AddHelp(tr("Help$Set this to 'yes' if don't want to see events on PayTV channels when searching for repeats."));
  Add(new cOsdItem(tr("Search templates")));
  AddHelp(tr("Help$Here you can setup templates for your searches."));
  Add(new cOsdItem(tr("Blacklists")));
  AddHelp(tr("Help$Here you can setup blacklists which can be used within a search to exclude events you don't like."));
  Add(new cOsdItem(tr("Channel groups")));
  AddHelp(tr("Help$Here you can setup channel groups which can be used within a search. These are different to VDR channel groups and represent a set of arbitrary channels, e.g. 'FreeTV'."));

  SetCurrent(Get(current));
  Display();
  SetHelpKeys();
}
Ejemplo n.º 9
0
void cMenuSetupMailNotification::Set()
{
  int current = Current();
  Clear();
  helpTexts.clear();

  Add(new cMenuEditBoolItem(tr("Search timer notification"), &data->sendMailOnSearchtimers, trVDR("no"), trVDR("yes")));
  AddHelp(tr("Help$Set this to 'yes' if you want to get an email notification about the search timers that where programmed automatically in the background."));

  if (data->sendMailOnSearchtimers)
  {
    Add(new cMenuEditIntItem(IndentMenuItem(tr("Time between mails [h]")), &data->sendMailOnSearchtimerHours,  0, 999999, ""));
    AddHelp(tr("Help$Specifiy how much time in [h] you would\nlike to have atleast between two mails.\nWith '0' you get a new mail after each\nsearch timer update with new results."));
  }
  Add(new cMenuEditBoolItem(tr("Timer conflict notification"), &data->sendMailOnConflicts, trVDR("no"), trVDR("yes")));
  AddHelp(tr("Help$Set this to 'yes' if you want to get an email notification about the timer conflicts."));

  Add(new cMenuEditStrItem(tr("Send to"), data->MailAddressTo, sizeof(data->MailAddressTo), MailBoxChars));
  AddHelp(tr("Help$Specify the email address where notifications should be sent to."));

  Add(new cMenuEditStraItem(tr("Mail method"), &data->mailViaScript, 2, MailMethod));
  AddHelp(tr("Help$Specify here the method to use when sending mails.\nYou can choose between\n - 'sendmail': requires a properly configured email system\n - 'SendEmail.pl': simple script for mail delivery"));

  if (data->mailViaScript)
  {
     cOsdItem* sep = new cOsdItem(tr("--- Email account ---"));
     sep->SetSelectable(false);
     Add(sep);
     AddHelp(" dummy");

     Add(new cMenuEditStrItem(tr("Email address"), data->MailAddress, sizeof(data->MailAddress), MailBoxChars));
     AddHelp(tr("Help$Specify the email address where notifications should be sent from."));

     Add(new cMenuEditStrItem(tr("SMTP server"), data->MailServer, sizeof(data->MailServer), HostNameChars));
     AddHelp(tr("Help$Specify the SMTP server that should deliver the notifications. If it's using a port different from the default(25) append the port with \":port\"."));
     Add(new cMenuEditBoolItem(tr("Use SMTP authentication"), &data->MailUseAuth, trVDR("no"), trVDR("yes")));
     AddHelp(tr("Help$Set this to 'yes' if your account needs authentication to send mails."));

     if (data->MailUseAuth)
     {
        Add(new cMenuEditStrItem(IndentMenuItem(tr("Auth user")), data->MailAuthUser, sizeof(data->MailAuthUser), UserNameChars));
        AddHelp(tr("Help$Specify the auth user, if this account needs authentication for SMTP."));
        Add(new cMenuEditStrItem(IndentMenuItem(tr("Auth password")), tmpMailAuthPass, sizeof(tmpMailAuthPass), PasswordChars));
        AddHelp(tr("Help$Specify the auth password, if this account needs authentication for SMTP."));
     }
  }

  SetCurrent(Get(current));
  Display();

  SetHelpKeys();
}
Ejemplo n.º 10
0
eOSState cMenuSetupSearchtimers::ProcessKey(eKeys Key)
{
    int iTemp_useSearchTimers = data->useSearchTimers;
    int iTemp_checkEPGHours = data->checkEPGHours;

    int iOnSearchTemplates = 0;
    int iOnBlacklists = 0;
    int iOnChannelGroups = 0;

    eOSState state = cMenuSetupSubMenu::ProcessKey(Key);

    if (iTemp_useSearchTimers != data->useSearchTimers ||
	iTemp_checkEPGHours != data->checkEPGHours)
    {
	Set();
	Display();
    }

    const char* ItemText = Get(Current())->Text();
    if (!HasSubMenu())
    {
	if (strstr(ItemText, tr("Search templates")) == ItemText)
	    iOnSearchTemplates = 1;
	else if (strstr(ItemText, tr("Blacklists")) == ItemText)
	    iOnBlacklists = 1;
	if (strstr(ItemText, tr("Channel groups")) == ItemText)
	    iOnChannelGroups = 1;
    }
    SetHelpKeys();

    if (state == osUnknown) {
	switch (Key) {
	    case kBlue:
		if (!HasSubMenu())
		{
		    if (iOnSearchTemplates == 1)
			state = AddSubMenu(new cMenuEPGSearchTemplate(NULL, NULL, false));
		    else if (iOnBlacklists == 1)
			state = AddSubMenu(new cMenuBlacklists);
		    else if (iOnChannelGroups == 1)
			state = AddSubMenu(new cMenuChannelGroups);
		}
		break;
	    case kOk:
		return osBack;
	    default: break;
	}
    }
    return state;
}
Ejemplo n.º 11
0
void cMenuSetupEPGMenus::Set()
{
    int current = Current();
    Clear();
    helpTexts.clear();

    Add(new cMenuEditStraItem(  tr("Ok key"), &data->useOkForSwitch, 2, OkKeyMode));
    AddHelp(tr("Help$Choose here the behaviour of key 'Ok'. You can use it to display the summary or to switch to the corresponding channel.\nNote: the functionality of key 'blue' (Switch/Info/Search) depends on this setting."));

    Add(new cMenuEditStraItem(tr("Red key"), &data->redkeymode, 2, RedKeyMode));
    AddHelp(tr("Help$Choose which standard function ('Record' or 'Commands') you like to have on the red key.\n(Can be toggled with key '0')"));
    Add(new cMenuEditStraItem(tr("Blue key"), &data->bluekeymode, 2, BlueKeyMode));
    AddHelp(tr("Help$Choose which standard function ('Switch'/'Info' or 'Search') you like to have on the blue key.\n(Can be toggled with key '0')"));

    Add(new cMenuEditBoolItem(tr("Show progress in 'Now'"), &data->showProgress, trVDR("no"), trVDR("yes")));
    AddHelp(tr("Help$Shows a progressbar in 'Overview - Now' that informs about the remaining time of the current event."));
    Add(new cMenuEditBoolItem(  tr("Show channel numbers"), &data->showChannelNr,       trVDR("no"),      trVDR("yes")));
    AddHelp(tr("Help$Display channel numbers in 'Overview - Now'.\n\n(To completely define your own menu look please inspect the MANUAL)"));
    Add(new cMenuEditBoolItem(  tr("Show channel separators"), &data->showChannelGroups,       trVDR("no"),      trVDR("yes")));
    AddHelp(tr("Help$Display VDR channel groups as separators between your channels in 'Overview - Now'."));
    Add(new cMenuEditBoolItem(  tr("Show day separators"), &data->showDaySeparators,       trVDR("no"),      trVDR("yes")));
    AddHelp(tr("Help$Display a separator line at day break in 'Schedule'."));
    Add(new cMenuEditBoolItem(  tr("Show radio channels"), &data->showRadioChannels,       trVDR("no"),      trVDR("yes")));
    AddHelp(tr("Help$Show also radio channels."));
    Add(new cMenuEditIntItem(tr("Limit channels from 1 to"), &data->maxChannelMenuNow, 0, 9999));
    AddHelp(tr("Help$If you have a large channel set you can speed up things when you limit the displayed channels with this setting. Use '0' to disable the limit."));
    Add(new cMenuEditBoolItem(  tr("'One press' timer creation"), &data->onePressTimerCreation,       trVDR("no"),      trVDR("yes")));
    AddHelp(tr("Help$When a timer is created with 'Record' you can choose between an immediate creation of the timer or the display of the timer edit menu."));
    Add(new cMenuEditBoolItem(  tr("Show channels without EPG"), &data->showEmptyChannels,       trVDR("no"),      trVDR("yes")));
    AddHelp(tr("Help$Choose 'yes' here if you want to display channels without EPG in 'Overview - Now'. 'Ok' on these entries switches the channel."));
    Add(new cMenuEditIntItem(tr("Time interval for FRew/FFwd [min]"), &data->timeShiftValue, 1, 9999));
    AddHelp(tr("Help$Choose here the time interval which should be used for jumping through the EPG by pressing FRew/FFwd.\n\n(If you don't have those keys, you can toggle to this functionality pressing '0' and get '<<' and '>>' on the keys green and yellow)"));
    Add(new cMenuEditBoolItem(  tr("Toggle Green/Yellow"), &data->toggleGreenYellow,       trVDR("no"),      trVDR("yes")));
    AddHelp(tr("Help$Specify if green and yellow shall also be switched when pressing '0'."));

    Add(new cMenuEditStraItem(  tr("Show favorites menu"), &data->showFavoritesMenu, 4, FavoritesMenuMode));
    AddHelp(tr("Help$A favorites menu can display a list of your favorite broadcasts. Enable this if you want an additional menu besides 'Now' and 'Next'\nAny search can be used as a favorite. You only have to set the option 'Use in favorites menu' when editing a search."));
    if (data->showFavoritesMenu)
    {
	Add(new cMenuEditIntItem( IndentMenuItem(tr("for the next ... hours")), &data->FavoritesMenuTimespan, 1, 9999));
	AddHelp(tr("Help$This value controls the timespan used to display your favorites."));
    }

    SetCurrent(Get(current));
    Display();
    SetHelpKeys();
}
Ejemplo n.º 12
0
void cMenuSetupTimers::Set()
{
  int current = Current();
  Clear();
  helpTexts.clear();

  //Add(new cMenuEditBoolItem(  tr("Use VDR's timer edit menu"),         &data->useVDRTimerEditMenu,       trVDR("no"),      trVDR("yes")));
  //AddHelp(tr("Help$This plugin has it's own timer edit menu extending the original one with some extra functionality like\n- an addtional directory entry\n- user-defined days of week for repeating timers\n- adding an episode name\n- support for EPG variables (see MANUAL)"));
  Add(new cMenuEditStrItem(tr("Default recording dir"), data->defrecdir, sizeof(data->defrecdir)));
  AddHelp(tr("Help$When creating a timer you can specify here a default recording directory."));
  Add(new cMenuEditStraItem(tr("Add episode to manual timers"), &data->addSubtitleToTimer, 3, AddSubtitleMode));
  AddHelp(tr("Help$If you create a timer for a series, you can automatically add the episode name.\n\n- never: no addition\n- always: always add episode name if present\n- smart: add only if event lasts less than 80 mins."));
  //Add(new cOsdItem(tr("Default timer check method")));
  //AddHelp(tr("Help$Manual timers can be checked for EPG changes. Here you can setup the default check method for each channel. Choose between\n\n- no checking\n- by event ID: checks by an event ID supplied by the channel provider.\n- by channel and time: check by the duration match."));

  SetCurrent(Get(current));
  Display();
  SetHelpKeys();
}
Ejemplo n.º 13
0
bool cMenuSearchResultsForSearch::BuildList()
{
   bool hasResults = false;
   int current = Current();
   Clear();
   time_t now = time(NULL);
   cSearchResults* pSearchResults = searchExt->Run(modeBlue == showNoPayTV?1:0, false, 0, NULL, modeBlue != showTimerPreview);
   Clear();
   eventObjects.Clear();

   if (pSearchResults)
   {
      pSearchResults->SortBy(m_bSort? CompareEventTime: CompareEventChannel);

      for (cSearchResult* pResultObj = pSearchResults->First();
           pResultObj;
           pResultObj = pSearchResults->Next(pResultObj))
      {
         if (ignoreRunning && now > pResultObj->event->StartTime())
            continue;
         if (!(searchExt->useAsSearchTimer && searchExt->avoidRepeats && modeBlue == showTimerPreview))
            pResultObj->needsTimer = false;
         hasResults = true;
         Add(new cMenuSearchResultsItem(pResultObj->event, modeYellow == showEpisode, pResultObj->needsTimer, menuTemplate));
         eventObjects.Add(pResultObj->event);
      }

      delete pSearchResults;
   }
   if (Count())
      SetCurrent(Get(0));
   SetHelpKeys(true);

   cString szTitle = cString::sprintf("%d %s - %s", Count(), tr("Search results"), searchExt->search);
   SetTitle(szTitle);

   SetCurrent(Get(current));
   Display();

   return hasResults;
}
Ejemplo n.º 14
0
void cMenuSetupSearchtimers::Set()
{
  int current = Current();
  Clear();
  helpTexts.clear();

  Add(new cMenuEditBoolItem(tr("Use search timers"), &data->useSearchTimers, trVDR("no"), trVDR("yes")));
  AddHelp(tr("Help$'Search timers' can be used to automatically create timers for events that match your search criterions."));
  if (data->useSearchTimers)
  {
      Add(new cMenuEditIntItem(tr("  Update interval [min]"), &data->UpdateIntervall, 1, 9999));
      AddHelp(tr("Help$Specify here the time intervall to be used when searching for events in the background."));
      AddHelp(tr("Help$Specify here the default lifetime of timers/recordings created with this plugin. This value can also be adjusted for each search itself."));
      Add(new cMenuEditIntItem(IndentMenuItem(tr("Setup.Recording$Time Buffer at Start (min)")), &data->DefMarginStart));
      AddHelp(tr("Help$Specify here the default start recording margin of timers/recordings created with this plugin. This value can also be adjusted for each search itself."));
      Add(new cMenuEditIntItem(IndentMenuItem(tr("Setup.Recording$Time Buffer at End (min)")), &data->DefMarginStop));
      AddHelp(tr("Help$Specify here the default stop recording margin of timers/recordings created with this plugin. This value can also be adjusted for each search itself."));
      Add(new cMenuEditBoolItem(IndentMenuItem(tr("No announcements when replaying")), &data->noAnnounceWhileReplay, trVDR("no"), trVDR("yes")));
      AddHelp(tr("Help$Set this to 'yes' if you don't like to get any announcements of broadcasts if you currently replay anything."));
#ifdef REELVDR
      Add(new cMenuEditBoolItem(IndentMenuItem(tr("Show pip on announcements")), &data->showPipOnAnnounce, trVDR("no"), trVDR("yes")));
      AddHelp(tr("Help$Set this to 'yes' if you want to show up the pip window with the announced channel."));
#endif
      Add(new cMenuEditBoolItem(IndentMenuItem(tr("Recreate timers after deletion")), &data->TimerProgRepeat, trVDR("no"), trVDR("yes")));
      AddHelp(tr("Help$Set this to 'yes' if you want timers to be recreated with the next search timer update after deleting them."));
  }

  Add(new cMenuEditBoolItem(  tr("Without PayTV channels"), &data->ignorePayTV, trVDR("no"), trVDR("yes")));
  AddHelp(tr("Help$Set this to 'yes' if don't want to see events on PayTV channels when searching for repeats."));
  Add(new cOsdItem(tr("Search templates")));
  AddHelp(tr("Help$Here you can setup templates for your searches."));
  Add(new cOsdItem(tr("Blacklists")));
  AddHelp(tr("Help$Here you can setup blacklists which can be used within a search to exclude events you don't like."));
//  Add(new cOsdItem(tr("Channel groups")));
//  AddHelp(tr("Help$Here you can setup channel groups which can be used within a search. These are different to VDR channel groups and represent a set of arbitrary channels, e.g. 'FreeTV'."));

  SetCurrent(Get(current));
  Display();
  SetHelpKeys();
}
Ejemplo n.º 15
0
eOSState cMenuEpgTimers::ProcessKey(eKeys Key)
{
  //int TimerNumber = HasSubMenu() ? Count() : -1;

  eOSState state = cOsdMenu::ProcessKey(Key);

#if REELVDR && APIVERSNUM >= 10718
  if (Key != kNone && state != osUnknown)
      ShowEventDetailsInSideNote();
#endif

  if (state == osUnknown) {
     switch (Key) {
       /// Löschen | Neu | Ein/Aus | (frei) | Info
       case kOk:     Timers.Count() ? state = Edit() : state = New(); break;
       case kRed:    state = Delete(); break; // must go through SetHelpKeys()!
       case kGreen:  return New(); break;
       case kYellow: state = OnOff(); break;
       case kBlue:   return osContinue; break;
       case kInfo:   return Info(); break;
       default: break;
       }
     }
/* redraw osd *ONLY* if Timers were modified and it is not a submenu, not with everykey stroke! */
#if 0
#ifdef USEMYSQL
if (!HasSubMenu() && (Timers.Modified(TimerState_) || (Timers.GetLastEventID() != LastEventID_)))
#else
if (!HasSubMenu() && (Timers.Modified(TimerState_) || (lastSet != time(0))))
#endif
#else
// We want to see changes in timers flag so we need to poll...
if (!HasSubMenu() && (lastSet != time(0)))
#endif
{
	Set();
	SetHelpKeys();
	Display();
#ifdef USEMYSQL
    LastEventID_ = Timers.GetLastEventID();
#endif
}
else if (!HasSubMenu())
    switch(Key) // update the info buttons
    {
        default: break;
        case kUp:
        case kUp|k_Repeat:
        case kDown:
        case kDown|k_Repeat:
        case kRight:
        case kRight|k_Repeat:
        case kLeft:
        case kLeft|k_Repeat:
            //activity of current timer may have chanched
            helpKeys = -1;
            SetHelpKeys();
            break;
    }
/*
  if (TimerNumber != -1 && TimerNumber != Timers.Count()) {
     Set();
     SetHelpKeys();
     Display();
  } else if (Key != kNone && !HasSubMenu()) {
     Set();
     SetHelpKeys();
     //Display();
  }
*/

  return state;
}
Ejemplo n.º 16
0
eOSState cMenuSearchResults::Record(void)
{
   UpdateCurrent();
   cMenuSearchResultsItem *item = (cMenuSearchResultsItem *)Get(Current());
   if (item) {
      if (item->timerMatch == tmFull)
      {
         eTimerMatch tm = tmNone;
         cTimer *timer = Timers.GetMatch(item->event, &tm);
         if (timer)
	   {
	     if (EPGSearchConfig.useVDRTimerEditMenu)
               return AddSubMenu(new cMenuEditTimer(timer));
	     else
               return AddSubMenu(new cMenuMyEditTimer(timer, false, item->event));
	   }
      }

      cTimer *timer = new cTimer(item->event);
      PrepareTimerFile(item->event, timer);
      cTimer *t = Timers.GetTimer(timer);
      if (EPGSearchConfig.onePressTimerCreation == 0 || t || !item->event || (!t && item->event && item->event->StartTime() - (Setup.MarginStart+2) * 60 < time(NULL)))
      {
         if (t)
         {
            delete timer;
            timer = t;
         }
         if (EPGSearchConfig.useVDRTimerEditMenu)
            return AddSubMenu(new cMenuEditTimer(timer, !t));
         else
            return AddSubMenu(new cMenuMyEditTimer(timer, !t, item->event));
      }
      else
      {
         string fullaux = "";
         string aux = "";
         if (item->event)
         {
            const cEvent* event = item->event;
            int bstart = event->StartTime() - timer->StartTime();
            int bstop = timer->StopTime() - event->EndTime();
            int checkmode = DefTimerCheckModes.GetMode(timer->Channel());
            aux = UpdateAuxValue(aux, "channel", NumToString(timer->Channel()->Number()) + " - " + CHANNELNAME(timer->Channel()));
            aux = UpdateAuxValue(aux, "update", checkmode);
            aux = UpdateAuxValue(aux, "eventid", event->EventID());
            aux = UpdateAuxValue(aux, "bstart", bstart);
            aux = UpdateAuxValue(aux, "bstop", bstop);
            fullaux = UpdateAuxValue(fullaux, "epgsearch", aux);
         }

#ifdef USE_PINPLUGIN
         aux = "";
	 aux = UpdateAuxValue(aux, "protected", timer->FskProtection() ? "yes" : "no");
         fullaux = UpdateAuxValue(fullaux, "pin-plugin", aux);
#endif

         SetAux(timer, fullaux);
         Timers.Add(timer);
	 gl_timerStatusMonitor->SetConflictCheckAdvised();
         timer->Matches();
         Timers.SetModified();
         LogFile.iSysLog("timer %s added (active)", *timer->ToDescr());

         if (HasSubMenu())
            CloseSubMenu();
         if (Update())
            Display();
         SetHelpKeys();
      }
   }
   return osContinue;
}
Ejemplo n.º 17
0
eOSState cMenuSearchMain::ProcessKey(eKeys Key)
{
    bool HadSubMenu = HasSubMenu();
    eOSState state = cOsdMenu::ProcessKey(Key);

    if (exitToMainMenu == 1)
    {
	exitToMainMenu = 0;
	return osBack;
    }

   if (!HasSubMenu() && HadSubMenu)
      UpdateCurrent();

    if (state == osUnknown) {
	switch (Key) {
	 case kFastRew:
	     if (HasSubMenu() && !InWhatsOnMenu && !InFavoritesMenu)
	     {
/*            if (Count())
            {
               CursorUp();
               return ShowSummary();
            }
*/	     }
	     else
            return Shift(-EPGSearchConfig.timeShiftValue);
	 case kFastFwd:
	     if (HasSubMenu() && !InWhatsOnMenu && !InFavoritesMenu)
	     {
/*		 if (Count())
		 {
		     CursorDown();
		     return ShowSummary();
		 }
*/	     }
	     else
		 return Shift(EPGSearchConfig.timeShiftValue);
	 case kRecord:
	 case kRed:
	     if(HasSubMenu()) {
            UpdateCurrent();
            state = Record();
            break;
	     }
	     if (Count())
	     {
		 if (EPGSearchConfig.redkeymode==toggleKeys)
		     state = Record();
		 else
		 {
		     cMenuMyScheduleItem *mi = (cMenuMyScheduleItem *)Get(Current());
		     if (mi) {
			 if (mi->event) {
			     return AddSubMenu(new cMenuSearchCommands(tr("EPG Commands"),mi->event));
			 }
		     }
		 }
	     }
	     break;
	 case k0:
	     if(!HasSubMenu())
	     {
		 toggleKeys = 1 - toggleKeys;
		 SetHelpKeys(true);
	     }
	     state = osContinue;
	     break;
	 case k1...k9:
	     if (!HasSubMenu())
		 return Commands(Key);
	     else
		 state = osContinue;
	     break;
	 case kGreen:
	     if (schedules)
	     {
		 if (HasSubMenu() && !InWhatsOnMenu && !InFavoritesMenu)
		 {
		     if (Count())
		     {
//			 CursorUp();
//			 return ShowSummary();
		     }
		 }
		 else if (toggleKeys == 0 || (toggleKeys == 1 && EPGSearchConfig.toggleGreenYellow == 0))
		 {
		     int ChannelNr = cDevice::CurrentChannel();
		     if (Count()) {
			 cMenuMyScheduleItem* Item = (cMenuMyScheduleItem *)Get(Current());
			 if (Item && Item->event)
			 {
			     cChannel *channel = Channels.GetByChannelID(Item->event->ChannelID(), true, true);
			     if (channel)
				 ChannelNr = channel->Number();
			 }
		     }
		     if (cMenuWhatsOnSearch::currentShowMode == showFavorites)
		     {
			 InFavoritesMenu = true;
			 return AddSubMenu(new cMenuFavorites());
		     }
		     else
		     {
			 InWhatsOnMenu = true;
			 return AddSubMenu(new cMenuWhatsOnSearch(schedules, ChannelNr));
		     }
		 }
		 else
		 {
		     cChannel *channel = Channels.GetByNumber(currentChannel-1,-1);

		     if (channel) {
			 PrepareSchedule(channel);
			 if (channel->Number() != cDevice::CurrentChannel()) {
			     otherChannel = channel->Number();
			 }
			 Display();
		     }
		     SetHelpKeys(true);
		     return osContinue;
		 }
	     }
	 case kYellow:
	     if (schedules)
	     {
		 if (HasSubMenu())
		 {
		     if (Count())
		     {
//			 CursorDown();
//			 return ShowSummary();
		     }
		 }
		 else if (toggleKeys == 0 || (toggleKeys == 1 && EPGSearchConfig.toggleGreenYellow == 0))
		 {
		     cMenuWhatsOnSearch::currentShowMode = showNext;
		     InWhatsOnMenu = true;
		     return AddSubMenu(new cMenuWhatsOnSearch(schedules, cMenuWhatsOnSearch::CurrentChannel()));
		 }
		 else
		 {
		     cChannel *channel = Channels.GetByNumber(currentChannel+1,1);
		     if (channel) {
			 PrepareSchedule(channel);
			 if (channel->Number() != cDevice::CurrentChannel()) {
			     otherChannel = channel->Number();
			 }
			 Display();
		     }
		     SetHelpKeys(true);
		     return osContinue;
		 }
	     }
	     break;
	 case kBlue:
        if (HasSubMenu())
        {
           UpdateCurrent();
           return Switch();
        }
	     if (EPGSearchConfig.bluekeymode==toggleKeys)
		 return Switch();
	     else
		 return ExtendedSearch();
	     break;
	case kInfo:
	case kOk:
	   if (Count())
	       return ShowSummary();
	   break;
	 default:
	     break;
	}
    }
    if (!HasSubMenu()) {
      cChannel *ch = cMenuWhatsOnSearch::ScheduleChannel();
      InWhatsOnMenu = false;
      InFavoritesMenu = false;
      if (ch) {
	// when switch from the other menus to the schedule, try to keep the same time
       	if (cMenuWhatsOnSearch::shiftTime)
	  {
	    time_t diff = cMenuWhatsOnSearch::seekTime - time(NULL);
	    shiftTime = (diff + (diff>0?30:-30)) / 60 ;
	  }
	else
	  shiftTime = 0;

	PrepareSchedule(ch);
	if (ch->Number() != cDevice::CurrentChannel()) {
	  otherChannel = ch->Number();
	}
	Display();
      }
      else if ((HadSubMenu || gl_TimerProgged) && Update())
      {
	  if (gl_TimerProgged) // when using epgsearch's timer edit menu, update is delayed because of SVDRP
	  {
	      gl_TimerProgged = 0;
	      SetHelpKeys();
	  }
	  Display();
      }
      if (Key != kNone)
	  SetHelpKeys();
      if (gl_InfoConflict)
      {
	  gl_InfoConflict = 0;
	  if (Interface->Confirm(tr("Timer conflict! Show?")))
	      return AddSubMenu(new cMenuConflictCheck());
      }
  }
  return state;
}
Ejemplo n.º 18
0
eOSState cMenuSearchResults::ProcessKey(eKeys Key)
{
   bool HadSubMenu = HasSubMenu();
   eOSState state = cOsdMenu::ProcessKey(Key);

   if (!HasSubMenu() && HadSubMenu) // navigation in summary could have changed current item, so update it
      UpdateCurrent();

   if (state == osUnknown) {
      switch (Key) {
         case k0:
            if(!HasSubMenu())
            {
               toggleKeys = 1 - toggleKeys;
               SetHelpKeys(true);
            }
            state = osContinue;
            break;
         case kGreen:
            state = OnGreen();
            break;
         case kYellow:
            state = OnYellow();
            break;
         case kOk:
      case kInfo:
            if(HasSubMenu())
            {
               state = cOsdMenu::ProcessKey(Key);
               break;
            }
            if (Count())
               state = ShowSummary();
            else
               state = osBack;
            break;
         default:
            break;
      }
   }
   if (!HasSubMenu())
   {
      if ((HadSubMenu || gl_TimerProgged) && Update())
      {
         if (gl_TimerProgged) // when using epgsearch's timer edit menu, update is delayed because of SVDRP
         {
            gl_TimerProgged = 0;
            SetHelpKeys();
         }
         Display();
      }
      if (Key != kNone)
         SetHelpKeys();
      if (gl_InfoConflict)
      {
         gl_InfoConflict = 0;
         if (Interface->Confirm(tr("Timer conflict! Show?")))
            state = AddSubMenu(new cMenuConflictCheck());
      }
   }
   return state;
}