mirror of
https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
synced 2023-10-05 15:01:48 +02:00
Add switchMode to setup menu
This commit is contained in:
parent
8ae5d34bef
commit
9df447454c
2
config.c
2
config.c
@ -64,6 +64,7 @@ cTvguideConfig::cTvguideConfig() {
|
|||||||
favLimitChannels = 0;
|
favLimitChannels = 0;
|
||||||
favStartChannel = 0;
|
favStartChannel = 0;
|
||||||
favStopChannel = 0;
|
favStopChannel = 0;
|
||||||
|
switchMode = 0;
|
||||||
switchMinsBefore = 2;
|
switchMinsBefore = 2;
|
||||||
fontIndex = 0;
|
fontIndex = 0;
|
||||||
fontNameDefault = "VDRSymbols Sans:Book";
|
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, "favLimitChannels") == 0) favLimitChannels = atoi(Value);
|
||||||
else if (strcmp(Name, "favStartChannel") == 0) favStartChannel = atoi(Value);
|
else if (strcmp(Name, "favStartChannel") == 0) favStartChannel = atoi(Value);
|
||||||
else if (strcmp(Name, "favStopChannel") == 0) favStopChannel = 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, "switchMinsBefore") == 0) switchMinsBefore = atoi(Value);
|
||||||
else if (strcmp(Name, "fontIndex") == 0) fontIndex = atoi(Value);
|
else if (strcmp(Name, "fontIndex") == 0) fontIndex = atoi(Value);
|
||||||
else if (strcmp(Name, "FontButtonDelta") == 0) FontButtonDelta = atoi(Value);
|
else if (strcmp(Name, "FontButtonDelta") == 0) FontButtonDelta = atoi(Value);
|
||||||
|
1
config.h
1
config.h
@ -118,6 +118,7 @@ class cTvguideConfig {
|
|||||||
int favLimitChannels;
|
int favLimitChannels;
|
||||||
int favStartChannel;
|
int favStartChannel;
|
||||||
int favStopChannel;
|
int favStopChannel;
|
||||||
|
int switchMode;
|
||||||
int switchMinsBefore;
|
int switchMinsBefore;
|
||||||
int fontIndex;
|
int fontIndex;
|
||||||
const char *fontNameDefault;
|
const char *fontNameDefault;
|
||||||
|
@ -3,7 +3,7 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: vdr-tvguide 0.0.1\n"
|
"Project-Id-Version: vdr-tvguide 0.0.1\n"
|
||||||
"Report-Msgid-Bugs-To: <see README>\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"
|
"PO-Revision-Date: 2012-08-25 17:49+0200\n"
|
||||||
"Last-Translator: Horst\n"
|
"Last-Translator: Horst\n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
@ -807,8 +807,11 @@ msgstr "Benutzerdef. Zeit 4 in Favoriten benutzen"
|
|||||||
msgid "Limit channels in favorites"
|
msgid "Limit channels in favorites"
|
||||||
msgstr "Kanäle in Favoriten beschränken"
|
msgstr "Kanäle in Favoriten beschränken"
|
||||||
|
|
||||||
msgid "Minutes a switchtimer switches before start of a show"
|
msgid "Switchtimer:"
|
||||||
msgstr "Umschalten (x)min vor Start der Sendung"
|
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"
|
msgid "Create Log Messages for image loading"
|
||||||
msgstr "Log Nachrichten für das Laden der Bilder erzeugen"
|
msgstr "Log Nachrichten für das Laden der Bilder erzeugen"
|
||||||
|
@ -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) {
|
bool cRecManager::CreateSwitchTimer(const cEvent *event, cSwitchTimer switchTimer) {
|
||||||
if (epgSearchAvailable && event) {
|
if (epgSearchAvailable && event) {
|
||||||
Epgsearch_switchtimer_v1_0 data;
|
Epgsearch_switchtimer_v1_0 data;
|
||||||
data.event = event;
|
data.event = event;
|
||||||
data.mode = 1;
|
data.mode = 1;
|
||||||
data.switchMinsBefore = switchTimer.switchMinsBefore;
|
data.switchMinsBefore = switchTimer.switchMinsBefore;
|
||||||
data.announceOnly = switchTimer.announceOnly;
|
data.announceOnly = switchTimer.switchMode;
|
||||||
data.success = false;
|
data.success = false;
|
||||||
epgSearchPlugin->Service("Epgsearch-switchtimer-v1.0", &data);
|
epgSearchPlugin->Service("Epgsearch-switchtimer-v1.0", &data);
|
||||||
cSwitchTimer *t = new cSwitchTimer(event);
|
cSwitchTimer *t = new cSwitchTimer(event);
|
||||||
|
14
recmenus.c
14
recmenus.c
@ -1101,7 +1101,7 @@ cRecMenuSearchTimerNothingFound::cRecMenuSearchTimerNothingFound(std::string sea
|
|||||||
// --- cRecMenuSwitchTimer ---------------------------------------------------------
|
// --- cRecMenuSwitchTimer ---------------------------------------------------------
|
||||||
cRecMenuSwitchTimer::cRecMenuSwitchTimer(void) {
|
cRecMenuSwitchTimer::cRecMenuSwitchTimer(void) {
|
||||||
switchMinsBefore = tvguideConfig.switchMinsBefore;
|
switchMinsBefore = tvguideConfig.switchMinsBefore;
|
||||||
announceOnly = 0;
|
switchMode = tvguideConfig.switchMode;
|
||||||
|
|
||||||
SetWidthPercent(60);
|
SetWidthPercent(60);
|
||||||
|
|
||||||
@ -1111,11 +1111,11 @@ cRecMenuSwitchTimer::cRecMenuSwitchTimer(void) {
|
|||||||
AddMenuItem(infoItem);
|
AddMenuItem(infoItem);
|
||||||
|
|
||||||
AddMenuItem(new cRecMenuItemInt(tr("Minutes before switching"), switchMinsBefore, 0, 10, false, &switchMinsBefore));
|
AddMenuItem(new cRecMenuItemInt(tr("Minutes before switching"), switchMinsBefore, 0, 10, false, &switchMinsBefore));
|
||||||
std::vector<std::string> switchModes;
|
std::vector<std::string> switchModeItems;
|
||||||
switchModes.push_back(tr("switch"));
|
switchModeItems.push_back(tr("switch"));
|
||||||
switchModes.push_back(tr("announce only"));
|
switchModeItems.push_back(tr("announce only"));
|
||||||
switchModes.push_back(tr("ask for switch"));
|
switchModeItems.push_back(tr("ask for switch"));
|
||||||
AddMenuItem(new cRecMenuItemSelect(tr("Switch Mode"), switchModes, announceOnly, false, &announceOnly));
|
AddMenuItem(new cRecMenuItemSelect(tr("Switch Mode"), switchModeItems, switchMode, false, &switchMode));
|
||||||
|
|
||||||
AddMenuItem(new cRecMenuItemButtonYesNo(tr("Create"), tr("Cancel"), rmsSwitchTimerCreate, rmsClose, true));
|
AddMenuItem(new cRecMenuItemButtonYesNo(tr("Create"), tr("Cancel"), rmsSwitchTimerCreate, rmsClose, true));
|
||||||
|
|
||||||
@ -1127,7 +1127,7 @@ cRecMenuSwitchTimer::cRecMenuSwitchTimer(void) {
|
|||||||
cSwitchTimer cRecMenuSwitchTimer::GetSwitchTimer(void) {
|
cSwitchTimer cRecMenuSwitchTimer::GetSwitchTimer(void) {
|
||||||
cSwitchTimer st;
|
cSwitchTimer st;
|
||||||
st.switchMinsBefore = switchMinsBefore;
|
st.switchMinsBefore = switchMinsBefore;
|
||||||
st.announceOnly = announceOnly;
|
st.switchMode = switchMode;
|
||||||
return st;
|
return st;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -319,7 +319,7 @@ public:
|
|||||||
class cRecMenuSwitchTimer: public cRecMenu {
|
class cRecMenuSwitchTimer: public cRecMenu {
|
||||||
private:
|
private:
|
||||||
int switchMinsBefore;
|
int switchMinsBefore;
|
||||||
int announceOnly;
|
int switchMode;
|
||||||
public:
|
public:
|
||||||
cRecMenuSwitchTimer(void);
|
cRecMenuSwitchTimer(void);
|
||||||
virtual ~cRecMenuSwitchTimer(void) {};
|
virtual ~cRecMenuSwitchTimer(void) {};
|
||||||
|
8
setup.c
8
setup.c
@ -121,6 +121,7 @@ void cTvguideSetup::Store(void) {
|
|||||||
SetupStore("favLimitChannels", tvguideConfig.favLimitChannels);
|
SetupStore("favLimitChannels", tvguideConfig.favLimitChannels);
|
||||||
SetupStore("favStartChannel", tvguideConfig.favStartChannel);
|
SetupStore("favStartChannel", tvguideConfig.favStartChannel);
|
||||||
SetupStore("favStopChannel", tvguideConfig.favStopChannel);
|
SetupStore("favStopChannel", tvguideConfig.favStopChannel);
|
||||||
|
SetupStore("switchMode", tvguideConfig.switchMode);
|
||||||
SetupStore("switchMinsBefore", tvguideConfig.switchMinsBefore);
|
SetupStore("switchMinsBefore", tvguideConfig.switchMinsBefore);
|
||||||
SetupStore("fontIndex", tvguideConfig.fontIndex);
|
SetupStore("fontIndex", tvguideConfig.fontIndex);
|
||||||
SetupStore("FontButtonDelta", tvguideConfig.FontButtonDelta);
|
SetupStore("FontButtonDelta", tvguideConfig.FontButtonDelta);
|
||||||
@ -379,6 +380,9 @@ cMenuSetupFavorites::cMenuSetupFavorites(cTvguideConfig* data) : cMenuSetupSubM
|
|||||||
recFolderMode[1] = tr("Select from folder list");
|
recFolderMode[1] = tr("Select from folder list");
|
||||||
recFolderMode[2] = tr("Use fixed folder");
|
recFolderMode[2] = tr("Use fixed folder");
|
||||||
strn0cpy(fixedFolder, data->instRecFixedFolder.c_str(), sizeof(fixedFolder));
|
strn0cpy(fixedFolder, data->instRecFixedFolder.c_str(), sizeof(fixedFolder));
|
||||||
|
switchModeItems[0] = (tr("switch"));
|
||||||
|
switchModeItems[1] = (tr("announce only"));
|
||||||
|
switchModeItems[2] = (tr("ask for switch"));
|
||||||
Set();
|
Set();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -420,7 +424,9 @@ void cMenuSetupFavorites::Set(void) {
|
|||||||
Add(new cMenuEditChanItem(tr("Start Channel"), &tmpTvguideConfig->favStartChannel));
|
Add(new cMenuEditChanItem(tr("Start Channel"), &tmpTvguideConfig->favStartChannel));
|
||||||
Add(new cMenuEditChanItem(tr("Stop Channel"), &tmpTvguideConfig->favStopChannel));
|
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));
|
SetCurrent(Get(currentItem));
|
||||||
|
1
setup.h
1
setup.h
@ -68,6 +68,7 @@ class cMenuSetupFavorites : public cMenuSetupSubMenu {
|
|||||||
char description3[256];
|
char description3[256];
|
||||||
char description4[256];
|
char description4[256];
|
||||||
const char * recFolderMode[3];
|
const char * recFolderMode[3];
|
||||||
|
const char * switchModeItems[3];
|
||||||
char fixedFolder[256];
|
char fixedFolder[256];
|
||||||
void Set(void);
|
void Set(void);
|
||||||
virtual eOSState ProcessKey(eKeys Key);
|
virtual eOSState ProcessKey(eKeys Key);
|
||||||
|
@ -7,14 +7,14 @@ cSwitchTimer::cSwitchTimer(void) {
|
|||||||
eventID = 0;
|
eventID = 0;
|
||||||
startTime = 0;
|
startTime = 0;
|
||||||
switchMinsBefore = tvguideConfig.switchMinsBefore;
|
switchMinsBefore = tvguideConfig.switchMinsBefore;
|
||||||
announceOnly = 0;
|
switchMode = tvguideConfig.switchMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
cSwitchTimer::cSwitchTimer(const cEvent* Event) {
|
cSwitchTimer::cSwitchTimer(const cEvent* Event) {
|
||||||
eventID = 0;
|
eventID = 0;
|
||||||
startTime = 0;
|
startTime = 0;
|
||||||
switchMinsBefore = tvguideConfig.switchMinsBefore;
|
// switchMinsBefore = tvguideConfig.switchMinsBefore;
|
||||||
announceOnly = 0;
|
// switchModes = tvguideConfig.switchModes;
|
||||||
if (Event) {
|
if (Event) {
|
||||||
eventID = Event->EventID();
|
eventID = Event->EventID();
|
||||||
channelID = Event->ChannelID();
|
channelID = Event->ChannelID();
|
||||||
|
@ -10,7 +10,7 @@ public:
|
|||||||
time_t startTime;
|
time_t startTime;
|
||||||
tChannelID channelID;
|
tChannelID channelID;
|
||||||
int switchMinsBefore;
|
int switchMinsBefore;
|
||||||
int announceOnly;
|
int switchMode;
|
||||||
#if VDRVERSNUM >= 20305
|
#if VDRVERSNUM >= 20305
|
||||||
cSwitchTimer(const cSwitchTimer &SwitchTimer) { *this = SwitchTimer; };
|
cSwitchTimer(const cSwitchTimer &SwitchTimer) { *this = SwitchTimer; };
|
||||||
cSwitchTimer& operator= (const cSwitchTimer &SwitchTimer)
|
cSwitchTimer& operator= (const cSwitchTimer &SwitchTimer)
|
||||||
@ -19,7 +19,7 @@ public:
|
|||||||
this->startTime = SwitchTimer.startTime;
|
this->startTime = SwitchTimer.startTime;
|
||||||
this->channelID = SwitchTimer.channelID;
|
this->channelID = SwitchTimer.channelID;
|
||||||
this->switchMinsBefore = SwitchTimer.switchMinsBefore;
|
this->switchMinsBefore = SwitchTimer.switchMinsBefore;
|
||||||
this->announceOnly = SwitchTimer.announceOnly;
|
this->switchMode = SwitchTimer.switchMode;
|
||||||
return *this;
|
return *this;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user