mirror of
https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
synced 2023-10-05 13:01:48 +00:00
Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
fc47c35bea | ||
|
4d80c6900d | ||
|
78d6e980ee | ||
|
69356e9c43 | ||
|
bf3a8a430b | ||
|
52c41ff5af | ||
|
5870b1ae4c | ||
|
69b851c9ed | ||
|
8335ab0e41 | ||
|
240cbe87e0 | ||
|
ee68d2eb2f | ||
|
eb3a4113be | ||
|
7ec89bf12b | ||
|
f653594c4a | ||
|
8129d116fb | ||
|
874f5cd9d5 |
22
HISTORY
22
HISTORY
@@ -256,3 +256,25 @@ Version 1.2.17
|
||||
- Final fix for utf8 CutText
|
||||
- Fixed a remote timer problem
|
||||
- Add episode to manual timer
|
||||
|
||||
Version 1.3.0
|
||||
|
||||
- last version with <VDR-2.3.1 compatibility
|
||||
- Fixed a possible seqfault in DisplayTimerConflict
|
||||
- Show numTimersToday in timeline
|
||||
- Fixed stopIndex in cRecMenu::JumpBegin
|
||||
- Fixed horizontal alignment in timeline
|
||||
- Fixed messages in DisplayTimerConflict
|
||||
|
||||
Version 1.3.1
|
||||
|
||||
- Fixes for <VDR-2.3.1 compatibility
|
||||
- Fixed a segfault while starting tvguide
|
||||
|
||||
Version 1.3.2
|
||||
|
||||
- Fixed display groupname in cChannelGroupGrid::DrawHorizontal
|
||||
- Center some channel logos
|
||||
- Add "Timer On/Off" to recmenu
|
||||
- Wrap title in detailview header
|
||||
- Optional deactivation of the timer confirmation messages
|
||||
|
@@ -68,29 +68,28 @@ void cChannelGroupGrid::Draw(void) {
|
||||
|
||||
void cChannelGroupGrid::DrawVertical(tColor colorText, tColor colorTextBack) {
|
||||
int textY = (Height() - fontManager.FontChannelGroups->Height()) / 2;
|
||||
cString text = CutText(name, Width() - 4, fontManager.FontChannelGroups).c_str();
|
||||
cString text = cString::sprintf("%s", CutText(name, Width() - 4, fontManager.FontChannelGroups).c_str());
|
||||
int textWidth = fontManager.FontChannelGroups->Width(*text);
|
||||
int x = (Width() - textWidth) / 2;
|
||||
pixmap->DrawText(cPoint(x, textY), *text, colorText, colorTextBack, fontManager.FontChannelGroups);
|
||||
}
|
||||
|
||||
void cChannelGroupGrid::DrawHorizontal(tColor colorText, tColor colorTextBack) {
|
||||
std::string nameUpper = name;
|
||||
std::transform(nameUpper.begin(), nameUpper.end(),nameUpper.begin(), ::toupper);
|
||||
int numChars = nameUpper.length();
|
||||
std::string groupName = name;
|
||||
int numChars = groupName.length();
|
||||
int charHeight = fontManager.FontChannelGroupsHorizontal->Height();
|
||||
int textHeight = numChars * charHeight;
|
||||
int y = 5;
|
||||
if ((textHeight +5) < Height()) {
|
||||
if ((textHeight + 5) < Height()) {
|
||||
y = (Height() - textHeight) / 2;
|
||||
}
|
||||
for (int i=0; i < numChars; i++) {
|
||||
if (((y + 2*charHeight) > Height()) && ((i+1)<numChars)) {
|
||||
for (int i = 0; i < numChars; i++) {
|
||||
if (((y + 2 * charHeight) > Height()) && ((i + 1) < numChars)) {
|
||||
int x = (Width() - fontManager.FontChannelGroupsHorizontal->Width("...")) / 2;
|
||||
pixmap->DrawText(cPoint(x, y), "...", colorText, colorTextBack, fontManager.FontChannelGroupsHorizontal);
|
||||
break;
|
||||
}
|
||||
cString currentChar = cString::sprintf("%c", nameUpper.at(i));
|
||||
cString currentChar = cString::sprintf("%s", utf8_substr(groupName.c_str(), i, 1).c_str());
|
||||
int x = (Width() - fontManager.FontChannelGroupsHorizontal->Width(*currentChar)) / 2;
|
||||
pixmap->DrawText(cPoint(x, y), *currentChar, colorText, colorTextBack, fontManager.FontChannelGroupsHorizontal);
|
||||
y += fontManager.FontChannelGroupsHorizontal->Height();
|
||||
|
2
config.c
2
config.c
@@ -35,6 +35,7 @@ cTVGuideConfig::cTVGuideConfig() {
|
||||
jumpChannels = 0;
|
||||
blueKeyMode = 2;
|
||||
addSubtitleToTimer = 1;
|
||||
timerMessage = 1;
|
||||
closeOnSwitch = 1;
|
||||
numkeyMode = 0;
|
||||
useRemoteTimers = 0;
|
||||
@@ -297,6 +298,7 @@ bool cTVGuideConfig::SetupParse(const char *Name, const char *Value) {
|
||||
else if (strcmp(Name, "instRecFolderMode") == 0) instRecFolderMode = atoi(Value);
|
||||
else if (strcmp(Name, "instRecFixedFolder") == 0) instRecFixedFolder = Value;
|
||||
else if (strcmp(Name, "addSubtitleToTimer") == 0) addSubtitleToTimer = atoi(Value);
|
||||
else if (strcmp(Name, "timerMessage") == 0) timerMessage = atoi(Value);
|
||||
else if (strcmp(Name, "favWhatsOnNow") == 0) favWhatsOnNow = atoi(Value);
|
||||
else if (strcmp(Name, "favWhatsOnNext") == 0) favWhatsOnNext = atoi(Value);
|
||||
else if (strcmp(Name, "favUseTime1") == 0) favUseTime1 = atoi(Value);
|
||||
|
1
config.h
1
config.h
@@ -88,6 +88,7 @@ class cTVGuideConfig {
|
||||
int channelJumpMode;
|
||||
int jumpChannels;
|
||||
int blueKeyMode;
|
||||
int timerMessage;
|
||||
int addSubtitleToTimer;
|
||||
int closeOnSwitch;
|
||||
int numkeyMode;
|
||||
|
@@ -7,7 +7,7 @@ cOsdManager::cOsdManager(void) {
|
||||
bool cOsdManager::setOsd() {
|
||||
osd = cOsdProvider::NewOsd(cOsd::OsdLeft(), cOsd::OsdTop());
|
||||
if (osd) {
|
||||
tArea Area = { 0, 0, cOsd::OsdWidth(), cOsd::OsdHeight(), 32 };
|
||||
tArea Area = { 0, 0, cOsd::OsdWidth() - 1, cOsd::OsdHeight() - 1, 32 };
|
||||
if (osd->SetAreas(&Area, 1) == oeOk) {
|
||||
return true;
|
||||
}
|
||||
|
20
po/ca_ES.po
20
po/ca_ES.po
@@ -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: 2020-02-17 14:30+0100\n"
|
||||
"POT-Creation-Date: 2020-08-04 14:15+0200\n"
|
||||
"PO-Revision-Date: 2013-09-21 17:49+0200\n"
|
||||
"Last-Translator: My friend <Sampep> Thanks David <Gabychan> <gbonich@gmail.com>\n"
|
||||
"Language-Team: \n"
|
||||
@@ -25,7 +25,7 @@ msgid "min"
|
||||
msgstr "min"
|
||||
|
||||
msgid "Reruns of "
|
||||
msgstr ""
|
||||
msgstr "Reemissions "
|
||||
|
||||
msgid "No reruns found"
|
||||
msgstr ""
|
||||
@@ -105,12 +105,15 @@ msgstr ""
|
||||
msgid "Instant Record"
|
||||
msgstr "Enregistra a l'instant"
|
||||
|
||||
msgid "Delete Timer"
|
||||
msgstr "Esborra temporitzador"
|
||||
msgid "Timer On/Off"
|
||||
msgstr "Temporitzador On/Off"
|
||||
|
||||
msgid "Edit Timer"
|
||||
msgstr "Edita temporitzador"
|
||||
|
||||
msgid "Delete Timer"
|
||||
msgstr "Esborra temporitzador"
|
||||
|
||||
msgid "Timer Timeline"
|
||||
msgstr ""
|
||||
|
||||
@@ -760,7 +763,7 @@ msgid "Display time in EPG Grids"
|
||||
msgstr "Mostra el temps a l'EPG"
|
||||
|
||||
msgid "Height of Headers (Status Header and EPG View, Perc. of osd height)"
|
||||
msgstr ""
|
||||
msgstr "Alçada capçalera d'estat (% alçada OSD)"
|
||||
|
||||
msgid "Height of Footer (Perc. of osd height)"
|
||||
msgstr ""
|
||||
@@ -898,7 +901,7 @@ msgid "Instant recording:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Folder for instant Recordings"
|
||||
msgstr ""
|
||||
msgstr "Utilitza carpetes per gravacions a l'instant"
|
||||
|
||||
msgid "Folder"
|
||||
msgstr ""
|
||||
@@ -909,6 +912,9 @@ msgstr ""
|
||||
msgid "Use Remotetimers"
|
||||
msgstr "Utilitza temporitzadors remots"
|
||||
|
||||
msgid "Show timer confirmation messages"
|
||||
msgstr ""
|
||||
|
||||
msgid "Favorites:"
|
||||
msgstr ""
|
||||
|
||||
@@ -997,7 +1003,7 @@ msgid "EPG Info"
|
||||
msgstr ""
|
||||
|
||||
msgid "Reruns"
|
||||
msgstr ""
|
||||
msgstr "Reemissions"
|
||||
|
||||
msgid "Recording Information"
|
||||
msgstr ""
|
||||
|
14
po/de_DE.po
14
po/de_DE.po
@@ -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: 2020-02-17 14:30+0100\n"
|
||||
"POT-Creation-Date: 2020-08-04 14:15+0200\n"
|
||||
"PO-Revision-Date: 2012-08-25 17:49+0200\n"
|
||||
"Last-Translator: Horst\n"
|
||||
"Language-Team: \n"
|
||||
@@ -102,12 +102,15 @@ msgstr "erledigte Aufnahmen"
|
||||
msgid "Instant Record"
|
||||
msgstr "Aufnahme"
|
||||
|
||||
msgid "Delete Timer"
|
||||
msgstr "Timer löschen"
|
||||
msgid "Timer On/Off"
|
||||
msgstr "Timer Ein/Aus"
|
||||
|
||||
msgid "Edit Timer"
|
||||
msgstr "Timer bearbeiten"
|
||||
|
||||
msgid "Delete Timer"
|
||||
msgstr "Timer löschen"
|
||||
|
||||
msgid "Timer Timeline"
|
||||
msgstr "Timer Tagesübersicht"
|
||||
|
||||
@@ -906,6 +909,9 @@ msgstr "Untertitel in manuellen Timern"
|
||||
msgid "Use Remotetimers"
|
||||
msgstr "RemoteTimers benutzen"
|
||||
|
||||
msgid "Show timer confirmation messages"
|
||||
msgstr "Timer Bestätigungsmeldungen anzeigen"
|
||||
|
||||
msgid "Favorites:"
|
||||
msgstr "Favoriten:"
|
||||
|
||||
@@ -997,7 +1003,7 @@ msgid "Reruns"
|
||||
msgstr "Wiederholungen"
|
||||
|
||||
msgid "Recording Information"
|
||||
msgstr ""
|
||||
msgstr "Aufnahme Information"
|
||||
|
||||
msgid "Image Galery"
|
||||
msgstr "Bildergalerie"
|
||||
|
12
po/it_IT.po
12
po/it_IT.po
@@ -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: 2020-02-17 14:30+0100\n"
|
||||
"POT-Creation-Date: 2020-08-04 14:15+0200\n"
|
||||
"PO-Revision-Date: 2012-08-25 17:49+0200\n"
|
||||
"Last-Translator: fiveten_59\n"
|
||||
"Language-Team: \n"
|
||||
@@ -102,12 +102,15 @@ msgstr "registrazione eseguita"
|
||||
msgid "Instant Record"
|
||||
msgstr "Registrazione immediata"
|
||||
|
||||
msgid "Delete Timer"
|
||||
msgstr "Cancella il Timer"
|
||||
msgid "Timer On/Off"
|
||||
msgstr "Timer On/Off"
|
||||
|
||||
msgid "Edit Timer"
|
||||
msgstr "Edita il Timer"
|
||||
|
||||
msgid "Delete Timer"
|
||||
msgstr "Cancella il Timer"
|
||||
|
||||
msgid "Timer Timeline"
|
||||
msgstr "Scadenza del Timer"
|
||||
|
||||
@@ -906,6 +909,9 @@ msgstr "Aggiungi episodi ai timer manuali"
|
||||
msgid "Use Remotetimers"
|
||||
msgstr "Usa Remotetimers"
|
||||
|
||||
msgid "Show timer confirmation messages"
|
||||
msgstr ""
|
||||
|
||||
msgid "Favorites:"
|
||||
msgstr ""
|
||||
|
||||
|
22
po/ru_RU.po
22
po/ru_RU.po
@@ -3,7 +3,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-tvguide 1.0.0\n"
|
||||
"Report-Msgid-Bugs-To: <see README>\n"
|
||||
"POT-Creation-Date: 2020-02-17 14:30+0100\n"
|
||||
"POT-Creation-Date: 2020-08-04 14:15+0200\n"
|
||||
"PO-Revision-Date: 2013-09-25 17:49+0400\n"
|
||||
"Last-Translator: AmiD, ilya\n"
|
||||
"Language-Team: Russia-Cherepovets(wm.amid@gmail.com)\n"
|
||||
@@ -22,7 +22,7 @@ msgid "min"
|
||||
msgstr "мин"
|
||||
|
||||
msgid "Reruns of "
|
||||
msgstr ""
|
||||
msgstr "ПОВТОРЫ ЭТОЙ "
|
||||
|
||||
msgid "No reruns found"
|
||||
msgstr ""
|
||||
@@ -102,12 +102,15 @@ msgstr ""
|
||||
msgid "Instant Record"
|
||||
msgstr "Записать"
|
||||
|
||||
msgid "Delete Timer"
|
||||
msgstr "Удалить таймер"
|
||||
msgid "Timer On/Off"
|
||||
msgstr "таймер Вкл/Выкл"
|
||||
|
||||
msgid "Edit Timer"
|
||||
msgstr "Редактировать таймер"
|
||||
|
||||
msgid "Delete Timer"
|
||||
msgstr "Удалить таймер"
|
||||
|
||||
msgid "Timer Timeline"
|
||||
msgstr ""
|
||||
|
||||
@@ -295,7 +298,7 @@ msgid "No Search Timers Configured"
|
||||
msgstr ""
|
||||
|
||||
msgid "Configure Search Timer Options"
|
||||
msgstr ""
|
||||
msgstr "Настроить параметры таймера"
|
||||
|
||||
msgid "Save Search Timer"
|
||||
msgstr ""
|
||||
@@ -757,7 +760,7 @@ msgid "Display time in EPG Grids"
|
||||
msgstr "Показывать время в сетке EPG"
|
||||
|
||||
msgid "Height of Headers (Status Header and EPG View, Perc. of osd height)"
|
||||
msgstr ""
|
||||
msgstr "Высота верхней панели (% от высоты OSD)"
|
||||
|
||||
msgid "Height of Footer (Perc. of osd height)"
|
||||
msgstr ""
|
||||
@@ -895,7 +898,7 @@ msgid "Instant recording:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Folder for instant Recordings"
|
||||
msgstr ""
|
||||
msgstr "Использовать директории для быстрой записи"
|
||||
|
||||
msgid "Folder"
|
||||
msgstr ""
|
||||
@@ -906,6 +909,9 @@ msgstr ""
|
||||
msgid "Use Remotetimers"
|
||||
msgstr "RemoteTimers benutzen"
|
||||
|
||||
msgid "Show timer confirmation messages"
|
||||
msgstr ""
|
||||
|
||||
msgid "Favorites:"
|
||||
msgstr ""
|
||||
|
||||
@@ -994,7 +1000,7 @@ msgid "EPG Info"
|
||||
msgstr ""
|
||||
|
||||
msgid "Reruns"
|
||||
msgstr ""
|
||||
msgstr "ПОВТОРЫ"
|
||||
|
||||
msgid "Recording Information"
|
||||
msgstr ""
|
||||
|
20
po/sk_SK.po
20
po/sk_SK.po
@@ -3,7 +3,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-tvguide 1.1.0\n"
|
||||
"Report-Msgid-Bugs-To: <see README>\n"
|
||||
"POT-Creation-Date: 2020-02-17 14:30+0100\n"
|
||||
"POT-Creation-Date: 2020-08-04 14:15+0200\n"
|
||||
"PO-Revision-Date: 2013-09-15 00:12+0100\n"
|
||||
"Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n"
|
||||
"Language-Team: \n"
|
||||
@@ -22,7 +22,7 @@ msgid "min"
|
||||
msgstr "min"
|
||||
|
||||
msgid "Reruns of "
|
||||
msgstr ""
|
||||
msgstr "Repr<EFBFBD>za tohto "
|
||||
|
||||
msgid "No reruns found"
|
||||
msgstr ""
|
||||
@@ -102,12 +102,15 @@ msgstr ""
|
||||
msgid "Instant Record"
|
||||
msgstr "Okam<61>ite nahra<72>"
|
||||
|
||||
msgid "Delete Timer"
|
||||
msgstr "Vymaza<EFBFBD> pl<70>n nahr<68>vania"
|
||||
msgid "Timer On/Off"
|
||||
msgstr "Zap./Vyp. pl<70>n nahr<68>vania"
|
||||
|
||||
msgid "Edit Timer"
|
||||
msgstr "Upravi<76> pl<70>n nahr<68>vania"
|
||||
|
||||
msgid "Delete Timer"
|
||||
msgstr "Vymaza<7A> pl<70>n nahr<68>vania"
|
||||
|
||||
msgid "Timer Timeline"
|
||||
msgstr ""
|
||||
|
||||
@@ -757,7 +760,7 @@ msgid "Display time in EPG Grids"
|
||||
msgstr "Zobrazi<7A> <20>as v EPG mrie<69>ke"
|
||||
|
||||
msgid "Height of Headers (Status Header and EPG View, Perc. of osd height)"
|
||||
msgstr ""
|
||||
msgstr "V<EFBFBD><EFBFBD>ka stavovej hlavi<76>ky (% z OSD v<><76>ky)"
|
||||
|
||||
msgid "Height of Footer (Perc. of osd height)"
|
||||
msgstr ""
|
||||
@@ -895,7 +898,7 @@ msgid "Instant recording:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Folder for instant Recordings"
|
||||
msgstr ""
|
||||
msgstr "Pou<EFBFBD>i<EFBFBD> adres<65>re pre okam<61>it<69> nahr<68>vky"
|
||||
|
||||
msgid "Folder"
|
||||
msgstr ""
|
||||
@@ -906,6 +909,9 @@ msgstr "Prida
|
||||
msgid "Use Remotetimers"
|
||||
msgstr "Pou<6F>i<EFBFBD> vzdialen<65> pl<70>nova<76>"
|
||||
|
||||
msgid "Show timer confirmation messages"
|
||||
msgstr ""
|
||||
|
||||
msgid "Favorites:"
|
||||
msgstr ""
|
||||
|
||||
@@ -994,7 +1000,7 @@ msgid "EPG Info"
|
||||
msgstr ""
|
||||
|
||||
msgid "Reruns"
|
||||
msgstr ""
|
||||
msgstr "Repr<EFBFBD>za"
|
||||
|
||||
msgid "Recording Information"
|
||||
msgstr ""
|
||||
|
56
recmanager.c
56
recmanager.c
@@ -130,7 +130,7 @@ cTimer *cRecManager::createLocalTimer(const cEvent *event, std::string path) {
|
||||
isyslog("timer %s added (active)", *timer->ToDescr());
|
||||
#endif
|
||||
}
|
||||
return timer;
|
||||
return timers->GetTimer(timer);
|
||||
}
|
||||
|
||||
cTimer *cRecManager::createRemoteTimer(const cEvent *event, std::string path) {
|
||||
@@ -267,6 +267,21 @@ void cRecManager::DeleteRemoteTimer(const cEvent *event) {
|
||||
}
|
||||
}
|
||||
|
||||
void cRecManager::OnOffTimer(const cEvent *event) {
|
||||
const cTimer *t;
|
||||
#if VDRVERSNUM >= 20301
|
||||
{
|
||||
LOCK_TIMERS_READ;
|
||||
t = Timers->GetMatch(event);
|
||||
}
|
||||
#else
|
||||
t = Timers.GetMatch(event);
|
||||
#endif
|
||||
if (!t)
|
||||
return;
|
||||
SaveTimer(t);
|
||||
}
|
||||
|
||||
void cRecManager::SaveTimer(const cTimer *t, cTimer *newTimerSettings) {
|
||||
if (!t)
|
||||
return;
|
||||
@@ -280,27 +295,34 @@ void cRecManager::SaveTimer(const cTimer *t, cTimer *newTimerSettings) {
|
||||
esyslog(tr("tvguide: RemoteTimerModifications failed"));
|
||||
}
|
||||
}
|
||||
cTimer *timer = timers->GetTimer(t);
|
||||
#else
|
||||
cTimers* timers = &Timers;
|
||||
cTimer *timer = timers->GetTimer((cTimer *)t);
|
||||
#endif
|
||||
cTimer *timer = timers->GetTimer(t);
|
||||
if (!timer) {
|
||||
return;
|
||||
}
|
||||
bool active = newTimerSettings->HasFlags(tfActive);
|
||||
int prio = newTimerSettings->Priority();
|
||||
int lifetime = newTimerSettings->Lifetime();
|
||||
time_t day = newTimerSettings->Day();
|
||||
int start = newTimerSettings->Start();
|
||||
int stop = newTimerSettings->Stop();
|
||||
std::string fileName = newTimerSettings->File();
|
||||
|
||||
timer->SetDay(day);
|
||||
timer->SetStart(start);
|
||||
timer->SetStop(stop);
|
||||
timer->SetPriority(prio);
|
||||
timer->SetLifetime(lifetime);
|
||||
timer->SetFile(fileName.c_str());
|
||||
bool active = true;
|
||||
if (newTimerSettings) {
|
||||
int prio = newTimerSettings->Priority();
|
||||
int lifetime = newTimerSettings->Lifetime();
|
||||
time_t day = newTimerSettings->Day();
|
||||
int start = newTimerSettings->Start();
|
||||
int stop = newTimerSettings->Stop();
|
||||
std::string fileName = newTimerSettings->File();
|
||||
|
||||
timer->SetDay(day);
|
||||
timer->SetStart(start);
|
||||
timer->SetStop(stop);
|
||||
timer->SetPriority(prio);
|
||||
timer->SetLifetime(lifetime);
|
||||
timer->SetFile(fileName.c_str());
|
||||
|
||||
active = newTimerSettings->HasFlags(tfActive);
|
||||
} else
|
||||
active = !timer->HasFlags(tfActive);
|
||||
|
||||
if (active)
|
||||
timer->SetFlags(tfActive);
|
||||
@@ -317,11 +339,7 @@ void cRecManager::SaveTimer(const cTimer *t, cTimer *newTimerSettings) {
|
||||
rt.timer = NULL;
|
||||
RefreshRemoteTimers();
|
||||
} else {
|
||||
#if VDRVERSNUM >= 20301
|
||||
timers->SetModified();
|
||||
#else
|
||||
timers.SetModified();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -33,11 +33,12 @@ public:
|
||||
cTimer *createLocalTimer(const cEvent *event, std::string path);
|
||||
cTimer *createRemoteTimer(const cEvent *event, std::string path);
|
||||
void SetTimerPath(cTimer *timer, const cEvent *event, std::string path);
|
||||
void OnOffTimer(const cEvent *event);
|
||||
void DeleteTimer(const cTimer *timer);
|
||||
void DeleteTimer(const cEvent *event);
|
||||
void DeleteLocalTimer(const cEvent *event);
|
||||
void DeleteRemoteTimer(const cEvent *event);
|
||||
void SaveTimer(const cTimer *timer, cTimer *newTimerSettings);
|
||||
void SaveTimer(const cTimer *timer, cTimer *newTimerSettings = NULL);
|
||||
bool IsRecorded(const cEvent *event);
|
||||
cTVGuideTimerConflicts *CheckTimerConflict(void);
|
||||
void CreateSeriesTimer(cTimer *seriesTimer);
|
||||
|
@@ -441,7 +441,7 @@ void cRecMenu::JumpBegin(void) {
|
||||
CreatePixmap();
|
||||
Arrange(false);
|
||||
startIndex = 0;
|
||||
stopIndex = numItems - 1;
|
||||
stopIndex = currentItem;
|
||||
cRecMenuItem *first = menuItems.front();
|
||||
first->setActive();
|
||||
first->setBackground();
|
||||
@@ -589,10 +589,14 @@ void cRecMenu::UpdateActiveMenuItem(void) {
|
||||
|
||||
|
||||
void cRecMenu::DrawScrollBar(void) {
|
||||
if (!pixmapScrollBar)
|
||||
return;
|
||||
pixmapScrollBar->Fill(theme.Color(clrBorder));
|
||||
pixmapScrollBar->DrawRectangle(cRect(2,2,pixmapScrollBar->ViewPort().Width()-4, pixmapScrollBar->ViewPort().Height() - 4), theme.Color(clrBackground));
|
||||
|
||||
int totalNumItems = GetTotalNumMenuItems();
|
||||
if (!totalNumItems)
|
||||
return;
|
||||
if (imgScrollBar == NULL) {
|
||||
int scrollBarImgHeight = (pixmapScrollBar->ViewPort().Height() - 8) * numItems / totalNumItems;
|
||||
imgScrollBar = createScrollbar(pixmapScrollBar->ViewPort().Width()-8, scrollBarImgHeight, theme.Color(clrHighlight), theme.Color(clrHighlightBlending));
|
||||
|
@@ -1548,6 +1548,7 @@ cRecMenuItemTimer::cRecMenuItemTimer(const cTimer *timer,
|
||||
this->overlapStop = overlapStop;
|
||||
this->active = active;
|
||||
height = 3 * font->Height();
|
||||
pixmapStatus = NULL;
|
||||
pixmapIcons = NULL;
|
||||
}
|
||||
|
||||
@@ -1585,6 +1586,8 @@ void cRecMenuItemTimer::Show(void) {
|
||||
}
|
||||
|
||||
void cRecMenuItemTimer::Draw(void) {
|
||||
if (!timer)
|
||||
return;
|
||||
const cChannel *channel = timer->Channel();
|
||||
int channelTransponder = 0;
|
||||
cString channelName = "";
|
||||
@@ -1598,7 +1601,7 @@ void cRecMenuItemTimer::Draw(void) {
|
||||
if (!config.hideChannelLogos) {
|
||||
if (imgLoader.LoadLogo(channel, logoWidth, height)) {
|
||||
cImage logo = imgLoader.GetImage();
|
||||
pixmapIcons->DrawImage(cPoint(logoX, 0), logo);
|
||||
pixmapIcons->DrawImage(cPoint(logoX, (height - logo.Height()) / 2), logo);
|
||||
logoX += logoWidth + 5;
|
||||
}
|
||||
}
|
||||
@@ -1740,8 +1743,13 @@ cRecMenuItemTimerConflictHeader::~cRecMenuItemTimerConflictHeader(void) {
|
||||
}
|
||||
|
||||
void cRecMenuItemTimerConflictHeader::SetPixmaps(void) {
|
||||
pixmap = osdManager.requestPixmap(4, cRect(x, y, width, height));
|
||||
pixmapStatus = osdManager.requestPixmap(5, cRect(x, y, width, height));
|
||||
if (!pixmap) {
|
||||
pixmap = osdManager.requestPixmap(4, cRect(x, y, width, height));
|
||||
pixmapStatus = osdManager.requestPixmap(5, cRect(x, y, width, height));
|
||||
} else {
|
||||
pixmap->SetViewPort(cRect(x, y, width, height));
|
||||
pixmapStatus->SetViewPort(cRect(x, y, width, height));
|
||||
}
|
||||
pixmapStatus->Fill(clrTransparent);
|
||||
}
|
||||
|
||||
@@ -2005,7 +2013,7 @@ void cRecMenuItemChannelChooser::DrawValue(void) {
|
||||
cImageLoader imgLoader;
|
||||
if (imgLoader.LoadLogo(channel, logoWidth, height - 10)) {
|
||||
cImage logo = imgLoader.GetImage();
|
||||
pixmapChannel->DrawImage(cPoint(logoX, 5), logo);
|
||||
pixmapChannel->DrawImage(cPoint(logoX, (height - logo.Height()) / 2), logo);
|
||||
}
|
||||
} else {
|
||||
cString textVal = tr("all Channels");
|
||||
@@ -2304,13 +2312,14 @@ void cRecMenuItemRecording::Show(void) {
|
||||
}
|
||||
|
||||
// --- cRecMenuItemTimelineHeader -------------------------------------------------------
|
||||
cRecMenuItemTimelineHeader::cRecMenuItemTimelineHeader(time_t day, std::vector<cTVGuideTimerConflict*> conflictsToday) {
|
||||
cRecMenuItemTimelineHeader::cRecMenuItemTimelineHeader(time_t day, int numTimersToday, std::vector<cTVGuideTimerConflict*> conflictsToday) {
|
||||
conflicts = conflictsToday;
|
||||
pixmapTimeline = NULL;
|
||||
pixmapTimerInfo = NULL;
|
||||
pixmapTimerConflicts = NULL;
|
||||
timer = NULL;
|
||||
this->day = day;
|
||||
this->numTimersToday = numTimersToday;
|
||||
selectable = false;
|
||||
active = false;
|
||||
height = 5 * font->Height();
|
||||
@@ -2359,7 +2368,7 @@ void cRecMenuItemTimelineHeader::Draw(void) {
|
||||
}
|
||||
DrawTimerConflicts();
|
||||
pixmap->Fill(clrTransparent);
|
||||
cString headerText = tr("Timers for");
|
||||
cString headerText = cString::sprintf("%i %s", numTimersToday, tr("Timers for"));
|
||||
cString dateText = DateString(day);
|
||||
cString header = cString::sprintf("%s: %s", *headerText, *dateText);
|
||||
int xText = (width - fontLarge->Width(*header)) / 2;
|
||||
@@ -2384,7 +2393,7 @@ void cRecMenuItemTimelineHeader::DrawCurrentTimer(void) {
|
||||
if (!config.hideChannelLogos) {
|
||||
if (imgLoader.LoadLogo(channel, logoWidth, infoHeight)) {
|
||||
cImage logo = imgLoader.GetImage();
|
||||
pixmapTimerInfo->DrawImage(cPoint(0, 0), logo);
|
||||
pixmapTimerInfo->DrawImage(cPoint(0, (infoHeight - logo.Height()) / 2), logo);
|
||||
x += logoWidth + 10;
|
||||
logoDrawn = true;
|
||||
}
|
||||
@@ -2421,7 +2430,7 @@ void cRecMenuItemTimelineHeader::DrawTimeline(void) {
|
||||
pixmapTimeline->Fill(clrTransparent);
|
||||
width5Mins = (float)width * 5.0 / 24.0 / 60.0;
|
||||
int widthHour = 12 * width5Mins;
|
||||
x0 = (width - 24*widthHour)/2;
|
||||
x0 = (width - (24 * widthHour)) / 2;
|
||||
int barHeight = fontSmall->Height();
|
||||
int y = height - barHeight;
|
||||
tColor col1 = theme.Color(clrTimeline1);
|
||||
@@ -2526,7 +2535,8 @@ void cRecMenuItemTimelineTimer::SetPixmaps(void) {
|
||||
|
||||
}
|
||||
width5Mins = (float)width * 5.0 / 24.0 / 60.0;
|
||||
x0 = (width - 24*12*width5Mins)/2;
|
||||
int widthHour = 12 * width5Mins;
|
||||
x0 = (width - (24 * widthHour)) / 2;
|
||||
}
|
||||
|
||||
void cRecMenuItemTimelineTimer::Draw(void) {
|
||||
|
@@ -25,6 +25,7 @@ enum eRecMenuState {
|
||||
rmsSearchRerunsTimerConflictMenu,
|
||||
rmsSaveTimerConflictMenu,
|
||||
rmsTimerConflictShowInfo,
|
||||
rmsOnOffTimer,
|
||||
rmsDeleteTimer,
|
||||
rmsDeleteTimerConfirmation,
|
||||
rmsEditTimer,
|
||||
@@ -573,19 +574,21 @@ private:
|
||||
cPixmap *pixmapTimeline;
|
||||
cPixmap *pixmapTimerInfo;
|
||||
cPixmap *pixmapTimerConflicts;
|
||||
int width5Mins;
|
||||
float width5Mins;
|
||||
int x0;
|
||||
int numTimersToday;
|
||||
bool timelineDrawn;
|
||||
void DrawTimeline(void);
|
||||
void DrawTimerConflicts(void);
|
||||
void DrawCurrentTimer(void);
|
||||
public:
|
||||
cRecMenuItemTimelineHeader(time_t day, std::vector<cTVGuideTimerConflict*> conflictsToday);
|
||||
cRecMenuItemTimelineHeader(time_t day, int numTimersToday, std::vector<cTVGuideTimerConflict*> conflictsToday);
|
||||
virtual ~cRecMenuItemTimelineHeader(void);
|
||||
void SetDay(time_t day) { this->day = day; };
|
||||
void SetPixmaps(void);
|
||||
void SetCurrentTimer(const cTimer *timer) { this->timer = timer; };
|
||||
void UnsetCurrentTimer(void) { timer = NULL; };
|
||||
void SetNumTimersToday(int numTimersToday) { this->numTimersToday = numTimersToday; };
|
||||
void RefreshTimerDisplay(void);
|
||||
void Hide(void);
|
||||
void Show(void);
|
||||
@@ -601,7 +604,7 @@ private:
|
||||
cPixmap *pixmapTimerConflicts;
|
||||
cRecMenuItemTimelineHeader *header;
|
||||
int x0;
|
||||
int width5Mins;
|
||||
float width5Mins;
|
||||
time_t start;
|
||||
time_t stop;
|
||||
void DrawBackground(void);
|
||||
|
63
recmenus.c
63
recmenus.c
@@ -11,8 +11,9 @@ cRecMenuMain::cRecMenuMain(bool epgSearchAvailable, bool timerActive, bool switc
|
||||
action = rmsInstantRecordFolder;
|
||||
AddMenuItem(new cRecMenuItemButton(tr("Instant Record"), action, true, false, false, true));
|
||||
} else {
|
||||
AddMenuItem(new cRecMenuItemButton(tr("Delete Timer"), rmsDeleteTimer, true, false, false, true));
|
||||
AddMenuItem(new cRecMenuItemButton(tr("Timer On/Off"), rmsOnOffTimer, true, false, false, true));
|
||||
AddMenuItem(new cRecMenuItemButton(tr("Edit Timer"), rmsEditTimer, false, false, false, true));
|
||||
AddMenuItem(new cRecMenuItemButton(tr("Delete Timer"), rmsDeleteTimer, false, false, false, true));
|
||||
}
|
||||
|
||||
AddMenuItem(new cRecMenuItemButton(tr("Timer Timeline"), rmsTimeline, false, false, false, true));
|
||||
@@ -194,8 +195,9 @@ cRecMenuAskDeleteTimer::cRecMenuAskDeleteTimer(const cEvent *event) {
|
||||
|
||||
// --- cRecMenuTimerConflicts ---------------------------------------------------------
|
||||
cRecMenuTimerConflicts::cRecMenuTimerConflicts(cTVGuideTimerConflicts *conflicts) {
|
||||
int numConflicts = conflicts->NumConflicts();
|
||||
|
||||
SetWidthPercent(50);
|
||||
|
||||
int numConflicts = (conflicts) ? conflicts->NumConflicts() : 0;
|
||||
cString text;
|
||||
if (numConflicts == 1) {
|
||||
text = cString::sprintf("%s %s %s", tr("One"), tr("Timer Conflict"), tr("detected"));
|
||||
@@ -230,19 +232,21 @@ int cRecMenuTimerConflicts::GetTimerConflict(void) {
|
||||
}
|
||||
|
||||
// --- cRecMenuTimerConflict ---------------------------------------------------------
|
||||
cRecMenuTimerConflict::cRecMenuTimerConflict(cTVGuideTimerConflict *conflict) {
|
||||
cRecMenuTimerConflict::cRecMenuTimerConflict(cTVGuideTimerConflict *conflict, eRecMenuState nextAction) {
|
||||
SetWidthPercent(95);
|
||||
this->conflict = conflict;
|
||||
SetHeader(new cRecMenuItemTimerConflictHeader(conflict->timeStart,
|
||||
conflict->timeStop,
|
||||
conflict->overlapStart,
|
||||
totalNumMenuItems = (int)conflict->timerIDs.size();
|
||||
|
||||
SetHeader(new cRecMenuItemTimerConflictHeader(conflict->timeStart,
|
||||
conflict->timeStop,
|
||||
conflict->overlapStart,
|
||||
conflict->overlapStop));
|
||||
SetFooter(new cRecMenuItemButton(tr("Ignore Conflict"), rmsIgnoreTimerConflict, false, true));
|
||||
SetFooter(new cRecMenuItemButton(tr("Ignore Conflict"), nextAction, false, true));
|
||||
int i=0;
|
||||
for(std::vector<int>::iterator it = conflict->timerIDs.begin(); it != conflict->timerIDs.end(); it++) {
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_READ;
|
||||
const cTimer *timer = Timers->Get(*it);
|
||||
const cTimer *timer = Timers->GetById(*it + 1);
|
||||
#else
|
||||
const cTimer *timer = Timers.Get(*it);
|
||||
#endif
|
||||
@@ -268,7 +272,7 @@ cRecMenuTimerConflict::cRecMenuTimerConflict(cTVGuideTimerConflict *conflict) {
|
||||
}
|
||||
|
||||
cRecMenuItem *cRecMenuTimerConflict::GetMenuItem(int number) {
|
||||
if ((number >= 0) && (number < (int)conflict->timerIDs.size())) {
|
||||
if ((number >= 0) && (number < totalNumMenuItems)) {
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_READ;
|
||||
const cTimer *timer = Timers->Get(conflict->timerIDs[number]);
|
||||
@@ -290,8 +294,8 @@ cRecMenuItem *cRecMenuTimerConflict::GetMenuItem(int number) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int cRecMenuTimerConflict::GetTotalNumMenuItems(void) {
|
||||
return conflict->timerIDs.size();
|
||||
int cRecMenuTimerConflict::GetTotalNumMenuItems(void) {
|
||||
return totalNumMenuItems;
|
||||
}
|
||||
|
||||
int cRecMenuTimerConflict::GetTimerConflictIndex(void) {
|
||||
@@ -1410,8 +1414,8 @@ cRecMenuTimeline::cRecMenuTimeline(cTVGuideTimerConflicts *timerConflicts) {
|
||||
SetStartStop();
|
||||
conflictsToday = timerConflicts->GetConflictsBetween(timeStart, timeStop);
|
||||
GetTimersForDay();
|
||||
SetWidthPercent(95);
|
||||
header = new cRecMenuItemTimelineHeader(timeStart, conflictsToday);
|
||||
SetWidthPercent(90);
|
||||
header = new cRecMenuItemTimelineHeader(timeStart, numTimersToday, conflictsToday);
|
||||
SetHeader(header);
|
||||
cRecMenuItem *footer = new cRecMenuItemButton(tr("Close"), rmsClose, false, true);
|
||||
SetFooter(footer);
|
||||
@@ -1432,9 +1436,6 @@ void cRecMenuTimeline::GetTimersForDay(void) {
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_READ;
|
||||
const cTimers* timers = Timers;
|
||||
#else
|
||||
const cTimers* timers = &Timers;
|
||||
#endif
|
||||
cSortedTimers SortedTimers(timers);
|
||||
int i = 0;
|
||||
while (i < SortedTimers.Size()) {
|
||||
@@ -1445,17 +1446,29 @@ void cRecMenuTimeline::GetTimersForDay(void) {
|
||||
}
|
||||
i++;
|
||||
}
|
||||
#else
|
||||
for (const cTimer *t = Timers.First(); t; t = Timers.Next(t)) {
|
||||
if (((t->StartTime() > timeStart) && (t->StartTime() <= timeStop)) || ((t->StopTime() > timeStart) && (t->StopTime() <= timeStop))) {
|
||||
timersToday.push_back(t);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
numTimersToday = timersToday.size();
|
||||
}
|
||||
|
||||
void cRecMenuTimeline::SetTimers(void) {
|
||||
ClearMenu();
|
||||
GetTimersForDay();
|
||||
conflictsToday = timerConflicts->GetConflictsBetween(timeStart, timeStop);
|
||||
header->UnsetCurrentTimer();
|
||||
header->SetDay(timeStart);
|
||||
header->RefreshTimerDisplay();
|
||||
header->SetNumTimersToday(numTimersToday);
|
||||
if (numTimersToday == 0) {
|
||||
AddMenuItem(new cRecMenuItemTimelineTimer(NULL, 0, 0, conflictsToday, header, false));
|
||||
header->UnsetCurrentTimer();
|
||||
footer->setActive();
|
||||
} else {
|
||||
for (int i=0; i<numTimersToday; i++) {
|
||||
for (int i = 0; i<numTimersToday; i++) {
|
||||
cRecMenuItemTimelineTimer *item = new cRecMenuItemTimelineTimer(timersToday[i], timeStart, timeStop, conflictsToday, header, false);
|
||||
if (i==0)
|
||||
item->setActive();
|
||||
@@ -1474,12 +1487,6 @@ void cRecMenuTimeline::PrevDay(void) {
|
||||
return;
|
||||
timeStart -= 3600*24;
|
||||
timeStop -= 3600*24;
|
||||
conflictsToday = timerConflicts->GetConflictsBetween(timeStart, timeStop);
|
||||
SetWidthPercent(95);
|
||||
header->SetDay(timeStart);
|
||||
header->UnsetCurrentTimer();
|
||||
header->RefreshTimerDisplay();
|
||||
GetTimersForDay();
|
||||
SetTimers();
|
||||
Display();
|
||||
}
|
||||
@@ -1487,12 +1494,6 @@ void cRecMenuTimeline::PrevDay(void) {
|
||||
void cRecMenuTimeline::NextDay(void) {
|
||||
timeStart += 3600*24;
|
||||
timeStop += 3600*24;
|
||||
conflictsToday = timerConflicts->GetConflictsBetween(timeStart, timeStop);
|
||||
SetWidthPercent(95);
|
||||
header->SetDay(timeStart);
|
||||
header->UnsetCurrentTimer();
|
||||
header->RefreshTimerDisplay();
|
||||
GetTimersForDay();
|
||||
SetTimers();
|
||||
Display();
|
||||
}
|
||||
|
@@ -77,11 +77,12 @@ public:
|
||||
class cRecMenuTimerConflict: public cRecMenu {
|
||||
private:
|
||||
cTVGuideTimerConflict *conflict;
|
||||
int totalNumMenuItems;
|
||||
public:
|
||||
cRecMenuTimerConflict(cTVGuideTimerConflict *conflict);
|
||||
cRecMenuTimerConflict(cTVGuideTimerConflict *conflict, eRecMenuState nextAction = rmsClose);
|
||||
virtual ~cRecMenuTimerConflict(void) {};
|
||||
cRecMenuItem *GetMenuItem(int number);
|
||||
int GetTotalNumMenuItems(void);
|
||||
virtual ~cRecMenuTimerConflict(void) {};
|
||||
int GetTimerConflictIndex(void);
|
||||
};
|
||||
|
||||
|
144
recmenuview.c
144
recmenuview.c
@@ -93,16 +93,18 @@ void cRecMenuView::DisplaySearchTimerList(void) {
|
||||
}
|
||||
|
||||
bool cRecMenuView::DisplayTimerConflict(const cTimer *timer) {
|
||||
int timerID = 0;
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_READ;
|
||||
for (const cTimer *t = Timers->First(); t; t = Timers->Next(t)) {
|
||||
if (t == timer)
|
||||
return DisplayTimerConflict(timer->Id() - 1);
|
||||
#else
|
||||
int timerID = 0;
|
||||
for (const cTimer *t = Timers.First(); t; t = Timers.Next(t)) {
|
||||
#endif
|
||||
if (t == timer)
|
||||
return DisplayTimerConflict(timerID);
|
||||
timerID++;
|
||||
#endif
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -119,7 +121,8 @@ bool cRecMenuView::DisplayTimerConflict(int timerID) {
|
||||
cTVGuideTimerConflict *conflict = timerConflicts->GetCurrentConflict();
|
||||
if (!conflict)
|
||||
return false;
|
||||
activeMenu = new cRecMenuTimerConflict(conflict);
|
||||
// delete activeMenu;
|
||||
activeMenu = new cRecMenuTimerConflict(conflict, rmsIgnoreTimerConflict);
|
||||
activeMenu->Display();
|
||||
return true;
|
||||
}
|
||||
@@ -161,11 +164,16 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
|
||||
if (cRecMenuAskFolder *menu = dynamic_cast<cRecMenuAskFolder*>(activeMenu)) {
|
||||
recFolder = menu->GetFolder();
|
||||
}
|
||||
delete activeMenu;
|
||||
cTimer *timer = recManager->createTimer(event, recFolder);
|
||||
if (!DisplayTimerConflict(timer)) {
|
||||
activeMenu = new cRecMenuConfirmTimer(event);
|
||||
activeMenu->Display();
|
||||
if (config.timerMessage) {
|
||||
delete activeMenu;
|
||||
activeMenu = new cRecMenuConfirmTimer(event);
|
||||
activeMenu->Display();
|
||||
} else {
|
||||
Close();
|
||||
state = osEnd;
|
||||
}
|
||||
}
|
||||
break; }
|
||||
case rmsInstantRecordFolder:
|
||||
@@ -175,24 +183,49 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
|
||||
activeMenu = new cRecMenuAskFolder(event, rmsInstantRecord);
|
||||
activeMenu->Display();
|
||||
break;
|
||||
case rmsOnOffTimer: {
|
||||
//caller: main menu
|
||||
//De/Activate timer for active event
|
||||
recManager->OnOffTimer(event);
|
||||
if (config.timerMessage) {
|
||||
delete activeMenu;
|
||||
activeMenu = new cRecMenuConfirmTimer(event, true);
|
||||
activeMenu->Display();
|
||||
} else {
|
||||
Close();
|
||||
state = osEnd;
|
||||
}
|
||||
break; }
|
||||
case rmsDeleteTimer: {
|
||||
//caller: main menu
|
||||
//delete timer for active event
|
||||
delete activeMenu;
|
||||
if (recManager->IsRecorded(event)) {
|
||||
delete activeMenu;
|
||||
activeMenu = new cRecMenuAskDeleteTimer(event);
|
||||
activeMenu->Display();
|
||||
} else {
|
||||
recManager->DeleteTimer(event);
|
||||
activeMenu = new cRecMenuConfirmDeleteTimer(event);
|
||||
if (config.timerMessage) {
|
||||
delete activeMenu;
|
||||
activeMenu = new cRecMenuConfirmDeleteTimer(event);
|
||||
activeMenu->Display();
|
||||
} else {
|
||||
Close();
|
||||
state = osEnd;
|
||||
}
|
||||
}
|
||||
activeMenu->Display();
|
||||
break; }
|
||||
case rmsDeleteTimerConfirmation: {
|
||||
//delete running timer for active event
|
||||
recManager->DeleteTimer(event);
|
||||
delete activeMenu;
|
||||
activeMenu = new cRecMenuConfirmDeleteTimer(event);
|
||||
activeMenu->Display();
|
||||
if (config.timerMessage) {
|
||||
delete activeMenu;
|
||||
activeMenu = new cRecMenuConfirmDeleteTimer(event);
|
||||
activeMenu->Display();
|
||||
} else {
|
||||
Close();
|
||||
state = osEnd;
|
||||
}
|
||||
break; }
|
||||
case rmsEditTimer: {
|
||||
//edit timer for active event
|
||||
@@ -219,9 +252,14 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
|
||||
case rmsIgnoreTimerConflict:
|
||||
//caller: cRecMenuTimerConflict
|
||||
//Confirming created Timer
|
||||
delete activeMenu;
|
||||
activeMenu = new cRecMenuConfirmTimer(event);
|
||||
activeMenu->Display();
|
||||
if (config.timerMessage) {
|
||||
delete activeMenu;
|
||||
activeMenu = new cRecMenuConfirmTimer(event);
|
||||
activeMenu->Display();
|
||||
} else {
|
||||
Close();
|
||||
state = osEnd;
|
||||
}
|
||||
break;
|
||||
case rmsTimerConflictShowInfo: {
|
||||
//caller: cRecMenuTimerConflict
|
||||
@@ -229,12 +267,18 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
|
||||
if (cRecMenuTimerConflict *menu = dynamic_cast<cRecMenuTimerConflict*>(activeMenu)) {
|
||||
timerIndex = menu->GetTimerConflictIndex();
|
||||
} else break;
|
||||
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex);
|
||||
const cTimers* timers;
|
||||
#if VDRVERSNUM >= 20301
|
||||
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex) + 1;
|
||||
{
|
||||
LOCK_TIMERS_READ;
|
||||
const cTimer *t = Timers->Get(timerID);
|
||||
timers = Timers;
|
||||
}
|
||||
const cTimer *t = timers->GetById(timerID);
|
||||
#else
|
||||
const cTimer *t = Timers.Get(timerID);
|
||||
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex);
|
||||
timers = &Timers;
|
||||
const cTimer *t = timers->Get(timerID);
|
||||
#endif
|
||||
if (t) {
|
||||
const cEvent *ev = t->Event();
|
||||
@@ -250,21 +294,30 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
|
||||
if (cRecMenuTimerConflict *menu = dynamic_cast<cRecMenuTimerConflict*>(activeMenu)) {
|
||||
timerIndex = menu->GetTimerConflictIndex();
|
||||
} else break;
|
||||
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex);
|
||||
const cTimers* timers;
|
||||
const cEvent *event;
|
||||
#if VDRVERSNUM >= 20301
|
||||
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex) + 1;
|
||||
{
|
||||
LOCK_TIMERS_READ;
|
||||
timers = Timers;
|
||||
}
|
||||
event = timers->GetById(timerID)->Event();
|
||||
#else
|
||||
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex);
|
||||
timers = &Timers;
|
||||
event = timers->Get(timerID)->Event();
|
||||
#endif
|
||||
recManager->DeleteTimer(timers->Get(timerID)->Event());
|
||||
delete activeMenu;
|
||||
recManager->DeleteTimer(event);
|
||||
if (!DisplayTimerConflict(timerID)) {
|
||||
activeMenu = new cRecMenuConfirmTimer(timers->Get(timerID)->Event());
|
||||
activeMenu->Display();
|
||||
if (config.timerMessage) {
|
||||
delete activeMenu;
|
||||
activeMenu = new cRecMenuConfirmDeleteTimer(event);
|
||||
activeMenu->Display();
|
||||
} else {
|
||||
Close();
|
||||
state = osEnd;
|
||||
}
|
||||
}
|
||||
break; }
|
||||
case rmsEditTimerConflictMenu: {
|
||||
@@ -274,12 +327,18 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
|
||||
if (cRecMenuTimerConflict *menu = dynamic_cast<cRecMenuTimerConflict*>(activeMenu)) {
|
||||
timerIndex = menu->GetTimerConflictIndex();
|
||||
} else break;
|
||||
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex);
|
||||
const cTimers* timers;
|
||||
#if VDRVERSNUM >= 20301
|
||||
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex) + 1;
|
||||
{
|
||||
LOCK_TIMERS_READ;
|
||||
const cTimer *timer = Timers->Get(timerID);
|
||||
timers = Timers;
|
||||
}
|
||||
const cTimer *timer = timers->GetById(timerID);
|
||||
#else
|
||||
const cTimer *timer = Timers.Get(timerID);
|
||||
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex);
|
||||
timers = &Timers;
|
||||
const cTimer *timer = timers->Get(timerID);
|
||||
#endif
|
||||
if (timer) {
|
||||
delete activeMenu;
|
||||
@@ -297,10 +356,15 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
|
||||
originalTimer = menu->GetOriginalTimer();
|
||||
} else break;
|
||||
recManager->SaveTimer(originalTimer, timerModified);
|
||||
delete activeMenu;
|
||||
if (!DisplayTimerConflict(originalTimer)) {
|
||||
activeMenu = new cRecMenuConfirmTimer(originalTimer->Event(), true);
|
||||
activeMenu->Display();
|
||||
if (config.timerMessage) {
|
||||
delete activeMenu;
|
||||
activeMenu = new cRecMenuConfirmTimer(originalTimer->Event(), true);
|
||||
activeMenu->Display();
|
||||
} else {
|
||||
Close();
|
||||
state = osEnd;
|
||||
}
|
||||
}
|
||||
break; }
|
||||
/***************************************************************************************
|
||||
@@ -648,7 +712,7 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
|
||||
} else break;
|
||||
timerConflicts->SetCurrentConflict(timerConflict);
|
||||
delete activeMenu;
|
||||
activeMenu = new cRecMenuTimerConflict(timerConflicts->GetCurrentConflict());
|
||||
activeMenu = new cRecMenuTimerConflict(timerConflicts->GetCurrentConflict(), rmsTimerConflicts);
|
||||
activeMenu->Display();
|
||||
break; }
|
||||
case rmsSearchRerunsTimerConflictMenu: {
|
||||
@@ -660,12 +724,18 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
|
||||
if (cRecMenuTimerConflict *menu = dynamic_cast<cRecMenuTimerConflict*>(activeMenu)) {
|
||||
timerConflict = menu->GetTimerConflictIndex();
|
||||
} else break;
|
||||
int timerID = timerConflicts->GetCurrentConflictTimerID(timerConflict);
|
||||
const cTimers* timers;
|
||||
#if VDRVERSNUM >= 20301
|
||||
int timerID = timerConflicts->GetCurrentConflictTimerID(timerConflict) + 1;
|
||||
{
|
||||
LOCK_TIMERS_READ;
|
||||
const cTimer *timer = Timers->Get(timerID);
|
||||
timers = Timers;
|
||||
}
|
||||
const cTimer *timer = timers->GetById(timerID);
|
||||
#else
|
||||
cTimer *timer = Timers.Get(timerID);
|
||||
int timerID = timerConflicts->GetCurrentConflictTimerID(timerConflict);
|
||||
timers = &Timers;
|
||||
const cTimer *timer = timers->Get(timerID);
|
||||
#endif
|
||||
if (timer) {
|
||||
const cEvent *event = timer->Event();
|
||||
@@ -707,12 +777,16 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
|
||||
originalConflictIndex = menu->GetTimerConflictIndex();
|
||||
} else break;
|
||||
int originalTimerID = timerConflicts->GetCurrentConflictTimerID(originalConflictIndex);
|
||||
const cTimers* timers;
|
||||
#if VDRVERSNUM >= 20301
|
||||
{
|
||||
LOCK_TIMERS_READ;
|
||||
const cTimer *timerOriginal = Timers->Get(originalTimerID);
|
||||
timers = Timers;
|
||||
}
|
||||
#else
|
||||
cTimer *timerOriginal = Timers.Get(originalTimerID);
|
||||
timers = &Timers;
|
||||
#endif
|
||||
const cTimer *timerOriginal = timers->Get(originalTimerID);
|
||||
if (replace && timerOriginal) {
|
||||
recManager->DeleteTimer(timerOriginal->Event());
|
||||
recManager->createTimer(replace);
|
||||
|
4
setup.c
4
setup.c
@@ -108,7 +108,8 @@ void cTvguideSetup::Store(void) {
|
||||
SetupStore("footerHeightPercent", config.footerHeightPercent);
|
||||
SetupStore("instRecFolderMode", config.instRecFolderMode);
|
||||
SetupStore("instRecFixedFolder", config.instRecFixedFolder.c_str());
|
||||
SetupStore("AddSubtitleToTimerMode", config.addSubtitleToTimer);
|
||||
SetupStore("addSubtitleToTimer", config.addSubtitleToTimer);
|
||||
SetupStore("timerMessage", config.timerMessage);
|
||||
SetupStore("favWhatsOnNow", config.favWhatsOnNow);
|
||||
SetupStore("favWhatsOnNext", config.favWhatsOnNext);
|
||||
SetupStore("favUseTime1", config.favUseTime1);
|
||||
@@ -432,6 +433,7 @@ void cMenuSetupFavorites::Set(void) {
|
||||
Add(new cMenuEditStraItem(tr("Add episode to manual timers"), &tmpConfig->addSubtitleToTimer, 3, addSubtitleMode));
|
||||
if (pRemoteTimers)
|
||||
Add(new cMenuEditBoolItem(tr("Use Remotetimers"), &tmpConfig->useRemoteTimers));
|
||||
Add(new cMenuEditBoolItem(tr("Show timer confirmation messages"), &tmpConfig->timerMessage));
|
||||
Add(new cOsdItem(tr("Favorites:"), osUnknown, false));
|
||||
Add(new cMenuEditBoolItem(tr("Limit channels in favorites"), &tmpConfig->favLimitChannels));
|
||||
if (tmpConfig->favLimitChannels) {
|
||||
|
@@ -16,12 +16,11 @@ cTVGuideTimerConflict::cTVGuideTimerConflict(void) {
|
||||
}
|
||||
|
||||
cTVGuideTimerConflict::~cTVGuideTimerConflict(void) {
|
||||
|
||||
}
|
||||
|
||||
bool cTVGuideTimerConflict::timerInvolved(int involvedID) {
|
||||
int numConflicts = timerIDs.size();
|
||||
for (int i=0; i<numConflicts; i++) {
|
||||
for (int i = 0; i < numConflicts; i++) {
|
||||
if (timerIDs[i] == involvedID)
|
||||
return true;
|
||||
}
|
||||
@@ -44,13 +43,12 @@ cTVGuideTimerConflicts::~cTVGuideTimerConflicts(void) {
|
||||
}
|
||||
|
||||
void cTVGuideTimerConflicts::AddConflict(std::string epgSearchConflictLine) {
|
||||
/* TIMERCONFLICT FORMAT:
|
||||
/* TIMERCONFLICT FORMAT:
|
||||
The result list looks like this for example when we have 2 timer conflicts at one time:
|
||||
1190232780:152|30|50#152#45:45|10|50#152#45
|
||||
'1190232780' is the time of the conflict in seconds since 1970-01-01.
|
||||
It's followed by list of timers that have a conflict at this time:
|
||||
'152|30|50#1 int editTimer(cTimer *timer, bool active, int prio, int start, int stop);
|
||||
52#45' is the description of the first conflicting timer. Here:
|
||||
'152|30|50#152#45' is the description of the first conflicting timer. Here:
|
||||
'152' is VDR's timer id of this timer as returned from VDR's LSTT command
|
||||
'30' is the percentage of recording that would be done (0...100)
|
||||
'50#152#45' is the list of concurrent timers at this conflict
|
||||
@@ -86,11 +84,13 @@ void cTVGuideTimerConflicts::CalculateConflicts(void) {
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_READ;
|
||||
const cTimers* timers = Timers;
|
||||
for (int j=0; j < numTimers; j++) {
|
||||
const cTimer *timer = timers->GetById(conflicts[i]->timerIDs[j] + 1);
|
||||
#else
|
||||
const cTimers* timers = &Timers;
|
||||
#endif
|
||||
for (int j=0; j < numTimers; j++) {
|
||||
const cTimer *timer = timers->Get(conflicts[i]->timerIDs[j]);
|
||||
#endif
|
||||
if (timer) {
|
||||
if (!unionSet) {
|
||||
unionSet = new cTimeInterval(timer->StartTime(), timer->StopTime());
|
||||
@@ -109,7 +109,11 @@ void cTVGuideTimerConflicts::CalculateConflicts(void) {
|
||||
|
||||
cTimeInterval *intersect = NULL;
|
||||
for (int j=0; j < numTimers; j++) {
|
||||
#if VDRVERSNUM >= 20301
|
||||
const cTimer *timer = timers->GetById(conflicts[i]->timerIDs[j] + 1);
|
||||
#else
|
||||
const cTimer *timer = timers->Get(conflicts[i]->timerIDs[j]);
|
||||
#endif
|
||||
if (timer) {
|
||||
if (!intersect) {
|
||||
intersect = new cTimeInterval(timer->StartTime(), timer->StopTime());
|
||||
@@ -152,7 +156,7 @@ int cTVGuideTimerConflicts::GetCurrentConflictTimerID(int timerIndex) {
|
||||
int cTVGuideTimerConflicts::GetCorrespondingConflict(int timerID) {
|
||||
int conflictIndex = -1;
|
||||
if (numConflicts > 0) {
|
||||
for (int i=0; i<numConflicts; i++) {
|
||||
for (int i = 0; i < numConflicts; i++) {
|
||||
if (conflicts[i]->timerInvolved(timerID)) {
|
||||
conflictIndex = i;
|
||||
break;
|
||||
@@ -172,7 +176,7 @@ cTVGuideTimerConflict *cTVGuideTimerConflicts::GetConflict(int conflictIndex) {
|
||||
|
||||
std::vector<cTVGuideTimerConflict*> cTVGuideTimerConflicts::GetConflictsBetween(time_t start, time_t stop) {
|
||||
std::vector<cTVGuideTimerConflict*> conflictsFound;
|
||||
for (int i=0; i < numConflicts; i++) {
|
||||
for (int i = 0; i < numConflicts; i++) {
|
||||
if ((conflicts[i]->timeStart > start) && (conflicts[i]->timeStart < stop)||
|
||||
(conflicts[i]->timeStop > start) && (conflicts[i]->timeStop < stop))
|
||||
conflictsFound.push_back(conflicts[i]);
|
||||
|
3
tools.c
3
tools.c
@@ -10,7 +10,6 @@
|
||||
#include <vdr/plugin.h>
|
||||
#include <vdr/skins.h>
|
||||
#include "services/epgsearch.h"
|
||||
|
||||
#include "tools.h"
|
||||
|
||||
cPlugin *GetScraperPlugin(void) {
|
||||
@@ -42,7 +41,7 @@ std::string utf8_substr(const std::string& str, unsigned int start, long unsigne
|
||||
}
|
||||
if (q<=start+leng || leng==std::string::npos){ max=i; }
|
||||
if (min==std::string::npos || max==std::string::npos) { return ""; }
|
||||
return str.substr(min,max);
|
||||
return str.substr(min,max-min);
|
||||
}
|
||||
|
||||
std::string CutText(std::string text, int width, const cFont *font) {
|
||||
|
@@ -27,7 +27,7 @@
|
||||
#error "VDR-2.0.0 API version or greater is required!"
|
||||
#endif
|
||||
|
||||
static const char *VERSION = "1.2.17";
|
||||
static const char *VERSION = "1.3.2";
|
||||
static const char *DESCRIPTION = tr("A fancy 2d EPG Viewer");
|
||||
static const char *MAINMENUENTRY = "Tvguide";
|
||||
|
||||
|
15
view.c
15
view.c
@@ -113,12 +113,18 @@ void cView::DrawHeader(void) {
|
||||
}
|
||||
}
|
||||
//Date and Time, Title, Subtitle
|
||||
int yDateTime = border / 2;
|
||||
int yTitle = (headerHeight - fontHeaderLarge->Height()) / 2;
|
||||
int ySubtitle = headerHeight - fontHeader->Height() - border / 3;
|
||||
int textWidthMax = headerWidth - xText - border / 2;
|
||||
wrapper.Set(title.c_str(), fontHeaderLarge, textWidthMax);
|
||||
int lineHeight = fontHeaderLarge->Height();
|
||||
int textLines = wrapper.Lines();
|
||||
int yDateTime = border / 2;
|
||||
int yTitle = (headerHeight - textLines * lineHeight) / 2;
|
||||
int ySubtitle = headerHeight - fontHeader->Height() - border / 3;
|
||||
|
||||
pixmapHeader->DrawText(cPoint(xText, yDateTime), CutText(dateTime, textWidthMax, fontHeader).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeader);
|
||||
pixmapHeader->DrawText(cPoint(xText, yTitle), CutText(title, textWidthMax, fontHeaderLarge).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeaderLarge);
|
||||
for (int i = 0; i < textLines; i++) {
|
||||
pixmapHeader->DrawText(cPoint(xText, yTitle + i * lineHeight), wrapper.GetLine(i), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeaderLarge);
|
||||
}
|
||||
pixmapHeader->DrawText(cPoint(xText, ySubtitle), CutText(subTitle, textWidthMax, fontHeader).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeader);
|
||||
//REC Icon
|
||||
eTimerMatch timerMatch = tmNone;
|
||||
@@ -481,7 +487,6 @@ bool cView::KeyUp(void) {
|
||||
if (!scrollable)
|
||||
return false;
|
||||
int aktHeight = pixmapContent->DrawPort().Point().Y();
|
||||
// int lineHeight = font->Height();
|
||||
if (aktHeight >= 0) {
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user