Add switchMode to setup menu

This commit is contained in:
kamel5 2019-04-05 11:35:45 +02:00
parent 8ae5d34bef
commit 9df447454c
10 changed files with 32 additions and 19 deletions

View File

@ -64,6 +64,7 @@ cTvguideConfig::cTvguideConfig() {
favLimitChannels = 0;
favStartChannel = 0;
favStopChannel = 0;
switchMode = 0;
switchMinsBefore = 2;
fontIndex = 0;
fontNameDefault = "VDRSymbols Sans:Book";
@ -300,6 +301,7 @@ bool cTvguideConfig::SetupParse(const char *Name, const char *Value) {
else if (strcmp(Name, "favLimitChannels") == 0) favLimitChannels = atoi(Value);
else if (strcmp(Name, "favStartChannel") == 0) favStartChannel = atoi(Value);
else if (strcmp(Name, "favStopChannel") == 0) favStopChannel = atoi(Value);
else if (strcmp(Name, "switchMode") == 0) switchMode = atoi(Value);
else if (strcmp(Name, "switchMinsBefore") == 0) switchMinsBefore = atoi(Value);
else if (strcmp(Name, "fontIndex") == 0) fontIndex = atoi(Value);
else if (strcmp(Name, "FontButtonDelta") == 0) FontButtonDelta = atoi(Value);

View File

@ -118,6 +118,7 @@ class cTvguideConfig {
int favLimitChannels;
int favStartChannel;
int favStopChannel;
int switchMode;
int switchMinsBefore;
int fontIndex;
const char *fontNameDefault;

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2019-03-23 16:23+0100\n"
"POT-Creation-Date: 2019-04-05 13:01+0200\n"
"PO-Revision-Date: 2012-08-25 17:49+0200\n"
"Last-Translator: Horst\n"
"Language-Team: \n"
@ -807,8 +807,11 @@ msgstr "Benutzerdef. Zeit 4 in Favoriten benutzen"
msgid "Limit channels in favorites"
msgstr "Kanäle in Favoriten beschränken"
msgid "Minutes a switchtimer switches before start of a show"
msgstr "Umschalten (x)min vor Start der Sendung"
msgid "Switchtimer:"
msgstr "Umschalttimer:"
msgid "Switch (x)min before start of the show"
msgstr "Umschalten (x)min vor der Sendung"
msgid "Create Log Messages for image loading"
msgstr "Log Nachrichten für das Laden der Bilder erzeugen"

View File

@ -586,14 +586,14 @@ void cRecManager::UpdateSearchTimers(void) {
}
}
// announceOnly: 0 = switch, 1 = announce only, 2 = ask for switch
// switchMode: 0 = switch, 1 = announce only, 2 = ask for switch
bool cRecManager::CreateSwitchTimer(const cEvent *event, cSwitchTimer switchTimer) {
if (epgSearchAvailable && event) {
Epgsearch_switchtimer_v1_0 data;
data.event = event;
data.mode = 1;
data.switchMinsBefore = switchTimer.switchMinsBefore;
data.announceOnly = switchTimer.announceOnly;
data.announceOnly = switchTimer.switchMode;
data.success = false;
epgSearchPlugin->Service("Epgsearch-switchtimer-v1.0", &data);
cSwitchTimer *t = new cSwitchTimer(event);

View File

@ -1101,7 +1101,7 @@ cRecMenuSearchTimerNothingFound::cRecMenuSearchTimerNothingFound(std::string sea
// --- cRecMenuSwitchTimer ---------------------------------------------------------
cRecMenuSwitchTimer::cRecMenuSwitchTimer(void) {
switchMinsBefore = tvguideConfig.switchMinsBefore;
announceOnly = 0;
switchMode = tvguideConfig.switchMode;
SetWidthPercent(60);
@ -1111,11 +1111,11 @@ cRecMenuSwitchTimer::cRecMenuSwitchTimer(void) {
AddMenuItem(infoItem);
AddMenuItem(new cRecMenuItemInt(tr("Minutes before switching"), switchMinsBefore, 0, 10, false, &switchMinsBefore));
std::vector<std::string> switchModes;
switchModes.push_back(tr("switch"));
switchModes.push_back(tr("announce only"));
switchModes.push_back(tr("ask for switch"));
AddMenuItem(new cRecMenuItemSelect(tr("Switch Mode"), switchModes, announceOnly, false, &announceOnly));
std::vector<std::string> switchModeItems;
switchModeItems.push_back(tr("switch"));
switchModeItems.push_back(tr("announce only"));
switchModeItems.push_back(tr("ask for switch"));
AddMenuItem(new cRecMenuItemSelect(tr("Switch Mode"), switchModeItems, switchMode, false, &switchMode));
AddMenuItem(new cRecMenuItemButtonYesNo(tr("Create"), tr("Cancel"), rmsSwitchTimerCreate, rmsClose, true));
@ -1127,7 +1127,7 @@ cRecMenuSwitchTimer::cRecMenuSwitchTimer(void) {
cSwitchTimer cRecMenuSwitchTimer::GetSwitchTimer(void) {
cSwitchTimer st;
st.switchMinsBefore = switchMinsBefore;
st.announceOnly = announceOnly;
st.switchMode = switchMode;
return st;
}

View File

@ -319,7 +319,7 @@ public:
class cRecMenuSwitchTimer: public cRecMenu {
private:
int switchMinsBefore;
int announceOnly;
int switchMode;
public:
cRecMenuSwitchTimer(void);
virtual ~cRecMenuSwitchTimer(void) {};

View File

@ -121,6 +121,7 @@ void cTvguideSetup::Store(void) {
SetupStore("favLimitChannels", tvguideConfig.favLimitChannels);
SetupStore("favStartChannel", tvguideConfig.favStartChannel);
SetupStore("favStopChannel", tvguideConfig.favStopChannel);
SetupStore("switchMode", tvguideConfig.switchMode);
SetupStore("switchMinsBefore", tvguideConfig.switchMinsBefore);
SetupStore("fontIndex", tvguideConfig.fontIndex);
SetupStore("FontButtonDelta", tvguideConfig.FontButtonDelta);
@ -379,6 +380,9 @@ cMenuSetupFavorites::cMenuSetupFavorites(cTvguideConfig* data) : cMenuSetupSubM
recFolderMode[1] = tr("Select from folder list");
recFolderMode[2] = tr("Use fixed folder");
strn0cpy(fixedFolder, data->instRecFixedFolder.c_str(), sizeof(fixedFolder));
switchModeItems[0] = (tr("switch"));
switchModeItems[1] = (tr("announce only"));
switchModeItems[2] = (tr("ask for switch"));
Set();
}
@ -420,7 +424,9 @@ void cMenuSetupFavorites::Set(void) {
Add(new cMenuEditChanItem(tr("Start Channel"), &tmpTvguideConfig->favStartChannel));
Add(new cMenuEditChanItem(tr("Stop Channel"), &tmpTvguideConfig->favStopChannel));
}
Add(new cMenuEditIntItem(tr("Minutes a switchtimer switches before start of a show"), &tmpTvguideConfig->switchMinsBefore, 0, 10));
Add(new cOsdItem(tr("Switchtimer:"), osUnknown, false));
Add(new cMenuEditStraItem(tr("Switch Mode"), &tmpTvguideConfig->switchMode, 3, switchModeItems));
Add(new cMenuEditIntItem(tr("Switch (x)min before start of the show"), &tmpTvguideConfig->switchMinsBefore, 0, 10));
SetCurrent(Get(currentItem));

View File

@ -68,6 +68,7 @@ class cMenuSetupFavorites : public cMenuSetupSubMenu {
char description3[256];
char description4[256];
const char * recFolderMode[3];
const char * switchModeItems[3];
char fixedFolder[256];
void Set(void);
virtual eOSState ProcessKey(eKeys Key);

View File

@ -7,14 +7,14 @@ cSwitchTimer::cSwitchTimer(void) {
eventID = 0;
startTime = 0;
switchMinsBefore = tvguideConfig.switchMinsBefore;
announceOnly = 0;
switchMode = tvguideConfig.switchMode;
}
cSwitchTimer::cSwitchTimer(const cEvent* Event) {
eventID = 0;
startTime = 0;
switchMinsBefore = tvguideConfig.switchMinsBefore;
announceOnly = 0;
// switchMinsBefore = tvguideConfig.switchMinsBefore;
// switchModes = tvguideConfig.switchModes;
if (Event) {
eventID = Event->EventID();
channelID = Event->ChannelID();

View File

@ -10,7 +10,7 @@ public:
time_t startTime;
tChannelID channelID;
int switchMinsBefore;
int announceOnly;
int switchMode;
#if VDRVERSNUM >= 20305
cSwitchTimer(const cSwitchTimer &SwitchTimer) { *this = SwitchTimer; };
cSwitchTimer& operator= (const cSwitchTimer &SwitchTimer)
@ -19,7 +19,7 @@ public:
this->startTime = SwitchTimer.startTime;
this->channelID = SwitchTimer.channelID;
this->switchMinsBefore = SwitchTimer.switchMinsBefore;
this->announceOnly = SwitchTimer.announceOnly;
this->switchMode = SwitchTimer.switchMode;
return *this;
};
#endif