98 Commits

Author SHA1 Message Date
kamel5
263a734a0d Version 1.2.15 2019-11-03 13:46:13 +01:00
kamel5
7300fdf91c Workaround for HWAccelerated OSD 2019-11-03 13:08:07 +01:00
kamel5
89e9086943 Version 1.2.14 2019-10-19 16:41:09 +02:00
kamel5
e236d9e571 Optimize cTimeLine::drawClock 2019-10-19 15:10:20 +02:00
kamel5
8794891599 Fixed a error while changing a Theme 2019-10-19 15:10:13 +02:00
kamel5
cd62a9bd6b Diplay the current TimeBase throughout the whole timeline 2019-10-19 15:10:06 +02:00
kamel5
3f0bd75011 Can switch off and optimize diplay time in epggrid "displayMode == Vertical" 2019-10-19 15:09:59 +02:00
kamel5
a711aed160 Version 1.2.13 2019-10-14 18:16:28 +02:00
kamel5
cdb5a46145 Revert "Diplay the current TimeBase throughout the whole timeline"
This reverts commit b707292 because of a segfault.
2019-10-14 16:51:52 +02:00
kamel5
fc784f34e5 Version 1.2.12 2019-10-14 12:58:40 +02:00
kamel5
b707292485 Diplay the current TimeBase throughout the whole timeline 2019-10-14 12:58:35 +02:00
kamel5
587fbe1f44 Fixed updating current TimeBase 2019-10-13 13:46:29 +02:00
kamel5
9173d14b10 Fixed updating current time 2019-10-13 13:46:23 +02:00
kamel5
3386c05e91 Version 1.2.11 2019-09-07 17:32:20 +02:00
kamel5
a1eaf7a865 Optical change in cMenuSetupImageCache 2019-09-07 17:24:01 +02:00
kamel5
41eb32389d Fixed a possible deadlock in detailview 2019-09-07 17:23:32 +02:00
kamel5
f4369c0772 Fix a segfault with graphicsmagick > 1.3.31 2019-09-05 17:08:12 +02:00
kamel5
0203cb3f01 Version 1.2.10 2019-07-20 11:53:04 +02:00
kamel5
152662d519 Rework cRecMenuItemDayChooser 2019-07-19 15:59:44 +02:00
kamel5
b17fd9b7aa Rework cRecMenuItemDay 2019-07-19 11:38:07 +02:00
kamel5
fb165b2b43 Rework cRecMenuItemTime 2019-07-19 11:38:07 +02:00
kamel5
e31070cd76 Rework cRecMenuItemText 2019-07-19 11:38:07 +02:00
kamel5
15ce11db5f Rework cRecMenuItemBool 2019-07-19 11:38:07 +02:00
kamel5
0d3dd79585 Rework cRecMenuItemInt 2019-07-19 11:38:07 +02:00
kamel5
7f8ac2a2a8 Rework cRecMenuItemSelect 2019-07-19 11:38:07 +02:00
kamel5
31f72f2ad8 Rework cRecMenuItemChannelChooser 2019-07-19 11:38:04 +02:00
kamel5
a1aa300259 Rework indent & refresh 2019-07-18 16:53:27 +02:00
kamel5
b7970e5723 Fixed cRecMenuItemSelectDirectory::DrawValue 2019-07-18 13:38:53 +02:00
kamel5
3f9327b8e4 Simplify cRecMenuSearchTimerEdit::GetSearchTimer 2019-07-14 14:22:26 +02:00
kamel5
bff9d78ff3 Rename grid.* to gridelement.* 2019-07-11 15:11:26 +02:00
kamel5
d21b1496f0 Change cGrid to cGridElement 2019-07-11 15:06:07 +02:00
kamel5
5ff172c987 Rename timer.* to timemanager.* 2019-07-11 14:40:41 +02:00
kamel5
6b3eda282f Change cMyTime to cTimeManager 2019-07-11 14:34:31 +02:00
kamel5
107f3f945f lastValidChannel 2019-07-11 14:19:44 +02:00
kamel5
45a2d6bee0 Cosmetic changes in channelgroups.c 2019-07-11 13:40:00 +02:00
kamel5
700543b394 GetLastValidChannel 2019-07-11 13:20:23 +02:00
kamel5
1df9641621 Rename channelcolumn.* to channelepg.* 2019-07-11 12:07:35 +02:00
kamel5
3ed46bd881 Rename channelcolumn to channelepg 2019-07-11 12:06:18 +02:00
kamel5
81759f95cb Change cTvguideConfig to cTVGuideConfig 2019-07-11 11:44:46 +02:00
kamel5
0766d67980 Change tvguideConfig to Config 2019-07-11 11:44:39 +02:00
kamel5
3513f82a8c Change tmpTvguideConfig to tmpConfig 2019-07-11 11:13:51 +02:00
kamel5
7a79059414 Change files to unix 2019-07-11 11:07:13 +02:00
kamel5
ceadc0bbfe Rework recmenuview.c 2019-07-10 18:54:44 +02:00
kamel5
e09279ca32 set ff=unix recmenuview.* 2019-07-10 18:54:29 +02:00
kamel5
27e9004629 Rename recmenumanager.* to recmenuview.* 2019-07-10 17:41:35 +02:00
kamel5
194aa06a4e Update remotetimers.h 2019-07-10 17:41:35 +02:00
kamel5
f046493a00 Cosmetic changes 2019-07-10 17:41:35 +02:00
kamel5
fd7b1b9ab7 Rework cRecManager::UserDefinedTime 2019-07-10 17:41:30 +02:00
kamel5
c4e25b899c Rework cRecManager::WhatsOnNow 2019-07-10 17:41:25 +02:00
kamel5
059936c6d7 Rework cRecManager::DeleteTimer 2019-07-10 17:41:16 +02:00
kamel5
549d42b487 Rework cRecManager::createLocalTimer 2019-07-10 17:41:00 +02:00
kamel5
ad1f0ba0d6 Fixed a compiler error for VDR < 2.3.0 and Cosmetic changes 2019-07-06 13:44:55 +02:00
kamel5
69711400fa Version 1.2.9 2019-07-05 15:09:33 +02:00
kamel5
463b6369d2 Fixed dayOfWeek error in RecMenuSearchTimerEdit 2019-07-05 14:51:21 +02:00
kamel5
0b37464dd0 Change SetStartChannel() and SetStopChannel() 2019-07-04 13:16:13 +02:00
kamel5
cf171d8732 Cosmetic Changes 2019-07-04 12:38:47 +02:00
kamel5
d666b8701e Change locking in cTVGuideSearchTimer::cTVGuideSearchTimer 2019-07-03 12:54:57 +02:00
kamel5
6139016102 Change some default values for searchtimer 2019-07-03 12:39:58 +02:00
kamel5
1c99501776 Correct plugin options in README and CommandLineHelp 2019-06-20 15:40:53 +02:00
kamel5
b484f6cfc1 Version 1.2.8 2019-06-20 13:45:13 +02:00
kamel5
c04ca30792 Remove some debugging 2019-06-19 13:28:22 +02:00
kamel5
ba9c04a4bc Delete rmsSearchTimerEditAdvanced 2019-06-19 13:24:27 +02:00
kamel5
cb2c604d71 Update i18n 2019-06-17 16:17:11 +02:00
kamel5
b8b95f61ed Add more options to cRecMenuSearchTimerEdit 2019-06-17 16:11:09 +02:00
kamel5
507ecc60f6 Eliminate all currentMenuItems 2019-06-17 14:39:11 +02:00
kamel5
ef4ff3d115 Some refatoring to searchTimer 2019-06-17 14:38:17 +02:00
kamel5
1c591b5408 Eliminate InitMenuItems in cRecMenuSearchTimerEdit 2019-06-17 14:38:09 +02:00
kamel5
5b1e174316 Move some inits to cRecMenuSearchTimerEdit::cRecMenuSearchTimerEdit 2019-06-17 14:36:03 +02:00
kamel5
1a2da2da0a Eliminate AddSubMenu in cRecMenuSearchTimerEdit 2019-06-17 14:36:03 +02:00
kamel5
b83ad6df81 Add some parameter to cTVGuideSearchTimer 2019-06-17 14:36:03 +02:00
kamel5
0a931b97dc Cosmetic changes 2019-06-17 14:36:03 +02:00
kamel5
3cce1d2ead Delete advancedOptions in cRecMenuSearchTimerEdit 2019-06-17 14:35:53 +02:00
kamel5
f6a7ae497c Some changes to RecMenuItems 2019-06-16 14:50:15 +02:00
kamel5
803b28aad9 Cosmetic changes in searchtimer.c 2019-06-16 14:49:59 +02:00
kamel5
d5f46dacc6 Add some Modes to searchtimer.* 2019-06-16 14:23:44 +02:00
kamel5
763f9d4e52 Changes in recmenu.c 2019-06-16 14:01:22 +02:00
kamel5
82e404a74e Add cRecManager::GetSearchExtCats and cRecManager::GetBlacklists 2019-06-16 13:45:47 +02:00
kamel5
872a0618f8 Cosmetic changes 2019-06-16 13:36:05 +02:00
kamel5
d0c1519463 Version 1.2.7 2019-06-02 11:14:37 +02:00
kamel5
c081bc5ca1 Correct a compiler error 2019-05-04 12:59:14 +02:00
kamel5
8b1651401c Optical changes in favorites and searchtimer menu 2019-04-26 11:15:08 +02:00
kamel5
5df21a4707 Eliminate a "invalid lock sequence report" in tvguideosd.c 2019-04-23 13:44:44 +02:00
kamel5
e7753834bc Version 1.2.6 2019-04-14 13:58:22 +02:00
kamel5
d1e5e240ec Change channel icon size in cRecMenuSearchTimerEdit 2019-04-14 13:58:15 +02:00
kamel5
6e83787437 Channelgroup in cRecMenuSearchTimerEdit 2019-04-14 13:58:07 +02:00
kamel5
333a3d397f Add .gitignore 2019-04-14 13:58:01 +02:00
kamel5
80acee49e1 Changes for Rec Icon in DrawHeader 2019-04-10 16:59:22 +02:00
kamel5
6095fb4dbc Update services/epgsearch.h 2019-04-09 16:20:50 +02:00
kamel5
e01a63b29e Optimizations in setup menu 2019-04-09 15:08:16 +02:00
kamel5
0975e97519 Different setup parameter for displayTime in horizontal and vertical mode 2019-04-09 15:06:39 +02:00
kamel5
929d8db9ba Optical changes in displaymode vertical 2019-04-09 14:50:42 +02:00
kamel5
56250e3af8 Update services/epgsearch.h 2019-04-07 18:27:53 +02:00
kamel5
d825d700eb Correct an error in setup page 2019-04-07 15:58:55 +02:00
kamel5
ae206f4768 Eliminate a compiler warning in searchtimer.c 2019-04-07 12:59:55 +02:00
kamel5
c7f0131d52 Some cosmetic changes 2019-04-07 12:57:22 +02:00
kamel5
52d887d854 Some changes for VDR < 2.3.0 2019-04-07 12:57:14 +02:00
kamel5
6f7042d41f Correct an error with the recording sign in grid 2019-04-07 12:56:53 +02:00
kamel5
9009f4f385 A german DESCRIPTION 2019-04-07 12:55:44 +02:00
71 changed files with 9654 additions and 8817 deletions

5
.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
*.o
*.so
po/*.mo
po/*.pot
.dependencies

69
HISTORY
View File

@@ -167,3 +167,72 @@ Version 1.2.5
- Eliminate a seqfault in "cRecManager::DeleteSearchTimer"
- Show Inactive timer in DrawHeader
- Add "switchMode" to setup menu
Version 1.2.6
- Some changes for VDR < 2.3.0
- Changes for Rec Icon in DrawHeader and Grid
- Eliminate a compiler warning in searchtimer.c
- Correct an error in setup page
- Optical changes in displaymode vertical
- Different setup parameter for displayTime in horizontal and vertical mode
- Optimizations in setup menu
- Add .gitignore
- Channelgroup in cRecMenuSearchTimerEdit
(Create and modify of channelgroups isn't yet possible, should be done in epgsearch)
- Change channel icon size in cRecMenuSearchTimerEdit
Version 1.2.7
- Eliminate a "invalid lock sequence report" in tvguideosd.c
- Optical changes in favorites and searchtimer menu
- Changes in README
Version 1.2.8
- Some refactoring
- Update i18n
- Add almost all search timer options to cRecMenuSearchTimerEdit,
only one is missing: "Use content descriptor"
(Create and modify of channelgroups and blacklists isn't possible,
because the epgsearch service interface doesn't support that,
should be done in epgsearch)
Version 1.2.9
- Correct plugin options in README and CommandLineHelp
- Change locking in cTVGuideSearchTimer::cTVGuideSearchTimer
- Fixed a dayOfWeek error in RecMenuSearchTimerEdit
Version 1.2.10
- Update remotetimers.h
- Simplify cRecMenuSearchTimerEdit::GetSearchTimer
- Fixed cRecMenuItemSelectDirectory::DrawValue
- Some rework
Version 1.2.11
- Fixed a segfault with graphicsmagick > 1.3.31
- Fixed a possible deadlock in detailview
- Optical changes in cMenuSetupImageCache
Version 1.2.12
- Fixed updating current time
- Fixed updating current TimeBase
- Diplay the current TimeBase throughout the whole timeline
Version 1.2.13
- Revert "Diplay the current TimeBase throughout the whole timeline"
Version 1.2.14
- Diplay the current TimeBase throughout the whole timeline
- Can switch off and optimize diplay time in epggrid "displayMode == Vertical"
- Fixed a error while changing a Theme
Version 1.2.15
- Workaround for HWAccelerated OSD

View File

@@ -60,7 +60,7 @@ endif
### The object files (add further files here):
OBJS = $(PLUGIN).o channelcolumn.o channelgroup.o channelgroups.o channeljump.o config.o detailview.o dummygrid.o epggrid.o fontmanager.o footer.o geometrymanager.o grid.o headergrid.o imagecache.o imageloader.o imagemagickwrapper.o imagescaler.o osdmanager.o recmanager.o recmenu.o recmenuitem.o recmenumanager.o recmenus.o searchtimer.o setup.o statusheader.o styledpixmap.o switchtimer.o timeline.o timer.o timerconflict.o tools.o tvguideosd.o view.o
OBJS = $(PLUGIN).o channelepg.o channelgroup.o channelgroups.o channeljump.o config.o detailview.o dummygrid.o epggrid.o fontmanager.o footer.o geometrymanager.o gridelement.o headergrid.o imagecache.o imageloader.o imagemagickwrapper.o imagescaler.o osdmanager.o recmanager.o recmenu.o recmenuitem.o recmenuview.o recmenus.o searchtimer.o setup.o statusheader.o styledpixmap.o switchtimer.o timeline.o timemanager.o timerconflict.o tools.o tvguideosd.o view.o
### The main target:

16
README
View File

@@ -1,10 +1,14 @@
This is a "plugin" for the Video Disk Recorder (VDR).
Written by: Louis Braun <louis DOT braun AT gmx DOT de>
TVGuide on GitLab: https://gitlab.com/kamel5/tvguide
Project's homepage: http://projects.vdr-developer.org/projects/plg-tvguide
Original Written by: Louis Braun <louis DOT braun AT gmx DOT de>
Latest version available at: http://projects.vdr-developer.org/projects/plg-tvguide/files
Original Project's homepage: http://projects.vdr-developer.org/projects/plg-tvguide
Latest version available at: https://gitlab.com/kamel5/tvguide
Original version available at: http://projects.vdr-developer.org/projects/plg-tvguide/files
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -40,13 +44,13 @@ After "normal" Plugin installation you have to care about the paths for the
used Icons, the channel logos and epg images. The following paths can be set
at startup:
-l path, --logodir=path
-l path, --logopath=path
Path to the logos (Default: <ResourceDirectory>/plugins/tvguide/channellogos/).
-e path, --epgimages=path
Path to the epgimages (Default: <CacheDirectory>/plugins/tvguide/epgimages/).
-i path, --icons=path
-i path, --iconpath=path
Path to the icons directory (Default: <ResourceDirectory>/plugins/tvguide/epgimages/).
<ResourceDirectory> and <CacheDirectory> is taken from your VDR configuration
@@ -274,4 +278,4 @@ Setup Options
- Maximal number of logos to cache
- Number of logos to cache at start: number of logos to pre cache at plugin startup
(a too large number causes a slower VDR start)
- Information about image cache sizes
- Information about image cache sizes

View File

@@ -1,55 +1,44 @@
#include "channelcolumn.h"
#include "channelepg.h"
#include "dummygrid.h"
cChannelColumn::cChannelColumn(int num, const cChannel *channel, cMyTime *myTime) {
cChannelEpg::cChannelEpg(int num, const cChannel *channel, cTimeManager *timeManager) {
this->channel = channel;
this->num = num;
this->myTime = myTime;
#if VDRVERSNUM >= 20301
hasTimer = false;
const cSchedule *Schedule = NULL;
LOCK_SCHEDULES_READ;
const cSchedules* schedules = Schedules;
if (schedules) {
Schedule = schedules->GetSchedule(channel);
hasTimer = Schedule ? Schedule->HasTimer() : false;
}
#else
this->timeManager = timeManager;
#if VDRVERSNUM < 20301
hasTimer = channel->HasTimer();
#endif
hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel);
#if VDRVERSNUM >= 20301
#else
#if VDRVERSNUM < 20301
schedulesLock = new cSchedulesLock(false, 100);
#endif
header = NULL;
}
cChannelColumn::~cChannelColumn(void) {
cChannelEpg::~cChannelEpg(void) {
if (header)
delete header;
grids.Clear();
#if VDRVERSNUM >= 20301
#else
#if VDRVERSNUM < 20301
delete schedulesLock;
#endif
}
void cChannelColumn::clearGrids() {
void cChannelEpg::clearGrids() {
grids.Clear();
}
void cChannelColumn::createHeader() {
void cChannelEpg::createHeader() {
header = new cHeaderGrid();
header->createBackground(num);
header->drawChannel(channel);
}
void cChannelColumn::drawHeader() {
void cChannelEpg::drawHeader() {
header->setPosition(num);
}
bool cChannelColumn::readGrids() {
bool cChannelEpg::readGrids() {
#if VDRVERSNUM >= 20301
const cSchedules* schedules;
{
@@ -62,17 +51,17 @@ bool cChannelColumn::readGrids() {
const cSchedule *Schedule = NULL;
Schedule = schedules->GetSchedule(channel);
if (!Schedule) {
addDummyGrid(myTime->GetStart(), myTime->GetEnd(), NULL, false);
addDummyGrid(timeManager->GetStart(), timeManager->GetEnd(), NULL, false);
return true;
}
bool eventFound = false;
bool dummyAtStart = false;
const cEvent *startEvent = Schedule->GetEventAround(myTime->GetStart());
const cEvent *startEvent = Schedule->GetEventAround(timeManager->GetStart());
if (startEvent != NULL) {
eventFound = true;
} else {
for (int i=1; i<6; i++) {
startEvent = Schedule->GetEventAround(myTime->GetStart()+i*5*60);
startEvent = Schedule->GetEventAround(timeManager->GetStart()+i*5*60);
if (startEvent) {
eventFound = true;
dummyAtStart = true;
@@ -83,20 +72,20 @@ bool cChannelColumn::readGrids() {
if (eventFound) {
bool col = true;
if (dummyAtStart) {
addDummyGrid(myTime->GetStart(), startEvent->StartTime(), NULL, col);
addDummyGrid(timeManager->GetStart(), startEvent->StartTime(), NULL, col);
col = !col;
}
bool dummyNeeded = true;
bool toFarInFuture = false;
time_t endLast = myTime->GetStart();
time_t endLast = timeManager->GetStart();
const cEvent *event = startEvent;
const cEvent *eventLast = NULL;
for (; event; event = Schedule->Events()->Next(event)) {
if (endLast < event->StartTime()) {
//gap, dummy needed
time_t endTime = event->StartTime();
if (endTime > myTime->GetEnd()) {
endTime = myTime->GetEnd();
if (endTime > timeManager->GetEnd()) {
endTime = timeManager->GetEnd();
toFarInFuture = true;
}
addDummyGrid(endLast, endTime, NULL, col);
@@ -108,74 +97,76 @@ bool cChannelColumn::readGrids() {
addEpgGrid(event, NULL, col);
col = !col;
endLast = event->EndTime();
if (event->EndTime() > myTime->GetEnd()) {
if (event->EndTime() > timeManager->GetEnd()) {
dummyNeeded = false;
break;
}
eventLast = event;
}
if (dummyNeeded) {
addDummyGrid(eventLast->EndTime(), myTime->GetEnd(), NULL, col);
addDummyGrid(eventLast->EndTime(), timeManager->GetEnd(), NULL, col);
}
return true;
} else {
addDummyGrid(myTime->GetStart(), myTime->GetEnd(), NULL, false);
addDummyGrid(timeManager->GetStart(), timeManager->GetEnd(), NULL, false);
return true;
}
return false;
}
void cChannelColumn::drawGrids() {
for (cGrid *grid = grids.First(); grid; grid = grids.Next(grid)) {
void cChannelEpg::drawGrids() {
for (cGridElement *grid = grids.First(); grid; grid = grids.Next(grid)) {
grid->SetViewportHeight();
grid->PositionPixmap();
grid->Draw();
}
}
int cChannelColumn::getX() {
int cChannelEpg::getX() {
return geoManager.timeLineWidth + num*geoManager.colWidth;
}
int cChannelColumn::getY() {
int cChannelEpg::getY() {
return geoManager.statusHeaderHeight + geoManager.timeLineHeight + num*geoManager.rowHeight;
}
cGrid * cChannelColumn::getActive() {
cMyTime t;
cGridElement *cChannelEpg::getActive(bool last) {
cTimeManager t;
t.Now();
for (cGrid *grid = grids.First(); grid; grid = grids.Next(grid)) {
if (last)
return grids.Last();
for (cGridElement *grid = grids.First(); grid; grid = grids.Next(grid)) {
if (grid->Match(t.Get()))
return grid;
}
return grids.First();
}
cGrid * cChannelColumn::getNext(cGrid *activeGrid) {
cGridElement *cChannelEpg::getNext(cGridElement *activeGrid) {
if (activeGrid == NULL)
return NULL;
cGrid *next = grids.Next(activeGrid);
cGridElement *next = grids.Next(activeGrid);
if (next)
return next;
return NULL;
}
cGrid * cChannelColumn::getPrev(cGrid *activeGrid) {
cGridElement *cChannelEpg::getPrev(cGridElement *activeGrid) {
if (activeGrid == NULL)
return NULL;
cGrid *prev = grids.Prev(activeGrid);
cGridElement *prev = grids.Prev(activeGrid);
if (prev)
return prev;
return NULL;
}
cGrid * cChannelColumn::getNeighbor(cGrid *activeGrid) {
cGridElement *cChannelEpg::getNeighbor(cGridElement *activeGrid) {
if (!activeGrid)
return NULL;
cGrid *neighbor = NULL;
cGridElement *neighbor = NULL;
int overlap = 0;
int overlapNew = 0;
cGrid *grid = NULL;
cGridElement *grid = NULL;
grid = grids.First();
if (grid) {
for (; grid; grid = grids.Next(grid)) {
@@ -195,19 +186,19 @@ cGrid * cChannelColumn::getNeighbor(cGrid *activeGrid) {
return neighbor;
}
bool cChannelColumn::isFirst(cGrid *grid) {
bool cChannelEpg::isFirst(cGridElement *grid) {
if (grid == grids.First())
return true;
return false;
}
void cChannelColumn::AddNewGridsAtStart() {
cGrid *firstGrid = NULL;
void cChannelEpg::AddNewGridsAtStart() {
cGridElement *firstGrid = NULL;
firstGrid = grids.First();
if (firstGrid == NULL)
return;
//if first event is long enough, nothing to do.
if (firstGrid->StartTime() <= myTime->GetStart()) {
if (firstGrid->StartTime() <= timeManager->GetStart()) {
return;
}
//if not, i have to add new ones to the list
@@ -224,8 +215,8 @@ void cChannelColumn::AddNewGridsAtStart() {
Schedule = schedules->GetSchedule(channel);
if (!Schedule) {
if (firstGrid->isDummy()) {
firstGrid->SetStartTime(myTime->GetStart());
firstGrid->SetEndTime(myTime->GetEnd());
firstGrid->SetStartTime(timeManager->GetStart());
firstGrid->SetEndTime(timeManager->GetEnd());
}
return;
}
@@ -234,13 +225,13 @@ void cChannelColumn::AddNewGridsAtStart() {
for (const cEvent *event = Schedule->GetEventAround(firstGrid->StartTime()-60); event; event = Schedule->Events()->Prev(event)) {
if (!event)
break;
if (event->EndTime() < myTime->GetStart()) {
if (event->EndTime() < timeManager->GetStart()) {
break;
}
cGrid *grid = addEpgGrid(event, firstGrid, col);
cGridElement *grid = addEpgGrid(event, firstGrid, col);
col = !col;
firstGrid = grid;
if (event->StartTime() <= myTime->GetStart()) {
if (event->StartTime() <= timeManager->GetStart()) {
dummyNeeded = false;
break;
}
@@ -248,22 +239,22 @@ void cChannelColumn::AddNewGridsAtStart() {
if (dummyNeeded) {
firstGrid = grids.First();
if (firstGrid->isDummy()) {
firstGrid->SetStartTime(myTime->GetStart());
if (firstGrid->EndTime() >= myTime->GetEnd())
firstGrid->SetEndTime(myTime->GetEnd());
firstGrid->SetStartTime(timeManager->GetStart());
if (firstGrid->EndTime() >= timeManager->GetEnd())
firstGrid->SetEndTime(timeManager->GetEnd());
} else {
addDummyGrid(myTime->GetStart(), firstGrid->StartTime(), firstGrid, col);
addDummyGrid(timeManager->GetStart(), firstGrid->StartTime(), firstGrid, col);
}
}
}
void cChannelColumn::AddNewGridsAtEnd() {
cGrid *lastGrid = NULL;
void cChannelEpg::AddNewGridsAtEnd() {
cGridElement *lastGrid = NULL;
lastGrid = grids.Last();
if (lastGrid == NULL)
return;
//if last event is long enough, nothing to do.
if (lastGrid->EndTime() >= myTime->GetEnd()) {
if (lastGrid->EndTime() >= timeManager->GetEnd()) {
return;
}
//if not, i have to add new ones to the list
@@ -280,8 +271,8 @@ void cChannelColumn::AddNewGridsAtEnd() {
Schedule = schedules->GetSchedule(channel);
if (!Schedule) {
if (lastGrid->isDummy()) {
lastGrid->SetStartTime(myTime->GetStart());
lastGrid->SetEndTime(myTime->GetEnd());
lastGrid->SetStartTime(timeManager->GetStart());
lastGrid->SetEndTime(timeManager->GetEnd());
}
return;
}
@@ -290,12 +281,12 @@ void cChannelColumn::AddNewGridsAtEnd() {
for (const cEvent *event = Schedule->GetEventAround(lastGrid->EndTime()+60); event; event = Schedule->Events()->Next(event)) {
if (!event)
break;
if (event->StartTime() > myTime->GetEnd()) {
if (event->StartTime() > timeManager->GetEnd()) {
break;
}
addEpgGrid(event, NULL, col);
col = !col;
if (event->EndTime() > myTime->GetEnd()) {
if (event->EndTime() > timeManager->GetEnd()) {
dummyNeeded = false;
break;
}
@@ -303,32 +294,32 @@ void cChannelColumn::AddNewGridsAtEnd() {
if (dummyNeeded) {
lastGrid = grids.Last();
if (lastGrid->isDummy()) {
lastGrid->SetEndTime(myTime->GetEnd());
if (lastGrid->StartTime() <= myTime->GetStart())
lastGrid->SetStartTime(myTime->GetStart());
lastGrid->SetEndTime(timeManager->GetEnd());
if (lastGrid->StartTime() <= timeManager->GetStart())
lastGrid->SetStartTime(timeManager->GetStart());
} else {
addDummyGrid(lastGrid->EndTime(), myTime->GetEnd(), NULL, col);
addDummyGrid(lastGrid->EndTime(), timeManager->GetEnd(), NULL, col);
}
}
}
void cChannelColumn::ClearOutdatedStart() {
cGrid *firstGrid = NULL;
void cChannelEpg::ClearOutdatedStart() {
cGridElement *firstGrid = NULL;
while (true) {
firstGrid = grids.First();
if (!firstGrid)
break;
if (firstGrid->EndTime() <= myTime->GetStart()) {
if (firstGrid->EndTime() <= timeManager->GetStart()) {
grids.Del(firstGrid);
firstGrid = NULL;
} else {
if (firstGrid->isDummy()) {
firstGrid->SetStartTime(myTime->GetStart());
cGrid *next = getNext(firstGrid);
firstGrid->SetStartTime(timeManager->GetStart());
cGridElement *next = getNext(firstGrid);
if (next) {
firstGrid->SetEndTime(next->StartTime());
} else {
firstGrid->SetEndTime(myTime->GetEnd());
firstGrid->SetEndTime(timeManager->GetEnd());
}
}
break;
@@ -336,23 +327,23 @@ void cChannelColumn::ClearOutdatedStart() {
}
}
void cChannelColumn::ClearOutdatedEnd() {
cGrid *lastGrid = NULL;
void cChannelEpg::ClearOutdatedEnd() {
cGridElement *lastGrid = NULL;
while (true) {
lastGrid = grids.Last();
if (!lastGrid)
break;
if (lastGrid->StartTime() >= myTime->GetEnd()) {
if (lastGrid->StartTime() >= timeManager->GetEnd()) {
grids.Del(lastGrid);
lastGrid = NULL;
} else {
if (lastGrid->isDummy()) {
lastGrid->SetEndTime(myTime->GetEnd());
cGrid *prev = getPrev(lastGrid);
lastGrid->SetEndTime(timeManager->GetEnd());
cGridElement *prev = getPrev(lastGrid);
if (prev) {
lastGrid->SetStartTime(prev->EndTime());
} else {
lastGrid->SetStartTime(myTime->GetStart());
lastGrid->SetStartTime(timeManager->GetStart());
}
}
break;
@@ -360,8 +351,8 @@ void cChannelColumn::ClearOutdatedEnd() {
}
}
cGrid *cChannelColumn::addEpgGrid(const cEvent *event, cGrid *firstGrid, bool color) {
cGrid *grid = new cEpgGrid(this, event);
cGridElement *cChannelEpg::addEpgGrid(const cEvent *event, cGridElement *firstGrid, bool color) {
cGridElement *grid = new cEpgGrid(this, event);
grid->setText();
grid->SetColor(color);
if (!firstGrid)
@@ -371,8 +362,8 @@ cGrid *cChannelColumn::addEpgGrid(const cEvent *event, cGrid *firstGrid, bool co
return grid;
}
cGrid *cChannelColumn::addDummyGrid(time_t start, time_t end, cGrid *firstGrid, bool color) {
cGrid *dummy = new cDummyGrid(this, start, end);
cGridElement *cChannelEpg::addDummyGrid(time_t start, time_t end, cGridElement *firstGrid, bool color) {
cGridElement *dummy = new cDummyGrid(this, start, end);
dummy->setText();
dummy->SetColor(color);
if (!firstGrid)
@@ -382,26 +373,15 @@ cGrid *cChannelColumn::addDummyGrid(time_t start, time_t end, cGrid *firstGrid,
return dummy;
}
void cChannelColumn::SetTimers() {
#if VDRVERSNUM >= 20301
hasTimer = false;
const cSchedule *Schedule = NULL;
{
LOCK_SCHEDULES_READ;
const cSchedules* schedules = Schedules;
if (schedules) {
Schedule = schedules->GetSchedule(channel);
hasTimer = Schedule ? Schedule->HasTimer() : false;
}
}
#else
void cChannelEpg::SetTimers() {
#if VDRVERSNUM < 20301
hasTimer = channel->HasTimer();
#endif
hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel);
for (cGrid *grid = grids.First(); grid; grid = grids.Next(grid)) {
for (cGridElement *grid = grids.First(); grid; grid = grids.Next(grid)) {
bool gridHadTimer = grid->HasTimer();
grid->SetTimer();
if (gridHadTimer != grid->HasTimer())
if (gridHadTimer || gridHadTimer != grid->HasTimer())
grid->SetDirty();
bool gridHadSwitchTimer = grid->HasSwitchTimer();
grid->SetSwitchTimer();
@@ -411,11 +391,11 @@ void cChannelColumn::SetTimers() {
}
}
void cChannelColumn::dumpGrids() {
void cChannelEpg::dumpGrids() {
esyslog("tvguide: ------Channel %s %d: %d entires ---------", channel->Name(), num, grids.Count());
int i=1;
for (cGrid *grid = grids.First(); grid; grid = grids.Next(grid)) {
esyslog("tvguide: grid %d: start: %s, stop: %s", i, *cMyTime::printTime(grid->StartTime()), *cMyTime::printTime(grid->EndTime()));
for (cGridElement *grid = grids.First(); grid; grid = grids.Next(grid)) {
esyslog("tvguide: grid %d: start: %s, stop: %s", i, *cTimeManager::printTime(grid->StartTime()), *cTimeManager::printTime(grid->EndTime()));
i++;
}
}

View File

@@ -1,25 +1,25 @@
#ifndef __TVGUIDE_CHANNELCOLUMN_H
#define __TVGUIDE_CHANNELCOLUMN_H
#ifndef __TVGUIDE_CHANNELEPG_H
#define __TVGUIDE_CHANNELEPG_H
#include <vdr/tools.h>
#include "grid.h"
#include "gridelement.h"
#include "epggrid.h"
#include "headergrid.h"
#include "switchtimer.h"
class cGrid;
class cGridElement;
class cEpgGrid;
class cHeaderGrid;
// --- cChannelColumn -------------------------------------------------------------
// --- cChannelEpg -------------------------------------------------------------
class cChannelColumn : public cListObject, public cStyledPixmap {
class cChannelEpg : public cListObject, public cStyledPixmap {
private:
cMyTime *myTime;
cTimeManager *timeManager;
int num;
const cChannel *channel;
cHeaderGrid *header;
cList<cGrid> grids;
cList<cGridElement> grids;
#if VDRVERSNUM >= 20301
#else
cSchedulesLock *schedulesLock;
@@ -27,26 +27,26 @@ private:
const cSchedules *schedules;
bool hasTimer;
bool hasSwitchTimer;
cGrid *addEpgGrid(const cEvent *event, cGrid *firstGrid, bool color);
cGrid *addDummyGrid(time_t start, time_t end, cGrid *firstGrid, bool color);
cGridElement *addEpgGrid(const cEvent *event, cGridElement *firstGrid, bool color);
cGridElement *addDummyGrid(time_t start, time_t end, cGridElement *firstGrid, bool color);
public:
cChannelColumn(int num, const cChannel *channel, cMyTime *myTime);
virtual ~cChannelColumn(void);
cChannelEpg(int num, const cChannel *channel, cTimeManager *timeManager);
virtual ~cChannelEpg(void);
void createHeader();
void drawHeader();
bool readGrids();
void drawGrids();
int getX();
int getY();
int Start() { return myTime->GetStart(); };
int Stop() { return myTime->GetEnd(); };
int Start() { return timeManager->GetStart(); };
int Stop() { return timeManager->GetEnd(); };
const char* Name() { return channel->Name(); };
const cChannel * getChannel() {return channel;}
cGrid * getActive();
cGrid * getNext(cGrid *activeGrid);
cGrid * getPrev(cGrid *activeGrid);
cGrid * getNeighbor(cGrid *activeGrid);
bool isFirst(cGrid *grid);
const cChannel *getChannel() {return channel;}
cGridElement *getActive(bool last = false);
cGridElement *getNext(cGridElement *activeGrid);
cGridElement *getPrev(cGridElement *activeGrid);
cGridElement *getNeighbor(cGridElement *activeGrid);
bool isFirst(cGridElement *grid);
void AddNewGridsAtStart();
void AddNewGridsAtEnd();
void ClearOutdatedStart();
@@ -66,4 +66,4 @@ public:
void dumpGrids();
};
#endif //__TVGUIDE_CHANNELCOLUMN_H
#endif //__TVGUIDE_CHANNELEPG_H

View File

@@ -1,98 +1,98 @@
#include <algorithm>
#include "channelgroup.h"
#include "tools.h"
cChannelGroup::cChannelGroup(const char *name) {
channelStart = 0;
channelStop = 0;
this->name = name;
}
cChannelGroup::~cChannelGroup(void) {
}
void cChannelGroup::Dump(void) {
esyslog("tvguide: Group %s, startChannel %d, stopChannel %d", name, channelStart, channelStop);
}
// --- cChannelGroupGrid -------------------------------------------------------------
cChannelGroupGrid::cChannelGroupGrid(const char *name) {
this->name = name;
}
cChannelGroupGrid::~cChannelGroupGrid(void) {
}
void cChannelGroupGrid::SetBackground() {
if (isColor1) {
color = theme.Color(clrGrid1);
colorBlending = theme.Color(clrGrid1Blending);
} else {
color = theme.Color(clrGrid2);
colorBlending = theme.Color(clrGrid2Blending);
}
}
void cChannelGroupGrid::SetGeometry(int start, int end) {
int x, y, width, height;
if (tvguideConfig.displayMode == eVertical) {
x = geoManager.timeLineWidth + start*geoManager.colWidth;
y = geoManager.statusHeaderHeight;
width = (end - start + 1) * geoManager.colWidth;
height = geoManager.channelGroupsHeight;
} else if (tvguideConfig.displayMode == eHorizontal) {
x = 0;
y = geoManager.statusHeaderHeight + geoManager.timeLineHeight + start*geoManager.rowHeight;
width = geoManager.channelGroupsWidth;
height = (end - start + 1) * geoManager.rowHeight;
}
pixmap = osdManager.requestPixmap(1, cRect(x, y, width, height));
}
void cChannelGroupGrid::Draw(void) {
if (tvguideConfig.style == eStyleGraphical) {
drawBackgroundGraphical(bgChannelGroup);
} else {
drawBackground();
drawBorder();
}
tColor colorText = theme.Color(clrFont);
tColor colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent;
if (tvguideConfig.displayMode == eVertical) {
DrawVertical(colorText, colorTextBack);
} else if (tvguideConfig.displayMode == eHorizontal) {
DrawHorizontal(colorText, colorTextBack);
}
}
void cChannelGroupGrid::DrawVertical(tColor colorText, tColor colorTextBack) {
int textY = (Height() - fontManager.FontChannelGroups->Height()) / 2;
cString text = 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();
int charHeight = fontManager.FontChannelGroupsHorizontal->Height();
int textHeight = numChars * charHeight;
int y = 5;
if ((textHeight +5) < Height()) {
y = (Height() - textHeight) / 2;
}
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));
int x = (Width() - fontManager.FontChannelGroupsHorizontal->Width(*currentChar)) / 2;
pixmap->DrawText(cPoint(x, y), *currentChar, colorText, colorTextBack, fontManager.FontChannelGroupsHorizontal);
y += fontManager.FontChannelGroupsHorizontal->Height();
}
}
#include <algorithm>
#include "channelgroup.h"
#include "tools.h"
cChannelGroup::cChannelGroup(const char *name) {
channelStart = 0;
channelStop = 0;
this->name = name;
}
cChannelGroup::~cChannelGroup(void) {
}
void cChannelGroup::Dump(void) {
esyslog("tvguide: Group %s, startChannel %d, stopChannel %d", name, channelStart, channelStop);
}
// --- cChannelGroupGrid -------------------------------------------------------------
cChannelGroupGrid::cChannelGroupGrid(const char *name) {
this->name = name;
}
cChannelGroupGrid::~cChannelGroupGrid(void) {
}
void cChannelGroupGrid::SetBackground() {
if (isColor1) {
color = theme.Color(clrGrid1);
colorBlending = theme.Color(clrGrid1Blending);
} else {
color = theme.Color(clrGrid2);
colorBlending = theme.Color(clrGrid2Blending);
}
}
void cChannelGroupGrid::SetGeometry(int start, int end) {
int x, y, width, height;
if (config.displayMode == eVertical) {
x = geoManager.timeLineWidth + start*geoManager.colWidth;
y = geoManager.statusHeaderHeight;
width = (end - start + 1) * geoManager.colWidth;
height = geoManager.channelGroupsHeight;
} else if (config.displayMode == eHorizontal) {
x = 0;
y = geoManager.statusHeaderHeight + geoManager.timeLineHeight + start*geoManager.rowHeight;
width = geoManager.channelGroupsWidth;
height = (end - start + 1) * geoManager.rowHeight;
}
pixmap = osdManager.requestPixmap(1, cRect(x, y, width, height));
}
void cChannelGroupGrid::Draw(void) {
if (config.style == eStyleGraphical) {
drawBackgroundGraphical(bgChannelGroup);
} else {
drawBackground();
drawBorder();
}
tColor colorText = theme.Color(clrFont);
tColor colorTextBack = (config.style == eStyleFlat)?color:clrTransparent;
if (config.displayMode == eVertical) {
DrawVertical(colorText, colorTextBack);
} else if (config.displayMode == eHorizontal) {
DrawHorizontal(colorText, colorTextBack);
}
}
void cChannelGroupGrid::DrawVertical(tColor colorText, tColor colorTextBack) {
int textY = (Height() - fontManager.FontChannelGroups->Height()) / 2;
cString text = 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();
int charHeight = fontManager.FontChannelGroupsHorizontal->Height();
int textHeight = numChars * charHeight;
int y = 5;
if ((textHeight +5) < Height()) {
y = (Height() - textHeight) / 2;
}
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));
int x = (Width() - fontManager.FontChannelGroupsHorizontal->Width(*currentChar)) / 2;
pixmap->DrawText(cPoint(x, y), *currentChar, colorText, colorTextBack, fontManager.FontChannelGroupsHorizontal);
y += fontManager.FontChannelGroupsHorizontal->Height();
}
}

View File

@@ -1,44 +1,44 @@
#ifndef __TVGUIDE_CHANNELGROUP_H
#define __TVGUIDE_CHANNELGROUP_H
#include <vdr/tools.h>
#include "styledpixmap.h"
// --- cChannelGroup -------------------------------------------------------------
class cChannelGroup {
private:
int channelStart;
int channelStop;
const char *name;
public:
cChannelGroup(const char *name);
virtual ~cChannelGroup(void);
void SetChannelStart(int start) { channelStart = start; };
int StartChannel(void) { return channelStart; };
void SetChannelStop(int stop) { channelStop = stop; };
int StopChannel(void) { return channelStop; };
const char* GetName(void) { return name; };
void Dump(void);
};
// --- cChannelGroupGrid -------------------------------------------------------------
class cChannelGroupGrid : public cListObject, public cStyledPixmap {
private:
const char *name;
bool isColor1;
void DrawHorizontal(tColor colorText, tColor colorTextBack);
void DrawVertical(tColor colorText, tColor colorTextBack);
public:
cChannelGroupGrid(const char *name);
virtual ~cChannelGroupGrid(void);
void SetColor(bool color) {isColor1 = color;};
void SetBackground(void);
void SetGeometry(int start, int end);
void Draw(void);
};
#endif //__TVGUIDE_CHANNELGROUP_H
#ifndef __TVGUIDE_CHANNELGROUP_H
#define __TVGUIDE_CHANNELGROUP_H
#include <vdr/tools.h>
#include "styledpixmap.h"
// --- cChannelGroup -------------------------------------------------------------
class cChannelGroup {
private:
int channelStart;
int channelStop;
const char *name;
public:
cChannelGroup(const char *name);
virtual ~cChannelGroup(void);
void SetChannelStart(int start) { channelStart = start; };
int StartChannel(void) { return channelStart; };
void SetChannelStop(int stop) { channelStop = stop; };
int StopChannel(void) { return channelStop; };
const char* GetName(void) { return name; };
void Dump(void);
};
// --- cChannelGroupGrid -------------------------------------------------------------
class cChannelGroupGrid : public cListObject, public cStyledPixmap {
private:
const char *name;
bool isColor1;
void DrawHorizontal(tColor colorText, tColor colorTextBack);
void DrawVertical(tColor colorText, tColor colorTextBack);
public:
cChannelGroupGrid(const char *name);
virtual ~cChannelGroupGrid(void);
void SetColor(bool color) {isColor1 = color;};
void SetBackground(void);
void SetGeometry(int start, int end);
void Draw(void);
};
#endif //__TVGUIDE_CHANNELGROUP_H

View File

@@ -1,4 +1,5 @@
#include <vector>
#include "config.h"
#include "channelgroups.h"
cChannelGroups::cChannelGroups(void) {
@@ -12,26 +13,23 @@ void cChannelGroups::ReadChannelGroups(void) {
int lastChannelNumber = 0;
#if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ;
const cChannel *first = Channels->First();
const cChannels *channels = Channels;
#else
const cChannel *first = Channels.First();
const cChannels *channels = &Channels;
#endif
const cChannel *first = channels->First();
if (!first->GroupSep()) {
channelGroups.push_back(cChannelGroup(tr("Main Program")));
setStart = true;
}
#if VDRVERSNUM >= 20301
for (const cChannel *channel = Channels->First(); channel; channel = Channels->Next(channel)) {
#else
for (const cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) {
#endif
for (const cChannel *channel = channels->First(); channel; channel = channels->Next(channel)) {
if (setStart && (channelGroups.size() > 0)) {
channelGroups[channelGroups.size()-1].SetChannelStart(channel->Number());
channelGroups[channelGroups.size() - 1].SetChannelStart(channel->Number());
setStart = false;
}
if (channel->GroupSep()) {
if (channelGroups.size() > 0) {
channelGroups[channelGroups.size()-1].SetChannelStop(lastChannelNumber);
channelGroups[channelGroups.size() - 1].SetChannelStop(lastChannelNumber);
}
channelGroups.push_back(cChannelGroup(channel->Name()));
setStart = true;
@@ -40,8 +38,8 @@ void cChannelGroups::ReadChannelGroups(void) {
}
}
if (channelGroups.size() > 0) {
channelGroups[channelGroups.size()-1].SetChannelStop(lastChannelNumber);
if ((tvguideConfig.hideLastGroup)&&(channelGroups.size() > 1)) {
channelGroups[channelGroups.size() - 1].SetChannelStop(lastChannelNumber);
if ((config.hideLastGroup) && (channelGroups.size() > 1)) {
channelGroups.pop_back();
}
}
@@ -96,7 +94,7 @@ int cChannelGroups::GetNextGroupChannelNumber(const cChannel *channel) {
}
bool cChannelGroups::IsInLastGroup(const cChannel *channel) {
if (!tvguideConfig.hideLastGroup)
if (!config.hideLastGroup)
return false;
if (channelGroups.size() > 0) {
if (channel->Number() > channelGroups[channelGroups.size()-1].StopChannel()) {
@@ -145,9 +143,15 @@ void cChannelGroups::CreateGroupGrid(const char *name, int number, int start, in
}
int cChannelGroups::GetLastValidChannel(void) {
if (channelGroups.size() > 0)
return channelGroups[channelGroups.size()-1].StopChannel();
return 0;
if (config.hideLastGroup && channelGroups.size() > 0) {
return channelGroups[channelGroups.size() - 1].StopChannel();
}
#if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ;
return Channels->MaxNumber();
#else
return Channels.MaxNumber();
#endif
}
void cChannelGroups::DumpGroups(void) {

View File

@@ -3,6 +3,7 @@
#include <vector>
#include <vdr/channels.h>
#include "config.h"
#include "channelgroup.h"
// --- cChannelGroups -------------------------------------------------------------

View File

@@ -1,95 +1,86 @@
#include <vdr/channels.h>
#include "config.h"
#include "geometrymanager.h"
#include "osdmanager.h"
#include "fontmanager.h"
#include "channelgroups.h"
#include "channeljump.h"
cChannelJump::cChannelJump(cChannelGroups *channelGroups) {
this->channelGroups = channelGroups;
pixmapText = NULL;
channel = 0;
if (!tvguideConfig.hideLastGroup) {
#if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ;
maxChannels = Channels->MaxNumber();
#else
maxChannels = Channels.MaxNumber();
#endif
} else {
maxChannels = channelGroups->GetLastValidChannel();
}
timeout = Setup.ChannelEntryTimeout;
startTime = cTimeMs::Now();
SetPixmaps();
Draw();
}
cChannelJump::~cChannelJump(void) {
osdManager.releasePixmap(pixmapBack);
osdManager.releasePixmap(pixmapText);
}
void cChannelJump::SetPixmaps(void) {
int x = (geoManager.osdWidth - geoManager.channelJumpWidth)/2;
int y = (geoManager.osdHeight - geoManager.channelJumpHeight)/2;
pixmapBack = osdManager.requestPixmap(4, cRect(x, y, geoManager.channelJumpWidth, geoManager.channelJumpHeight));
pixmap = osdManager.requestPixmap(5, cRect(x, y, geoManager.channelJumpWidth, geoManager.channelJumpHeight));
pixmapText = osdManager.requestPixmap(6, cRect(x, y, geoManager.channelJumpWidth, geoManager.channelJumpHeight));
}
void cChannelJump::Draw(void) {
if (tvguideConfig.style == eStyleGraphical) {
drawBackgroundGraphical(bgChannelJump);
} else {
pixmap->Fill(theme.Color(clrBackground));
drawBorder();
}
pixmapBack->Fill(clrTransparent);
pixmapBack->DrawRectangle(cRect(5, Height()/2, Width()-10, Height()-3), theme.Color(clrBackground));
}
void cChannelJump::DrawText(void) {
pixmapText->Fill(clrTransparent);
cString header = cString::sprintf("%s:", tr("Channel"));
const cFont *font = fontManager.FontMessageBox;
const cFont *fontHeader = fontManager.FontMessageBoxLarge;
int xHeader = (Width() - fontHeader->Width(*header)) / 2;
int yHeader = (Height()/2 - fontHeader->Height()) / 2;
pixmapText->DrawText(cPoint(xHeader, yHeader), *header, theme.Color(clrFont), clrTransparent, fontHeader);
cString strChannel = BuildChannelString();
int xChannel = (Width() - font->Width(*strChannel)) / 2;
int yChannel = Height()/2 + (Height()/2 - font->Height()) / 2;
pixmapText->DrawText(cPoint(xChannel, yChannel), *strChannel, theme.Color(clrFont), clrTransparent, font);
}
void cChannelJump::Set(int num) {
startTime = cTimeMs::Now();
if (channel == 0) {
channel = num;
return;
}
int newChannel = channel * 10 + num;
if (newChannel <= maxChannels)
channel = newChannel;
}
cString cChannelJump::BuildChannelString(void) {
if (channel*10 <= maxChannels)
return cString::sprintf("%d-", channel);
else
return cString::sprintf("%d", channel);
}
bool cChannelJump::TimeOut(void) {
if ((cTimeMs::Now() - startTime) > timeout)
return true;
return false;
}
#include <vdr/channels.h>
#include "config.h"
#include "geometrymanager.h"
#include "osdmanager.h"
#include "fontmanager.h"
#include "channelgroups.h"
#include "channeljump.h"
cChannelJump::cChannelJump(cChannelGroups *channelGroups, int lastValidChannel) {
this->channelGroups = channelGroups;
pixmapText = NULL;
channel = 0;
maxChannels = lastValidChannel;
timeout = Setup.ChannelEntryTimeout;
startTime = 0;
SetPixmaps();
Draw();
}
cChannelJump::~cChannelJump(void) {
osdManager.releasePixmap(pixmapBack);
osdManager.releasePixmap(pixmapText);
}
void cChannelJump::SetPixmaps(void) {
int x = (geoManager.osdWidth - geoManager.channelJumpWidth)/2;
int y = (geoManager.osdHeight - geoManager.channelJumpHeight)/2;
pixmapBack = osdManager.requestPixmap(4, cRect(x, y, geoManager.channelJumpWidth, geoManager.channelJumpHeight));
pixmap = osdManager.requestPixmap(5, cRect(x, y, geoManager.channelJumpWidth, geoManager.channelJumpHeight));
pixmapText = osdManager.requestPixmap(6, cRect(x, y, geoManager.channelJumpWidth, geoManager.channelJumpHeight));
}
void cChannelJump::Draw(void) {
if (config.style == eStyleGraphical) {
drawBackgroundGraphical(bgChannelJump);
} else {
pixmap->Fill(theme.Color(clrBackground));
drawBorder();
}
pixmapBack->Fill(clrTransparent);
pixmapBack->DrawRectangle(cRect(5, Height()/2, Width()-10, Height()-3), theme.Color(clrBackground));
}
void cChannelJump::DrawText(void) {
pixmapText->Fill(clrTransparent);
cString header = cString::sprintf("%s:", tr("Channel"));
const cFont *font = fontManager.FontMessageBox;
const cFont *fontHeader = fontManager.FontMessageBoxLarge;
int xHeader = (Width() - fontHeader->Width(*header)) / 2;
int yHeader = (Height()/2 - fontHeader->Height()) / 2;
pixmapText->DrawText(cPoint(xHeader, yHeader), *header, theme.Color(clrFont), clrTransparent, fontHeader);
cString strChannel = BuildChannelString();
int xChannel = (Width() - font->Width(*strChannel)) / 2;
int yChannel = Height()/2 + (Height()/2 - font->Height()) / 2;
pixmapText->DrawText(cPoint(xChannel, yChannel), *strChannel, theme.Color(clrFont), clrTransparent, font);
}
void cChannelJump::Set(int num) {
startTime = cTimeMs::Now();
if (channel == 0) {
channel = num;
return;
}
int newChannel = channel * 10 + num;
if (newChannel <= maxChannels)
channel = newChannel;
}
cString cChannelJump::BuildChannelString(void) {
if (channel*10 <= maxChannels)
return cString::sprintf("%d-", channel);
else
return cString::sprintf("%d", channel);
}
bool cChannelJump::TimeOut(void) {
if ((cTimeMs::Now() - startTime) > timeout)
return true;
return false;
}

View File

@@ -1,29 +1,29 @@
#ifndef __TVGUIDE_CHANNELJUMP_H
#define __TVGUIDE_CHANNELJUMP_H
#include "styledpixmap.h"
// --- cChannelJump -------------------------------------------------------------
class cChannelJump : public cStyledPixmap {
private:
int channel;
cChannelGroups *channelGroups;
int maxChannels;
long unsigned int startTime;
long unsigned int timeout;
cPixmap *pixmapBack;
cPixmap *pixmapText;
void SetPixmaps(void);
void Draw(void);
cString BuildChannelString(void);
public:
cChannelJump(cChannelGroups *channelGroups);
virtual ~cChannelJump(void);
void Set(int num);
void DrawText(void);
bool TimeOut(void);
int GetChannel(void) { return channel; };
};
#endif //__TVGUIDE_CHANNELJUMP_H
#ifndef __TVGUIDE_CHANNELJUMP_H
#define __TVGUIDE_CHANNELJUMP_H
#include "styledpixmap.h"
// --- cChannelJump -------------------------------------------------------------
class cChannelJump : public cStyledPixmap {
private:
int channel;
cChannelGroups *channelGroups;
int maxChannels;
long unsigned int startTime;
long unsigned int timeout;
cPixmap *pixmapBack;
cPixmap *pixmapText;
void SetPixmaps(void);
void Draw(void);
cString BuildChannelString(void);
public:
cChannelJump(cChannelGroups *channelGroups, int lastValidChannel);
virtual ~cChannelJump(void);
void Set(int num);
void DrawText(void);
bool TimeOut(void);
int GetChannel(void) { return channel; };
};
#endif //__TVGUIDE_CHANNELJUMP_H

683
config.c
View File

@@ -1,338 +1,345 @@
#include <string>
#include "config.h"
cTvguideConfig::cTvguideConfig() {
debugImageLoading = 0;
showMainMenuEntry = 1;
replaceOriginalSchedule = 0;
displayMode = eHorizontal;
showTimeInGrid = 1;
channelCols = 5;
channelRows = 10;
displayTime = 160;
displayStatusHeader = 1;
displayChannelGroups = 1;
displayTimeBase = 1;
headerHeightPercent = 20;
channelGroupsPercent = 5;
epgViewBorder = 50;
scaleVideo = 1;
decorateVideo = 1;
timeLineWidthPercent = 8;
timeLineHeightPercent = 4;
displayChannelName = 1;
channelHeaderWidthPercent = 20;
channelHeaderHeightPercent = 15;
footerHeightPercent = 7;
stepMinutes = 30;
bigStepHours = 3;
hugeStepHours = 24;
channelJumpMode = eNumJump;
jumpChannels = 0;
blueKeyMode = 2;
closeOnSwitch = 1;
numkeyMode = 0;
useRemoteTimers = 0;
hideLastGroup = 0;
hideChannelLogos = 0;
logoWidthRatio = 13;
logoHeightRatio = 10;
logoExtension = 0;
hideEpgImages = 0;
epgImageWidth = 315;
epgImageHeight = 240;
numAdditionalEPGPictures = 9;
epgImageWidthLarge = 525;
epgImageHeightLarge = 400;
detailedViewScrollStep = 5;
instRecFolderMode = eFolderRoot;
instRecFixedFolder = "";
favWhatsOnNow = 1;
favWhatsOnNext = 1;
favUseTime1 = 0;
favUseTime2 = 0;
favUseTime3 = 0;
favUseTime4 = 0;
favTime1 = 0;
favTime2 = 0;
favTime3 = 0;
favTime4 = 0;
descUser1 = "";
descUser2 = "";
descUser3 = "";
descUser4 = "";
favLimitChannels = 0;
favStartChannel = 0;
favStopChannel = 0;
switchMode = 0;
switchMinsBefore = 2;
fontIndex = 0;
fontNameDefault = "VDRSymbols Sans:Book";
FontButtonDelta = 0;
FontDetailViewDelta = 0;
FontDetailViewSmallDelta = 0;
FontDetailHeaderDelta = 0;
FontMessageBoxDelta = 0;
FontMessageBoxLargeDelta = 0;
FontStatusHeaderDelta = 0;
FontStatusHeaderLargeDelta = 0;
FontChannelHeaderDelta = 0;
FontChannelGroupsDelta = 0;
FontGridDelta = 0;
FontGridSmallDelta = 0;
FontTimeLineWeekdayDelta = 0;
FontTimeLineDateDelta = 0;
FontTimeLineTimeDelta = 0;
FontChannelHeaderHorizontalDelta = 0;
FontChannelGroupsHorizontalDelta = 0;
FontGridHorizontalDelta = 0;
FontGridHorizontalSmallDelta = 0;
FontTimeLineDateHorizontalDelta = 0;
FontTimeLineTimeHorizontalDelta = 0;
FontRecMenuItemDelta = 0;
FontRecMenuItemSmallDelta = 0;
FontRecMenuItemLargeDelta = 0;
timeFormat = 1;
useNopacityTheme = 1;
themeIndex = -1;
themeIndexCurrent = -1;
themeName = "";
nOpacityTheme = "";
style = eStyleBlendingDefault;
roundedCorners = 0;
displayRerunsDetailEPGView = 1;
numReruns = 5;
useSubtitleRerun = 1;
numLogosInitial = 30;
numLogosMax = 50;
limitLogoCache = 1;
logoPathSet = false;
imagesPathSet = false;
iconsPathSet = false;
}
cTvguideConfig::~cTvguideConfig() {
}
void cTvguideConfig::setDynamicValues() {
numGrids = (displayMode == eVertical)?channelCols:channelRows;
jumpChannels = numGrids;
}
bool cTvguideConfig::LoadTheme() {
//is correct theme already loaded?
if (nOpacityTheme.size() == 0)
nOpacityTheme = Setup.OSDTheme;
if ((themeIndex > -1) && (themeIndex == themeIndexCurrent)) {
if (!nOpacityTheme.compare(Setup.OSDTheme)) {
return false;
} else {
nOpacityTheme = Setup.OSDTheme;
}
}
//Load available Themes
cThemes themes;
themes.Load(*cString("tvguide"));
int numThemesAvailable = themes.NumThemes();
//Check for nOpacity Theme
if (useNopacityTheme) {
std::string nOpacity = "nOpacity";
std::string currentSkin = Setup.OSDSkin;
std::string currentSkinTheme = Setup.OSDTheme;
if (!currentSkin.compare(nOpacity)) {
for (int curThemeIndex = 0; curThemeIndex < numThemesAvailable; curThemeIndex++) {
std::string curThemeName = themes.Name(curThemeIndex);
if (!curThemeName.compare(currentSkinTheme)) {
themeIndex = curThemeIndex;
break;
}
}
}
}
if (themeIndex == -1) {
for (int curThemeIndex = 0; curThemeIndex < numThemesAvailable; curThemeIndex++) {
std::string curThemeName = themes.Name(curThemeIndex);
if (!curThemeName.compare("default")) {
themeIndex = curThemeIndex;
break;
}
}
}
if (themeIndex == -1)
themeIndex = 0;
themeIndexCurrent = themeIndex;
const char *themePath = themes.FileName(themeIndex);
if (access(themePath, F_OK) == 0) {
::theme.Load(themePath);
themeName = themes.Name(themeIndex);
}
esyslog("tvguide: set Theme to %s", *themeName);
return true;
}
void cTvguideConfig::SetStyle(void) {
if (theme.Color(clrStyle) == CLR_STYLE_FLAT) {
style = eStyleFlat;
esyslog("tvguide: set flat style");
} else if (theme.Color(clrStyle) == CLR_STYLE_BLENDING_DEFAULT) {
style = eStyleBlendingDefault;
esyslog("tvguide: set blending style");
} else if (theme.Color(clrStyle) == CLR_STYLE_GRAPHICAL) {
style = eStyleGraphical;
esyslog("tvguide: set graphical style");
} else {
style = eStyleBlendingMagick;
esyslog("tvguide: set magick blending style");
}
}
void cTvguideConfig::SetLogoPath(cString path) {
logoPath = checkSlashAtEnd(*path);
logoPathSet = true;
esyslog("tvguide: Logo Path set to %s", *logoPath);
}
void cTvguideConfig::SetImagesPath(cString path) {
epgImagePath = checkSlashAtEnd(*path);
imagesPathSet = true;
esyslog("tvguide: EPG Image Path set to %s", *epgImagePath);
}
void cTvguideConfig::SetIconsPath(cString path) {
iconPath = checkSlashAtEnd(*path);
iconsPathSet = true;
esyslog("tvguide: Icon Path set to %s", *iconPath);
}
void cTvguideConfig::SetDefaultPathes(void) {
logoPathDefault = cString::sprintf("%s/logos/", cPlugin::ResourceDirectory(PLUGIN_NAME_I18N));
iconPathDefault = cString::sprintf("%s/icons/", cPlugin::ResourceDirectory(PLUGIN_NAME_I18N));
epgImagePathDefault = cString::sprintf("%s/epgimages/", cPlugin::CacheDirectory(PLUGIN_NAME_I18N));
if (!logoPathSet) {
logoPath = logoPathDefault;
}
if (!imagesPathSet) {
epgImagePath = epgImagePathDefault;
}
if (!iconsPathSet) {
iconPath = iconPathDefault;
}
}
cString cTvguideConfig::checkSlashAtEnd(std::string path) {
try {
if (!(path.at(path.size()-1) == '/'))
return cString::sprintf("%s/", path.c_str());
} catch (...) {return path.c_str();}
return path.c_str();
}
bool cTvguideConfig::SetupParse(const char *Name, const char *Value) {
if (strcmp(Name, "timeFormat") == 0) timeFormat = atoi(Value);
else if (strcmp(Name, "debugImageLoading") == 0) debugImageLoading = atoi(Value);
else if (strcmp(Name, "showMainMenuEntry") == 0) showMainMenuEntry = atoi(Value);
else if (strcmp(Name, "replaceOriginalSchedule") == 0) replaceOriginalSchedule = atoi(Value);
else if (strcmp(Name, "useNopacityTheme") == 0) useNopacityTheme = atoi(Value);
else if (strcmp(Name, "themeIndex") == 0) themeIndex = atoi(Value);
else if (strcmp(Name, "displayMode") == 0) displayMode = atoi(Value);
else if (strcmp(Name, "showTimeInGrid") == 0) showTimeInGrid = atoi(Value);
else if (strcmp(Name, "displayStatusHeader") == 0) displayStatusHeader = atoi(Value);
else if (strcmp(Name, "displayChannelGroups") == 0) displayChannelGroups = atoi(Value);
else if (strcmp(Name, "displayTimeBase") == 0) displayTimeBase = atoi(Value);
else if (strcmp(Name, "headerHeightPercent") == 0) headerHeightPercent = atoi(Value);
else if (strcmp(Name, "channelGroupsPercent") == 0) channelGroupsPercent = atoi(Value);
else if (strcmp(Name, "epgViewBorder") == 0) epgViewBorder = atoi(Value);
else if (strcmp(Name, "scaleVideo") == 0) scaleVideo = atoi(Value);
else if (strcmp(Name, "decorateVideo") == 0) decorateVideo = atoi(Value);
else if (strcmp(Name, "roundedCorners") == 0) roundedCorners = atoi(Value);
else if (strcmp(Name, "channelCols") == 0) channelCols = atoi(Value);
else if (strcmp(Name, "channelRows") == 0) channelRows = atoi(Value);
else if (strcmp(Name, "displayTime") == 0) displayTime = atoi(Value);
else if (strcmp(Name, "hideChannelLogos") == 0) hideChannelLogos = atoi(Value);
else if (strcmp(Name, "logoExtension") == 0) logoExtension = atoi(Value);
else if (strcmp(Name, "logoWidthRatio") == 0) logoWidthRatio = atoi(Value);
else if (strcmp(Name, "logoHeightRatio") == 0) logoHeightRatio = atoi(Value);
else if (strcmp(Name, "bigStepHours") == 0) bigStepHours = atoi(Value);
else if (strcmp(Name, "hugeStepHours") == 0) hugeStepHours = atoi(Value);
else if (strcmp(Name, "channelJumpMode") == 0) channelJumpMode = atoi(Value);
else if (strcmp(Name, "blueKeyMode") == 0) blueKeyMode = atoi(Value);
else if (strcmp(Name, "numkeyMode") == 0) numkeyMode = atoi(Value);
else if (strcmp(Name, "closeOnSwitch") == 0) closeOnSwitch = atoi(Value);
else if (strcmp(Name, "useRemoteTimers") == 0) useRemoteTimers = atoi(Value);
else if (strcmp(Name, "hideLastGroup") == 0) hideLastGroup = atoi(Value);
else if (strcmp(Name, "hideEpgImages") == 0) hideEpgImages = atoi(Value);
else if (strcmp(Name, "epgImageWidth") == 0) epgImageWidth = atoi(Value);
else if (strcmp(Name, "epgImageHeight") == 0) epgImageHeight = atoi(Value);
else if (strcmp(Name, "numAdditionalEPGPictures") == 0) numAdditionalEPGPictures = atoi(Value);
else if (strcmp(Name, "epgImageWidthLarge") == 0) epgImageWidthLarge = atoi(Value);
else if (strcmp(Name, "epgImageHeightLarge") == 0) epgImageHeightLarge = atoi(Value);
else if (strcmp(Name, "detailedViewScrollStep") == 0) detailedViewScrollStep = atoi(Value);
else if (strcmp(Name, "timeLineWidthPercent") == 0) timeLineWidthPercent = atoi(Value);
else if (strcmp(Name, "timeLineHeightPercent") == 0) timeLineHeightPercent = atoi(Value);
else if (strcmp(Name, "displayChannelName") == 0) displayChannelName = atoi(Value);
else if (strcmp(Name, "channelHeaderWidthPercent") == 0) channelHeaderWidthPercent = atoi(Value);
else if (strcmp(Name, "channelHeaderHeightPercent") == 0) channelHeaderHeightPercent = atoi(Value);
else if (strcmp(Name, "footerHeightPercent") == 0) footerHeightPercent = atoi(Value);
else if (strcmp(Name, "instRecFolderMode") == 0) instRecFolderMode = atoi(Value);
else if (strcmp(Name, "instRecFixedFolder") == 0) instRecFixedFolder = 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);
else if (strcmp(Name, "favUseTime2") == 0) favUseTime2 = atoi(Value);
else if (strcmp(Name, "favUseTime3") == 0) favUseTime3 = atoi(Value);
else if (strcmp(Name, "favUseTime4") == 0) favUseTime4 = atoi(Value);
else if (strcmp(Name, "favTime1") == 0) favTime1 = atoi(Value);
else if (strcmp(Name, "favTime2") == 0) favTime2 = atoi(Value);
else if (strcmp(Name, "favTime3") == 0) favTime3 = atoi(Value);
else if (strcmp(Name, "favTime4") == 0) favTime4 = atoi(Value);
else if (strcmp(Name, "descUser1") == 0) descUser1 = Value;
else if (strcmp(Name, "descUser2") == 0) descUser2 = Value;
else if (strcmp(Name, "descUser3") == 0) descUser3 = Value;
else if (strcmp(Name, "descUser4") == 0) descUser4 = 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);
else if (strcmp(Name, "FontDetailViewDelta") == 0) FontDetailViewDelta = atoi(Value);
else if (strcmp(Name, "FontDetailHeaderDelta") == 0) FontDetailHeaderDelta = atoi(Value);
else if (strcmp(Name, "FontMessageBoxDelta") == 0) FontMessageBoxDelta = atoi(Value);
else if (strcmp(Name, "FontMessageBoxLargeDelta") == 0) FontMessageBoxLargeDelta = atoi(Value);
else if (strcmp(Name, "FontStatusHeaderDelta") == 0) FontStatusHeaderDelta = atoi(Value);
else if (strcmp(Name, "FontStatusHeaderLargeDelta") == 0) FontStatusHeaderLargeDelta = atoi(Value);
else if (strcmp(Name, "FontChannelHeaderDelta") == 0) FontChannelHeaderDelta = atoi(Value);
else if (strcmp(Name, "FontChannelGroupsDelta") == 0) FontChannelGroupsDelta = atoi(Value);
else if (strcmp(Name, "FontGridDelta") == 0) FontGridDelta = atoi(Value);
else if (strcmp(Name, "FontGridSmallDelta") == 0) FontGridSmallDelta = atoi(Value);
else if (strcmp(Name, "FontTimeLineWeekdayDelta") == 0) FontTimeLineWeekdayDelta = atoi(Value);
else if (strcmp(Name, "FontTimeLineDateDelta") == 0) FontTimeLineDateDelta = atoi(Value);
else if (strcmp(Name, "FontTimeLineTimeDelta") == 0) FontTimeLineTimeDelta = atoi(Value);
else if (strcmp(Name, "FontChannelHeaderHorizontalDelta") == 0) FontChannelHeaderHorizontalDelta = atoi(Value);
else if (strcmp(Name, "FontChannelGroupsHorizontalDelta") == 0) FontChannelGroupsHorizontalDelta = atoi(Value);
else if (strcmp(Name, "FontGridHorizontalDelta") == 0) FontGridHorizontalDelta = atoi(Value);
else if (strcmp(Name, "FontGridHorizontalSmallDelta") == 0) FontGridHorizontalSmallDelta = atoi(Value);
else if (strcmp(Name, "FontTimeLineDateHorizontalDelta") == 0) FontTimeLineDateHorizontalDelta = atoi(Value);
else if (strcmp(Name, "FontTimeLineTimeHorizontalDelta") == 0) FontTimeLineTimeHorizontalDelta = atoi(Value);
else if (strcmp(Name, "FontRecMenuItemDelta") == 0) FontRecMenuItemDelta = atoi(Value);
else if (strcmp(Name, "FontRecMenuItemSmallDelta") == 0) FontRecMenuItemSmallDelta = atoi(Value);
else if (strcmp(Name, "FontRecMenuItemLargeDelta") == 0) FontRecMenuItemLargeDelta = atoi(Value);
else if (strcmp(Name, "displayRerunsDetailEPGView") == 0) displayRerunsDetailEPGView = atoi(Value);
else if (strcmp(Name, "numReruns") == 0) numReruns = atoi(Value);
else if (strcmp(Name, "useSubtitleRerun") == 0) useSubtitleRerun = atoi(Value);
else if (strcmp(Name, "numLogosInitial") == 0) numLogosInitial = atoi(Value);
else if (strcmp(Name, "numLogosMax") == 0) numLogosMax = atoi(Value);
else if (strcmp(Name, "limitLogoCache") == 0) limitLogoCache = atoi(Value);
else return false;
return true;
}
#include <string>
#include "config.h"
cTVGuideConfig::cTVGuideConfig() {
useHWAccel = false;
debugImageLoading = 0;
showMainMenuEntry = 1;
replaceOriginalSchedule = 0;
displayMode = eHorizontal;
showTimeInGrid = 1;
channelCols = 5;
channelRows = 10;
displayTime = 160;
displayHorizontalTime = 160;
displayStatusHeader = 1;
displayChannelGroups = 1;
displayTimeBase = 1;
headerHeightPercent = 20;
channelGroupsPercent = 5;
epgViewBorder = 50;
scaleVideo = 1;
decorateVideo = 1;
timeLineWidthPercent = 8;
timeLineHeightPercent = 4;
displayChannelName = 1;
channelHeaderWidthPercent = 20;
channelHeaderHeightPercent = 15;
footerHeightPercent = 7;
stepMinutes = 30;
bigStepHours = 3;
hugeStepHours = 24;
channelJumpMode = eNumJump;
jumpChannels = 0;
blueKeyMode = 2;
closeOnSwitch = 1;
numkeyMode = 0;
useRemoteTimers = 0;
hideLastGroup = 0;
hideChannelLogos = 0;
logoWidthRatio = 13;
logoHeightRatio = 10;
logoExtension = 0;
hideEpgImages = 0;
epgImageWidth = 315;
epgImageHeight = 240;
numAdditionalEPGPictures = 9;
epgImageWidthLarge = 525;
epgImageHeightLarge = 400;
detailedViewScrollStep = 5;
instRecFolderMode = eFolderRoot;
instRecFixedFolder = "";
favWhatsOnNow = 1;
favWhatsOnNext = 1;
favUseTime1 = 0;
favUseTime2 = 0;
favUseTime3 = 0;
favUseTime4 = 0;
favTime1 = 0;
favTime2 = 0;
favTime3 = 0;
favTime4 = 0;
descUser1 = "";
descUser2 = "";
descUser3 = "";
descUser4 = "";
favLimitChannels = 0;
favStartChannel = 0;
favStopChannel = 0;
switchMode = 0;
switchMinsBefore = 2;
fontIndex = 0;
fontNameDefault = "VDRSymbols Sans:Book";
FontButtonDelta = 0;
FontDetailViewDelta = 0;
FontDetailViewSmallDelta = 0;
FontDetailHeaderDelta = 0;
FontMessageBoxDelta = 0;
FontMessageBoxLargeDelta = 0;
FontStatusHeaderDelta = 0;
FontStatusHeaderLargeDelta = 0;
FontChannelHeaderDelta = 0;
FontChannelGroupsDelta = 0;
FontGridDelta = 0;
FontGridSmallDelta = 0;
FontTimeLineWeekdayDelta = 0;
FontTimeLineDateDelta = 0;
FontTimeLineTimeDelta = 0;
FontChannelHeaderHorizontalDelta = 0;
FontChannelGroupsHorizontalDelta = 0;
FontGridHorizontalDelta = 0;
FontGridHorizontalSmallDelta = 0;
FontTimeLineDateHorizontalDelta = 0;
FontTimeLineTimeHorizontalDelta = 0;
FontRecMenuItemDelta = 0;
FontRecMenuItemSmallDelta = 0;
FontRecMenuItemLargeDelta = 0;
timeFormat = 1;
useNopacityTheme = 1;
useNopacityThemeCurrent = -1;
themeIndex = -1;
themeIndexCurrent = -1;
themeName = "";
nOpacityTheme = "";
style = eStyleBlendingDefault;
roundedCorners = 0;
displayRerunsDetailEPGView = 1;
numReruns = 5;
useSubtitleRerun = 1;
numLogosInitial = 30;
numLogosMax = 50;
limitLogoCache = 1;
logoPathSet = false;
imagesPathSet = false;
iconsPathSet = false;
}
cTVGuideConfig::~cTVGuideConfig() {
}
void cTVGuideConfig::setDynamicValues() {
numGrids = (displayMode == eVertical)?channelCols:channelRows;
jumpChannels = numGrids;
}
bool cTVGuideConfig::LoadTheme() {
//is correct theme already loaded?
if (nOpacityTheme.size() == 0)
nOpacityTheme = Setup.OSDTheme;
if ((themeIndex > -1) && (themeIndex == themeIndexCurrent) && (useNopacityTheme == useNopacityThemeCurrent)) {
if (!nOpacityTheme.compare(Setup.OSDTheme)) {
return false;
} else {
nOpacityTheme = Setup.OSDTheme;
}
}
esyslog("tvguide: loading new Theme");
//Load available Themes
cThemes themes;
themes.Load(*cString("tvguide"));
int numThemesAvailable = themes.NumThemes();
//Check for nOpacity Theme
if (useNopacityTheme) {
std::string nOpacity = "nOpacity";
std::string currentSkin = Setup.OSDSkin;
std::string currentSkinTheme = Setup.OSDTheme;
if (!currentSkin.compare(nOpacity)) {
for (int curThemeIndex = 0; curThemeIndex < numThemesAvailable; curThemeIndex++) {
std::string curThemeName = themes.Name(curThemeIndex);
if (!curThemeName.compare(currentSkinTheme)) {
themeIndex = curThemeIndex;
break;
}
}
}
}
if (themeIndex == -1) {
for (int curThemeIndex = 0; curThemeIndex < numThemesAvailable; curThemeIndex++) {
std::string curThemeName = themes.Name(curThemeIndex);
if (!curThemeName.compare("default")) {
themeIndex = curThemeIndex;
break;
}
}
}
if (themeIndex == -1)
themeIndex = 0;
themeIndexCurrent = themeIndex;
useNopacityThemeCurrent = useNopacityTheme;
const char *themePath = themes.FileName(themeIndex);
if (access(themePath, F_OK) == 0) {
::theme.Load(themePath);
themeName = themes.Name(themeIndex);
}
esyslog("tvguide: set Theme to %s", *themeName);
return true;
}
void cTVGuideConfig::SetStyle(void) {
if (theme.Color(clrStyle) == CLR_STYLE_FLAT) {
style = eStyleFlat;
esyslog("tvguide: set flat style");
} else if (theme.Color(clrStyle) == CLR_STYLE_BLENDING_DEFAULT) {
style = eStyleBlendingDefault;
esyslog("tvguide: set blending style");
} else if (theme.Color(clrStyle) == CLR_STYLE_GRAPHICAL) {
style = eStyleGraphical;
esyslog("tvguide: set graphical style");
} else {
style = eStyleBlendingMagick;
esyslog("tvguide: set magick blending style");
}
}
void cTVGuideConfig::SetLogoPath(cString path) {
logoPath = checkSlashAtEnd(*path);
logoPathSet = true;
esyslog("tvguide: Logo Path set to %s", *logoPath);
}
void cTVGuideConfig::SetImagesPath(cString path) {
epgImagePath = checkSlashAtEnd(*path);
imagesPathSet = true;
esyslog("tvguide: EPG Image Path set to %s", *epgImagePath);
}
void cTVGuideConfig::SetIconsPath(cString path) {
iconPath = checkSlashAtEnd(*path);
iconsPathSet = true;
esyslog("tvguide: Icon Path set to %s", *iconPath);
}
void cTVGuideConfig::SetDefaultPathes(void) {
logoPathDefault = cString::sprintf("%s/logos/", cPlugin::ResourceDirectory(PLUGIN_NAME_I18N));
iconPathDefault = cString::sprintf("%s/icons/", cPlugin::ResourceDirectory(PLUGIN_NAME_I18N));
epgImagePathDefault = cString::sprintf("%s/epgimages/", cPlugin::CacheDirectory(PLUGIN_NAME_I18N));
if (!logoPathSet) {
logoPath = logoPathDefault;
}
if (!imagesPathSet) {
epgImagePath = epgImagePathDefault;
}
if (!iconsPathSet) {
iconPath = iconPathDefault;
}
}
cString cTVGuideConfig::checkSlashAtEnd(std::string path) {
try {
if (!(path.at(path.size()-1) == '/'))
return cString::sprintf("%s/", path.c_str());
} catch (...) {return path.c_str();}
return path.c_str();
}
bool cTVGuideConfig::SetupParse(const char *Name, const char *Value) {
if (strcmp(Name, "timeFormat") == 0) timeFormat = atoi(Value);
else if (strcmp(Name, "debugImageLoading") == 0) debugImageLoading = atoi(Value);
else if (strcmp(Name, "useHWAccel") == 0) useHWAccel = atoi(Value);
else if (strcmp(Name, "showMainMenuEntry") == 0) showMainMenuEntry = atoi(Value);
else if (strcmp(Name, "replaceOriginalSchedule") == 0) replaceOriginalSchedule = atoi(Value);
else if (strcmp(Name, "useNopacityTheme") == 0) useNopacityTheme = atoi(Value);
else if (strcmp(Name, "themeIndex") == 0) themeIndex = atoi(Value);
else if (strcmp(Name, "displayMode") == 0) displayMode = atoi(Value);
else if (strcmp(Name, "showTimeInGrid") == 0) showTimeInGrid = atoi(Value);
else if (strcmp(Name, "displayStatusHeader") == 0) displayStatusHeader = atoi(Value);
else if (strcmp(Name, "displayChannelGroups") == 0) displayChannelGroups = atoi(Value);
else if (strcmp(Name, "displayTimeBase") == 0) displayTimeBase = atoi(Value);
else if (strcmp(Name, "headerHeightPercent") == 0) headerHeightPercent = atoi(Value);
else if (strcmp(Name, "channelGroupsPercent") == 0) channelGroupsPercent = atoi(Value);
else if (strcmp(Name, "epgViewBorder") == 0) epgViewBorder = atoi(Value);
else if (strcmp(Name, "scaleVideo") == 0) scaleVideo = atoi(Value);
else if (strcmp(Name, "decorateVideo") == 0) decorateVideo = atoi(Value);
else if (strcmp(Name, "roundedCorners") == 0) roundedCorners = atoi(Value);
else if (strcmp(Name, "channelCols") == 0) channelCols = atoi(Value);
else if (strcmp(Name, "channelRows") == 0) channelRows = atoi(Value);
else if (strcmp(Name, "displayTime") == 0) displayTime = atoi(Value);
else if (strcmp(Name, "displayHorizontalTime") == 0) displayHorizontalTime = atoi(Value);
else if (strcmp(Name, "hideChannelLogos") == 0) hideChannelLogos = atoi(Value);
else if (strcmp(Name, "logoExtension") == 0) logoExtension = atoi(Value);
else if (strcmp(Name, "logoWidthRatio") == 0) logoWidthRatio = atoi(Value);
else if (strcmp(Name, "logoHeightRatio") == 0) logoHeightRatio = atoi(Value);
else if (strcmp(Name, "bigStepHours") == 0) bigStepHours = atoi(Value);
else if (strcmp(Name, "hugeStepHours") == 0) hugeStepHours = atoi(Value);
else if (strcmp(Name, "channelJumpMode") == 0) channelJumpMode = atoi(Value);
else if (strcmp(Name, "blueKeyMode") == 0) blueKeyMode = atoi(Value);
else if (strcmp(Name, "numkeyMode") == 0) numkeyMode = atoi(Value);
else if (strcmp(Name, "closeOnSwitch") == 0) closeOnSwitch = atoi(Value);
else if (strcmp(Name, "useRemoteTimers") == 0) useRemoteTimers = atoi(Value);
else if (strcmp(Name, "hideLastGroup") == 0) hideLastGroup = atoi(Value);
else if (strcmp(Name, "hideEpgImages") == 0) hideEpgImages = atoi(Value);
else if (strcmp(Name, "epgImageWidth") == 0) epgImageWidth = atoi(Value);
else if (strcmp(Name, "epgImageHeight") == 0) epgImageHeight = atoi(Value);
else if (strcmp(Name, "numAdditionalEPGPictures") == 0) numAdditionalEPGPictures = atoi(Value);
else if (strcmp(Name, "epgImageWidthLarge") == 0) epgImageWidthLarge = atoi(Value);
else if (strcmp(Name, "epgImageHeightLarge") == 0) epgImageHeightLarge = atoi(Value);
else if (strcmp(Name, "detailedViewScrollStep") == 0) detailedViewScrollStep = atoi(Value);
else if (strcmp(Name, "timeLineWidthPercent") == 0) timeLineWidthPercent = atoi(Value);
else if (strcmp(Name, "timeLineHeightPercent") == 0) timeLineHeightPercent = atoi(Value);
else if (strcmp(Name, "displayChannelName") == 0) displayChannelName = atoi(Value);
else if (strcmp(Name, "channelHeaderWidthPercent") == 0) channelHeaderWidthPercent = atoi(Value);
else if (strcmp(Name, "channelHeaderHeightPercent") == 0) channelHeaderHeightPercent = atoi(Value);
else if (strcmp(Name, "footerHeightPercent") == 0) footerHeightPercent = atoi(Value);
else if (strcmp(Name, "instRecFolderMode") == 0) instRecFolderMode = atoi(Value);
else if (strcmp(Name, "instRecFixedFolder") == 0) instRecFixedFolder = 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);
else if (strcmp(Name, "favUseTime2") == 0) favUseTime2 = atoi(Value);
else if (strcmp(Name, "favUseTime3") == 0) favUseTime3 = atoi(Value);
else if (strcmp(Name, "favUseTime4") == 0) favUseTime4 = atoi(Value);
else if (strcmp(Name, "favTime1") == 0) favTime1 = atoi(Value);
else if (strcmp(Name, "favTime2") == 0) favTime2 = atoi(Value);
else if (strcmp(Name, "favTime3") == 0) favTime3 = atoi(Value);
else if (strcmp(Name, "favTime4") == 0) favTime4 = atoi(Value);
else if (strcmp(Name, "descUser1") == 0) descUser1 = Value;
else if (strcmp(Name, "descUser2") == 0) descUser2 = Value;
else if (strcmp(Name, "descUser3") == 0) descUser3 = Value;
else if (strcmp(Name, "descUser4") == 0) descUser4 = 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);
else if (strcmp(Name, "FontDetailViewDelta") == 0) FontDetailViewDelta = atoi(Value);
else if (strcmp(Name, "FontDetailHeaderDelta") == 0) FontDetailHeaderDelta = atoi(Value);
else if (strcmp(Name, "FontMessageBoxDelta") == 0) FontMessageBoxDelta = atoi(Value);
else if (strcmp(Name, "FontMessageBoxLargeDelta") == 0) FontMessageBoxLargeDelta = atoi(Value);
else if (strcmp(Name, "FontStatusHeaderDelta") == 0) FontStatusHeaderDelta = atoi(Value);
else if (strcmp(Name, "FontStatusHeaderLargeDelta") == 0) FontStatusHeaderLargeDelta = atoi(Value);
else if (strcmp(Name, "FontChannelHeaderDelta") == 0) FontChannelHeaderDelta = atoi(Value);
else if (strcmp(Name, "FontChannelGroupsDelta") == 0) FontChannelGroupsDelta = atoi(Value);
else if (strcmp(Name, "FontGridDelta") == 0) FontGridDelta = atoi(Value);
else if (strcmp(Name, "FontGridSmallDelta") == 0) FontGridSmallDelta = atoi(Value);
else if (strcmp(Name, "FontTimeLineWeekdayDelta") == 0) FontTimeLineWeekdayDelta = atoi(Value);
else if (strcmp(Name, "FontTimeLineDateDelta") == 0) FontTimeLineDateDelta = atoi(Value);
else if (strcmp(Name, "FontTimeLineTimeDelta") == 0) FontTimeLineTimeDelta = atoi(Value);
else if (strcmp(Name, "FontChannelHeaderHorizontalDelta") == 0) FontChannelHeaderHorizontalDelta = atoi(Value);
else if (strcmp(Name, "FontChannelGroupsHorizontalDelta") == 0) FontChannelGroupsHorizontalDelta = atoi(Value);
else if (strcmp(Name, "FontGridHorizontalDelta") == 0) FontGridHorizontalDelta = atoi(Value);
else if (strcmp(Name, "FontGridHorizontalSmallDelta") == 0) FontGridHorizontalSmallDelta = atoi(Value);
else if (strcmp(Name, "FontTimeLineDateHorizontalDelta") == 0) FontTimeLineDateHorizontalDelta = atoi(Value);
else if (strcmp(Name, "FontTimeLineTimeHorizontalDelta") == 0) FontTimeLineTimeHorizontalDelta = atoi(Value);
else if (strcmp(Name, "FontRecMenuItemDelta") == 0) FontRecMenuItemDelta = atoi(Value);
else if (strcmp(Name, "FontRecMenuItemSmallDelta") == 0) FontRecMenuItemSmallDelta = atoi(Value);
else if (strcmp(Name, "FontRecMenuItemLargeDelta") == 0) FontRecMenuItemLargeDelta = atoi(Value);
else if (strcmp(Name, "displayRerunsDetailEPGView") == 0) displayRerunsDetailEPGView = atoi(Value);
else if (strcmp(Name, "numReruns") == 0) numReruns = atoi(Value);
else if (strcmp(Name, "useSubtitleRerun") == 0) useSubtitleRerun = atoi(Value);
else if (strcmp(Name, "numLogosInitial") == 0) numLogosInitial = atoi(Value);
else if (strcmp(Name, "numLogosMax") == 0) numLogosMax = atoi(Value);
else if (strcmp(Name, "limitLogoCache") == 0) limitLogoCache = atoi(Value);
else return false;
return true;
}

517
config.h
View File

@@ -1,257 +1,260 @@
#ifndef __TVGUIDE_CONFIG_H
#define __TVGUIDE_CONFIG_H
#include <vdr/themes.h>
#include <vdr/plugin.h>
#include "osdmanager.h"
#include "geometrymanager.h"
#include "fontmanager.h"
#include "imagecache.h"
enum {
e12Hours,
e24Hours
};
enum {
eVertical,
eHorizontal
};
enum {
eNumJump,
eGroupJump
};
enum {
eStyleGraphical,
eStyleBlendingMagick,
eStyleBlendingDefault,
eStyleFlat
};
enum eBlueKeyMode {
eBlueKeySwitch = 0,
eBlueKeyEPG,
eBlueKeyFavorites
};
enum eInstRecFolderMode {
eFolderRoot = 0,
eFolderSelect,
eFolderFixed
};
class cTvguideConfig {
private:
cString checkSlashAtEnd(std::string path);
public:
cTvguideConfig();
~cTvguideConfig();
int debugImageLoading;
int showMainMenuEntry;
int replaceOriginalSchedule;
int displayMode;
int showTimeInGrid;
int channelCols;
int channelRows;
int numGrids;
int displayTime;
int displayStatusHeader;
int displayChannelGroups;
int displayTimeBase;
int headerHeightPercent;
int channelGroupsPercent;
int epgViewBorder;
int scaleVideo;
int decorateVideo;
int timeLineWidthPercent;
int timeLineHeightPercent;
int displayChannelName;
int channelHeaderWidthPercent;
int channelHeaderHeightPercent;
int footerHeightPercent;
int stepMinutes;
int bigStepHours;
int hugeStepHours;
int channelJumpMode;
int jumpChannels;
int blueKeyMode;
int closeOnSwitch;
int numkeyMode;
int useRemoteTimers;
int hideLastGroup;
int hideChannelLogos;
int logoWidthRatio;
int logoHeightRatio;
cString logoPath;
int logoExtension;
int hideEpgImages;
int epgImageWidth;
int epgImageHeight;
int numAdditionalEPGPictures;
int epgImageWidthLarge;
int epgImageHeightLarge;
int detailedViewScrollStep;
cString epgImagePath;
cString iconPath;
cString logoPathDefault;
cString iconPathDefault;
cString epgImagePathDefault;
int instRecFolderMode;
std::string instRecFixedFolder;
int favWhatsOnNow;
int favWhatsOnNext;
int favUseTime1;
int favUseTime2;
int favUseTime3;
int favUseTime4;
int favTime1;
int favTime2;
int favTime3;
int favTime4;
std::string descUser1;
std::string descUser2;
std::string descUser3;
std::string descUser4;
int favLimitChannels;
int favStartChannel;
int favStopChannel;
int switchMode;
int switchMinsBefore;
int fontIndex;
const char *fontNameDefault;
int FontButtonDelta;
int FontDetailViewDelta;
int FontDetailViewSmallDelta;
int FontDetailHeaderDelta;
int FontMessageBoxDelta;
int FontMessageBoxLargeDelta;
int FontStatusHeaderDelta;
int FontStatusHeaderLargeDelta;
int FontChannelHeaderDelta;
int FontChannelGroupsDelta;
int FontGridDelta;
int FontGridSmallDelta;
int FontTimeLineWeekdayDelta;
int FontTimeLineDateDelta;
int FontTimeLineTimeDelta;
int FontChannelHeaderHorizontalDelta;
int FontChannelGroupsHorizontalDelta;
int FontGridHorizontalDelta;
int FontGridHorizontalSmallDelta;
int FontTimeLineDateHorizontalDelta;
int FontTimeLineTimeHorizontalDelta;
int FontRecMenuItemDelta;
int FontRecMenuItemSmallDelta;
int FontRecMenuItemLargeDelta;
int timeFormat;
int useNopacityTheme;
int themeIndex;
int themeIndexCurrent;
cString themeName;
std::string nOpacityTheme;
int style;
int roundedCorners;
int displayRerunsDetailEPGView;
int numReruns;
int useSubtitleRerun;
int numLogosInitial;
int numLogosMax;
int limitLogoCache;
bool logoPathSet;
bool imagesPathSet;
bool iconsPathSet;
bool LoadTheme();
void SetStyle(void);
void setDynamicValues(void);
void SetLogoPath(cString path);
void SetImagesPath(cString path);
void SetIconsPath(cString path);
void SetDefaultPathes(void);
bool SetupParse(const char *Name, const char *Value);
};
#ifdef DEFINE_CONFIG
cTvguideConfig tvguideConfig;
cOsdManager osdManager;
cGeometryManager geoManager;
cFontManager fontManager;
cImageCache imgCache;
cTheme theme;
cPlugin* pRemoteTimers = NULL;
#else
extern cTvguideConfig tvguideConfig;
extern cOsdManager osdManager;
extern cGeometryManager geoManager;
extern cFontManager fontManager;
extern cImageCache imgCache;
extern cTheme theme;
extern cPlugin* pRemoteTimers;
#endif
// --- Theme -------------------------------------------------------------
//Style SETUP
#define CLR_STYLE_BLENDING_MAGICK 0xFFFFFFFF
#define CLR_STYLE_BLENDING_DEFAULT 0xAAAAAAAA
#define CLR_STYLE_GRAPHICAL 0x66666666
#define CLR_STYLE_FLAT 0x00000000
THEME_CLR(theme, clrStyle, CLR_STYLE_BLENDING_DEFAULT);
THEME_CLR(theme, clrBackgroundOSD, 0xB012273f);
THEME_CLR(theme, clrBackground, 0xFF12273f);
THEME_CLR(theme, clrGrid1, 0x00000000);
THEME_CLR(theme, clrGrid1Blending, 0x00000000);
THEME_CLR(theme, clrGrid2, 0x00000000);
THEME_CLR(theme, clrGrid2Blending, 0x00000000);
THEME_CLR(theme, clrHighlight, 0xAA3A3A55);
THEME_CLR(theme, clrHighlightBlending, 0xDD000000);
THEME_CLR(theme, clrGridFontBack, clrTransparent);
THEME_CLR(theme, clrGridActiveFontBack, 0xFFAFD533);
THEME_CLR(theme, clrFont, clrWhite);
THEME_CLR(theme, clrFontActive, 0xFF363636);
THEME_CLR(theme, clrFontHeader, 0xFF363636);
THEME_CLR(theme, clrFontButtons, clrWhite);
THEME_CLR(theme, clrStatusHeader, 0x00000000);
THEME_CLR(theme, clrStatusHeaderBlending, 0x00000000);
THEME_CLR(theme, clrHeader, 0x00000000);
THEME_CLR(theme, clrHeaderBlending, 0x00000000);
THEME_CLR(theme, clrBorder, 0x00000000);
THEME_CLR(theme, clrTimeline1, clrWhite);
THEME_CLR(theme, clrTimeline1Blending, 0xFF828282);
THEME_CLR(theme, clrTimeline2, clrBlack);
THEME_CLR(theme, clrTimeline2Blending, 0xFF3F3F3F);
THEME_CLR(theme, clrTimeBase, 0xA0FF0000);
THEME_CLR(theme, clrTabInactive, 0xA01F3D7A);
THEME_CLR(theme, clrButtonRed, 0xFFFF0000);
THEME_CLR(theme, clrButtonRedBorder, 0x00000000);
THEME_CLR(theme, clrButtonGreen, 0x00000000);
THEME_CLR(theme, clrButtonGreenBorder, 0x00000000);
THEME_CLR(theme, clrButtonYellow, 0x00000000);
THEME_CLR(theme, clrButtonYellowBorder, 0x00000000);
THEME_CLR(theme, clrButtonBlue, 0x00000000);
THEME_CLR(theme, clrButtonBlueBorder, 0x00000000);
THEME_CLR(theme, clrButtonBlend, 0xDD000000);
THEME_CLR(theme, clrRecMenuBackground, 0xAA000000);
THEME_CLR(theme, clrRecMenuTimerConflictBackground, 0xFFCCCCCC);
THEME_CLR(theme, clrRecMenuTimerConflictBar, 0xFF222222);
THEME_CLR(theme, clrRecMenuTimerConflictOverlap, 0xAAFF0000);
THEME_CLR(theme, clrRecMenuDayActive, 0xFF00FF00);
THEME_CLR(theme, clrRecMenuDayInactive, 0xFFFF0000);
THEME_CLR(theme, clrRecMenuDayHighlight, 0x44FFFFFF);
THEME_CLR(theme, clrRecMenuTextBack, 0xFF000000);
THEME_CLR(theme, clrRecMenuTextActiveBack, 0xFF939376);
THEME_CLR(theme, clrRecMenuKeyboardBack, 0xFF000000);
THEME_CLR(theme, clrRecMenuKeyboardBorder, clrWhite);
THEME_CLR(theme, clrRecMenuKeyboardHigh, 0x40BB0000);
THEME_CLR(theme, clrButtonRedKeyboard, 0xFFBB0000);
THEME_CLR(theme, clrButtonGreenKeyboard, 0xFF00BB00);
THEME_CLR(theme, clrButtonYellowKeyboard, 0xFFBBBB00);
THEME_CLR(theme, clrRecMenuTimelineTimer, 0xB012273f);
THEME_CLR(theme, clrRecMenuTimelineBack, 0xFF828282);
THEME_CLR(theme, clrRecMenuTimelineActive, 0xFF3F3F3F);
THEME_CLR(theme, clrRecMenuTimelineConflict, 0x30FF0000);
THEME_CLR(theme, clrRecMenuTimelineConflictOverlap, 0x90FF0000);
#endif //__TVGUIDE_CONFIG_H
#ifndef __TVGUIDE_CONFIG_H
#define __TVGUIDE_CONFIG_H
#include <vdr/themes.h>
#include <vdr/plugin.h>
#include "osdmanager.h"
#include "geometrymanager.h"
#include "fontmanager.h"
#include "imagecache.h"
enum {
e12Hours,
e24Hours
};
enum {
eVertical,
eHorizontal
};
enum {
eNumJump,
eGroupJump
};
enum {
eStyleGraphical,
eStyleBlendingMagick,
eStyleBlendingDefault,
eStyleFlat
};
enum eBlueKeyMode {
eBlueKeySwitch = 0,
eBlueKeyEPG,
eBlueKeyFavorites
};
enum eInstRecFolderMode {
eFolderRoot = 0,
eFolderSelect,
eFolderFixed
};
class cTVGuideConfig {
private:
cString checkSlashAtEnd(std::string path);
public:
cTVGuideConfig();
~cTVGuideConfig();
int useHWAccel;
int debugImageLoading;
int showMainMenuEntry;
int replaceOriginalSchedule;
int displayMode;
int showTimeInGrid;
int channelCols;
int channelRows;
int numGrids;
int displayTime;
int displayHorizontalTime;
int displayStatusHeader;
int displayChannelGroups;
int displayTimeBase;
int headerHeightPercent;
int channelGroupsPercent;
int epgViewBorder;
int scaleVideo;
int decorateVideo;
int timeLineWidthPercent;
int timeLineHeightPercent;
int displayChannelName;
int channelHeaderWidthPercent;
int channelHeaderHeightPercent;
int footerHeightPercent;
int stepMinutes;
int bigStepHours;
int hugeStepHours;
int channelJumpMode;
int jumpChannels;
int blueKeyMode;
int closeOnSwitch;
int numkeyMode;
int useRemoteTimers;
int hideLastGroup;
int hideChannelLogos;
int logoWidthRatio;
int logoHeightRatio;
cString logoPath;
int logoExtension;
int hideEpgImages;
int epgImageWidth;
int epgImageHeight;
int numAdditionalEPGPictures;
int epgImageWidthLarge;
int epgImageHeightLarge;
int detailedViewScrollStep;
cString epgImagePath;
cString iconPath;
cString logoPathDefault;
cString iconPathDefault;
cString epgImagePathDefault;
int instRecFolderMode;
std::string instRecFixedFolder;
int favWhatsOnNow;
int favWhatsOnNext;
int favUseTime1;
int favUseTime2;
int favUseTime3;
int favUseTime4;
int favTime1;
int favTime2;
int favTime3;
int favTime4;
std::string descUser1;
std::string descUser2;
std::string descUser3;
std::string descUser4;
int favLimitChannels;
int favStartChannel;
int favStopChannel;
int switchMode;
int switchMinsBefore;
int fontIndex;
const char *fontNameDefault;
int FontButtonDelta;
int FontDetailViewDelta;
int FontDetailViewSmallDelta;
int FontDetailHeaderDelta;
int FontMessageBoxDelta;
int FontMessageBoxLargeDelta;
int FontStatusHeaderDelta;
int FontStatusHeaderLargeDelta;
int FontChannelHeaderDelta;
int FontChannelGroupsDelta;
int FontGridDelta;
int FontGridSmallDelta;
int FontTimeLineWeekdayDelta;
int FontTimeLineDateDelta;
int FontTimeLineTimeDelta;
int FontChannelHeaderHorizontalDelta;
int FontChannelGroupsHorizontalDelta;
int FontGridHorizontalDelta;
int FontGridHorizontalSmallDelta;
int FontTimeLineDateHorizontalDelta;
int FontTimeLineTimeHorizontalDelta;
int FontRecMenuItemDelta;
int FontRecMenuItemSmallDelta;
int FontRecMenuItemLargeDelta;
int timeFormat;
int useNopacityTheme;
int useNopacityThemeCurrent;
int themeIndex;
int themeIndexCurrent;
cString themeName;
std::string nOpacityTheme;
int style;
int roundedCorners;
int displayRerunsDetailEPGView;
int numReruns;
int useSubtitleRerun;
int numLogosInitial;
int numLogosMax;
int limitLogoCache;
bool logoPathSet;
bool imagesPathSet;
bool iconsPathSet;
bool LoadTheme();
void SetStyle(void);
void setDynamicValues(void);
void SetLogoPath(cString path);
void SetImagesPath(cString path);
void SetIconsPath(cString path);
void SetDefaultPathes(void);
bool SetupParse(const char *Name, const char *Value);
};
#ifdef DEFINE_CONFIG
cTVGuideConfig config;
cOsdManager osdManager;
cGeometryManager geoManager;
cFontManager fontManager;
cImageCache imgCache;
cTheme theme;
cPlugin* pRemoteTimers = NULL;
#else
extern cTVGuideConfig config;
extern cOsdManager osdManager;
extern cGeometryManager geoManager;
extern cFontManager fontManager;
extern cImageCache imgCache;
extern cTheme theme;
extern cPlugin* pRemoteTimers;
#endif
// --- Theme -------------------------------------------------------------
//Style SETUP
#define CLR_STYLE_BLENDING_MAGICK 0xFFFFFFFF
#define CLR_STYLE_BLENDING_DEFAULT 0xAAAAAAAA
#define CLR_STYLE_GRAPHICAL 0x66666666
#define CLR_STYLE_FLAT 0x00000000
THEME_CLR(theme, clrStyle, CLR_STYLE_BLENDING_DEFAULT);
THEME_CLR(theme, clrBackgroundOSD, 0xB012273f);
THEME_CLR(theme, clrBackground, 0xFF12273f);
THEME_CLR(theme, clrGrid1, 0x00000000);
THEME_CLR(theme, clrGrid1Blending, 0x00000000);
THEME_CLR(theme, clrGrid2, 0x00000000);
THEME_CLR(theme, clrGrid2Blending, 0x00000000);
THEME_CLR(theme, clrHighlight, 0xAA3A3A55);
THEME_CLR(theme, clrHighlightBlending, 0xDD000000);
THEME_CLR(theme, clrGridFontBack, clrTransparent);
THEME_CLR(theme, clrGridActiveFontBack, 0xFFAFD533);
THEME_CLR(theme, clrFont, clrWhite);
THEME_CLR(theme, clrFontActive, 0xFF363636);
THEME_CLR(theme, clrFontHeader, 0xFF363636);
THEME_CLR(theme, clrFontButtons, clrWhite);
THEME_CLR(theme, clrStatusHeader, 0x00000000);
THEME_CLR(theme, clrStatusHeaderBlending, 0x00000000);
THEME_CLR(theme, clrHeader, 0x00000000);
THEME_CLR(theme, clrHeaderBlending, 0x00000000);
THEME_CLR(theme, clrBorder, 0x00000000);
THEME_CLR(theme, clrTimeline1, clrWhite);
THEME_CLR(theme, clrTimeline1Blending, 0xFF828282);
THEME_CLR(theme, clrTimeline2, clrBlack);
THEME_CLR(theme, clrTimeline2Blending, 0xFF3F3F3F);
THEME_CLR(theme, clrTimeBase, 0xA0FF0000);
THEME_CLR(theme, clrTabInactive, 0xA01F3D7A);
THEME_CLR(theme, clrButtonRed, 0xFFFF0000);
THEME_CLR(theme, clrButtonRedBorder, 0x00000000);
THEME_CLR(theme, clrButtonGreen, 0x00000000);
THEME_CLR(theme, clrButtonGreenBorder, 0x00000000);
THEME_CLR(theme, clrButtonYellow, 0x00000000);
THEME_CLR(theme, clrButtonYellowBorder, 0x00000000);
THEME_CLR(theme, clrButtonBlue, 0x00000000);
THEME_CLR(theme, clrButtonBlueBorder, 0x00000000);
THEME_CLR(theme, clrButtonBlend, 0xDD000000);
THEME_CLR(theme, clrRecMenuBackground, 0xAA000000);
THEME_CLR(theme, clrRecMenuTimerConflictBackground, 0xFFCCCCCC);
THEME_CLR(theme, clrRecMenuTimerConflictBar, 0xFF222222);
THEME_CLR(theme, clrRecMenuTimerConflictOverlap, 0xAAFF0000);
THEME_CLR(theme, clrRecMenuDayActive, 0xFF00FF00);
THEME_CLR(theme, clrRecMenuDayInactive, 0xFFFF0000);
THEME_CLR(theme, clrRecMenuDayHighlight, 0x44FFFFFF);
THEME_CLR(theme, clrRecMenuTextBack, 0xFF000000);
THEME_CLR(theme, clrRecMenuTextActiveBack, 0xFF939376);
THEME_CLR(theme, clrRecMenuKeyboardBack, 0xFF000000);
THEME_CLR(theme, clrRecMenuKeyboardBorder, clrWhite);
THEME_CLR(theme, clrRecMenuKeyboardHigh, 0x40BB0000);
THEME_CLR(theme, clrButtonRedKeyboard, 0xFFBB0000);
THEME_CLR(theme, clrButtonGreenKeyboard, 0xFF00BB00);
THEME_CLR(theme, clrButtonYellowKeyboard, 0xFFBBBB00);
THEME_CLR(theme, clrRecMenuTimelineTimer, 0xB012273f);
THEME_CLR(theme, clrRecMenuTimelineBack, 0xFF828282);
THEME_CLR(theme, clrRecMenuTimelineActive, 0xFF3F3F3F);
THEME_CLR(theme, clrRecMenuTimelineConflict, 0x30FF0000);
THEME_CLR(theme, clrRecMenuTimelineConflictOverlap, 0x90FF0000);
#endif //__TVGUIDE_CONFIG_H

View File

@@ -1,12 +1,12 @@
#include "detailview.h"
cDetailView::cDetailView(const cEvent *event, cFooter *footer) {
cDetailView::cDetailView(const cEvent *event, cFooter *footer) : cThread("DetailView") {
this->event = event;
this->footer = footer;
}
cDetailView::~cDetailView(void){
Cancel(-1);
Cancel(3);
while (Active())
cCondWait::SleepMs(10);
#if VDRVERSNUM >= 20301
@@ -74,8 +74,8 @@ std::string cDetailView::LoadReruns(void) {
Epgsearch_searchresults_v1_0 data;
std::string strQuery = event->Title();
if (tvguideConfig.displayRerunsDetailEPGView > 0) {
if (tvguideConfig.useSubtitleRerun == 2 && !isempty(event->ShortText())) {
if (config.displayRerunsDetailEPGView > 0) {
if (config.useSubtitleRerun == 2 && !isempty(event->ShortText())) {
strQuery += "~";
strQuery += event->ShortText();
}
@@ -95,7 +95,7 @@ std::string cDetailView::LoadReruns(void) {
if (list && (list->Count() > 1)) {
foundRerun = true;
int i = 0;
for (Epgsearch_searchresults_v1_0::cServiceSearchResult *r = list->First(); r && i < tvguideConfig.numReruns; r = list->Next(r)) {
for (Epgsearch_searchresults_v1_0::cServiceSearchResult *r = list->First(); r && i < config.numReruns; r = list->Next(r)) {
if ((event->ChannelID() == r->event->ChannelID()) && (event->StartTime() == r->event->StartTime()))
continue;
i++;
@@ -171,4 +171,4 @@ eOSState cDetailView::ProcessKey(eKeys Key) {
break;
}
return state;
}
}

View File

@@ -25,4 +25,4 @@ public:
eOSState ProcessKey(eKeys Key);
};
#endif //__TVGUIDE_DETAILVIEW_H
#endif //__TVGUIDE_DETAILVIEW_H

View File

@@ -1,6 +1,6 @@
#include "dummygrid.h"
cDummyGrid::cDummyGrid(cChannelColumn *c, time_t start, time_t end) : cGrid(c) {
cDummyGrid::cDummyGrid(cChannelEpg *c, time_t start, time_t end) : cGridElement(c) {
this->start = start;
this->end = end;
strText = tr("No EPG Information available");
@@ -27,7 +27,7 @@ void cDummyGrid::SetViewportHeight() {
void cDummyGrid::PositionPixmap() {
int x0, y0;
if (tvguideConfig.displayMode == eVertical) {
if (config.displayMode == eVertical) {
x0 = column->getX();
y0 = geoManager.statusHeaderHeight + geoManager.channelHeaderHeight + geoManager.channelGroupsHeight;
if ( column->Start() < StartTime() ) {
@@ -41,7 +41,7 @@ void cDummyGrid::PositionPixmap() {
} else {
pixmap->SetViewPort(cRect(x0, y0, geoManager.colWidth, viewportHeight));
}
} else if (tvguideConfig.displayMode == eHorizontal) {
} else if (config.displayMode == eHorizontal) {
x0 = geoManager.channelHeaderWidth + geoManager.channelGroupsWidth;
y0 = column->getY();
if ( column->Start() < StartTime() ) {
@@ -59,7 +59,7 @@ void cDummyGrid::PositionPixmap() {
}
void cDummyGrid::setText() {
if (tvguideConfig.displayMode == eVertical) {
if (config.displayMode == eVertical) {
text->Set(*strText, fontManager.FontGrid, geoManager.colWidth-2*borderWidth);
}
}
@@ -67,13 +67,13 @@ void cDummyGrid::setText() {
void cDummyGrid::drawText() {
tColor colorText = (active)?theme.Color(clrFontActive):theme.Color(clrFont);
tColor colorTextBack;
if (tvguideConfig.style == eStyleFlat)
if (config.style == eStyleFlat)
colorTextBack = color;
else if (tvguideConfig.style == eStyleGraphical)
else if (config.style == eStyleGraphical)
colorTextBack = (active)?theme.Color(clrGridActiveFontBack):theme.Color(clrGridFontBack);
else
colorTextBack = clrTransparent;
if (tvguideConfig.displayMode == eVertical) {
if (config.displayMode == eVertical) {
if (Height()/geoManager.minutePixel < 6)
return;
int textHeight = fontManager.FontGrid->Height();
@@ -82,7 +82,7 @@ void cDummyGrid::drawText() {
pixmap->DrawText(cPoint(borderWidth, borderWidth + i*textHeight), text->GetLine(i), colorText, colorTextBack, fontManager.FontGrid);
}
} else if (tvguideConfig.displayMode == eHorizontal) {
} else if (config.displayMode == eHorizontal) {
if (Width()/geoManager.minutePixel < 10) {
int titleY = (geoManager.rowHeight - fontManager.FontGridHorizontal->Height())/2;
pixmap->DrawText(cPoint(borderWidth - 2, titleY), "...", colorText, colorTextBack, fontManager.FontGridHorizontal);
@@ -103,9 +103,9 @@ cString cDummyGrid::getTimeString(void) {
void cDummyGrid::debug() {
esyslog("tvguide dummygrid: %s: %s, %s, viewportHeight: %d px, Duration: %ld min, active: %d",
column->Name(),
*cMyTime::printTime(start),
*cMyTime::printTime(end),
*cTimeManager::printTime(start),
*cTimeManager::printTime(end),
viewportHeight,
Duration()/60,
active);
}
}

View File

@@ -1,12 +1,12 @@
#ifndef __TVGUIDE_DUMMYGRID_H
#define __TVGUIDE_DUMMYGRID_H
#include "grid.h"
#include "channelcolumn.h"
#include "gridelement.h"
#include "channelepg.h"
// --- cDummyGrid -------------------------------------------------------------
class cDummyGrid : public cGrid {
class cDummyGrid : public cGridElement {
private:
time_t start;
time_t end;
@@ -14,7 +14,7 @@ private:
void drawText();
time_t Duration(void);
public:
cDummyGrid(cChannelColumn *c, time_t start, time_t end);
cDummyGrid(cChannelEpg *c, time_t start, time_t end);
virtual ~cDummyGrid(void);
void SetViewportHeight();
void PositionPixmap();
@@ -24,11 +24,11 @@ public:
time_t EndTime() { return end; };
void SetStartTime(time_t start) { this->start = start; };
void SetEndTime(time_t end) { this->end = end; };
int calcOverlap(cGrid *neighbor);
int calcOverlap(cGridElement *neighbor);
void setTimer() {};
cString getText(void);
cString getTimeString(void);
void debug();
};
#endif //__TVGUIDE_DUMMYGRID_H
#endif //__TVGUIDE_DUMMYGRID_H

391
epggrid.c
View File

@@ -1,193 +1,198 @@
#include "services/remotetimers.h"
#include "channelcolumn.h"
#include "tools.h"
#include "epggrid.h"
cEpgGrid::cEpgGrid(cChannelColumn *c, const cEvent *event) : cGrid(c) {
this->event = event;
extText = new cTextWrapper();
hasTimer = false;
SetTimer();
hasSwitchTimer = false;
SetSwitchTimer();
dummy = false;
}
cEpgGrid::~cEpgGrid(void) {
delete extText;
}
void cEpgGrid::SetViewportHeight() {
int viewportHeightOld = viewportHeight;
if ( column->Start() > StartTime() ) {
viewportHeight = (min((int)EndTime(), column->Stop()) - column->Start()) /60;
} else if ( column->Stop() < EndTime() ) {
viewportHeight = (column->Stop() - StartTime()) /60;
if (viewportHeight < 0) viewportHeight = 0;
} else {
viewportHeight = Duration() / 60;
}
viewportHeight *= geoManager.minutePixel;
if (viewportHeight != viewportHeightOld)
dirty = true;
}
void cEpgGrid::PositionPixmap() {
if (tvguideConfig.displayMode == eVertical) {
int x0 = column->getX();
int y0 = geoManager.statusHeaderHeight + geoManager.channelHeaderHeight + geoManager.channelGroupsHeight;
if ( column->Start() < StartTime() ) {
y0 += (StartTime() - column->Start())/60*geoManager.minutePixel;
}
if (!pixmap) {
pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, geoManager.colWidth, viewportHeight),
cRect(0, 0, geoManager.colWidth, Duration()/60*geoManager.minutePixel));
} else {
pixmap->SetViewPort(cRect(x0, y0, geoManager.colWidth, viewportHeight));
}
} else if (tvguideConfig.displayMode == eHorizontal) {
int x0 = geoManager.channelHeaderWidth + geoManager.channelGroupsWidth;
int y0 = column->getY();
if ( column->Start() < StartTime() ) {
x0 += (StartTime() - column->Start())/60*geoManager.minutePixel;
}
if (!pixmap) {
pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, viewportHeight, geoManager.rowHeight),
cRect(0, 0, Duration()/60*geoManager.minutePixel, geoManager.rowHeight));
} else {
pixmap->SetViewPort(cRect(x0, y0, viewportHeight, geoManager.rowHeight ));
}
}
}
void cEpgGrid::SetTimer() {
if (tvguideConfig.useRemoteTimers && pRemoteTimers) {
RemoteTimers_Event_v1_0 rt;
rt.event = event;
if (pRemoteTimers->Service("RemoteTimers::GetTimerByEvent-v1.0", &rt))
hasTimer = true;
else
hasTimer = false;
#if VDRVERSNUM >= 30400
} else if (event->HasTimer()) {
hasTimer = true;
#else
} else if (column->HasTimer()) {
hasTimer = event->HasTimer();
#endif
} else {
hasTimer = false;
}
}
void cEpgGrid::SetSwitchTimer() {
if (column->HasSwitchTimer()) {
hasSwitchTimer = SwitchTimers.EventInSwitchList(event);
} else {
hasSwitchTimer = false;
}
}
void cEpgGrid::setText() {
if (tvguideConfig.displayMode == eVertical) {
cString strText;
strText = cString::sprintf("%s - %s:\n%s", *(event->GetTimeString()), *(event->GetEndTimeString()), event->Title());
text->Set(*(strText), fontManager.FontGrid, geoManager.colWidth-2*borderWidth);
extText->Set(event->ShortText(), fontManager.FontGridSmall, geoManager.colWidth-2*borderWidth);
} else if (tvguideConfig.displayMode == eHorizontal) {
timeString = cString::sprintf("%s - %s", *(event->GetTimeString()), *(event->GetEndTimeString()));
}
}
void cEpgGrid::drawText() {
tColor colorText = (active)?theme.Color(clrFontActive):theme.Color(clrFont);
tColor colorTextBack;
if (tvguideConfig.style == eStyleFlat)
colorTextBack = color;
else if (tvguideConfig.style == eStyleGraphical)
colorTextBack = (active)?theme.Color(clrGridActiveFontBack):theme.Color(clrGridFontBack);
else
colorTextBack = clrTransparent;
if (tvguideConfig.displayMode == eVertical) {
if (Height()/geoManager.minutePixel < 6)
return;
int textHeight = fontManager.FontGrid->Height();
int textLines = text->Lines();
for (int i=0; i<textLines; i++) {
pixmap->DrawText(cPoint(borderWidth, borderWidth + i*textHeight), text->GetLine(i), colorText, colorTextBack, fontManager.FontGrid);
}
int extTextLines = extText->Lines();
int offset = (textLines+1)*textHeight - 0.5*textHeight;
textHeight = fontManager.FontGridSmall->Height();
if ((Height()-textHeight-10) > offset) {
for (int i=0; i<extTextLines; i++) {
pixmap->DrawText(cPoint(borderWidth, borderWidth + offset + i*textHeight), extText->GetLine(i), colorText, colorTextBack, fontManager.FontGridSmall);
}
}
} else if (tvguideConfig.displayMode == eHorizontal) {
if (Width()/geoManager.minutePixel < 10) {
int titleY = (geoManager.rowHeight - fontManager.FontGridHorizontal->Height())/2;
pixmap->DrawText(cPoint(borderWidth - 2, titleY), "...", colorText, colorTextBack, fontManager.FontGridHorizontal);
return;
}
cString strTitle = CutText(event->Title(), viewportHeight, fontManager.FontGridHorizontal).c_str();
int titleY = 0;
if (tvguideConfig.showTimeInGrid) {
pixmap->DrawText(cPoint(borderWidth, borderWidth), *timeString, colorText, colorTextBack, fontManager.FontGridHorizontalSmall);
titleY = fontManager.FontGridHorizontalSmall->Height() + (geoManager.rowHeight - fontManager.FontGridHorizontalSmall->Height() - fontManager.FontGridHorizontal->Height())/2;
} else {
titleY = (geoManager.rowHeight - fontManager.FontGridHorizontal->Height())/2;
}
pixmap->DrawText(cPoint(borderWidth, titleY), *strTitle, colorText, colorTextBack, fontManager.FontGridHorizontal);
}
if (hasSwitchTimer)
drawIcon("Switch", theme.Color(clrButtonYellow));
if (hasTimer) {
const cTimer *timer = NULL;
#if VDRVERSNUM >= 20301
{
LOCK_TIMERS_READ;
timer = Timers->GetMatch(event);
}
#else
timer = Timers.GetMatch(event);
#endif
if (timer)
#ifdef SWITCHONLYPATCH
if (timer->HasFlags(tfSwitchOnly))
drawIcon("Switch", theme.Color(clrButtonYellow));
else if (timer->HasFlags(tfActive))
#else /* SWITCHONLY */
if (timer->HasFlags(tfActive))
#endif /* SWITCHONLY */
drawIcon("REC", theme.Color(clrButtonRed));
else
drawIcon("REC", theme.Color(clrButtonGreen));
}
}
void cEpgGrid::drawIcon(cString iconText, tColor color) {
const cFont *font = (tvguideConfig.displayMode == eVertical)
?fontManager.FontGrid
:fontManager.FontGridHorizontalSmall;
int textWidth = font->Width(*iconText)+2*borderWidth;
int textHeight = font->Height()+10;
pixmap->DrawRectangle( cRect(Width() - textWidth - borderWidth, Height() - textHeight - borderWidth, textWidth, textHeight), color);
pixmap->DrawText(cPoint(Width() - textWidth, Height() - textHeight - borderWidth/2), *iconText, theme.Color(clrFont), color, font);
}
cString cEpgGrid::getTimeString(void) {
return cString::sprintf("%s - %s", *(event->GetTimeString()), *(event->GetEndTimeString()));
}
void cEpgGrid::debug() {
esyslog("tvguide epggrid: %s: %s, %s, viewportHeight: %d px, Duration: %d min, active: %d",
column->Name(),
*(event->GetTimeString()),
event->Title(),
viewportHeight,
event->Duration()/60,
active);
}
#include "services/remotetimers.h"
#include "channelepg.h"
#include "tools.h"
#include "epggrid.h"
cEpgGrid::cEpgGrid(cChannelEpg *c, const cEvent *event) : cGridElement(c) {
this->event = event;
extText = new cTextWrapper();
hasTimer = false;
SetTimer();
hasSwitchTimer = false;
SetSwitchTimer();
dummy = false;
}
cEpgGrid::~cEpgGrid(void) {
delete extText;
}
void cEpgGrid::SetViewportHeight() {
int viewportHeightOld = viewportHeight;
if ( column->Start() > StartTime() ) {
viewportHeight = (min((int)EndTime(), column->Stop()) - column->Start()) /60;
} else if ( column->Stop() < EndTime() ) {
viewportHeight = (column->Stop() - StartTime()) /60;
if (viewportHeight < 0) viewportHeight = 0;
} else {
viewportHeight = Duration() / 60;
}
viewportHeight *= geoManager.minutePixel;
if (viewportHeight != viewportHeightOld)
dirty = true;
}
void cEpgGrid::PositionPixmap() {
if (config.displayMode == eVertical) {
int x0 = column->getX();
int y0 = geoManager.statusHeaderHeight + geoManager.channelHeaderHeight + geoManager.channelGroupsHeight;
if ( column->Start() < StartTime() ) {
y0 += (StartTime() - column->Start())/60*geoManager.minutePixel;
}
if (!pixmap) {
pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, geoManager.colWidth, viewportHeight),
cRect(0, 0, geoManager.colWidth, Duration()/60*geoManager.minutePixel));
} else {
pixmap->SetViewPort(cRect(x0, y0, geoManager.colWidth, viewportHeight));
}
} else if (config.displayMode == eHorizontal) {
int x0 = geoManager.channelHeaderWidth + geoManager.channelGroupsWidth;
int y0 = column->getY();
if ( column->Start() < StartTime() ) {
x0 += (StartTime() - column->Start())/60*geoManager.minutePixel;
}
if (!pixmap) {
pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, viewportHeight, geoManager.rowHeight),
cRect(0, 0, Duration()/60*geoManager.minutePixel, geoManager.rowHeight));
} else {
pixmap->SetViewPort(cRect(x0, y0, viewportHeight, geoManager.rowHeight ));
}
}
}
void cEpgGrid::SetTimer() {
hasTimer = false;
if (config.useRemoteTimers && pRemoteTimers) {
RemoteTimers_Event_v1_0 rt;
rt.event = event;
if (pRemoteTimers->Service("RemoteTimers::GetTimerByEvent-v1.0", &rt))
hasTimer = true;
#if VDRVERSNUM >= 20301
} else {
eTimerMatch TimerMatch = tmNone;
LOCK_TIMERS_READ;
const cTimers *timers = Timers;
if (timers->GetMatch(event, &TimerMatch) && (TimerMatch == tmFull))
hasTimer = true;
#else
} else if (column->HasTimer()) {
hasTimer = event->HasTimer();
#endif
}
}
void cEpgGrid::SetSwitchTimer() {
if (column->HasSwitchTimer()) {
hasSwitchTimer = SwitchTimers.EventInSwitchList(event);
} else {
hasSwitchTimer = false;
}
}
void cEpgGrid::setText() {
if (config.displayMode == eVertical) {
text->Set(event->Title(), fontManager.FontGrid, geoManager.colWidth - 2 * borderWidth);
extText->Set(event->ShortText(), fontManager.FontGridSmall, geoManager.colWidth - 2 * borderWidth);
}
if (config.showTimeInGrid) {
timeString = cString::sprintf("%s - %s:", *(event->GetTimeString()), *(event->GetEndTimeString()));
}
}
void cEpgGrid::drawText() {
tColor colorText = (active) ? theme.Color(clrFontActive) : theme.Color(clrFont);
tColor colorTextBack;
if (config.style == eStyleFlat)
colorTextBack = color;
else if (config.style == eStyleGraphical)
colorTextBack = (active) ? theme.Color(clrGridActiveFontBack) : theme.Color(clrGridFontBack);
else
colorTextBack = clrTransparent;
if (config.displayMode == eVertical) {
if (Height() / geoManager.minutePixel < 6)
return;
int textHeight = fontManager.FontGrid->Height();
int textHeightSmall = fontManager.FontGridSmall->Height();
int textLines = text->Lines();
int titleY = borderWidth;
if (config.showTimeInGrid) { // mit Zeitangabe im Grid
pixmap->DrawText(cPoint(borderWidth, borderWidth), *timeString, colorText, colorTextBack, fontManager.FontGridSmall);
titleY += textHeightSmall;
}
for (int i = 0; i < textLines; i++) {
pixmap->DrawText(cPoint(borderWidth, titleY + i * textHeight), text->GetLine(i), colorText, colorTextBack, fontManager.FontGrid);
}
int extTextLines = extText->Lines();
int offset = titleY + (textLines + 0.5) * textHeight;
if ((Height() - textHeightSmall - 10) > offset) {
for (int i = 0; i < extTextLines; i++) {
pixmap->DrawText(cPoint(borderWidth, offset + i * textHeightSmall), extText->GetLine(i), colorText, colorTextBack, fontManager.FontGridSmall);
}
}
} else if (config.displayMode == eHorizontal) {
if (Width() / geoManager.minutePixel < 10) {
int titleY = (geoManager.rowHeight - fontManager.FontGridHorizontal->Height()) / 2;
pixmap->DrawText(cPoint(borderWidth - 2, titleY), "...", colorText, colorTextBack, fontManager.FontGridHorizontal);
return;
}
cString strTitle = CutText(event->Title(), viewportHeight, fontManager.FontGridHorizontal).c_str();
int titleY = 0;
if (config.showTimeInGrid) { // mit Zeitangabe im Grid
pixmap->DrawText(cPoint(borderWidth, borderWidth), *timeString, colorText, colorTextBack, fontManager.FontGridHorizontalSmall);
titleY = fontManager.FontGridHorizontalSmall->Height() + (geoManager.rowHeight - fontManager.FontGridHorizontalSmall->Height() - fontManager.FontGridHorizontal->Height()) / 2;
} else {
titleY = (geoManager.rowHeight - fontManager.FontGridHorizontal->Height()) / 2;
}
pixmap->DrawText(cPoint(borderWidth, titleY), *strTitle, colorText, colorTextBack, fontManager.FontGridHorizontal);
}
if (hasSwitchTimer)
drawIcon("Switch", theme.Color(clrButtonYellow));
if (hasTimer) {
const cTimer *timer = NULL;
#if VDRVERSNUM >= 20301
{
LOCK_TIMERS_READ;
timer = Timers->GetMatch(event);
}
#else
timer = Timers.GetMatch(event);
#endif
if (timer)
#ifdef SWITCHONLYPATCH
if (timer->HasFlags(tfSwitchOnly))
drawIcon("Switch", theme.Color(clrButtonYellow));
else if (timer->HasFlags(tfActive))
#else /* SWITCHONLY */
if (timer->HasFlags(tfActive))
#endif /* SWITCHONLY */
drawIcon("REC", theme.Color(clrButtonRed));
else
drawIcon("REC", theme.Color(clrButtonGreen));
}
}
void cEpgGrid::drawIcon(cString iconText, tColor color) {
const cFont *font = (config.displayMode == eVertical)
?fontManager.FontGrid
:fontManager.FontGridHorizontalSmall;
int textWidth = font->Width(*iconText)+2*borderWidth;
int textHeight = font->Height()+10;
pixmap->DrawRectangle( cRect(Width() - textWidth - borderWidth, Height() - textHeight - borderWidth, textWidth, textHeight), color);
pixmap->DrawText(cPoint(Width() - textWidth, Height() - textHeight - borderWidth/2), *iconText, theme.Color(clrFont), color, font);
}
cString cEpgGrid::getTimeString(void) {
return cString::sprintf("%s - %s", *(event->GetTimeString()), *(event->GetEndTimeString()));
}
void cEpgGrid::debug() {
esyslog("tvguide epggrid: %s: %s, %s, viewportHeight: %d px, Duration: %d min, active: %d",
column->Name(),
*(event->GetTimeString()),
event->Title(),
viewportHeight,
event->Duration()/60,
active);
}

View File

@@ -1,33 +1,33 @@
#ifndef __TVGUIDE_EPGGRID_H
#define __TVGUIDE_EPGGRID_H
#include <vdr/epg.h>
#include "grid.h"
// --- cEpgGrid -------------------------------------------------------------
class cEpgGrid : public cGrid {
private:
const cTimer *timer;
const cEvent *event;
cTextWrapper *extText;
cString timeString;
void drawText();
void drawIcon(cString iconText, tColor color);
time_t Duration(void) { return event->Duration(); };
public:
cEpgGrid(cChannelColumn *c, const cEvent *event);
virtual ~cEpgGrid(void);
void SetViewportHeight();
void PositionPixmap();
void setText(void);
const cEvent *GetEvent() {return event;};
time_t StartTime() { return event->StartTime(); };
time_t EndTime() { return event->EndTime(); };
void SetTimer();
void SetSwitchTimer();
cString getTimeString(void);
void debug();
};
#endif //__TVGUIDE_EPGGRID_H
#ifndef __TVGUIDE_EPGGRID_H
#define __TVGUIDE_EPGGRID_H
#include <vdr/epg.h>
#include "gridelement.h"
// --- cEpgGrid -------------------------------------------------------------
class cEpgGrid : public cGridElement {
private:
const cTimer *timer;
const cEvent *event;
cTextWrapper *extText;
cString timeString;
void drawText();
void drawIcon(cString iconText, tColor color);
time_t Duration(void) { return event->Duration(); };
public:
cEpgGrid(cChannelEpg *c, const cEvent *event);
virtual ~cEpgGrid(void);
void SetViewportHeight();
void PositionPixmap();
void setText(void);
const cEvent *GetEvent() {return event;};
time_t StartTime() { return event->StartTime(); };
time_t EndTime() { return event->EndTime(); };
void SetTimer();
void SetSwitchTimer();
cString getTimeString(void);
void debug();
};
#endif //__TVGUIDE_EPGGRID_H

View File

@@ -1,96 +1,96 @@
#include "geometrymanager.h"
#include "config.h"
#include "fontmanager.h"
cFontManager::cFontManager() {
}
cFontManager::~cFontManager() {
DeleteFonts();
}
void cFontManager::SetFonts() {
InitialiseFontType();
//Common Fonts
FontButton = CreateFont(geoManager.footerHeight/3 + 4 + tvguideConfig.FontButtonDelta);
FontDetailView = CreateFont(geoManager.osdHeight/30 + tvguideConfig.FontDetailViewDelta);
FontDetailViewSmall = CreateFont(geoManager.osdHeight/40 + tvguideConfig.FontDetailViewSmallDelta);
FontDetailHeader = CreateFont(geoManager.osdHeight/27 + tvguideConfig.FontDetailHeaderDelta);
FontDetailHeaderLarge = CreateFont(geoManager.osdHeight/20 + tvguideConfig.FontDetailHeaderDelta);
FontMessageBox = CreateFont(geoManager.osdHeight/33 + tvguideConfig.FontMessageBoxDelta);
FontMessageBoxLarge = CreateFont(geoManager.osdHeight/30 + tvguideConfig.FontMessageBoxLargeDelta);
FontStatusHeader = CreateFont(geoManager.statusHeaderHeight/6 - 4 + tvguideConfig.FontStatusHeaderDelta);
FontStatusHeaderLarge = CreateFont(geoManager.statusHeaderHeight/5 + tvguideConfig.FontStatusHeaderLargeDelta);
//Fonts for vertical Display
FontChannelHeader = CreateFont(geoManager.colWidth/10 + tvguideConfig.FontChannelHeaderDelta);
FontChannelGroups = CreateFont(geoManager.colWidth/8 + tvguideConfig.FontChannelGroupsDelta);
FontGrid = CreateFont(geoManager.colWidth/12 + tvguideConfig.FontGridDelta);
FontGridSmall = CreateFont(geoManager.colWidth/12 + tvguideConfig.FontGridSmallDelta);
FontTimeLineWeekday = CreateFont(geoManager.timeLineWidth/3 + tvguideConfig.FontTimeLineWeekdayDelta);
FontTimeLineDate = CreateFont(geoManager.timeLineWidth/4 + tvguideConfig.FontTimeLineDateDelta);
FontTimeLineTime = CreateFont(geoManager.timeLineWidth/4 + tvguideConfig.FontTimeLineTimeDelta);
//Fonts for horizontal Display
FontChannelHeaderHorizontal = CreateFont(geoManager.rowHeight/3 + tvguideConfig.FontChannelHeaderHorizontalDelta);
FontChannelGroupsHorizontal = CreateFont(geoManager.rowHeight/3 + 5 + tvguideConfig.FontChannelGroupsHorizontalDelta);
FontGridHorizontal = CreateFont(geoManager.rowHeight/3 + 5 + tvguideConfig.FontGridHorizontalDelta);
FontGridHorizontalSmall = CreateFont(geoManager.rowHeight/4 + tvguideConfig.FontGridHorizontalSmallDelta);
FontTimeLineDateHorizontal = CreateFont(geoManager.timeLineHeight/2 + 5 + tvguideConfig.FontTimeLineDateHorizontalDelta);
FontTimeLineTimeHorizontal = CreateFont(geoManager.timeLineHeight/2 + tvguideConfig.FontTimeLineTimeHorizontalDelta);
//Fonts for RecMenu
FontRecMenuItem = CreateFont(geoManager.osdHeight/30 + tvguideConfig.FontRecMenuItemDelta);
FontRecMenuItemSmall = CreateFont(geoManager.osdHeight/40 + tvguideConfig.FontRecMenuItemSmallDelta);
FontRecMenuItemLarge = CreateFont(geoManager.osdHeight/25 + tvguideConfig.FontRecMenuItemLargeDelta);
}
void cFontManager::DeleteFonts() {
delete FontButton;
delete FontDetailView;
delete FontDetailViewSmall;
delete FontDetailHeader;
delete FontDetailHeaderLarge;
delete FontMessageBox;
delete FontMessageBoxLarge;
delete FontStatusHeader;
delete FontStatusHeaderLarge;
delete FontChannelHeader;
delete FontChannelGroups;
delete FontGrid;
delete FontGridSmall;
delete FontTimeLineWeekday;
delete FontTimeLineDate;
delete FontTimeLineTime;
delete FontChannelHeaderHorizontal;
delete FontChannelGroupsHorizontal;
delete FontGridHorizontal;
delete FontGridHorizontalSmall;
delete FontTimeLineDateHorizontal;
delete FontTimeLineTimeHorizontal;
delete FontRecMenuItem;
delete FontRecMenuItemSmall;
delete FontRecMenuItemLarge;
}
void cFontManager::InitialiseFontType(void) {
if (tvguideConfig.fontIndex == 0) {
fontName = tvguideConfig.fontNameDefault;
} else {
cStringList availableFonts;
cFont::GetAvailableFontNames(&availableFonts);
if (availableFonts[tvguideConfig.fontIndex-1]) {
fontName = availableFonts[tvguideConfig.fontIndex-1];
} else
fontName = tvguideConfig.fontNameDefault;
}
cFont *test = NULL;
test = cFont::CreateFont(*fontName, 30);
if (!test) {
fontName = DefaultFontSml;
}
delete test;
esyslog("tvguide: Set Font to %s", *fontName);
}
cFont *cFontManager::CreateFont(int size) {
return cFont::CreateFont(*fontName, size);
}
#include "geometrymanager.h"
#include "config.h"
#include "fontmanager.h"
cFontManager::cFontManager() {
}
cFontManager::~cFontManager() {
DeleteFonts();
}
void cFontManager::SetFonts() {
InitialiseFontType();
//Common Fonts
FontButton = CreateFont(geoManager.footerHeight/3 + 4 + config.FontButtonDelta);
FontDetailView = CreateFont(geoManager.osdHeight/30 + config.FontDetailViewDelta);
FontDetailViewSmall = CreateFont(geoManager.osdHeight/40 + config.FontDetailViewSmallDelta);
FontDetailHeader = CreateFont(geoManager.osdHeight/27 + config.FontDetailHeaderDelta);
FontDetailHeaderLarge = CreateFont(geoManager.osdHeight/20 + config.FontDetailHeaderDelta);
FontMessageBox = CreateFont(geoManager.osdHeight/33 + config.FontMessageBoxDelta);
FontMessageBoxLarge = CreateFont(geoManager.osdHeight/30 + config.FontMessageBoxLargeDelta);
FontStatusHeader = CreateFont(geoManager.statusHeaderHeight/6 - 4 + config.FontStatusHeaderDelta);
FontStatusHeaderLarge = CreateFont(geoManager.statusHeaderHeight/5 + config.FontStatusHeaderLargeDelta);
//Fonts for vertical Display
FontChannelHeader = CreateFont(geoManager.colWidth/10 + config.FontChannelHeaderDelta);
FontChannelGroups = CreateFont(geoManager.colWidth/8 + config.FontChannelGroupsDelta);
FontGrid = CreateFont(geoManager.colWidth/12 + config.FontGridDelta);
FontGridSmall = CreateFont(geoManager.colWidth/12 + config.FontGridSmallDelta);
FontTimeLineWeekday = CreateFont(geoManager.timeLineWidth/3 + config.FontTimeLineWeekdayDelta);
FontTimeLineDate = CreateFont(geoManager.timeLineWidth/4 + config.FontTimeLineDateDelta);
FontTimeLineTime = CreateFont(geoManager.timeLineWidth/4 + config.FontTimeLineTimeDelta);
//Fonts for horizontal Display
FontChannelHeaderHorizontal = CreateFont(geoManager.rowHeight/3 + config.FontChannelHeaderHorizontalDelta);
FontChannelGroupsHorizontal = CreateFont(geoManager.rowHeight/3 + 5 + config.FontChannelGroupsHorizontalDelta);
FontGridHorizontal = CreateFont(geoManager.rowHeight/3 + 5 + config.FontGridHorizontalDelta);
FontGridHorizontalSmall = CreateFont(geoManager.rowHeight/4 + config.FontGridHorizontalSmallDelta);
FontTimeLineDateHorizontal = CreateFont(geoManager.timeLineHeight/2 + 5 + config.FontTimeLineDateHorizontalDelta);
FontTimeLineTimeHorizontal = CreateFont(geoManager.timeLineHeight/2 + config.FontTimeLineTimeHorizontalDelta);
//Fonts for RecMenu
FontRecMenuItem = CreateFont(geoManager.osdHeight/30 + config.FontRecMenuItemDelta);
FontRecMenuItemSmall = CreateFont(geoManager.osdHeight/40 + config.FontRecMenuItemSmallDelta);
FontRecMenuItemLarge = CreateFont(geoManager.osdHeight/25 + config.FontRecMenuItemLargeDelta);
}
void cFontManager::DeleteFonts() {
delete FontButton;
delete FontDetailView;
delete FontDetailViewSmall;
delete FontDetailHeader;
delete FontDetailHeaderLarge;
delete FontMessageBox;
delete FontMessageBoxLarge;
delete FontStatusHeader;
delete FontStatusHeaderLarge;
delete FontChannelHeader;
delete FontChannelGroups;
delete FontGrid;
delete FontGridSmall;
delete FontTimeLineWeekday;
delete FontTimeLineDate;
delete FontTimeLineTime;
delete FontChannelHeaderHorizontal;
delete FontChannelGroupsHorizontal;
delete FontGridHorizontal;
delete FontGridHorizontalSmall;
delete FontTimeLineDateHorizontal;
delete FontTimeLineTimeHorizontal;
delete FontRecMenuItem;
delete FontRecMenuItemSmall;
delete FontRecMenuItemLarge;
}
void cFontManager::InitialiseFontType(void) {
if (config.fontIndex == 0) {
fontName = config.fontNameDefault;
} else {
cStringList availableFonts;
cFont::GetAvailableFontNames(&availableFonts);
if (availableFonts[config.fontIndex-1]) {
fontName = availableFonts[config.fontIndex-1];
} else
fontName = config.fontNameDefault;
}
cFont *test = NULL;
test = cFont::CreateFont(*fontName, 30);
if (!test) {
fontName = DefaultFontSml;
}
delete test;
esyslog("tvguide: Set Font to %s", *fontName);
}
cFont *cFontManager::CreateFont(int size) {
return cFont::CreateFont(*fontName, size);
}

View File

@@ -1,41 +1,41 @@
#ifndef __TVGUIDE_FONTMANAGER_H
#define __TVGUIDE_FONTMANAGER_H
#include <vdr/skins.h>
class cFontManager {
cString fontName;
void InitialiseFontType(void);
cFont *CreateFont(int size);
public:
cFontManager();
~cFontManager();
void SetFonts(void);
void DeleteFonts(void);
cFont *FontChannelHeader;
cFont *FontChannelHeaderHorizontal;
cFont *FontChannelGroups;
cFont *FontChannelGroupsHorizontal;
cFont *FontStatusHeader;
cFont *FontStatusHeaderLarge;
cFont *FontGrid;
cFont *FontGridSmall;
cFont *FontGridHorizontal;
cFont *FontGridHorizontalSmall;
cFont *FontTimeLineWeekday;
cFont *FontTimeLineDate;
cFont *FontTimeLineDateHorizontal;
cFont *FontTimeLineTime;
cFont *FontTimeLineTimeHorizontal;
cFont *FontButton;
cFont *FontDetailView;
cFont *FontDetailViewSmall;
cFont *FontDetailHeader;
cFont *FontDetailHeaderLarge;
cFont *FontMessageBox;
cFont *FontMessageBoxLarge;
cFont *FontRecMenuItem;
cFont *FontRecMenuItemSmall;
cFont *FontRecMenuItemLarge;
};
#endif //__TVGUIDE_FONTMANAGER_H
#ifndef __TVGUIDE_FONTMANAGER_H
#define __TVGUIDE_FONTMANAGER_H
#include <vdr/skins.h>
class cFontManager {
cString fontName;
void InitialiseFontType(void);
cFont *CreateFont(int size);
public:
cFontManager();
~cFontManager();
void SetFonts(void);
void DeleteFonts(void);
cFont *FontChannelHeader;
cFont *FontChannelHeaderHorizontal;
cFont *FontChannelGroups;
cFont *FontChannelGroupsHorizontal;
cFont *FontStatusHeader;
cFont *FontStatusHeaderLarge;
cFont *FontGrid;
cFont *FontGridSmall;
cFont *FontGridHorizontal;
cFont *FontGridHorizontalSmall;
cFont *FontTimeLineWeekday;
cFont *FontTimeLineDate;
cFont *FontTimeLineDateHorizontal;
cFont *FontTimeLineTime;
cFont *FontTimeLineTimeHorizontal;
cFont *FontButton;
cFont *FontDetailView;
cFont *FontDetailViewSmall;
cFont *FontDetailHeader;
cFont *FontDetailHeaderLarge;
cFont *FontMessageBox;
cFont *FontMessageBoxLarge;
cFont *FontRecMenuItem;
cFont *FontRecMenuItemSmall;
cFont *FontRecMenuItemLarge;
};
#endif //__TVGUIDE_FONTMANAGER_H

334
footer.c
View File

@@ -1,167 +1,167 @@
#include <string>
#include "imageloader.h"
#include "tools.h"
#include "footer.h"
cFooter::cFooter(cChannelGroups *channelGroups) {
this->channelGroups = channelGroups;
currentGroup = -1;
buttonY = (geoManager.footerHeight - geoManager.buttonHeight)/2;
SetButtonPositions();
footer = osdManager.requestPixmap(2, cRect( 0,
geoManager.footerY,
geoManager.osdWidth,
geoManager.footerHeight),
cRect::Null);
footer->Fill(clrTransparent);
}
cFooter::~cFooter(void) {
osdManager.releasePixmap(footer);
}
void cFooter::drawRedButton() {
cString text(tr("Search & Rec"));
DrawButton(*text, theme.Color(clrButtonRed), theme.Color(clrButtonRedBorder), oeButtonRed, positionButtons[0]);
}
void cFooter::drawGreenButton() {
cString text = cString::sprintf("%d %s", tvguideConfig.jumpChannels, tr("Channels back"));
DrawButton(*text, theme.Color(clrButtonGreen), theme.Color(clrButtonGreenBorder), oeButtonGreen, positionButtons[1]);
}
void cFooter::drawGreenButton(const char *text) {
std::string cuttedText = CutText(text, geoManager.buttonWidth-6, fontManager.FontButton);
DrawButton(cuttedText.c_str(), theme.Color(clrButtonGreen), theme.Color(clrButtonGreenBorder), oeButtonGreen, positionButtons[1]);
}
void cFooter::drawYellowButton() {
cString text = cString::sprintf("%d %s", tvguideConfig.jumpChannels, tr("Channels forward"));
DrawButton(*text, theme.Color(clrButtonYellow), theme.Color(clrButtonYellowBorder), oeButtonYellow, positionButtons[2]);
}
void cFooter::drawYellowButton(const char *text) {
std::string cuttedText = CutText(text, geoManager.buttonWidth-6, fontManager.FontButton);
DrawButton(cuttedText.c_str(), theme.Color(clrButtonYellow), theme.Color(clrButtonYellowBorder), oeButtonYellow, positionButtons[2]);
}
void cFooter::drawBlueButton(bool detailedEPG) {
cString text;
if (tvguideConfig.blueKeyMode == eBlueKeySwitch)
text = tr("Switch to Channel");
else if (tvguideConfig.blueKeyMode == eBlueKeyEPG) {
if (!detailedEPG)
text = tr("Detailed EPG");
else
text = tr("Close detailed EPG");
} else if (tvguideConfig.blueKeyMode == eBlueKeyFavorites) {
if (!detailedEPG)
text = tr("Favorites");
else
text = tr("Switch to Channel");
}
DrawButton(*text, theme.Color(clrButtonBlue), theme.Color(clrButtonBlueBorder), oeButtonBlue, positionButtons[3]);
}
void cFooter::UpdateGroupButtons(const cChannel *channel, bool force) {
if (!channel)
return;
int group = channelGroups->GetGroup(channel);
if ((group != currentGroup) || force) {
currentGroup = group;
drawGreenButton(channelGroups->GetPrev(group));
drawYellowButton(channelGroups->GetNext(group));
}
}
void cFooter::SetDetailedViewMode(bool fromRecMenu) {
ClearButton(positionButtons[1]);
ClearButton(positionButtons[2]);
if (fromRecMenu) {
ClearButton(positionButtons[0]);
ClearButton(positionButtons[3]);
} else if (tvguideConfig.blueKeyMode != eBlueKeySwitch) {
ClearButton(positionButtons[3]);
drawBlueButton(true);
}
}
void cFooter::LeaveDetailedViewMode(const cChannel *channel) {
drawRedButton();
drawBlueButton();
if (tvguideConfig.channelJumpMode == eNumJump) {
drawGreenButton();
drawYellowButton();
} else {
UpdateGroupButtons(channel, true);
}
}
void cFooter::SetButtonPositions(void) {
for (int i=0; i < 4; i++) {
positionButtons[i] = -1;
}
/*
red button = 0
green button = 1
yellow button = 2
blue button = 3
*/
for (int button=0; button<4; button++) {
if (Setup.ColorKey0 == button) {
positionButtons[button] = 0;
continue;
}
if (Setup.ColorKey1 == button) {
positionButtons[button] = 1;
continue;
}
if (Setup.ColorKey2 == button) {
positionButtons[button] = 2;
continue;
}
if (Setup.ColorKey3 == button) {
positionButtons[button] = 3;
continue;
}
}
}
void cFooter::DrawButton(const char *text, tColor color, tColor borderColor, eOsdElementType buttonType, int num) {
tColor colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent;
int left = num * geoManager.buttonWidth + (2 * num + 1) * geoManager.buttonBorder;
if ((tvguideConfig.style == eStyleBlendingMagick) || (tvguideConfig.style == eStyleBlendingDefault)) {
cImageLoader imgLoader;
imgLoader.DrawBackground(theme.Color(clrButtonBlend), color, geoManager.buttonWidth-4, geoManager.buttonHeight-4);
footer->DrawRectangle(cRect(left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight), borderColor);
footer->DrawImage(cPoint(left+2, buttonY+2), imgLoader.GetImage());
if (tvguideConfig.roundedCorners) {
int borderRadius = 12;
int borderWidth = 2;
DrawRoundedCorners(footer, left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight, borderRadius, borderWidth, borderColor);
}
} else if (tvguideConfig.style == eStyleGraphical) {
cImage *button = imgCache.GetOsdElement(buttonType);
if (button) {
footer->DrawImage(cPoint(left, buttonY), *button);
}
} else {
footer->DrawRectangle(cRect(left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight), borderColor);
footer->DrawRectangle(cRect(left+1, buttonY+1, geoManager.buttonWidth-2, geoManager.buttonHeight-2), color);
if (tvguideConfig.roundedCorners) {
int borderRadius = 12;
int borderWidth = 1;
DrawRoundedCorners(footer, left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight, borderRadius, borderWidth, borderColor);
}
}
int textWidth = fontManager.FontButton->Width(text);
int textHeight = fontManager.FontButton->Height();
footer->DrawText(cPoint(left + (geoManager.buttonWidth-textWidth)/2, buttonY + (geoManager.buttonHeight-textHeight)/2), text, theme.Color(clrFontButtons), colorTextBack, fontManager.FontButton);
}
void cFooter::ClearButton(int num) {
int left = num * geoManager.buttonWidth + (2 * num + 1) * geoManager.buttonBorder;
footer->DrawRectangle(cRect(left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight), clrTransparent);
}
#include <string>
#include "imageloader.h"
#include "tools.h"
#include "footer.h"
cFooter::cFooter(cChannelGroups *channelGroups) {
this->channelGroups = channelGroups;
currentGroup = -1;
buttonY = (geoManager.footerHeight - geoManager.buttonHeight)/2;
SetButtonPositions();
footer = osdManager.requestPixmap(2, cRect( 0,
geoManager.footerY,
geoManager.osdWidth,
geoManager.footerHeight),
cRect::Null);
footer->Fill(clrTransparent);
}
cFooter::~cFooter(void) {
osdManager.releasePixmap(footer);
}
void cFooter::drawRedButton() {
cString text(tr("Search & Rec"));
DrawButton(*text, theme.Color(clrButtonRed), theme.Color(clrButtonRedBorder), oeButtonRed, positionButtons[0]);
}
void cFooter::drawGreenButton() {
cString text = cString::sprintf("%d %s", config.jumpChannels, tr("Channels back"));
DrawButton(*text, theme.Color(clrButtonGreen), theme.Color(clrButtonGreenBorder), oeButtonGreen, positionButtons[1]);
}
void cFooter::drawGreenButton(const char *text) {
std::string cuttedText = CutText(text, geoManager.buttonWidth-6, fontManager.FontButton);
DrawButton(cuttedText.c_str(), theme.Color(clrButtonGreen), theme.Color(clrButtonGreenBorder), oeButtonGreen, positionButtons[1]);
}
void cFooter::drawYellowButton() {
cString text = cString::sprintf("%d %s", config.jumpChannels, tr("Channels forward"));
DrawButton(*text, theme.Color(clrButtonYellow), theme.Color(clrButtonYellowBorder), oeButtonYellow, positionButtons[2]);
}
void cFooter::drawYellowButton(const char *text) {
std::string cuttedText = CutText(text, geoManager.buttonWidth-6, fontManager.FontButton);
DrawButton(cuttedText.c_str(), theme.Color(clrButtonYellow), theme.Color(clrButtonYellowBorder), oeButtonYellow, positionButtons[2]);
}
void cFooter::drawBlueButton(bool detailedEPG) {
cString text;
if (config.blueKeyMode == eBlueKeySwitch)
text = tr("Switch to Channel");
else if (config.blueKeyMode == eBlueKeyEPG) {
if (!detailedEPG)
text = tr("Detailed EPG");
else
text = tr("Close detailed EPG");
} else if (config.blueKeyMode == eBlueKeyFavorites) {
if (!detailedEPG)
text = tr("Favorites");
else
text = tr("Switch to Channel");
}
DrawButton(*text, theme.Color(clrButtonBlue), theme.Color(clrButtonBlueBorder), oeButtonBlue, positionButtons[3]);
}
void cFooter::UpdateGroupButtons(const cChannel *channel, bool force) {
if (!channel)
return;
int group = channelGroups->GetGroup(channel);
if ((group != currentGroup) || force) {
currentGroup = group;
drawGreenButton(channelGroups->GetPrev(group));
drawYellowButton(channelGroups->GetNext(group));
}
}
void cFooter::SetDetailedViewMode(bool fromRecMenu) {
ClearButton(positionButtons[1]);
ClearButton(positionButtons[2]);
if (fromRecMenu) {
ClearButton(positionButtons[0]);
ClearButton(positionButtons[3]);
} else if (config.blueKeyMode != eBlueKeySwitch) {
ClearButton(positionButtons[3]);
drawBlueButton(true);
}
}
void cFooter::LeaveDetailedViewMode(const cChannel *channel) {
drawRedButton();
drawBlueButton();
if (config.channelJumpMode == eNumJump) {
drawGreenButton();
drawYellowButton();
} else {
UpdateGroupButtons(channel, true);
}
}
void cFooter::SetButtonPositions(void) {
for (int i=0; i < 4; i++) {
positionButtons[i] = -1;
}
/*
red button = 0
green button = 1
yellow button = 2
blue button = 3
*/
for (int button=0; button<4; button++) {
if (Setup.ColorKey0 == button) {
positionButtons[button] = 0;
continue;
}
if (Setup.ColorKey1 == button) {
positionButtons[button] = 1;
continue;
}
if (Setup.ColorKey2 == button) {
positionButtons[button] = 2;
continue;
}
if (Setup.ColorKey3 == button) {
positionButtons[button] = 3;
continue;
}
}
}
void cFooter::DrawButton(const char *text, tColor color, tColor borderColor, eOsdElementType buttonType, int num) {
tColor colorTextBack = (config.style == eStyleFlat)?color:clrTransparent;
int left = num * geoManager.buttonWidth + (2 * num + 1) * geoManager.buttonBorder;
if ((config.style == eStyleBlendingMagick) || (config.style == eStyleBlendingDefault)) {
cImageLoader imgLoader;
imgLoader.DrawBackground(theme.Color(clrButtonBlend), color, geoManager.buttonWidth-4, geoManager.buttonHeight-4);
footer->DrawRectangle(cRect(left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight), borderColor);
footer->DrawImage(cPoint(left+2, buttonY+2), imgLoader.GetImage());
if (config.roundedCorners) {
int borderRadius = 12;
int borderWidth = 2;
DrawRoundedCorners(footer, left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight, borderRadius, borderWidth, borderColor);
}
} else if (config.style == eStyleGraphical) {
cImage *button = imgCache.GetOsdElement(buttonType);
if (button) {
footer->DrawImage(cPoint(left, buttonY), *button);
}
} else {
footer->DrawRectangle(cRect(left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight), borderColor);
footer->DrawRectangle(cRect(left+1, buttonY+1, geoManager.buttonWidth-2, geoManager.buttonHeight-2), color);
if (config.roundedCorners) {
int borderRadius = 12;
int borderWidth = 1;
DrawRoundedCorners(footer, left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight, borderRadius, borderWidth, borderColor);
}
}
int textWidth = fontManager.FontButton->Width(text);
int textHeight = fontManager.FontButton->Height();
footer->DrawText(cPoint(left + (geoManager.buttonWidth-textWidth)/2, buttonY + (geoManager.buttonHeight-textHeight)/2), text, theme.Color(clrFontButtons), colorTextBack, fontManager.FontButton);
}
void cFooter::ClearButton(int num) {
int left = num * geoManager.buttonWidth + (2 * num + 1) * geoManager.buttonBorder;
footer->DrawRectangle(cRect(left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight), clrTransparent);
}

View File

@@ -30,4 +30,4 @@ public:
void LeaveDetailedViewMode(const cChannel *channel);
};
#endif //__TVGUIDE_FOOTER_H
#endif //__TVGUIDE_FOOTER_H

View File

@@ -1,74 +1,76 @@
#include <vdr/osd.h>
#include "config.h"
#include "geometrymanager.h"
cGeometryManager::cGeometryManager() {
osdWidth = 0;
osdHeight = 0;
}
cGeometryManager::~cGeometryManager() {
}
bool cGeometryManager::SetGeometry(int osdWidth, int osdHeight, bool force) {
if (!force && (this->osdWidth == osdWidth) && (this->osdHeight == osdHeight)) {
esyslog("tvgudie: GeoManager SetGeometry nothing to change");
return false;
}
this->osdWidth = osdWidth;
this->osdHeight = osdHeight;
esyslog("tvguide: Set OSD to %d x %d px", osdWidth, osdHeight);
statusHeaderHeight = (tvguideConfig.displayStatusHeader)?(tvguideConfig.headerHeightPercent * osdHeight / 100):0;
tvFrameWidth = statusHeaderHeight * 16 / 9;
headerContentWidth = (tvguideConfig.scaleVideo)?(osdWidth - tvFrameWidth):osdWidth;
channelGroupsWidth = (tvguideConfig.displayChannelGroups)?(tvguideConfig.channelGroupsPercent * osdWidth / 100):0;
channelGroupsHeight = (tvguideConfig.displayChannelGroups)?(tvguideConfig.channelGroupsPercent * osdHeight / 100):0;
channelHeaderWidth = tvguideConfig.channelHeaderWidthPercent * osdWidth / 100;
channelHeaderHeight = tvguideConfig.channelHeaderHeightPercent * osdHeight / 100;
timeLineWidth = tvguideConfig.timeLineWidthPercent * osdWidth / 100;
timeLineHeight = tvguideConfig.timeLineHeightPercent * osdHeight / 100;
clockWidth = tvFrameWidth / 3;
clockHeight = timeLineHeight;
footerHeight = tvguideConfig.footerHeightPercent * osdHeight / 100;
footerY = osdHeight - footerHeight;
if (tvguideConfig.displayMode == eVertical) {
colWidth = (osdWidth - timeLineWidth) / tvguideConfig.channelCols;
rowHeight = 0;
minutePixel = (osdHeight - statusHeaderHeight - channelGroupsHeight - channelHeaderHeight - footerHeight) / tvguideConfig.displayTime;
channelLogoWidth = colWidth;
channelLogoHeight = channelHeaderHeight;
logoWidth = channelLogoWidth/2 - 15;
logoHeight = logoWidth * tvguideConfig.logoHeightRatio / tvguideConfig.logoWidthRatio;
timeLineGridWidth = timeLineWidth;
timeLineGridHeight = minutePixel*30;
dateVieverWidth = timeLineWidth;
dateVieverHeight = channelHeaderHeight + channelGroupsHeight;
} else if (tvguideConfig.displayMode == eHorizontal) {
colWidth = 0;
rowHeight = (osdHeight - statusHeaderHeight - timeLineHeight - footerHeight) / tvguideConfig.channelRows;
minutePixel = (osdWidth - channelHeaderWidth - channelGroupsWidth) / tvguideConfig.displayTime;
channelLogoWidth = channelHeaderWidth;
channelLogoHeight = rowHeight;
logoWidth = channelLogoHeight * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio;
logoHeight = channelLogoHeight;
timeLineGridWidth = geoManager.minutePixel*30;
timeLineGridHeight = geoManager.timeLineHeight;
dateVieverWidth = channelHeaderWidth + channelGroupsWidth;
dateVieverHeight = timeLineHeight;
}
buttonBorder = footerHeight / 6;
buttonWidth = osdWidth / 4 - 2 * buttonBorder;
buttonHeight = footerHeight - 3 * buttonBorder;
epgViewHeaderHeight = tvguideConfig.headerHeightPercent * osdHeight / 100;
borderRecMenus = 10;
channelJumpWidth = osdWidth * 30 / 100;
channelJumpHeight = osdHeight * 20 / 100;
return true;
}
#include <vdr/osd.h>
#include "config.h"
#include "geometrymanager.h"
cGeometryManager::cGeometryManager() {
osdWidth = 0;
osdHeight = 0;
}
cGeometryManager::~cGeometryManager() {
}
bool cGeometryManager::SetGeometry(int osdWidth, int osdHeight, bool force) {
if (!force && (this->osdWidth == osdWidth) && (this->osdHeight == osdHeight)) {
esyslog("tvgudie: GeoManager SetGeometry nothing to change");
return false;
}
this->osdWidth = osdWidth;
this->osdHeight = osdHeight;
esyslog("tvguide: Set OSD to %d x %d px", osdWidth, osdHeight);
statusHeaderHeight = (config.displayStatusHeader) ? (config.headerHeightPercent * osdHeight / 100):0;
tvFrameWidth = statusHeaderHeight * 16 / 9;
headerContentWidth = (config.scaleVideo) ? (osdWidth - tvFrameWidth):osdWidth;
channelGroupsWidth = (config.displayChannelGroups) ? (config.channelGroupsPercent * osdWidth / 100):0;
channelGroupsHeight = (config.displayChannelGroups) ? (config.channelGroupsPercent * osdHeight / 100):0;
channelHeaderWidth = config.channelHeaderWidthPercent * osdWidth / 100;
channelHeaderHeight = config.channelHeaderHeightPercent * osdHeight / 100;
timeLineWidth = config.timeLineWidthPercent * osdWidth / 100;
timeLineHeight = config.timeLineHeightPercent * osdHeight / 100;
footerHeight = config.footerHeightPercent * osdHeight / 100;
footerY = osdHeight - footerHeight;
if (config.displayMode == eVertical) {
colWidth = (osdWidth - timeLineWidth) / config.channelCols;
rowHeight = 0;
minutePixel = (osdHeight - statusHeaderHeight - channelGroupsHeight - channelHeaderHeight - footerHeight) / config.displayTime;
channelLogoWidth = colWidth;
channelLogoHeight = channelHeaderHeight;
logoWidth = channelLogoWidth / 2 - 15;
logoHeight = logoWidth * config.logoHeightRatio / config.logoWidthRatio;
timeLineGridWidth = timeLineWidth;
timeLineGridHeight = minutePixel * 30;
dateVieverWidth = timeLineWidth;
dateVieverHeight = (channelHeaderHeight + channelGroupsHeight) * 2 / 3;
clockWidth = dateVieverWidth;
clockHeight = (channelHeaderHeight + channelGroupsHeight) - dateVieverHeight;
} else if (config.displayMode == eHorizontal) {
colWidth = 0;
rowHeight = (osdHeight - statusHeaderHeight - timeLineHeight - footerHeight) / config.channelRows;
minutePixel = (osdWidth - channelHeaderWidth - channelGroupsWidth) / config.displayHorizontalTime;
channelLogoWidth = channelHeaderWidth;
channelLogoHeight = rowHeight;
logoWidth = channelLogoHeight * config.logoWidthRatio / config.logoHeightRatio;
logoHeight = channelLogoHeight;
timeLineGridWidth = geoManager.minutePixel * 30;
timeLineGridHeight = geoManager.timeLineHeight;
dateVieverWidth = (channelHeaderWidth + channelGroupsWidth) * 3 / 5;
dateVieverHeight = timeLineHeight;
clockWidth = (channelHeaderWidth + channelGroupsWidth) - dateVieverWidth;
clockHeight = timeLineHeight;
}
buttonBorder = footerHeight / 6;
buttonWidth = osdWidth / 4 - 2 * buttonBorder;
buttonHeight = footerHeight - 3 * buttonBorder;
epgViewHeaderHeight = config.headerHeightPercent * osdHeight / 100;
borderRecMenus = 10;
channelJumpWidth = osdWidth * 30 / 100;
channelJumpHeight = osdHeight * 20 / 100;
return true;
}

View File

@@ -1,54 +1,54 @@
#ifndef __TVGUIDE_GEOMETRYMANAGER_H
#define __TVGUIDE_GEOMETRYMANAGER_H
class cGeometryManager {
private:
public:
cGeometryManager(void);
~cGeometryManager();
bool SetGeometry(int osdWidth, int osdHeight, bool force = false);
//Common
int osdWidth;
int osdHeight;
int statusHeaderHeight;
int tvFrameWidth;
int headerContentWidth;
//ChannelGroups
int channelGroupsWidth;
int channelGroupsHeight;
//ContentHeader
int channelHeaderWidth;
int channelHeaderHeight;
int logoWidth;
int logoHeight;
//Content
int colWidth;
int rowHeight;
int minutePixel;
int channelLogoWidth;
int channelLogoHeight;
//Timeline
int timeLineWidth;
int timeLineHeight;
int timeLineGridWidth;
int timeLineGridHeight;
int dateVieverWidth;
int dateVieverHeight;
int clockWidth;
int clockHeight;
//Footer
int footerY;
int footerHeight;
int buttonWidth;
int buttonHeight;
int buttonBorder;
//Detailed EPG View
int epgViewHeaderHeight;
//Recording Menus
int borderRecMenus;
//Channel Jump
int channelJumpWidth;
int channelJumpHeight;
};
#endif //__TVGUIDE_GEOMETRYMANAGER_H
#ifndef __TVGUIDE_GEOMETRYMANAGER_H
#define __TVGUIDE_GEOMETRYMANAGER_H
class cGeometryManager {
private:
public:
cGeometryManager(void);
~cGeometryManager();
bool SetGeometry(int osdWidth, int osdHeight, bool force = false);
//Common
int osdWidth;
int osdHeight;
int statusHeaderHeight;
int tvFrameWidth;
int headerContentWidth;
//ChannelGroups
int channelGroupsWidth;
int channelGroupsHeight;
//ContentHeader
int channelHeaderWidth;
int channelHeaderHeight;
int logoWidth;
int logoHeight;
//Content
int colWidth;
int rowHeight;
int minutePixel;
int channelLogoWidth;
int channelLogoHeight;
//Timeline
int timeLineWidth;
int timeLineHeight;
int timeLineGridWidth;
int timeLineGridHeight;
int dateVieverWidth;
int dateVieverHeight;
int clockWidth;
int clockHeight;
//Footer
int footerY;
int footerHeight;
int buttonWidth;
int buttonHeight;
int buttonBorder;
//Detailed EPG View
int epgViewHeaderHeight;
//Recording Menus
int borderRecMenus;
//Channel Jump
int channelJumpWidth;
int channelJumpHeight;
};
#endif //__TVGUIDE_GEOMETRYMANAGER_H

View File

@@ -1,82 +1,82 @@
#include "channelcolumn.h"
#include "grid.h"
cGrid::cGrid(cChannelColumn *c) {
this->column = c;
text = new cTextWrapper();
dirty = true;
active = false;
viewportHeight = 0;
borderWidth = 10;
}
cGrid::~cGrid(void) {
delete text;
}
void cGrid::setBackground() {
if (active) {
color = theme.Color(clrHighlight);
colorBlending = theme.Color(clrHighlightBlending);
} else {
if (isColor1) {
color = theme.Color(clrGrid1);
colorBlending = theme.Color(clrGrid1Blending);
} else {
color = theme.Color(clrGrid2);
colorBlending = theme.Color(clrGrid2Blending);
}
}
}
void cGrid::Draw() {
if (!pixmap) {
return;
}
if (dirty) {
if (tvguideConfig.style == eStyleGraphical) {
drawBackgroundGraphical(bgGrid, active);
drawText();
} else {
setBackground();
drawBackground();
drawText();
drawBorder();
}
pixmap->SetLayer(1);
dirty = false;
}
}
bool cGrid::isFirst(void) {
if (column->isFirst(this))
return true;
return false;
}
bool cGrid::Match(time_t t) {
if ((StartTime() < t) && (EndTime() > t))
return true;
else
return false;
}
int cGrid::calcOverlap(cGrid *neighbor) {
int overlap = 0;
if (intersects(neighbor)) {
if ((StartTime() <= neighbor->StartTime()) && (EndTime() <= neighbor->EndTime())) {
overlap = EndTime() - neighbor->StartTime();
} else if ((StartTime() >= neighbor->StartTime()) && (EndTime() >= neighbor->EndTime())) {
overlap = neighbor->EndTime() - StartTime();
} else if ((StartTime() >= neighbor->StartTime()) && (EndTime() <= neighbor->EndTime())) {
overlap = Duration();
} else if ((StartTime() <= neighbor->StartTime()) && (EndTime() >= neighbor->EndTime())) {
overlap = neighbor->EndTime() - neighbor->StartTime();
}
}
return overlap;
}
bool cGrid::intersects(cGrid *neighbor) {
return ! ( (neighbor->EndTime() <= StartTime()) || (neighbor->StartTime() >= EndTime()) );
}
#include "channelepg.h"
#include "gridelement.h"
cGridElement::cGridElement(cChannelEpg *c) {
this->column = c;
text = new cTextWrapper();
dirty = true;
active = false;
viewportHeight = 0;
borderWidth = 10;
}
cGridElement::~cGridElement(void) {
delete text;
}
void cGridElement::setBackground() {
if (active) {
color = theme.Color(clrHighlight);
colorBlending = theme.Color(clrHighlightBlending);
} else {
if (isColor1) {
color = theme.Color(clrGrid1);
colorBlending = theme.Color(clrGrid1Blending);
} else {
color = theme.Color(clrGrid2);
colorBlending = theme.Color(clrGrid2Blending);
}
}
}
void cGridElement::Draw() {
if (!pixmap) {
return;
}
if (dirty) {
if (config.style == eStyleGraphical) {
drawBackgroundGraphical(bgGrid, active);
drawText();
} else {
setBackground();
drawBackground();
drawText();
drawBorder();
}
pixmap->SetLayer(1);
dirty = false;
}
}
bool cGridElement::isFirst(void) {
if (column->isFirst(this))
return true;
return false;
}
bool cGridElement::Match(time_t t) {
if ((StartTime() < t) && (EndTime() > t))
return true;
else
return false;
}
int cGridElement::calcOverlap(cGridElement *neighbor) {
int overlap = 0;
if (intersects(neighbor)) {
if ((StartTime() <= neighbor->StartTime()) && (EndTime() <= neighbor->EndTime())) {
overlap = EndTime() - neighbor->StartTime();
} else if ((StartTime() >= neighbor->StartTime()) && (EndTime() >= neighbor->EndTime())) {
overlap = neighbor->EndTime() - StartTime();
} else if ((StartTime() >= neighbor->StartTime()) && (EndTime() <= neighbor->EndTime())) {
overlap = Duration();
} else if ((StartTime() <= neighbor->StartTime()) && (EndTime() >= neighbor->EndTime())) {
overlap = neighbor->EndTime() - neighbor->StartTime();
}
}
return overlap;
}
bool cGridElement::intersects(cGridElement *neighbor) {
return ! ( (neighbor->EndTime() <= StartTime()) || (neighbor->StartTime() >= EndTime()) );
}

View File

@@ -1,58 +1,58 @@
#ifndef __TVGUIDE_GRID_H
#define __TVGUIDE_GRID_H
#include <vdr/tools.h>
#include "styledpixmap.h"
class cChannelColumn;
// --- cEpgGrid -------------------------------------------------------------
class cGrid : public cListObject, public cStyledPixmap {
protected:
cTextWrapper *text;
int viewportHeight;
int borderWidth;
void setBackground();
bool isColor1;
bool active;
bool dirty;
bool hasTimer;
bool hasSwitchTimer;
bool intersects(cGrid *neighbor);
virtual time_t Duration(void) { return 0; };
virtual void drawText(void) {};
bool dummy;
public:
cGrid(cChannelColumn *c);
virtual ~cGrid(void);
cChannelColumn *column;
virtual void SetViewportHeight(void) {};
virtual void PositionPixmap(void) {};
virtual void setText(void) {};
void Draw(void);
void SetDirty(void) {dirty = true;};
void SetActive(void) {dirty = true; active = true;};
void SetInActive(void) {dirty = true; active = false;};
void SetColor(bool color) {isColor1 = color;};
bool IsColor1(void) {return isColor1;};
bool isFirst(void);
virtual const cEvent *GetEvent(void) { return NULL; };
bool Match(time_t t);
virtual time_t StartTime(void) { return 0; };
virtual time_t EndTime(void) { return 0; };
virtual void SetStartTime(time_t start) {};
virtual void SetEndTime(time_t end) {};
int calcOverlap(cGrid *neighbor);
virtual void SetTimer(void) {};
virtual void SetSwitchTimer(void) {};
virtual cString getText(void) { return cString("");};
virtual cString getTimeString(void) { return cString("");};
bool Active(void) { return active; };
bool HasTimer(void) {return hasTimer;};
bool HasSwitchTimer(void) {return hasSwitchTimer;};
bool isDummy(void) { return dummy; };
virtual void debug() {};
};
#endif //__TVGUIDE_GRID_H
#ifndef __TVGUIDE_GRID_H
#define __TVGUIDE_GRID_H
#include <vdr/tools.h>
#include "styledpixmap.h"
class cChannelEpg;
// --- cEpgGrid -------------------------------------------------------------
class cGridElement : public cListObject, public cStyledPixmap {
protected:
cTextWrapper *text;
int viewportHeight;
int borderWidth;
void setBackground();
bool isColor1;
bool active;
bool dirty;
bool hasTimer;
bool hasSwitchTimer;
bool intersects(cGridElement *neighbor);
virtual time_t Duration(void) { return 0; };
virtual void drawText(void) {};
bool dummy;
public:
cGridElement(cChannelEpg *c);
virtual ~cGridElement(void);
cChannelEpg *column;
virtual void SetViewportHeight(void) {};
virtual void PositionPixmap(void) {};
virtual void setText(void) {};
void Draw(void);
void SetDirty(void) {dirty = true;};
void SetActive(void) {dirty = true; active = true;};
void SetInActive(void) {dirty = true; active = false;};
void SetColor(bool color) {isColor1 = color;};
bool IsColor1(void) {return isColor1;};
bool isFirst(void);
virtual const cEvent *GetEvent(void) { return NULL; };
bool Match(time_t t);
virtual time_t StartTime(void) { return 0; };
virtual time_t EndTime(void) { return 0; };
virtual void SetStartTime(time_t start) {};
virtual void SetEndTime(time_t end) {};
int calcOverlap(cGridElement *neighbor);
virtual void SetTimer(void) {};
virtual void SetSwitchTimer(void) {};
virtual cString getText(void) { return cString("");};
virtual cString getTimeString(void) { return cString("");};
bool Active(void) { return active; };
bool HasTimer(void) {return hasTimer;};
bool HasSwitchTimer(void) {return hasSwitchTimer;};
bool isDummy(void) { return dummy; };
virtual void debug() {};
};
#endif //__TVGUIDE_GRID_H

View File

@@ -1,135 +1,134 @@
#include "imageloader.h"
#include "tools.h"
#include "headergrid.h"
cHeaderGrid::cHeaderGrid(void) : cGrid(NULL) {
pixmap = NULL;
pixmapLogo = NULL;
}
cHeaderGrid::~cHeaderGrid(void) {
osdManager.releasePixmap(pixmapLogo);
}
void cHeaderGrid::createBackground(int num) {
color = theme.Color(clrHeader);
colorBlending = theme.Color(clrHeaderBlending);
int x, y;
if (tvguideConfig.displayMode == eVertical) {
x = geoManager.timeLineWidth + num*geoManager.colWidth;
y = geoManager.statusHeaderHeight + geoManager.channelGroupsHeight;
} else if (tvguideConfig.displayMode == eHorizontal) {
x = geoManager.channelGroupsWidth;
y = geoManager.statusHeaderHeight + geoManager.timeLineHeight + num*geoManager.rowHeight;
}
pixmap = osdManager.requestPixmap(1, cRect(x, y, geoManager.channelLogoWidth, geoManager.channelLogoHeight));
pixmapLogo = osdManager.requestPixmap(2, cRect(x, y, geoManager.channelLogoWidth, geoManager.channelLogoHeight));
if ((!pixmap) || (!pixmapLogo)){
return;
}
pixmapLogo->Fill(clrTransparent);
if (tvguideConfig.style == eStyleGraphical) {
drawBackgroundGraphical(bgChannelHeader);
} else {
drawBackground();
drawBorder();
}
}
void cHeaderGrid::drawChannel(const cChannel *channel) {
if (tvguideConfig.displayMode == eVertical) {
drawChannelVertical(channel);
} else if (tvguideConfig.displayMode == eHorizontal) {
drawChannelHorizontal(channel);
}
}
// Draw Channel horizontal view
void cHeaderGrid::drawChannelHorizontal(const cChannel *channel) {
int logoWidth = geoManager.logoWidth;
int logoX = tvguideConfig.displayChannelName ? 5 : (Width() - logoWidth) / 2;
int textX = 5;
int textY = (Height() - fontManager.FontChannelHeaderHorizontal->Height()) / 2;
bool logoFound = false;
if (!tvguideConfig.hideChannelLogos) {
cImage *logo = imgCache.GetLogo(channel);
if (logo) {
const int logoheight = logo->Height();
pixmapLogo->DrawImage(cPoint(logoX, (Height() - logoheight) / 2), *logo);
logoFound = true;
}
}
bool drawText = false;
int textWidthMax = Width() - 10;
if (!logoFound) {
drawText = true;
}
if (tvguideConfig.displayChannelName) {
drawText = true;
textX += logoWidth + 5;
textWidthMax -= textX;
}
if (drawText) {
tColor colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent;
cString strChannel = cString::sprintf("%d %s", channel->Number(), channel->Name());
strChannel = CutText(*strChannel, textWidthMax, fontManager.FontChannelHeaderHorizontal).c_str();
pixmap->DrawText(cPoint(textX, textY), *strChannel, theme.Color(clrFontHeader), colorTextBack, fontManager.FontChannelHeaderHorizontal);
}
}
// Draw Channel vertical view
void cHeaderGrid::drawChannelVertical(const cChannel *channel) {
int logoWidth = geoManager.logoWidth;
int logoHeight = geoManager.logoHeight;
cTextWrapper tw;
cString headerText = cString::sprintf("%d - %s", channel->Number(), channel->Name());
tw.Set(*headerText, fontManager.FontChannelHeader, geoManager.colWidth - 8);
int lines = tw.Lines();
int lineHeight = fontManager.FontChannelHeader->Height();
int yStart = (geoManager.channelHeaderHeight - lines*lineHeight)/2 + 8;
bool logoFound = false;
if (!tvguideConfig.hideChannelLogos) {
cImage *logo = imgCache.GetLogo(channel);
if (logo) {
const int logoheight = logo->Height();
pixmapLogo->DrawImage(cPoint((Width() - logoWidth) / 2, (geoManager.channelHeaderHeight - lineHeight - logoheight) / 2), *logo);
logoFound = true;
}
}
bool drawText = false;
if (!logoFound) {
drawText = true;
} else if (tvguideConfig.displayChannelName) {
drawText = true;
yStart = logoHeight;
}
if (!drawText)
return;
tColor colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent;
for (int i=0; i<lines; i++) {
int textWidth = fontManager.FontChannelHeader->Width(tw.GetLine(i));
int xText = (geoManager.colWidth - textWidth) / 2;
if (xText < 0)
xText = 0;
pixmap->DrawText(cPoint(xText, yStart + i*lineHeight), tw.GetLine(i), theme.Color(clrFontHeader), colorTextBack, fontManager.FontChannelHeader);
}
}
void cHeaderGrid::setPosition(int num) {
int x, y, width, height;
if (tvguideConfig.displayMode == eVertical) {
x = geoManager.timeLineWidth + num*geoManager.colWidth;
y = geoManager.statusHeaderHeight + geoManager.channelGroupsHeight;
width = geoManager.colWidth;
height = geoManager.channelHeaderHeight;
} else if (tvguideConfig.displayMode == eHorizontal) {
x = geoManager.channelGroupsWidth;
y = geoManager.statusHeaderHeight + geoManager.timeLineHeight + num*geoManager.rowHeight;
width = geoManager.channelHeaderWidth;
height = geoManager.rowHeight;
}
pixmap->SetViewPort(cRect(x, y, width, height));
pixmapLogo->SetViewPort(cRect(x, y, width, height));
}
#include "imageloader.h"
#include "tools.h"
#include "headergrid.h"
cHeaderGrid::cHeaderGrid(void) : cGridElement(NULL) {
pixmap = NULL;
pixmapLogo = NULL;
}
cHeaderGrid::~cHeaderGrid(void) {
osdManager.releasePixmap(pixmapLogo);
}
void cHeaderGrid::createBackground(int num) {
color = theme.Color(clrHeader);
colorBlending = theme.Color(clrHeaderBlending);
int x, y;
if (config.displayMode == eVertical) {
x = geoManager.timeLineWidth + num*geoManager.colWidth;
y = geoManager.statusHeaderHeight + geoManager.channelGroupsHeight;
} else if (config.displayMode == eHorizontal) {
x = geoManager.channelGroupsWidth;
y = geoManager.statusHeaderHeight + geoManager.timeLineHeight + num*geoManager.rowHeight;
}
pixmap = osdManager.requestPixmap(1, cRect(x, y, geoManager.channelLogoWidth, geoManager.channelLogoHeight));
pixmapLogo = osdManager.requestPixmap(2, cRect(x, y, geoManager.channelLogoWidth, geoManager.channelLogoHeight));
if ((!pixmap) || (!pixmapLogo)){
return;
}
pixmapLogo->Fill(clrTransparent);
if (config.style == eStyleGraphical) {
drawBackgroundGraphical(bgChannelHeader);
} else {
drawBackground();
drawBorder();
}
}
void cHeaderGrid::drawChannel(const cChannel *channel) {
if (config.displayMode == eVertical) {
drawChannelVertical(channel);
} else if (config.displayMode == eHorizontal) {
drawChannelHorizontal(channel);
}
}
// Draw Channel horizontal view
void cHeaderGrid::drawChannelHorizontal(const cChannel *channel) {
int logoWidth = geoManager.logoWidth;
int logoX = config.displayChannelName ? 5 : (Width() - logoWidth) / 2;
int textX = 5;
int textY = (Height() - fontManager.FontChannelHeaderHorizontal->Height()) / 2;
bool logoFound = false;
if (!config.hideChannelLogos) {
cImage *logo = imgCache.GetLogo(channel);
if (logo) {
const int logoheight = logo->Height();
pixmapLogo->DrawImage(cPoint(logoX, (Height() - logoheight) / 2), *logo);
logoFound = true;
}
}
bool drawText = false;
int textWidthMax = Width() - 10;
if (!logoFound) {
drawText = true;
}
if (config.displayChannelName) {
drawText = true;
textX += logoWidth + 5;
textWidthMax -= textX;
}
if (drawText) {
tColor colorTextBack = (config.style == eStyleFlat)?color:clrTransparent;
cString strChannel = cString::sprintf("%d %s", channel->Number(), channel->Name());
strChannel = CutText(*strChannel, textWidthMax, fontManager.FontChannelHeaderHorizontal).c_str();
pixmap->DrawText(cPoint(textX, textY), *strChannel, theme.Color(clrFontHeader), colorTextBack, fontManager.FontChannelHeaderHorizontal);
}
}
// Draw Channel vertical view
void cHeaderGrid::drawChannelVertical(const cChannel *channel) {
int logoWidth = geoManager.logoWidth;
int logoHeight = geoManager.logoHeight;
cTextWrapper tw;
cString headerText = cString::sprintf("%d - %s", channel->Number(), channel->Name());
tw.Set(*headerText, fontManager.FontChannelHeader, geoManager.colWidth - 8);
int lines = tw.Lines();
int lineHeight = fontManager.FontChannelHeader->Height();
int yStart = (geoManager.channelHeaderHeight - lines * lineHeight) / 2 + 8;
bool logoFound = false;
if (!config.hideChannelLogos) {
cImage *logo = imgCache.GetLogo(channel);
if (logo) {
pixmapLogo->DrawImage(cPoint((Width() - logoWidth) / 2, 6), *logo);
logoFound = true;
}
}
bool drawText = false;
if (!logoFound) {
drawText = true;
} else if (config.displayChannelName) {
drawText = true;
yStart = logoHeight;
}
if (!drawText)
return;
tColor colorTextBack = (config.style == eStyleFlat)?color:clrTransparent;
for (int i = 0; i < lines; i++) {
int textWidth = fontManager.FontChannelHeader->Width(tw.GetLine(i));
int xText = (geoManager.colWidth - textWidth) / 2;
if (xText < 0)
xText = 0;
pixmap->DrawText(cPoint(xText, yStart + i * lineHeight), tw.GetLine(i), theme.Color(clrFontHeader), colorTextBack, fontManager.FontChannelHeader);
}
}
void cHeaderGrid::setPosition(int num) {
int x, y, width, height;
if (config.displayMode == eVertical) {
x = geoManager.timeLineWidth + num*geoManager.colWidth;
y = geoManager.statusHeaderHeight + geoManager.channelGroupsHeight;
width = geoManager.colWidth;
height = geoManager.channelHeaderHeight;
} else if (config.displayMode == eHorizontal) {
x = geoManager.channelGroupsWidth;
y = geoManager.statusHeaderHeight + geoManager.timeLineHeight + num*geoManager.rowHeight;
width = geoManager.channelHeaderWidth;
height = geoManager.rowHeight;
}
pixmap->SetViewPort(cRect(x, y, width, height));
pixmapLogo->SetViewPort(cRect(x, y, width, height));
}

View File

@@ -1,21 +1,21 @@
#ifndef __TVGUIDE_HEADERGRID_H
#define __TVGUIDE_HEADERGRID_H
#include "grid.h"
// --- cHeaderGrid -------------------------------------------------------------
class cHeaderGrid : public cGrid {
private:
cPixmap *pixmapLogo;
void drawChannelHorizontal(const cChannel *channel);
void drawChannelVertical(const cChannel *channel);
public:
cHeaderGrid(void);
virtual ~cHeaderGrid(void);
void createBackground(int num);
void drawChannel(const cChannel *channel);
void setPosition(int num);
};
#endif //__TVGUIDE_HEADERGRID_H
#ifndef __TVGUIDE_HEADERGRID_H
#define __TVGUIDE_HEADERGRID_H
#include "gridelement.h"
// --- cHeaderGrid -------------------------------------------------------------
class cHeaderGrid : public cGridElement {
private:
cPixmap *pixmapLogo;
void drawChannelHorizontal(const cChannel *channel);
void drawChannelVertical(const cChannel *channel);
public:
cHeaderGrid(void);
virtual ~cHeaderGrid(void);
void createBackground(int num);
void drawChannel(const cChannel *channel);
void setPosition(int num);
};
#endif //__TVGUIDE_HEADERGRID_H

File diff suppressed because it is too large Load Diff

View File

@@ -1,92 +1,92 @@
#ifndef __TVGUIDE_IMAGECACHE_H
#define __TVGUIDE_IMAGECACHE_H
#define X_DISPLAY_MISSING
#include <map>
#include <vector>
#include "imagemagickwrapper.h"
enum eCacheType {
ctOsdElement = 0,
ctGrid,
ctLogo,
ctChannelGroup,
ctIcon,
};
enum eOsdElementType {
oeNone = -1,
oeStatusHeaderContentFull,
oeStatusHeaderContentWindowed,
oeStatusHeaderTVFrame,
oeButtonRed,
oeButtonGreen,
oeButtonYellow,
oeButtonBlue,
oeLogoBack,
oeTimeline1,
oeTimeline2,
oeDateViewer,
oeClock,
oeChannelJump,
};
class cImageCache : public cImageMagickWrapper {
public:
cImageCache();
~cImageCache();
void CreateCache(void);
cImage *GetOsdElement(eOsdElementType type);
cImage *GetGrid(int width, int height, bool active);
cImage *GetChannelGroup(int width, int height);
cImage *GetLogo(const cChannel *channel);
cImage *GetIcon(std::string name, int width, int height);
std::string GetCacheSize(eCacheType type);
void Clear(void);
private:
cImage *tempStaticLogo;
Image bufferGrid;
Image bufferGridActive;
bool gridsAvailable;
int cornerWidth;
int cornerHeight;
cImage *imgLeft;
cImage *imgLeftActive;
cImage *imgRight;
cImage *imgRightActive;
cImage *imgHead;
cImage *imgHeadActive;
cImage *imgBottom;
cImage *imgBottomActive;
cImage *imgChannelgroupHead;
cImage *imgChannelgroupBottom;
cImage *groupsHead;
cImage *groupsBottom;
cImage *groupsLeft;
cImage *groupsRight;
std::map<eOsdElementType, cImage*> osdElementCache;
std::map<std::string, cImage*> gridCache;
std::map<std::string, cImage*> groupsCache;
std::map<std::string, cImage*> logoCache;
std::map<std::string, cImage*> iconCache;
void CreateOsdIconCache(void);
void PrepareGridIconCache(void);
void CreateGridIconCache(void);
void CreateChannelGroupCache(void);
void CreateLogoCache(void);
bool LoadIcon(std::string name);
void InsertIntoOsdElementCache(eOsdElementType type, int width=0, int height=0);
void InsertIntoGridCache(std::string name, int width, int height, bool active);
cImage *CreateGrid(int width, int height, bool active);
void AddCornersHorizontal(cImage *img, bool active);
void AddCornersVertical(cImage *img, bool active);
void InsertIntoGroupsCacheHorizontal(int size);
void InsertIntoGroupsCacheVertical(int size);
void AddCornersGroupHorizontal(cImage *img);
void AddCornersGroupVertical(cImage *img);
bool LoadLogo(const cChannel *channel);
void InsertIntoLogoCache(std::string channelID);
};
#endif //__TVGUIDE_IMAGECACHE_H
#ifndef __TVGUIDE_IMAGECACHE_H
#define __TVGUIDE_IMAGECACHE_H
#define X_DISPLAY_MISSING
#include <map>
#include <vector>
#include "imagemagickwrapper.h"
enum eCacheType {
ctOsdElement = 0,
ctGrid,
ctLogo,
ctChannelGroup,
ctIcon,
};
enum eOsdElementType {
oeNone = -1,
oeStatusHeaderContentFull,
oeStatusHeaderContentWindowed,
oeStatusHeaderTVFrame,
oeButtonRed,
oeButtonGreen,
oeButtonYellow,
oeButtonBlue,
oeLogoBack,
oeTimeline1,
oeTimeline2,
oeDateViewer,
oeClock,
oeChannelJump,
};
class cImageCache : public cImageMagickWrapper {
public:
cImageCache();
~cImageCache();
void CreateCache(void);
cImage *GetOsdElement(eOsdElementType type);
cImage *GetGrid(int width, int height, bool active);
cImage *GetChannelGroup(int width, int height);
cImage *GetLogo(const cChannel *channel);
cImage *GetIcon(std::string name, int width, int height);
std::string GetCacheSize(eCacheType type);
void Clear(void);
private:
cImage *tempStaticLogo;
Image bufferGrid;
Image bufferGridActive;
bool gridsAvailable;
int cornerWidth;
int cornerHeight;
cImage *imgLeft;
cImage *imgLeftActive;
cImage *imgRight;
cImage *imgRightActive;
cImage *imgHead;
cImage *imgHeadActive;
cImage *imgBottom;
cImage *imgBottomActive;
cImage *imgChannelgroupHead;
cImage *imgChannelgroupBottom;
cImage *groupsHead;
cImage *groupsBottom;
cImage *groupsLeft;
cImage *groupsRight;
std::map<eOsdElementType, cImage*> osdElementCache;
std::map<std::string, cImage*> gridCache;
std::map<std::string, cImage*> groupsCache;
std::map<std::string, cImage*> logoCache;
std::map<std::string, cImage*> iconCache;
void CreateOsdIconCache(void);
void PrepareGridIconCache(void);
void CreateGridIconCache(void);
void CreateChannelGroupCache(void);
void CreateLogoCache(void);
bool LoadIcon(std::string name);
void InsertIntoOsdElementCache(eOsdElementType type, int width=0, int height=0);
void InsertIntoGridCache(std::string name, int width, int height, bool active);
cImage *CreateGrid(int width, int height, bool active);
void AddCornersHorizontal(cImage *img, bool active);
void AddCornersVertical(cImage *img, bool active);
void InsertIntoGroupsCacheHorizontal(int size);
void InsertIntoGroupsCacheVertical(int size);
void AddCornersGroupHorizontal(cImage *img);
void AddCornersGroupVertical(cImage *img);
bool LoadLogo(const cChannel *channel);
void InsertIntoLogoCache(std::string channelID);
};
#endif //__TVGUIDE_IMAGECACHE_H

View File

@@ -11,7 +11,6 @@
using namespace Magick;
cImageLoader::cImageLoader() {
InitializeMagick(NULL);
}
cImageLoader::~cImageLoader() {
@@ -23,22 +22,22 @@ bool cImageLoader::LoadLogo(const cChannel *channel, int width, int height) {
std::string channelID = StrToLowerCase(*(channel->GetChannelID().ToString()));
std::string logoLower = StrToLowerCase(channel->Name());
cString extension;
if (tvguideConfig.logoExtension == 0) {
if (config.logoExtension == 0) {
extension = "png";
} else if (tvguideConfig.logoExtension == 1) {
} else if (config.logoExtension == 1) {
extension = "jpg";
}
bool success = false;
if (tvguideConfig.logoPathSet) {
success = LoadImage(channelID.c_str(), *tvguideConfig.logoPath, *extension);
if (config.logoPathSet) {
success = LoadImage(channelID.c_str(), *config.logoPath, *extension);
if (!success) {
success = LoadImage(logoLower.c_str(), *tvguideConfig.logoPath, *extension);
success = LoadImage(logoLower.c_str(), *config.logoPath, *extension);
}
}
if (!success)
success = LoadImage(channelID.c_str(), *tvguideConfig.logoPathDefault, *extension);
success = LoadImage(channelID.c_str(), *config.logoPathDefault, *extension);
if (!success)
success = LoadImage(logoLower.c_str(), *tvguideConfig.logoPathDefault, *extension);
success = LoadImage(logoLower.c_str(), *config.logoPathDefault, *extension);
if (success)
buffer.sample(Geometry(width, height));
return success;
@@ -48,9 +47,9 @@ bool cImageLoader::LoadEPGImage(int eventID, int width, int height) {
if ((width == 0)||(height==0))
return false;
bool success = false;
success = LoadImage(*cString::sprintf("%d", eventID), *tvguideConfig.epgImagePath, "jpg");
success = LoadImage(*cString::sprintf("%d", eventID), *config.epgImagePath, "jpg");
if (!success)
success = LoadImage(*cString::sprintf("%d_0", eventID), *tvguideConfig.epgImagePath, "jpg");
success = LoadImage(*cString::sprintf("%d_0", eventID), *config.epgImagePath, "jpg");
if (!success)
return false;
buffer.sample( Geometry(width, height));
@@ -58,12 +57,12 @@ bool cImageLoader::LoadEPGImage(int eventID, int width, int height) {
}
bool cImageLoader::LoadAdditionalEPGImage(cString name) {
int width = tvguideConfig.epgImageWidthLarge;
int height = tvguideConfig.epgImageHeightLarge;
int width = config.epgImageWidthLarge;
int height = config.epgImageHeightLarge;
if ((width == 0)||(height==0))
return false;
bool success = false;
success = LoadImage(*name, *tvguideConfig.epgImagePath, "jpg");
success = LoadImage(*name, *config.epgImagePath, "jpg");
if (!success)
return false;
if (height != 0 || width != 0) {
@@ -84,19 +83,19 @@ bool cImageLoader::LoadIcon(const char *cIcon, int size) {
if (size==0)
return false;
bool success = false;
if (tvguideConfig.iconsPathSet) {
cString iconPathTheme = cString::sprintf("%s%s/recmenuicons/", *tvguideConfig.iconPath, *tvguideConfig.themeName);
if (config.iconsPathSet) {
cString iconPathTheme = cString::sprintf("%s%s/recmenuicons/", *config.iconPath, *config.themeName);
success = LoadImage(cIcon, *iconPathTheme, "png");
if (!success) {
cString iconPath = cString::sprintf("%srecmenuicons/", *tvguideConfig.iconPath);
cString iconPath = cString::sprintf("%srecmenuicons/", *config.iconPath);
success = LoadImage(cIcon, *iconPath, "png");
}
}
if (!success) {
cString iconPathTheme = cString::sprintf("%s%s/recmenuicons/", *tvguideConfig.iconPathDefault, *tvguideConfig.themeName);
cString iconPathTheme = cString::sprintf("%s%s/recmenuicons/", *config.iconPathDefault, *config.themeName);
success = LoadImage(cIcon, *iconPathTheme, "png");
if (!success) {
cString iconPath = cString::sprintf("%srecmenuicons/", *tvguideConfig.iconPathDefault);
cString iconPath = cString::sprintf("%srecmenuicons/", *config.iconPathDefault);
success = LoadImage(cIcon, *iconPath, "png");
}
}
@@ -110,20 +109,20 @@ bool cImageLoader::LoadOsdElement(cString name, int width, int height) {
if ((width == 0)||(height==0))
return false;
bool success = false;
if (tvguideConfig.iconsPathSet) {
cString path = cString::sprintf("%s%s%s", *tvguideConfig.iconPath, *tvguideConfig.themeName, "/osdElements/");
if (config.iconsPathSet) {
cString path = cString::sprintf("%s%s%s", *config.iconPath, *config.themeName, "/osdElements/");
success = LoadImage(*name, *path, "png");
if (!success) {
path = cString::sprintf("%s%s", *tvguideConfig.iconPath, "/osdElements/");
path = cString::sprintf("%s%s", *config.iconPath, "/osdElements/");
success = LoadImage(*name, *path, "png");
}
}
if (!success) {
cString path = cString::sprintf("%s%s%s", *tvguideConfig.iconPathDefault, *tvguideConfig.themeName, "/osdElements/");
cString path = cString::sprintf("%s%s%s", *config.iconPathDefault, *config.themeName, "/osdElements/");
success = LoadImage(*name, *path, "png");
}
if (!success) {
cString path = cString::sprintf("%s%s", *tvguideConfig.iconPathDefault, "/osdElements/");
cString path = cString::sprintf("%s%s", *config.iconPathDefault, "/osdElements/");
success = LoadImage(*name, *path, "png");
}
if (!success)

View File

@@ -5,7 +5,6 @@
#include "imagescaler.h"
cImageMagickWrapper::cImageMagickWrapper() {
InitializeMagick(NULL);
}
cImageMagickWrapper::~cImageMagickWrapper() {
@@ -77,21 +76,21 @@ bool cImageMagickWrapper::LoadImage(std::string FileName, std::string Path, std:
std::stringstream sstrImgFile;
sstrImgFile << Path << FileName << "." << Extension;
std::string imgFile = sstrImgFile.str();
if (tvguideConfig.debugImageLoading)
if (config.debugImageLoading)
esyslog("tvguide: trying to load: %s", imgFile.c_str());
buffer.read(imgFile.c_str());
if (tvguideConfig.debugImageLoading)
if (config.debugImageLoading)
esyslog("tvguide: %s sucessfully loaded", imgFile.c_str());
} catch( Magick::Warning &warning ) {
if (tvguideConfig.debugImageLoading)
if (config.debugImageLoading)
esyslog("tvguide: Magick Warning: %s", warning.what());
return true;
} catch( Magick::Error &error ) {
if (tvguideConfig.debugImageLoading)
if (config.debugImageLoading)
esyslog("tvguide: Magick Error: %s", error.what());
return false;
} catch(...) {
if (tvguideConfig.debugImageLoading)
if (config.debugImageLoading)
esyslog("tvguide: an unknown Magick error occured during image loading");
return false;
}
@@ -102,21 +101,21 @@ bool cImageMagickWrapper::LoadImage(const char *fullpath) {
if ((fullpath == NULL) || (strlen(fullpath) < 5))
return false;
try {
if (tvguideConfig.debugImageLoading)
if (config.debugImageLoading)
esyslog("tvguide: trying to load: %s", fullpath);
buffer.read(fullpath);
if (tvguideConfig.debugImageLoading)
if (config.debugImageLoading)
esyslog("tvguide: %s sucessfully loaded", fullpath);
} catch( Magick::Warning &warning ) {
if (tvguideConfig.debugImageLoading)
if (config.debugImageLoading)
esyslog("tvguide: Magick Warning: %s", warning.what());
return true;
} catch( Magick::Error &error ) {
if (tvguideConfig.debugImageLoading)
if (config.debugImageLoading)
esyslog("tvguide: Magick Error: %s", error.what());
return false;
} catch(...) {
if (tvguideConfig.debugImageLoading)
if (config.debugImageLoading)
esyslog("tvguide: an unknown Magick error occured during image loading");
return false;
}

View File

@@ -1,38 +1,38 @@
#include "config.h"
#include "osdmanager.h"
cOsdManager::cOsdManager(void) {
}
bool cOsdManager::setOsd() {
osd = cOsdProvider::NewOsd(cOsd::OsdLeft(), cOsd::OsdTop());
if (osd) {
tArea Area = { 0, 0, cOsd::OsdWidth(), cOsd::OsdHeight(), 32 };
if (osd->SetAreas(&Area, 1) == oeOk) {
return true;
}
}
return false;
}
void cOsdManager::setBackground() {
if (tvguideConfig.displayStatusHeader && tvguideConfig.scaleVideo) {
int widthStatus = cOsd::OsdWidth() - geoManager.statusHeaderHeight * 16 / 9;
osd->DrawRectangle(0, 0, widthStatus, geoManager.statusHeaderHeight, theme.Color(clrBackgroundOSD));
osd->DrawRectangle(0, geoManager.statusHeaderHeight, Width(), Height(), theme.Color(clrBackgroundOSD));
}
else
osd->DrawRectangle(0, 0, Width(), Height(), theme.Color(clrBackgroundOSD));
}
cPixmap *cOsdManager::requestPixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort) {
return osd->CreatePixmap(Layer, ViewPort, DrawPort);
}
void cOsdManager::releasePixmap(cPixmap *pixmap) {
if (!pixmap)
return;
osd->DestroyPixmap(pixmap);
}
#include "config.h"
#include "osdmanager.h"
cOsdManager::cOsdManager(void) {
}
bool cOsdManager::setOsd() {
osd = cOsdProvider::NewOsd(cOsd::OsdLeft(), cOsd::OsdTop());
if (osd) {
tArea Area = { 0, 0, cOsd::OsdWidth(), cOsd::OsdHeight(), 32 };
if (osd->SetAreas(&Area, 1) == oeOk) {
return true;
}
}
return false;
}
void cOsdManager::setBackground() {
if (config.displayStatusHeader && config.scaleVideo) {
int widthStatus = cOsd::OsdWidth() - geoManager.statusHeaderHeight * 16 / 9;
osd->DrawRectangle(0, 0, widthStatus, geoManager.statusHeaderHeight, theme.Color(clrBackgroundOSD));
osd->DrawRectangle(0, geoManager.statusHeaderHeight, Width(), Height(), theme.Color(clrBackgroundOSD));
}
else
osd->DrawRectangle(0, 0, Width(), Height(), theme.Color(clrBackgroundOSD));
}
cPixmap *cOsdManager::requestPixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort) {
return osd->CreatePixmap(Layer, ViewPort, DrawPort);
}
void cOsdManager::releasePixmap(cPixmap *pixmap) {
if (!pixmap)
return;
osd->DestroyPixmap(pixmap);
}

View File

@@ -1,23 +1,23 @@
#ifndef __TVGUIDE_OSDMANAGER_H
#define __TVGUIDE_OSDMANAGER_H
#include <vdr/osd.h>
class cOsdManager {
private:
cOsd *osd;
public:
cOsdManager(void);
bool setOsd();
void setBackground();
void flush() {osd->Flush();};
cPixmap *requestPixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort = cRect::Null);
void releasePixmap(cPixmap *pixmap);
void deleteOsd() {delete osd;};
int Width() { return osd->Width(); };
int Height() { return osd->Height(); };
int Top() { return osd->Top(); };
int Left() { return osd->Left(); };
};
#endif //__TVGUIDE_OSDMANAGER_H
#ifndef __TVGUIDE_OSDMANAGER_H
#define __TVGUIDE_OSDMANAGER_H
#include <vdr/osd.h>
class cOsdManager {
private:
cOsd *osd;
public:
cOsdManager(void);
bool setOsd();
void setBackground();
void flush() {osd->Flush();};
cPixmap *requestPixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort = cRect::Null);
void releasePixmap(cPixmap *pixmap);
void deleteOsd() {delete osd;};
int Width() { return osd->Width(); };
int Height() { return osd->Height(); };
int Top() { return osd->Top(); };
int Left() { return osd->Left(); };
};
#endif //__TVGUIDE_OSDMANAGER_H

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-04-05 13:01+0200\n"
"POT-Creation-Date: 2019-11-03 12:37+0100\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"
@@ -99,12 +99,6 @@ msgstr ""
msgid "recordings done"
msgstr ""
msgid "What's on now"
msgstr ""
msgid "What's on next"
msgstr ""
msgid "Instant Record"
msgstr "Enregistra a l'instant"
@@ -303,79 +297,106 @@ msgstr ""
msgid "Save Search Timer"
msgstr ""
msgid "Search String"
msgid "Search term"
msgstr ""
msgid "Active"
msgstr ""
msgid "Search Mode"
msgstr "Mode de cerca"
msgid "Search mode"
msgstr ""
msgid "Use Title"
msgid "Tolerance"
msgstr ""
msgid "Match case"
msgstr ""
msgid "Use title"
msgstr "Utilitza títol"
msgid "Use Subtitle"
msgid "Use subtitle"
msgstr "Utilitza subtítol"
msgid "Use Description"
msgid "Use description"
msgstr "Utilitza descripció"
msgid "Limit Channels"
msgid "Use channel"
msgstr "Canals restringits"
msgid "Use Time"
msgstr "Utilitza temps"
msgid "Display advanced Options"
msgstr ""
msgid "Limit Days of the Week"
msgstr ""
msgid "Time margin for start in minutes"
msgstr ""
msgid "Time margin for stop in minutes"
msgstr ""
msgid "Series Recording"
msgstr ""
msgid "Folder"
msgstr ""
msgid "Use VPS"
msgstr ""
msgid "Avoid Repeats"
msgstr ""
msgid "Use in Favorites"
msgstr ""
msgid "Hide advanced Options"
msgstr ""
msgid "Display Results for Search Timer"
msgstr "Mostra resultats de la cerca"
msgid "Start Channel"
msgid "from channel"
msgstr "Inicia canal"
msgid "Stop Channel"
msgid "to channel"
msgstr "Atura canal"
msgid "Channel group"
msgstr ""
msgid "Use time"
msgstr "Utilitza temps"
msgid "Start after"
msgstr "Comença després"
msgid "Start before"
msgstr "Comença abans"
msgid "Select Days"
msgid "Use duration"
msgstr "Utilitza Durada"
msgid "Min. duration"
msgstr ""
msgid "Number of allowed repeats"
msgid "Max. duration"
msgstr ""
msgid "Use day of week"
msgstr ""
msgid "Day of week"
msgstr ""
msgid "Use in Favorites"
msgstr ""
msgid "Use as search timer"
msgstr ""
msgid "Action"
msgstr ""
msgid "Switch ... minutes before start"
msgstr ""
msgid "Unmute sound"
msgstr ""
msgid "Ask ... minutes before start"
msgstr ""
msgid "Series Recording"
msgstr ""
msgid "Directory"
msgstr ""
msgid "Delete recordings after ... days"
msgstr ""
msgid "Keep ... recordings"
msgstr ""
msgid "Pause when ... recordings exist"
msgstr ""
msgid "Avoid Repeats"
msgstr ""
msgid "Allowed repeats"
msgstr ""
msgid "Only repeats within ... days"
msgstr ""
msgid "Compare Title"
@@ -387,6 +408,33 @@ msgstr ""
msgid "Compare Description"
msgstr ""
msgid "Min. match in %"
msgstr ""
msgid "Compare date"
msgstr ""
msgid "Time margin for start in minutes"
msgstr ""
msgid "Time margin for stop in minutes"
msgstr ""
msgid "Use VPS"
msgstr ""
msgid "Auto delete"
msgstr ""
msgid "after ... recordings"
msgstr ""
msgid "after ... days after first rec."
msgstr ""
msgid "Display Results for Search Timer"
msgstr "Mostra resultats de la cerca"
msgid "Really delete Search Timer"
msgstr ""
@@ -462,6 +510,9 @@ msgstr "No s'ha creat el canvi de temporitzador"
msgid "Switch Timer deleted"
msgstr "Canvi de temporitzador esborrat"
msgid "Search Mode"
msgstr "Mode de cerca"
msgid "Channel to Search"
msgstr "Canal a cercar"
@@ -510,6 +561,12 @@ msgstr "No s'han trobat gravacions per"
msgid "No Favorites available"
msgstr ""
msgid "What's on now"
msgstr ""
msgid "What's on next"
msgstr ""
msgid "whole term must appear"
msgstr "expressió completa"
@@ -525,6 +582,54 @@ msgstr "coincidència exacta"
msgid "regular expression"
msgstr "expressió regular"
msgid "fuzzy"
msgstr ""
msgid "Interval"
msgstr ""
msgid "Channel Group"
msgstr ""
msgid "only FTA"
msgstr ""
msgid "same day"
msgstr ""
msgid "same week"
msgstr ""
msgid "same month"
msgstr ""
msgid "Record"
msgstr ""
msgid "Announce by OSD"
msgstr ""
msgid "Switch only"
msgstr ""
msgid "Announce and switch"
msgstr ""
msgid "Announce by mail"
msgstr ""
msgid "Inactive record"
msgstr ""
msgid "no"
msgstr ""
msgid "count recordings"
msgstr ""
msgid "count days"
msgstr ""
msgid "General Settings"
msgstr "Preferències"
@@ -570,6 +675,9 @@ msgstr "si existeix"
msgid "always"
msgstr "sempre"
msgid "Use workaround for HWAccelerated OSD"
msgstr ""
msgid "Show Main Menu Entry"
msgstr "Mostra entrada del menú principal"
@@ -780,16 +888,31 @@ msgstr ""
msgid "Folder for instant Recordings"
msgstr ""
msgid "Folder"
msgstr ""
msgid "Use Remotetimers"
msgstr "Utilitza temporitzadors remots"
msgid "Limit channels in favorites"
msgstr ""
msgid "Start Channel"
msgstr "Inicia canal"
msgid "Stop Channel"
msgstr "Atura canal"
msgid "Use \"What's on now\" in favorites"
msgstr ""
msgid "Use \"What's on next\" in favorites"
msgstr ""
msgid "Use user defined time 1 in favorites"
msgid "User defined times in favorites:"
msgstr ""
msgid "Use user defined time 1"
msgstr ""
msgid "Description"
@@ -798,16 +921,13 @@ msgstr ""
msgid "Time"
msgstr ""
msgid "Use user defined time 2 in favorites"
msgid "Use user defined time 2"
msgstr ""
msgid "Use user defined time 3 in favorites"
msgid "Use user defined time 3"
msgstr ""
msgid "Use user defined time 4 in favorites"
msgstr ""
msgid "Limit channels in favorites"
msgid "Use user defined time 4"
msgstr ""
msgid "Switchtimer:"
@@ -846,6 +966,9 @@ msgstr ""
msgid "Recording Menus Icon Cache"
msgstr ""
msgid "A fancy 2d EPG Viewer"
msgstr ""
msgid "No Cast available"
msgstr ""
@@ -915,9 +1038,6 @@ msgstr ""
msgid "yes"
msgstr ""
msgid "no"
msgstr ""
msgid "Adult"
msgstr ""

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-04-05 13:01+0200\n"
"POT-Creation-Date: 2019-11-03 12:37+0100\n"
"PO-Revision-Date: 2012-08-25 17:49+0200\n"
"Last-Translator: Horst\n"
"Language-Team: \n"
@@ -96,12 +96,6 @@ msgstr "aktive Timer"
msgid "recordings done"
msgstr "erledigte Aufnahmen"
msgid "What's on now"
msgstr "Was läuft jetzt?"
msgid "What's on next"
msgstr "Was läuft als nächstes?"
msgid "Instant Record"
msgstr "Aufnahme"
@@ -300,68 +294,44 @@ msgstr "Suchtimer konfigurieren"
msgid "Save Search Timer"
msgstr "Suchtimer speichern"
msgid "Search String"
msgid "Search term"
msgstr "Suchbegriff"
msgid "Active"
msgstr "Aktiv"
msgid "Search Mode"
msgid "Search mode"
msgstr "Suchmodus"
msgid "Use Title"
msgstr "Titel benutzen"
msgid "Tolerance"
msgstr "Toleranz"
msgid "Use Subtitle"
msgstr "Untertitel benutzen"
msgid "Match case"
msgstr "Groß/klein"
msgid "Use Description"
msgstr "Beschreibung benutzen"
msgid "Use title"
msgstr "Verwende Titel"
msgid "Limit Channels"
msgstr "Kanäle einschränken"
msgid "Use subtitle"
msgstr "Verwende Untertitel"
msgid "Use Time"
msgstr "Zeit benutzen"
msgid "Use description"
msgstr "Verwende Beschreibung"
msgid "Display advanced Options"
msgstr "Erweiterte Optionen anzeigen"
msgid "Use channel"
msgstr "Verwende Kanal"
msgid "Limit Days of the Week"
msgstr "Wochentage beschränken"
msgid "from channel"
msgstr "von Kanal"
msgid "Time margin for start in minutes"
msgstr "Zeit vor Start in Minuten"
msgid "to channel"
msgstr "bis Kanal"
msgid "Time margin for stop in minutes"
msgstr "Zeit nach Ende in Minuten"
msgid "Channel group"
msgstr "Kanalgruppe"
msgid "Series Recording"
msgstr "Serienaufnahme"
msgid "Folder"
msgstr "Verzeichnis"
msgid "Use VPS"
msgstr "VPS benutzen"
msgid "Avoid Repeats"
msgstr "Wiederholungen vermeiden"
msgid "Use in Favorites"
msgstr "Als Favorit benutzen"
msgid "Hide advanced Options"
msgstr "Erweiterte Optionen ausblenden"
msgid "Display Results for Search Timer"
msgstr "Ergebnisse für Suchtimer anzeigen"
msgid "Start Channel"
msgstr "Startkanal"
msgid "Stop Channel"
msgstr "Stopkanal"
msgid "Use time"
msgstr "Verwende Uhrzeit"
msgid "Start after"
msgstr "Beginn nach"
@@ -369,20 +339,98 @@ msgstr "Beginn nach"
msgid "Start before"
msgstr "Beginn vor"
msgid "Select Days"
msgstr "Tage bestimmen"
msgid "Use duration"
msgstr "Verwende Dauer"
msgid "Number of allowed repeats"
msgstr "Anzahl erlaubter Wiederholungen"
msgid "Min. duration"
msgstr "Min. Dauer"
msgid "Max. duration"
msgstr "Max. Dauer"
msgid "Use day of week"
msgstr "Verwende Wochentag"
msgid "Day of week"
msgstr "Wochentag"
msgid "Use in Favorites"
msgstr "Als Favorit benutzen"
msgid "Use as search timer"
msgstr "Als Suchtimer verwenden"
msgid "Action"
msgstr "Aktion"
msgid "Switch ... minutes before start"
msgstr "Umschalten ... Minuten vor Start"
msgid "Unmute sound"
msgstr "Ton anschalten"
msgid "Ask ... minutes before start"
msgstr "Nachfrage ... Minuten vor Start"
msgid "Series Recording"
msgstr "Serienaufnahme"
msgid "Directory"
msgstr "Verzeichnis"
msgid "Delete recordings after ... days"
msgstr "Aufn. nach ... Tagen löschen"
msgid "Keep ... recordings"
msgstr "Behalte ... Aufnahmen"
msgid "Pause when ... recordings exist"
msgstr "Pause, wenn ... Aufnahmen exist."
msgid "Avoid Repeats"
msgstr "Vermeide Wiederholung"
msgid "Allowed repeats"
msgstr "Erlaubte Wiederholungen"
msgid "Only repeats within ... days"
msgstr "Nur Wiederh. innerhalb von ... Tagen"
msgid "Compare Title"
msgstr "Titel vergleichen"
msgstr "Vergleiche Titel"
msgid "Compare Subtitle"
msgstr "Untertitel vergleichen"
msgstr "Vergleiche Untertitel"
msgid "Compare Description"
msgstr "Beschreibung vergleichen"
msgstr "Vergleiche Beschreibung"
msgid "Min. match in %"
msgstr "Min. Übereinstimmung in %"
msgid "Compare date"
msgstr "Vergleiche Zeitpunkt"
msgid "Time margin for start in minutes"
msgstr "Vorlauf zum Timer-Beginn (min)"
msgid "Time margin for stop in minutes"
msgstr "Nachlauf zum Timer-Ende (min)"
msgid "Use VPS"
msgstr "Verwende VPS"
msgid "Auto delete"
msgstr "automatisch löschen"
msgid "after ... recordings"
msgstr "nach ... Aufnahmen"
msgid "after ... days after first rec."
msgstr "nach ... Tagen nach erster Aufn."
msgid "Display Results for Search Timer"
msgstr "Ergebnisse für Suchtimer anzeigen"
msgid "Really delete Search Timer"
msgstr "Suchtimer wirklich löschen"
@@ -459,6 +507,9 @@ msgstr "Umschalttimer NICHT erfolgreich angelegt"
msgid "Switch Timer deleted"
msgstr "Umschalttimer gelöscht"
msgid "Search Mode"
msgstr "Suchmodus"
msgid "Channel to Search"
msgstr "Suche auf Kanal"
@@ -507,6 +558,12 @@ msgstr "Keine Aufnahmen gefunden für"
msgid "No Favorites available"
msgstr "Keine Favoriten verfügbar"
msgid "What's on now"
msgstr "Was läuft jetzt?"
msgid "What's on next"
msgstr "Was läuft als nächstes?"
msgid "whole term must appear"
msgstr "vollständiger Ausdruck"
@@ -522,6 +579,54 @@ msgstr "exakt"
msgid "regular expression"
msgstr "Regulärer Ausdruck"
msgid "fuzzy"
msgstr "unscharf"
msgid "Interval"
msgstr "Bereich"
msgid "Channel Group"
msgstr "Kanalgruppe"
msgid "only FTA"
msgstr "ohne PayTV"
msgid "same day"
msgstr "gleicher Tag"
msgid "same week"
msgstr "gleiche Woche"
msgid "same month"
msgstr "gleicher Monat"
msgid "Record"
msgstr "Aufnehmen"
msgid "Announce by OSD"
msgstr "per OSD ankündigen"
msgid "Switch only"
msgstr "Nur umschalten"
msgid "Announce and switch"
msgstr "Ankündigen und Umschalten"
msgid "Announce by mail"
msgstr "per Mail ankündigen"
msgid "Inactive record"
msgstr "inaktive Aufnahme"
msgid "no"
msgstr "Nein"
msgid "count recordings"
msgstr "Anzahl Aufnahmen"
msgid "count days"
msgstr "Anzahl Tage"
msgid "General Settings"
msgstr "Allgemeine Einstellungen"
@@ -567,6 +672,9 @@ msgstr "falls vorhanden"
msgid "always"
msgstr "immer"
msgid "Use workaround for HWAccelerated OSD"
msgstr ""
msgid "Show Main Menu Entry"
msgstr "Hauptmenüeintrag anzeigen"
@@ -777,17 +885,32 @@ msgstr "Festes Verzeichnis benutzen"
msgid "Folder for instant Recordings"
msgstr "Verzeichnis für Sofortaufnahmen"
msgid "Folder"
msgstr "Verzeichnis"
msgid "Use Remotetimers"
msgstr "RemoteTimers benutzen"
msgid "Limit channels in favorites"
msgstr "Kanäle in Favoriten beschränken"
msgid "Start Channel"
msgstr "von Kanal"
msgid "Stop Channel"
msgstr "bis Kanal"
msgid "Use \"What's on now\" in favorites"
msgstr "\"Was läuft jetzt\" in Favoriten benutzen"
msgid "Use \"What's on next\" in favorites"
msgstr "\"Was läuft als nächstes\" in Favoriten benutzen"
msgid "Use user defined time 1 in favorites"
msgstr "Benutzerdef. Zeit 1 in Favoriten benutzen"
msgid "User defined times in favorites:"
msgstr "Nutzer definierte Zeiten in Favoriten:"
msgid "Use user defined time 1"
msgstr "Verw. benutzerdef. Zeit 1"
msgid "Description"
msgstr "Beschreibung"
@@ -795,17 +918,14 @@ msgstr "Beschreibung"
msgid "Time"
msgstr "Zeit"
msgid "Use user defined time 2 in favorites"
msgstr "Benutzerdef. Zeit 2 in Favoriten benutzen"
msgid "Use user defined time 2"
msgstr "Verw. benutzerdef. Zeit 2"
msgid "Use user defined time 3 in favorites"
msgstr "Benutzerdef. Zeit 3 in Favoriten benutzen"
msgid "Use user defined time 3"
msgstr "Verw. benutzerdef. Zeit 3"
msgid "Use user defined time 4 in favorites"
msgstr "Benutzerdef. Zeit 4 in Favoriten benutzen"
msgid "Limit channels in favorites"
msgstr "Kanäle in Favoriten beschränken"
msgid "Use user defined time 4"
msgstr "Verw. benutzerdef. Zeit 4"
msgid "Switchtimer:"
msgstr "Umschalttimer:"
@@ -843,6 +963,9 @@ msgstr "Kanalgruppen Cache"
msgid "Recording Menus Icon Cache"
msgstr "Recording Menüs Icon Cache"
msgid "A fancy 2d EPG Viewer"
msgstr "Eine schicke Programm Vorschau"
msgid "No Cast available"
msgstr "Keine Besetzung vorhanden"
@@ -912,9 +1035,6 @@ msgstr "Überblick"
msgid "yes"
msgstr "Ja"
msgid "no"
msgstr "Nein"
msgid "Adult"
msgstr "Nur für Erwachsene"
@@ -944,3 +1064,9 @@ msgstr "TheMovieDB Popularität"
msgid "TheMovieDB Vote Average"
msgstr "TheMovieDB durchschnittliche Bewertung"
#~ msgid "Display advanced Options"
#~ msgstr "Erweiterte Optionen anzeigen"
#~ msgid "Hide advanced Options"
#~ msgstr "Erweiterte Optionen ausblenden"

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-04-05 13:01+0200\n"
"POT-Creation-Date: 2019-11-03 12:37+0100\n"
"PO-Revision-Date: 2012-08-25 17:49+0200\n"
"Last-Translator: fiveten_59\n"
"Language-Team: \n"
@@ -96,12 +96,6 @@ msgstr "Timers attivi"
msgid "recordings done"
msgstr "registrazione eseguita"
msgid "What's on now"
msgstr "Was läuft jetzt?"
msgid "What's on next"
msgstr "Was läuft als nächstes?"
msgid "Instant Record"
msgstr "Registrazione immediata"
@@ -300,80 +294,107 @@ msgstr "Configura le opzione del Search Timer"
msgid "Save Search Timer"
msgstr "Salva il Search Timer"
msgid "Search String"
msgstr "Suchbegriff"
msgid "Search term"
msgstr ""
msgid "Active"
msgstr "Attivo"
msgid "Search Mode"
msgid "Search mode"
msgstr "Modalità di ricerca"
msgid "Use Title"
msgid "Tolerance"
msgstr ""
msgid "Match case"
msgstr ""
msgid "Use title"
msgstr "Usa Titolo"
msgid "Use Subtitle"
msgid "Use subtitle"
msgstr "Usa Sottotitolo"
msgid "Use Description"
msgid "Use description"
msgstr "Usa Descrizione"
msgid "Limit Channels"
msgid "Use channel"
msgstr "Limite Canale"
msgid "Use Time"
msgstr "Utilizza Time"
msgid "Display advanced Options"
msgstr "Mostra Opzioni avanzate"
msgid "Limit Days of the Week"
msgstr "Limite dei giorni della settimana"
msgid "Time margin for start in minutes"
msgstr "Margine di tempo per l'avvio in minuti"
msgid "Time margin for stop in minutes"
msgstr "Margine di tempo per lo stop in minuti"
msgid "Series Recording"
msgstr "Serie di registrazioni"
msgid "Folder"
msgstr "Cartella"
msgid "Use VPS"
msgstr "Utilizza VPS"
msgid "Avoid Repeats"
msgstr "Evita ripetizioni"
msgid "Use in Favorites"
msgstr "Utilizza nei favoriti"
msgid "Hide advanced Options"
msgstr "Nascondi Opzioni avanzate"
msgid "Display Results for Search Timer"
msgstr "Mostra risultati per il Search Timer"
msgid "Start Channel"
msgid "from channel"
msgstr "Avvia il Canale"
msgid "Stop Channel"
msgid "to channel"
msgstr "Ferma il Canale"
msgid "Channel group"
msgstr ""
msgid "Use time"
msgstr "Utilizza Time"
msgid "Start after"
msgstr "Avvia dopo"
msgid "Start before"
msgstr "Avvia prima"
msgid "Select Days"
msgid "Use duration"
msgstr ""
msgid "Min. duration"
msgstr ""
msgid "Max. duration"
msgstr ""
msgid "Use day of week"
msgstr "Usa giorno feriale"
msgid "Day of week"
msgstr "Seleziona i giorni"
msgid "Number of allowed repeats"
msgstr "Numero di ripetizioni permesse"
msgid "Use in Favorites"
msgstr "Utilizza nei favoriti"
msgid "Use as search timer"
msgstr ""
msgid "Action"
msgstr ""
msgid "Switch ... minutes before start"
msgstr ""
msgid "Unmute sound"
msgstr ""
msgid "Ask ... minutes before start"
msgstr ""
msgid "Series Recording"
msgstr "Serie di registrazioni"
msgid "Directory"
msgstr ""
msgid "Delete recordings after ... days"
msgstr ""
msgid "Keep ... recordings"
msgstr ""
msgid "Pause when ... recordings exist"
msgstr ""
msgid "Avoid Repeats"
msgstr "Evita ripetizioni"
msgid "Allowed repeats"
msgstr ""
msgid "Only repeats within ... days"
msgstr ""
msgid "Compare Title"
msgstr "Confonta Titolo"
@@ -384,6 +405,33 @@ msgstr "Confonta Sottotitolo"
msgid "Compare Description"
msgstr "Confonta Descrizione"
msgid "Min. match in %"
msgstr ""
msgid "Compare date"
msgstr ""
msgid "Time margin for start in minutes"
msgstr "Margine di tempo per l'avvio in minuti"
msgid "Time margin for stop in minutes"
msgstr "Margine di tempo per lo stop in minuti"
msgid "Use VPS"
msgstr "Utilizza VPS"
msgid "Auto delete"
msgstr ""
msgid "after ... recordings"
msgstr ""
msgid "after ... days after first rec."
msgstr ""
msgid "Display Results for Search Timer"
msgstr "Mostra risultati per il Search Timer"
msgid "Really delete Search Timer"
msgstr "Veramente eliminare il Search Timer"
@@ -459,6 +507,9 @@ msgstr "Switch Timer NON creato"
msgid "Switch Timer deleted"
msgstr "Switch Timer eliminato"
msgid "Search Mode"
msgstr "Modalità di ricerca"
msgid "Channel to Search"
msgstr "Canale da cercare"
@@ -507,6 +558,12 @@ msgstr "Nessuna registrazione trovata per"
msgid "No Favorites available"
msgstr "Nessun Favoriti disponibile"
msgid "What's on now"
msgstr "Was läuft jetzt?"
msgid "What's on next"
msgstr "Was läuft als nächstes?"
msgid "whole term must appear"
msgstr "vollständiger Ausdruck"
@@ -522,6 +579,54 @@ msgstr "exakt"
msgid "regular expression"
msgstr "Regulärer Ausdruck"
msgid "fuzzy"
msgstr ""
msgid "Interval"
msgstr ""
msgid "Channel Group"
msgstr ""
msgid "only FTA"
msgstr ""
msgid "same day"
msgstr ""
msgid "same week"
msgstr ""
msgid "same month"
msgstr ""
msgid "Record"
msgstr ""
msgid "Announce by OSD"
msgstr ""
msgid "Switch only"
msgstr ""
msgid "Announce and switch"
msgstr ""
msgid "Announce by mail"
msgstr ""
msgid "Inactive record"
msgstr ""
msgid "no"
msgstr "No"
msgid "count recordings"
msgstr ""
msgid "count days"
msgstr ""
msgid "General Settings"
msgstr "Allgemeine Einstellungen"
@@ -567,6 +672,9 @@ msgstr "se esiste"
msgid "always"
msgstr "sempre"
msgid "Use workaround for HWAccelerated OSD"
msgstr ""
msgid "Show Main Menu Entry"
msgstr "Hauptmenüeintrag anzeigen"
@@ -777,17 +885,32 @@ msgstr "Usa cartella fissa"
msgid "Folder for instant Recordings"
msgstr "Cartella per la registrazione immediata"
msgid "Folder"
msgstr "Cartella"
msgid "Use Remotetimers"
msgstr "Usa Remotetimers"
msgid "Limit channels in favorites"
msgstr "Limite dei canali nei favoriti"
msgid "Start Channel"
msgstr "Avvia il Canale"
msgid "Stop Channel"
msgstr "Ferma il Canale"
msgid "Use \"What's on now\" in favorites"
msgstr "Usa \"In programma ora\" nei favoriti"
msgid "Use \"What's on next\" in favorites"
msgstr "Usa \"Programma prossimo\" nei favoriti"
msgid "Use user defined time 1 in favorites"
msgstr "Usa il tempo definito per l'user 1 in favoriti"
msgid "User defined times in favorites:"
msgstr ""
msgid "Use user defined time 1"
msgstr "Usa il tempo definito per l'user 1"
msgid "Description"
msgstr "Descrizione"
@@ -795,17 +918,14 @@ msgstr "Descrizione"
msgid "Time"
msgstr "Tempo"
msgid "Use user defined time 2 in favorites"
msgstr "Usa il tempo definito per l'user 2 in favoriti"
msgid "Use user defined time 2"
msgstr "Usa il tempo definito per l'user 2"
msgid "Use user defined time 3 in favorites"
msgstr "Usa il tempo definito per l'user 3 in favoriti"
msgid "Use user defined time 3"
msgstr "Usa il tempo definito per l'user 3"
msgid "Use user defined time 4 in favorites"
msgstr "Usa il tempo definito per l'user 4 in favoriti"
msgid "Limit channels in favorites"
msgstr "Limite dei canali nei favoriti"
msgid "Use user defined time 4"
msgstr "Usa il tempo definito per l'user 4"
msgid "Switchtimer:"
msgstr ""
@@ -843,6 +963,9 @@ msgstr "Cache dei Gruppi Canale"
msgid "Recording Menus Icon Cache"
msgstr "Recording Menüs Icon Cache"
msgid "A fancy 2d EPG Viewer"
msgstr ""
msgid "No Cast available"
msgstr "Nessun cast disponibile"
@@ -912,9 +1035,6 @@ msgstr "Überblick"
msgid "yes"
msgstr "Si"
msgid "no"
msgstr "No"
msgid "Adult"
msgstr "Per adulti"
@@ -944,3 +1064,12 @@ msgstr "TheMovieDB Popularità"
msgid "TheMovieDB Vote Average"
msgstr "Voto medio di TheMovieDB"
#~ msgid "Number of allowed repeats"
#~ msgstr "Numero di ripetizioni permesse"
#~ msgid "Display advanced Options"
#~ msgstr "Mostra Opzioni avanzate"
#~ msgid "Hide advanced Options"
#~ msgstr "Nascondi Opzioni avanzate"

View File

@@ -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: 2019-04-05 13:01+0200\n"
"POT-Creation-Date: 2019-11-03 12:37+0100\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"
@@ -96,12 +96,6 @@ msgstr ""
msgid "recordings done"
msgstr ""
msgid "What's on now"
msgstr ""
msgid "What's on next"
msgstr ""
msgid "Instant Record"
msgstr "Записать"
@@ -300,79 +294,106 @@ msgstr ""
msgid "Save Search Timer"
msgstr ""
msgid "Search String"
msgid "Search term"
msgstr ""
msgid "Active"
msgstr ""
msgid "Search Mode"
msgstr "Режим поиска"
msgid "Search mode"
msgstr ""
msgid "Use Title"
msgid "Tolerance"
msgstr ""
msgid "Match case"
msgstr ""
msgid "Use title"
msgstr "Искать в названиях"
msgid "Use Subtitle"
msgid "Use subtitle"
msgstr "Искать в эпизодах"
msgid "Use Description"
msgid "Use description"
msgstr "Искать в описаниях"
msgid "Limit Channels"
msgid "Use channel"
msgstr "Ограничить список каналов"
msgid "Use Time"
msgid "from channel"
msgstr ""
msgid "to channel"
msgstr ""
msgid "Channel group"
msgstr ""
msgid "Use time"
msgstr "Время"
msgid "Display advanced Options"
msgstr ""
msgid "Limit Days of the Week"
msgstr ""
msgid "Time margin for start in minutes"
msgstr ""
msgid "Time margin for stop in minutes"
msgstr ""
msgid "Series Recording"
msgstr ""
msgid "Folder"
msgstr ""
msgid "Use VPS"
msgstr ""
msgid "Avoid Repeats"
msgstr ""
msgid "Use in Favorites"
msgstr ""
msgid "Hide advanced Options"
msgstr ""
msgid "Display Results for Search Timer"
msgstr "Тест"
msgid "Start Channel"
msgstr "С канала"
msgid "Stop Channel"
msgstr "По канал"
msgid "Start after"
msgstr "С"
msgid "Start before"
msgstr "До"
msgid "Select Days"
msgid "Use duration"
msgstr ""
msgid "Number of allowed repeats"
msgid "Min. duration"
msgstr ""
msgid "Max. duration"
msgstr ""
msgid "Use day of week"
msgstr ""
msgid "Day of week"
msgstr ""
msgid "Use in Favorites"
msgstr ""
msgid "Use as search timer"
msgstr ""
msgid "Action"
msgstr ""
msgid "Switch ... minutes before start"
msgstr ""
msgid "Unmute sound"
msgstr ""
msgid "Ask ... minutes before start"
msgstr ""
msgid "Series Recording"
msgstr ""
msgid "Directory"
msgstr ""
msgid "Delete recordings after ... days"
msgstr ""
msgid "Keep ... recordings"
msgstr ""
msgid "Pause when ... recordings exist"
msgstr ""
msgid "Avoid Repeats"
msgstr ""
msgid "Allowed repeats"
msgstr ""
msgid "Only repeats within ... days"
msgstr ""
msgid "Compare Title"
@@ -384,6 +405,33 @@ msgstr ""
msgid "Compare Description"
msgstr ""
msgid "Min. match in %"
msgstr ""
msgid "Compare date"
msgstr ""
msgid "Time margin for start in minutes"
msgstr ""
msgid "Time margin for stop in minutes"
msgstr ""
msgid "Use VPS"
msgstr ""
msgid "Auto delete"
msgstr ""
msgid "after ... recordings"
msgstr ""
msgid "after ... days after first rec."
msgstr ""
msgid "Display Results for Search Timer"
msgstr "Тест"
msgid "Really delete Search Timer"
msgstr ""
@@ -459,6 +507,9 @@ msgstr "Таймер переключения НЕ был создан!"
msgid "Switch Timer deleted"
msgstr "Таймер переключения удален"
msgid "Search Mode"
msgstr "Режим поиска"
msgid "Channel to Search"
msgstr "Канал для поиска"
@@ -507,6 +558,12 @@ msgstr "Не найдено записей:"
msgid "No Favorites available"
msgstr ""
msgid "What's on now"
msgstr ""
msgid "What's on next"
msgstr ""
msgid "whole term must appear"
msgstr "фраза"
@@ -522,6 +579,54 @@ msgstr "точное совпадение"
msgid "regular expression"
msgstr "регулярные выражения"
msgid "fuzzy"
msgstr ""
msgid "Interval"
msgstr ""
msgid "Channel Group"
msgstr ""
msgid "only FTA"
msgstr ""
msgid "same day"
msgstr ""
msgid "same week"
msgstr ""
msgid "same month"
msgstr ""
msgid "Record"
msgstr ""
msgid "Announce by OSD"
msgstr ""
msgid "Switch only"
msgstr ""
msgid "Announce and switch"
msgstr ""
msgid "Announce by mail"
msgstr ""
msgid "Inactive record"
msgstr ""
msgid "no"
msgstr ""
msgid "count recordings"
msgstr ""
msgid "count days"
msgstr ""
msgid "General Settings"
msgstr "Основные настройки"
@@ -567,6 +672,9 @@ msgstr "если существует"
msgid "always"
msgstr "всегда"
msgid "Use workaround for HWAccelerated OSD"
msgstr ""
msgid "Show Main Menu Entry"
msgstr "Показывать пункт в главном меню"
@@ -777,16 +885,31 @@ msgstr ""
msgid "Folder for instant Recordings"
msgstr ""
msgid "Folder"
msgstr ""
msgid "Use Remotetimers"
msgstr "RemoteTimers benutzen"
msgid "Limit channels in favorites"
msgstr ""
msgid "Start Channel"
msgstr "С канала"
msgid "Stop Channel"
msgstr "По канал"
msgid "Use \"What's on now\" in favorites"
msgstr ""
msgid "Use \"What's on next\" in favorites"
msgstr ""
msgid "Use user defined time 1 in favorites"
msgid "User defined times in favorites:"
msgstr ""
msgid "Use user defined time 1"
msgstr ""
msgid "Description"
@@ -795,16 +918,13 @@ msgstr ""
msgid "Time"
msgstr ""
msgid "Use user defined time 2 in favorites"
msgid "Use user defined time 2"
msgstr ""
msgid "Use user defined time 3 in favorites"
msgid "Use user defined time 3"
msgstr ""
msgid "Use user defined time 4 in favorites"
msgstr ""
msgid "Limit channels in favorites"
msgid "Use user defined time 4"
msgstr ""
msgid "Switchtimer:"
@@ -843,6 +963,9 @@ msgstr ""
msgid "Recording Menus Icon Cache"
msgstr ""
msgid "A fancy 2d EPG Viewer"
msgstr ""
msgid "No Cast available"
msgstr ""
@@ -912,9 +1035,6 @@ msgstr ""
msgid "yes"
msgstr ""
msgid "no"
msgstr ""
msgid "Adult"
msgstr ""

View File

@@ -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: 2019-04-05 13:01+0200\n"
"POT-Creation-Date: 2019-11-03 12:37+0100\n"
"PO-Revision-Date: 2013-09-15 00:12+0100\n"
"Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n"
"Language-Team: \n"
@@ -96,12 +96,6 @@ msgstr ""
msgid "recordings done"
msgstr ""
msgid "What's on now"
msgstr ""
msgid "What's on next"
msgstr ""
msgid "Instant Record"
msgstr "Okam<61>ite nahra<72>"
@@ -300,79 +294,106 @@ msgstr ""
msgid "Save Search Timer"
msgstr ""
msgid "Search String"
msgid "Search term"
msgstr ""
msgid "Active"
msgstr ""
msgid "Search Mode"
msgstr "Re<EFBFBD>im vyh<79>ad<61>vania"
msgid "Search mode"
msgstr ""
msgid "Use Title"
msgid "Tolerance"
msgstr ""
msgid "Match case"
msgstr ""
msgid "Use title"
msgstr "Pou<6F>i<EFBFBD> n<>zov"
msgid "Use Subtitle"
msgid "Use subtitle"
msgstr "Pou<6F>i<EFBFBD> titulky"
msgid "Use Description"
msgid "Use description"
msgstr "Pou<6F>i<EFBFBD> popis"
msgid "Limit Channels"
msgid "Use channel"
msgstr "Obmedzi<7A> kan<61>ly"
msgid "Use Time"
msgid "from channel"
msgstr ""
msgid "to channel"
msgstr ""
msgid "Channel group"
msgstr ""
msgid "Use time"
msgstr "Pou<6F>i<EFBFBD> <20>as"
msgid "Display advanced Options"
msgstr ""
msgid "Limit Days of the Week"
msgstr ""
msgid "Time margin for start in minutes"
msgstr ""
msgid "Time margin for stop in minutes"
msgstr ""
msgid "Series Recording"
msgstr ""
msgid "Folder"
msgstr ""
msgid "Use VPS"
msgstr ""
msgid "Avoid Repeats"
msgstr ""
msgid "Use in Favorites"
msgstr ""
msgid "Hide advanced Options"
msgstr ""
msgid "Display Results for Search Timer"
msgstr "Pozrie<69> v<>sledky pre vyh<79>ad<61>vanie pl<70>nov"
msgid "Start Channel"
msgstr "Od kan<61>lu"
msgid "Stop Channel"
msgstr "Po kan<61>l"
msgid "Start after"
msgstr "Za<5A>iatok po"
msgid "Start before"
msgstr "Za<5A>iatok pred"
msgid "Select Days"
msgid "Use duration"
msgstr ""
msgid "Number of allowed repeats"
msgid "Min. duration"
msgstr ""
msgid "Max. duration"
msgstr ""
msgid "Use day of week"
msgstr ""
msgid "Day of week"
msgstr ""
msgid "Use in Favorites"
msgstr ""
msgid "Use as search timer"
msgstr ""
msgid "Action"
msgstr ""
msgid "Switch ... minutes before start"
msgstr ""
msgid "Unmute sound"
msgstr ""
msgid "Ask ... minutes before start"
msgstr ""
msgid "Series Recording"
msgstr ""
msgid "Directory"
msgstr ""
msgid "Delete recordings after ... days"
msgstr ""
msgid "Keep ... recordings"
msgstr ""
msgid "Pause when ... recordings exist"
msgstr ""
msgid "Avoid Repeats"
msgstr ""
msgid "Allowed repeats"
msgstr ""
msgid "Only repeats within ... days"
msgstr ""
msgid "Compare Title"
@@ -384,6 +405,33 @@ msgstr ""
msgid "Compare Description"
msgstr ""
msgid "Min. match in %"
msgstr ""
msgid "Compare date"
msgstr ""
msgid "Time margin for start in minutes"
msgstr ""
msgid "Time margin for stop in minutes"
msgstr ""
msgid "Use VPS"
msgstr ""
msgid "Auto delete"
msgstr ""
msgid "after ... recordings"
msgstr ""
msgid "after ... days after first rec."
msgstr ""
msgid "Display Results for Search Timer"
msgstr "Pozrie<69> v<>sledky pre vyh<79>ad<61>vanie pl<70>nov"
msgid "Really delete Search Timer"
msgstr ""
@@ -459,6 +507,9 @@ msgstr "Pl
msgid "Switch Timer deleted"
msgstr "Pl<50>n prepnutia vymazan<61>"
msgid "Search Mode"
msgstr "Re<52>im vyh<79>ad<61>vania"
msgid "Channel to Search"
msgstr "H<>ada<64> na kan<61>le"
@@ -507,6 +558,12 @@ msgstr "Nena
msgid "No Favorites available"
msgstr ""
msgid "What's on now"
msgstr ""
msgid "What's on next"
msgstr ""
msgid "whole term must appear"
msgstr "kompletn<74> v<>raz"
@@ -522,6 +579,54 @@ msgstr "presn
msgid "regular expression"
msgstr "regul<75>rny v<>raz"
msgid "fuzzy"
msgstr ""
msgid "Interval"
msgstr ""
msgid "Channel Group"
msgstr ""
msgid "only FTA"
msgstr ""
msgid "same day"
msgstr ""
msgid "same week"
msgstr ""
msgid "same month"
msgstr ""
msgid "Record"
msgstr ""
msgid "Announce by OSD"
msgstr ""
msgid "Switch only"
msgstr ""
msgid "Announce and switch"
msgstr ""
msgid "Announce by mail"
msgstr ""
msgid "Inactive record"
msgstr ""
msgid "no"
msgstr ""
msgid "count recordings"
msgstr ""
msgid "count days"
msgstr ""
msgid "General Settings"
msgstr "V<>eobecn<63> nastavenia"
@@ -567,6 +672,9 @@ msgstr "ak s
msgid "always"
msgstr "v<>dy"
msgid "Use workaround for HWAccelerated OSD"
msgstr ""
msgid "Show Main Menu Entry"
msgstr "Zobrazi<7A> v hlavnom menu"
@@ -777,16 +885,31 @@ msgstr ""
msgid "Folder for instant Recordings"
msgstr ""
msgid "Folder"
msgstr ""
msgid "Use Remotetimers"
msgstr "Pou<6F>i<EFBFBD> vzdialen<65> pl<70>nova<76>"
msgid "Limit channels in favorites"
msgstr ""
msgid "Start Channel"
msgstr "Od kan<61>lu"
msgid "Stop Channel"
msgstr "Po kan<61>l"
msgid "Use \"What's on now\" in favorites"
msgstr ""
msgid "Use \"What's on next\" in favorites"
msgstr ""
msgid "Use user defined time 1 in favorites"
msgid "User defined times in favorites:"
msgstr ""
msgid "Use user defined time 1"
msgstr ""
msgid "Description"
@@ -795,16 +918,13 @@ msgstr ""
msgid "Time"
msgstr ""
msgid "Use user defined time 2 in favorites"
msgid "Use user defined time 2"
msgstr ""
msgid "Use user defined time 3 in favorites"
msgid "Use user defined time 3"
msgstr ""
msgid "Use user defined time 4 in favorites"
msgstr ""
msgid "Limit channels in favorites"
msgid "Use user defined time 4"
msgstr ""
msgid "Switchtimer:"
@@ -843,6 +963,9 @@ msgstr ""
msgid "Recording Menus Icon Cache"
msgstr ""
msgid "A fancy 2d EPG Viewer"
msgstr ""
msgid "No Cast available"
msgstr ""
@@ -912,9 +1035,6 @@ msgstr ""
msgid "yes"
msgstr ""
msgid "no"
msgstr ""
msgid "Adult"
msgstr ""

View File

@@ -44,21 +44,29 @@ bool cRecManager::RefreshRemoteTimers(void) {
bool cRecManager::CheckEventForTimer(const cEvent *event) {
bool hasTimer = false;
if (tvguideConfig.useRemoteTimers && pRemoteTimers) {
if (config.useRemoteTimers && pRemoteTimers) {
RemoteTimers_GetMatch_v1_0 rtMatch;
rtMatch.event = event;
pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch);
if (rtMatch.timerMatch == tmFull)
hasTimer = true;
} else
} else {
#if VDRVERSNUM >= 20301
eTimerMatch TimerMatch = tmNone;
LOCK_TIMERS_READ;
const cTimers *timers = Timers;
if (timers->GetMatch(event, &TimerMatch) && (TimerMatch == tmFull))
hasTimer = true;
#else
hasTimer = event->HasTimer();
#endif
}
return hasTimer;
}
const cTimer *cRecManager::GetTimerForEvent(const cEvent *event) {
const cTimer *timer = NULL;
if (tvguideConfig.useRemoteTimers && pRemoteTimers) {
if (config.useRemoteTimers && pRemoteTimers) {
RemoteTimers_GetMatch_v1_0 rtMatch;
rtMatch.event = event;
pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch);
@@ -77,7 +85,7 @@ const cTimer *cRecManager::GetTimerForEvent(const cEvent *event) {
cTimer *cRecManager::createTimer(const cEvent *event, std::string path) {
cTimer *timer = NULL;
if (tvguideConfig.useRemoteTimers && pRemoteTimers) {
if (config.useRemoteTimers && pRemoteTimers) {
timer = createRemoteTimer(event, path);
} else {
timer = createLocalTimer(event, path);
@@ -91,10 +99,11 @@ cTimer *cRecManager::createLocalTimer(const cEvent *event, std::string path) {
if (Setup.SVDRPPeering && *Setup.SVDRPDefaultHost)
((cTimer*)timer)->SetRemote(Setup.SVDRPDefaultHost);
LOCK_TIMERS_WRITE;
cTimer *t = Timers->GetTimer(timer);
cTimers* timers = Timers;
#else
cTimer *t = Timers.GetTimer(timer);
cTimers* timers = &Timers;
#endif
cTimer *t = timers->GetTimer(timer);
if (t) {
t->OnOff();
#if VDRVERSNUM >= 20301
@@ -106,19 +115,11 @@ cTimer *cRecManager::createLocalTimer(const cEvent *event, std::string path) {
timer = t;
isyslog("timer %s reactivated", *t->ToDescr());
} else {
#if VDRVERSNUM >= 20301
Timers->Add(timer);
#else
Timers.Add(timer);
#endif
timers->Add(timer);
isyslog("timer %s added (active)", *timer->ToDescr());
}
SetTimerPath(timer, event, path);
#if VDRVERSNUM >= 20301
Timers->SetModified();
#else
Timers.SetModified();
#endif
timers->SetModified();
return timer;
}
@@ -142,9 +143,9 @@ cTimer *cRecManager::createRemoteTimer(const cEvent *event, std::string path) {
}
void cRecManager::SetTimerPath(cTimer *timer, const cEvent *event, std::string path) {
if (tvguideConfig.instRecFolderMode == eFolderFixed) {
if (config.instRecFolderMode == eFolderFixed) {
Epgsearch_services_v1_2 *epgSearch = new Epgsearch_services_v1_2;
std::string recDir = tvguideConfig.instRecFixedFolder;
std::string recDir = config.instRecFixedFolder;
std::replace(recDir.begin(), recDir.end(), '/', '~');
if (strchr(recDir.c_str(), '%') != NULL) {
if (epgSearchPlugin->Service("Epgsearch-services-v1.1", epgSearch)) {
@@ -175,15 +176,14 @@ void cRecManager::SetTimerPath(cTimer *timer, const cEvent *event, std::string p
}
void cRecManager::DeleteTimer(int timerID) {
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
const cTimer *t;
#if VDRVERSNUM >= 20301
cTimer *t;
{
LOCK_TIMERS_WRITE;
LOCK_TIMERS_READ;
t = Timers->Get(timerID);
}
#else
cTimer *t = Timers.Get(timerID);
t = Timers.Get(timerID);
#endif
if (!t)
return;
@@ -191,10 +191,9 @@ void cRecManager::DeleteTimer(int timerID) {
}
void cRecManager::DeleteTimer(const cEvent *event) {
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
if (!event)
return;
if (tvguideConfig.useRemoteTimers && pRemoteTimers) {
if (config.useRemoteTimers && pRemoteTimers) {
DeleteRemoteTimer(event);
} else {
DeleteLocalTimer(event);
@@ -202,7 +201,6 @@ void cRecManager::DeleteTimer(const cEvent *event) {
}
void cRecManager::DeleteLocalTimer(const cEvent *event) {
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
const cTimer *t;
#if VDRVERSNUM >= 20301
{
@@ -218,7 +216,6 @@ void cRecManager::DeleteLocalTimer(const cEvent *event) {
}
void cRecManager::DeleteTimer(const cTimer *timer) {
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
#if VDRVERSNUM >= 20301
LOCK_TIMERS_WRITE;
cTimers* timers = Timers;
@@ -227,7 +224,8 @@ void cRecManager::DeleteTimer(const cTimer *timer) {
cTimers* timers = &Timers;
cTimer* t = timers->GetTimer((cTimer*)timer);
#endif
if (!t)
return;
if (t->Recording()) {
t->Skip();
#if VDRVERSNUM >= 20301
@@ -235,7 +233,7 @@ void cRecManager::DeleteTimer(const cTimer *timer) {
#else
cRecordControls::Process(time(NULL));
#endif
}
}
isyslog("timer %s deleted", *t->ToDescr());
timers->Del(t, true);
timers->SetModified();
@@ -289,7 +287,7 @@ void cRecManager::SaveTimer(const cTimer *t, cTimer newTimerSettings) {
#if VDRVERSNUM < 20300
timer->SetEventFromSchedule();
#endif
if (tvguideConfig.useRemoteTimers && pRemoteTimers) {
if (config.useRemoteTimers && pRemoteTimers) {
RemoteTimers_Timer_v1_0 rt;
rt.timer = timer;
if (!pRemoteTimers->Service("RemoteTimers::ModTimer-v1.0", &rt))
@@ -304,7 +302,6 @@ void cRecManager::SaveTimer(const cTimer *t, cTimer newTimerSettings) {
}
}
bool cRecManager::IsRecorded(const cEvent *event) {
#if VDRVERSNUM >= 20301
LOCK_TIMERS_WRITE;
@@ -337,11 +334,10 @@ cTVGuideTimerConflicts *cRecManager::CheckTimerConflict(void) {
}
void cRecManager::CreateSeriesTimer(cTimer *seriesTimer) {
#if VDRVERSNUM >= 20301
#else
#if VDRVERSNUM < 20300
seriesTimer->SetEventFromSchedule();
#endif
if (tvguideConfig.useRemoteTimers && pRemoteTimers) {
if (config.useRemoteTimers && pRemoteTimers) {
RemoteTimers_Timer_v1_0 rt;
rt.timer = seriesTimer;
if (!pRemoteTimers->Service("RemoteTimers::NewTimer-v1.0", &rt))
@@ -351,12 +347,11 @@ void cRecManager::CreateSeriesTimer(cTimer *seriesTimer) {
#if VDRVERSNUM >= 20301
LOCK_TIMERS_WRITE;
cTimers* timers = Timers;
#else
cTimers* timers = &Timers;
#endif
timers->Add(seriesTimer);
timers->SetModified();
#else
Timers.Add(seriesTimer);
Timers.SetModified();
#endif
}
}
@@ -491,6 +486,52 @@ void cRecManager::GetSearchTimers(std::vector<cTVGuideSearchTimer> *searchTimer)
std::sort(searchTimer->begin(), searchTimer->end());
}
void cRecManager::GetSearchExtCats(std::vector<std::string> *searchExtCats) {
if (!epgSearchAvailable) {
return;
}
Epgsearch_services_v1_1 *epgSearch = new Epgsearch_services_v1_1;
if (epgSearchPlugin->Service("Epgsearch-services-v1.1", epgSearch)) {
std::list<std::string> list;
list = epgSearch->handler->ExtEPGInfoList();
for (std::list<std::string>::iterator it = list.begin(); it != list.end(); it++) {
searchExtCats->push_back(*it);
}
}
}
void cRecManager::GetChannelGroups(std::vector<std::string> *channelGroups) {
if (!epgSearchAvailable) {
return;
}
Epgsearch_services_v1_1 *epgSearch = new Epgsearch_services_v1_1;
if (epgSearchPlugin->Service("Epgsearch-services-v1.1", epgSearch)) {
std::list<std::string> list;
list = epgSearch->handler->ChanGrpList();
for (std::list<std::string>::iterator it = list.begin(); it != list.end(); it++) {
channelGroups->push_back(*it);
}
}
std::sort(channelGroups->begin(), channelGroups->end());
}
void cRecManager::GetBlacklists(std::vector<std::string> *blacklists) {
if (!epgSearchAvailable) {
return;
}
Epgsearch_services_v1_1 *epgSearch = new Epgsearch_services_v1_1;
if (epgSearchPlugin->Service("Epgsearch-services-v1.1", epgSearch)) {
std::list<std::string> list;
list = epgSearch->handler->BlackList();
for (std::list<std::string>::iterator it = list.begin(); it != list.end(); it++) {
blacklists->push_back(*it);
}
}
}
int cRecManager::CreateSearchTimer(std::string epgSearchString) {
int timerID = -1;
if (!epgSearchAvailable)
@@ -547,7 +588,7 @@ void cRecManager::DeleteSearchTimer(cTVGuideSearchTimer *searchTimer, bool delTi
timers = &Timers;
#endif
cTimer *timer = timers->First();
while(timer) {
while (timer) {
if (!timer->Recording()) {
char* searchID = GetAuxValue(timer, "s-id");
if (searchID) {
@@ -571,9 +612,9 @@ void cRecManager::DeleteSearchTimer(cTVGuideSearchTimer *searchTimer, bool delTi
if (epgSearchPlugin->Service("Epgsearch-services-v1.1", epgSearch)) {
bool success = epgSearch->handler->DelSearchTimer(searchTimerID);
if (success) {
esyslog("tvguide: search timer \"%s\" sucessfully deleted", searchTimer->SearchString().c_str());
esyslog("tvguide: search timer \"%s\" sucessfully deleted", searchTimer->GetSearchString().c_str());
} else {
esyslog("tvguide: error deleting search timer \"%s\"", searchTimer->SearchString().c_str());
esyslog("tvguide: error deleting search timer \"%s\"", searchTimer->GetSearchString().c_str());
}
}
}
@@ -676,8 +717,8 @@ const cEvent **cRecManager::LoadReruns(const cEvent *event, int &numResults) {
if (epgSearchAvailable && !isempty(event->Title())) {
Epgsearch_searchresults_v1_0 data;
std::string strQuery = event->Title();
if (tvguideConfig.useSubtitleRerun > 0) {
if (tvguideConfig.useSubtitleRerun == 2 || !isempty(event->ShortText()))
if (config.useSubtitleRerun > 0) {
if (config.useSubtitleRerun == 2 || !isempty(event->ShortText()))
strQuery += "~";
if (!isempty(event->ShortText()))
strQuery += event->ShortText();
@@ -739,31 +780,23 @@ const cEvent **cRecManager::WhatsOnNow(bool nowOrNext, int &numResults) {
std::vector<const cEvent*> tmpResults;
#if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ;
const cChannels* channels = Channels;
LOCK_SCHEDULES_READ;
const cSchedules* schedules = Schedules;
#else
cChannels* channels = &Channels;
cSchedulesLock schedulesLock;
const cSchedules *schedules = cSchedules::Schedules(schedulesLock);
#endif
const cChannel *startChannel = NULL, *stopChannel = NULL;
if (tvguideConfig.favLimitChannels) {
#if VDRVERSNUM >= 20301
startChannel = Channels->GetByNumber(tvguideConfig.favStartChannel);
stopChannel = Channels->GetByNumber(tvguideConfig.favStopChannel);
if (config.favLimitChannels) {
startChannel = channels->GetByNumber(config.favStartChannel);
stopChannel = channels->GetByNumber(config.favStopChannel);
}
if (!startChannel)
startChannel = Channels->First();
startChannel = channels->First();
for (const cChannel *channel = startChannel; channel; channel = Channels->Next(channel)) {
#else
startChannel = Channels.GetByNumber(tvguideConfig.favStartChannel);
stopChannel = Channels.GetByNumber(tvguideConfig.favStopChannel);
}
if (!startChannel)
startChannel = Channels.First();
for (const cChannel *channel = startChannel; channel; channel = Channels.Next(channel)) {
#endif
for (const cChannel *channel = startChannel; channel; channel = channels->Next(channel)) {
if (channel->GroupSep()) continue;
const cSchedule *Schedule = schedules->GetSchedule(channel);
if (!Schedule) continue;
@@ -792,13 +825,13 @@ const cEvent **cRecManager::UserDefinedTime(int userTime, int &numResults) {
std::vector<const cEvent*> tmpResults;
int favTime = 0;
if (userTime == 1) {
favTime = tvguideConfig.favTime1;
favTime = config.favTime1;
} else if (userTime == 2) {
favTime = tvguideConfig.favTime2;
favTime = config.favTime2;
} else if (userTime == 3) {
favTime = tvguideConfig.favTime3;
favTime = config.favTime3;
} else if (userTime == 4) {
favTime = tvguideConfig.favTime4;
favTime = config.favTime4;
}
time_t now = time(0);
@@ -815,32 +848,23 @@ const cEvent **cRecManager::UserDefinedTime(int userTime, int &numResults) {
#if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ;
const cChannels* channels = Channels;
LOCK_SCHEDULES_READ;
// const cChannels* channels = Channels;
const cSchedules* schedules = Schedules;
#else
cChannels* channels = &Channels;
cSchedulesLock schedulesLock;
const cSchedules *schedules = cSchedules::Schedules(schedulesLock);
#endif
const cChannel *startChannel = NULL, *stopChannel = NULL;
if (tvguideConfig.favLimitChannels) {
#if VDRVERSNUM >= 20301
startChannel = Channels->GetByNumber(tvguideConfig.favStartChannel);
stopChannel = Channels->GetByNumber(tvguideConfig.favStopChannel);
if (config.favLimitChannels) {
startChannel = channels->GetByNumber(config.favStartChannel);
stopChannel = channels->GetByNumber(config.favStopChannel);
}
if (!startChannel)
startChannel = Channels->First();
startChannel = channels->First();
for (const cChannel *channel = startChannel; channel; channel = Channels->Next(channel)) {
#else
startChannel = Channels.GetByNumber(tvguideConfig.favStartChannel);
stopChannel = Channels.GetByNumber(tvguideConfig.favStopChannel);
}
if (!startChannel)
startChannel = Channels.First();
for (const cChannel *channel = startChannel; channel; channel = Channels.Next(channel)) {
#endif
for (const cChannel *channel = startChannel; channel; channel = channels->Next(channel)) {
if (channel->GroupSep()) continue;
const cSchedule *Schedule = schedules->GetSchedule(channel);
if (!Schedule) continue;

View File

@@ -46,6 +46,9 @@ public:
const cEvent **PerformSearch(Epgsearch_searchresults_v1_0 data, int &numResults);
void ReadEPGSearchTemplates(std::vector<TVGuideEPGSearchTemplate> *epgTemplates);
void GetSearchTimers(std::vector<cTVGuideSearchTimer> *timers);
void GetSearchExtCats(std::vector<std::string> *searchExtCats);
void GetChannelGroups(std::vector<std::string> *channelGroups);
void GetBlacklists(std::vector<std::string> *blacklists);
int CreateSearchTimer(std::string epgSearchString);
bool SaveSearchTimer(cTVGuideSearchTimer *searchTimer);
void DeleteSearchTimer(cTVGuideSearchTimer *searchTimer, bool delTimers);

View File

@@ -5,7 +5,7 @@
cRecMenu::cRecMenu(void) {
border = geoManager.borderRecMenus;
height = 2*border;
height = 2 * border;
headerHeight = 0;
footerHeight = 0;
currentHeight = 0;
@@ -54,25 +54,29 @@ int cRecMenu::CalculateOptimalWidth(void) {
}
bool cRecMenu::CalculateHeight(bool reDraw) {
int newHeight = 2*border;
if (header)
int newHeight = 2 * border;
bool returnvalue = false;
if (header) {
newHeight += headerHeight;
for (std::list<cRecMenuItem*>::iterator item = menuItems.begin(); item != menuItems.end(); item++) {
newHeight += (*item)->GetHeight();
}
if (footer)
for (std::list<cRecMenuItem*>::iterator item = menuItems.begin(); item != menuItems.end(); item++) {
newHeight += (*item)->GetHeight();
}
if (footer) {
newHeight += footerHeight;
}
y = (geoManager.osdHeight - newHeight) / 2;
if (newHeight != height) {
height = newHeight;
if (scrollable && !reDraw) {
width += scrollbarWidth + border;
}
return true;
returnvalue = true;
}
return false;
if (scrollable && !reDraw) {
width += scrollbarWidth + border;
returnvalue = true;
}
return returnvalue;
}
void cRecMenu::CreatePixmap(void) {
@@ -141,7 +145,6 @@ void cRecMenu::InitMenu(bool complete) {
}
void cRecMenu::AddMenuItem(cRecMenuItem *item, bool inFront) {
item->Show();
if (!inFront)
@@ -153,7 +156,7 @@ void cRecMenu::AddMenuItem(cRecMenuItem *item, bool inFront) {
bool cRecMenu::AddMenuItemInitial(cRecMenuItem *item, bool inFront) {
currentHeight += item->GetHeight();
int totalHeight = headerHeight + footerHeight + currentHeight + 2*border;
if (totalHeight >= geoManager.osdHeight - 10) {
if (totalHeight >= geoManager.osdHeight - 80) {
scrollable = true;
currentHeight -= item->GetHeight();
if (deleteMenuItems) {
@@ -434,14 +437,16 @@ void cRecMenu::JumpBegin(void) {
if (currentItem >= numItems)
break;
}
Arrange(true);
if (CalculateHeight(true))
CreatePixmap();
Arrange(false);
startIndex = 0;
stopIndex = numItems-1;
stopIndex = numItems - 1;
cRecMenuItem *first = menuItems.front();
first->setActive();
first->setBackground();
first->Draw();
Display(true);
Display(false);
}
}
@@ -470,7 +475,7 @@ void cRecMenu::JumpEnd(void) {
activeItem->setBackground();
ClearMenuItems();
int totalNumItems = GetTotalNumMenuItems();
int currentItem = totalNumItems-1;
int currentItem = totalNumItems - 1;
int itemsAdded = 0;
cRecMenuItem *newItem = NULL;
while (newItem = GetMenuItem(currentItem)) {
@@ -480,7 +485,9 @@ void cRecMenu::JumpEnd(void) {
if (itemsAdded >= numItems)
break;
}
Arrange(true);
if (CalculateHeight(true))
CreatePixmap();
Arrange(false);
stopIndex = totalNumItems;
startIndex = stopIndex - numItems;
if (footer) {
@@ -493,7 +500,7 @@ void cRecMenu::JumpEnd(void) {
last->setBackground();
last->Draw();
}
Display(true);
Display(false);
}
}
@@ -525,7 +532,7 @@ void cRecMenu::Arrange(bool scroll) {
}
void cRecMenu::Display(bool scroll) {
if (tvguideConfig.style == eStyleGraphical) {
if (config.style == eStyleGraphical) {
drawBackgroundGraphical(bgRecMenuBack);
} else {
pixmap->Fill(theme.Color(clrBackground));
@@ -667,7 +674,7 @@ eRecMenuState cRecMenu::ProcessKey(eKeys Key) {
cImage *cRecMenu::createScrollbar(int width, int height, tColor clrBgr, tColor clrBlend) {
cImage *image = new cImage(cSize(width, height));
image->Fill(clrBgr);
if (tvguideConfig.style != eStyleFlat) {
if (config.style != eStyleFlat) {
int numSteps = 64;
int alphaStep = 0x03;
if (height < 30)
@@ -692,4 +699,4 @@ cImage *cRecMenu::createScrollbar(int width, int height, tColor clrBgr, tColor c
}
}
return image;
}
}

View File

@@ -36,7 +36,7 @@ void cRecMenuItem::SetPixmaps(void) {
}
void cRecMenuItem::setBackground(void) {
if (tvguideConfig.style == eStyleGraphical) {
if (config.style == eStyleGraphical) {
if (defaultBackground) {
drawBackgroundGraphical(bgButton, active);
}
@@ -52,7 +52,7 @@ void cRecMenuItem::setBackground(void) {
colorBlending = theme.Color(clrGrid1Blending);
colorText = theme.Color(clrFont);
}
colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent;
colorTextBack = (config.style == eStyleFlat)?color:clrTransparent;
if (defaultBackground) {
drawBackground();
drawBorder();
@@ -177,7 +177,7 @@ void cRecMenuItemButtonYesNo::Show(void) {
}
void cRecMenuItemButtonYesNo::setBackground() {
if (tvguideConfig.style == eStyleGraphical) {
if (config.style == eStyleGraphical) {
drawBackgroundGraphical(bgButton, yesActive&&active);
colorTextBack = clrTransparent;
colorTextNoBack = clrTransparent;
@@ -213,8 +213,8 @@ void cRecMenuItemButtonYesNo::setBackground() {
theme.Color(clrGrid1Blending));
colorTextNo = theme.Color(clrFont);
}
colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent;
colorTextNoBack = (tvguideConfig.style == eStyleFlat)?colorNoBack:clrTransparent;
colorTextBack = (config.style == eStyleFlat)?color:clrTransparent;
colorTextNoBack = (config.style == eStyleFlat)?colorNoBack:clrTransparent;
drawBackground();
drawBorder();
pixmapNo->drawBackground();
@@ -275,7 +275,7 @@ cRecMenuItemInfo::~cRecMenuItemInfo(void) {
void cRecMenuItemInfo::CalculateHeight(int textWidth) {
wrapper.Set(*text, fontInfo, textWidth);
height = fontInfo->Height() * wrapper.Lines() + 2*border;
height = fontInfo->Height() * wrapper.Lines() + 2 * border;
}
void cRecMenuItemInfo::setBackground(void) {
@@ -297,7 +297,6 @@ void cRecMenuItemInfo::Draw(void) {
// --- cRecMenuItemInt -------------------------------------------------------
cRecMenuItemInt::cRecMenuItemInt(cString text,
int initialVal,
int minVal,
int maxVal,
bool active,
@@ -305,7 +304,7 @@ cRecMenuItemInt::cRecMenuItemInt(cString text,
eRecMenuState action) {
selectable = true;
this->text = text;
this->currentVal = initialVal;
this->currentVal = *callback;
this->minVal = minVal;
this->maxVal = maxVal;
this->active = active;
@@ -371,7 +370,7 @@ eRecMenuState cRecMenuItemInt::ProcessKey(eKeys Key) {
*callback = currentVal;
DrawValue();
}
return rmsConsumed;
return (currentVal == 0) ? rmsRefresh : rmsConsumed;
break;
case kRight:
fresh = true;
@@ -381,7 +380,7 @@ eRecMenuState cRecMenuItemInt::ProcessKey(eKeys Key) {
*callback = currentVal;
DrawValue();
}
return rmsConsumed;
return (currentVal == 1) ? rmsRefresh : rmsConsumed;
break;
case k0 ... k9:
if (fresh) {
@@ -406,14 +405,13 @@ eRecMenuState cRecMenuItemInt::ProcessKey(eKeys Key) {
// --- cRecMenuItemBool -------------------------------------------------------
cRecMenuItemBool::cRecMenuItemBool(cString text,
bool initialVal,
bool refresh,
bool active,
bool *callback,
eRecMenuState action) {
eRecMenuState action,
bool refresh) {
selectable = true;
this->text = text;
this->yes = initialVal;
this->yes = *callback;
this->refresh = refresh;
this->active = active;
this->callback = callback;
@@ -422,6 +420,22 @@ cRecMenuItemBool::cRecMenuItemBool(cString text,
pixmapVal = NULL;
}
cRecMenuItemBool::cRecMenuItemBool(cString text,
bool active,
int *callback,
eRecMenuState action,
bool refresh) {
selectable = true;
this->text = text;
this->yes = *callback;
this->refresh = refresh;
this->active = active;
this->callback = (bool*)callback;
this->action = action;
height = 3 * font->Height() / 2;
pixmapVal = NULL;
}
cRecMenuItemBool::~cRecMenuItemBool(void) {
if (pixmapVal)
osdManager.releasePixmap(pixmapVal);
@@ -455,7 +469,7 @@ void cRecMenuItemBool::Draw(void) {
void cRecMenuItemBool::DrawValue(void) {
pixmapVal->Fill(clrTransparent);
std::string strIcon = yes?"yes":"no";
std::string strIcon = yes ? "yes" : "no";
int iconSize = height - 8;
int iconX = width - iconSize - 10;
int iconY = (height - iconSize) / 2;
@@ -490,20 +504,20 @@ eRecMenuState cRecMenuItemBool::ProcessKey(eKeys Key) {
// --- cRecMenuItemSelect -------------------------------------------------------
cRecMenuItemSelect::cRecMenuItemSelect(cString text,
std::vector<std::string> Strings,
int initialVal,
bool active,
int *callback,
eRecMenuState action) {
eRecMenuState action,
bool refresh) {
selectable = true;
this->text = text;
strings = Strings;
numValues = Strings.size();
if ((initialVal < 0) || (initialVal > numValues-1))
this->currentVal = *callback;
if ((this->currentVal < 0) || (this->currentVal > numValues - 1))
this->currentVal = 0;
else
this->currentVal = initialVal;
this->active = active;
this->callback = callback;
this->refresh = refresh;
this->action = action;
height = 3 * font->Height() / 2;
pixmapVal = NULL;
@@ -571,14 +585,20 @@ eRecMenuState cRecMenuItemSelect::ProcessKey(eKeys Key) {
if (callback)
*callback = currentVal;
DrawValue();
return rmsConsumed;
if (refresh)
return rmsRefresh;
else
return rmsConsumed;
break;
case kRight:
currentVal = (currentVal+1)%numValues;
if (callback)
*callback = currentVal;
DrawValue();
return rmsConsumed;
if (refresh)
return rmsRefresh;
else
return rmsConsumed;
break;
case kOk:
return action;
@@ -604,8 +624,8 @@ cRecMenuItemSelectDirectory::cRecMenuItemSelectDirectory(cString text,
height = 3 * font->Height() / 2;
pixmapVal = NULL;
folders.push_back(tr("root video folder"));
if (isSearchTimer && tvguideConfig.instRecFixedFolder.size() > 0)
folders.push_back(tvguideConfig.instRecFixedFolder);
if (isSearchTimer && config.instRecFixedFolder.size() > 0)
folders.push_back(config.instRecFixedFolder);
ReadRecordingDirectories(&folders, NULL, "");
numValues = folders.size();
this->currentVal = GetInitial();
@@ -645,9 +665,9 @@ void cRecMenuItemSelectDirectory::Draw(void) {
void cRecMenuItemSelectDirectory::DrawValue(void) {
pixmapVal->Fill(clrTransparent);
int iconSize = min(128, height);
int textX = width - font->Width(folders[currentVal].c_str()) - iconSize;
int textX = std::max(width - font->Width(folders[currentVal].c_str()) - iconSize, 10 + font->Width(*text) + 2 * iconSize);
int textY = (height - font->Height()) / 2;
pixmapVal->DrawText(cPoint(textX, textY), folders[currentVal].c_str(), colorText, clrTransparent, font);
pixmapVal->DrawText(cPoint(textX, textY), folders[currentVal].c_str(), colorText, clrTransparent, font, width - textX - iconSize, font->Height(), taTop | taRight);
int iconLeftX = textX - iconSize;
int iconRightX = width - iconSize;
int iconY = (height - iconSize) / 2;
@@ -713,13 +733,12 @@ int cRecMenuItemSelectDirectory::GetInitial(void) {
// --- cRecMenuItemText -------------------------------------------------------
cRecMenuItemText::cRecMenuItemText(cString title,
char *initialVal,
int length,
bool active,
char *callback) {
selectable = true;
this->title = title;
value = initialVal;
value = callback;
this->active = active;
this->callback = callback;
height = 3 * font->Height();
@@ -1286,13 +1305,12 @@ eRecMenuState cRecMenuItemText::ProcessKey(eKeys Key) {
// --- cRecMenuItemTime -------------------------------------------------------
cRecMenuItemTime::cRecMenuItemTime(cString text,
int initialVal,
bool active,
int *callback,
eRecMenuState action) {
selectable = true;
this->text = text;
this->value = initialVal;
this->value = *callback;
hh = value / 100;
mm = value % 100;
pos = 0;
@@ -1430,13 +1448,12 @@ eRecMenuState cRecMenuItemTime::ProcessKey(eKeys Key) {
// --- cRecMenuItemDay -------------------------------------------------------
cRecMenuItemDay::cRecMenuItemDay(cString text,
time_t initialVal,
bool active,
time_t *callback,
eRecMenuState action) {
selectable = true;
this->text = text;
this->currentVal = cTimer::SetTime(initialVal, 0);
this->currentVal = cTimer::SetTime(*callback, 0);
this->active = active;
this->callback = callback;
this->action = action;
@@ -1576,9 +1593,9 @@ void cRecMenuItemTimer::Draw(void) {
channelName = channel->Name();
}
int logoX = DrawIcons();
int logoWidth = height * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio;
int logoWidth = height * config.logoWidthRatio / config.logoHeightRatio;
cImageLoader imgLoader;
if (!tvguideConfig.hideChannelLogos) {
if (!config.hideChannelLogos) {
if (imgLoader.LoadLogo(channel, logoWidth, height)) {
cImage logo = imgLoader.GetImage();
pixmapIcons->DrawImage(cPoint(logoX, 0), logo);
@@ -1713,7 +1730,7 @@ cRecMenuItemTimerConflictHeader::cRecMenuItemTimerConflictHeader(time_t conflict
this->conflictStop = conflictStop;
this->overlapStart = overlapStart;
this->overlapStop = overlapStop;
height = 3*font->Height()/2;
height = 3 * font->Height() / 2;
pixmapStatus = NULL;
}
@@ -1787,7 +1804,7 @@ cRecMenuItemEvent::cRecMenuItemEvent(const cEvent *event,
this->action2 = action2;
iconActive = 0;
this->active = active;
height = font->Height() + 2*fontSmall->Height() + 10;
height = font->Height() + 2 * fontSmall->Height() + 10;
pixmapText = NULL;
pixmapIcons = NULL;
}
@@ -1802,13 +1819,13 @@ cRecMenuItemEvent::~cRecMenuItemEvent(void) {
void cRecMenuItemEvent::SetPixmaps(void) {
if (!pixmap) {
pixmap = osdManager.requestPixmap(4, cRect(x, y, width, height));
pixmapText = osdManager.requestPixmap(5, cRect(x, y, width, height));
pixmapText = osdManager.requestPixmap(5, cRect(x, y, width - height / 2 - 10, height));
pixmapText->Fill(clrTransparent);
pixmapIcons = osdManager.requestPixmap(6, cRect(x, y, width, height));
pixmapIcons->Fill(clrTransparent);
} else {
pixmap->SetViewPort(cRect(x, y, width, height));
pixmapText->SetViewPort(cRect(x, y, width, height));
pixmapText->SetViewPort(cRect(x, y, width - height / 2 - 10, height));
pixmapIcons->SetViewPort(cRect(x, y, width, height));
}
}
@@ -1826,9 +1843,9 @@ void cRecMenuItemEvent::Draw(void) {
cString channelName = "";
if (channel)
channelName = channel->Name();
int logoWidth = height * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio;
int logoWidth = height * config.logoWidthRatio / config.logoHeightRatio;
cImageLoader imgLoader;
if (!tvguideConfig.hideChannelLogos) {
if (!config.hideChannelLogos) {
if (imgLoader.LoadLogo(channel, logoWidth, height)) {
cImage logo = imgLoader.GetImage();
pixmapText->DrawImage(cPoint(logoX, (height - logo.Height()) / 2), logo);
@@ -1861,7 +1878,7 @@ int cRecMenuItemEvent::DrawIcons(void) {
int iconY = (height - iconSize) / 2;
std::string iconInfo;
if (active) {
iconInfo = (iconActive==0)?"info_active":"info_inactive";
iconInfo = (iconActive == 0) ? "info_active" : "info_inactive";
} else {
iconInfo = "info_inactive";
}
@@ -1871,7 +1888,6 @@ int cRecMenuItemEvent::DrawIcons(void) {
iconsX += iconSize + 5;
}
iconY = height - iconSize - 10;
if (event->HasTimer()) {
cImage *imgHasTimer = imgCache.GetIcon("activetimer", iconSize, iconSize);
if (imgHasTimer) {
@@ -1919,18 +1935,21 @@ eRecMenuState cRecMenuItemEvent::ProcessKey(eKeys Key) {
// --- cRecMenuItemChannelChooser -------------------------------------------------------
cRecMenuItemChannelChooser::cRecMenuItemChannelChooser(cString text,
#if VDRVERSNUM >= 20301
const cChannel *initialChannel,
#else
cChannel *initialChannel,
#endif
bool active,
int *callback,
eRecMenuState action) {
selectable = true;
this->text = text;
this->channel = initialChannel;
if (initialChannel)
#if VDRVERSNUM >= 20301
{
LOCK_CHANNELS_READ;
channels = Channels;
}
#else
channels = &Channels;
#endif
this->channel = channels->GetByNumber(*callback);
if (callback)
initialChannelSet = true;
else
initialChannelSet = false;
@@ -1939,7 +1958,7 @@ cRecMenuItemChannelChooser::cRecMenuItemChannelChooser(cString text,
this->active = active;
this->callback = callback;
this->action = action;
height = 2 * font->Height();
height = 3 * font->Height() / 2;
pixmapChannel = NULL;
}
@@ -1981,12 +2000,12 @@ void cRecMenuItemChannelChooser::DrawValue(void) {
cString textVal = cString::sprintf("%d - %s", channel->Number(), channel->Name());
int textX = width - font->Width(*textVal) - 10;
pixmapChannel->DrawText(cPoint(textX, textY), *textVal, colorText, clrTransparent, font);
int logoWidth = height * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio;
int logoWidth = height * config.logoWidthRatio / config.logoHeightRatio;
int logoX = textX - logoWidth - 10;
cImageLoader imgLoader;
if (imgLoader.LoadLogo(channel, logoWidth, height)) {
if (imgLoader.LoadLogo(channel, logoWidth, height - 10)) {
cImage logo = imgLoader.GetImage();
pixmapChannel->DrawImage(cPoint(logoX, 0), logo);
pixmapChannel->DrawImage(cPoint(logoX, 5), logo);
}
} else {
cString textVal = tr("all Channels");
@@ -2008,29 +2027,15 @@ eRecMenuState cRecMenuItemChannelChooser::ProcessKey(eKeys Key) {
fresh = true;
if (!channel)
return rmsConsumed;
#if VDRVERSNUM >= 20301
const cChannel *prev = channel;
LOCK_CHANNELS_READ;
const cChannel *firstChannel = Channels->First();
#else
cChannel *prev = channel;
cChannel *firstChannel = Channels.First();
#endif
const cChannel *firstChannel = channels->First();
if(firstChannel->GroupSep())
#if VDRVERSNUM >= 20301
firstChannel = Channels->Next(firstChannel);
#else
firstChannel = Channels.Next(firstChannel);
#endif
firstChannel = channels->Next(firstChannel);
if (prev == firstChannel) {
if (!initialChannelSet)
channel = NULL;
} else {
#if VDRVERSNUM >= 20301
while (prev = Channels->Prev(prev)) {
#else
while (prev = Channels.Prev(prev)) {
#endif
while (prev = channels->Prev(prev)) {
if(!prev->GroupSep()) {
channel = prev;
break;
@@ -2047,30 +2052,14 @@ eRecMenuState cRecMenuItemChannelChooser::ProcessKey(eKeys Key) {
return rmsConsumed;
break; }
case kRight: {
#if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ;
#endif
fresh = true;
if (!channel) {
#if VDRVERSNUM >= 20301
channel = Channels->First();
#else
channel = Channels.First();
#endif
channel = channels->First();
if(channel->GroupSep())
#if VDRVERSNUM >= 20301
channel = Channels->Next(channel);
#else
channel = Channels.Next(channel);
#endif
channel = channels->Next(channel);
} else {
#if VDRVERSNUM >= 20301
const cChannel *next = channel;
while (next = Channels->Next(next)) {
#else
cChannel *next = channel;
while (next = Channels.Next(next)) {
#endif
while (next = channels->Next(next)) {
if(!next->GroupSep()) {
channel = next;
break;
@@ -2092,12 +2081,7 @@ eRecMenuState cRecMenuItemChannelChooser::ProcessKey(eKeys Key) {
fresh = false;
}
channelNumber = channelNumber * 10 + (Key - k0);
#if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ;
const cChannel *chanNew = Channels->GetByNumber(channelNumber);
#else
cChannel *chanNew = Channels.GetByNumber(channelNumber);
#endif
chanNew = channels->GetByNumber(channelNumber);
if (chanNew) {
channel = chanNew;
DrawValue();
@@ -2116,17 +2100,16 @@ eRecMenuState cRecMenuItemChannelChooser::ProcessKey(eKeys Key) {
// --- cRecMenuItemDayChooser -------------------------------------------------------
cRecMenuItemDayChooser::cRecMenuItemDayChooser(cString text,
int weekdays,
bool active,
int *callback) {
selectable = true;
this->text = text;
this->weekdays = *callback;
if (weekdays < 1)
weekdays *= -1;
this->weekdays = weekdays;
this->active = active;
this->callback = callback;
height = 2 * font->Height();
height = 3 * font->Height() / 2;
selectedDay = 0;
pixmapWeekdays = NULL;
pixmapWeekdaysSelect = NULL;
@@ -2167,13 +2150,13 @@ void cRecMenuItemDayChooser::Show(void) {
void cRecMenuItemDayChooser::SetSizes(void) {
days = trVDR("MTWTFSS");
int maxWidth = 0;
for (unsigned i=0; i<days.length(); ++i) {
for (unsigned i = 0; i < days.length(); ++i) {
int charWidth = font->Width(days.at(i));
if (charWidth > maxWidth)
maxWidth = charWidth;
}
daysSize = min(maxWidth + 15, height-4);
daysX = width - 10 - 7*daysSize;
daysSize = min(maxWidth + 15, height - 4);
daysX = width - 10 - 7 * daysSize;
daysY = (height - daysSize) / 2;
}
@@ -2195,13 +2178,13 @@ void cRecMenuItemDayChooser::Draw(void) {
void cRecMenuItemDayChooser::DrawDays(void) {
pixmapWeekdays->Fill(clrTransparent);
int textY = (height - font->Height()) / 2;
pixmapWeekdays->DrawRectangle(cRect(daysX, daysY, 7*daysSize, daysSize), theme.Color(clrBorder));
pixmapWeekdays->DrawRectangle(cRect(daysX, daysY, 7 * daysSize, daysSize), theme.Color(clrBorder));
int currentX = daysX;
for (unsigned day=0; day<days.length(); ++day) {
for (unsigned day = 0; day < days.length(); ++day) {
cString strDay = cString::sprintf("%c", days.at(day));
pixmapWeekdays->DrawRectangle(cRect(currentX+2, daysY+2, daysSize-4, daysSize-4), theme.Color(clrBackground));
tColor colorDay = WeekDaySet(day)?theme.Color(clrRecMenuDayActive)
:theme.Color(clrRecMenuDayInactive);
pixmapWeekdays->DrawRectangle(cRect(currentX + 2, daysY + 2, daysSize - 4, daysSize - 4), theme.Color(clrBackground));
tColor colorDay = WeekDaySet(day) ? theme.Color(clrRecMenuDayActive)
: theme.Color(clrRecMenuDayInactive);
int textX = currentX + (daysSize - font->Width(*strDay)) / 2;
pixmapWeekdays->DrawText(cPoint(textX, textY), *strDay, colorDay, clrTransparent, font);
currentX += daysSize;
@@ -2211,7 +2194,7 @@ void cRecMenuItemDayChooser::DrawDays(void) {
void cRecMenuItemDayChooser::DrawHighlight(int day) {
pixmapWeekdaysSelect->Fill(clrTransparent);
if (day > -1) {
int currentX = daysX + day*daysSize;
int currentX = daysX + day * daysSize;
pixmapWeekdaysSelect->DrawRectangle(cRect(currentX, daysY, daysSize, daysSize), theme.Color(clrRecMenuDayHighlight));
}
}
@@ -2237,13 +2220,13 @@ eRecMenuState cRecMenuItemDayChooser::ProcessKey(eKeys Key) {
switch (Key & ~k_Repeat) {
case kLeft: {
selectedDay--;
if (selectedDay<0)
if (selectedDay < 0)
selectedDay += 7;
DrawHighlight(selectedDay);
return rmsConsumed;
break; }
case kRight: {
selectedDay = (selectedDay+1)%7;
selectedDay = (selectedDay + 1) % 7;
DrawHighlight(selectedDay);
return rmsConsumed;
break; }
@@ -2263,7 +2246,7 @@ cRecMenuItemRecording::cRecMenuItemRecording(const cRecording *recording, bool a
selectable = true;
this->recording = recording;
this->active = active;
height = font->Height() + 2*fontSmall->Height() + 10;
height = font->Height() + 2 * fontSmall->Height() + 10;
pixmapText = NULL;
}
@@ -2291,7 +2274,7 @@ void cRecMenuItemRecording::Draw(void) {
LOCK_CHANNELS_READ;
const cChannel *channel = Channels->GetByChannelID(recInfo->ChannelID());
#else
cChannel *channel = Channels.GetByChannelID(recInfo->ChannelID());
const cChannel *channel = Channels.GetByChannelID(recInfo->ChannelID());
#endif
cString channelName = tr("unknown channel");
if (channel)
@@ -2395,10 +2378,10 @@ void cRecMenuItemTimelineHeader::DrawCurrentTimer(void) {
const cChannel *channel = timer->Channel();
int x = 0;
if (channel) {
int logoWidth = infoHeight * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio;
int logoWidth = infoHeight * config.logoWidthRatio / config.logoHeightRatio;
bool logoDrawn = false;
cImageLoader imgLoader;
if (!tvguideConfig.hideChannelLogos) {
if (!config.hideChannelLogos) {
if (imgLoader.LoadLogo(channel, logoWidth, infoHeight)) {
cImage logo = imgLoader.GetImage();
pixmapTimerInfo->DrawImage(cPoint(0, 0), logo);
@@ -2406,7 +2389,7 @@ void cRecMenuItemTimelineHeader::DrawCurrentTimer(void) {
logoDrawn = true;
}
}
if (tvguideConfig.hideChannelLogos || !logoDrawn) {
if (config.hideChannelLogos || !logoDrawn) {
int channelNameWidth = fontSmall->Width(channel->Name());
pixmapTimerInfo->DrawText(cPoint(10, (infoHeight - fontSmall->Height())/2), channel->Name(), colorText, clrTransparent, fontSmall);
x += channelNameWidth + 20;
@@ -2708,18 +2691,19 @@ void cRecMenuItemSearchTimer::SetPixmaps(void) {
void cRecMenuItemSearchTimer::Draw(void) {
int textX = DrawIcons();
bool timerIsActive = timer.IsActive();
pixmapText->Fill(clrTransparent);
textX += 20;
cString label;
if (timer.Active()) {
label = cString::sprintf("\"%s\"", timer.SearchString().c_str());
} else {
label = cString::sprintf("\"%s\" (%s)", timer.SearchString().c_str(), tr("inactive"));
}
cString label = cString::sprintf("\"%s\"", timer.GetSearchString().c_str());
cString inactive = cString::sprintf("(%s)", tr("inactive"));
int numTimersActive = timer.GetNumTimers();
int numRecordings = timer.GetNumRecordings();
cString info = cString::sprintf("%s: %d, %s: %d", tr("active timers"), numTimersActive, tr("recordings done"), numRecordings);
pixmapText->DrawText(cPoint(textX, 5 + (height/2 - font->Height())/2), *label, colorText, clrTransparent, font);
pixmapText->DrawText(cPoint(textX, 5 + (height/2 - font->Height()) / 2), *label, colorText, clrTransparent, font);
if (!timerIsActive) {
pixmapText->DrawText(cPoint(textX, 5 + (height - font->Height()) / 2), *inactive, colorText, clrTransparent, font, width - textX - 20, 0, taRight);
}
pixmapText->DrawText(cPoint(textX, height/2 + (height/2 - fontSmall->Height())/2), *info, colorText, clrTransparent, fontSmall);
}
@@ -2836,7 +2820,7 @@ void cRecMenuItemFavorite::Draw(void) {
int textX = DrawIcons();
pixmapText->Fill(clrTransparent);
textX += 20;
cString label = cString::sprintf("\"%s\"", favorite.SearchString().c_str());
cString label = cString::sprintf("\"%s\"", favorite.GetSearchString().c_str());
pixmapText->DrawText(cPoint(textX, (height - fontLarge->Height())/2), *label, colorText, clrTransparent, fontLarge);
}

View File

@@ -46,7 +46,6 @@ enum eRecMenuState {
rmsSearchTimerOptions,
rmsSearchTimers,
rmsSearchTimerEdit,
rmsSearchTimerEditAdvanced,
rmsSearchTimerTest,
rmsSearchTimerSave,
rmsSearchTimerCreateWithTemplate,
@@ -200,7 +199,6 @@ private:
void DrawValue(void);
public:
cRecMenuItemInt(cString text,
int initialVal,
int minVal,
int maxVal,
bool active = false,
@@ -227,11 +225,15 @@ private:
void DrawValue(void);
public:
cRecMenuItemBool(cString text,
bool initialVal,
bool refresh = false,
bool active = false,
bool *callback = NULL,
eRecMenuState action = rmsNotConsumed);
eRecMenuState action = rmsNotConsumed,
bool refresh = false);
cRecMenuItemBool(cString text,
bool active = false,
int *callback = NULL,
eRecMenuState action = rmsNotConsumed,
bool refresh = false);
virtual ~cRecMenuItemBool(void);
void SetPixmaps(void);
void Hide(void);
@@ -247,6 +249,7 @@ private:
cString text;
int currentVal;
int *callback;
bool refresh;
std::vector<std::string> strings;
int numValues;
cPixmap *pixmapVal;
@@ -254,10 +257,10 @@ private:
public:
cRecMenuItemSelect(cString text,
std::vector<std::string> Strings,
int initialVal,
bool active = false,
int *callback = NULL,
eRecMenuState action = rmsNotConsumed);
eRecMenuState action = rmsNotConsumed,
bool refresh = false);
virtual ~cRecMenuItemSelect(void);
void SetPixmaps(void);
void Hide(void);
@@ -340,7 +343,6 @@ private:
void DrawValue(char *newValue);
public:
cRecMenuItemText(cString title,
char *initialVal,
int length,
bool active = false,
char *callback = NULL);
@@ -369,7 +371,6 @@ private:
void DrawValue(void);
public:
cRecMenuItemTime(cString text,
int initialVal,
bool active = false,
int *callback = NULL,
eRecMenuState action = rmsNotConsumed);
@@ -392,7 +393,6 @@ private:
void DrawValue(void);
public:
cRecMenuItemDay(cString text,
time_t initialVal,
bool active = false,
time_t *callback = NULL,
eRecMenuState action = rmsNotConsumed);
@@ -490,10 +490,13 @@ class cRecMenuItemChannelChooser : public cRecMenuItem {
private:
cString text;
#if VDRVERSNUM >= 20301
const cChannel *channel;
const cChannels *channels;
const cChannel *chanNew;
#else
cChannel *channel;
cChannels *channels;
cChannel *chanNew;
#endif
const cChannel *channel;
int channelNumber;
int *callback;
bool initialChannelSet;
@@ -502,11 +505,6 @@ private:
void DrawValue(void);
public:
cRecMenuItemChannelChooser (cString text,
#if VDRVERSNUM >= 20301
const cChannel *initialChannel,
#else
cChannel *initialChannel,
#endif
bool active = false,
int *callback = NULL,
eRecMenuState action = rmsNotConsumed);
@@ -540,7 +538,6 @@ private:
bool WeekDaySet(unsigned day);
public:
cRecMenuItemDayChooser (cString text,
int weekdays,
bool active = false,
int *callback = NULL);
virtual ~cRecMenuItemDayChooser(void);

View File

@@ -1,18 +1,16 @@
#include "services/remotetimers.h"
#include "tools.h"
#include "recmenumanager.h"
#include "recmenuview.h"
#include "recmenus.h"
// --- cRecMenuMain ---------------------------------------------------------
cRecMenuMain::cRecMenuMain(bool epgSearchAvailable, bool timerActive, bool switchTimerActive) {
eRecMenuState action = rmsInstantRecord;
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
if (!timerActive) {
if (tvguideConfig.instRecFolderMode == eFolderSelect)
if (config.instRecFolderMode == eFolderSelect)
action = rmsInstantRecordFolder;
AddMenuItem(new cRecMenuItemButton(tr("Instant Record"), action, true, false, false, true));
} else {
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
AddMenuItem(new cRecMenuItemButton(tr("Delete Timer"), rmsDeleteTimer, true, false, false, true));
AddMenuItem(new cRecMenuItemButton(tr("Edit Timer"), rmsEditTimer, false, false, false, true));
}
@@ -24,7 +22,7 @@ cRecMenuMain::cRecMenuMain(bool epgSearchAvailable, bool timerActive, bool switc
AddMenuItem(new cRecMenuItemButton(tr("Search Timers"), rmsSearchTimers, false, false, false, true));
}
if (tvguideConfig.instRecFolderMode == eFolderSelect)
if (config.instRecFolderMode == eFolderSelect)
action = rmsSeriesTimerFolder;
else
action = rmsSeriesTimer;
@@ -115,7 +113,7 @@ cRecMenuConfirmTimer::cRecMenuConfirmTimer(const cEvent *event) {
#endif
cString message;
bool eventHasTimer = false;
if (tvguideConfig.useRemoteTimers && pRemoteTimers) {
if (config.useRemoteTimers && pRemoteTimers) {
RemoteTimers_GetMatch_v1_0 rtMatch;
rtMatch.event = event;
pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch);
@@ -149,7 +147,6 @@ cRecMenuConfirmTimer::cRecMenuConfirmTimer(const cEvent *event) {
// --- cRecMenuConfirmDeleteTimer ---------------------------------------------------------
cRecMenuConfirmDeleteTimer::cRecMenuConfirmDeleteTimer(const cEvent *event) {
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
SetWidthPercent(50);
#if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ;
@@ -177,7 +174,6 @@ cRecMenuConfirmDeleteTimer::cRecMenuConfirmDeleteTimer(const cEvent *event) {
// --- cRecMenuAskDeleteTimer ---------------------------------------------------------
cRecMenuAskDeleteTimer::cRecMenuAskDeleteTimer(const cEvent *event) {
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
SetWidthPercent(50);
#if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ;
@@ -430,7 +426,7 @@ cRecMenuEditTimer::cRecMenuEditTimer(const cTimer *timer, eRecMenuState nextStat
AddMenuItemInitial(infoItem);
timerActive = false;
if (tvguideConfig.useRemoteTimers && pRemoteTimers) {
if (config.useRemoteTimers && pRemoteTimers) {
RemoteTimers_GetMatch_v1_0 rtMatch;
rtMatch.event = timer->Event();
pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch);
@@ -448,12 +444,12 @@ cRecMenuEditTimer::cRecMenuEditTimer(const cTimer *timer, eRecMenuState nextStat
lifetime = timer->Lifetime();
strncpy(folder, GetDirectoryFromTimer(timer->File()).c_str(), TEXTINPUTLENGTH);
AddMenuItemInitial(new cRecMenuItemBool(tr("Timer Active"), timerActive, false, true, &timerActive));
AddMenuItemInitial(new cRecMenuItemInt(tr("Priority"), prio, 0, MAXPRIORITY, false, &prio));
AddMenuItemInitial(new cRecMenuItemInt(tr("Lifetime"), lifetime, 0, MAXLIFETIME, false, &lifetime));
AddMenuItemInitial(new cRecMenuItemDay(tr("Day"), day, false, &day));
AddMenuItemInitial(new cRecMenuItemTime(tr("Timer start time"), start, false, &start));
AddMenuItemInitial(new cRecMenuItemTime(tr("Timer stop time"), stop, false, &stop));
AddMenuItemInitial(new cRecMenuItemBool(tr("Timer Active"), true, &timerActive));
AddMenuItemInitial(new cRecMenuItemInt(tr("Priority"), 0, MAXPRIORITY, false, &prio));
AddMenuItemInitial(new cRecMenuItemInt(tr("Lifetime"), 0, MAXLIFETIME, false, &lifetime));
AddMenuItemInitial(new cRecMenuItemDay(tr("Day"), false, &day));
AddMenuItemInitial(new cRecMenuItemTime(tr("Timer start time"), false, &start));
AddMenuItemInitial(new cRecMenuItemTime(tr("Timer stop time"), false, &stop));
cString fileInfo = cString::sprintf("%s:\n%s", tr("Timer File"), timer->File());
cRecMenuItemInfo *fileInfoItem = new cRecMenuItemInfo(*fileInfo, false);
fileInfoItem->CalculateHeight(width - 2 * border);
@@ -526,18 +522,14 @@ cRecMenuSeriesTimer::cRecMenuSeriesTimer(const cChannel *initialChannel, const c
infoItem->CalculateHeight(width - 2 * border);
SetHeader(infoItem);
AddMenuItem(new cRecMenuItemBool(tr("Timer Active"), timerActive, false, false, &timerActive));
#if VDRVERSNUM >= 20301
AddMenuItem(new cRecMenuItemChannelChooser(tr("Channel"), initialChannel, false, &channel));
#else
AddMenuItem(new cRecMenuItemChannelChooser(tr("Channel"), (cChannel*)initialChannel, false, &channel));
#endif
AddMenuItem(new cRecMenuItemTime(tr("Series Timer start time"), start, false, &start));
AddMenuItem(new cRecMenuItemTime(tr("Series Timer stop time"), stop, false, &stop));
AddMenuItem(new cRecMenuItemDayChooser(tr("Days to record"), dayOfWeek, false, &dayOfWeek));
AddMenuItem(new cRecMenuItemDay(tr("Day to start"), tstart, false, &tstart));
AddMenuItem(new cRecMenuItemInt(tr("Priority"), priority, 0, MAXPRIORITY, false, &priority));
AddMenuItem(new cRecMenuItemInt(tr("Lifetime"), lifetime, 0, MAXLIFETIME, false, &lifetime));
AddMenuItem(new cRecMenuItemBool(tr("Timer Active"), false, &timerActive));
AddMenuItem(new cRecMenuItemChannelChooser(tr("Channel"), false, &channel));
AddMenuItem(new cRecMenuItemTime(tr("Series Timer start time"), false, &start));
AddMenuItem(new cRecMenuItemTime(tr("Series Timer stop time"), false, &stop));
AddMenuItem(new cRecMenuItemDayChooser(tr("Days to record"), false, &dayOfWeek));
AddMenuItem(new cRecMenuItemDay(tr("Day to start"), false, &tstart));
AddMenuItem(new cRecMenuItemInt(tr("Priority"), 0, MAXPRIORITY, false, &priority));
AddMenuItem(new cRecMenuItemInt(tr("Lifetime"), 0, MAXLIFETIME, false, &lifetime));
AddMenuItem(new cRecMenuItemButtonYesNo(tr("Create Timer"), tr("Cancel"), rmsSeriesTimerCreate, rmsClose, true));
@@ -619,7 +611,7 @@ cRecMenuSearchTimer::cRecMenuSearchTimer(const cEvent *event) {
infoItem->CalculateHeight(width - 2 * border);
SetHeader(infoItem);
strncpy(searchString, event->Title(), TEXTINPUTLENGTH);
AddMenuItemInitial(new cRecMenuItemText(tr("Search Expression:"), searchString, TEXTINPUTLENGTH, false));
AddMenuItemInitial(new cRecMenuItemText(tr("Search Expression:"), TEXTINPUTLENGTH, false, searchString));
AddMenuItemInitial(new cRecMenuItemButtonYesNo(tr("Continue"), tr("Cancel"), rmsSearchTimerOptions, rmsClose, true));
CalculateHeight();
CreatePixmap();
@@ -632,7 +624,7 @@ cRecMenuSearchTimerTemplates::cRecMenuSearchTimerTemplates(cTVGuideSearchTimer s
this->templates = templates;
SetWidthPercent(70);
cString message = tr("Configure Search Timer for Search String");
cString infoText = cString::sprintf("%s:\n%s", *message, searchTimer.SearchString().c_str());
cString infoText = cString::sprintf("%s:\n%s", *message, searchTimer.GetSearchString().c_str());
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText, true);
infoItem->CalculateHeight(width - 2 * border);
SetHeader(infoItem);
@@ -722,42 +714,36 @@ int cRecMenuSearchTimers::GetTotalNumMenuItems(void) {
}
// --- cRecMenuSearchTimerEdit ---------------------------------------------------------
cRecMenuSearchTimerEdit::cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer, bool advancedOptions) {
cRecMenuSearchTimerEdit::cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer, std::vector<std::string> channelGroups) {
init = true;
deleteMenuItems = false;
this->advancedOptions = advancedOptions;
this->searchTimer = searchTimer;
strncpy(searchString, searchTimer.SearchString().c_str(), TEXTINPUTLENGTH);
timerActive = searchTimer.Active();
mode = searchTimer.SearchMode();
useTitle = searchTimer.UseTitle();
useSubtitle = searchTimer.UseSubtitle();
useDescription = searchTimer.UseDescription();
useChannel = searchTimer.UseChannel();
startChannel = searchTimer.StartChannel();
stopChannel = searchTimer.StopChannel();
useTime = searchTimer.UseTime();
startTime = searchTimer.StartTime();
stopTime = searchTimer.StopTime();
useDayOfWeek = searchTimer.UseDayOfWeek();
dayOfWeek = searchTimer.DayOfWeek();
priority = searchTimer.Priority();
lifetime = searchTimer.Lifetime();
useEpisode = searchTimer.UseEpisode();
std::string dir = searchTimer.Directory();
this->sT = searchTimer;
this->channelGroups = channelGroups;
strncpy(searchString, sT.searchString.c_str(), TEXTINPUTLENGTH);
channelgroupIndex = -1;
std::string dir = sT.directory;
strncpy(directory, dir.c_str(), TEXTINPUTLENGTH);
marginStart = searchTimer.MarginStart();
marginStop = searchTimer.MarginStop();
useVPS = searchTimer.UseVPS();
avoidRepeats = searchTimer.AvoidRepeats();
allowedRepeats = searchTimer.AllowedRepeats();
compareTitle = searchTimer.CompareTitle();
compareSubtitle = searchTimer.CompareSubtitle();
compareSummary = searchTimer.CompareSummary();
useInFavorites = searchTimer.UseInFavorites();
dayOfWeek = DayOfWeek(sT.dayOfWeek);
// dsyslog("Weekday = %i, %i", sT.dayOfWeek, dayOfWeek);
indent = " ";
if (sT.useChannel == 1) {
startChannel = (sT.channelMin) ? sT.channelMin->Number() : 0;
stopChannel = (sT.channelMax) ? sT.channelMax->Number() : 0;
if (startChannel == 0) startChannel = 1;
if (stopChannel == 0) stopChannel = 1;
}
sT.GetSearchModes(&searchModes);
sT.GetUseChannelModes(&useChannelModes);
sT.GetCompareDateModes(&compareDateModes);
sT.GetSearchTimerModes(&searchTimerModes);
sT.GetDelModes(&delModes);
channelgroupIndex = SplitChannelGroups(&channelGroups, &channelgroups);
SetWidthPercent(70);
cString infoText;
if (searchTimer.GetID() > -1) {
if (sT.GetID() > -1) {
infoText = tr("Configure Search Timer Options");
} else {
infoText = tr("Create Search Timer");
@@ -765,9 +751,8 @@ cRecMenuSearchTimerEdit::cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText, true);
infoItem->CalculateHeight(width - 2 * border);
SetHeader(infoItem);
cRecMenuItemButtonYesNo *footerButton = new cRecMenuItemButtonYesNo(tr("Save Search Timer"), tr("Cancel"), rmsSearchTimerSave, rmsSearchTimers, (advancedOptions)?false:true);
cRecMenuItemButtonYesNo *footerButton = new cRecMenuItemButtonYesNo(tr("Save Search Timer"), tr("Cancel"), rmsSearchTimerSave, rmsSearchTimers, false);
SetFooter(footerButton);
InitMenuItems();
CreateMenuItems();
}
@@ -776,169 +761,198 @@ cRecMenuSearchTimerEdit::~cRecMenuSearchTimerEdit(void) {
delete *it;
}
mainMenuItems.clear();
for (std::vector<cRecMenuItem*>::iterator it = useChannelSubMenu.begin(); it != useChannelSubMenu.end(); it++) {
delete *it;
}
useChannelSubMenu.clear();
for (std::vector<cRecMenuItem*>::iterator it = useTimeSubMenu.begin(); it != useTimeSubMenu.end(); it++) {
delete *it;
}
useTimeSubMenu.clear();
for (std::vector<cRecMenuItem*>::iterator it = useDayOfWeekSubMenu.begin(); it != useDayOfWeekSubMenu.end(); it++) {
delete *it;
}
useDayOfWeekSubMenu.clear();
for (std::vector<cRecMenuItem*>::iterator it = avoidRepeatSubMenu.begin(); it != avoidRepeatSubMenu.end(); it++) {
delete *it;
}
avoidRepeatSubMenu.clear();
currentMenuItems.clear();
}
void cRecMenuSearchTimerEdit::InitMenuItems(void) {
int cRecMenuSearchTimerEdit::DayOfWeek(int dayofWeek) {
int vdrDayOfWeek = 0;
if (dayofWeek > 0) {
vdrDayOfWeek = pow(2, (dayofWeek + 6) % 7);
} else if (dayofWeek < 0) {
int absDayOfWeek = abs(dayofWeek);
for (int i = 0; i < 7; i++) {
if (absDayOfWeek & (1 << i)) {
vdrDayOfWeek += pow(2, (i + 6) % 7);
}
}
}
return vdrDayOfWeek;
}
useChannelPos = 6;
useTimePos = 7;
useDayOfWeekPos = 8;
avoidRepeatsPos = 14;
int cRecMenuSearchTimerEdit::SetDayOfWeek(int VDRDayOfWeek) {
int epgSearchDayOfWeek = 0;
for (int i=0; i < 7; i++) {
if (VDRDayOfWeek & (1 << i)) {
epgSearchDayOfWeek += pow(2, (i+1)%7);
}
}
return epgSearchDayOfWeek * (-1);
}
mainMenuItems.push_back(new cRecMenuItemText(tr("Search String"), searchString, TEXTINPUTLENGTH, false, searchString));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Active"), timerActive, false, false, &timerActive, rmsSearchTimerSave));
std::vector<std::string> searchModes;
searchTimer.GetSearchModes(&searchModes);
mainMenuItems.push_back(new cRecMenuItemSelect(tr("Search Mode"), searchModes, mode, false, &mode, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Use Title"), useTitle, false, false, &useTitle, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Use Subtitle"), useSubtitle, false, false, &useSubtitle, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Use Description"), useDescription, false, false, &useDescription, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Limit Channels"), useChannel, true, false, &useChannel, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Use Time"), useTime, true, false, &useTime, rmsSearchTimerSave));
if (!advancedOptions) {
mainMenuItems.push_back(new cRecMenuItemButton(tr("Display advanced Options"), rmsSearchTimerEditAdvanced, false));
} else {
mainMenuItems.push_back(new cRecMenuItemBool(tr("Limit Days of the Week"), useDayOfWeek, true, false, &useDayOfWeek, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemInt(tr("Priority"), priority, 0, 99, false, &priority, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemInt(tr("Lifetime"), lifetime, 0, 99, false, &lifetime, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemInt(tr("Time margin for start in minutes"), marginStart, 0, 30, false, &marginStart, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemInt(tr("Time margin for stop in minutes"), marginStop, 0, 30, false, &marginStop, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Series Recording"), useEpisode, false, false, &useEpisode, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemSelectDirectory(tr("Folder"), std::string(directory), false, directory, rmsSearchTimerSave, true));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Use VPS"), useVPS, false, false, &useVPS, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Avoid Repeats"), avoidRepeats, true, false, &avoidRepeats, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Use in Favorites"), useInFavorites, false, false, &useInFavorites, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemButton(tr("Hide advanced Options"), rmsSearchTimerEdit, false));
int cRecMenuSearchTimerEdit::SplitChannelGroups(std::vector<std::string> *channelGroups, std::vector<std::string> *channelgroups) {
int i = 0;
int j = 0;
for (std::vector<std::string>::iterator it = channelGroups->begin(); it != channelGroups->end(); it++) {
std::string a = *it;
splitstring s(a.c_str());
std::vector<std::string> value = s.split('|', 0);
std::vector<std::string>::iterator ito = value.begin();
channelgroups->push_back(*ito);
std::string b = *ito;
if (b.compare(sT.channelGroup) == 0)
j = i;
i++;
}
return j;
}
void cRecMenuSearchTimerEdit::CreateMenuItems(void) {
int activeMenuItem = 0;
if (mainMenuItems.size() > 0) {
for (long unsigned int index = 0; index < mainMenuItems.size(); index++) {
if (mainMenuItems[index]->isActive()) {
activeMenuItem = index;
break;
}
}
mainMenuItems.clear();
}
mainMenuItems.push_back(new cRecMenuItemText(tr("Search term"), TEXTINPUTLENGTH, init, searchString));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Active"), false, &sT.useAsSearchTimer, rmsSearchTimerSave, true));
mainMenuItems.push_back(new cRecMenuItemSelect(tr("Search mode"), searchModes, false, &sT.mode, rmsSearchTimerSave, true));
if (sT.mode == 5) {
mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s", *indent, tr("Tolerance")), 1, 9, false, &sT.fuzzyTolerance, rmsSearchTimerSave));
}
mainMenuItems.push_back(new cRecMenuItemBool(tr("Match case"), false, &sT.useCase, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Use title"), false, &sT.useTitle, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Use subtitle"), false, &sT.useSubtitle, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Use description"), false, &sT.useDescription, rmsSearchTimerSave));
// mainMenuItems.push_back(new cRecMenuItemBool(tr("Use content descriptor"), false, &sT.useContentDescriptors, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemSelect(tr("Use channel"), useChannelModes, false, &sT.useChannel, rmsSearchTimerSave, true));
if (sT.useChannel == 1) {
mainMenuItems.push_back(new cRecMenuItemChannelChooser(cString::sprintf("%s%s", *indent, tr("from channel")), false, &startChannel, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemChannelChooser(cString::sprintf("%s%s", *indent, tr("to channel")), false, &stopChannel, rmsSearchTimerSave));
}
else if ((sT.useChannel == 2) && (channelgroups.size() > 0)) {
mainMenuItems.push_back(new cRecMenuItemSelect(cString::sprintf("%s%s", *indent, tr("Channel group")), channelgroups, false, &channelgroupIndex, rmsSearchTimerSave, false));
}
mainMenuItems.push_back(new cRecMenuItemBool(tr("Use time"), false, &sT.useTime, rmsSearchTimerSave, true));
if (sT.useTime) {
mainMenuItems.push_back(new cRecMenuItemTime(cString::sprintf("%s%s", *indent, tr("Start after")), false, &sT.startTime, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemTime(cString::sprintf("%s%s", *indent, tr("Start before")), false, &sT.stopTime, rmsSearchTimerSave));
}
mainMenuItems.push_back(new cRecMenuItemBool(tr("Use duration"), false, &sT.useDuration, rmsSearchTimerSave, true));
if (sT.useDuration) {
mainMenuItems.push_back(new cRecMenuItemTime(cString::sprintf("%s%s", *indent, tr("Min. duration")), false, &sT.minDuration, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemTime(cString::sprintf("%s%s", *indent, tr("Max. duration")), false, &sT.maxDuration, rmsSearchTimerSave));
}
mainMenuItems.push_back(new cRecMenuItemBool(tr("Use day of week"), false, &sT.useDayOfWeek, rmsSearchTimerSave, true));
if (sT.useDayOfWeek)
mainMenuItems.push_back(new cRecMenuItemDayChooser(cString::sprintf("%s%s", *indent, tr("Day of week")), false, &dayOfWeek));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Use in Favorites"), false, &sT.useInFavorites, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Use as search timer"), false, &sT.useAsSearchTimer, rmsSearchTimerSave, true));
if (sT.useAsSearchTimer) {
mainMenuItems.push_back(new cRecMenuItemSelect(cString::sprintf("%s%s", *indent, tr("Action")), searchTimerModes, false, &sT.action, rmsSearchTimerSave, true));
if (sT.action == searchTimerActionSwitchOnly) {
mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s%s", *indent, *indent, tr("Switch ... minutes before start")), 0, 99, false, &sT.switchMinsBefore, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s", *indent, *indent, tr("Unmute sound")), false, &sT.unmuteSoundOnSwitch, rmsSearchTimerSave));
}
if (sT.action == searchTimerActionAnnounceAndSwitch) {
mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s%s", *indent, *indent, tr("Ask ... minutes before start")), 0, 99, false, &sT.switchMinsBefore, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s", *indent, *indent, tr("Unmute sound")), false, &sT.unmuteSoundOnSwitch, rmsSearchTimerSave));
}
if ((sT.action == searchTimerActionRecord) || (sT.action == searchTimerActionInactiveRecord)) {
mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s", *indent, *indent, tr("Series Recording")), false, &sT.useEpisode, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemSelectDirectory(cString::sprintf("%s%s%s", *indent, *indent, tr("Directory")), std::string(directory), false, directory, rmsSearchTimerSave, true));
mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s%s", *indent, *indent, tr("Delete recordings after ... days")), 0, 999, false, &sT.delAfterDays, rmsSearchTimerSave));
if (sT.delAfterDays > 0) {
mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s%s%s", *indent, *indent, *indent, tr("Keep ... recordings")), 0, 999, false, &sT.recordingsKeep, rmsSearchTimerSave));
}
mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s%s", *indent, *indent, tr("Pause when ... recordings exist")), 0, 999, false, &sT.pauseOnNrRecordings, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s", *indent, *indent, tr("Avoid Repeats")), false, &sT.avoidRepeats, rmsSearchTimerSave, true));
if (sT.avoidRepeats) {
mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s%s%s", *indent, *indent, *indent, tr("Allowed repeats")), 0, 99, false, &sT.allowedRepeats, rmsSearchTimerSave));
if (sT.allowedRepeats > 0) {
mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s%s%s%s", *indent, *indent, *indent, *indent, tr("Only repeats within ... days")), 0, 999, false, &sT.repeatsWithinDays, rmsSearchTimerSave));
}
mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s%s", *indent, *indent, *indent, tr("Compare Title")), false, &sT.compareTitle, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s%s", *indent, *indent, *indent, tr("Compare Subtitle")), false, &sT.compareSubtitle, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s%s", *indent, *indent, *indent, tr("Compare Description")), false, &sT.compareSummary, rmsSearchTimerSave, true));
if (sT.compareSummary) {
mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s%s%s%s", *indent, *indent, *indent, *indent, tr("Min. match in %")), 1, 100, false, &sT.compareSummaryMatchInPercent, rmsSearchTimerSave));
}
mainMenuItems.push_back(new cRecMenuItemSelect(cString::sprintf("%s%s%s%s", *indent, *indent, *indent, tr("Compare date")), compareDateModes, false, &sT.compareDate, rmsSearchTimerSave, false));
}
mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s%s", *indent, *indent, tr("Priority")), 0, 99, false, &sT.priority, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s%s", *indent, *indent, tr("Lifetime")), 0, 99, false, &sT.lifetime, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s%s", *indent, *indent, tr("Time margin for start in minutes")), 0, 30, false, &sT.marginStart, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s%s", *indent, *indent, tr("Time margin for stop in minutes")), 0, 30, false, &sT.marginStop, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s", *indent, *indent, tr("Use VPS")), false, &sT.useVPS, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemSelect(cString::sprintf("%s%s%s", *indent, *indent, tr("Auto delete")), delModes, false, &sT.delMode, rmsSearchTimerSave, true));
if (sT.delMode == 1)
mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s%s%s", *indent, *indent, *indent, tr("after ... recordings")), 0, 999, false, &sT.delAfterCountRecs, rmsSearchTimerSave));
else if (sT.delMode == 2)
mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s%s%s", *indent, *indent, *indent, tr("after ... days after first rec.")), 0, 999, false, &sT.delAfterDaysOfFirstRec, rmsSearchTimerSave));
}
}
mainMenuItems.push_back(new cRecMenuItemButton(tr("Display Results for Search Timer"), rmsSearchTimerTest, false));
if (startChannel == 0)
startChannel = 1;
if (stopChannel == 0)
stopChannel = 1;
#if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ;
useChannelSubMenu.push_back(new cRecMenuItemChannelChooser(tr("Start Channel"), Channels->GetByNumber(startChannel), false, &startChannel, rmsSearchTimerSave));
useChannelSubMenu.push_back(new cRecMenuItemChannelChooser(tr("Stop Channel"), Channels->GetByNumber(stopChannel), false, &stopChannel, rmsSearchTimerSave));
#else
useChannelSubMenu.push_back(new cRecMenuItemChannelChooser(tr("Start Channel"), Channels.GetByNumber(startChannel), false, &startChannel, rmsSearchTimerSave));
useChannelSubMenu.push_back(new cRecMenuItemChannelChooser(tr("Stop Channel"), Channels.GetByNumber(stopChannel), false, &stopChannel, rmsSearchTimerSave));
#endif
useTimeSubMenu.push_back(new cRecMenuItemTime(tr("Start after"), startTime, false, &startTime, rmsSearchTimerSave));
useTimeSubMenu.push_back(new cRecMenuItemTime(tr("Start before"), stopTime, false, &stopTime, rmsSearchTimerSave));
if (advancedOptions) {
useDayOfWeekSubMenu.push_back(new cRecMenuItemDayChooser(tr("Select Days"), dayOfWeek, false, &dayOfWeek));
avoidRepeatSubMenu.push_back(new cRecMenuItemInt(tr("Number of allowed repeats"), allowedRepeats, 0, 30, false, &allowedRepeats, rmsSearchTimerSave));
avoidRepeatSubMenu.push_back(new cRecMenuItemBool(tr("Compare Title"), compareTitle, false, false, &compareTitle, rmsSearchTimerSave));
avoidRepeatSubMenu.push_back(new cRecMenuItemBool(tr("Compare Subtitle"), compareSubtitle, false, false, &compareSubtitle, rmsSearchTimerSave));
avoidRepeatSubMenu.push_back(new cRecMenuItemBool(tr("Compare Description"), compareSummary, false, false, &compareSummary, rmsSearchTimerSave));
}
}
void cRecMenuSearchTimerEdit::CreateMenuItems(void) {
bool reDraw = false;
if (GetCurrentNumMenuItems() > 0) {
InitMenu(false);
currentMenuItems.clear();
reDraw = true;
}
int numMainMenuItems = mainMenuItems.size();
for (int i = 0; i < numMainMenuItems; i++) {
currentMenuItems.push_back(mainMenuItems[i]);
if ((i == useChannelPos) && useChannel)
AddSubMenu(&useChannelSubMenu);
else if ((i == useTimePos) && useTime)
AddSubMenu(&useTimeSubMenu);
else if (advancedOptions && (i == useDayOfWeekPos) && useDayOfWeek)
AddSubMenu(&useDayOfWeekSubMenu);
else if (advancedOptions && (i == avoidRepeatsPos) && avoidRepeats)
AddSubMenu(&avoidRepeatSubMenu);
}
numMenuItems = mainMenuItems.size();
int numMenuItemsAll = currentMenuItems.size();
int start = GetStartIndex();
for (int i = start; i < numMenuItemsAll; i++) {
if ((i == start) && !reDraw && advancedOptions) {
currentMenuItems[i]->setActive();
}
if (!AddMenuItemInitial(currentMenuItems[i])) {
for (int i = start; i < numMenuItems; i++) {
if (!AddMenuItemInitial(mainMenuItems[i])) {
break;
}
}
numMenuItems = currentMenuItems.size();
CalculateHeight();
if (reDraw)
mainMenuItems[activeMenuItem]->setActive();
if (init) {
init = !init;
}
CalculateHeight(!reDraw);
CreatePixmap();
Arrange();
}
void cRecMenuSearchTimerEdit::AddSubMenu(std::vector<cRecMenuItem*> *subMenu) {
for (std::vector<cRecMenuItem*>::iterator it = subMenu->begin(); it < subMenu->end(); it++) {
currentMenuItems.push_back(*it);
}
}
cTVGuideSearchTimer cRecMenuSearchTimerEdit::GetSearchTimer(void) {
searchTimer.SetSearchString(searchString);
searchTimer.SetActive(timerActive);
searchTimer.SetSearchMode(mode);
searchTimer.SetUseTitle(useTitle);
searchTimer.SetUseSubtitle(useSubtitle);
searchTimer.SetUseDesription(useDescription);
searchTimer.SetUseChannel(useChannel);
if (useChannel) {
searchTimer.SetStartChannel(startChannel);
searchTimer.SetStopChannel(stopChannel);
sT.searchString = searchString;
if (sT.useChannel == 1) {
#if VDRVERSNUM >= 20301
{
LOCK_CHANNELS_READ;
sT.channelMin = Channels->GetByNumber(startChannel);
sT.channelMax = Channels->GetByNumber(stopChannel);
}
#else
sT.channelMin = Channels.GetByNumber(startChannel);
sT.channelMax = Channels.GetByNumber(stopChannel);
#endif
}
searchTimer.SetUseTime(useTime);
if (useTime) {
searchTimer.SetStartTime(startTime);
searchTimer.SetStopTime(stopTime);
if (sT.useChannel == 2) {
if (channelgroups.size() > 0) {
std::string & channelGroup = channelgroups[channelgroupIndex];
sT.channelGroup = channelGroup;
} else {
sT.useChannel = 0;
}
}
searchTimer.SetUseDayOfWeek(useDayOfWeek);
if (useDayOfWeek) {
searchTimer.SetDayOfWeek(dayOfWeek);
if (sT.useDayOfWeek) {
sT.dayOfWeek = SetDayOfWeek(dayOfWeek);
}
searchTimer.SetPriority(priority);
searchTimer.SetLifetime(lifetime);
searchTimer.SetUseEpisode(useEpisode);
std::string dir(directory);
std::replace(dir.begin(), dir.end(), '/', '~');
searchTimer.SetDirectory(dir);
searchTimer.SetMarginStart(marginStart);
searchTimer.SetMarginStop(marginStop);
searchTimer.SetUseVPS(useVPS);
searchTimer.SetAvoidRepeats(avoidRepeats);
if (avoidRepeats) {
searchTimer.SetAllowedRepeats(allowedRepeats);
searchTimer.SetCompareTitle(compareTitle);
searchTimer.SetCompareSubtitle(compareSubtitle);
searchTimer.SetCompareSummary(compareSummary);
}
searchTimer.SetUseInFavorites(useInFavorites);
return searchTimer;
sT.directory = dir;
return sT;
}
int cRecMenuSearchTimerEdit::GetTotalNumMenuItems(void) {
@@ -947,7 +961,7 @@ int cRecMenuSearchTimerEdit::GetTotalNumMenuItems(void) {
cRecMenuItem *cRecMenuSearchTimerEdit::GetMenuItem(int number) {
if ((number > -1) && (number < numMenuItems)) {
return currentMenuItems[number];
return mainMenuItems[number];
}
return NULL;
}
@@ -957,7 +971,7 @@ cRecMenuSearchTimerDeleteConfirm::cRecMenuSearchTimerDeleteConfirm(cTVGuideSearc
this->searchTimer = searchTimer;
SetWidthPercent(70);
cString message = tr("Really delete Search Timer");
cString infoText = cString::sprintf("%s \"%s\"?", *message, searchTimer.SearchString().c_str());
cString infoText = cString::sprintf("%s \"%s\"?", *message, searchTimer.GetSearchString().c_str());
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText, true);
infoItem->CalculateHeight(width - 2 * border);
SetHeader(infoItem);
@@ -1007,7 +1021,7 @@ cRecMenuSearchTimerTemplatesCreate::cRecMenuSearchTimerTemplatesCreate(TVGuideEP
cString message2 = tr("Search Term");
cString message3 = tr("Using Template");
cString infoText = cString::sprintf("%s\n%s: \"%s\"\n%s \"%s\"", *message1, *message2, searchTimer.SearchString().c_str(), *message3, templ.name.c_str());
cString infoText = cString::sprintf("%s\n%s: \"%s\"\n%s \"%s\"", *message1, *message2, searchTimer.GetSearchString().c_str(), *message3, templ.name.c_str());
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText);
infoItem->CalculateHeight(width - 2 * border);
AddMenuItem(infoItem);
@@ -1100,8 +1114,8 @@ cRecMenuSearchTimerNothingFound::cRecMenuSearchTimerNothingFound(std::string sea
// --- cRecMenuSwitchTimer ---------------------------------------------------------
cRecMenuSwitchTimer::cRecMenuSwitchTimer(void) {
switchMinsBefore = tvguideConfig.switchMinsBefore;
switchMode = tvguideConfig.switchMode;
switchMinsBefore = config.switchMinsBefore;
switchMode = config.switchMode;
SetWidthPercent(60);
@@ -1110,12 +1124,12 @@ cRecMenuSwitchTimer::cRecMenuSwitchTimer(void) {
infoItem->CalculateHeight(width - 2 * border);
AddMenuItem(infoItem);
AddMenuItem(new cRecMenuItemInt(tr("Minutes before switching"), switchMinsBefore, 0, 10, false, &switchMinsBefore));
AddMenuItem(new cRecMenuItemInt(tr("Minutes before switching"), 0, 10, false, &switchMinsBefore));
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 cRecMenuItemSelect(tr("Switch Mode"), switchModeItems, false, &switchMode));
AddMenuItem(new cRecMenuItemButtonYesNo(tr("Create"), tr("Cancel"), rmsSwitchTimerCreate, rmsClose, true));
@@ -1183,16 +1197,16 @@ cRecMenuSearch::cRecMenuSearch(std::string searchString, bool withOptions) {
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText, true);
infoItem->CalculateHeight(width - 2 * border);
SetHeader(infoItem);
AddMenuItem(new cRecMenuItemText(tr("Search Expression:"), this->searchString, TEXTINPUTLENGTH, false, this->searchString));
AddMenuItem(new cRecMenuItemText(tr("Search Expression:"), TEXTINPUTLENGTH, false, this->searchString));
if (withOptions) {
std::vector<std::string> searchModes;
cTVGuideSearchTimer searchTimer;
searchTimer.GetSearchModes(&searchModes);
AddMenuItemInitial(new cRecMenuItemSelect(tr("Search Mode"), searchModes, 0, false, &mode));
AddMenuItemInitial(new cRecMenuItemChannelChooser(tr("Channel to Search"), NULL, false, &channelNr));
AddMenuItemInitial(new cRecMenuItemBool(tr("Search in title"), true, false, false, &useTitle));
AddMenuItemInitial(new cRecMenuItemBool(tr("Search in Subtitle"), true, false, false, &useSubTitle));
AddMenuItemInitial(new cRecMenuItemBool(tr("Search in Description"), false, false, false, &useDescription));
AddMenuItemInitial(new cRecMenuItemSelect(tr("Search Mode"), searchModes, false, &mode));
AddMenuItemInitial(new cRecMenuItemChannelChooser(tr("Channel to Search"), false, &channelNr));
AddMenuItemInitial(new cRecMenuItemBool(tr("Search in title"), false, &useTitle));
AddMenuItemInitial(new cRecMenuItemBool(tr("Search in Subtitle"), false, &useSubTitle));
AddMenuItemInitial(new cRecMenuItemBool(tr("Search in Description"), false, &useDescription));
} else {
AddMenuItemInitial(new cRecMenuItemButton(tr("Show Search Options"), rmsSearchWithOptions, false));
}
@@ -1326,7 +1340,7 @@ cRecMenuRecordingSearch::cRecMenuRecordingSearch(std::string search) {
infoItem->CalculateHeight(width - 2 * border);
SetHeader(infoItem);
AddMenuItem(new cRecMenuItemText(tr("Search Expression:"), searchString, TEXTINPUTLENGTH, false, searchString));
AddMenuItem(new cRecMenuItemText(tr("Search Expression:"), TEXTINPUTLENGTH, false, searchString));
AddMenuItem(new cRecMenuItemButtonYesNo(tr("Perform Search"), tr("Cancel"), rmsRecordingSearchResult, rmsClose, true));
CalculateHeight();
CreatePixmap();
@@ -1570,26 +1584,26 @@ cRecMenuFavorites::~cRecMenuFavorites(void) {
}
void cRecMenuFavorites::CreateFavoritesMenuItems(void) {
if (tvguideConfig.favWhatsOnNow) {
if (config.favWhatsOnNow) {
myMenuItems.push_back(new cRecMenuItemFavoriteStatic(tr("What's on now"), rmsFavoritesNow, false));
}
if (tvguideConfig.favWhatsOnNext) {
if (config.favWhatsOnNext) {
myMenuItems.push_back(new cRecMenuItemFavoriteStatic(tr("What's on next"), rmsFavoritesNext, false));
}
if (tvguideConfig.favUseTime1) {
std::string desc = *cString::sprintf("%s (%s)", tvguideConfig.descUser1.c_str(), NiceTime(tvguideConfig.favTime1).c_str());
if (config.favUseTime1) {
std::string desc = *cString::sprintf("%s (%s)", config.descUser1.c_str(), NiceTime(config.favTime1).c_str());
myMenuItems.push_back(new cRecMenuItemFavoriteStatic(desc, rmsFavoritesUser1, false));
}
if (tvguideConfig.favUseTime2) {
std::string desc = *cString::sprintf("%s (%s)", tvguideConfig.descUser2.c_str(), NiceTime(tvguideConfig.favTime2).c_str());
if (config.favUseTime2) {
std::string desc = *cString::sprintf("%s (%s)", config.descUser2.c_str(), NiceTime(config.favTime2).c_str());
myMenuItems.push_back(new cRecMenuItemFavoriteStatic(desc, rmsFavoritesUser2, false));
}
if (tvguideConfig.favUseTime3) {
std::string desc = *cString::sprintf("%s (%s)", tvguideConfig.descUser3.c_str(), NiceTime(tvguideConfig.favTime3).c_str());
if (config.favUseTime3) {
std::string desc = *cString::sprintf("%s (%s)", config.descUser3.c_str(), NiceTime(config.favTime3).c_str());
myMenuItems.push_back(new cRecMenuItemFavoriteStatic(desc, rmsFavoritesUser3, false));
}
if (tvguideConfig.favUseTime4) {
std::string desc = *cString::sprintf("%s (%s)", tvguideConfig.descUser4.c_str(), NiceTime(tvguideConfig.favTime4).c_str());
if (config.favUseTime4) {
std::string desc = *cString::sprintf("%s (%s)", config.descUser4.c_str(), NiceTime(config.favTime4).c_str());
myMenuItems.push_back(new cRecMenuItemFavoriteStatic(desc, rmsFavoritesUser4, false));
}

View File

@@ -10,6 +10,15 @@
#include "switchtimer.h"
#include "recmanager.h"
typedef enum {
searchTimerActionRecord = 0,
searchTimerActionAnnounceViaOSD,
searchTimerActionSwitchOnly,
searchTimerActionAnnounceAndSwitch,
searchTimerActionAnnounceViaMail,
searchTimerActionInactiveRecord
} searchTimerAction;
// --- cRecMenuMain ---------------------------------------------------------
class cRecMenuMain : public cRecMenu {
public:
@@ -207,50 +216,34 @@ public:
// --- cRecMenuSearchTimerEdit ---------------------------------------------------------
class cRecMenuSearchTimerEdit: public cRecMenu {
private:
bool advancedOptions;
cTVGuideSearchTimer searchTimer;
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;
std::vector<cRecMenuItem*> useChannelSubMenu;
std::vector<cRecMenuItem*> useTimeSubMenu;
std::vector<cRecMenuItem*> useDayOfWeekSubMenu;
std::vector<cRecMenuItem*> avoidRepeatSubMenu;
std::vector<cRecMenuItem*> currentMenuItems;
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 mode;
bool useTitle;
bool useSubtitle;
bool useDescription;
bool useChannel;
int startChannel;
int stopChannel;
bool useTime;
int startTime;
int stopTime;
bool useDayOfWeek;
int channelgroupIndex;
int dayOfWeek;
int priority;
int lifetime;
bool useEpisode;
char directory[TEXTINPUTLENGTH];
int marginStart;
int marginStop;
bool useVPS;
bool avoidRepeats;
int allowedRepeats;
bool compareTitle;
bool compareSubtitle;
bool compareSummary;
bool useInFavorites;
void InitMenuItems(void);
void AddSubMenu(std::vector<cRecMenuItem*> *subMenu);
int SplitChannelGroups(std::vector<std::string> *channelGroups, std::vector<std::string> *channelgroups);
public:
cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer, bool advancedOptions);
cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer, std::vector<std::string> channelGroups);
void CreateMenuItems(void);
virtual ~cRecMenuSearchTimerEdit(void);
cTVGuideSearchTimer GetSearchTimer(void);

File diff suppressed because it is too large Load Diff

View File

@@ -1,43 +1,43 @@
#ifndef __TVGUIDE_RECMENUMANAGER_H
#define __TVGUIDE_RECMENUMANAGER_H
#include "recmenu.h"
#include "recmanager.h"
#include "services/epgsearch.h"
#include "footer.h"
// --- cRecMenuManager -------------------------------------------------------------
class cRecMenuManager {
private:
cFooter *footer;
bool active;
cRecMenu *activeMenu;
cRecMenu *activeMenuBuffer;
cRecMenu *activeMenuBuffer2;
const cEvent *event;
const cEvent *displayEvent;
cRecManager *recManager;
cTVGuideTimerConflicts *timerConflicts;
cDetailView *detailView;
cPixmap *pixmapBackground;
bool detailViewActive;
void SetBackground(void);
void DeleteBackground(void);
void DisplaySearchTimerList(void);
bool DisplayTimerConflict(const cTimer *timer);
bool DisplayTimerConflict(int timerID);
void DisplayDetailedView(const cEvent *ev);
void DisplayFavoriteResults(std::string header, const cEvent **result, int numResults);
eOSState StateMachine(eRecMenuState nextState);
public:
cRecMenuManager(void);
virtual ~cRecMenuManager(void);
void SetFooter(cFooter *footer) { this->footer = footer; };
bool isActive(void) { return active; };
void Start(const cEvent *event);
void StartFavorites(void);
void Close(void);
eOSState ProcessKey(eKeys Key);
};
#endif //__TVGUIDE_RECMENUMANAGER_H
#ifndef __TVGUIDE_RECMENUVIEW_H
#define __TVGUIDE_RECMENUVIEW_H
#include "recmenu.h"
#include "recmanager.h"
#include "services/epgsearch.h"
#include "footer.h"
// --- cRecMenuView -------------------------------------------------------------
class cRecMenuView {
private:
cFooter *footer;
bool active;
cRecMenu *activeMenu;
cRecMenu *activeMenuBuffer;
cRecMenu *activeMenuBuffer2;
const cEvent *event;
const cEvent *displayEvent;
cRecManager *recManager;
cTVGuideTimerConflicts *timerConflicts;
cDetailView *detailView;
cPixmap *pixmapBackground;
bool detailViewActive;
void SetBackground(void);
void DeleteBackground(void);
void DisplaySearchTimerList(void);
bool DisplayTimerConflict(const cTimer *timer);
bool DisplayTimerConflict(int timerID);
void DisplayDetailedView(const cEvent *ev);
void DisplayFavoriteResults(std::string header, const cEvent **result, int numResults);
eOSState StateMachine(eRecMenuState nextState);
public:
cRecMenuView(void);
virtual ~cRecMenuView(void);
void SetFooter(cFooter *footer) { this->footer = footer; };
bool isActive(void) { return active; };
void Start(const cEvent *event);
void StartFavorites(void);
void Close(void);
eOSState ProcessKey(eKeys Key);
};
#endif //__TVGUIDE_RECMENUVIEW_H

File diff suppressed because it is too large Load Diff

View File

@@ -1,141 +1,91 @@
#ifndef __TVGUIDE_SEARCHTIMER_H
#define __TVGUIDE_SEARCHTIMER_H
class cTVGuideSearchTimer {
private:
std::string strTimer;
int ID;
std::string searchString;
int useTime;
int startTime;
int stopTime;
int useChannel;
#if VDRVERSNUM >= 20301
const cChannel *channelMin;
const cChannel *channelMax;
#else
cChannel *channelMin;
cChannel *channelMax;
#endif
std::string channelGroup;
int useCase;
int mode;
int useTitle;
int useSubtitle;
int useDescription;
int useDuration;
int minDuration;
int maxDuration;
int useAsSearchTimer;
int useDayOfWeek;
int dayOfWeek;
int useEpisode;
std::string directory;
int priority;
int lifetime;
int marginStart;
int marginStop;
int useVPS;
int action;
int useExtEPGInfo;
std::string extEPGInfoValues;
int avoidRepeats;
int allowedRepeats;
int compareTitle;
int compareSubtitle;
int compareSummary;
unsigned long catvaluesAvoidRepeat;
int repeatsWithinDays;
int delAfterDays;
int recordingsKeep;
int switchMinsBefore;
int pauseOnNrRecordings;
int blacklistMode;
std::string blacklists;
int fuzzyTolerance;
int useInFavorites;
int menuTemplate;
int delMode;
int delAfterCountRecs;
int delAfterDaysOfFirstRec;
int useAsSearchTimerFrom;
int useAsSearchTimerTil;
int ignoreMissingEPGCats;
int unmuteSoundOnSwitch;
int compareSummaryMatchInPercent;
std::string contentsFilter;
int compareDate;
public:
cTVGuideSearchTimer(void);
virtual ~cTVGuideSearchTimer(void);
bool operator < (const cTVGuideSearchTimer& other) const;
void SetEPGSearchString(std::string strTimer) { this->strTimer = strTimer; };
void SetTemplate(std::string tmpl);
bool Parse(bool readTemplate = false);
std::string BuildSearchString(void);
int GetID(void) { return ID; };
//GETTER
std::string SearchString(void) const { return searchString; };
bool Active(void);
bool UseTitle(void) { return useTitle; };
bool UseSubtitle(void) { return useSubtitle; };
bool UseDescription(void) { return useDescription; };
int SearchMode(void) { return mode; };
bool UseChannel(void) { return useChannel; };
int StartChannel(void) { return (channelMin)?channelMin->Number():0; };
int StopChannel(void) { return (channelMax)?channelMax->Number():0; };
bool UseTime(void) { return useTime; };
int StartTime(void) { return startTime; };
int StopTime(void) { return stopTime; };
bool UseDayOfWeek(void) { return useDayOfWeek; };
int DayOfWeek(void);
int UseEpisode(void) { return useEpisode; };
std::string Directory(void) { return directory; };
int Priority(void) { return priority; };
int Lifetime(void) { return lifetime; };
int MarginStart(void) { return marginStart; };
int MarginStop(void) { return marginStop; };
bool UseVPS(void) { return useVPS; };
bool AvoidRepeats(void) { return avoidRepeats; };
int AllowedRepeats(void) { return allowedRepeats; };
bool CompareTitle(void) { return compareTitle; };
bool CompareSubtitle(void) { return compareSubtitle; };
bool CompareSummary(void) { return compareSummary; };
bool UseInFavorites(void) { return useInFavorites; };
//SETTER
void SetSearchString(std::string searchString) { this->searchString = searchString; };
void SetActive(bool active) { useAsSearchTimer = active; };
void SetSearchMode(int searchMode) { mode = searchMode; };
void SetUseTitle(bool useTitle) { this->useTitle = useTitle; };
void SetUseSubtitle(bool useSubtitle) { this->useSubtitle = useSubtitle; };
void SetUseDesription(bool useDescription) { this->useDescription = useDescription; };
void SetUseChannel(bool useChannel) { this->useChannel = useChannel; };
void SetStartChannel(int startChannel);
void SetStopChannel(int stopChannel);
void SetUseTime(bool useTime) { this->useTime = useTime; };
void SetStartTime(int startTime) { this->startTime = startTime; };
void SetStopTime(int stopTime) { this->stopTime = stopTime; };
void SetUseDayOfWeek(bool useDayOfWeek) { this->useDayOfWeek = useDayOfWeek; };
void SetDayOfWeek(int VDRDayOfWeek);
void SetUseEpisode(int useEpisode) { this->useEpisode = useEpisode; };
void SetDirectory(std::string directory) { this-> directory = directory; };
void SetPriority(int priority) { this->priority = priority; };
void SetLifetime(int lifetime) { this->lifetime = lifetime; };
void SetMarginStart(int marginStart) { this->marginStart = marginStart; };
void SetMarginStop(int marginStop) { this->marginStop = marginStop; };
void SetUseVPS(bool useVPS) { this->useVPS = useVPS; };
void SetAvoidRepeats(bool avoidRepeats) { this->avoidRepeats = avoidRepeats; };
void SetAllowedRepeats(int allowedRepeats) { this->allowedRepeats = allowedRepeats; };
void SetCompareTitle(bool compareTitle) { this->compareTitle = compareTitle; };
void SetCompareSubtitle(bool compareSubtitle) { this->compareSubtitle = compareSubtitle; };
void SetCompareSummary(bool compareSummary) { this->compareSummary = compareSummary; };
void SetUseInFavorites(bool useInFavorites) { this->useInFavorites = useInFavorites; };
//COMMON
int GetNumTimers(void);
int GetNumRecordings(void);
void GetSearchModes(std::vector<std::string> *searchModes);
void Dump(void);
};
#endif //__TVGUIDE_SEARCHTIMER_H
#ifndef __TVGUIDE_SEARCHTIMER_H
#define __TVGUIDE_SEARCHTIMER_H
class cTVGuideSearchTimer {
friend class cRecMenuSearchTimerEdit;
protected:
std::string strTimer;
int ID;
std::string searchString;
int useTime;
int startTime;
int stopTime;
int useChannel;
const cChannel *channelMin;
const cChannel *channelMax;
std::string channelGroup;
int useCase;
int mode;
int useTitle;
int useSubtitle;
int useDescription;
int useDuration;
int minDuration;
int maxDuration;
int useAsSearchTimer;
int useDayOfWeek;
int dayOfWeek;
int useEpisode;
std::string directory;
int priority;
int lifetime;
int marginStart;
int marginStop;
int useVPS;
int action;
int useExtEPGInfo;
std::string extEPGInfoValues;
int avoidRepeats;
int allowedRepeats;
int compareTitle;
int compareSubtitle;
int compareSummary;
unsigned long catvaluesAvoidRepeat;
int repeatsWithinDays;
int delAfterDays;
int recordingsKeep;
int switchMinsBefore;
int pauseOnNrRecordings;
int blacklistMode;
std::string blacklists;
int fuzzyTolerance;
int useInFavorites;
int menuTemplate;
int delMode;
int delAfterCountRecs;
int delAfterDaysOfFirstRec;
int useAsSearchTimerFrom;
int useAsSearchTimerTil;
int ignoreMissingEPGCats;
int unmuteSoundOnSwitch;
int compareSummaryMatchInPercent;
std::string contentsFilter;
int compareDate;
public:
cTVGuideSearchTimer(void);
virtual ~cTVGuideSearchTimer(void);
bool operator < (const cTVGuideSearchTimer& other) const;
void SetEPGSearchString(std::string strTimer) { this->strTimer = strTimer; };
void SetTemplate(std::string tmpl);
bool Parse(bool readTemplate = false);
std::string BuildSearchString(void);
int GetID(void) { return ID; };
//GETTER
std::string GetSearchString(void) const { return searchString; };
bool IsActive(void);
bool UseInFavorites(void) { return useInFavorites; };
//SETTER
void SetSearchString(std::string searchString) { this->searchString = searchString; };
//COMMON
int GetNumTimers(void);
int GetNumRecordings(void);
void GetSearchModes(std::vector<std::string> *searchModes);
void GetUseChannelModes(std::vector<std::string> *useChannelModes);
void GetSearchTimerModes(std::vector<std::string> *searchTimerModes);
void GetCompareDateModes(std::vector<std::string> *compareDateModes);
void GetDelModes(std::vector<std::string> *delModes);
void Dump(void);
};
#endif //__TVGUIDE_SEARCHTIMER_H

View File

@@ -154,7 +154,11 @@ public:
struct Epgsearch_services_v1_0 {
// in/out
#if __cplusplus < 201103L
std::auto_ptr<cServiceHandler> handler;
#else
std::unique_ptr<cServiceHandler> handler;
#endif
};
// Data structures for service "Epgsearch-services-v1.1"
@@ -169,7 +173,11 @@ public:
struct Epgsearch_services_v1_1 {
// in/out
#if __cplusplus < 201103L
std::auto_ptr<cServiceHandler_v1_1> handler;
#else
std::unique_ptr<cServiceHandler_v1_1> handler;
#endif
};
// Data structures for service "Epgsearch-services-v1.2"
@@ -184,7 +192,11 @@ public:
struct Epgsearch_services_v1_2 {
// in/out
#if __cplusplus < 201103L
std::auto_ptr<cServiceHandler_v1_2> handler;
#else
std::unique_ptr<cServiceHandler_v1_2> handler;
#endif
};
#endif

View File

@@ -1,33 +1,182 @@
#ifndef REMOTETIMERSERVICES_INC
#define REMOTETIMERSERVICES_INC
/*
* remotetimers.h: Public interface of the plugin's services
*
* Copyright (C) 2008-2013 Frank Schmirler <vdr@schmirler.de>
*
* This file is part of VDR Plugin remotetimers.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
#ifndef _SERVICE__H
#define _SERVICE__H
#include <vdr/epg.h>
#include <vdr/timers.h>
#include <vdr/epg.h>
#include <vdr/osdbase.h>
// RemoteTimers services
struct RemoteTimers_Event_v1_0 {
//in
const cEvent *event;
//out
cTimer *timer;
cString errorMsg;
/*
* If the Data argument is NULL, all service calls return true.
* Otherwise the return value indicates success or failure of the service call.
*
* The service calls are not thread safe and must be called from the VDR main loop.
*/
/*
* RemoteTimers::InstantRecording-v1.0
* Start an instant recording or pause live TV. VDR needs to be patched to support this.
* The service returns false if a local timer should be used. An error occured if true is returned but the out parameters name and fileName are NULL.
* Data points to the following structure where pause indicates if it is an instant recording or an attempt to pause live TV.
*/
struct RemoteTimers_InstantRecording_v1_0 {
//in
const cTimer *timer;
bool pause;
const cEvent *event;
//out
cString name;
cString fileName;
};
/*
* RemoteTimers::RefreshTimers-v1.0
* Fetch timer list from remote VDR. You must call this service before you can use one of the service calls below.
* Data points to a cString which in case of failure (service call returns false) contains an error message.
*/
//out
// cString errorMsg;
/*
* RemoteTimers::ForEachConflict-v1.0
* Iterates the list of remote timer conflicts.
* The service call always returns true.
* Data points to a const char* which must be NULL to return the first conflict. Pass the previously returned conflict to get the next one until const char* is NULL.
*
*/
//in+out
// const char* conflict;
/*
* RemoteTimers::ForEach-v1.0
* Iterates the list of remote timers.
* The service call always returns true.
* Data points to a cTimer* which must be NULL to return the first timer. Pass the previously returned timer to get the next one until cTimer* is NULL.
*
* RemoteTimers::GetTimer-v1.0
* Test if the timer exists as either a remote or a local timer.
* The service call always returns true.
* Data points to a cTimer* which points to the timer you are looking for. If found, cTimer* will point to the timer, otherwise it will be NULL.
*/
//in+out
// cTimer* timer;
/*
* RemoteTimers::GetMatch-v1.0
* Find the remote or local timer which matches the event best.
* The service call always returns true.
* Data points to the following structure:
*/
struct RemoteTimers_GetMatch_v1_0 {
//in
const cEvent *event;
//out
cTimer *timer;
int timerMatch;
int timerType;
bool isRemote;
//in
const cEvent *event;
//out
cTimer *timer;
int timerMatch;
int timerType;
bool isRemote;
};
/*
* RemoteTimers::GetTimerByEvent-v1.0
* Find the remote or local timer matching the event.
* If no timer matches, the service call returns false.
* Data points to a RemoteTimers_Event_v1_0 struct.
*
* RemoteTimers::NewTimerByEvent-v1.0
* Add a new timer for an event.
* In case of an error, the service call returns false and the structure includes an error message.
* Data points to a RemoteTimers_Event_v1_0 struct.
*/
struct RemoteTimers_Event_v1_0 {
//in
const cEvent *event;
//out
cTimer *timer;
cString errorMsg;
};
/*
* RemoteTimers::NewTimer-v1.0
* Add a new timer.
* In case of an error, the service call returns false and the structure includes an error message.
* Data points to a RemoteTimers_Timer_v1_0 struct.
*
* RemoteTimers::ModTimer-v1.0
* Change an existing timer.
* In case of an error, the service call returns false and the structure includes an error message.
* Data points to a RemoteTimers_Timer_v1_0 struct.
*
* RemoteTimers::DelTimer-v1.0
* Delete an existing timer.
* In case of an error, the service call returns false and the structure includes an error message.
* Data points to a RemoteTimers_Timer_v1_0 struct.
*/
struct RemoteTimers_Timer_v1_0 {
//in+out
cTimer *timer;
//out
cString errorMsg;
//in+out
cTimer *timer;
//out
cString errorMsg;
};
#endif //REMOTETIMERSERVICES_INC
/*
* RemoteTimers::GetTimerById-v1.0
* Get a remote timer by its id (i.e. timer->Index()+1 on remote machine).
* The service call always returns true.
* Data must point to a RemoteTimers_Timer_v1_1 structure. errorMsg is unused.
* NULL is returned as timer if no remote timer exists for the given id locally.
* Note that a timer with this id may exist remotely. This can happen if the
* remote timer's channel doesn't exist on the local machine.
*/
struct RemoteTimers_Timer_v1_1 {
//in+out
cTimer *timer;
int id;
//out
cString errorMsg;
};
/*
* RemoteTimers::Menu-v1.0
* Depending on the state parameter, open the Timers or Schedule menu.
* In case of an error, menu is NULL.
* Data points to a RemoteTimers_Menu_v1_0 struct.
*/
struct RemoteTimers_Menu_v1_0 {
//in
const char *serverIp;
unsigned short serverPort;
eOSState state;
//out
cOsdMenu *menu;
};
#endif //_SERVICE__H

544
setup.c
View File

@@ -1,7 +1,7 @@
#include "setup.h"
cTvguideSetup::cTvguideSetup() {
tmpTvguideConfig = tvguideConfig;
tmpConfig = config;
Setup();
}
@@ -9,8 +9,8 @@ cTvguideSetup::~cTvguideSetup() {
geoManager.SetGeometry(cOsd::OsdWidth(), cOsd::OsdHeight(), true);
fontManager.DeleteFonts();
fontManager.SetFonts();
tvguideConfig.LoadTheme();
tvguideConfig.setDynamicValues();
config.LoadTheme();
config.setDynamicValues();
imgCache.Clear();
imgCache.CreateCache();
}
@@ -40,15 +40,15 @@ eOSState cTvguideSetup::ProcessKey(eKeys Key) {
if ((Key == kOk && !hadSubMenu)) {
const char* ItemText = Get(Current())->Text();
if (strcmp(ItemText, tr("General Settings")) == 0)
state = AddSubMenu(new cMenuSetupGeneral(&tmpTvguideConfig));
state = AddSubMenu(new cMenuSetupGeneral(&tmpConfig));
if (strcmp(ItemText, tr("Screen Presentation")) == 0)
state = AddSubMenu(new cMenuSetupScreenLayout(&tmpTvguideConfig));
state = AddSubMenu(new cMenuSetupScreenLayout(&tmpConfig));
if (strcmp(ItemText, tr("Fonts and Fontsizes")) == 0)
state = AddSubMenu(new cMenuSetupFont(&tmpTvguideConfig));
state = AddSubMenu(new cMenuSetupFont(&tmpConfig));
if (strcmp(ItemText, tr("Recording Menus and Favorites")) == 0)
state = AddSubMenu(new cMenuSetupFavorites(&tmpTvguideConfig));
state = AddSubMenu(new cMenuSetupFavorites(&tmpConfig));
if (strcmp(ItemText, tr("Image Loading and Caching")) == 0)
state = AddSubMenu(new cMenuSetupImageCache(&tmpTvguideConfig));
state = AddSubMenu(new cMenuSetupImageCache(&tmpConfig));
}
}
return state;
@@ -56,107 +56,109 @@ eOSState cTvguideSetup::ProcessKey(eKeys Key) {
void cTvguideSetup::Store(void) {
tvguideConfig = tmpTvguideConfig;
SetupStore("debugImageLoading", tvguideConfig.debugImageLoading);
SetupStore("useNopacityTheme", tvguideConfig.useNopacityTheme);
SetupStore("themeIndex", tvguideConfig.themeIndex);
SetupStore("showMainMenuEntry", tvguideConfig.showMainMenuEntry);
SetupStore("replaceOriginalSchedule", tvguideConfig.replaceOriginalSchedule);
SetupStore("displayMode", tvguideConfig.displayMode);
SetupStore("showTimeInGrid", tvguideConfig.showTimeInGrid);
SetupStore("displayStatusHeader", tvguideConfig.displayStatusHeader);
SetupStore("displayChannelGroups", tvguideConfig.displayChannelGroups);
SetupStore("displayTimeBase", tvguideConfig.displayTimeBase);
SetupStore("headerHeightPercent", tvguideConfig.headerHeightPercent);
SetupStore("channelGroupsPercent", tvguideConfig.channelGroupsPercent);
SetupStore("epgViewBorder", tvguideConfig.epgViewBorder);
SetupStore("scaleVideo", tvguideConfig.scaleVideo);
SetupStore("decorateVideo", tvguideConfig.decorateVideo);
SetupStore("roundedCorners", tvguideConfig.roundedCorners);
SetupStore("timeFormat", tvguideConfig.timeFormat);
SetupStore("channelCols", tvguideConfig.channelCols);
SetupStore("channelRows", tvguideConfig.channelRows);
SetupStore("displayTime", tvguideConfig.displayTime);
SetupStore("bigStepHours", tvguideConfig.bigStepHours);
SetupStore("hugeStepHours", tvguideConfig.hugeStepHours);
SetupStore("channelJumpMode", tvguideConfig.channelJumpMode);
SetupStore("blueKeyMode", tvguideConfig.blueKeyMode);
SetupStore("numkeyMode", tvguideConfig.numkeyMode);
SetupStore("useRemoteTimers", tvguideConfig.useRemoteTimers);
SetupStore("closeOnSwitch", tvguideConfig.closeOnSwitch);
SetupStore("hideLastGroup", tvguideConfig.hideLastGroup);
SetupStore("hideChannelLogos", tvguideConfig.hideChannelLogos);
SetupStore("logoExtension", tvguideConfig.logoExtension);
SetupStore("logoWidthRatio", tvguideConfig.logoWidthRatio);
SetupStore("logoHeightRatio", tvguideConfig.logoHeightRatio);
SetupStore("hideEpgImages", tvguideConfig.hideEpgImages);
SetupStore("epgImageWidth", tvguideConfig.epgImageWidth);
SetupStore("epgImageHeight", tvguideConfig.epgImageHeight);
SetupStore("numAdditionalEPGPictures", tvguideConfig.numAdditionalEPGPictures);
SetupStore("epgImageWidthLarge", tvguideConfig.epgImageWidthLarge);
SetupStore("epgImageHeightLarge", tvguideConfig.epgImageHeightLarge);
SetupStore("detailedViewScrollStep", tvguideConfig.detailedViewScrollStep);
SetupStore("timeLineWidthPercent", tvguideConfig.timeLineWidthPercent);
SetupStore("timeLineHeightPercent", tvguideConfig.timeLineHeightPercent);
SetupStore("displayChannelName", tvguideConfig.displayChannelName);
SetupStore("channelHeaderWidthPercent", tvguideConfig.channelHeaderWidthPercent);
SetupStore("channelHeaderHeightPercent", tvguideConfig.channelHeaderHeightPercent);
SetupStore("footerHeightPercent", tvguideConfig.footerHeightPercent);
SetupStore("instRecFolderMode", tvguideConfig.instRecFolderMode);
SetupStore("instRecFixedFolder", tvguideConfig.instRecFixedFolder.c_str());
SetupStore("favWhatsOnNow", tvguideConfig.favWhatsOnNow);
SetupStore("favWhatsOnNext", tvguideConfig.favWhatsOnNext);
SetupStore("favUseTime1", tvguideConfig.favUseTime1);
SetupStore("favUseTime2", tvguideConfig.favUseTime2);
SetupStore("favUseTime3", tvguideConfig.favUseTime3);
SetupStore("favUseTime4", tvguideConfig.favUseTime4);
SetupStore("favTime1", tvguideConfig.favTime1);
SetupStore("favTime2", tvguideConfig.favTime2);
SetupStore("favTime3", tvguideConfig.favTime3);
SetupStore("favTime4", tvguideConfig.favTime4);
SetupStore("descUser1", tvguideConfig.descUser1.c_str());
SetupStore("descUser2", tvguideConfig.descUser2.c_str());
SetupStore("descUser3", tvguideConfig.descUser3.c_str());
SetupStore("descUser4", tvguideConfig.descUser4.c_str());
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);
SetupStore("FontDetailViewDelta", tvguideConfig.FontDetailViewDelta);
SetupStore("FontDetailHeaderDelta", tvguideConfig.FontDetailHeaderDelta);
SetupStore("FontMessageBoxDelta", tvguideConfig.FontMessageBoxDelta);
SetupStore("FontMessageBoxLargeDelta", tvguideConfig.FontMessageBoxLargeDelta);
SetupStore("FontStatusHeaderDelta", tvguideConfig.FontStatusHeaderDelta);
SetupStore("FontStatusHeaderLargeDelta", tvguideConfig.FontStatusHeaderLargeDelta);
SetupStore("FontChannelHeaderDelta", tvguideConfig.FontChannelHeaderDelta);
SetupStore("FontChannelGroupsDelta", tvguideConfig.FontChannelGroupsDelta);
SetupStore("FontGridDelta", tvguideConfig.FontGridDelta);
SetupStore("FontGridSmallDelta", tvguideConfig.FontGridSmallDelta);
SetupStore("FontTimeLineWeekdayDelta", tvguideConfig.FontTimeLineWeekdayDelta);
SetupStore("FontTimeLineDateDelta", tvguideConfig.FontTimeLineDateDelta);
SetupStore("FontTimeLineTimeDelta", tvguideConfig.FontTimeLineTimeDelta);
SetupStore("FontChannelHeaderHorizontalDelta", tvguideConfig.FontChannelHeaderHorizontalDelta);
SetupStore("FontChannelGroupsHorizontalDelta", tvguideConfig.FontChannelGroupsHorizontalDelta);
SetupStore("FontGridHorizontalDelta", tvguideConfig.FontGridHorizontalDelta);
SetupStore("FontGridHorizontalSmallDelta", tvguideConfig.FontGridHorizontalSmallDelta);
SetupStore("FontTimeLineDateHorizontalDelta", tvguideConfig.FontTimeLineDateHorizontalDelta);
SetupStore("FontTimeLineTimeHorizontalDelta", tvguideConfig.FontTimeLineTimeHorizontalDelta);
SetupStore("FontRecMenuItemDelta", tvguideConfig.FontRecMenuItemDelta);
SetupStore("FontRecMenuItemSmallDelta", tvguideConfig.FontRecMenuItemSmallDelta);
SetupStore("FontRecMenuItemLargeDelta", tvguideConfig.FontRecMenuItemLargeDelta);
SetupStore("displayRerunsDetailEPGView", tvguideConfig.displayRerunsDetailEPGView);
SetupStore("numReruns", tvguideConfig.numReruns);
SetupStore("useSubtitleRerun", tvguideConfig.useSubtitleRerun);
SetupStore("numLogosInitial", tvguideConfig.numLogosInitial);
SetupStore("numLogosMax", tvguideConfig.numLogosMax);
SetupStore("limitLogoCache", tvguideConfig.limitLogoCache);
config = tmpConfig;
SetupStore("debugImageLoading", config.debugImageLoading);
SetupStore("useNopacityTheme", config.useNopacityTheme);
SetupStore("themeIndex", config.themeIndex);
SetupStore("useHWAccel", config.useHWAccel);
SetupStore("showMainMenuEntry", config.showMainMenuEntry);
SetupStore("replaceOriginalSchedule", config.replaceOriginalSchedule);
SetupStore("displayMode", config.displayMode);
SetupStore("showTimeInGrid", config.showTimeInGrid);
SetupStore("displayStatusHeader", config.displayStatusHeader);
SetupStore("displayChannelGroups", config.displayChannelGroups);
SetupStore("displayTimeBase", config.displayTimeBase);
SetupStore("headerHeightPercent", config.headerHeightPercent);
SetupStore("channelGroupsPercent", config.channelGroupsPercent);
SetupStore("epgViewBorder", config.epgViewBorder);
SetupStore("scaleVideo", config.scaleVideo);
SetupStore("decorateVideo", config.decorateVideo);
SetupStore("roundedCorners", config.roundedCorners);
SetupStore("timeFormat", config.timeFormat);
SetupStore("channelCols", config.channelCols);
SetupStore("channelRows", config.channelRows);
SetupStore("displayTime", config.displayTime);
SetupStore("displayHorizontalTime", config.displayHorizontalTime);
SetupStore("bigStepHours", config.bigStepHours);
SetupStore("hugeStepHours", config.hugeStepHours);
SetupStore("channelJumpMode", config.channelJumpMode);
SetupStore("blueKeyMode", config.blueKeyMode);
SetupStore("numkeyMode", config.numkeyMode);
SetupStore("useRemoteTimers", config.useRemoteTimers);
SetupStore("closeOnSwitch", config.closeOnSwitch);
SetupStore("hideLastGroup", config.hideLastGroup);
SetupStore("hideChannelLogos", config.hideChannelLogos);
SetupStore("logoExtension", config.logoExtension);
SetupStore("logoWidthRatio", config.logoWidthRatio);
SetupStore("logoHeightRatio", config.logoHeightRatio);
SetupStore("hideEpgImages", config.hideEpgImages);
SetupStore("epgImageWidth", config.epgImageWidth);
SetupStore("epgImageHeight", config.epgImageHeight);
SetupStore("numAdditionalEPGPictures", config.numAdditionalEPGPictures);
SetupStore("epgImageWidthLarge", config.epgImageWidthLarge);
SetupStore("epgImageHeightLarge", config.epgImageHeightLarge);
SetupStore("detailedViewScrollStep", config.detailedViewScrollStep);
SetupStore("timeLineWidthPercent", config.timeLineWidthPercent);
SetupStore("timeLineHeightPercent", config.timeLineHeightPercent);
SetupStore("displayChannelName", config.displayChannelName);
SetupStore("channelHeaderWidthPercent", config.channelHeaderWidthPercent);
SetupStore("channelHeaderHeightPercent", config.channelHeaderHeightPercent);
SetupStore("footerHeightPercent", config.footerHeightPercent);
SetupStore("instRecFolderMode", config.instRecFolderMode);
SetupStore("instRecFixedFolder", config.instRecFixedFolder.c_str());
SetupStore("favWhatsOnNow", config.favWhatsOnNow);
SetupStore("favWhatsOnNext", config.favWhatsOnNext);
SetupStore("favUseTime1", config.favUseTime1);
SetupStore("favUseTime2", config.favUseTime2);
SetupStore("favUseTime3", config.favUseTime3);
SetupStore("favUseTime4", config.favUseTime4);
SetupStore("favTime1", config.favTime1);
SetupStore("favTime2", config.favTime2);
SetupStore("favTime3", config.favTime3);
SetupStore("favTime4", config.favTime4);
SetupStore("descUser1", config.descUser1.c_str());
SetupStore("descUser2", config.descUser2.c_str());
SetupStore("descUser3", config.descUser3.c_str());
SetupStore("descUser4", config.descUser4.c_str());
SetupStore("favLimitChannels", config.favLimitChannels);
SetupStore("favStartChannel", config.favStartChannel);
SetupStore("favStopChannel", config.favStopChannel);
SetupStore("switchMode", config.switchMode);
SetupStore("switchMinsBefore", config.switchMinsBefore);
SetupStore("fontIndex", config.fontIndex);
SetupStore("FontButtonDelta", config.FontButtonDelta);
SetupStore("FontDetailViewDelta", config.FontDetailViewDelta);
SetupStore("FontDetailHeaderDelta", config.FontDetailHeaderDelta);
SetupStore("FontMessageBoxDelta", config.FontMessageBoxDelta);
SetupStore("FontMessageBoxLargeDelta", config.FontMessageBoxLargeDelta);
SetupStore("FontStatusHeaderDelta", config.FontStatusHeaderDelta);
SetupStore("FontStatusHeaderLargeDelta", config.FontStatusHeaderLargeDelta);
SetupStore("FontChannelHeaderDelta", config.FontChannelHeaderDelta);
SetupStore("FontChannelGroupsDelta", config.FontChannelGroupsDelta);
SetupStore("FontGridDelta", config.FontGridDelta);
SetupStore("FontGridSmallDelta", config.FontGridSmallDelta);
SetupStore("FontTimeLineWeekdayDelta", config.FontTimeLineWeekdayDelta);
SetupStore("FontTimeLineDateDelta", config.FontTimeLineDateDelta);
SetupStore("FontTimeLineTimeDelta", config.FontTimeLineTimeDelta);
SetupStore("FontChannelHeaderHorizontalDelta", config.FontChannelHeaderHorizontalDelta);
SetupStore("FontChannelGroupsHorizontalDelta", config.FontChannelGroupsHorizontalDelta);
SetupStore("FontGridHorizontalDelta", config.FontGridHorizontalDelta);
SetupStore("FontGridHorizontalSmallDelta", config.FontGridHorizontalSmallDelta);
SetupStore("FontTimeLineDateHorizontalDelta", config.FontTimeLineDateHorizontalDelta);
SetupStore("FontTimeLineTimeHorizontalDelta", config.FontTimeLineTimeHorizontalDelta);
SetupStore("FontRecMenuItemDelta", config.FontRecMenuItemDelta);
SetupStore("FontRecMenuItemSmallDelta", config.FontRecMenuItemSmallDelta);
SetupStore("FontRecMenuItemLargeDelta", config.FontRecMenuItemLargeDelta);
SetupStore("displayRerunsDetailEPGView", config.displayRerunsDetailEPGView);
SetupStore("numReruns", config.numReruns);
SetupStore("useSubtitleRerun", config.useSubtitleRerun);
SetupStore("numLogosInitial", config.numLogosInitial);
SetupStore("numLogosMax", config.numLogosMax);
SetupStore("limitLogoCache", config.limitLogoCache);
}
cMenuSetupSubMenu::cMenuSetupSubMenu(const char* Title, cTvguideConfig* data) : cOsdMenu(Title, 30) {
tmpTvguideConfig = data;
cMenuSetupSubMenu::cMenuSetupSubMenu(const char* Title, cTVGuideConfig* data) : cOsdMenu(Title, 40) {
tmpConfig = data;
indent = " ";
}
@@ -182,7 +184,7 @@ eOSState cMenuSetupSubMenu::ProcessKey(eKeys Key) {
//----- General Settings -------------------------------------------------------------------------------------------------------------
cMenuSetupGeneral::cMenuSetupGeneral(cTvguideConfig* data) : cMenuSetupSubMenu(tr("General Settings"), data) {
cMenuSetupGeneral::cMenuSetupGeneral(cTVGuideConfig* data) : cMenuSetupSubMenu(tr("General Settings"), data) {
themes.Load(*cString("tvguide"));
timeFormatItems[0] = "12h";
timeFormatItems[1] = "24h";
@@ -202,47 +204,57 @@ cMenuSetupGeneral::cMenuSetupGeneral(cTvguideConfig* data) : cMenuSetupSubMenu(
void cMenuSetupGeneral::Set(void) {
int currentItem = Current();
Clear();
Add(new cMenuEditBoolItem(tr("Show Main Menu Entry"), &tmpTvguideConfig->showMainMenuEntry));
Add(new cMenuEditBoolItem(tr("Replace VDR Schedules Menu"), &tmpTvguideConfig->replaceOriginalSchedule));
Add(new cMenuEditBoolItem(tr("Use appropriate nOpacity Theme"), &tmpTvguideConfig->useNopacityTheme));
if (!tmpTvguideConfig->useNopacityTheme) {
Add(new cMenuEditBoolItem(tr("Use workaround for HWAccelerated OSD"), &tmpConfig->useHWAccel));
Add(new cMenuEditBoolItem(tr("Show Main Menu Entry"), &tmpConfig->showMainMenuEntry));
Add(new cMenuEditBoolItem(tr("Replace VDR Schedules Menu"), &tmpConfig->replaceOriginalSchedule));
Add(new cMenuEditBoolItem(tr("Use appropriate nOpacity Theme"), &tmpConfig->useNopacityTheme));
if (!tmpConfig->useNopacityTheme) {
if (themes.NumThemes())
Add(new cMenuEditStraItem(cString::sprintf("%s%s", *indent, tr("Theme")), &tmpTvguideConfig->themeIndex, themes.NumThemes(), themes.Descriptions()));
Add(new cMenuEditStraItem(cString::sprintf("%s%s", *indent, tr("Theme")), &tmpConfig->themeIndex, themes.NumThemes(), themes.Descriptions()));
}
Add(new cMenuEditIntItem(tr("Time to display in minutes"), &tmpTvguideConfig->displayTime, 60, 320));
Add(new cMenuEditBoolItem(tr("Rounded Corners"), &tmpTvguideConfig->roundedCorners));
if (tmpConfig->displayMode == eVertical) {
Add(new cMenuEditIntItem(tr("Time to display in minutes"), &tmpConfig->displayTime, 60, 320));
} else if (tmpConfig->displayMode == eHorizontal) {
Add(new cMenuEditIntItem(tr("Time to display in minutes"), &tmpConfig->displayHorizontalTime, 60, 320));
}
Add(new cMenuEditBoolItem(tr("Rounded Corners"), &tmpConfig->roundedCorners));
Add(new cMenuEditStraItem(tr("Channel Jump Mode (Keys Green / Yellow)"), &tmpTvguideConfig->channelJumpMode, 2, jumpMode));
Add(new cMenuEditStraItem(tr("Keys Blue and OK"), &tmpTvguideConfig->blueKeyMode, 3, blueMode));
Add(new cMenuEditBoolItem(tr("Close TVGuide after channel switch"), &tmpTvguideConfig->closeOnSwitch));
Add(new cMenuEditStraItem(tr("Functionality of numeric Keys"), &tmpTvguideConfig->numkeyMode, 2, numMode));
Add(new cMenuEditBoolItem(tr("Hide last Channel Group"), &tmpTvguideConfig->hideLastGroup));
Add(new cMenuEditIntItem(tr("Big Step (Keys 1 / 3) in hours"), &tmpTvguideConfig->bigStepHours, 1, 12));
Add(new cMenuEditIntItem(tr("Huge Step (Keys 4 / 6) in hours"), &tmpTvguideConfig->hugeStepHours, 13, 48));
Add(new cMenuEditStraItem(tr("Time Format (12h/24h)"), &tmpTvguideConfig->timeFormat, 2, timeFormatItems));
Add(new cMenuEditIntItem(tr("EPG Window Text Scrolling Speed"), &tmpTvguideConfig->detailedViewScrollStep, 1, 30));
Add(new cMenuEditBoolItem(tr("Display Reruns in detailed EPG View"), &tmpTvguideConfig->displayRerunsDetailEPGView));
if (tmpTvguideConfig->displayRerunsDetailEPGView) {
Add(new cMenuEditIntItem(cString::sprintf("%s%s", *indent, tr("Number of reruns to display")), &tmpTvguideConfig->numReruns, 1, 10));
Add(new cMenuEditStraItem(cString::sprintf("%s%s", *indent, tr("Use Subtitle for reruns")), &tmpTvguideConfig->useSubtitleRerun, 3, useSubtitleRerunTexts));
Add(new cMenuEditStraItem(tr("Channel Jump Mode (Keys Green / Yellow)"), &tmpConfig->channelJumpMode, 2, jumpMode));
Add(new cMenuEditStraItem(tr("Keys Blue and OK"), &tmpConfig->blueKeyMode, 3, blueMode));
Add(new cMenuEditBoolItem(tr("Close TVGuide after channel switch"), &tmpConfig->closeOnSwitch));
Add(new cMenuEditStraItem(tr("Functionality of numeric Keys"), &tmpConfig->numkeyMode, 2, numMode));
Add(new cMenuEditBoolItem(tr("Hide last Channel Group"), &tmpConfig->hideLastGroup));
Add(new cMenuEditIntItem(tr("Big Step (Keys 1 / 3) in hours"), &tmpConfig->bigStepHours, 1, 12));
Add(new cMenuEditIntItem(tr("Huge Step (Keys 4 / 6) in hours"), &tmpConfig->hugeStepHours, 13, 48));
Add(new cMenuEditStraItem(tr("Time Format (12h/24h)"), &tmpConfig->timeFormat, 2, timeFormatItems));
Add(new cMenuEditIntItem(tr("EPG Window Text Scrolling Speed"), &tmpConfig->detailedViewScrollStep, 1, 30));
Add(new cMenuEditBoolItem(tr("Display Reruns in detailed EPG View"), &tmpConfig->displayRerunsDetailEPGView));
if (tmpConfig->displayRerunsDetailEPGView) {
Add(new cMenuEditIntItem(cString::sprintf("%s%s", *indent, tr("Number of reruns to display")), &tmpConfig->numReruns, 1, 10));
Add(new cMenuEditStraItem(cString::sprintf("%s%s", *indent, tr("Use Subtitle for reruns")), &tmpConfig->useSubtitleRerun, 3, useSubtitleRerunTexts));
}
SetCurrent(Get(currentItem));
Display();
}
eOSState cMenuSetupGeneral::ProcessKey(eKeys Key) {
bool olduseNopacityTheme = tmpConfig->useNopacityTheme;
bool olddisplayRerunsDetailEPGView = tmpConfig->displayRerunsDetailEPGView;
eOSState state = cOsdMenu::ProcessKey(Key);
if (Key == kOk) {
state = osBack;
} else if (Key != kNone) {
Set();
if (tmpConfig->useNopacityTheme != olduseNopacityTheme ||
tmpConfig->displayRerunsDetailEPGView != olddisplayRerunsDetailEPGView) {
Set();
}
}
return state;
}
//----- Screen Presentation -------------------------------------------------------------------------------------------------------------
cMenuSetupScreenLayout::cMenuSetupScreenLayout(cTvguideConfig* data) : cMenuSetupSubMenu(tr("Screen Presentation"), data) {
cMenuSetupScreenLayout::cMenuSetupScreenLayout(cTVGuideConfig* data) : cMenuSetupSubMenu(tr("Screen Presentation"), data) {
displayModeItems[0] = "vertical";
displayModeItems[1] = "horizontal";
hideChannelLogosItems[0] = trVDR("yes");
@@ -256,55 +268,55 @@ void cMenuSetupScreenLayout::Set(void) {
int currentItem = Current();
Clear();
Add(new cMenuEditStraItem(tr("Display Mode"), &tmpTvguideConfig->displayMode, 2, displayModeItems));
if (tmpTvguideConfig->displayMode == eVertical) {
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Height of Channel Header (Perc. of osd height)")), &tmpTvguideConfig->channelHeaderHeightPercent, 5, 30));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Width of Timeline (Perc. of osd width)")), &tmpTvguideConfig->timeLineWidthPercent, 5, 30));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Number of Channels to display")), &tmpTvguideConfig->channelCols, 3, 12));
} else if (tmpTvguideConfig->displayMode == eHorizontal) {
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Width of Channel Header (Perc. of osd width)")), &tmpTvguideConfig->channelHeaderWidthPercent, 5, 30));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Height of Timeline (Perc. of osd height)")), &tmpTvguideConfig->timeLineHeightPercent, 5, 30));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Number of Channels to display")), &tmpTvguideConfig->channelRows, 3, 12));
Add(new cMenuEditBoolItem(*cString::sprintf("%s%s", *indent, tr("Display time in EPG Grids")), &tmpTvguideConfig->showTimeInGrid));
Add(new cMenuEditStraItem(tr("Display Mode"), &tmpConfig->displayMode, 2, displayModeItems));
if (tmpConfig->displayMode == eVertical) {
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Height of Channel Header (Perc. of osd height)")), &tmpConfig->channelHeaderHeightPercent, 5, 30));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Width of Timeline (Perc. of osd width)")), &tmpConfig->timeLineWidthPercent, 5, 30));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Number of Channels to display")), &tmpConfig->channelCols, 3, 12));
} else if (tmpConfig->displayMode == eHorizontal) {
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Width of Channel Header (Perc. of osd width)")), &tmpConfig->channelHeaderWidthPercent, 5, 30));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Height of Timeline (Perc. of osd height)")), &tmpConfig->timeLineHeightPercent, 5, 30));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Number of Channels to display")), &tmpConfig->channelRows, 3, 12));
}
Add(new cMenuEditIntItem(tr("Height of Headers (Status Header and EPG View, Perc. of osd height)"), &tmpTvguideConfig->headerHeightPercent, 10, 50));
Add(new cMenuEditIntItem(tr("Height of Footer (Perc. of osd height)"), &tmpTvguideConfig->footerHeightPercent, 3, 20));
Add(new cMenuEditBoolItem(tr("Display time in EPG Grids"), &tmpConfig->showTimeInGrid));
Add(new cMenuEditIntItem(tr("Height of Headers (Status Header and EPG View, Perc. of osd height)"), &tmpConfig->headerHeightPercent, 10, 50));
Add(new cMenuEditIntItem(tr("Height of Footer (Perc. of osd height)"), &tmpConfig->footerHeightPercent, 3, 20));
Add(new cMenuEditBoolItem(tr("Display status header"), &tmpTvguideConfig->displayStatusHeader));
if (tmpTvguideConfig->displayStatusHeader) {
Add(new cMenuEditBoolItem(*cString::sprintf("%s%s", *indent, tr("Scale video to upper right corner")), &tmpTvguideConfig->scaleVideo));
Add(new cMenuEditBoolItem(*cString::sprintf("%s%s", *indent, tr("Rounded corners around video frame")), &tmpTvguideConfig->decorateVideo));
Add(new cMenuEditBoolItem(tr("Display status header"), &tmpConfig->displayStatusHeader));
if (tmpConfig->displayStatusHeader) {
Add(new cMenuEditBoolItem(*cString::sprintf("%s%s", *indent, tr("Scale video to upper right corner")), &tmpConfig->scaleVideo));
Add(new cMenuEditBoolItem(*cString::sprintf("%s%s", *indent, tr("Rounded corners around video frame")), &tmpConfig->decorateVideo));
}
Add(new cMenuEditBoolItem(tr("Display Channel Names in Header"), &tmpTvguideConfig->displayChannelName));
Add(new cMenuEditBoolItem(tr("Display channel groups"), &tmpTvguideConfig->displayChannelGroups));
if (tmpTvguideConfig->displayChannelGroups) {
if (tmpTvguideConfig->displayMode == eVertical) {
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Height of channel groups (Perc. of osd height)")), &tmpTvguideConfig->channelGroupsPercent, 3, 30));
} else if (tmpTvguideConfig->displayMode == eHorizontal) {
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Width of channel groups (Perc. of osd width)")), &tmpTvguideConfig->channelGroupsPercent, 3, 30));
Add(new cMenuEditBoolItem(tr("Display Channel Names in Header"), &tmpConfig->displayChannelName));
Add(new cMenuEditBoolItem(tr("Display channel groups"), &tmpConfig->displayChannelGroups));
if (tmpConfig->displayChannelGroups) {
if (tmpConfig->displayMode == eVertical) {
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Height of channel groups (Perc. of osd height)")), &tmpConfig->channelGroupsPercent, 3, 30));
} else if (tmpConfig->displayMode == eHorizontal) {
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Width of channel groups (Perc. of osd width)")), &tmpConfig->channelGroupsPercent, 3, 30));
}
}
Add(new cMenuEditBoolItem(tr("Display current time baseline"), &tmpTvguideConfig->displayTimeBase));
Add(new cMenuEditStraItem(tr("Show Channel Logos"), &tmpTvguideConfig->hideChannelLogos, 2, hideChannelLogosItems));
if (!tmpTvguideConfig->hideChannelLogos) {
Add(InfoItem(tr("Logo Path used"), *tvguideConfig.logoPath));
Add(new cMenuEditStraItem(*cString::sprintf("%s%s", *indent, tr("Logo Extension")), &tmpTvguideConfig->logoExtension, 2, logoExtensionItems));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Logo width ratio")), &tmpTvguideConfig->logoWidthRatio, 1, 1000));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Logo height ratio")), &tmpTvguideConfig->logoHeightRatio, 1, 1000));
Add(new cMenuEditBoolItem(tr("Display current time baseline"), &tmpConfig->displayTimeBase));
Add(new cMenuEditStraItem(tr("Show Channel Logos"), &tmpConfig->hideChannelLogos, 2, hideChannelLogosItems));
if (!tmpConfig->hideChannelLogos) {
Add(InfoItem(tr("Logo Path used"), *config.logoPath));
Add(new cMenuEditStraItem(*cString::sprintf("%s%s", *indent, tr("Logo Extension")), &tmpConfig->logoExtension, 2, logoExtensionItems));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Logo width ratio")), &tmpConfig->logoWidthRatio, 1, 1000));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Logo height ratio")), &tmpConfig->logoHeightRatio, 1, 1000));
}
Add(new cMenuEditIntItem(tr("Text Border in Detailed View (pixel)"), &tmpTvguideConfig->epgViewBorder, 0, 300));
Add(new cMenuEditIntItem(tr("Text Border in Detailed View (pixel)"), &tmpConfig->epgViewBorder, 0, 300));
Add(new cMenuEditStraItem(tr("Show EPG Images"), &tmpTvguideConfig->hideEpgImages, 2, hideChannelLogosItems));
if (!tmpTvguideConfig->hideEpgImages) {
Add(InfoItem(tr("EPG Images Path used"), *tvguideConfig.epgImagePath));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("EPG Image width")), &tmpTvguideConfig->epgImageWidth, 0, 800));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("EPG Image height")), &tmpTvguideConfig->epgImageHeight, 0, 800));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Number of additional EPG Images")), &tmpTvguideConfig->numAdditionalEPGPictures, 0, 20));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Additional EPG Image width")), &tmpTvguideConfig->epgImageWidthLarge, 1, 800));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Additional EPG Image height")), &tmpTvguideConfig->epgImageHeightLarge, 0, 800));
Add(new cMenuEditStraItem(tr("Show EPG Images"), &tmpConfig->hideEpgImages, 2, hideChannelLogosItems));
if (!tmpConfig->hideEpgImages) {
Add(InfoItem(tr("EPG Images Path used"), *config.epgImagePath));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("EPG Image width")), &tmpConfig->epgImageWidth, 0, 800));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("EPG Image height")), &tmpConfig->epgImageHeight, 0, 800));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Number of additional EPG Images")), &tmpConfig->numAdditionalEPGPictures, 0, 20));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Additional EPG Image width")), &tmpConfig->epgImageWidthLarge, 1, 800));
Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Additional EPG Image height")), &tmpConfig->epgImageHeightLarge, 0, 800));
}
SetCurrent(Get(currentItem));
@@ -312,20 +324,31 @@ void cMenuSetupScreenLayout::Set(void) {
}
eOSState cMenuSetupScreenLayout::ProcessKey(eKeys Key) {
int olddisplayMode = tmpConfig->displayMode;
bool olddisplayStatusHeader = tmpConfig->displayStatusHeader;
bool olddisplayChannelGroups = tmpConfig->displayChannelGroups;
int oldhideChannelLogos = tmpConfig->hideChannelLogos;
int oldhideEpgImages = tmpConfig->hideEpgImages;
eOSState state = cOsdMenu::ProcessKey(Key);
if (Key == kOk) {
state = osBack;
} else if (Key != kNone) {
Set();
if (tmpConfig->displayMode != olddisplayMode ||
tmpConfig->displayStatusHeader != olddisplayStatusHeader ||
tmpConfig->displayChannelGroups != olddisplayChannelGroups ||
tmpConfig->hideChannelLogos != oldhideChannelLogos ||
tmpConfig->hideEpgImages != oldhideEpgImages) {
Set();
}
}
return state;
}
//-----Fonts and Fontsizes -------------------------------------------------------------------------------------------------------
cMenuSetupFont::cMenuSetupFont(cTvguideConfig* data) : cMenuSetupSubMenu(tr("Fonts and Fontsizes"), data) {
cMenuSetupFont::cMenuSetupFont(cTVGuideConfig* data) : cMenuSetupSubMenu(tr("Fonts and Fontsizes"), data) {
cFont::GetAvailableFontNames(&fontNames);
fontNames.Insert(strdup(tvguideConfig.fontNameDefault));
fontNames.Insert(strdup(config.fontNameDefault));
Set();
}
@@ -333,37 +356,37 @@ void cMenuSetupFont::Set(void) {
int currentItem = Current();
Clear();
Add(new cMenuEditStraItem(tr("Font"), &tmpTvguideConfig->fontIndex, fontNames.Size(), &fontNames[0]));
Add(new cMenuEditStraItem(tr("Font"), &tmpConfig->fontIndex, fontNames.Size(), &fontNames[0]));
Add(new cMenuEditIntItem(tr("Status Header Font Size"), &tmpTvguideConfig->FontStatusHeaderDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Status Header Large Font Size"), &tmpTvguideConfig->FontStatusHeaderLargeDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Detail EPG View Font Size"), &tmpTvguideConfig->FontDetailViewDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Detail EPG View Header Font Size"), &tmpTvguideConfig->FontDetailHeaderDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Message Font Size"), &tmpTvguideConfig->FontMessageBoxDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Message Large Font Size"), &tmpTvguideConfig->FontMessageBoxLargeDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Button Font Size"), &tmpTvguideConfig->FontButtonDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Status Header Font Size"), &tmpConfig->FontStatusHeaderDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Status Header Large Font Size"), &tmpConfig->FontStatusHeaderLargeDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Detail EPG View Font Size"), &tmpConfig->FontDetailViewDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Detail EPG View Header Font Size"), &tmpConfig->FontDetailHeaderDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Message Font Size"), &tmpConfig->FontMessageBoxDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Message Large Font Size"), &tmpConfig->FontMessageBoxLargeDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Button Font Size"), &tmpConfig->FontButtonDelta, -30, 30));
if (tmpTvguideConfig->displayMode == eVertical) {
Add(new cMenuEditIntItem(tr("Channel Header Font Size"), &tmpTvguideConfig->FontChannelHeaderDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Channel Groups Font Size"), &tmpTvguideConfig->FontChannelGroupsDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Grid Font Size"), &tmpTvguideConfig->FontGridDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Grid Font Small Size"), &tmpTvguideConfig->FontGridSmallDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Timeline Weekday Font Size"), &tmpTvguideConfig->FontTimeLineWeekdayDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Timeline Date Font Size"), &tmpTvguideConfig->FontTimeLineDateDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Timeline Time Font Size"), &tmpTvguideConfig->FontTimeLineTimeDelta, -30, 30));
} else if (tmpTvguideConfig->displayMode == eHorizontal) {
Add(new cMenuEditIntItem(tr("Channel Header Font Size"), &tmpTvguideConfig->FontChannelHeaderHorizontalDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Channel Groups Font Size"), &tmpTvguideConfig->FontChannelGroupsHorizontalDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Grid Font Size"), &tmpTvguideConfig->FontGridHorizontalDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Grid Font Small Size"), &tmpTvguideConfig->FontGridHorizontalSmallDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Timeline Date Font Size"), &tmpTvguideConfig->FontTimeLineDateHorizontalDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Timeline Time Font Size"), &tmpTvguideConfig->FontTimeLineTimeHorizontalDelta, -30, 30));
if (tmpConfig->displayMode == eVertical) {
Add(new cMenuEditIntItem(tr("Channel Header Font Size"), &tmpConfig->FontChannelHeaderDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Channel Groups Font Size"), &tmpConfig->FontChannelGroupsDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Grid Font Size"), &tmpConfig->FontGridDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Grid Font Small Size"), &tmpConfig->FontGridSmallDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Timeline Weekday Font Size"), &tmpConfig->FontTimeLineWeekdayDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Timeline Date Font Size"), &tmpConfig->FontTimeLineDateDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Timeline Time Font Size"), &tmpConfig->FontTimeLineTimeDelta, -30, 30));
} else if (tmpConfig->displayMode == eHorizontal) {
Add(new cMenuEditIntItem(tr("Channel Header Font Size"), &tmpConfig->FontChannelHeaderHorizontalDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Channel Groups Font Size"), &tmpConfig->FontChannelGroupsHorizontalDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Grid Font Size"), &tmpConfig->FontGridHorizontalDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Grid Font Small Size"), &tmpConfig->FontGridHorizontalSmallDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Timeline Date Font Size"), &tmpConfig->FontTimeLineDateHorizontalDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Timeline Time Font Size"), &tmpConfig->FontTimeLineTimeHorizontalDelta, -30, 30));
}
Add(new cMenuEditIntItem(tr("Search & Recording Menu Font Size"), &tmpTvguideConfig->FontRecMenuItemDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Search & Recording Menu Small Font Size"), &tmpTvguideConfig->FontRecMenuItemSmallDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Search & Recording Menu Header Font Size"), &tmpTvguideConfig->FontRecMenuItemLargeDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Search & Recording Menu Font Size"), &tmpConfig->FontRecMenuItemDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Search & Recording Menu Small Font Size"), &tmpConfig->FontRecMenuItemSmallDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Search & Recording Menu Header Font Size"), &tmpConfig->FontRecMenuItemLargeDelta, -30, 30));
SetCurrent(Get(currentItem));
Display();
@@ -371,7 +394,7 @@ void cMenuSetupFont::Set(void) {
//----- Recording Menus and Favorites -------------------------------------------------------------------------------------------------------
cMenuSetupFavorites::cMenuSetupFavorites(cTvguideConfig* data) : cMenuSetupSubMenu(tr("Recording Menus and Favorites"), data) {
cMenuSetupFavorites::cMenuSetupFavorites(cTVGuideConfig* data) : cMenuSetupSubMenu(tr("Recording Menus and Favorites"), data) {
strn0cpy(description1, data->descUser1.c_str(), sizeof(description1));
strn0cpy(description2, data->descUser2.c_str(), sizeof(description2));
strn0cpy(description3, data->descUser3.c_str(), sizeof(description3));
@@ -390,43 +413,44 @@ void cMenuSetupFavorites::Set(void) {
int currentItem = Current();
Clear();
Add(new cMenuEditStraItem(tr("Folder for instant Recordings"), &tmpTvguideConfig->instRecFolderMode, 3, recFolderMode));
if (tmpTvguideConfig->instRecFolderMode == eFolderFixed) {
Add(new cMenuEditStraItem(tr("Folder for instant Recordings"), &tmpConfig->instRecFolderMode, 3, recFolderMode));
if (tmpConfig->instRecFolderMode == eFolderFixed) {
Add(new cMenuEditStrItem(cString::sprintf("%s%s", *indent, tr("Folder")), fixedFolder, sizeof(fixedFolder), trVDR(FileNameChars)));
}
if (pRemoteTimers)
Add(new cMenuEditBoolItem(tr("Use Remotetimers"), &tmpTvguideConfig->useRemoteTimers));
Add(new cMenuEditBoolItem(tr("Use Remotetimers"), &tmpConfig->useRemoteTimers));
Add(new cMenuEditBoolItem(tr("Use \"What's on now\" in favorites"), &tmpTvguideConfig->favWhatsOnNow));
Add(new cMenuEditBoolItem(tr("Use \"What's on next\" in favorites"), &tmpTvguideConfig->favWhatsOnNext));
Add(new cMenuEditBoolItem(tr("Use user defined time 1 in favorites"), &tmpTvguideConfig->favUseTime1));
if (tmpTvguideConfig->favUseTime1) {
Add(new cMenuEditBoolItem(tr("Limit channels in favorites"), &tmpConfig->favLimitChannels));
if (tmpConfig->favLimitChannels) {
Add(new cMenuEditChanItem(tr("Start Channel"), &tmpConfig->favStartChannel));
Add(new cMenuEditChanItem(tr("Stop Channel"), &tmpConfig->favStopChannel));
}
Add(new cMenuEditBoolItem(tr("Use \"What's on now\" in favorites"), &tmpConfig->favWhatsOnNow));
Add(new cMenuEditBoolItem(tr("Use \"What's on next\" in favorites"), &tmpConfig->favWhatsOnNext));
Add(new cOsdItem(tr("User defined times in favorites:"), osUnknown, false));
Add(new cMenuEditBoolItem(tr("Use user defined time 1"), &tmpConfig->favUseTime1));
if (tmpConfig->favUseTime1) {
Add(new cMenuEditStrItem(cString::sprintf("%s%s", *indent, tr("Description")), description1, sizeof(description1), trVDR(FileNameChars)));
Add(new cMenuEditTimeItem(cString::sprintf("%s%s", *indent, tr("Time")), &tmpTvguideConfig->favTime1));
Add(new cMenuEditTimeItem(cString::sprintf("%s%s", *indent, tr("Time")), &tmpConfig->favTime1));
}
Add(new cMenuEditBoolItem(tr("Use user defined time 2 in favorites"), &tmpTvguideConfig->favUseTime2));
if (tmpTvguideConfig->favUseTime2) {
Add(new cMenuEditBoolItem(tr("Use user defined time 2"), &tmpConfig->favUseTime2));
if (tmpConfig->favUseTime2) {
Add(new cMenuEditStrItem(cString::sprintf("%s%s", *indent, tr("Description")), description2, sizeof(description2), trVDR(FileNameChars)));
Add(new cMenuEditTimeItem(cString::sprintf("%s%s", *indent, tr("Time")), &tmpTvguideConfig->favTime2));
Add(new cMenuEditTimeItem(cString::sprintf("%s%s", *indent, tr("Time")), &tmpConfig->favTime2));
}
Add(new cMenuEditBoolItem(tr("Use user defined time 3 in favorites"), &tmpTvguideConfig->favUseTime3));
if (tmpTvguideConfig->favUseTime3) {
Add(new cMenuEditBoolItem(tr("Use user defined time 3"), &tmpConfig->favUseTime3));
if (tmpConfig->favUseTime3) {
Add(new cMenuEditStrItem(cString::sprintf("%s%s", *indent, tr("Description")), description3, sizeof(description3), trVDR(FileNameChars)));
Add(new cMenuEditTimeItem(cString::sprintf("%s%s", *indent, tr("Time")), &tmpTvguideConfig->favTime3));
Add(new cMenuEditTimeItem(cString::sprintf("%s%s", *indent, tr("Time")), &tmpConfig->favTime3));
}
Add(new cMenuEditBoolItem(tr("Use user defined time 4 in favorites"), &tmpTvguideConfig->favUseTime4));
if (tmpTvguideConfig->favUseTime4) {
Add(new cMenuEditBoolItem(tr("Use user defined time 4"), &tmpConfig->favUseTime4));
if (tmpConfig->favUseTime4) {
Add(new cMenuEditStrItem(cString::sprintf("%s%s", *indent, tr("Description")), description4, sizeof(description4), trVDR(FileNameChars)));
Add(new cMenuEditTimeItem(cString::sprintf("%s%s", *indent, tr("Time")), &tmpTvguideConfig->favTime4));
}
Add(new cMenuEditBoolItem(tr("Limit channels in favorites"), &tmpTvguideConfig->favLimitChannels));
if (tmpTvguideConfig->favLimitChannels) {
Add(new cMenuEditChanItem(tr("Start Channel"), &tmpTvguideConfig->favStartChannel));
Add(new cMenuEditChanItem(tr("Stop Channel"), &tmpTvguideConfig->favStopChannel));
Add(new cMenuEditTimeItem(cString::sprintf("%s%s", *indent, tr("Time")), &tmpConfig->favTime4));
}
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));
Add(new cMenuEditStraItem(tr("Switch Mode"), &tmpConfig->switchMode, 3, switchModeItems));
Add(new cMenuEditIntItem(tr("Switch (x)min before start of the show"), &tmpConfig->switchMinsBefore, 0, 10));
SetCurrent(Get(currentItem));
@@ -434,53 +458,63 @@ void cMenuSetupFavorites::Set(void) {
}
eOSState cMenuSetupFavorites::ProcessKey(eKeys Key) {
int tmpFavUseTime1 = tmpTvguideConfig->favUseTime1;
int tmpFavUseTime2 = tmpTvguideConfig->favUseTime2;
int tmpFavUseTime3 = tmpTvguideConfig->favUseTime3;
int tmpFavUseTime4 = tmpTvguideConfig->favUseTime4;
int tmpFavLimitChannels = tmpTvguideConfig->favLimitChannels;
int tmpFolderMode = tmpTvguideConfig->instRecFolderMode;
int tmpFavUseTime1 = tmpConfig->favUseTime1;
int tmpFavUseTime2 = tmpConfig->favUseTime2;
int tmpFavUseTime3 = tmpConfig->favUseTime3;
int tmpFavUseTime4 = tmpConfig->favUseTime4;
int tmpFavLimitChannels = tmpConfig->favLimitChannels;
int tmpFolderMode = tmpConfig->instRecFolderMode;
eOSState state = cOsdMenu::ProcessKey(Key);
if (Key == kOk) {
tmpTvguideConfig->descUser1 = description1;
tmpTvguideConfig->descUser2 = description2;
tmpTvguideConfig->descUser3 = description3;
tmpTvguideConfig->descUser4 = description4;
tmpTvguideConfig->instRecFixedFolder = fixedFolder;
} else if ((Key == kLeft)||(Key == kRight)) {
if ((tmpFavUseTime1 != tmpTvguideConfig->favUseTime1) ||
(tmpFavUseTime2 != tmpTvguideConfig->favUseTime2) ||
(tmpFavUseTime3 != tmpTvguideConfig->favUseTime3) ||
(tmpFavUseTime4 != tmpTvguideConfig->favUseTime4) ||
(tmpFavLimitChannels != tmpTvguideConfig->favLimitChannels) ||
(tmpFolderMode != tmpTvguideConfig->instRecFolderMode) )
Set();
if ((tmpFavUseTime1 != tmpConfig->favUseTime1) ||
(tmpFavUseTime2 != tmpConfig->favUseTime2) ||
(tmpFavUseTime3 != tmpConfig->favUseTime3) ||
(tmpFavUseTime4 != tmpConfig->favUseTime4) ||
(tmpFavLimitChannels != tmpConfig->favLimitChannels) ||
(tmpFolderMode != tmpConfig->instRecFolderMode) ) {
Set();
Display();
}
if (state == osUnknown) {
switch (Key) {
case kOk: {
tmpConfig->descUser1 = cString::sprintf("%s", description1);
tmpConfig->descUser2 = cString::sprintf("%s", description2);
tmpConfig->descUser3 = cString::sprintf("%s", description3);
tmpConfig->descUser4 = cString::sprintf("%s", description4);
return osBack; }
default:
break;
}
}
return state;
}
//-----Image Caching-------------------------------------------------------------------------------------------------------------
cMenuSetupImageCache::cMenuSetupImageCache(cTvguideConfig* data) : cMenuSetupSubMenu(tr("Image Loading and Caching"), data) {
cMenuSetupImageCache::cMenuSetupImageCache(cTVGuideConfig* data) : cMenuSetupSubMenu(tr("Image Loading and Caching"), data) {
Set();
}
void cMenuSetupImageCache::Set(void) {
int currentItem = Current();
Clear();
Add(new cMenuEditBoolItem(tr("Create Log Messages for image loading"), &tmpTvguideConfig->debugImageLoading));
Add(new cMenuEditBoolItem(tr("Limit Logo Cache"), &tmpTvguideConfig->limitLogoCache));
if (&tmpTvguideConfig->limitLogoCache) {
Add(new cMenuEditIntItem(cString::sprintf("%s%s", *indent, tr("Maximal number of logos to cache")), &tmpTvguideConfig->numLogosMax, 1, 9999));
Add(new cMenuEditBoolItem(tr("Create Log Messages for image loading"), &tmpConfig->debugImageLoading));
Add(new cMenuEditBoolItem(tr("Limit Logo Cache"), &tmpConfig->limitLogoCache));
if (&tmpConfig->limitLogoCache) {
Add(new cMenuEditIntItem(cString::sprintf("%s%s", *indent, tr("Maximal number of logos to cache")), &tmpConfig->numLogosMax, 1, 9999));
}
Add(new cMenuEditIntItem(tr("Number of logos to cache at start"), &tmpTvguideConfig->numLogosInitial, 0, 9999));
Add(new cMenuEditIntItem(tr("Number of logos to cache at start"), &tmpConfig->numLogosInitial, 0, 9999));
Add(InfoItem(tr("Cache Sizes"), ""));
Add(InfoItem(tr("OSD Element Cache"), (imgCache.GetCacheSize(ctOsdElement)).c_str()));
Add(InfoItem(tr("Logo cache"), (imgCache.GetCacheSize(ctLogo)).c_str()));
Add(InfoItem(tr("EPG Grid Cache"), (imgCache.GetCacheSize(ctGrid)).c_str()));
Add(InfoItem(tr("Channel Groups Cache"), (imgCache.GetCacheSize(ctChannelGroup)).c_str()));
Add(InfoItem(tr("Recording Menus Icon Cache"), (imgCache.GetCacheSize(ctIcon)).c_str()));
Add(InfoItem(tr("OSD Element Cache"), cString::sprintf("\t%s", (imgCache.GetCacheSize(ctOsdElement)).c_str())));
Add(InfoItem(tr("Logo cache"), cString::sprintf("\t%s", (imgCache.GetCacheSize(ctLogo)).c_str())));
Add(InfoItem(tr("EPG Grid Cache"), cString::sprintf("\t%s", (imgCache.GetCacheSize(ctGrid)).c_str())));
Add(InfoItem(tr("Channel Groups Cache"), cString::sprintf("\t%s", (imgCache.GetCacheSize(ctChannelGroup)).c_str())));
Add(InfoItem(tr("Recording Menus Icon Cache"), cString::sprintf("\t%s", (imgCache.GetCacheSize(ctIcon)).c_str())));
SetCurrent(Get(currentItem));
Display();

18
setup.h
View File

@@ -4,12 +4,14 @@
#include <vdr/menuitems.h>
#include "config.h"
extern cTVGuideConfig config;
class cTvguideSetup : public cMenuSetupPage {
public:
cTvguideSetup(void);
virtual ~cTvguideSetup();
private:
cTvguideConfig tmpTvguideConfig;
cTVGuideConfig tmpConfig;
void Setup(void);
protected:
virtual eOSState ProcessKey(eKeys Key);
@@ -19,13 +21,13 @@ class cTvguideSetup : public cMenuSetupPage {
class cMenuSetupSubMenu : public cOsdMenu {
protected:
cTvguideConfig *tmpTvguideConfig;
cTVGuideConfig *tmpConfig;
virtual eOSState ProcessKey(eKeys Key);
virtual void Set(void) = 0;
cOsdItem *InfoItem(const char *label, const char *value);
cString indent;
public:
cMenuSetupSubMenu(const char *Title, cTvguideConfig *data);
cMenuSetupSubMenu(const char *Title, cTVGuideConfig *data);
};
class cMenuSetupGeneral : public cMenuSetupSubMenu {
@@ -39,7 +41,7 @@ class cMenuSetupGeneral : public cMenuSetupSubMenu {
const char *useSubtitleRerunTexts[3];
void Set(void);
public:
cMenuSetupGeneral(cTvguideConfig *data);
cMenuSetupGeneral(cTVGuideConfig *data);
};
class cMenuSetupScreenLayout : public cMenuSetupSubMenu {
@@ -50,7 +52,7 @@ class cMenuSetupScreenLayout : public cMenuSetupSubMenu {
const char * logoExtensionItems[2];
void Set(void);
public:
cMenuSetupScreenLayout(cTvguideConfig *data);
cMenuSetupScreenLayout(cTVGuideConfig *data);
};
class cMenuSetupFont : public cMenuSetupSubMenu {
@@ -58,7 +60,7 @@ class cMenuSetupFont : public cMenuSetupSubMenu {
cStringList fontNames;
void Set(void);
public:
cMenuSetupFont(cTvguideConfig *data);
cMenuSetupFont(cTVGuideConfig *data);
};
class cMenuSetupFavorites : public cMenuSetupSubMenu {
@@ -73,14 +75,14 @@ class cMenuSetupFavorites : public cMenuSetupSubMenu {
void Set(void);
virtual eOSState ProcessKey(eKeys Key);
public:
cMenuSetupFavorites(cTvguideConfig *data);
cMenuSetupFavorites(cTVGuideConfig *data);
};
class cMenuSetupImageCache : public cMenuSetupSubMenu {
protected:
void Set(void);
public:
cMenuSetupImageCache(cTvguideConfig *data);
cMenuSetupImageCache(cTVGuideConfig *data);
};
#endif //__TVGUIDE_SETUP_H

View File

@@ -1,146 +1,143 @@
#include "tools.h"
#include "services/scraper2vdr.h"
#include "imageloader.h"
#include "statusheader.h"
cStatusHeader::cStatusHeader(void) {
color = theme.Color(clrStatusHeader);
colorBlending = theme.Color(clrStatusHeaderBlending);
height = geoManager.statusHeaderHeight;
width = geoManager.headerContentWidth;
tvFrameWidth = geoManager.tvFrameWidth;
pixmap = osdManager.requestPixmap(1, cRect(0, 0, width, height));
pixmapText = osdManager.requestPixmap(2, cRect(0, 0, width, height));
pixmapTVFrame = osdManager.requestPixmap(1, cRect(width, 0, tvFrameWidth, height));
}
cStatusHeader::~cStatusHeader(void) {
osdManager.releasePixmap(pixmapText);
osdManager.releasePixmap(pixmapTVFrame);
if (tvguideConfig.scaleVideo) {
cRect vidWin = cDevice::PrimaryDevice()->CanScaleVideo(cRect::Null);
cDevice::PrimaryDevice()->ScaleVideo(vidWin);
}
}
void cStatusHeader::Draw(void) {
pixmapText->Fill(clrTransparent);
pixmapTVFrame->Fill(clrTransparent);
if (tvguideConfig.style == eStyleGraphical) {
if (tvguideConfig.scaleVideo) {
drawBackgroundGraphical(bgStatusHeaderWindowed);
cImage *tvFrameBack = imgCache.GetOsdElement(oeStatusHeaderTVFrame);
if (tvFrameBack)
pixmapTVFrame->DrawImage(cPoint(0,0), *tvFrameBack);
} else {
drawBackgroundGraphical(bgStatusHeaderFull);
}
} else {
if (tvguideConfig.decorateVideo) {
DecorateVideoFrame();
}
drawBackground();
drawBorder();
}
}
void cStatusHeader::ScaleVideo(void) {
if (tvguideConfig.scaleVideo) {
int width = height * 16 / 9;
int x = osdManager.Left() + geoManager.osdWidth - width;
int y = osdManager.Top();
cRect availableRect(x, y, width, height);
cRect vidWin = cDevice::PrimaryDevice()->CanScaleVideo(availableRect);
cDevice::PrimaryDevice()->ScaleVideo(vidWin);
}
}
void cStatusHeader::DrawInfoText(cGrid *grid) {
int border = 10;
int textWidth = 0;
if (tvguideConfig.displayMode == eVertical)
textWidth = width - 2 * border - geoManager.clockWidth - 2;
else
textWidth = width - 2 * border;
tColor colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent;
pixmapText->Fill(clrTransparent);
int x = border;
int y = border;
if (!grid->isDummy()) {
const cEvent *event = grid->GetEvent();
int newX = DrawPoster(event, x, y, height-2*border, border);
if (newX > 0) {
textWidth -= (newX - x);
x += newX;
}
cString time = grid->getTimeString();
cString title("");
title = cString::sprintf(": %s", event->Title());
cString header = cString::sprintf("%s%s", *time, *title);
header = CutText(*header, textWidth, fontManager.FontStatusHeaderLarge).c_str();
pixmapText->DrawText(cPoint(x,y), *header, theme.Color(clrFont), colorTextBack, fontManager.FontStatusHeaderLarge);
y += fontManager.FontStatusHeaderLarge->Height() + border;
int heightText = pixmapText->ViewPort().Height() - y;
cTextWrapper description;
description.Set(event->Description(), fontManager.FontStatusHeader, textWidth);
int lineHeight = fontManager.FontStatusHeader->Height();
int textLines = description.Lines();
int maxLines = heightText / lineHeight;
int lines = std::min(textLines, maxLines);
for (int i = 0; i < lines-1; i++) {
pixmapText->DrawText(cPoint(x,y), description.GetLine(i), theme.Color(clrFont), colorTextBack, fontManager.FontStatusHeader);
y += lineHeight;
}
cString lastLine = description.GetLine(lines-1);
if (textLines > maxLines) {
lastLine = cString::sprintf("%s...", *lastLine);
}
pixmapText->DrawText(cPoint(x,y), *lastLine, theme.Color(clrFont), colorTextBack, fontManager.FontStatusHeader);
} else {
int heightText = pixmapText->ViewPort().Height() - y;
y += (heightText - fontManager.FontStatusHeaderLarge->Height() - 2*border)/2;
pixmapText->DrawText(cPoint(x,y), *grid->getText(), theme.Color(clrFont), colorTextBack, fontManager.FontStatusHeaderLarge);
}
}
int cStatusHeader::DrawPoster(const cEvent *event, int x, int y, int height, int border) {
bool hasPoster = false;
ScraperGetPoster posterScraper2Vdr;
int posterWidth = 0;
int posterHeight = 0;
static cPlugin *pScraper = GetScraperPlugin();
if (pScraper) {
posterScraper2Vdr.event = event;
posterScraper2Vdr.recording = NULL;
if (pScraper->Service("GetPoster", &posterScraper2Vdr)) {
hasPoster = true;
int posterWidthOrig = posterScraper2Vdr.poster.width;
int posterHeightOrig = posterScraper2Vdr.poster.height;
posterHeight = height;
posterWidth = posterWidthOrig * ((double)posterHeight / (double)posterHeightOrig);
} else {
hasPoster = false;
}
}
if (hasPoster) {
cImageLoader imgLoader;
if (imgLoader.LoadPoster(posterScraper2Vdr.poster.path.c_str(), posterWidth, posterHeight)) {
pixmapText->DrawImage(cPoint(x, y), imgLoader.GetImage());
return posterWidth + border;
}
}
return 0;
}
void cStatusHeader::DecorateVideoFrame(void) {
int radius = 16;
int frame = 2;
pixmapTVFrame->DrawRectangle(cRect(0, 0, tvFrameWidth, frame), theme.Color(clrBackgroundOSD));
pixmapTVFrame->DrawEllipse(cRect(frame,frame,radius,radius), theme.Color(clrBackgroundOSD), -2);
pixmapTVFrame->DrawRectangle(cRect(tvFrameWidth - frame, frame, frame, height - 2*frame), theme.Color(clrBackgroundOSD));
pixmapTVFrame->DrawEllipse(cRect(tvFrameWidth - radius - frame, frame, radius, radius), theme.Color(clrBackgroundOSD), -1);
pixmapTVFrame->DrawRectangle(cRect(0, frame, frame, height - 2*frame), theme.Color(clrBackgroundOSD));
pixmapTVFrame->DrawEllipse(cRect(frame, height - radius - frame, radius, radius), theme.Color(clrBackgroundOSD), -3);
pixmapTVFrame->DrawRectangle(cRect(0, height - frame, tvFrameWidth, frame), theme.Color(clrBackgroundOSD));
pixmapTVFrame->DrawEllipse(cRect(tvFrameWidth - radius - frame, height - radius - frame, radius, radius), theme.Color(clrBackgroundOSD), -4);
}
#include "tools.h"
#include "services/scraper2vdr.h"
#include "imageloader.h"
#include "statusheader.h"
cStatusHeader::cStatusHeader(void) {
color = theme.Color(clrStatusHeader);
colorBlending = theme.Color(clrStatusHeaderBlending);
height = geoManager.statusHeaderHeight;
width = geoManager.headerContentWidth;
tvFrameWidth = geoManager.tvFrameWidth;
pixmap = osdManager.requestPixmap(1, cRect(0, 0, width, height));
pixmapText = osdManager.requestPixmap(2, cRect(0, 0, width, height));
pixmapTVFrame = osdManager.requestPixmap(1, cRect(width, 0, tvFrameWidth, height));
}
cStatusHeader::~cStatusHeader(void) {
osdManager.releasePixmap(pixmapText);
osdManager.releasePixmap(pixmapTVFrame);
if (config.scaleVideo) {
cRect vidWin = cDevice::PrimaryDevice()->CanScaleVideo(cRect::Null);
cDevice::PrimaryDevice()->ScaleVideo(vidWin);
}
}
void cStatusHeader::Draw(void) {
pixmapText->Fill(clrTransparent);
pixmapTVFrame->Fill(clrTransparent);
if (config.style == eStyleGraphical) {
if (config.scaleVideo) {
drawBackgroundGraphical(bgStatusHeaderWindowed);
cImage *tvFrameBack = imgCache.GetOsdElement(oeStatusHeaderTVFrame);
if (tvFrameBack)
pixmapTVFrame->DrawImage(cPoint(0,0), *tvFrameBack);
} else {
drawBackgroundGraphical(bgStatusHeaderFull);
}
} else {
if (config.decorateVideo) {
DecorateVideoFrame();
}
drawBackground();
drawBorder();
}
}
void cStatusHeader::ScaleVideo(void) {
if (config.scaleVideo) {
int width = height * 16 / 9;
int x = osdManager.Left() + geoManager.osdWidth - width;
int y = osdManager.Top();
cRect availableRect(x, y, width, height);
cRect vidWin = cDevice::PrimaryDevice()->CanScaleVideo(availableRect);
cDevice::PrimaryDevice()->ScaleVideo(vidWin);
}
}
void cStatusHeader::DrawInfoText(cGridElement *grid) {
int border = 10;
int textWidth = 0;
textWidth = width - 2 * border;
tColor colorTextBack = (config.style == eStyleFlat)?color:clrTransparent;
pixmapText->Fill(clrTransparent);
int x = border;
int y = border;
if (!grid->isDummy()) {
const cEvent *event = grid->GetEvent();
int newX = DrawPoster(event, x, y, height-2*border, border);
if (newX > 0) {
textWidth -= (newX - x);
x += newX;
}
cString time = grid->getTimeString();
cString title("");
title = cString::sprintf(": %s", event->Title());
cString header = cString::sprintf("%s%s", *time, *title);
header = CutText(*header, textWidth, fontManager.FontStatusHeaderLarge).c_str();
pixmapText->DrawText(cPoint(x,y), *header, theme.Color(clrFont), colorTextBack, fontManager.FontStatusHeaderLarge);
y += fontManager.FontStatusHeaderLarge->Height() + border;
int heightText = pixmapText->ViewPort().Height() - y;
cTextWrapper description;
description.Set(event->Description(), fontManager.FontStatusHeader, textWidth);
int lineHeight = fontManager.FontStatusHeader->Height();
int textLines = description.Lines();
int maxLines = heightText / lineHeight;
int lines = std::min(textLines, maxLines);
for (int i = 0; i < lines-1; i++) {
pixmapText->DrawText(cPoint(x,y), description.GetLine(i), theme.Color(clrFont), colorTextBack, fontManager.FontStatusHeader);
y += lineHeight;
}
cString lastLine = description.GetLine(lines-1);
if (textLines > maxLines) {
lastLine = cString::sprintf("%s...", *lastLine);
}
pixmapText->DrawText(cPoint(x,y), *lastLine, theme.Color(clrFont), colorTextBack, fontManager.FontStatusHeader);
} else {
int heightText = pixmapText->ViewPort().Height() - y;
y += (heightText - fontManager.FontStatusHeaderLarge->Height() - 2*border)/2;
pixmapText->DrawText(cPoint(x,y), *grid->getText(), theme.Color(clrFont), colorTextBack, fontManager.FontStatusHeaderLarge);
}
}
int cStatusHeader::DrawPoster(const cEvent *event, int x, int y, int height, int border) {
bool hasPoster = false;
ScraperGetPoster posterScraper2Vdr;
int posterWidth = 0;
int posterHeight = 0;
static cPlugin *pScraper = GetScraperPlugin();
if (pScraper) {
posterScraper2Vdr.event = event;
posterScraper2Vdr.recording = NULL;
if (pScraper->Service("GetPoster", &posterScraper2Vdr)) {
hasPoster = true;
int posterWidthOrig = posterScraper2Vdr.poster.width;
int posterHeightOrig = posterScraper2Vdr.poster.height;
posterHeight = height;
posterWidth = posterWidthOrig * ((double)posterHeight / (double)posterHeightOrig);
} else {
hasPoster = false;
}
}
if (hasPoster) {
cImageLoader imgLoader;
if (imgLoader.LoadPoster(posterScraper2Vdr.poster.path.c_str(), posterWidth, posterHeight)) {
pixmapText->DrawImage(cPoint(x, y), imgLoader.GetImage());
return posterWidth + border;
}
}
return 0;
}
void cStatusHeader::DecorateVideoFrame(void) {
int radius = 16;
int frame = 2;
pixmapTVFrame->DrawRectangle(cRect(0, 0, tvFrameWidth, frame), theme.Color(clrBackgroundOSD));
pixmapTVFrame->DrawEllipse(cRect(frame,frame,radius,radius), theme.Color(clrBackgroundOSD), -2);
pixmapTVFrame->DrawRectangle(cRect(tvFrameWidth - frame, frame, frame, height - 2*frame), theme.Color(clrBackgroundOSD));
pixmapTVFrame->DrawEllipse(cRect(tvFrameWidth - radius - frame, frame, radius, radius), theme.Color(clrBackgroundOSD), -1);
pixmapTVFrame->DrawRectangle(cRect(0, frame, frame, height - 2*frame), theme.Color(clrBackgroundOSD));
pixmapTVFrame->DrawEllipse(cRect(frame, height - radius - frame, radius, radius), theme.Color(clrBackgroundOSD), -3);
pixmapTVFrame->DrawRectangle(cRect(0, height - frame, tvFrameWidth, frame), theme.Color(clrBackgroundOSD));
pixmapTVFrame->DrawEllipse(cRect(tvFrameWidth - radius - frame, height - radius - frame, radius, radius), theme.Color(clrBackgroundOSD), -4);
}

View File

@@ -1,25 +1,25 @@
#ifndef __TVGUIDE_STATUSHEADER_H
#define __TVGUIDE_STATUSHEADER_H
#include "styledpixmap.h"
#include "grid.h"
// --- cStatusHeader -------------------------------------------------------------
class cStatusHeader : public cStyledPixmap {
private:
int width, height;
int tvFrameWidth;
cPixmap *pixmapText;
cPixmap *pixmapTVFrame;
int DrawPoster(const cEvent *event, int x, int y, int height, int border);
void DecorateVideoFrame(void);
public:
cStatusHeader(void);
virtual ~cStatusHeader(void);
void Draw(void);
void ScaleVideo(void);
void DrawInfoText(cGrid *grid);
};
#endif //__TVGUIDE_STATUSHEADER_H
#ifndef __TVGUIDE_STATUSHEADER_H
#define __TVGUIDE_STATUSHEADER_H
#include "styledpixmap.h"
#include "gridelement.h"
// --- cStatusHeader -------------------------------------------------------------
class cStatusHeader : public cStyledPixmap {
private:
int width, height;
int tvFrameWidth;
cPixmap *pixmapText;
cPixmap *pixmapTVFrame;
int DrawPoster(const cEvent *event, int x, int y, int height, int border);
void DecorateVideoFrame(void);
public:
cStatusHeader(void);
virtual ~cStatusHeader(void);
void Draw(void);
void ScaleVideo(void);
void DrawInfoText(cGridElement *grid);
};
#endif //__TVGUIDE_STATUSHEADER_H

View File

@@ -1,205 +1,205 @@
#include "imageloader.h"
#include "geometrymanager.h"
#include "styledpixmap.h"
cStyledPixmap::cStyledPixmap(void) {
pixmap = NULL;
}
cStyledPixmap::cStyledPixmap(cPixmap *pixmap) {
this->pixmap = pixmap;
}
cStyledPixmap::~cStyledPixmap(void) {
if (pixmap)
osdManager.releasePixmap(pixmap);
}
void cStyledPixmap::setPixmap(cPixmap *pixmap) {
if (pixmap) {
this->pixmap = pixmap;
}
}
void cStyledPixmap::drawBackground() {
if (tvguideConfig.style == eStyleBlendingDefault){
drawBlendedBackground();
} else if (tvguideConfig.style == eStyleBlendingMagick){
drawSparsedBackground();
} else {
pixmap->Fill(color);
}
}
void cStyledPixmap::drawBackgroundGraphical(eBackgroundType type, bool active) {
cImage *back = NULL;
if (type == bgGrid) {
back = imgCache.GetGrid(pixmap->ViewPort().Width(), pixmap->ViewPort().Height(), active);
} else if (type == bgChannelHeader) {
back = imgCache.GetOsdElement(oeLogoBack);
} else if (type == bgChannelGroup) {
back = imgCache.GetChannelGroup(pixmap->ViewPort().Width(), pixmap->ViewPort().Height());
} else if (type == bgStatusHeaderWindowed) {
back = imgCache.GetOsdElement(oeStatusHeaderContentWindowed);
} else if (type == bgStatusHeaderFull) {
back = imgCache.GetOsdElement(oeStatusHeaderContentFull);
} else if (type == bgClock) {
back = imgCache.GetOsdElement(oeClock);
} else if (type == bgButton) {
drawBackgroundButton(active);
return;
} else if (type == bgRecMenuBack) {
cImageLoader imgLoader;
if (imgLoader.LoadOsdElement("recmenu_background", pixmap->ViewPort().Width(), pixmap->ViewPort().Height())) {
cImage background = imgLoader.GetImage();
pixmap->DrawImage(cPoint(0, 0), background);
} else {
pixmap->Fill(clrTransparent);
}
return;
} else if (type == bgChannelJump) {
back = imgCache.GetOsdElement(oeChannelJump);
}
if (back) {
pixmap->DrawImage(cPoint(0,0), *back);
} else {
pixmap->Fill(clrTransparent);
}
}
void cStyledPixmap::drawBackgroundButton(bool active) {
std::string buttonName = "";
int buttonWidth = pixmap->ViewPort().Width();
int buttonHeight = pixmap->ViewPort().Height();
if (buttonWidth > geoManager.osdWidth * 50 / 100) {
if (active)
buttonName = "button_active_70percent";
else
buttonName = "button_70percent";
} else {
if (active)
buttonName = "button_active_30percent";
else
buttonName = "button_30percent";
}
cImageLoader imgLoader;
if (imgLoader.LoadOsdElement(buttonName.c_str(), buttonWidth, buttonHeight)) {
cImage button = imgLoader.GetImage();
pixmap->DrawImage(cPoint(0, 0), button);
} else {
pixmap->Fill(clrTransparent);
}
}
void cStyledPixmap::drawBlendedBackground() {
int width = pixmap->ViewPort().Width();
int height = pixmap->ViewPort().Height();
pixmap->Fill(color);
int numSteps = 64;
int alphaStep = 0x04;
if (height < 30)
return;
else if (height < 100) {
numSteps = 32;
alphaStep = 0x08;
}
int stepY = 0.5*height / numSteps;
if (stepY == 0) stepY = 1;
int alpha = 0x00;
tColor clr;
for (int i = 0; i<numSteps; i++) {
clr = AlphaBlend(color, colorBlending, alpha);
pixmap->DrawRectangle(cRect(0,i*stepY,width,stepY), clr);
alpha += alphaStep;
}
}
void cStyledPixmap::drawSparsedBackground() {
int width = pixmap->ViewPort().Width();
int height = pixmap->ViewPort().Height();
cImageLoader imgLoader;
if (imgLoader.DrawBackground(colorBlending, color, width, height))
pixmap->DrawImage(cPoint(0,0), imgLoader.GetImage());
}
void cStyledPixmap::drawBorder() {
int width = pixmap->ViewPort().Width();
int height = pixmap->ViewPort().Height();
drawDefaultBorder(width, height);
if (tvguideConfig.roundedCorners) {
int borderRadius = 12;
drawRoundedCorners(width, height, borderRadius);
}
}
void cStyledPixmap::drawDefaultBorder(int width, int height) {
pixmap->DrawRectangle(cRect(0,0,width,2), clrTransparent); //top
pixmap->DrawRectangle(cRect(0,0,2,height), clrTransparent); //left
pixmap->DrawRectangle(cRect(0,height-2,width,2), clrTransparent); //bottom
pixmap->DrawRectangle(cRect(width-2,0,2,height), clrTransparent); //right
pixmap->DrawRectangle(cRect(2,2,width-4,1), theme.Color(clrBorder)); //top
pixmap->DrawRectangle(cRect(2,2,1,height-4), theme.Color(clrBorder)); //left
pixmap->DrawRectangle(cRect(2,height-3,width-4,1), theme.Color(clrBorder)); //bottom
pixmap->DrawRectangle(cRect(width-3,2,1,height-4), theme.Color(clrBorder)); //right
}
void cStyledPixmap::drawBoldBorder() {
int width = pixmap->ViewPort().Width();
int height = pixmap->ViewPort().Height();
pixmap->DrawRectangle(cRect(0,0,width,2), theme.Color(clrBorder)); //top
pixmap->DrawRectangle(cRect(0,0,2,height), theme.Color(clrBorder)); //left
pixmap->DrawRectangle(cRect(0,height-2,width,2), theme.Color(clrBorder)); //bottom
pixmap->DrawRectangle(cRect(width-2,0,2,height), theme.Color(clrBorder)); //right
}
void cStyledPixmap::drawRoundedCorners(int width, int height, int radius) {
pixmap->DrawEllipse(cRect(2,2,radius,radius), theme.Color(clrBorder), -2);
pixmap->DrawEllipse(cRect(1,1,radius,radius), clrTransparent, -2);
pixmap->DrawEllipse(cRect(width-radius - 2,2,radius,radius), theme.Color(clrBorder), -1);
pixmap->DrawEllipse(cRect(width-radius - 1,1,radius,radius), clrTransparent, -1);
if( height > 2*radius) {
pixmap->DrawEllipse(cRect(2,height-radius - 2,radius,radius), theme.Color(clrBorder), -3);
pixmap->DrawEllipse(cRect(1,height-radius - 1,radius,radius), clrTransparent, -3);
pixmap->DrawEllipse(cRect(width-radius - 2,height-radius - 2,radius,radius), theme.Color(clrBorder), -4);
pixmap->DrawEllipse(cRect(width-radius - 1,height-radius - 1,radius,radius), clrTransparent, -4);
}
}
void cStyledPixmap::drawVerticalLine(int x, int yStart, int yStop, tColor col) {
for (int y = yStart; y <= yStop; y++) {
pixmap->DrawPixel(cPoint(x,y), col);
}
}
void cStyledPixmap::drawHorizontalLine(int y, int xStart, int xStop, tColor col) {
for (int x = xStart; x <= xStop; x++) {
pixmap->DrawPixel(cPoint(x,y), col);
}
}
void cStyledPixmap::DrawText(const cPoint &Point, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font) {
pixmap->DrawText(Point, s, ColorFg, ColorBg, Font);
}
void cStyledPixmap::DrawImage(const cPoint &Point, const cImage &Image) {
pixmap->DrawImage(Point, Image);
}
void cStyledPixmap::DrawRectangle(const cRect &Rect, tColor Color) {
pixmap->DrawRectangle(Rect,Color);
}
void cStyledPixmap::DrawEllipse(const cRect &Rect, tColor Color, int Quadrant) {
pixmap->DrawEllipse(Rect,Color,Quadrant);
}
void cStyledPixmap::SetViewPort(const cRect &Rect) {
pixmap->SetViewPort(Rect);
}
#include "imageloader.h"
#include "geometrymanager.h"
#include "styledpixmap.h"
cStyledPixmap::cStyledPixmap(void) {
pixmap = NULL;
}
cStyledPixmap::cStyledPixmap(cPixmap *pixmap) {
this->pixmap = pixmap;
}
cStyledPixmap::~cStyledPixmap(void) {
if (pixmap)
osdManager.releasePixmap(pixmap);
}
void cStyledPixmap::setPixmap(cPixmap *pixmap) {
if (pixmap) {
this->pixmap = pixmap;
}
}
void cStyledPixmap::drawBackground() {
if (config.style == eStyleBlendingDefault){
drawBlendedBackground();
} else if (config.style == eStyleBlendingMagick){
drawSparsedBackground();
} else {
pixmap->Fill(color);
}
}
void cStyledPixmap::drawBackgroundGraphical(eBackgroundType type, bool active) {
cImage *back = NULL;
if (type == bgGrid) {
back = imgCache.GetGrid(pixmap->ViewPort().Width(), pixmap->ViewPort().Height(), active);
} else if (type == bgChannelHeader) {
back = imgCache.GetOsdElement(oeLogoBack);
} else if (type == bgChannelGroup) {
back = imgCache.GetChannelGroup(pixmap->ViewPort().Width(), pixmap->ViewPort().Height());
} else if (type == bgStatusHeaderWindowed) {
back = imgCache.GetOsdElement(oeStatusHeaderContentWindowed);
} else if (type == bgStatusHeaderFull) {
back = imgCache.GetOsdElement(oeStatusHeaderContentFull);
} else if (type == bgClock) {
back = imgCache.GetOsdElement(oeClock);
} else if (type == bgButton) {
drawBackgroundButton(active);
return;
} else if (type == bgRecMenuBack) {
cImageLoader imgLoader;
if (imgLoader.LoadOsdElement("recmenu_background", pixmap->ViewPort().Width(), pixmap->ViewPort().Height())) {
cImage background = imgLoader.GetImage();
pixmap->DrawImage(cPoint(0, 0), background);
} else {
pixmap->Fill(clrTransparent);
}
return;
} else if (type == bgChannelJump) {
back = imgCache.GetOsdElement(oeChannelJump);
}
if (back) {
pixmap->DrawImage(cPoint(0,0), *back);
} else {
pixmap->Fill(clrTransparent);
}
}
void cStyledPixmap::drawBackgroundButton(bool active) {
std::string buttonName = "";
int buttonWidth = pixmap->ViewPort().Width();
int buttonHeight = pixmap->ViewPort().Height();
if (buttonWidth > geoManager.osdWidth * 50 / 100) {
if (active)
buttonName = "button_active_70percent";
else
buttonName = "button_70percent";
} else {
if (active)
buttonName = "button_active_30percent";
else
buttonName = "button_30percent";
}
cImageLoader imgLoader;
if (imgLoader.LoadOsdElement(buttonName.c_str(), buttonWidth, buttonHeight)) {
cImage button = imgLoader.GetImage();
pixmap->DrawImage(cPoint(0, 0), button);
} else {
pixmap->Fill(clrTransparent);
}
}
void cStyledPixmap::drawBlendedBackground() {
int width = pixmap->ViewPort().Width();
int height = pixmap->ViewPort().Height();
pixmap->Fill(color);
int numSteps = 64;
int alphaStep = 0x04;
if (height < 30)
return;
else if (height < 100) {
numSteps = 32;
alphaStep = 0x08;
}
int stepY = 0.5*height / numSteps;
if (stepY == 0) stepY = 1;
int alpha = 0x00;
tColor clr;
for (int i = 0; i<numSteps; i++) {
clr = AlphaBlend(color, colorBlending, alpha);
pixmap->DrawRectangle(cRect(0,i*stepY,width,stepY), clr);
alpha += alphaStep;
}
}
void cStyledPixmap::drawSparsedBackground() {
int width = pixmap->ViewPort().Width();
int height = pixmap->ViewPort().Height();
cImageLoader imgLoader;
if (imgLoader.DrawBackground(colorBlending, color, width, height))
pixmap->DrawImage(cPoint(0,0), imgLoader.GetImage());
}
void cStyledPixmap::drawBorder() {
int width = pixmap->ViewPort().Width();
int height = pixmap->ViewPort().Height();
drawDefaultBorder(width, height);
if (config.roundedCorners) {
int borderRadius = 12;
drawRoundedCorners(width, height, borderRadius);
}
}
void cStyledPixmap::drawDefaultBorder(int width, int height) {
pixmap->DrawRectangle(cRect(0,0,width,2), clrTransparent); //top
pixmap->DrawRectangle(cRect(0,0,2,height), clrTransparent); //left
pixmap->DrawRectangle(cRect(0,height-2,width,2), clrTransparent); //bottom
pixmap->DrawRectangle(cRect(width-2,0,2,height), clrTransparent); //right
pixmap->DrawRectangle(cRect(2,2,width-4,1), theme.Color(clrBorder)); //top
pixmap->DrawRectangle(cRect(2,2,1,height-4), theme.Color(clrBorder)); //left
pixmap->DrawRectangle(cRect(2,height-3,width-4,1), theme.Color(clrBorder)); //bottom
pixmap->DrawRectangle(cRect(width-3,2,1,height-4), theme.Color(clrBorder)); //right
}
void cStyledPixmap::drawBoldBorder() {
int width = pixmap->ViewPort().Width();
int height = pixmap->ViewPort().Height();
pixmap->DrawRectangle(cRect(0,0,width,2), theme.Color(clrBorder)); //top
pixmap->DrawRectangle(cRect(0,0,2,height), theme.Color(clrBorder)); //left
pixmap->DrawRectangle(cRect(0,height-2,width,2), theme.Color(clrBorder)); //bottom
pixmap->DrawRectangle(cRect(width-2,0,2,height), theme.Color(clrBorder)); //right
}
void cStyledPixmap::drawRoundedCorners(int width, int height, int radius) {
pixmap->DrawEllipse(cRect(2,2,radius,radius), theme.Color(clrBorder), -2);
pixmap->DrawEllipse(cRect(1,1,radius,radius), clrTransparent, -2);
pixmap->DrawEllipse(cRect(width-radius - 2,2,radius,radius), theme.Color(clrBorder), -1);
pixmap->DrawEllipse(cRect(width-radius - 1,1,radius,radius), clrTransparent, -1);
if( height > 2*radius) {
pixmap->DrawEllipse(cRect(2,height-radius - 2,radius,radius), theme.Color(clrBorder), -3);
pixmap->DrawEllipse(cRect(1,height-radius - 1,radius,radius), clrTransparent, -3);
pixmap->DrawEllipse(cRect(width-radius - 2,height-radius - 2,radius,radius), theme.Color(clrBorder), -4);
pixmap->DrawEllipse(cRect(width-radius - 1,height-radius - 1,radius,radius), clrTransparent, -4);
}
}
void cStyledPixmap::drawVerticalLine(int x, int yStart, int yStop, tColor col) {
for (int y = yStart; y <= yStop; y++) {
pixmap->DrawPixel(cPoint(x,y), col);
}
}
void cStyledPixmap::drawHorizontalLine(int y, int xStart, int xStop, tColor col) {
for (int x = xStart; x <= xStop; x++) {
pixmap->DrawPixel(cPoint(x,y), col);
}
}
void cStyledPixmap::DrawText(const cPoint &Point, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font) {
pixmap->DrawText(Point, s, ColorFg, ColorBg, Font);
}
void cStyledPixmap::DrawImage(const cPoint &Point, const cImage &Image) {
pixmap->DrawImage(Point, Image);
}
void cStyledPixmap::DrawRectangle(const cRect &Rect, tColor Color) {
pixmap->DrawRectangle(Rect,Color);
}
void cStyledPixmap::DrawEllipse(const cRect &Rect, tColor Color, int Quadrant) {
pixmap->DrawEllipse(Rect,Color,Quadrant);
}
void cStyledPixmap::SetViewPort(const cRect &Rect) {
pixmap->SetViewPort(Rect);
}

View File

@@ -1,58 +1,58 @@
#ifndef __TVGUIDE_STYLEDPIXMAP_H
#define __TVGUIDE_STYLEDPIXMAP_H
#include <vdr/osd.h>
#include <vdr/epg.h>
#include "timer.h"
#include "config.h"
enum eBackgroundType {
bgGrid,
bgStatusHeaderFull,
bgStatusHeaderWindowed,
bgChannelHeader,
bgChannelGroup,
bgClock,
bgButton,
bgRecMenuBack,
bgChannelJump,
};
// --- cStyledPixmap -------------------------------------------------------------
class cStyledPixmap {
private:
void drawVerticalLine(int x, int yStart, int yStop, tColor col);
void drawHorizontalLine(int y, int xStart, int xStop, tColor col);
void drawBackgroundButton(bool active);
protected:
cPixmap *pixmap;
tColor color;
tColor colorBlending;
void setPixmap(cPixmap *pixmap);
public:
cStyledPixmap(void);
cStyledPixmap(cPixmap *pixmap);
virtual ~cStyledPixmap(void);
void drawBackground();
void drawBackgroundGraphical(eBackgroundType type, bool active = false);
void drawBlendedBackground();
void drawSparsedBackground();
void drawBorder();
void drawBoldBorder();
void drawDefaultBorder(int width, int height);
void drawRoundedCorners(int width, int height, int radius);
void setColor(tColor color, tColor colorBlending) {this->color = color; this->colorBlending = colorBlending;};
void SetAlpha(int alpha) {pixmap->SetAlpha(alpha);};
void SetLayer(int layer) {pixmap->SetLayer(layer);};
void Fill(tColor clr) {pixmap->Fill(clr);};
void DrawText(const cPoint &Point, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font);
void DrawImage(const cPoint &Point, const cImage &Image);
void DrawRectangle(const cRect &Rect, tColor Color);
void DrawEllipse(const cRect &Rect, tColor Color, int Quadrant);
void SetViewPort(const cRect &Rect);
int Width() {return pixmap->ViewPort().Width();};
int Height() {return pixmap->ViewPort().Height();};
};
#endif //__TVGUIDE_STYLEDPIXMAP_H
#ifndef __TVGUIDE_STYLEDPIXMAP_H
#define __TVGUIDE_STYLEDPIXMAP_H
#include <vdr/osd.h>
#include <vdr/epg.h>
#include "timemanager.h"
#include "config.h"
enum eBackgroundType {
bgGrid,
bgStatusHeaderFull,
bgStatusHeaderWindowed,
bgChannelHeader,
bgChannelGroup,
bgClock,
bgButton,
bgRecMenuBack,
bgChannelJump,
};
// --- cStyledPixmap -------------------------------------------------------------
class cStyledPixmap {
private:
void drawVerticalLine(int x, int yStart, int yStop, tColor col);
void drawHorizontalLine(int y, int xStart, int xStop, tColor col);
void drawBackgroundButton(bool active);
protected:
cPixmap *pixmap;
tColor color;
tColor colorBlending;
void setPixmap(cPixmap *pixmap);
public:
cStyledPixmap(void);
cStyledPixmap(cPixmap *pixmap);
virtual ~cStyledPixmap(void);
void drawBackground();
void drawBackgroundGraphical(eBackgroundType type, bool active = false);
void drawBlendedBackground();
void drawSparsedBackground();
void drawBorder();
void drawBoldBorder();
void drawDefaultBorder(int width, int height);
void drawRoundedCorners(int width, int height, int radius);
void setColor(tColor color, tColor colorBlending) {this->color = color; this->colorBlending = colorBlending;};
void SetAlpha(int alpha) {pixmap->SetAlpha(alpha);};
void SetLayer(int layer) {pixmap->SetLayer(layer);};
void Fill(tColor clr) {pixmap->Fill(clr);};
void DrawText(const cPoint &Point, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font);
void DrawImage(const cPoint &Point, const cImage &Image);
void DrawRectangle(const cRect &Rect, tColor Color);
void DrawEllipse(const cRect &Rect, tColor Color, int Quadrant);
void SetViewPort(const cRect &Rect);
int Width() {return pixmap->ViewPort().Width();};
int Height() {return pixmap->ViewPort().Height();};
};
#endif //__TVGUIDE_STYLEDPIXMAP_H

View File

@@ -6,15 +6,13 @@ cSwitchTimers SwitchTimers;
cSwitchTimer::cSwitchTimer(void) {
eventID = 0;
startTime = 0;
switchMinsBefore = tvguideConfig.switchMinsBefore;
switchMode = tvguideConfig.switchMode;
switchMinsBefore = config.switchMinsBefore;
switchMode = config.switchMode;
}
cSwitchTimer::cSwitchTimer(const cEvent* Event) {
eventID = 0;
startTime = 0;
// switchMinsBefore = tvguideConfig.switchMinsBefore;
// switchModes = tvguideConfig.switchModes;
if (Event) {
eventID = Event->EventID();
channelID = Event->ChannelID();

View File

@@ -1,285 +1,281 @@
#include "imageloader.h"
#include "timeline.h"
cTimeLine::cTimeLine(cMyTime *myTime) {
this->myTime = myTime;
if (tvguideConfig.displayMode == eVertical) {
dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(0,
geoManager.statusHeaderHeight,
geoManager.dateVieverWidth,
geoManager.dateVieverHeight)));
timeline = osdManager.requestPixmap(2, cRect(0,
geoManager.statusHeaderHeight + geoManager.channelHeaderHeight + geoManager.channelGroupsHeight,
geoManager.timeLineWidth,
geoManager.osdHeight - geoManager.statusHeaderHeight - geoManager.channelHeaderHeight - geoManager.channelGroupsHeight - geoManager.footerHeight)
, cRect(0,
0,
geoManager.timeLineWidth,
1440*geoManager.minutePixel));
timeBase = osdManager.requestPixmap(3, cRect(0,
geoManager.statusHeaderHeight + geoManager.channelGroupsHeight + geoManager.channelHeaderHeight,
geoManager.osdWidth,
geoManager.timeLineGridHeight));
} else if (tvguideConfig.displayMode == eHorizontal) {
dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(geoManager.clockWidth,
geoManager.statusHeaderHeight,
geoManager.dateVieverWidth - geoManager.clockWidth,
geoManager.dateVieverHeight)));
timeline = osdManager.requestPixmap(2, cRect(geoManager.channelHeaderWidth + geoManager.channelGroupsWidth,
geoManager.statusHeaderHeight,
geoManager.osdWidth - geoManager.channelHeaderWidth - geoManager.channelGroupsWidth,
geoManager.timeLineHeight)
, cRect(0,
0,
1440*geoManager.minutePixel,
geoManager.timeLineHeight));
timeBase = osdManager.requestPixmap(3, cRect(geoManager.channelGroupsWidth + geoManager.channelHeaderWidth,
geoManager.statusHeaderHeight,
geoManager.timeLineGridWidth,
geoManager.timeLineHeight + tvguideConfig.channelRows * geoManager.rowHeight));
}
timeBase->Fill(clrTransparent);
int clockY;
int clockX;
if (tvguideConfig.displayMode == eVertical) {
clockY = 10;
if (tvguideConfig.scaleVideo) {
clockX = geoManager.osdWidth - geoManager.tvFrameWidth - geoManager.clockWidth - 4;
}
else {
clockX = geoManager.osdWidth - geoManager.clockWidth - 10;
}
}
else {
clockY = geoManager.statusHeaderHeight;
clockX = 0;
}
clock = new cStyledPixmap(osdManager.requestPixmap(3, cRect(clockX,
clockY,
geoManager.clockWidth,
geoManager.clockHeight)));
}
cTimeLine::~cTimeLine(void) {
delete dateViewer;
osdManager.releasePixmap(timeline);
if (clock)
delete clock;
}
void cTimeLine::drawDateViewer() {
cString weekDay = myTime->GetWeekday();
cString date = myTime->GetDate();
if (tvguideConfig.style != eStyleGraphical) {
dateViewer->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending));
dateViewer->drawBackground();
dateViewer->drawBorder();
} else {
cImage *imgBack = imgCache.GetOsdElement(oeDateViewer);
if (imgBack)
dateViewer->DrawImage(cPoint(0,0), *imgBack);
else
dateViewer->Fill(clrTransparent);
}
tColor colorFont = theme.Color(clrButtonYellow);
tColor colorFontBack = (tvguideConfig.style == eStyleFlat)?theme.Color(clrHeader):clrTransparent;
if (tvguideConfig.displayMode == eVertical) {
int textHeight = fontManager.FontTimeLineWeekday->Height();
int weekdayWidth = fontManager.FontTimeLineWeekday->Width(*weekDay);
int dateWidth = fontManager.FontTimeLineDate->Width(*date);
dateViewer->DrawText(cPoint((geoManager.timeLineWidth-weekdayWidth)/2, (geoManager.channelHeaderHeight + geoManager.channelGroupsHeight -2*textHeight)/2), *weekDay, colorFont, colorFontBack, fontManager.FontTimeLineWeekday);
dateViewer->DrawText(cPoint((geoManager.timeLineWidth-dateWidth)/2, (geoManager.channelHeaderHeight + geoManager.channelGroupsHeight -2*textHeight)/2 + textHeight + 5), *date, colorFont, colorFontBack, fontManager.FontTimeLineDate);
} else if (tvguideConfig.displayMode == eHorizontal) {
cString strDate = cString::sprintf("%s %s", *weekDay, *date);
int x = ((dateViewer->Width() - fontManager.FontTimeLineDateHorizontal->Width(*strDate)) / 2);
int y = (dateViewer->Height() - fontManager.FontTimeLineDateHorizontal->Height())/2;
dateViewer->DrawText(cPoint(x, y), *strDate, colorFont, colorFontBack, fontManager.FontTimeLineDateHorizontal);
}
}
void cTimeLine::drawTimeline() {
timeline->SetTile(true);
timeline->Fill(clrTransparent);
tColor colorFont, colorBackground;
int imgWidth = geoManager.timeLineGridWidth;
int imgHeight = geoManager.timeLineGridHeight;
const cImage *img1 = NULL;
const cImage *img2 = NULL;
if (tvguideConfig.style == eStyleGraphical) {
img1 = imgCache.GetOsdElement(oeTimeline1);
img2 = imgCache.GetOsdElement(oeTimeline2);
} else {
img1 = createBackgroundImage(imgWidth, imgHeight, theme.Color(clrTimeline1), theme.Color(clrTimeline1Blending));
img2 = createBackgroundImage(imgWidth, imgHeight, theme.Color(clrTimeline2), theme.Color(clrTimeline2Blending));
}
const cImage *img = NULL;
if (!img1 || !img2)
return;
int textWidth, posX, posY;
char timetext[10];
for (int i=0; i<48; i++) {
if (i%2==0) {
img = img1;
colorFont = theme.Color(clrTimeline2);
colorBackground = (tvguideConfig.style == eStyleFlat)?theme.Color(clrTimeline1):clrTransparent;
if (tvguideConfig.timeFormat == e12Hours) {
if (i == 0)
sprintf(timetext, "12:00 PM");
else if (i/2 < 13)
sprintf(timetext, "%d:00 AM", i/2);
else
sprintf(timetext, "%d:00 PM", i/2-12);
} else {
sprintf(timetext, "%d:00", i/2);
}
} else {
img = img2;
colorFont = theme.Color(clrTimeline1);
colorBackground = (tvguideConfig.style == eStyleFlat)?theme.Color(clrTimeline2):clrTransparent;
if (tvguideConfig.timeFormat == e12Hours) {
if (i == 1)
sprintf(timetext, "12:30 PM");
else if (i/2 < 13)
sprintf(timetext, "%d:30 AM", i/2);
else
sprintf(timetext, "%d:30 PM", i/2-12);
} else {
sprintf(timetext, "%d:30", i/2);
}
}
if (tvguideConfig.displayMode == eVertical) {
posY = i*geoManager.minutePixel*30;
timeline->DrawImage(cPoint(0, posY), *img);
if (tvguideConfig.style != eStyleGraphical) {
decorateTile(0, posY, imgWidth+2, imgHeight);
}
textWidth = fontManager.FontTimeLineTime->Width(timetext);
timeline->DrawText(cPoint((geoManager.timeLineWidth-textWidth)/2, posY + 5), timetext, colorFont, colorBackground, fontManager.FontTimeLineTime);
} else if (tvguideConfig.displayMode == eHorizontal) {
posX = i*geoManager.minutePixel*30;
timeline->DrawImage(cPoint(posX, 0), *img);
if (tvguideConfig.style != eStyleGraphical) {
decorateTile(posX, 0, imgWidth, imgHeight+2);
}
timeline->DrawText(cPoint(posX + 15, (dateViewer->Height() - fontManager.FontTimeLineTimeHorizontal->Height())/2), timetext, colorFont, colorBackground, fontManager.FontTimeLineTimeHorizontal);
}
}
setTimeline();
if (tvguideConfig.style != eStyleGraphical) {
delete img1;
delete img2;
}
}
void cTimeLine::decorateTile(int posX, int posY, int tileWidth, int tileHeight) {
timeline->DrawRectangle(cRect(posX,posY,tileWidth,2), clrTransparent); //top
timeline->DrawRectangle(cRect(posX,posY,2,tileHeight), clrTransparent); //left
timeline->DrawRectangle(cRect(posX,posY + tileHeight-2,tileWidth,2), clrTransparent); //bottom
timeline->DrawRectangle(cRect(posX + tileWidth-2,posY,2,tileHeight), clrTransparent); //right
timeline->DrawRectangle(cRect(2+posX,posY+2,tileWidth-4,1), theme.Color(clrBorder)); //top
timeline->DrawRectangle(cRect(2+posX,posY+2,1,tileHeight-4), theme.Color(clrBorder)); //left
timeline->DrawRectangle(cRect(2+posX,posY+tileHeight-3,tileWidth-4,1), theme.Color(clrBorder)); //bottom
timeline->DrawRectangle(cRect(posX+tileWidth-3,posY+2,1,tileHeight-4), theme.Color(clrBorder)); //right
if (tvguideConfig.roundedCorners) {
int borderRadius = 12;
drawRoundedCorners(posX, posY, tileWidth, tileHeight, borderRadius);
}
}
void cTimeLine::drawRoundedCorners(int posX, int posY, int width, int height, int radius) {
timeline->DrawEllipse(cRect(posX+2,posY+2,radius,radius), theme.Color(clrBorder), -2);
timeline->DrawEllipse(cRect(posX+1,posY+1,radius,radius), clrTransparent, -2);
timeline->DrawEllipse(cRect(posX+width-radius - 2,posY+2,radius,radius), theme.Color(clrBorder), -1);
timeline->DrawEllipse(cRect(posX+width-radius - 1,posY+1,radius,radius), clrTransparent, -1);
if( height > 2*radius) {
timeline->DrawEllipse(cRect(posX+2,posY+height-radius - 2,radius,radius), theme.Color(clrBorder), -3);
timeline->DrawEllipse(cRect(posX+1,posY+height-radius - 1,radius,radius), clrTransparent, -3);
timeline->DrawEllipse(cRect(posX+width-radius - 2,posY+height-radius - 2,radius,radius), theme.Color(clrBorder), -4);
timeline->DrawEllipse(cRect(posX+width-radius - 1,posY+height-radius - 1,radius,radius), clrTransparent, -4);
}
}
void cTimeLine::drawCurrentTimeBase(void) {
timeBase->Fill(clrTransparent);
bool nowVisible = myTime->NowVisible();
if (!nowVisible)
return;
int deltaTime = (myTime->GetNow() - myTime->GetStart()) / 60 * geoManager.minutePixel;
if (tvguideConfig.displayMode == eVertical) {
timeBase->DrawRectangle(cRect(0, deltaTime - 2, timeBase->ViewPort().Width(), 4), theme.Color(clrTimeBase));
} else {
timeBase->DrawRectangle(cRect(deltaTime-2, 0, 4, timeBase->ViewPort().Height()), theme.Color(clrTimeBase));
}
}
cImage *cTimeLine::createBackgroundImage(int width, int height, tColor clrBgr, tColor clrBlend) {
cImage *image = NULL;
if (tvguideConfig.style == eStyleBlendingDefault) {
image = new cImage(cSize(width, height));
image->Fill(clrBgr);
int stepY = 0.5*height / 64;
int alpha = 0x00;
tColor clr;
for (int i = 0; i<64; i++) {
clr = AlphaBlend(clrBgr, clrBlend, alpha);
for (int y = i*stepY; y < (i+1)*stepY; y++) {
for (int x=0; x<width; x++) {
image->SetPixel(cPoint(x,y), clr);
}
}
alpha += 0x04;
}
} else if (tvguideConfig.style == eStyleBlendingMagick) {
cImageLoader imgLoader;
if (imgLoader.DrawBackground(clrBgr, clrBlend, width, height)) {
image = new cImage(imgLoader.GetImage());
}
} else {
image = new cImage(cSize(width, height));
image->Fill(clrBgr);
}
return image;
}
void cTimeLine::setTimeline() {
int offset = myTime->GetTimelineOffset();
int xNew, yNew;
if (tvguideConfig.displayMode == eVertical) {
xNew = 0;
yNew = -offset*geoManager.minutePixel;
} else if (tvguideConfig.displayMode == eHorizontal) {
xNew = -offset*geoManager.minutePixel;
yNew = 0;
}
timeline->SetDrawPortPoint(cPoint(xNew, yNew));
if (tvguideConfig.displayTimeBase)
drawCurrentTimeBase();
}
void cTimeLine::drawClock() {
if (tvguideConfig.displayMode == eVertical)
clock->Fill(clrTransparent);
cString currentTime = myTime->GetCurrentTime();
const cFont *font = (tvguideConfig.displayMode == eVertical)?fontManager.FontTimeLineTime:fontManager.FontTimeLineTimeHorizontal;
int textHeight = font->Height();
int clockTextWidth = font->Width(*currentTime);
tColor colorFontBack = (tvguideConfig.style == eStyleFlat)?theme.Color(clrHeader):clrTransparent;
if (tvguideConfig.style == eStyleGraphical) {
clock->drawBackgroundGraphical(bgClock);
} else {
clock->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending));
clock->drawBackground();
clock->drawBorder();
}
clock->DrawText(cPoint((geoManager.clockWidth-clockTextWidth)/2, (geoManager.clockHeight-textHeight)/2), *currentTime, theme.Color(clrFont), colorFontBack, font);
}
#include "imageloader.h"
#include "timeline.h"
cTimeLine::cTimeLine(cTimeManager *timeManager) {
this->timeManager = timeManager;
lastClock = "";
timeBase = NULL;
if (config.displayMode == eVertical) {
dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(0,
geoManager.statusHeaderHeight + geoManager.clockHeight,
geoManager.dateVieverWidth,
geoManager.dateVieverHeight)));
timeline = osdManager.requestPixmap(2, cRect(0,
geoManager.statusHeaderHeight + geoManager.channelHeaderHeight + geoManager.channelGroupsHeight,
geoManager.timeLineWidth,
geoManager.osdHeight - geoManager.statusHeaderHeight - geoManager.channelHeaderHeight - geoManager.channelGroupsHeight - geoManager.footerHeight)
, cRect(0,
0,
geoManager.timeLineWidth,
1440 * geoManager.minutePixel));
} else if (config.displayMode == eHorizontal) {
dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(geoManager.clockWidth,
geoManager.statusHeaderHeight,
geoManager.dateVieverWidth,
geoManager.dateVieverHeight)));
timeline = osdManager.requestPixmap(2, cRect(geoManager.channelHeaderWidth + geoManager.channelGroupsWidth,
geoManager.statusHeaderHeight,
geoManager.osdWidth - geoManager.channelHeaderWidth - geoManager.channelGroupsWidth,
geoManager.timeLineHeight)
, cRect(0,
0,
1440 * geoManager.minutePixel,
geoManager.timeLineHeight));
}
clock = new cStyledPixmap(osdManager.requestPixmap(3, cRect(0,
geoManager.statusHeaderHeight,
geoManager.clockWidth,
geoManager.clockHeight)));
}
cTimeLine::~cTimeLine(void) {
if (clock)
delete clock;
osdManager.releasePixmap(timeBase);
osdManager.releasePixmap(timeline);
delete dateViewer;
}
void cTimeLine::drawDateViewer() {
cString weekDay = timeManager->GetWeekday();
cString date = timeManager->GetDate();
if (config.style != eStyleGraphical) {
dateViewer->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending));
dateViewer->drawBackground();
dateViewer->drawBorder();
} else {
cImage *imgBack = imgCache.GetOsdElement(oeDateViewer);
if (imgBack)
dateViewer->DrawImage(cPoint(0,0), *imgBack);
else
dateViewer->Fill(clrTransparent);
}
tColor colorFont = theme.Color(clrButtonYellow);
tColor colorFontBack = (config.style == eStyleFlat) ? theme.Color(clrHeader) : clrTransparent;
if (config.displayMode == eVertical) {
int textHeightWeekday = fontManager.FontTimeLineWeekday->Height();
int textHeightDate = fontManager.FontTimeLineDate->Height();
int weekdayWidth = fontManager.FontTimeLineWeekday->Width(*weekDay);
int dateWidth = fontManager.FontTimeLineDate->Width(*date);
int y = ((geoManager.dateVieverHeight - textHeightWeekday - textHeightDate) / 2);
dateViewer->DrawText(cPoint((geoManager.timeLineWidth - weekdayWidth) / 2, y), *weekDay, colorFont, colorFontBack, fontManager.FontTimeLineWeekday);
dateViewer->DrawText(cPoint((geoManager.timeLineWidth - dateWidth) / 2, y + textHeightWeekday), *date, colorFont, colorFontBack, fontManager.FontTimeLineDate);
} else if (config.displayMode == eHorizontal) {
cString strDate = cString::sprintf("%s %s", *weekDay, *date);
int x = ((dateViewer->Width() - fontManager.FontTimeLineDateHorizontal->Width(*strDate)) / 2);
int y = ((dateViewer->Height() - fontManager.FontTimeLineDateHorizontal->Height()) / 2);
dateViewer->DrawText(cPoint(x, y), *strDate, colorFont, colorFontBack, fontManager.FontTimeLineDateHorizontal);
}
}
void cTimeLine::drawTimeline() {
timeline->SetTile(true);
timeline->Fill(clrTransparent);
tColor colorFont, colorBackground;
int imgWidth = geoManager.timeLineGridWidth;
int imgHeight = geoManager.timeLineGridHeight;
const cImage *img1 = NULL;
const cImage *img2 = NULL;
if (config.style == eStyleGraphical) {
img1 = imgCache.GetOsdElement(oeTimeline1);
img2 = imgCache.GetOsdElement(oeTimeline2);
} else {
img1 = createBackgroundImage(imgWidth, imgHeight, theme.Color(clrTimeline1), theme.Color(clrTimeline1Blending));
img2 = createBackgroundImage(imgWidth, imgHeight, theme.Color(clrTimeline2), theme.Color(clrTimeline2Blending));
}
const cImage *img = NULL;
if (!img1 || !img2)
return;
int textWidth, posX, posY;
char timetext[10];
for (int i=0; i<48; i++) {
if (i%2==0) {
img = img1;
colorFont = theme.Color(clrTimeline2);
colorBackground = (config.style == eStyleFlat)?theme.Color(clrTimeline1):clrTransparent;
if (config.timeFormat == e12Hours) {
if (i == 0)
sprintf(timetext, "12:00 PM");
else if (i/2 < 13)
sprintf(timetext, "%d:00 AM", i/2);
else
sprintf(timetext, "%d:00 PM", i/2-12);
} else {
sprintf(timetext, "%d:00", i/2);
}
} else {
img = img2;
colorFont = theme.Color(clrTimeline1);
colorBackground = (config.style == eStyleFlat)?theme.Color(clrTimeline2):clrTransparent;
if (config.timeFormat == e12Hours) {
if (i == 1)
sprintf(timetext, "12:30 PM");
else if (i/2 < 13)
sprintf(timetext, "%d:30 AM", i/2);
else
sprintf(timetext, "%d:30 PM", i/2-12);
} else {
sprintf(timetext, "%d:30", i/2);
}
}
if (config.displayMode == eVertical) {
posY = i*geoManager.minutePixel*30;
timeline->DrawImage(cPoint(0, posY), *img);
if (config.style != eStyleGraphical) {
decorateTile(0, posY, imgWidth+2, imgHeight);
}
textWidth = fontManager.FontTimeLineTime->Width(timetext);
timeline->DrawText(cPoint((geoManager.timeLineWidth-textWidth)/2, posY + 5), timetext, colorFont, colorBackground, fontManager.FontTimeLineTime);
} else if (config.displayMode == eHorizontal) {
posX = i*geoManager.minutePixel*30;
timeline->DrawImage(cPoint(posX, 0), *img);
if (config.style != eStyleGraphical) {
decorateTile(posX, 0, imgWidth, imgHeight+2);
}
timeline->DrawText(cPoint(posX + 15, (dateViewer->Height() - fontManager.FontTimeLineTimeHorizontal->Height())/2), timetext, colorFont, colorBackground, fontManager.FontTimeLineTimeHorizontal);
}
}
setTimeline();
if (config.style != eStyleGraphical) {
delete img1;
delete img2;
}
}
void cTimeLine::decorateTile(int posX, int posY, int tileWidth, int tileHeight) {
timeline->DrawRectangle(cRect(posX,posY,tileWidth,2), clrTransparent); //top
timeline->DrawRectangle(cRect(posX,posY,2,tileHeight), clrTransparent); //left
timeline->DrawRectangle(cRect(posX,posY + tileHeight-2,tileWidth,2), clrTransparent); //bottom
timeline->DrawRectangle(cRect(posX + tileWidth-2,posY,2,tileHeight), clrTransparent); //right
timeline->DrawRectangle(cRect(2+posX,posY+2,tileWidth-4,1), theme.Color(clrBorder)); //top
timeline->DrawRectangle(cRect(2+posX,posY+2,1,tileHeight-4), theme.Color(clrBorder)); //left
timeline->DrawRectangle(cRect(2+posX,posY+tileHeight-3,tileWidth-4,1), theme.Color(clrBorder)); //bottom
timeline->DrawRectangle(cRect(posX+tileWidth-3,posY+2,1,tileHeight-4), theme.Color(clrBorder)); //right
if (config.roundedCorners) {
int borderRadius = 12;
drawRoundedCorners(posX, posY, tileWidth, tileHeight, borderRadius);
}
}
void cTimeLine::drawRoundedCorners(int posX, int posY, int width, int height, int radius) {
timeline->DrawEllipse(cRect(posX+2,posY+2,radius,radius), theme.Color(clrBorder), -2);
timeline->DrawEllipse(cRect(posX+1,posY+1,radius,radius), clrTransparent, -2);
timeline->DrawEllipse(cRect(posX+width-radius - 2,posY+2,radius,radius), theme.Color(clrBorder), -1);
timeline->DrawEllipse(cRect(posX+width-radius - 1,posY+1,radius,radius), clrTransparent, -1);
if( height > 2*radius) {
timeline->DrawEllipse(cRect(posX+2,posY+height-radius - 2,radius,radius), theme.Color(clrBorder), -3);
timeline->DrawEllipse(cRect(posX+1,posY+height-radius - 1,radius,radius), clrTransparent, -3);
timeline->DrawEllipse(cRect(posX+width-radius - 2,posY+height-radius - 2,radius,radius), theme.Color(clrBorder), -4);
timeline->DrawEllipse(cRect(posX+width-radius - 1,posY+height-radius - 1,radius,radius), clrTransparent, -4);
}
}
void cTimeLine::drawCurrentTimeBase(void) {
if (!timeManager->NowVisible()) {
if (timeBase)
timeBase->Fill(clrTransparent);
return;
}
osdManager.releasePixmap(timeBase);
int deltaTime = (timeManager->GetNow() - timeManager->GetStart()) / 60 * geoManager.minutePixel;
int x1, x2, y1, y2;
if (config.displayMode == eVertical) {
x1 = 0;
y1 = geoManager.statusHeaderHeight + geoManager.channelGroupsHeight + geoManager.channelHeaderHeight + deltaTime - 2;
x2 = geoManager.osdWidth;
y2 = 4;
} else {
x1 = geoManager.channelGroupsWidth + geoManager.channelHeaderWidth + deltaTime - 2;
y1 = geoManager.statusHeaderHeight;
x2 = 4;
y2 = geoManager.timeLineHeight + config.channelRows * geoManager.rowHeight;
}
timeBase = osdManager.requestPixmap(3, cRect(x1, y1, x2, y2));
timeBase->Fill(clrTransparent);
timeBase->DrawRectangle(cRect(0, 0, timeBase->ViewPort().Width(), timeBase->ViewPort().Height()), theme.Color(clrTimeBase));
}
cImage *cTimeLine::createBackgroundImage(int width, int height, tColor clrBgr, tColor clrBlend) {
cImage *image = NULL;
if (config.style == eStyleBlendingDefault) {
image = new cImage(cSize(width, height));
image->Fill(clrBgr);
int stepY = 0.5*height / 64;
int alpha = 0x00;
tColor clr;
for (int i = 0; i<64; i++) {
clr = AlphaBlend(clrBgr, clrBlend, alpha);
for (int y = i*stepY; y < (i+1)*stepY; y++) {
for (int x=0; x<width; x++) {
image->SetPixel(cPoint(x,y), clr);
}
}
alpha += 0x04;
}
} else if (config.style == eStyleBlendingMagick) {
cImageLoader imgLoader;
if (imgLoader.DrawBackground(clrBgr, clrBlend, width, height)) {
image = new cImage(imgLoader.GetImage());
}
} else {
image = new cImage(cSize(width, height));
image->Fill(clrBgr);
}
return image;
}
void cTimeLine::setTimeline() {
int offset = timeManager->GetTimelineOffset();
int xNew, yNew;
if (config.displayMode == eVertical) {
xNew = 0;
yNew = -offset*geoManager.minutePixel;
} else if (config.displayMode == eHorizontal) {
xNew = -offset*geoManager.minutePixel;
yNew = 0;
}
timeline->SetDrawPortPoint(cPoint(xNew, yNew));
if (config.displayTimeBase)
drawCurrentTimeBase();
}
bool cTimeLine::drawClock() {
cString currentTime = timeManager->GetCurrentTime();
if (strcmp(currentTime, lastClock)) {
clock->Fill(clrTransparent);
const cFont *font = (config.displayMode == eVertical) ? fontManager.FontTimeLineTime : fontManager.FontTimeLineTimeHorizontal;
int textHeight = font->Height();
int clockTextWidth = font->Width(*currentTime);
tColor colorFontBack = (config.style == eStyleFlat) ? theme.Color(clrHeader) : clrTransparent;
if (config.style == eStyleGraphical) {
clock->drawBackgroundGraphical(bgClock);
} else {
clock->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending));
clock->drawBackground();
clock->drawBorder();
}
clock->DrawText(cPoint((geoManager.clockWidth - clockTextWidth) / 2, (geoManager.clockHeight - textHeight) / 2), *currentTime, theme.Color(clrFont), colorFontBack, font);
lastClock = currentTime;
return true;
}
return false;
}

View File

@@ -1,29 +1,30 @@
#ifndef __TVGUIDE_TIMELINE_H
#define __TVGUIDE_TIMELINE_H
#include "timer.h"
#include "styledpixmap.h"
// --- cTimeLine -------------------------------------------------------------
class cTimeLine {
private:
cMyTime *myTime;
cStyledPixmap *dateViewer;
cPixmap *timeline;
cStyledPixmap *clock;
cPixmap *timeBase;
void decorateTile(int posX, int posY, int tileWidth, int tileHeight);
void drawRoundedCorners(int posX, int posY, int width, int height, int radius);
cImage *createBackgroundImage(int width, int height, tColor clrBgr, tColor clrBlend);
void drawCurrentTimeBase(void);
public:
cTimeLine(cMyTime *myTime);
virtual ~cTimeLine(void);
void setTimeline();
void drawDateViewer();
void drawTimeline();
void drawClock();
};
#endif //__TVGUIDE_TIMELINE_H
#ifndef __TVGUIDE_TIMELINE_H
#define __TVGUIDE_TIMELINE_H
#include "timemanager.h"
#include "styledpixmap.h"
// --- cTimeLine -------------------------------------------------------------
class cTimeLine {
private:
cTimeManager *timeManager;
cStyledPixmap *dateViewer;
cPixmap *timeline;
cStyledPixmap *clock;
cPixmap *timeBase;
cString lastClock;
void decorateTile(int posX, int posY, int tileWidth, int tileHeight);
void drawRoundedCorners(int posX, int posY, int width, int height, int radius);
cImage *createBackgroundImage(int width, int height, tColor clrBgr, tColor clrBlend);
public:
cTimeLine(cTimeManager *timeManager);
virtual ~cTimeLine(void);
void setTimeline(void);
void drawDateViewer(void);
void drawTimeline(void);
void drawCurrentTimeBase(void);
bool drawClock();
};
#endif //__TVGUIDE_TIMELINE_H

View File

@@ -1,178 +1,178 @@
#include <time.h>
#include <vdr/tools.h>
#include "config.h"
#include "timer.h"
cMyTime::~cMyTime(void) {
}
cString cMyTime::printTime(time_t displayTime) {
struct tm *ts;
ts = localtime(&displayTime);
cString strTime = cString::sprintf("%d.%d-%d:%d.%d", ts->tm_mday, ts->tm_mon+1, ts->tm_hour, ts->tm_min, ts->tm_sec);
return strTime;
}
void cMyTime::Now() {
t = time(0);
tStart = t;
tStart = GetRounded();
if (tvguideConfig.displayMode == eVertical) {
tEnd = tStart + (geoManager.osdHeight - geoManager.statusHeaderHeight - geoManager.channelHeaderHeight - geoManager.channelGroupsHeight - geoManager.footerHeight)/geoManager.minutePixel*60;
} else if (tvguideConfig.displayMode == eHorizontal) {
tEnd = tStart + (geoManager.osdWidth - geoManager.channelHeaderWidth - geoManager.channelGroupsWidth)/geoManager.minutePixel*60;
}
}
void cMyTime::AddStep(int step) {
tStart += step*60;
tEnd += step*60;
}
bool cMyTime::DelStep(int step) {
if ((tStart - step*60)+30*60 < t) {
return true;
}
tStart -= step*60;
tEnd -= step*60;
return false;
}
void cMyTime::SetTime(time_t newTime) {
tStart = newTime;
if (tvguideConfig.displayMode == eVertical) {
tEnd = tStart + (geoManager.osdHeight - geoManager.statusHeaderHeight - geoManager.channelHeaderHeight - geoManager.channelGroupsHeight - geoManager.footerHeight)/geoManager.minutePixel*60;
} else if (tvguideConfig.displayMode == eHorizontal) {
tEnd = tStart + (geoManager.osdWidth - geoManager.channelHeaderWidth - geoManager.channelGroupsWidth)/geoManager.minutePixel*60;
}
}
time_t cMyTime::getPrevPrimetime(time_t current) {
tm *st = localtime(&current);
if (st->tm_hour < 21) {
current -= 24 * 60* 60;
st = localtime(&current);
}
st->tm_hour = 20;
st->tm_min = 0;
time_t primeTime = mktime(st);
return primeTime;
}
time_t cMyTime::getNextPrimetime(time_t current){
tm *st = localtime(&current);
if (st->tm_hour > 19) {
current += 24 * 60* 60;
st = localtime(&current);
}
st->tm_hour = 20;
st->tm_min = 0;
time_t primeTime = mktime(st);
return primeTime;
}
bool cMyTime::tooFarInPast(time_t current) {
if (current < t) {
return true;
}
return false;
}
cString cMyTime::GetCurrentTime() {
char buf[25];
t = time(0);
tm *st = localtime(&t);
//snprintf(text, sizeof(text), "%d:%02d", st->tm_hour, st->tm_min);
if (tvguideConfig.timeFormat == e12Hours) {
strftime(buf, sizeof(buf), "%I:%M %p", st);
} else if (tvguideConfig.timeFormat == e24Hours)
strftime(buf, sizeof(buf), "%H:%M", st);
return buf;
}
cString cMyTime::GetDate() {
char text[6];
tm *st = localtime(&tStart);
snprintf(text, sizeof(text), "%d.%d", st->tm_mday, st->tm_mon+1);
return text;
}
cString cMyTime::GetWeekday() {
return WeekDayName(tStart);
}
int cMyTime::GetTimelineOffset() {
tm *st = localtime(&tStart);
int offset = st->tm_hour*60;
offset += st->tm_min;
return offset;
}
time_t cMyTime::GetRounded() {
tm *rounded = localtime ( &tStart );
rounded->tm_sec = 0;
if (rounded->tm_min > 29)
rounded->tm_min = 30;
else
rounded->tm_min = 0;
return mktime(rounded);
}
bool cMyTime::NowVisible(void) {
if (t > tStart)
return true;
return false;
}
void cMyTime::debug() {
esyslog("t: %s, tStart: %s, tEnd: %s", *TimeString(t), *TimeString(tStart), *TimeString(tEnd));
}
// --- cTimeInterval -------------------------------------------------------------
cTimeInterval::cTimeInterval(time_t start, time_t stop) {
this->start = start;
this->stop = stop;
}
cTimeInterval::~cTimeInterval(void) {
}
cTimeInterval *cTimeInterval::Intersect(cTimeInterval *interval) {
time_t startIntersect, stopIntersect;
if ((stop <= interval->Start()) || (interval->Stop() <= start)) {
return NULL;
}
if (start <= interval->Start()) {
startIntersect = interval->Start();
} else {
startIntersect = start;
}
if (stop <= interval->Stop()) {
stopIntersect = stop;
} else {
stopIntersect = interval->Stop();
}
return new cTimeInterval(startIntersect, stopIntersect);
}
cTimeInterval *cTimeInterval::Union(cTimeInterval *interval) {
time_t startUnion, stopUnion;
if (start <= interval->Start()) {
startUnion = start;
} else {
startUnion = interval->Start();
}
if (stop <= interval->Stop()) {
stopUnion = interval->Stop();
} else {
stopUnion = stop;
}
return new cTimeInterval(startUnion, stopUnion);
}
#include <time.h>
#include <vdr/tools.h>
#include "config.h"
#include "timemanager.h"
cTimeManager::~cTimeManager(void) {
}
cString cTimeManager::printTime(time_t displayTime) {
struct tm *ts;
ts = localtime(&displayTime);
cString strTime = cString::sprintf("%d.%d-%d:%d.%d", ts->tm_mday, ts->tm_mon+1, ts->tm_hour, ts->tm_min, ts->tm_sec);
return strTime;
}
void cTimeManager::Now() {
t = time(0);
tStart = t;
tStart = GetRounded();
if (config.displayMode == eVertical) {
tEnd = tStart + (geoManager.osdHeight - geoManager.statusHeaderHeight - geoManager.channelHeaderHeight - geoManager.channelGroupsHeight - geoManager.footerHeight)/geoManager.minutePixel*60;
} else if (config.displayMode == eHorizontal) {
tEnd = tStart + (geoManager.osdWidth - geoManager.channelHeaderWidth - geoManager.channelGroupsWidth)/geoManager.minutePixel*60;
}
}
void cTimeManager::AddStep(int step) {
tStart += step*60;
tEnd += step*60;
}
bool cTimeManager::DelStep(int step) {
if ((tStart - step*60)+30*60 < t) {
return true;
}
tStart -= step*60;
tEnd -= step*60;
return false;
}
void cTimeManager::SetTime(time_t newTime) {
tStart = newTime;
if (config.displayMode == eVertical) {
tEnd = tStart + (geoManager.osdHeight - geoManager.statusHeaderHeight - geoManager.channelHeaderHeight - geoManager.channelGroupsHeight - geoManager.footerHeight)/geoManager.minutePixel*60;
} else if (config.displayMode == eHorizontal) {
tEnd = tStart + (geoManager.osdWidth - geoManager.channelHeaderWidth - geoManager.channelGroupsWidth)/geoManager.minutePixel*60;
}
}
time_t cTimeManager::getPrevPrimetime(time_t current) {
tm *st = localtime(&current);
if (st->tm_hour < 21) {
current -= 24 * 60* 60;
st = localtime(&current);
}
st->tm_hour = 20;
st->tm_min = 0;
time_t primeTime = mktime(st);
return primeTime;
}
time_t cTimeManager::getNextPrimetime(time_t current){
tm *st = localtime(&current);
if (st->tm_hour > 19) {
current += 24 * 60* 60;
st = localtime(&current);
}
st->tm_hour = 20;
st->tm_min = 0;
time_t primeTime = mktime(st);
return primeTime;
}
bool cTimeManager::tooFarInPast(time_t current) {
if (current < t) {
return true;
}
return false;
}
cString cTimeManager::GetCurrentTime() {
char buf[25];
t = time(0);
tm *st = localtime(&t);
//snprintf(text, sizeof(text), "%d:%02d", st->tm_hour, st->tm_min);
if (config.timeFormat == e12Hours) {
strftime(buf, sizeof(buf), "%I:%M %p", st);
} else if (config.timeFormat == e24Hours)
strftime(buf, sizeof(buf), "%H:%M", st);
return buf;
}
cString cTimeManager::GetDate() {
char text[6];
tm *st = localtime(&tStart);
snprintf(text, sizeof(text), "%d.%d", st->tm_mday, st->tm_mon+1);
return text;
}
cString cTimeManager::GetWeekday() {
return WeekDayName(tStart);
}
int cTimeManager::GetTimelineOffset() {
tm *st = localtime(&tStart);
int offset = st->tm_hour*60;
offset += st->tm_min;
return offset;
}
time_t cTimeManager::GetRounded() {
tm *rounded = localtime ( &tStart );
rounded->tm_sec = 0;
if (rounded->tm_min > 29)
rounded->tm_min = 30;
else
rounded->tm_min = 0;
return mktime(rounded);
}
bool cTimeManager::NowVisible(void) {
if (t > tStart)
return true;
return false;
}
void cTimeManager::debug() {
esyslog("t: %s, tStart: %s, tEnd: %s", *TimeString(t), *TimeString(tStart), *TimeString(tEnd));
}
// --- cTimeInterval -------------------------------------------------------------
cTimeInterval::cTimeInterval(time_t start, time_t stop) {
this->start = start;
this->stop = stop;
}
cTimeInterval::~cTimeInterval(void) {
}
cTimeInterval *cTimeInterval::Intersect(cTimeInterval *interval) {
time_t startIntersect, stopIntersect;
if ((stop <= interval->Start()) || (interval->Stop() <= start)) {
return NULL;
}
if (start <= interval->Start()) {
startIntersect = interval->Start();
} else {
startIntersect = start;
}
if (stop <= interval->Stop()) {
stopIntersect = stop;
} else {
stopIntersect = interval->Stop();
}
return new cTimeInterval(startIntersect, stopIntersect);
}
cTimeInterval *cTimeInterval::Union(cTimeInterval *interval) {
time_t startUnion, stopUnion;
if (start <= interval->Start()) {
startUnion = start;
} else {
startUnion = interval->Start();
}
if (stop <= interval->Stop()) {
stopUnion = interval->Stop();
} else {
stopUnion = stop;
}
return new cTimeInterval(startUnion, stopUnion);
}

View File

@@ -1,52 +1,52 @@
#ifndef __TVGUIDE_TIMER_H
#define __TVGUIDE_TIMER_H
#include <vdr/tools.h>
// --- cMyTime -------------------------------------------------------------
class cMyTime {
private:
time_t t;
time_t tStart;
time_t tEnd;
public:
cMyTime(){};
virtual ~cMyTime(void);
static cString printTime(time_t displayTime);
void Now();
time_t GetNow() { return t; };
void AddStep(int step);
bool DelStep(int step);
void SetTime(time_t newTime);
time_t Get() {return t;};
time_t GetStart() {return tStart;};
time_t GetEnd() {return tEnd;};
cString GetCurrentTime();
cString GetDate();
cString GetWeekday();
time_t getPrevPrimetime(time_t current);
time_t getNextPrimetime(time_t current);
bool tooFarInPast(time_t current);
int GetTimelineOffset();
time_t GetRounded();
bool NowVisible(void);
void debug();
};
// --- cTimeInterval -------------------------------------------------------------
class cTimeInterval {
private:
time_t start;
time_t stop;
public:
cTimeInterval(time_t start, time_t stop);
virtual ~cTimeInterval(void);
time_t Start(void) { return start; };
time_t Stop(void) { return stop; };
cTimeInterval *Intersect(cTimeInterval *interval);
cTimeInterval *Union(cTimeInterval *interval);
};
#endif //__TVGUIDE_TIMER_H
#ifndef __TVGUIDE_TIMEMANAGER_H
#define __TVGUIDE_TIMEMANAGER_H
#include <vdr/tools.h>
// --- cTimeManager -------------------------------------------------------------
class cTimeManager {
private:
time_t t;
time_t tStart;
time_t tEnd;
public:
cTimeManager(){};
virtual ~cTimeManager(void);
static cString printTime(time_t displayTime);
void Now();
time_t GetNow() { return t; };
void AddStep(int step);
bool DelStep(int step);
void SetTime(time_t newTime);
time_t Get() {return t;};
time_t GetStart() {return tStart;};
time_t GetEnd() {return tEnd;};
cString GetCurrentTime();
cString GetDate();
cString GetWeekday();
time_t getPrevPrimetime(time_t current);
time_t getNextPrimetime(time_t current);
bool tooFarInPast(time_t current);
int GetTimelineOffset();
time_t GetRounded();
bool NowVisible(void);
void debug();
};
// --- cTimeInterval -------------------------------------------------------------
class cTimeInterval {
private:
time_t start;
time_t stop;
public:
cTimeInterval(time_t start, time_t stop);
virtual ~cTimeInterval(void);
time_t Start(void) { return start; };
time_t Stop(void) { return stop; };
cTimeInterval *Intersect(cTimeInterval *interval);
cTimeInterval *Union(cTimeInterval *interval);
};
#endif //__TVGUIDE_TIMEMANAGER_H

View File

@@ -2,7 +2,7 @@
#include <vector>
#include <vdr/timers.h>
#include "tools.h"
#include "timer.h"
#include "timemanager.h"
#include "timerconflict.h"
cTVGuideTimerConflict::cTVGuideTimerConflict(void) {

View File

@@ -12,6 +12,7 @@
#include <vdr/plugin.h>
#include <vdr/device.h>
#include <vdr/menu.h>
#include <Magick++.h>
#define DEFINE_CONFIG 1
#include "geometrymanager.h"
@@ -26,8 +27,8 @@
#error "VDR-2.0.0 API version or greater is required!"
#endif
static const char *VERSION = "1.2.5";
static const char *DESCRIPTION = "A fancy 2d EPG Viewer";
static const char *VERSION = "1.2.15";
static const char *DESCRIPTION = tr("A fancy 2d EPG Viewer");
static const char *MAINMENUENTRY = "Tvguide";
class cPluginTvguide : public cPlugin {
@@ -35,7 +36,7 @@ public:
cPluginTvguide(void);
virtual ~cPluginTvguide();
virtual const char *Version(void) { return VERSION; }
virtual const char *Description(void) { return DESCRIPTION; }
virtual const char *Description(void) { return tr(DESCRIPTION); }
virtual const char *CommandLineHelp(void);
virtual bool ProcessArgs(int argc, char *argv[]);
virtual bool Initialize(void);
@@ -45,7 +46,7 @@ public:
virtual void MainThreadHook(void);
virtual cString Active(void);
virtual time_t WakeupTime(void);
virtual const char *MainMenuEntry(void) { return (tvguideConfig.showMainMenuEntry)?MAINMENUENTRY:NULL; }
virtual const char *MainMenuEntry(void) { return (config.showMainMenuEntry) ? MAINMENUENTRY : NULL; }
virtual cOsdObject *MainMenuAction(void);
virtual cMenuSetupPage *SetupMenu(void);
virtual bool SetupParse(const char *Name, const char *Value);
@@ -62,9 +63,9 @@ cPluginTvguide::~cPluginTvguide() {
const char *cPluginTvguide::CommandLineHelp(void) {
return
" -e <IMAGESDIR>, --epgimages=<IMAGESDIR> Set directory where epgimages are stored.\n"
" -i <ICONDIR>, --icons=<ICONDIR> Set directory where icons are stored.\n"
" -l <LOGODIR>, --logodir=<LOGODIR> Set directory where logos are stored.\n";
" -e <IMAGESDIR>, --epgimages=<IMAGESDIR> Set directory where epgimages are stored.\n"
" -i <ICONDIR>, --iconpath=<ICONDIR> Set directory where icons are stored.\n"
" -l <LOGODIR>, --logopath=<LOGODIR> Set directory where logos are stored.\n";
}
bool cPluginTvguide::ProcessArgs(int argc, char *argv[]) {
@@ -78,13 +79,13 @@ bool cPluginTvguide::ProcessArgs(int argc, char *argv[]) {
while ((c = getopt_long(argc, argv, "e:i:l:", long_options, NULL)) != -1) {
switch (c) {
case 'e':
tvguideConfig.SetImagesPath(cString(optarg));
config.SetImagesPath(cString(optarg));
break;
case 'i':
tvguideConfig.SetIconsPath(cString(optarg));
config.SetIconsPath(cString(optarg));
break;
case 'l':
tvguideConfig.SetLogoPath(cString(optarg));
config.SetLogoPath(cString(optarg));
break;
default:
return false;
@@ -93,11 +94,15 @@ bool cPluginTvguide::ProcessArgs(int argc, char *argv[]) {
return true;
}
__attribute__((constructor)) static void init(void) {
Magick::InitializeMagick(NULL);
}
bool cPluginTvguide::Initialize(void) {
tvguideConfig.SetDefaultPathes();
tvguideConfig.LoadTheme();
tvguideConfig.SetStyle();
tvguideConfig.setDynamicValues();
config.SetDefaultPathes();
config.LoadTheme();
config.SetStyle();
config.setDynamicValues();
geoManager.SetGeometry(cOsd::OsdWidth(), cOsd::OsdHeight());
fontManager.SetFonts();
imgCache.CreateCache();
@@ -134,11 +139,11 @@ cMenuSetupPage *cPluginTvguide::SetupMenu(void) {
}
bool cPluginTvguide::SetupParse(const char *Name, const char *Value) {
return tvguideConfig.SetupParse(Name, Value);
return config.SetupParse(Name, Value);
}
bool cPluginTvguide::Service(const char *Id, void *Data) {
if (strcmp(Id, "MainMenuHooksPatch-v1.0::osSchedule") == 0 && tvguideConfig.replaceOriginalSchedule != 0) {
if (strcmp(Id, "MainMenuHooksPatch-v1.0::osSchedule") == 0 && config.replaceOriginalSchedule != 0) {
if (Data == NULL)
return true;
cOsdObject **guide = (cOsdObject**) Data;

File diff suppressed because it is too large Load Diff

View File

@@ -1,65 +1,66 @@
#ifndef __TVGUIDE_TVGUIDEOSD_H
#define __TVGUIDE_TVGUIDEOSD_H
#include "timer.h"
#include "grid.h"
#include "channelcolumn.h"
#include "statusheader.h"
#include "detailview.h"
#include "timeline.h"
#include "channelgroups.h"
#include "footer.h"
#include "recmenumanager.h"
#include "channeljump.h"
// --- cTvGuideOsd -------------------------------------------------------------
class cTvGuideOsd : public cOsdObject {
private:
cMyTime *myTime;
cList<cChannelColumn> columns;
cGrid *activeGrid;
cStatusHeader *statusHeader;
cDetailView *detailView;
cTimeLine *timeLine;
cChannelGroups *channelGroups;
cFooter *footer;
cRecMenuManager *recMenuManager;
cChannelJump *channelJumper;
bool detailViewActive;
void drawOsd();
void readChannels(const cChannel *channelStart);
void drawGridsChannelJump(int offset = 0);
void drawGridsTimeJump();
void processKeyUp();
void processKeyDown();
void processKeyLeft();
void processKeyRight();
void processKeyRed();
void processKeyGreen();
void processKeyYellow();
eOSState processKeyBlue(bool *alreadyUnlocked);
eOSState processKeyOk(bool *alreadyUnlocked);
void processNumKey(int numKey);
void TimeJump(int mode);
void ChannelJump(int num);
void CheckTimeout(void);
void setNextActiveGrid(cGrid *next);
void channelForward();
void channelBack();
void timeForward();
void timeBack();
void ScrollForward();
void ScrollBack();
eOSState ChannelSwitch(bool *alreadyUnlocked);
void DetailedEPG();
void SetTimers();
void dump();
public:
cTvGuideOsd(void);
virtual ~cTvGuideOsd(void);
virtual void Show(void);
virtual eOSState ProcessKey(eKeys Key);
};
#endif //__TVGUIDE_TVGUIDEOSD_H
#ifndef __TVGUIDE_TVGUIDEOSD_H
#define __TVGUIDE_TVGUIDEOSD_H
#include "timemanager.h"
#include "gridelement.h"
#include "channelepg.h"
#include "statusheader.h"
#include "detailview.h"
#include "timeline.h"
#include "channelgroups.h"
#include "footer.h"
#include "recmenuview.h"
#include "channeljump.h"
// --- cTvGuideOsd -------------------------------------------------------------
class cTvGuideOsd : public cOsdObject {
private:
cTimeManager *timeManager;
cList<cChannelEpg> columns;
cGridElement *activeGrid;
cStatusHeader *statusHeader;
cDetailView *detailView;
cTimeLine *timeLine;
cChannelGroups *channelGroups;
cFooter *footer;
cRecMenuView *recMenuView;
cChannelJump *channelJumper;
int GetLastValidChannel(void);
bool detailViewActive;
void drawOsd();
void readChannels(const cChannel *channelStart);
void drawGridsChannelJump(int offset = 0);
void drawGridsTimeJump(bool last = false);
void processKeyUp();
void processKeyDown();
void processKeyLeft();
void processKeyRight();
void processKeyRed();
void processKeyGreen();
void processKeyYellow();
eOSState processKeyBlue(bool *alreadyUnlocked);
eOSState processKeyOk(bool *alreadyUnlocked);
void processNumKey(int numKey);
void TimeJump(int mode);
void ChannelJump(int num);
void CheckTimeout(void);
void setNextActiveGrid(cGridElement *next);
void channelForward();
void channelBack();
void timeForward();
void timeBack();
void ScrollForward();
void ScrollBack();
eOSState ChannelSwitch(bool *alreadyUnlocked);
void DetailedEPG();
void SetTimers();
void dump();
public:
cTvGuideOsd(void);
virtual ~cTvGuideOsd(void);
virtual void Show(void);
virtual eOSState ProcessKey(eKeys Key);
};
#endif //__TVGUIDE_TVGUIDEOSD_H

2129
view.c

File diff suppressed because it is too large Load Diff

299
view.h
View File

@@ -1,150 +1,149 @@
#ifndef __TVGUIDE_VIEW_H
#define __TVGUIDE_VIEW_H
#include <vector>
#include <string>
#include <sstream>
#include <vdr/skins.h>
#include "services/scraper2vdr.h"
#include "services/epgsearch.h"
#include "services/remotetimers.h"
#include "config.h"
#include "imagecache.h"
#include "imageloader.h"
#include "tools.h"
enum eEPGViewTabs {
evtInfo = 0,
evtAddInfo,
evtImages,
evtCount
};
enum eMediaViewTabs {
mvtInfo = 0,
mvtAddInfo,
mvtCast,
mvtOnlineInfo,
mvtImages,
mvtCount
};
class cView : public cThread {
protected:
const cEvent *event;
cPixmap *pixmapBackground;
cStyledPixmap *pixmapHeader;
cPixmap *pixmapHeaderLogo;
cPixmap *pixmapHeaderIcon;
cPixmap *pixmapContent;
cPixmap *pixmapScrollbar;
cPixmap *pixmapScrollbarBack;
cPixmap *pixmapTabs;
cFont *font, *fontSmall, *fontHeader, *fontHeaderLarge;
cImage *imgScrollBar;
int activeView;
bool scrollable;
bool tabbed;
int x, y;
int width, height;
int border;
int headerWidth, headerHeight;
int contentHeight;
int tabHeight;
int scrollbarWidth;
std::vector<std::string> tabs;
std::string title;
std::string subTitle;
std::string dateTime;
std::string infoText;
std::string addInfoText;
const cChannel *channel;
int eventID;
bool headerDrawn;
void DrawHeader(void);
void ClearContent(void);
void CreateContent(int fullHeight);
void DrawContent(std::string *text);
void DrawFloatingContent(std::string *infoText, cTvMedia *img, cTvMedia *img2 = NULL);
void CreateFloatingTextWrapper(cTextWrapper *twNarrow, cTextWrapper *twFull, std::string *text, int widthImg, int heightImg);
void DrawActors(std::vector<cActor> *actors);
void ClearScrollbar(void);
void ClearScrollbarImage(void);
cImage *CreateScrollbarImage(int width, int height, tColor clrBgr, tColor clrBlend);
virtual void SetTabs(void) {};
void DrawTabs(void);
public:
cView(void);
virtual ~cView(void);
void SetTitle(const char *t) { title = t ? t : ""; };
void SetSubTitle(const char *s) { subTitle = s ? s : ""; };
void SetDateTime(const char *dt) { dateTime = dt; };
void SetInfoText(const char *i) { infoText = i ? i : ""; };
void SetAdditionalInfoText(std::string addInfo) { addInfoText = addInfo; };
void SetChannel(const cChannel *c) { channel = c; };
void SetEventID(int id) { eventID = id; };
void SetEvent(const cEvent *event) { this->event = event; };
virtual void LoadMedia(void) {};
void SetGeometry(void);
void SetFonts(void);
virtual bool KeyUp(void);
virtual bool KeyDown(void);
virtual void KeyLeft(void) {};
virtual void KeyRight(void) {};
void DrawScrollbar(void);
virtual void Action(void) {};
};
class cEPGView : public cView {
protected:
std::vector<std::string> epgPics;
int numEPGPics;
int numTabs;
void SetTabs(void);
void CheckEPGImages(void);
void DrawImages(void);
public:
cEPGView(void);
virtual ~cEPGView(void);
void KeyLeft(void);
void KeyRight(void);
void Action(void);
};
class cSeriesView : public cView {
protected:
int seriesId;
int episodeId;
cSeries series;
std::string tvdbInfo;
void SetTabs(void);
void CreateTVDBInfo(void);
void DrawImages(void);
int GetRandomPoster(void);
public:
cSeriesView(int seriesId, int episodeId);
virtual ~cSeriesView(void);
void LoadMedia(void);
void KeyLeft(void);
void KeyRight(void);
void Action(void);
};
class cMovieView : public cView {
protected:
int movieId;
cMovie movie;
std::string movieDBInfo;
void SetTabs(void);
void CreateMovieDBInfo(void);
void DrawImages(void);
public:
cMovieView(int movieId);
virtual ~cMovieView(void);
void LoadMedia(void);
void KeyLeft(void);
void KeyRight(void);
void Action(void);
};
#endif //__TVGUIDE_VIEW_H
#ifndef __TVGUIDE_VIEW_H
#define __TVGUIDE_VIEW_H
#include <vector>
#include <string>
#include <sstream>
#include <vdr/skins.h>
#include "services/scraper2vdr.h"
#include "services/epgsearch.h"
#include "services/remotetimers.h"
#include "config.h"
#include "imagecache.h"
#include "imageloader.h"
#include "tools.h"
enum eEPGViewTabs {
evtInfo = 0,
evtAddInfo,
evtImages,
evtCount
};
enum eMediaViewTabs {
mvtInfo = 0,
mvtAddInfo,
mvtCast,
mvtOnlineInfo,
mvtImages,
mvtCount
};
class cView : public cThread {
protected:
const cEvent *event;
cPixmap *pixmapBackground;
cStyledPixmap *pixmapHeader;
cPixmap *pixmapHeaderLogo;
cPixmap *pixmapContent;
cPixmap *pixmapScrollbar;
cPixmap *pixmapScrollbarBack;
cPixmap *pixmapTabs;
cFont *font, *fontSmall, *fontHeader, *fontHeaderLarge;
cImage *imgScrollBar;
int activeView;
bool scrollable;
bool tabbed;
int x, y;
int width, height;
int border;
int headerWidth, headerHeight;
int contentHeight;
int tabHeight;
int scrollbarWidth;
std::vector<std::string> tabs;
std::string title;
std::string subTitle;
std::string dateTime;
std::string infoText;
std::string addInfoText;
const cChannel *channel;
int eventID;
bool headerDrawn;
void DrawHeader(void);
void ClearContent(void);
void CreateContent(int fullHeight);
void DrawContent(std::string *text);
void DrawFloatingContent(std::string *infoText, cTvMedia *img, cTvMedia *img2 = NULL);
void CreateFloatingTextWrapper(cTextWrapper *twNarrow, cTextWrapper *twFull, std::string *text, int widthImg, int heightImg);
void DrawActors(std::vector<cActor> *actors);
void ClearScrollbar(void);
void ClearScrollbarImage(void);
cImage *CreateScrollbarImage(int width, int height, tColor clrBgr, tColor clrBlend);
virtual void SetTabs(void) {};
void DrawTabs(void);
public:
cView(void);
virtual ~cView(void);
void SetTitle(const char *t) { title = t ? t : ""; };
void SetSubTitle(const char *s) { subTitle = s ? s : ""; };
void SetDateTime(const char *dt) { dateTime = dt; };
void SetInfoText(const char *i) { infoText = i ? i : ""; };
void SetAdditionalInfoText(std::string addInfo) { addInfoText = addInfo; };
void SetChannel(const cChannel *c) { channel = c; };
void SetEventID(int id) { eventID = id; };
void SetEvent(const cEvent *event) { this->event = event; };
virtual void LoadMedia(void) {};
void SetGeometry(void);
void SetFonts(void);
virtual bool KeyUp(void);
virtual bool KeyDown(void);
virtual void KeyLeft(void) {};
virtual void KeyRight(void) {};
void DrawScrollbar(void);
virtual void Action(void) {};
};
class cEPGView : public cView {
protected:
std::vector<std::string> epgPics;
int numEPGPics;
int numTabs;
void SetTabs(void);
void CheckEPGImages(void);
void DrawImages(void);
public:
cEPGView(void);
virtual ~cEPGView(void);
void KeyLeft(void);
void KeyRight(void);
void Action(void);
};
class cSeriesView : public cView {
protected:
int seriesId;
int episodeId;
cSeries series;
std::string tvdbInfo;
void SetTabs(void);
void CreateTVDBInfo(void);
void DrawImages(void);
int GetRandomPoster(void);
public:
cSeriesView(int seriesId, int episodeId);
virtual ~cSeriesView(void);
void LoadMedia(void);
void KeyLeft(void);
void KeyRight(void);
void Action(void);
};
class cMovieView : public cView {
protected:
int movieId;
cMovie movie;
std::string movieDBInfo;
void SetTabs(void);
void CreateMovieDBInfo(void);
void DrawImages(void);
public:
cMovieView(int movieId);
virtual ~cMovieView(void);
void LoadMedia(void);
void KeyLeft(void);
void KeyRight(void);
void Action(void);
};
#endif //__TVGUIDE_VIEW_H