vdr-plugin-tvguide/recmenus.h

478 lines
17 KiB
C
Raw Normal View History

2013-12-07 15:51:50 +01:00
#ifndef __TVGUIDE_RECMENUS_H
#define __TVGUIDE_RECMENUS_H
#define TEXTINPUTLENGTH 256
2013-12-07 15:51:50 +01:00
#include <vector>
#include <functional>
2013-12-07 15:51:50 +01:00
#include <vdr/epg.h>
#include "services/epgsearch.h"
#include "switchtimer.h"
2013-12-07 15:51:50 +01:00
#include "recmanager.h"
typedef enum {
searchTimerActionRecord = 0,
searchTimerActionAnnounceViaOSD,
searchTimerActionSwitchOnly,
searchTimerActionAnnounceAndSwitch,
searchTimerActionAnnounceViaMail,
searchTimerActionInactiveRecord
} searchTimerAction;
2013-12-07 15:51:50 +01:00
// --- cRecMenuMain ---------------------------------------------------------
class cRecMenuMain : public cRecMenu {
public:
cRecMenuMain(bool epgSearchAvailable, bool timerActive, bool switchTimerActive);
virtual ~cRecMenuMain(void) {};
};
/******************************************************************************************
* Instant Timer Menus
******************************************************************************************/
2013-12-07 15:51:50 +01:00
// --- cRecMenuAskFolder ---------------------------------------------------------
class cRecMenuAskFolder: public cRecMenu {
private:
std::vector<std::string> folders;
2013-12-07 15:51:50 +01:00
eRecMenuState NextAction;
public:
cRecMenuAskFolder(const cEvent *event, eRecMenuState nextAction);
cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void);
virtual ~cRecMenuAskFolder(void) {};
std::string GetFolder(void);
2013-12-07 15:51:50 +01:00
};
// --- cRecMenuConfirmTimer ---------------------------------------------------------
class cRecMenuConfirmTimer: public cRecMenu {
public:
cRecMenuConfirmTimer(const cEvent *event);
virtual ~cRecMenuConfirmTimer(void) {};
};
// --- cRecMenuConfirmDeleteTimer ---------------------------------------------------------
class cRecMenuConfirmDeleteTimer: public cRecMenu {
public:
cRecMenuConfirmDeleteTimer(const cEvent *event);
virtual ~cRecMenuConfirmDeleteTimer(void) {};
};
// --- cRecMenuAskDeleteTimer ---------------------------------------------------------
class cRecMenuAskDeleteTimer: public cRecMenu {
public:
cRecMenuAskDeleteTimer(const cEvent *event);
virtual ~cRecMenuAskDeleteTimer(void) {};
};
// --- cRecMenuTimerConflicts ---------------------------------------------------------
class cRecMenuTimerConflicts: public cRecMenu {
public:
cRecMenuTimerConflicts(cTVGuideTimerConflicts *conflicts);
2013-12-07 15:51:50 +01:00
virtual ~cRecMenuTimerConflicts(void) {};
int GetTimerConflict(void);
2013-12-07 15:51:50 +01:00
};
// --- cRecMenuTimerConflict ---------------------------------------------------------
class cRecMenuTimerConflict: public cRecMenu {
private:
cTVGuideTimerConflict *conflict;
2013-12-07 15:51:50 +01:00
public:
cRecMenuTimerConflict(cTVGuideTimerConflict *conflict);
2013-12-07 15:51:50 +01:00
cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void);
virtual ~cRecMenuTimerConflict(void) {};
int GetTimerConflictIndex(void);
2013-12-07 15:51:50 +01:00
};
// --- cRecMenuNoTimerConflict ---------------------------------------------------------
class cRecMenuNoTimerConflict: public cRecMenu {
public:
cRecMenuNoTimerConflict(void);
virtual ~cRecMenuNoTimerConflict(void) {};
};
// --- cRecMenuRerunResults ---------------------------------------------------------
class cRecMenuRerunResults: public cRecMenu {
private:
const cEvent **reruns;
int numReruns;
public:
cRecMenuRerunResults(const cEvent *original, const cEvent **reruns, int numReruns);
cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void);
virtual ~cRecMenuRerunResults(void) {
delete[] reruns;
};
const cEvent *GetRerunEvent(void);
};
// --- cRecMenuNoRerunsFound ---------------------------------------------------------
class cRecMenuNoRerunsFound: public cRecMenu {
public:
cRecMenuNoRerunsFound(cString searchString);
virtual ~cRecMenuNoRerunsFound(void) {};
};
// --- cRecMenuConfirmRerunUsed ---------------------------------------------------------
class cRecMenuConfirmRerunUsed: public cRecMenu {
public:
cRecMenuConfirmRerunUsed(const cEvent *original, const cEvent *replace);
virtual ~cRecMenuConfirmRerunUsed(void) {};
};
2013-12-07 15:51:50 +01:00
// --- cRecMenuEditTimer ---------------------------------------------------------
class cRecMenuEditTimer: public cRecMenu {
private:
2018-03-08 13:02:38 +01:00
const cTimer *originalTimer;
bool timerActive;
time_t day;
int start;
int stop;
int prio;
int lifetime;
char folder[TEXTINPUTLENGTH];
public:
2018-03-08 13:02:38 +01:00
cRecMenuEditTimer(const cTimer *timer, eRecMenuState nextState);
const cTimer *GetOriginalTimer(void);
2013-12-07 15:51:50 +01:00
virtual ~cRecMenuEditTimer(void) {};
cTimer GetTimer(void);
2013-12-07 15:51:50 +01:00
};
/******************************************************************************************
* Series Timer Menus
******************************************************************************************/
2013-12-07 15:51:50 +01:00
// --- cRecMenuSeriesTimer ---------------------------------------------------------
class cRecMenuSeriesTimer: public cRecMenu {
std::string folder;
bool timerActive;
int channel;
time_t tstart;
int start;
int stop;
int dayOfWeek;
int priority;
int lifetime;
void CalculateTimes(const cEvent *event);
public:
2018-03-08 13:02:38 +01:00
cRecMenuSeriesTimer(const cChannel *initialChannel, const cEvent *event, std::string folder);
2013-12-07 15:51:50 +01:00
virtual ~cRecMenuSeriesTimer(void) {};
cTimer *GetTimer(void);
2013-12-07 15:51:50 +01:00
};
// --- cRecMenuConfirmSeriesTimer ---------------------------------------------------------
class cRecMenuConfirmSeriesTimer: public cRecMenu {
public:
cRecMenuConfirmSeriesTimer(cTimer *seriesTimer);
virtual ~cRecMenuConfirmSeriesTimer(void) {};
};
/******************************************************************************************
* SearchTimer Menus
******************************************************************************************/
2013-12-07 15:51:50 +01:00
// --- cRecMenuSearchTimer ---------------------------------------------------------
class cRecMenuSearchTimer: public cRecMenu {
private:
char searchString[TEXTINPUTLENGTH];
2013-12-07 15:51:50 +01:00
public:
cRecMenuSearchTimer(const cEvent *event);
virtual ~cRecMenuSearchTimer(void) {};
std::string GetSearchString(void) { return searchString; };
2013-12-07 15:51:50 +01:00
};
// --- cRecMenuSearchTimerTemplates ---------------------------------------------------------
class cRecMenuSearchTimerTemplates: public cRecMenu {
private:
int numTemplates;
cTVGuideSearchTimer searchTimer;
2013-12-07 15:51:50 +01:00
std::vector<TVGuideEPGSearchTemplate> templates;
public:
cRecMenuSearchTimerTemplates(cTVGuideSearchTimer searchTimer, std::vector<TVGuideEPGSearchTemplate> templates);
2013-12-07 15:51:50 +01:00
cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void);
virtual ~cRecMenuSearchTimerTemplates(void) {};
cTVGuideSearchTimer GetSearchTimer(void) { return searchTimer; };
TVGuideEPGSearchTemplate GetTemplate(void);
2013-12-07 15:51:50 +01:00
};
// --- cRecMenuSearchTimers ---------------------------------------------------------
class cRecMenuSearchTimers: public cRecMenu {
2013-12-07 15:51:50 +01:00
private:
int numSearchTimers;
std::vector<cTVGuideSearchTimer> searchTimers;
void SetMenuItems(void);
2013-12-07 15:51:50 +01:00
public:
cRecMenuSearchTimers(std::vector<cTVGuideSearchTimer> searchTimers);
cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void);
cTVGuideSearchTimer GetSearchTimer(void);
virtual ~cRecMenuSearchTimers(void);
2013-12-07 15:51:50 +01:00
};
// --- cRecMenuSearchTimerEdit ---------------------------------------------------------
class cRecMenuSearchTimerEdit: public cRecMenu {
2013-12-07 15:51:50 +01:00
private:
cTVGuideSearchTimer sT;
std::vector<std::string> searchModes;
std::vector<std::string> useChannelModes;
std::vector<std::string> channelGroups;
std::vector<std::string> compareDateModes;
std::vector<std::string> searchTimerModes;
std::vector<std::string> delModes;
std::vector<std::string> channelgroups;
std::vector<cRecMenuItem*> mainMenuItems;
2019-07-15 15:23:14 +02:00
cString indent;
bool init;
int numMenuItems;
int useChannelPos;
int useTimePos;
int useDayOfWeekPos;
int DayOfWeek(int dayofWeek = 0);
int SetDayOfWeek(int VDRDayOfWeek);
int avoidRepeatsPos;
char searchString[TEXTINPUTLENGTH];
bool timerActive;
int startChannel;
int stopChannel;
int channelgroupIndex;
int dayOfWeek;
char directory[TEXTINPUTLENGTH];
int SplitChannelGroups(std::vector<std::string> *channelGroups, std::vector<std::string> *channelgroups);
public:
cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer, std::vector<std::string> channelGroups);
2013-12-07 15:51:50 +01:00
void CreateMenuItems(void);
virtual ~cRecMenuSearchTimerEdit(void);
cTVGuideSearchTimer GetSearchTimer(void);
cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void);
};
// --- cRecMenuSearchTimerDeleteConfirm ---------------------------------------------
class cRecMenuSearchTimerDeleteConfirm: public cRecMenu {
private:
cTVGuideSearchTimer searchTimer;
public:
cRecMenuSearchTimerDeleteConfirm(cTVGuideSearchTimer searchTimer);
virtual ~cRecMenuSearchTimerDeleteConfirm(void);
cTVGuideSearchTimer GetSearchTimer(void);
};
// --- cRecMenuSearchTimerCreateConfirm ---------------------------------------------------------
class cRecMenuSearchTimerCreateConfirm: public cRecMenu {
private:
public:
cRecMenuSearchTimerCreateConfirm(bool success);
virtual ~cRecMenuSearchTimerCreateConfirm(void) {};
};
// --- cRecMenuSearchTimerTemplatesCreate ---------------------------------------------------------
class cRecMenuSearchTimerTemplatesCreate: public cRecMenu {
private:
TVGuideEPGSearchTemplate templ;
cTVGuideSearchTimer searchTimer;
public:
cRecMenuSearchTimerTemplatesCreate(TVGuideEPGSearchTemplate templ, cTVGuideSearchTimer searchTimer);
virtual ~cRecMenuSearchTimerTemplatesCreate(void) {};
cTVGuideSearchTimer GetSearchTimer(void) { return searchTimer; };
TVGuideEPGSearchTemplate GetTemplate(void) { return templ; };
2013-12-07 15:51:50 +01:00
};
// --- cRecMenuSearchTimerResults ---------------------------------------------------------
class cRecMenuSearchTimerResults: public cRecMenu {
private:
const cEvent **searchResults;
int numResults;
eRecMenuState action2;
2013-12-07 15:51:50 +01:00
public:
cRecMenuSearchTimerResults(std::string searchString, const cEvent **searchResults, int numResults, std::string templateName = "", eRecMenuState action2 = rmsDisabled);
2013-12-07 15:51:50 +01:00
cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void);
virtual ~cRecMenuSearchTimerResults(void) {
delete[] searchResults;
};
const cEvent *GetEvent(void);
2013-12-07 15:51:50 +01:00
};
// --- cRecMenuSearchTimerNothingFound ---------------------------------------------------------
class cRecMenuSearchTimerNothingFound: public cRecMenu {
public:
cRecMenuSearchTimerNothingFound(std::string searchString);
2013-12-07 15:51:50 +01:00
virtual ~cRecMenuSearchTimerNothingFound(void) {};
};
/******************************************************************************************
* SwitchTimer Menus
******************************************************************************************/
2013-12-07 15:51:50 +01:00
// --- cRecMenuSwitchTimer ---------------------------------------------------------
class cRecMenuSwitchTimer: public cRecMenu {
private:
int switchMinsBefore;
2019-04-05 11:35:45 +02:00
int switchMode;
2013-12-07 15:51:50 +01:00
public:
cRecMenuSwitchTimer(void);
virtual ~cRecMenuSwitchTimer(void) {};
cSwitchTimer GetSwitchTimer(void);
2013-12-07 15:51:50 +01:00
};
// --- cRecMenuSwitchTimerConfirm ---------------------------------------------------------
class cRecMenuSwitchTimerConfirm: public cRecMenu {
private:
public:
cRecMenuSwitchTimerConfirm(bool success);
virtual ~cRecMenuSwitchTimerConfirm(void) {};
};
// --- cRecMenuSwitchTimerDelete ---------------------------------------------------------
class cRecMenuSwitchTimerDelete: public cRecMenu {
private:
public:
cRecMenuSwitchTimerDelete(void);
virtual ~cRecMenuSwitchTimerDelete(void) {};
};
/******************************************************************************************
* Search Menus
******************************************************************************************/
2013-12-07 15:51:50 +01:00
// --- cRecMenuSearch ---------------------------------------------------------
class cRecMenuSearch: public cRecMenu {
private:
char searchString[TEXTINPUTLENGTH];
int mode;
int channelNr;
bool useTitle;
bool useSubTitle;
bool useDescription;
public:
cRecMenuSearch(std::string searchString, bool withOptions);
2013-12-07 15:51:50 +01:00
virtual ~cRecMenuSearch(void) {};
Epgsearch_searchresults_v1_0 GetEPGSearchStruct(void);
std::string GetSearchString(void) { return searchString; };
2013-12-07 15:51:50 +01:00
};
// --- cRecMenuSearchResults ---------------------------------------------------------
class cRecMenuSearchResults: public cRecMenu {
private:
std::string searchString;
2013-12-07 15:51:50 +01:00
const cEvent **searchResults;
int numResults;
public:
cRecMenuSearchResults(std::string searchString, const cEvent **searchResults, int numResults);
2013-12-07 15:51:50 +01:00
cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void);
virtual ~cRecMenuSearchResults(void) {
delete[] searchResults;
};
const cEvent *GetEvent(void);
std::string GetSearchString(void) { return searchString; };
2013-12-07 15:51:50 +01:00
};
// --- cRecMenuSearchConfirmTimer ---------------------------------------------------------
class cRecMenuSearchConfirmTimer: public cRecMenu {
public:
cRecMenuSearchConfirmTimer(const cEvent *event, eRecMenuState nextAction);
2013-12-07 15:51:50 +01:00
virtual ~cRecMenuSearchConfirmTimer(void) {};
};
// --- cRecMenuSearchNothingFound ---------------------------------------------------------
class cRecMenuSearchNothingFound: public cRecMenu {
public:
cRecMenuSearchNothingFound(std::string searchString, bool tooShort = false);
2013-12-07 15:51:50 +01:00
virtual ~cRecMenuSearchNothingFound(void) {};
};
/******************************************************************************************
* Recording Search Menus
******************************************************************************************/
2013-12-07 15:51:50 +01:00
// --- cRecMenuRecordingSearch ---------------------------------------------------------
class cRecMenuRecordingSearch: public cRecMenu {
private:
char searchString[TEXTINPUTLENGTH];
2013-12-07 15:51:50 +01:00
public:
cRecMenuRecordingSearch(std::string search);
2013-12-07 15:51:50 +01:00
virtual ~cRecMenuRecordingSearch(void) {};
std::string GetSearchString(void) { return searchString; };
2013-12-07 15:51:50 +01:00
};
// --- cRecMenuRecordingSearchResults ---------------------------------------------------------
class cRecMenuRecordingSearchResults: public cRecMenu {
private:
std::string searchString;
2018-03-08 13:02:38 +01:00
const cRecording **searchResults;
2013-12-07 15:51:50 +01:00
int numResults;
public:
2018-03-08 13:02:38 +01:00
cRecMenuRecordingSearchResults(std::string searchString, const cRecording **searchResults, int numResults);
2013-12-07 15:51:50 +01:00
cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void);
virtual ~cRecMenuRecordingSearchResults(void) {
delete[] searchResults;
};
std::string GetSearchString(void) { return searchString; };
2013-12-07 15:51:50 +01:00
};
// --- cRecMenuRecordingSearchNotFound ---------------------------------------------------------
class cRecMenuRecordingSearchNotFound: public cRecMenu {
public:
cRecMenuRecordingSearchNotFound(std::string searchString);
2013-12-07 15:51:50 +01:00
virtual ~cRecMenuRecordingSearchNotFound(void) {};
};
/******************************************************************************************
* Timeline
******************************************************************************************/
// --- cRecMenuTimeline ---------------------------------------------------------
class cRecMenuTimeline: public cRecMenu {
private:
2018-03-08 13:02:38 +01:00
std::vector<const cTimer*> timersToday;
int numTimersToday;
time_t today;
time_t timeStart;
time_t timeStop;
cTVGuideTimerConflicts *timerConflicts;
std::vector<cTVGuideTimerConflict*> conflictsToday;
cRecMenuItemTimelineHeader *header;
void SetStartStop(void);
void GetTimersForDay(void);
void SetTimers(void);
void PrevDay(void);
void NextDay(void);
void ClearMenu(void);
public:
cRecMenuTimeline(cTVGuideTimerConflicts *timerConflicts);
2019-03-30 18:06:47 +01:00
virtual ~cRecMenuTimeline(void) {};
cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void);
eRecMenuState ProcessKey(eKeys Key);
2018-03-08 13:02:38 +01:00
const cTimer *GetTimer(void);
};
2013-12-07 15:51:50 +01:00
/******************************************************************************************
* Favorites
******************************************************************************************/
// --- cRecMenuFavorites ---------------------------------------------------------
class cRecMenuFavorites: public cRecMenu {
private:
std::vector<cTVGuideSearchTimer> favorites;
std::vector<cRecMenuItem*> myMenuItems;
int numFavorites;
void CreateFavoritesMenuItems(void);
std::string NiceTime(int favTime);
public:
cRecMenuFavorites(std::vector<cTVGuideSearchTimer> favorites);
cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void);
cTVGuideSearchTimer GetFavorite(void);
virtual ~cRecMenuFavorites(void);
};
2019-03-30 18:06:47 +01:00
#endif //__TVGUIDE_RECMENUS_H