mirror of
				https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
				synced 2023-10-05 13:01:48 +00:00 
			
		
		
		
	Compare commits
	
		
			73 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 9044e092f8 | ||
|  | b96f800240 | ||
|  | 5d9ed1439a | ||
|  | 66a0c15aea | ||
|  | 8db88c2556 | ||
|  | 509b64d78f | ||
|  | 15b7074b4e | ||
|  | 3fee6ab13f | ||
|  | ffd3e2c79f | ||
|  | c77f74321f | ||
|  | efe06b8e98 | ||
|  | 6540e21444 | ||
|  | 2e4a43133e | ||
|  | bcf2ce757c | ||
|  | 263a734a0d | ||
|  | 7300fdf91c | ||
|  | 89e9086943 | ||
|  | e236d9e571 | ||
|  | 8794891599 | ||
|  | cd62a9bd6b | ||
|  | 3f0bd75011 | ||
|  | a711aed160 | ||
|  | cdb5a46145 | ||
|  | fc784f34e5 | ||
|  | b707292485 | ||
|  | 587fbe1f44 | ||
|  | 9173d14b10 | ||
|  | 3386c05e91 | ||
|  | a1eaf7a865 | ||
|  | 41eb32389d | ||
|  | f4369c0772 | ||
|  | 0203cb3f01 | ||
|  | 152662d519 | ||
|  | b17fd9b7aa | ||
|  | fb165b2b43 | ||
|  | e31070cd76 | ||
|  | 15ce11db5f | ||
|  | 0d3dd79585 | ||
|  | 7f8ac2a2a8 | ||
|  | 31f72f2ad8 | ||
|  | a1aa300259 | ||
|  | b7970e5723 | ||
|  | 3f9327b8e4 | ||
|  | bff9d78ff3 | ||
|  | d21b1496f0 | ||
|  | 5ff172c987 | ||
|  | 6b3eda282f | ||
|  | 107f3f945f | ||
|  | 45a2d6bee0 | ||
|  | 700543b394 | ||
|  | 1df9641621 | ||
|  | 3ed46bd881 | ||
|  | 81759f95cb | ||
|  | 0766d67980 | ||
|  | 3513f82a8c | ||
|  | 7a79059414 | ||
|  | ceadc0bbfe | ||
|  | e09279ca32 | ||
|  | 27e9004629 | ||
|  | 194aa06a4e | ||
|  | f046493a00 | ||
|  | fd7b1b9ab7 | ||
|  | c4e25b899c | ||
|  | 059936c6d7 | ||
|  | 549d42b487 | ||
|  | ad1f0ba0d6 | ||
|  | 69711400fa | ||
|  | 463b6369d2 | ||
|  | 0b37464dd0 | ||
|  | cf171d8732 | ||
|  | d666b8701e | ||
|  | 6139016102 | ||
|  | 1c99501776 | 
							
								
								
									
										59
									
								
								HISTORY
									
									
									
									
									
								
							
							
						
						
									
										59
									
								
								HISTORY
									
									
									
									
									
								
							| @@ -197,3 +197,62 @@ Version 1.2.8 | |||||||
|   (Create and modify of channelgroups and blacklists isn't possible, |   (Create and modify of channelgroups and blacklists isn't possible, | ||||||
|   because the epgsearch service interface doesn't support that,  |   because the epgsearch service interface doesn't support that,  | ||||||
|   should be done in epgsearch) |   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 | ||||||
|  |  | ||||||
|  | Version 1.2.16 | ||||||
|  |  | ||||||
|  | - Fixed a timer changed message | ||||||
|  | - Extend keys kFastRew, kFastFwd, kPrev, kNext for TimeJump | ||||||
|  |   (if you use the numeric keys for "Jump to specific channel", | ||||||
|  |   you can now use the keys kFastRew, kFastFwd, kPrev, kNext for TimeJump. | ||||||
|  |   Note: if you use the permashift-plugin then the key kFastRew doesnt work for TimeJump) | ||||||
|  | - Fixed a possible deadlook in cEPGView::cEPGView | ||||||
|  | - Refactor Timeline | ||||||
|  | - Refactor CutText in horizontal epgview | ||||||
|  | - Optimize display "REC" sign in epgview | ||||||
|  | - Separate "displayTime" for horizontal and vertical view | ||||||
|  | - RecMenu "Timer Timeline" displays now sorted active timer | ||||||
|  |  | ||||||
|  | Version 1.2.17 | ||||||
|  |  | ||||||
|  | - Final fix for utf8 CutText | ||||||
|  | - Fixed a remote timer problem | ||||||
|  | - Add episode to manual timer | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								Makefile
									
									
									
									
									
								
							| @@ -60,7 +60,7 @@ endif | |||||||
|  |  | ||||||
| ### The object files (add further files here): | ### 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: | ### The main target: | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										4
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								README
									
									
									
									
									
								
							| @@ -44,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 | used Icons, the channel logos and epg images. The following paths can be set | ||||||
| at startup: | at startup: | ||||||
|  |  | ||||||
| -l path, --logodir=path | -l path, --logopath=path | ||||||
|     Path to the logos (Default: <ResourceDirectory>/plugins/tvguide/channellogos/). |     Path to the logos (Default: <ResourceDirectory>/plugins/tvguide/channellogos/). | ||||||
|  |  | ||||||
| -e path, --epgimages=path | -e path, --epgimages=path | ||||||
|     Path to the epgimages (Default: <CacheDirectory>/plugins/tvguide/epgimages/). |     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/). |     Path to the icons directory (Default: <ResourceDirectory>/plugins/tvguide/epgimages/). | ||||||
|  |  | ||||||
| <ResourceDirectory> and <CacheDirectory> is taken from your VDR configuration  | <ResourceDirectory> and <CacheDirectory> is taken from your VDR configuration  | ||||||
|   | |||||||
| @@ -1,10 +1,10 @@ | |||||||
| #include "channelcolumn.h" | #include "channelepg.h" | ||||||
| #include "dummygrid.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->channel = channel; | ||||||
|     this->num = num; |     this->num = num; | ||||||
|     this->myTime = myTime; |     this->timeManager = timeManager; | ||||||
| #if VDRVERSNUM < 20301 | #if VDRVERSNUM < 20301 | ||||||
|     hasTimer = channel->HasTimer(); |     hasTimer = channel->HasTimer(); | ||||||
| #endif | #endif | ||||||
| @@ -15,7 +15,7 @@ cChannelColumn::cChannelColumn(int num, const cChannel *channel, cMyTime *myTime | |||||||
|     header = NULL; |     header = NULL; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| cChannelColumn::~cChannelColumn(void) { | cChannelEpg::~cChannelEpg(void) { | ||||||
|     if (header) |     if (header) | ||||||
|         delete header; |         delete header; | ||||||
|     grids.Clear(); |     grids.Clear(); | ||||||
| @@ -24,21 +24,21 @@ cChannelColumn::~cChannelColumn(void) { | |||||||
| #endif | #endif | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void cChannelColumn::clearGrids() { | void cChannelEpg::clearGrids() { | ||||||
|     grids.Clear(); |     grids.Clear(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void cChannelColumn::createHeader() { | void cChannelEpg::createHeader() { | ||||||
|     header = new cHeaderGrid(); |     header = new cHeaderGrid(); | ||||||
|     header->createBackground(num); |     header->createBackground(num); | ||||||
|     header->drawChannel(channel); |     header->drawChannel(channel); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void cChannelColumn::drawHeader() { | void cChannelEpg::drawHeader() { | ||||||
|     header->setPosition(num); |     header->setPosition(num); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| bool cChannelColumn::readGrids() { | bool cChannelEpg::readGrids() { | ||||||
| #if VDRVERSNUM >= 20301 | #if VDRVERSNUM >= 20301 | ||||||
|     const cSchedules* schedules; |     const cSchedules* schedules; | ||||||
|     { |     { | ||||||
| @@ -51,17 +51,17 @@ bool cChannelColumn::readGrids() { | |||||||
|     const cSchedule *Schedule = NULL; |     const cSchedule *Schedule = NULL; | ||||||
|     Schedule = schedules->GetSchedule(channel); |     Schedule = schedules->GetSchedule(channel); | ||||||
|     if (!Schedule) { |     if (!Schedule) { | ||||||
|         addDummyGrid(myTime->GetStart(), myTime->GetEnd(), NULL, false); |         addDummyGrid(timeManager->GetStart(), timeManager->GetEnd(), NULL, false); | ||||||
|         return true; |         return true; | ||||||
|     } |     } | ||||||
|     bool eventFound = false; |     bool eventFound = false; | ||||||
|     bool dummyAtStart = false; |     bool dummyAtStart = false; | ||||||
|     const cEvent *startEvent = Schedule->GetEventAround(myTime->GetStart()); |     const cEvent *startEvent = Schedule->GetEventAround(timeManager->GetStart()); | ||||||
|     if (startEvent != NULL) { |     if (startEvent != NULL) { | ||||||
|         eventFound = true; |         eventFound = true; | ||||||
|     } else { |     } else { | ||||||
|         for (int i=1; i<6; i++) { |         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) { |             if (startEvent) { | ||||||
|                 eventFound = true; |                 eventFound = true; | ||||||
|                 dummyAtStart = true; |                 dummyAtStart = true; | ||||||
| @@ -72,20 +72,20 @@ bool cChannelColumn::readGrids() { | |||||||
|     if (eventFound) { |     if (eventFound) { | ||||||
|         bool col = true; |         bool col = true; | ||||||
|         if (dummyAtStart) { |         if (dummyAtStart) { | ||||||
|             addDummyGrid(myTime->GetStart(), startEvent->StartTime(), NULL, col); |             addDummyGrid(timeManager->GetStart(), startEvent->StartTime(), NULL, col); | ||||||
|             col = !col; |             col = !col; | ||||||
|         } |         } | ||||||
|         bool dummyNeeded = true; |         bool dummyNeeded = true; | ||||||
|         bool toFarInFuture = false; |         bool toFarInFuture = false; | ||||||
|         time_t endLast = myTime->GetStart(); |         time_t endLast = timeManager->GetStart(); | ||||||
|         const cEvent *event = startEvent; |         const cEvent *event = startEvent; | ||||||
|         const cEvent *eventLast = NULL; |         const cEvent *eventLast = NULL; | ||||||
|         for (; event; event = Schedule->Events()->Next(event)) { |         for (; event; event = Schedule->Events()->Next(event)) { | ||||||
|             if (endLast < event->StartTime()) { |             if (endLast < event->StartTime()) { | ||||||
|                 //gap, dummy needed
 |                 //gap, dummy needed
 | ||||||
|                 time_t endTime = event->StartTime(); |                 time_t endTime = event->StartTime(); | ||||||
|                 if (endTime > myTime->GetEnd()) { |                 if (endTime > timeManager->GetEnd()) { | ||||||
|                     endTime = myTime->GetEnd(); |                     endTime = timeManager->GetEnd(); | ||||||
|                     toFarInFuture = true; |                     toFarInFuture = true; | ||||||
|                 } |                 } | ||||||
|                 addDummyGrid(endLast, endTime, NULL, col); |                 addDummyGrid(endLast, endTime, NULL, col); | ||||||
| @@ -97,74 +97,76 @@ bool cChannelColumn::readGrids() { | |||||||
|             addEpgGrid(event, NULL, col); |             addEpgGrid(event, NULL, col); | ||||||
|             col = !col; |             col = !col; | ||||||
|             endLast = event->EndTime(); |             endLast = event->EndTime(); | ||||||
|             if (event->EndTime() > myTime->GetEnd()) { |             if (event->EndTime() > timeManager->GetEnd()) { | ||||||
|                 dummyNeeded = false; |                 dummyNeeded = false; | ||||||
|                 break; |                 break; | ||||||
|             } |             } | ||||||
|             eventLast = event; |             eventLast = event; | ||||||
|         } |         } | ||||||
|         if (dummyNeeded) { |         if (dummyNeeded) { | ||||||
|             addDummyGrid(eventLast->EndTime(), myTime->GetEnd(), NULL, col); |             addDummyGrid(eventLast->EndTime(), timeManager->GetEnd(), NULL, col); | ||||||
|         } |         } | ||||||
|         return true; |         return true; | ||||||
|     } else { |     } else { | ||||||
|         addDummyGrid(myTime->GetStart(), myTime->GetEnd(), NULL, false); |         addDummyGrid(timeManager->GetStart(), timeManager->GetEnd(), NULL, false); | ||||||
|         return true; |         return true; | ||||||
|     } |     } | ||||||
|     return false; |     return false; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void cChannelColumn::drawGrids() { | void cChannelEpg::drawGrids() { | ||||||
|     for (cGrid *grid = grids.First(); grid; grid = grids.Next(grid)) { |     for (cGridElement *grid = grids.First(); grid; grid = grids.Next(grid)) { | ||||||
|         grid->SetViewportHeight(); |         grid->SetViewportHeight(); | ||||||
|         grid->PositionPixmap(); |         grid->PositionPixmap(); | ||||||
|         grid->Draw(); |         grid->Draw(); | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| int cChannelColumn::getX() { | int cChannelEpg::getX() { | ||||||
|     return geoManager.timeLineWidth + num*geoManager.colWidth; |     return geoManager.timeLineWidth + num*geoManager.colWidth; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| int cChannelColumn::getY() { | int cChannelEpg::getY() { | ||||||
|     return geoManager.statusHeaderHeight +  geoManager.timeLineHeight + num*geoManager.rowHeight; |     return geoManager.statusHeaderHeight +  geoManager.timeLineHeight + num*geoManager.rowHeight; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| cGrid * cChannelColumn::getActive() { | cGridElement *cChannelEpg::getActive(bool last) { | ||||||
|     cMyTime t; |     cTimeManager t; | ||||||
|     t.Now(); |     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())) |         if (grid->Match(t.Get())) | ||||||
|             return grid; |             return grid; | ||||||
|     } |     } | ||||||
|     return grids.First(); |     return grids.First(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| cGrid * cChannelColumn::getNext(cGrid *activeGrid) { | cGridElement *cChannelEpg::getNext(cGridElement *activeGrid) { | ||||||
|     if (activeGrid == NULL) |     if (activeGrid == NULL) | ||||||
|         return NULL; |         return NULL; | ||||||
|     cGrid *next = grids.Next(activeGrid); |     cGridElement *next = grids.Next(activeGrid); | ||||||
|     if (next) |     if (next) | ||||||
|         return next; |         return next; | ||||||
|     return NULL; |     return NULL; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| cGrid * cChannelColumn::getPrev(cGrid *activeGrid) { | cGridElement *cChannelEpg::getPrev(cGridElement *activeGrid) { | ||||||
|     if (activeGrid == NULL) |     if (activeGrid == NULL) | ||||||
|         return NULL; |         return NULL; | ||||||
|     cGrid *prev = grids.Prev(activeGrid); |     cGridElement *prev = grids.Prev(activeGrid); | ||||||
|     if (prev) |     if (prev) | ||||||
|         return prev; |         return prev; | ||||||
|     return NULL; |     return NULL; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| cGrid * cChannelColumn::getNeighbor(cGrid *activeGrid) { | cGridElement *cChannelEpg::getNeighbor(cGridElement *activeGrid) { | ||||||
|     if (!activeGrid) |     if (!activeGrid) | ||||||
|         return NULL; |         return NULL; | ||||||
|     cGrid *neighbor = NULL; |     cGridElement *neighbor = NULL; | ||||||
|     int overlap = 0; |     int overlap = 0; | ||||||
|     int overlapNew = 0; |     int overlapNew = 0; | ||||||
|     cGrid *grid = NULL; |     cGridElement *grid = NULL; | ||||||
|     grid = grids.First(); |     grid = grids.First(); | ||||||
|     if (grid) { |     if (grid) { | ||||||
|         for (; grid; grid = grids.Next(grid)) { |         for (; grid; grid = grids.Next(grid)) { | ||||||
| @@ -184,19 +186,19 @@ cGrid * cChannelColumn::getNeighbor(cGrid *activeGrid) { | |||||||
|     return neighbor; |     return neighbor; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| bool cChannelColumn::isFirst(cGrid *grid) { | bool cChannelEpg::isFirst(cGridElement *grid) { | ||||||
|     if (grid == grids.First()) |     if (grid == grids.First()) | ||||||
|         return true; |         return true; | ||||||
|     return false; |     return false; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void cChannelColumn::AddNewGridsAtStart() { | void cChannelEpg::AddNewGridsAtStart() { | ||||||
|     cGrid *firstGrid = NULL; |     cGridElement *firstGrid = NULL; | ||||||
|     firstGrid = grids.First(); |     firstGrid = grids.First(); | ||||||
|     if (firstGrid == NULL) |     if (firstGrid == NULL) | ||||||
|         return; |         return; | ||||||
|     //if first event is long enough, nothing to do.
 |     //if first event is long enough, nothing to do.
 | ||||||
|     if (firstGrid->StartTime() <= myTime->GetStart()) { |     if (firstGrid->StartTime() <= timeManager->GetStart()) { | ||||||
|         return; |         return; | ||||||
|     } |     } | ||||||
|     //if not, i have to add new ones to the list
 |     //if not, i have to add new ones to the list
 | ||||||
| @@ -213,8 +215,8 @@ void cChannelColumn::AddNewGridsAtStart() { | |||||||
|     Schedule = schedules->GetSchedule(channel); |     Schedule = schedules->GetSchedule(channel); | ||||||
|     if (!Schedule) { |     if (!Schedule) { | ||||||
|         if (firstGrid->isDummy()) { |         if (firstGrid->isDummy()) { | ||||||
|             firstGrid->SetStartTime(myTime->GetStart()); |             firstGrid->SetStartTime(timeManager->GetStart()); | ||||||
|             firstGrid->SetEndTime(myTime->GetEnd()); |             firstGrid->SetEndTime(timeManager->GetEnd()); | ||||||
|         } |         } | ||||||
|         return; |         return; | ||||||
|     } |     } | ||||||
| @@ -223,13 +225,13 @@ void cChannelColumn::AddNewGridsAtStart() { | |||||||
|     for (const cEvent *event = Schedule->GetEventAround(firstGrid->StartTime()-60); event; event = Schedule->Events()->Prev(event)) { |     for (const cEvent *event = Schedule->GetEventAround(firstGrid->StartTime()-60); event; event = Schedule->Events()->Prev(event)) { | ||||||
|         if (!event) |         if (!event) | ||||||
|             break; |             break; | ||||||
|         if (event->EndTime() < myTime->GetStart()) { |         if (event->EndTime() < timeManager->GetStart()) { | ||||||
|             break; |             break; | ||||||
|         } |         } | ||||||
|         cGrid *grid = addEpgGrid(event, firstGrid, col); |         cGridElement *grid = addEpgGrid(event, firstGrid, col); | ||||||
|         col = !col; |         col = !col; | ||||||
|         firstGrid = grid; |         firstGrid = grid; | ||||||
|         if (event->StartTime() <= myTime->GetStart()) { |         if (event->StartTime() <= timeManager->GetStart()) { | ||||||
|             dummyNeeded = false; |             dummyNeeded = false; | ||||||
|             break; |             break; | ||||||
|         } |         } | ||||||
| @@ -237,22 +239,22 @@ void cChannelColumn::AddNewGridsAtStart() { | |||||||
|     if (dummyNeeded) { |     if (dummyNeeded) { | ||||||
|         firstGrid = grids.First(); |         firstGrid = grids.First(); | ||||||
|         if (firstGrid->isDummy()) { |         if (firstGrid->isDummy()) { | ||||||
|             firstGrid->SetStartTime(myTime->GetStart()); |             firstGrid->SetStartTime(timeManager->GetStart()); | ||||||
|             if (firstGrid->EndTime() >= myTime->GetEnd()) |             if (firstGrid->EndTime() >= timeManager->GetEnd()) | ||||||
|                 firstGrid->SetEndTime(myTime->GetEnd()); |                 firstGrid->SetEndTime(timeManager->GetEnd()); | ||||||
|         } else { |         } else { | ||||||
|             addDummyGrid(myTime->GetStart(), firstGrid->StartTime(), firstGrid, col); |             addDummyGrid(timeManager->GetStart(), firstGrid->StartTime(), firstGrid, col); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void cChannelColumn::AddNewGridsAtEnd() { | void cChannelEpg::AddNewGridsAtEnd() { | ||||||
|     cGrid *lastGrid = NULL; |     cGridElement *lastGrid = NULL; | ||||||
|     lastGrid = grids.Last(); |     lastGrid = grids.Last(); | ||||||
|     if (lastGrid == NULL) |     if (lastGrid == NULL) | ||||||
|         return; |         return; | ||||||
|     //if last event is long enough, nothing to do.
 |     //if last event is long enough, nothing to do.
 | ||||||
|     if (lastGrid->EndTime() >= myTime->GetEnd()) { |     if (lastGrid->EndTime() >= timeManager->GetEnd()) { | ||||||
|         return; |         return; | ||||||
|     } |     } | ||||||
|     //if not, i have to add new ones to the list
 |     //if not, i have to add new ones to the list
 | ||||||
| @@ -269,8 +271,8 @@ void cChannelColumn::AddNewGridsAtEnd() { | |||||||
|     Schedule = schedules->GetSchedule(channel); |     Schedule = schedules->GetSchedule(channel); | ||||||
|     if (!Schedule) { |     if (!Schedule) { | ||||||
|         if (lastGrid->isDummy()) { |         if (lastGrid->isDummy()) { | ||||||
|             lastGrid->SetStartTime(myTime->GetStart()); |             lastGrid->SetStartTime(timeManager->GetStart()); | ||||||
|             lastGrid->SetEndTime(myTime->GetEnd()); |             lastGrid->SetEndTime(timeManager->GetEnd()); | ||||||
|         } |         } | ||||||
|         return; |         return; | ||||||
|     } |     } | ||||||
| @@ -279,12 +281,12 @@ void cChannelColumn::AddNewGridsAtEnd() { | |||||||
|     for (const cEvent *event = Schedule->GetEventAround(lastGrid->EndTime()+60); event; event = Schedule->Events()->Next(event)) { |     for (const cEvent *event = Schedule->GetEventAround(lastGrid->EndTime()+60); event; event = Schedule->Events()->Next(event)) { | ||||||
|         if (!event) |         if (!event) | ||||||
|             break; |             break; | ||||||
|         if (event->StartTime() > myTime->GetEnd()) { |         if (event->StartTime() > timeManager->GetEnd()) { | ||||||
|             break; |             break; | ||||||
|         } |         } | ||||||
|         addEpgGrid(event, NULL, col); |         addEpgGrid(event, NULL, col); | ||||||
|         col = !col; |         col = !col; | ||||||
|         if (event->EndTime() > myTime->GetEnd()) { |         if (event->EndTime() > timeManager->GetEnd()) { | ||||||
|             dummyNeeded = false; |             dummyNeeded = false; | ||||||
|             break; |             break; | ||||||
|         } |         } | ||||||
| @@ -292,32 +294,32 @@ void cChannelColumn::AddNewGridsAtEnd() { | |||||||
|     if (dummyNeeded) { |     if (dummyNeeded) { | ||||||
|         lastGrid = grids.Last(); |         lastGrid = grids.Last(); | ||||||
|         if (lastGrid->isDummy()) { |         if (lastGrid->isDummy()) { | ||||||
|             lastGrid->SetEndTime(myTime->GetEnd()); |             lastGrid->SetEndTime(timeManager->GetEnd()); | ||||||
|             if (lastGrid->StartTime() <= myTime->GetStart()) |             if (lastGrid->StartTime() <= timeManager->GetStart()) | ||||||
|                 lastGrid->SetStartTime(myTime->GetStart()); |                 lastGrid->SetStartTime(timeManager->GetStart()); | ||||||
|         } else { |         } else { | ||||||
|             addDummyGrid(lastGrid->EndTime(), myTime->GetEnd(), NULL, col); |             addDummyGrid(lastGrid->EndTime(), timeManager->GetEnd(), NULL, col); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void cChannelColumn::ClearOutdatedStart() { | void cChannelEpg::ClearOutdatedStart() { | ||||||
|     cGrid *firstGrid = NULL; |     cGridElement *firstGrid = NULL; | ||||||
|     while (true) { |     while (true) { | ||||||
|         firstGrid = grids.First(); |         firstGrid = grids.First(); | ||||||
|         if (!firstGrid) |         if (!firstGrid) | ||||||
|             break; |             break; | ||||||
|         if (firstGrid->EndTime() <= myTime->GetStart()) { |         if (firstGrid->EndTime() <= timeManager->GetStart()) { | ||||||
|             grids.Del(firstGrid); |             grids.Del(firstGrid); | ||||||
|             firstGrid = NULL; |             firstGrid = NULL; | ||||||
|         } else { |         } else { | ||||||
|             if (firstGrid->isDummy()) { |             if (firstGrid->isDummy()) { | ||||||
|                 firstGrid->SetStartTime(myTime->GetStart()); |                 firstGrid->SetStartTime(timeManager->GetStart()); | ||||||
|                 cGrid *next = getNext(firstGrid); |                 cGridElement *next = getNext(firstGrid); | ||||||
|                 if (next) { |                 if (next) { | ||||||
|                     firstGrid->SetEndTime(next->StartTime()); |                     firstGrid->SetEndTime(next->StartTime()); | ||||||
|                 } else { |                 } else { | ||||||
|                     firstGrid->SetEndTime(myTime->GetEnd()); |                     firstGrid->SetEndTime(timeManager->GetEnd()); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|             break; |             break; | ||||||
| @@ -325,23 +327,23 @@ void cChannelColumn::ClearOutdatedStart() { | |||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void cChannelColumn::ClearOutdatedEnd() { | void cChannelEpg::ClearOutdatedEnd() { | ||||||
|     cGrid *lastGrid = NULL; |     cGridElement *lastGrid = NULL; | ||||||
|     while (true) { |     while (true) { | ||||||
|         lastGrid = grids.Last();     |         lastGrid = grids.Last();     | ||||||
|         if (!lastGrid) |         if (!lastGrid) | ||||||
|             break; |             break; | ||||||
|         if (lastGrid->StartTime() >= myTime->GetEnd()) { |         if (lastGrid->StartTime() >= timeManager->GetEnd()) { | ||||||
|             grids.Del(lastGrid); |             grids.Del(lastGrid); | ||||||
|             lastGrid = NULL; |             lastGrid = NULL; | ||||||
|         } else { |         } else { | ||||||
|             if (lastGrid->isDummy()) { |             if (lastGrid->isDummy()) { | ||||||
|                 lastGrid->SetEndTime(myTime->GetEnd()); |                 lastGrid->SetEndTime(timeManager->GetEnd()); | ||||||
|                 cGrid *prev = getPrev(lastGrid); |                 cGridElement *prev = getPrev(lastGrid); | ||||||
|                 if (prev) { |                 if (prev) { | ||||||
|                     lastGrid->SetStartTime(prev->EndTime()); |                     lastGrid->SetStartTime(prev->EndTime()); | ||||||
|                 } else { |                 } else { | ||||||
|                     lastGrid->SetStartTime(myTime->GetStart()); |                     lastGrid->SetStartTime(timeManager->GetStart()); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|             break; |             break; | ||||||
| @@ -349,8 +351,8 @@ void cChannelColumn::ClearOutdatedEnd() { | |||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| cGrid *cChannelColumn::addEpgGrid(const cEvent *event, cGrid *firstGrid, bool color) { | cGridElement *cChannelEpg::addEpgGrid(const cEvent *event, cGridElement *firstGrid, bool color) { | ||||||
|     cGrid *grid = new cEpgGrid(this, event); |     cGridElement *grid = new cEpgGrid(this, event); | ||||||
|     grid->setText(); |     grid->setText(); | ||||||
|     grid->SetColor(color); |     grid->SetColor(color); | ||||||
|     if (!firstGrid) |     if (!firstGrid) | ||||||
| @@ -360,8 +362,8 @@ cGrid *cChannelColumn::addEpgGrid(const cEvent *event, cGrid *firstGrid, bool co | |||||||
|     return grid; |     return grid; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| cGrid *cChannelColumn::addDummyGrid(time_t start, time_t end, cGrid *firstGrid, bool color) { | cGridElement *cChannelEpg::addDummyGrid(time_t start, time_t end, cGridElement *firstGrid, bool color) { | ||||||
|     cGrid *dummy = new cDummyGrid(this, start, end); |     cGridElement *dummy = new cDummyGrid(this, start, end); | ||||||
|     dummy->setText(); |     dummy->setText(); | ||||||
|     dummy->SetColor(color); |     dummy->SetColor(color); | ||||||
|     if (!firstGrid) |     if (!firstGrid) | ||||||
| @@ -371,12 +373,12 @@ cGrid *cChannelColumn::addDummyGrid(time_t start, time_t end, cGrid *firstGrid, | |||||||
|     return dummy; |     return dummy; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void cChannelColumn::SetTimers() { | void cChannelEpg::SetTimers() { | ||||||
| #if VDRVERSNUM < 20301 | #if VDRVERSNUM < 20301 | ||||||
|     hasTimer = channel->HasTimer(); |     hasTimer = channel->HasTimer(); | ||||||
| #endif | #endif | ||||||
|     hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel); |     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(); |         bool gridHadTimer = grid->HasTimer(); | ||||||
|         grid->SetTimer(); |         grid->SetTimer(); | ||||||
|         if (gridHadTimer || gridHadTimer != grid->HasTimer()) |         if (gridHadTimer || gridHadTimer != grid->HasTimer()) | ||||||
| @@ -389,11 +391,11 @@ void cChannelColumn::SetTimers() { | |||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void cChannelColumn::dumpGrids() { | void cChannelEpg::dumpGrids() { | ||||||
|     esyslog("tvguide: ------Channel %s %d: %d entires ---------", channel->Name(), num, grids.Count()); |     esyslog("tvguide: ------Channel %s %d: %d entires ---------", channel->Name(), num, grids.Count()); | ||||||
|     int i=1; |     int i=1; | ||||||
|     for (cGrid *grid = grids.First(); grid; grid = grids.Next(grid)) { |     for (cGridElement *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())); |         esyslog("tvguide: grid %d: start: %s, stop: %s", i, *cTimeManager::printTime(grid->StartTime()), *cTimeManager::printTime(grid->EndTime())); | ||||||
|         i++; |         i++; | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @@ -1,25 +1,25 @@ | |||||||
| #ifndef __TVGUIDE_CHANNELCOLUMN_H | #ifndef __TVGUIDE_CHANNELEPG_H | ||||||
| #define __TVGUIDE_CHANNELCOLUMN_H | #define __TVGUIDE_CHANNELEPG_H | ||||||
| 
 | 
 | ||||||
| #include <vdr/tools.h> | #include <vdr/tools.h> | ||||||
| #include "grid.h" | #include "gridelement.h" | ||||||
| #include "epggrid.h" | #include "epggrid.h" | ||||||
| #include "headergrid.h" | #include "headergrid.h" | ||||||
| #include "switchtimer.h" | #include "switchtimer.h" | ||||||
| 
 | 
 | ||||||
| class cGrid; | class cGridElement; | ||||||
| class cEpgGrid; | class cEpgGrid; | ||||||
| class cHeaderGrid; | class cHeaderGrid; | ||||||
| 
 | 
 | ||||||
| // --- cChannelColumn  -------------------------------------------------------------
 | // --- cChannelEpg  -------------------------------------------------------------
 | ||||||
| 
 | 
 | ||||||
| class cChannelColumn : public cListObject, public cStyledPixmap { | class cChannelEpg : public cListObject, public cStyledPixmap { | ||||||
| private: | private: | ||||||
|     cMyTime *myTime; |     cTimeManager *timeManager; | ||||||
|     int num; |     int num; | ||||||
|     const cChannel *channel; |     const cChannel *channel; | ||||||
|     cHeaderGrid *header; |     cHeaderGrid *header; | ||||||
|     cList<cGrid> grids; |     cList<cGridElement> grids; | ||||||
| #if VDRVERSNUM >= 20301 | #if VDRVERSNUM >= 20301 | ||||||
| #else | #else | ||||||
|     cSchedulesLock *schedulesLock; |     cSchedulesLock *schedulesLock; | ||||||
| @@ -27,26 +27,26 @@ private: | |||||||
|     const cSchedules *schedules; |     const cSchedules *schedules; | ||||||
|     bool hasTimer; |     bool hasTimer; | ||||||
|     bool hasSwitchTimer; |     bool hasSwitchTimer; | ||||||
|     cGrid *addEpgGrid(const cEvent *event, cGrid *firstGrid, bool color); |     cGridElement *addEpgGrid(const cEvent *event, cGridElement *firstGrid, bool color); | ||||||
|     cGrid *addDummyGrid(time_t start, time_t end, cGrid *firstGrid, bool color); |     cGridElement *addDummyGrid(time_t start, time_t end, cGridElement *firstGrid, bool color); | ||||||
| public: | public: | ||||||
|     cChannelColumn(int num, const cChannel *channel, cMyTime *myTime); |     cChannelEpg(int num, const cChannel *channel, cTimeManager *timeManager); | ||||||
|     virtual ~cChannelColumn(void); |     virtual ~cChannelEpg(void); | ||||||
|     void createHeader(); |     void createHeader(); | ||||||
|     void drawHeader(); |     void drawHeader(); | ||||||
|     bool readGrids(); |     bool readGrids(); | ||||||
|     void drawGrids(); |     void drawGrids(); | ||||||
|     int getX(); |     int getX(); | ||||||
|     int getY(); |     int getY(); | ||||||
|     int Start() { return myTime->GetStart(); }; |     int Start() { return timeManager->GetStart(); }; | ||||||
|     int Stop()  { return myTime->GetEnd(); }; |     int Stop()  { return timeManager->GetEnd(); }; | ||||||
|     const char* Name() { return channel->Name(); }; |     const char* Name() { return channel->Name(); }; | ||||||
|     const cChannel * getChannel() {return channel;} |     const cChannel *getChannel() {return channel;} | ||||||
|     cGrid * getActive(); |     cGridElement *getActive(bool last = false); | ||||||
|     cGrid * getNext(cGrid *activeGrid); |     cGridElement *getNext(cGridElement *activeGrid); | ||||||
|     cGrid * getPrev(cGrid *activeGrid); |     cGridElement *getPrev(cGridElement *activeGrid); | ||||||
|     cGrid * getNeighbor(cGrid *activeGrid); |     cGridElement *getNeighbor(cGridElement *activeGrid); | ||||||
|     bool isFirst(cGrid *grid); |     bool isFirst(cGridElement *grid); | ||||||
|     void AddNewGridsAtStart(); |     void AddNewGridsAtStart(); | ||||||
|     void AddNewGridsAtEnd(); |     void AddNewGridsAtEnd(); | ||||||
|     void ClearOutdatedStart(); |     void ClearOutdatedStart(); | ||||||
| @@ -66,4 +66,4 @@ public: | |||||||
|     void dumpGrids(); |     void dumpGrids(); | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| #endif //__TVGUIDE_CHANNELCOLUMN_H
 | #endif //__TVGUIDE_CHANNELEPG_H
 | ||||||
| @@ -36,12 +36,12 @@ void cChannelGroupGrid::SetBackground() { | |||||||
|  |  | ||||||
| void cChannelGroupGrid::SetGeometry(int start, int end) { | void cChannelGroupGrid::SetGeometry(int start, int end) { | ||||||
|     int x, y, width, height; |     int x, y, width, height; | ||||||
|     if (tvguideConfig.displayMode == eVertical) { |     if (config.displayMode == eVertical) { | ||||||
|         x = geoManager.timeLineWidth + start*geoManager.colWidth; |         x = geoManager.timeLineWidth + start*geoManager.colWidth; | ||||||
|         y = geoManager.statusHeaderHeight; |         y = geoManager.statusHeaderHeight; | ||||||
|         width = (end - start + 1) * geoManager.colWidth; |         width = (end - start + 1) * geoManager.colWidth; | ||||||
|         height = geoManager.channelGroupsHeight; |         height = geoManager.channelGroupsHeight; | ||||||
|     } else if (tvguideConfig.displayMode == eHorizontal) { |     } else if (config.displayMode == eHorizontal) { | ||||||
|         x = 0; |         x = 0; | ||||||
|         y = geoManager.statusHeaderHeight +  geoManager.timeLineHeight + start*geoManager.rowHeight; |         y = geoManager.statusHeaderHeight +  geoManager.timeLineHeight + start*geoManager.rowHeight; | ||||||
|         width = geoManager.channelGroupsWidth; |         width = geoManager.channelGroupsWidth; | ||||||
| @@ -51,17 +51,17 @@ void cChannelGroupGrid::SetGeometry(int start, int end) { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cChannelGroupGrid::Draw(void) { | void cChannelGroupGrid::Draw(void) { | ||||||
|     if (tvguideConfig.style == eStyleGraphical) { |     if (config.style == eStyleGraphical) { | ||||||
|         drawBackgroundGraphical(bgChannelGroup); |         drawBackgroundGraphical(bgChannelGroup); | ||||||
|     } else { |     } else { | ||||||
|         drawBackground(); |         drawBackground(); | ||||||
|         drawBorder(); |         drawBorder(); | ||||||
|     } |     } | ||||||
|     tColor colorText = theme.Color(clrFont); |     tColor colorText = theme.Color(clrFont); | ||||||
|     tColor colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent; |     tColor colorTextBack = (config.style == eStyleFlat)?color:clrTransparent; | ||||||
|     if (tvguideConfig.displayMode == eVertical) { |     if (config.displayMode == eVertical) { | ||||||
|         DrawVertical(colorText, colorTextBack); |         DrawVertical(colorText, colorTextBack); | ||||||
|     } else if (tvguideConfig.displayMode == eHorizontal) { |     } else if (config.displayMode == eHorizontal) { | ||||||
|         DrawHorizontal(colorText, colorTextBack); |         DrawHorizontal(colorText, colorTextBack); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -1,4 +1,5 @@ | |||||||
| #include <vector> | #include <vector> | ||||||
|  | #include "config.h" | ||||||
| #include "channelgroups.h" | #include "channelgroups.h" | ||||||
|  |  | ||||||
| cChannelGroups::cChannelGroups(void) { | cChannelGroups::cChannelGroups(void) { | ||||||
| @@ -12,26 +13,23 @@ void cChannelGroups::ReadChannelGroups(void) { | |||||||
|     int lastChannelNumber = 0; |     int lastChannelNumber = 0; | ||||||
| #if VDRVERSNUM >= 20301 | #if VDRVERSNUM >= 20301 | ||||||
|     LOCK_CHANNELS_READ; |     LOCK_CHANNELS_READ; | ||||||
|     const cChannel *first = Channels->First(); |     const cChannels *channels = Channels; | ||||||
| #else | #else | ||||||
|     const cChannel *first = Channels.First(); |     const cChannels *channels = &Channels; | ||||||
| #endif | #endif | ||||||
|  |     const cChannel *first = channels->First(); | ||||||
|     if (!first->GroupSep()) { |     if (!first->GroupSep()) { | ||||||
|         channelGroups.push_back(cChannelGroup(tr("Main Program"))); |         channelGroups.push_back(cChannelGroup(tr("Main Program"))); | ||||||
|         setStart = true; |         setStart = true; | ||||||
|     }     |     }     | ||||||
| #if VDRVERSNUM >= 20301 |     for (const cChannel *channel = channels->First(); channel; channel = channels->Next(channel)) { | ||||||
|     for (const cChannel *channel = Channels->First(); channel; channel = Channels->Next(channel)) { |  | ||||||
| #else |  | ||||||
|     for (const cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) { |  | ||||||
| #endif |  | ||||||
|         if (setStart && (channelGroups.size() > 0)) { |         if (setStart && (channelGroups.size() > 0)) { | ||||||
|             channelGroups[channelGroups.size()-1].SetChannelStart(channel->Number()); |             channelGroups[channelGroups.size() - 1].SetChannelStart(channel->Number()); | ||||||
|             setStart = false; |             setStart = false; | ||||||
|         } |         } | ||||||
|         if (channel->GroupSep()) { |         if (channel->GroupSep()) { | ||||||
|             if (channelGroups.size() > 0) { |             if (channelGroups.size() > 0) { | ||||||
|                 channelGroups[channelGroups.size()-1].SetChannelStop(lastChannelNumber); |                 channelGroups[channelGroups.size() - 1].SetChannelStop(lastChannelNumber); | ||||||
|             } |             } | ||||||
|             channelGroups.push_back(cChannelGroup(channel->Name())); |             channelGroups.push_back(cChannelGroup(channel->Name())); | ||||||
|             setStart = true; |             setStart = true; | ||||||
| @@ -40,8 +38,8 @@ void cChannelGroups::ReadChannelGroups(void) { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
|     if (channelGroups.size() > 0) { |     if (channelGroups.size() > 0) { | ||||||
|         channelGroups[channelGroups.size()-1].SetChannelStop(lastChannelNumber); |         channelGroups[channelGroups.size() - 1].SetChannelStop(lastChannelNumber); | ||||||
|         if ((tvguideConfig.hideLastGroup)&&(channelGroups.size() > 1)) { |         if ((config.hideLastGroup) && (channelGroups.size() > 1)) { | ||||||
|             channelGroups.pop_back(); |             channelGroups.pop_back(); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| @@ -96,7 +94,7 @@ int cChannelGroups::GetNextGroupChannelNumber(const cChannel *channel) { | |||||||
| } | } | ||||||
|  |  | ||||||
| bool cChannelGroups::IsInLastGroup(const cChannel *channel) { | bool cChannelGroups::IsInLastGroup(const cChannel *channel) { | ||||||
|     if (!tvguideConfig.hideLastGroup) |     if (!config.hideLastGroup) | ||||||
|         return false; |         return false; | ||||||
|     if (channelGroups.size() > 0) { |     if (channelGroups.size() > 0) { | ||||||
|         if (channel->Number() > channelGroups[channelGroups.size()-1].StopChannel()) { |         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) { | int cChannelGroups::GetLastValidChannel(void) { | ||||||
|     if (channelGroups.size() > 0) |     if (config.hideLastGroup && channelGroups.size() > 0) { | ||||||
|         return channelGroups[channelGroups.size()-1].StopChannel(); |         return channelGroups[channelGroups.size() - 1].StopChannel(); | ||||||
|     return 0; |     } | ||||||
|  | #if VDRVERSNUM >= 20301 | ||||||
|  |    LOCK_CHANNELS_READ; | ||||||
|  |    return Channels->MaxNumber(); | ||||||
|  | #else | ||||||
|  |    return Channels.MaxNumber(); | ||||||
|  | #endif | ||||||
| } | } | ||||||
|  |  | ||||||
| void cChannelGroups::DumpGroups(void) { | void cChannelGroups::DumpGroups(void) { | ||||||
|   | |||||||
| @@ -3,6 +3,7 @@ | |||||||
|  |  | ||||||
| #include <vector> | #include <vector> | ||||||
| #include <vdr/channels.h> | #include <vdr/channels.h> | ||||||
|  | #include "config.h" | ||||||
| #include "channelgroup.h" | #include "channelgroup.h" | ||||||
|  |  | ||||||
| // --- cChannelGroups  ------------------------------------------------------------- | // --- cChannelGroups  ------------------------------------------------------------- | ||||||
|   | |||||||
| @@ -6,22 +6,13 @@ | |||||||
| #include "channelgroups.h" | #include "channelgroups.h" | ||||||
| #include "channeljump.h" | #include "channeljump.h" | ||||||
|  |  | ||||||
| cChannelJump::cChannelJump(cChannelGroups *channelGroups) { | cChannelJump::cChannelJump(cChannelGroups *channelGroups, int lastValidChannel) { | ||||||
|     this->channelGroups = channelGroups; |     this->channelGroups = channelGroups; | ||||||
|     pixmapText = NULL; |     pixmapText = NULL; | ||||||
|     channel = 0; |     channel = 0; | ||||||
| 	if (!tvguideConfig.hideLastGroup) { |     maxChannels = lastValidChannel; | ||||||
| #if VDRVERSNUM >= 20301 |  | ||||||
|         LOCK_CHANNELS_READ; |  | ||||||
|         maxChannels = Channels->MaxNumber(); |  | ||||||
| #else |  | ||||||
|         maxChannels = Channels.MaxNumber(); |  | ||||||
| #endif |  | ||||||
| 	} else { |  | ||||||
|         maxChannels = channelGroups->GetLastValidChannel(); |  | ||||||
|     } |  | ||||||
|     timeout = Setup.ChannelEntryTimeout; |     timeout = Setup.ChannelEntryTimeout; | ||||||
|     startTime = cTimeMs::Now(); |     startTime = 0; | ||||||
|     SetPixmaps(); |     SetPixmaps(); | ||||||
|     Draw(); |     Draw(); | ||||||
| } | } | ||||||
| @@ -41,7 +32,7 @@ void cChannelJump::SetPixmaps(void) { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cChannelJump::Draw(void) { | void cChannelJump::Draw(void) { | ||||||
| 	if (tvguideConfig.style == eStyleGraphical) { | 	if (config.style == eStyleGraphical) { | ||||||
|         drawBackgroundGraphical(bgChannelJump); |         drawBackgroundGraphical(bgChannelJump); | ||||||
| 	} else { | 	} else { | ||||||
|         pixmap->Fill(theme.Color(clrBackground)); |         pixmap->Fill(theme.Color(clrBackground)); | ||||||
|   | |||||||
| @@ -18,7 +18,7 @@ private: | |||||||
|     void Draw(void); |     void Draw(void); | ||||||
|     cString BuildChannelString(void); |     cString BuildChannelString(void); | ||||||
| public: | public: | ||||||
|     cChannelJump(cChannelGroups *channelGroups); |     cChannelJump(cChannelGroups *channelGroups, int lastValidChannel); | ||||||
|     virtual ~cChannelJump(void); |     virtual ~cChannelJump(void); | ||||||
|     void Set(int num); |     void Set(int num); | ||||||
|     void DrawText(void); |     void DrawText(void); | ||||||
|   | |||||||
							
								
								
									
										39
									
								
								config.c
									
									
									
									
									
								
							
							
						
						
									
										39
									
								
								config.c
									
									
									
									
									
								
							| @@ -1,7 +1,8 @@ | |||||||
| #include <string> | #include <string> | ||||||
| #include "config.h" | #include "config.h" | ||||||
|  |  | ||||||
| cTvguideConfig::cTvguideConfig() { | cTVGuideConfig::cTVGuideConfig() { | ||||||
|  |     useHWAccel = false; | ||||||
|     debugImageLoading = 0; |     debugImageLoading = 0; | ||||||
|     showMainMenuEntry = 1; |     showMainMenuEntry = 1; | ||||||
|     replaceOriginalSchedule = 0; |     replaceOriginalSchedule = 0; | ||||||
| @@ -9,8 +10,8 @@ cTvguideConfig::cTvguideConfig() { | |||||||
|     showTimeInGrid = 1; |     showTimeInGrid = 1; | ||||||
|     channelCols = 5; |     channelCols = 5; | ||||||
|     channelRows = 10; |     channelRows = 10; | ||||||
|     displayTime = 160; |     displayTime = 180; | ||||||
|     displayHorizontalTime = 160; |     displayHorizontalTime = 180; | ||||||
|     displayStatusHeader = 1; |     displayStatusHeader = 1; | ||||||
|     displayChannelGroups = 1; |     displayChannelGroups = 1; | ||||||
|     displayTimeBase = 1; |     displayTimeBase = 1; | ||||||
| @@ -27,10 +28,13 @@ cTvguideConfig::cTvguideConfig() { | |||||||
|     footerHeightPercent = 7; |     footerHeightPercent = 7; | ||||||
|     stepMinutes = 30; |     stepMinutes = 30; | ||||||
|     bigStepHours = 3; |     bigStepHours = 3; | ||||||
|  |     bigStepHoursHorizontal = 3; | ||||||
|     hugeStepHours = 24; |     hugeStepHours = 24; | ||||||
|  |     hugeStepHoursHorizontal = 24; | ||||||
|     channelJumpMode = eNumJump; |     channelJumpMode = eNumJump; | ||||||
|     jumpChannels = 0; |     jumpChannels = 0; | ||||||
|     blueKeyMode = 2; |     blueKeyMode = 2; | ||||||
|  |     addSubtitleToTimer = 1; | ||||||
|     closeOnSwitch = 1; |     closeOnSwitch = 1; | ||||||
|     numkeyMode = 0; |     numkeyMode = 0; | ||||||
|     useRemoteTimers = 0; |     useRemoteTimers = 0; | ||||||
| @@ -95,6 +99,7 @@ cTvguideConfig::cTvguideConfig() { | |||||||
|     FontRecMenuItemLargeDelta = 0; |     FontRecMenuItemLargeDelta = 0; | ||||||
|     timeFormat = 1; |     timeFormat = 1; | ||||||
|     useNopacityTheme = 1; |     useNopacityTheme = 1; | ||||||
|  |     useNopacityThemeCurrent = -1; | ||||||
|     themeIndex = -1; |     themeIndex = -1; | ||||||
|     themeIndexCurrent = -1; |     themeIndexCurrent = -1; | ||||||
|     themeName = ""; |     themeName = ""; | ||||||
| @@ -112,25 +117,26 @@ cTvguideConfig::cTvguideConfig() { | |||||||
|     iconsPathSet = false; |     iconsPathSet = false; | ||||||
| } | } | ||||||
|  |  | ||||||
| cTvguideConfig::~cTvguideConfig() { | cTVGuideConfig::~cTVGuideConfig() { | ||||||
| } | } | ||||||
|  |  | ||||||
| void cTvguideConfig::setDynamicValues() { | void cTVGuideConfig::setDynamicValues() { | ||||||
|     numGrids = (displayMode == eVertical)?channelCols:channelRows; |     numGrids = (displayMode == eVertical)?channelCols:channelRows; | ||||||
|     jumpChannels = numGrids; |     jumpChannels = numGrids; | ||||||
| } | } | ||||||
|  |  | ||||||
| bool cTvguideConfig::LoadTheme() { | bool cTVGuideConfig::LoadTheme() { | ||||||
|     //is correct theme already loaded? |     //is correct theme already loaded? | ||||||
|     if (nOpacityTheme.size() == 0) |     if (nOpacityTheme.size() == 0) | ||||||
|         nOpacityTheme = Setup.OSDTheme; |         nOpacityTheme = Setup.OSDTheme; | ||||||
|     if ((themeIndex > -1) && (themeIndex == themeIndexCurrent)) { |     if ((themeIndex > -1) && (themeIndex == themeIndexCurrent) && (useNopacityTheme == useNopacityThemeCurrent)) { | ||||||
|         if (!nOpacityTheme.compare(Setup.OSDTheme)) { |         if (!nOpacityTheme.compare(Setup.OSDTheme)) { | ||||||
|             return false; |             return false; | ||||||
|         } else { |         } else { | ||||||
|             nOpacityTheme = Setup.OSDTheme; |             nOpacityTheme = Setup.OSDTheme; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |     esyslog("tvguide: loading new Theme"); | ||||||
|     //Load available Themes |     //Load available Themes | ||||||
|     cThemes themes; |     cThemes themes; | ||||||
|     themes.Load(*cString("tvguide")); |     themes.Load(*cString("tvguide")); | ||||||
| @@ -167,6 +173,7 @@ bool cTvguideConfig::LoadTheme() { | |||||||
|         themeIndex = 0; |         themeIndex = 0; | ||||||
|  |  | ||||||
|     themeIndexCurrent = themeIndex; |     themeIndexCurrent = themeIndex; | ||||||
|  |     useNopacityThemeCurrent = useNopacityTheme; | ||||||
|  |  | ||||||
|     const char *themePath = themes.FileName(themeIndex); |     const char *themePath = themes.FileName(themeIndex); | ||||||
|     if (access(themePath, F_OK) == 0) { |     if (access(themePath, F_OK) == 0) { | ||||||
| @@ -178,7 +185,7 @@ bool cTvguideConfig::LoadTheme() { | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| void cTvguideConfig::SetStyle(void) { | void cTVGuideConfig::SetStyle(void) { | ||||||
|     if (theme.Color(clrStyle) == CLR_STYLE_FLAT) { |     if (theme.Color(clrStyle) == CLR_STYLE_FLAT) { | ||||||
|         style = eStyleFlat; |         style = eStyleFlat; | ||||||
|         esyslog("tvguide: set flat style"); |         esyslog("tvguide: set flat style"); | ||||||
| @@ -195,25 +202,25 @@ void cTvguideConfig::SetStyle(void) { | |||||||
|      |      | ||||||
| } | } | ||||||
|  |  | ||||||
| void cTvguideConfig::SetLogoPath(cString path) { | void cTVGuideConfig::SetLogoPath(cString path) { | ||||||
|     logoPath = checkSlashAtEnd(*path); |     logoPath = checkSlashAtEnd(*path); | ||||||
|     logoPathSet = true; |     logoPathSet = true; | ||||||
|     esyslog("tvguide: Logo Path set to %s", *logoPath); |     esyslog("tvguide: Logo Path set to %s", *logoPath); | ||||||
| } | } | ||||||
|  |  | ||||||
| void cTvguideConfig::SetImagesPath(cString path) { | void cTVGuideConfig::SetImagesPath(cString path) { | ||||||
|     epgImagePath = checkSlashAtEnd(*path); |     epgImagePath = checkSlashAtEnd(*path); | ||||||
|     imagesPathSet = true; |     imagesPathSet = true; | ||||||
|     esyslog("tvguide: EPG Image Path set to %s", *epgImagePath); |     esyslog("tvguide: EPG Image Path set to %s", *epgImagePath); | ||||||
| } | } | ||||||
|  |  | ||||||
| void cTvguideConfig::SetIconsPath(cString path) { | void cTVGuideConfig::SetIconsPath(cString path) { | ||||||
|     iconPath = checkSlashAtEnd(*path); |     iconPath = checkSlashAtEnd(*path); | ||||||
|     iconsPathSet = true; |     iconsPathSet = true; | ||||||
|     esyslog("tvguide: Icon Path set to %s", *iconPath); |     esyslog("tvguide: Icon Path set to %s", *iconPath); | ||||||
| } | } | ||||||
|  |  | ||||||
| void cTvguideConfig::SetDefaultPathes(void) { | void cTVGuideConfig::SetDefaultPathes(void) { | ||||||
|     logoPathDefault = cString::sprintf("%s/logos/", cPlugin::ResourceDirectory(PLUGIN_NAME_I18N)); |     logoPathDefault = cString::sprintf("%s/logos/", cPlugin::ResourceDirectory(PLUGIN_NAME_I18N)); | ||||||
|     iconPathDefault = cString::sprintf("%s/icons/", 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)); |     epgImagePathDefault = cString::sprintf("%s/epgimages/", cPlugin::CacheDirectory(PLUGIN_NAME_I18N)); | ||||||
| @@ -229,7 +236,7 @@ void cTvguideConfig::SetDefaultPathes(void) { | |||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| cString cTvguideConfig::checkSlashAtEnd(std::string path) { | cString cTVGuideConfig::checkSlashAtEnd(std::string path) { | ||||||
|     try { |     try { | ||||||
|         if (!(path.at(path.size()-1) == '/')) |         if (!(path.at(path.size()-1) == '/')) | ||||||
|             return cString::sprintf("%s/", path.c_str()); |             return cString::sprintf("%s/", path.c_str()); | ||||||
| @@ -237,9 +244,10 @@ cString cTvguideConfig::checkSlashAtEnd(std::string path) { | |||||||
|     return path.c_str(); |     return path.c_str(); | ||||||
| } | } | ||||||
|  |  | ||||||
| bool cTvguideConfig::SetupParse(const char *Name, const char *Value) { | bool cTVGuideConfig::SetupParse(const char *Name, const char *Value) { | ||||||
|     if      (strcmp(Name, "timeFormat") == 0)               timeFormat = atoi(Value); |     if      (strcmp(Name, "timeFormat") == 0)               timeFormat = atoi(Value); | ||||||
|     else if (strcmp(Name, "debugImageLoading") == 0)        debugImageLoading = 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, "showMainMenuEntry") == 0)        showMainMenuEntry = atoi(Value); | ||||||
|     else if (strcmp(Name, "replaceOriginalSchedule") == 0)  replaceOriginalSchedule = atoi(Value); |     else if (strcmp(Name, "replaceOriginalSchedule") == 0)  replaceOriginalSchedule = atoi(Value); | ||||||
|     else if (strcmp(Name, "useNopacityTheme") == 0)         useNopacityTheme = atoi(Value);    |     else if (strcmp(Name, "useNopacityTheme") == 0)         useNopacityTheme = atoi(Value);    | ||||||
| @@ -264,7 +272,9 @@ bool cTvguideConfig::SetupParse(const char *Name, const char *Value) { | |||||||
|     else if (strcmp(Name, "logoWidthRatio") == 0)           logoWidthRatio = atoi(Value); |     else if (strcmp(Name, "logoWidthRatio") == 0)           logoWidthRatio = atoi(Value); | ||||||
|     else if (strcmp(Name, "logoHeightRatio") == 0)          logoHeightRatio = atoi(Value); |     else if (strcmp(Name, "logoHeightRatio") == 0)          logoHeightRatio = atoi(Value); | ||||||
|     else if (strcmp(Name, "bigStepHours") == 0)             bigStepHours = atoi(Value); |     else if (strcmp(Name, "bigStepHours") == 0)             bigStepHours = atoi(Value); | ||||||
|  |     else if (strcmp(Name, "bigStepHoursHorizontal") == 0)   bigStepHoursHorizontal = atoi(Value); | ||||||
|     else if (strcmp(Name, "hugeStepHours") == 0)            hugeStepHours = atoi(Value); |     else if (strcmp(Name, "hugeStepHours") == 0)            hugeStepHours = atoi(Value); | ||||||
|  |     else if (strcmp(Name, "hugeStepHoursHorizontal") == 0)  hugeStepHoursHorizontal = atoi(Value); | ||||||
|     else if (strcmp(Name, "channelJumpMode") == 0)          channelJumpMode = atoi(Value); |     else if (strcmp(Name, "channelJumpMode") == 0)          channelJumpMode = atoi(Value); | ||||||
|     else if (strcmp(Name, "blueKeyMode") == 0)              blueKeyMode = atoi(Value); |     else if (strcmp(Name, "blueKeyMode") == 0)              blueKeyMode = atoi(Value); | ||||||
|     else if (strcmp(Name, "numkeyMode") == 0)               numkeyMode = atoi(Value); |     else if (strcmp(Name, "numkeyMode") == 0)               numkeyMode = atoi(Value); | ||||||
| @@ -286,6 +296,7 @@ bool cTvguideConfig::SetupParse(const char *Name, const char *Value) { | |||||||
|     else if (strcmp(Name, "footerHeightPercent") == 0)      footerHeightPercent = atoi(Value); |     else if (strcmp(Name, "footerHeightPercent") == 0)      footerHeightPercent = atoi(Value); | ||||||
|     else if (strcmp(Name, "instRecFolderMode") == 0)        instRecFolderMode = atoi(Value); |     else if (strcmp(Name, "instRecFolderMode") == 0)        instRecFolderMode = atoi(Value); | ||||||
|     else if (strcmp(Name, "instRecFixedFolder") == 0)       instRecFixedFolder = Value; |     else if (strcmp(Name, "instRecFixedFolder") == 0)       instRecFixedFolder = Value; | ||||||
|  |     else if (strcmp(Name, "addSubtitleToTimer") == 0)       addSubtitleToTimer = atoi(Value); | ||||||
|     else if (strcmp(Name, "favWhatsOnNow") == 0)            favWhatsOnNow = atoi(Value); |     else if (strcmp(Name, "favWhatsOnNow") == 0)            favWhatsOnNow = atoi(Value); | ||||||
|     else if (strcmp(Name, "favWhatsOnNext") == 0)           favWhatsOnNext = atoi(Value); |     else if (strcmp(Name, "favWhatsOnNext") == 0)           favWhatsOnNext = atoi(Value); | ||||||
|     else if (strcmp(Name, "favUseTime1") == 0)              favUseTime1 = atoi(Value); |     else if (strcmp(Name, "favUseTime1") == 0)              favUseTime1 = atoi(Value); | ||||||
|   | |||||||
							
								
								
									
										23
									
								
								config.h
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								config.h
									
									
									
									
									
								
							| @@ -8,7 +8,7 @@ | |||||||
| #include "fontmanager.h" | #include "fontmanager.h" | ||||||
| #include "imagecache.h" | #include "imagecache.h" | ||||||
|  |  | ||||||
| enum { | enum eTimeFormat { | ||||||
|     e12Hours, |     e12Hours, | ||||||
|     e24Hours |     e24Hours | ||||||
| }; | }; | ||||||
| @@ -43,12 +43,19 @@ enum eInstRecFolderMode { | |||||||
|     eFolderFixed |     eFolderFixed | ||||||
| }; | }; | ||||||
|  |  | ||||||
| class cTvguideConfig { | typedef enum { | ||||||
|  |     addSubtitleNever = 0, | ||||||
|  |     addSubtitleSmart, | ||||||
|  |     addSubtitleAlways | ||||||
|  | } addSubtitleToTimerMode; | ||||||
|  |  | ||||||
|  | class cTVGuideConfig { | ||||||
|     private: |     private: | ||||||
|         cString checkSlashAtEnd(std::string path); |         cString checkSlashAtEnd(std::string path); | ||||||
|     public: |     public: | ||||||
|         cTvguideConfig(); |         cTVGuideConfig(); | ||||||
|         ~cTvguideConfig(); |         ~cTVGuideConfig(); | ||||||
|  |         int useHWAccel; | ||||||
|         int debugImageLoading; |         int debugImageLoading; | ||||||
|         int showMainMenuEntry; |         int showMainMenuEntry; | ||||||
|         int replaceOriginalSchedule; |         int replaceOriginalSchedule; | ||||||
| @@ -75,10 +82,13 @@ class cTvguideConfig { | |||||||
|         int footerHeightPercent; |         int footerHeightPercent; | ||||||
|         int stepMinutes; |         int stepMinutes; | ||||||
|         int bigStepHours; |         int bigStepHours; | ||||||
|  |         int bigStepHoursHorizontal; | ||||||
|         int hugeStepHours; |         int hugeStepHours; | ||||||
|  |         int hugeStepHoursHorizontal; | ||||||
|         int channelJumpMode; |         int channelJumpMode; | ||||||
|         int jumpChannels; |         int jumpChannels; | ||||||
|         int blueKeyMode; |         int blueKeyMode; | ||||||
|  |         int addSubtitleToTimer; | ||||||
|         int closeOnSwitch; |         int closeOnSwitch; | ||||||
|         int numkeyMode; |         int numkeyMode; | ||||||
|         int useRemoteTimers; |         int useRemoteTimers; | ||||||
| @@ -149,6 +159,7 @@ class cTvguideConfig { | |||||||
|         int FontRecMenuItemLargeDelta; |         int FontRecMenuItemLargeDelta; | ||||||
|         int timeFormat; |         int timeFormat; | ||||||
|         int useNopacityTheme; |         int useNopacityTheme; | ||||||
|  | 	int useNopacityThemeCurrent; | ||||||
|         int themeIndex; |         int themeIndex; | ||||||
|         int themeIndexCurrent; |         int themeIndexCurrent; | ||||||
|         cString themeName; |         cString themeName; | ||||||
| @@ -175,7 +186,7 @@ class cTvguideConfig { | |||||||
| }; | }; | ||||||
|  |  | ||||||
| #ifdef DEFINE_CONFIG | #ifdef DEFINE_CONFIG | ||||||
|     cTvguideConfig tvguideConfig; |     cTVGuideConfig config; | ||||||
|     cOsdManager osdManager; |     cOsdManager osdManager; | ||||||
|     cGeometryManager geoManager; |     cGeometryManager geoManager; | ||||||
|     cFontManager fontManager; |     cFontManager fontManager; | ||||||
| @@ -183,7 +194,7 @@ class cTvguideConfig { | |||||||
|     cTheme theme; |     cTheme theme; | ||||||
|     cPlugin* pRemoteTimers = NULL; |     cPlugin* pRemoteTimers = NULL; | ||||||
| #else | #else | ||||||
|     extern cTvguideConfig tvguideConfig; |     extern cTVGuideConfig config; | ||||||
|     extern cOsdManager osdManager; |     extern cOsdManager osdManager; | ||||||
|     extern cGeometryManager geoManager; |     extern cGeometryManager geoManager; | ||||||
|     extern cFontManager fontManager; |     extern cFontManager fontManager; | ||||||
|   | |||||||
							
								
								
									
										10
									
								
								detailview.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								detailview.c
									
									
									
									
									
								
							| @@ -1,12 +1,12 @@ | |||||||
| #include "detailview.h" | #include "detailview.h" | ||||||
|  |  | ||||||
| cDetailView::cDetailView(const cEvent *event, cFooter *footer) { | cDetailView::cDetailView(const cEvent *event, cFooter *footer) : cThread("DetailView") { | ||||||
|     this->event = event; |     this->event = event; | ||||||
|     this->footer = footer; |     this->footer = footer; | ||||||
| } | } | ||||||
|  |  | ||||||
| cDetailView::~cDetailView(void){ | cDetailView::~cDetailView(void){ | ||||||
|     Cancel(-1); |     Cancel(3); | ||||||
|     while (Active()) |     while (Active()) | ||||||
|         cCondWait::SleepMs(10); |         cCondWait::SleepMs(10); | ||||||
| #if VDRVERSNUM >= 20301 | #if VDRVERSNUM >= 20301 | ||||||
| @@ -74,8 +74,8 @@ std::string cDetailView::LoadReruns(void) { | |||||||
|     Epgsearch_searchresults_v1_0 data; |     Epgsearch_searchresults_v1_0 data; | ||||||
|     std::string strQuery = event->Title(); |     std::string strQuery = event->Title(); | ||||||
|  |  | ||||||
|     if (tvguideConfig.displayRerunsDetailEPGView > 0) { |     if (config.displayRerunsDetailEPGView > 0) { | ||||||
|         if (tvguideConfig.useSubtitleRerun == 2 && !isempty(event->ShortText())) { |         if (config.useSubtitleRerun == 2 && !isempty(event->ShortText())) { | ||||||
|             strQuery += "~"; |             strQuery += "~"; | ||||||
|             strQuery += event->ShortText(); |             strQuery += event->ShortText(); | ||||||
|         } |         } | ||||||
| @@ -95,7 +95,7 @@ std::string cDetailView::LoadReruns(void) { | |||||||
|         if (list && (list->Count() > 1)) { |         if (list && (list->Count() > 1)) { | ||||||
|             foundRerun = true; |             foundRerun = true; | ||||||
|             int i = 0; |             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())) |                 if ((event->ChannelID() == r->event->ChannelID()) && (event->StartTime() == r->event->StartTime())) | ||||||
|                     continue; |                     continue; | ||||||
|                 i++; |                 i++; | ||||||
|   | |||||||
							
								
								
									
										20
									
								
								dummygrid.c
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								dummygrid.c
									
									
									
									
									
								
							| @@ -1,6 +1,6 @@ | |||||||
| #include "dummygrid.h" | #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->start = start; | ||||||
|     this->end = end; |     this->end = end; | ||||||
|     strText = tr("No EPG Information available"); |     strText = tr("No EPG Information available"); | ||||||
| @@ -27,7 +27,7 @@ void cDummyGrid::SetViewportHeight() { | |||||||
|  |  | ||||||
| void cDummyGrid::PositionPixmap() { | void cDummyGrid::PositionPixmap() { | ||||||
|     int x0, y0; |     int x0, y0; | ||||||
|     if (tvguideConfig.displayMode == eVertical) { |     if (config.displayMode == eVertical) { | ||||||
|         x0 = column->getX(); |         x0 = column->getX(); | ||||||
|         y0 = geoManager.statusHeaderHeight + geoManager.channelHeaderHeight + geoManager.channelGroupsHeight; |         y0 = geoManager.statusHeaderHeight + geoManager.channelHeaderHeight + geoManager.channelGroupsHeight; | ||||||
|         if ( column->Start() < StartTime() ) { |         if ( column->Start() < StartTime() ) { | ||||||
| @@ -41,7 +41,7 @@ void cDummyGrid::PositionPixmap() { | |||||||
|         } else { |         } else { | ||||||
|             pixmap->SetViewPort(cRect(x0, y0, geoManager.colWidth, viewportHeight)); |             pixmap->SetViewPort(cRect(x0, y0, geoManager.colWidth, viewportHeight)); | ||||||
|         } |         } | ||||||
|     } else if (tvguideConfig.displayMode == eHorizontal) { |     } else if (config.displayMode == eHorizontal) { | ||||||
|         x0 = geoManager.channelHeaderWidth + geoManager.channelGroupsWidth; |         x0 = geoManager.channelHeaderWidth + geoManager.channelGroupsWidth; | ||||||
|         y0 = column->getY(); |         y0 = column->getY(); | ||||||
|         if ( column->Start() < StartTime() ) { |         if ( column->Start() < StartTime() ) { | ||||||
| @@ -59,7 +59,7 @@ void cDummyGrid::PositionPixmap() { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cDummyGrid::setText() { | void cDummyGrid::setText() { | ||||||
|     if (tvguideConfig.displayMode == eVertical) { |     if (config.displayMode == eVertical) { | ||||||
|         text->Set(*strText, fontManager.FontGrid, geoManager.colWidth-2*borderWidth); |         text->Set(*strText, fontManager.FontGrid, geoManager.colWidth-2*borderWidth); | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @@ -67,13 +67,13 @@ void cDummyGrid::setText() { | |||||||
| void cDummyGrid::drawText() { | void cDummyGrid::drawText() { | ||||||
|     tColor colorText = (active)?theme.Color(clrFontActive):theme.Color(clrFont); |     tColor colorText = (active)?theme.Color(clrFontActive):theme.Color(clrFont); | ||||||
|     tColor colorTextBack; |     tColor colorTextBack; | ||||||
|     if (tvguideConfig.style == eStyleFlat) |     if (config.style == eStyleFlat) | ||||||
|         colorTextBack = color; |         colorTextBack = color; | ||||||
|     else if (tvguideConfig.style == eStyleGraphical) |     else if (config.style == eStyleGraphical) | ||||||
|         colorTextBack = (active)?theme.Color(clrGridActiveFontBack):theme.Color(clrGridFontBack); |         colorTextBack = (active)?theme.Color(clrGridActiveFontBack):theme.Color(clrGridFontBack); | ||||||
|     else |     else | ||||||
|         colorTextBack = clrTransparent; |         colorTextBack = clrTransparent; | ||||||
|     if (tvguideConfig.displayMode == eVertical) { |     if (config.displayMode == eVertical) { | ||||||
|         if (Height()/geoManager.minutePixel < 6) |         if (Height()/geoManager.minutePixel < 6) | ||||||
|             return; |             return; | ||||||
|         int textHeight = fontManager.FontGrid->Height(); |         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); |             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) { |         if (Width()/geoManager.minutePixel < 10) { | ||||||
|             int titleY = (geoManager.rowHeight - fontManager.FontGridHorizontal->Height())/2; |             int titleY = (geoManager.rowHeight - fontManager.FontGridHorizontal->Height())/2; | ||||||
|             pixmap->DrawText(cPoint(borderWidth - 2, titleY), "...", colorText, colorTextBack, fontManager.FontGridHorizontal); |             pixmap->DrawText(cPoint(borderWidth - 2, titleY), "...", colorText, colorTextBack, fontManager.FontGridHorizontal); | ||||||
| @@ -103,8 +103,8 @@ cString cDummyGrid::getTimeString(void) { | |||||||
| void cDummyGrid::debug() { | void cDummyGrid::debug() { | ||||||
|     esyslog("tvguide dummygrid: %s: %s, %s, viewportHeight: %d px, Duration: %ld min, active: %d",  |     esyslog("tvguide dummygrid: %s: %s, %s, viewportHeight: %d px, Duration: %ld min, active: %d",  | ||||||
|                 column->Name(), |                 column->Name(), | ||||||
|                 *cMyTime::printTime(start),  |                 *cTimeManager::printTime(start),  | ||||||
|                 *cMyTime::printTime(end),  |                 *cTimeManager::printTime(end),  | ||||||
|                 viewportHeight,  |                 viewportHeight,  | ||||||
|                 Duration()/60, |                 Duration()/60, | ||||||
|                 active); |                 active); | ||||||
|   | |||||||
							
								
								
									
										10
									
								
								dummygrid.h
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								dummygrid.h
									
									
									
									
									
								
							| @@ -1,12 +1,12 @@ | |||||||
| #ifndef __TVGUIDE_DUMMYGRID_H | #ifndef __TVGUIDE_DUMMYGRID_H | ||||||
| #define __TVGUIDE_DUMMYGRID_H | #define __TVGUIDE_DUMMYGRID_H | ||||||
|  |  | ||||||
| #include "grid.h" | #include "gridelement.h" | ||||||
| #include "channelcolumn.h" | #include "channelepg.h" | ||||||
|  |  | ||||||
| // --- cDummyGrid  ------------------------------------------------------------- | // --- cDummyGrid  ------------------------------------------------------------- | ||||||
|  |  | ||||||
| class cDummyGrid : public cGrid { | class cDummyGrid : public cGridElement { | ||||||
| private: | private: | ||||||
|     time_t start; |     time_t start; | ||||||
|     time_t end; |     time_t end; | ||||||
| @@ -14,7 +14,7 @@ private: | |||||||
|     void drawText(); |     void drawText(); | ||||||
|     time_t Duration(void); |     time_t Duration(void); | ||||||
| public: | public: | ||||||
|     cDummyGrid(cChannelColumn *c, time_t start, time_t end); |     cDummyGrid(cChannelEpg *c, time_t start, time_t end); | ||||||
|     virtual ~cDummyGrid(void); |     virtual ~cDummyGrid(void); | ||||||
|     void SetViewportHeight(); |     void SetViewportHeight(); | ||||||
|     void PositionPixmap(); |     void PositionPixmap(); | ||||||
| @@ -24,7 +24,7 @@ public: | |||||||
|     time_t EndTime() { return end; }; |     time_t EndTime() { return end; }; | ||||||
|     void SetStartTime(time_t start) { this->start = start; }; |     void SetStartTime(time_t start) { this->start = start; }; | ||||||
|     void SetEndTime(time_t end) { this->end = end; }; |     void SetEndTime(time_t end) { this->end = end; }; | ||||||
|     int calcOverlap(cGrid *neighbor); |     int calcOverlap(cGridElement *neighbor); | ||||||
|     void setTimer() {}; |     void setTimer() {}; | ||||||
|     cString getText(void); |     cString getText(void); | ||||||
|     cString getTimeString(void); |     cString getTimeString(void); | ||||||
|   | |||||||
							
								
								
									
										87
									
								
								epggrid.c
									
									
									
									
									
								
							
							
						
						
									
										87
									
								
								epggrid.c
									
									
									
									
									
								
							| @@ -1,9 +1,9 @@ | |||||||
| #include "services/remotetimers.h" | #include "services/remotetimers.h" | ||||||
| #include "channelcolumn.h" | #include "channelepg.h" | ||||||
| #include "tools.h" | #include "tools.h" | ||||||
| #include "epggrid.h" | #include "epggrid.h" | ||||||
|  |  | ||||||
| cEpgGrid::cEpgGrid(cChannelColumn *c, const cEvent *event)  : cGrid(c) { | cEpgGrid::cEpgGrid(cChannelEpg *c, const cEvent *event)  : cGridElement(c) { | ||||||
|     this->event = event; |     this->event = event; | ||||||
|     extText = new cTextWrapper(); |     extText = new cTextWrapper(); | ||||||
|     hasTimer = false; |     hasTimer = false; | ||||||
| @@ -33,7 +33,7 @@ void cEpgGrid::SetViewportHeight() { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cEpgGrid::PositionPixmap() { | void cEpgGrid::PositionPixmap() { | ||||||
|     if (tvguideConfig.displayMode == eVertical) { |     if (config.displayMode == eVertical) { | ||||||
|         int x0 = column->getX(); |         int x0 = column->getX(); | ||||||
|         int y0 = geoManager.statusHeaderHeight + geoManager.channelHeaderHeight + geoManager.channelGroupsHeight; |         int y0 = geoManager.statusHeaderHeight + geoManager.channelHeaderHeight + geoManager.channelGroupsHeight; | ||||||
|         if ( column->Start() < StartTime() ) { |         if ( column->Start() < StartTime() ) { | ||||||
| @@ -45,7 +45,7 @@ void cEpgGrid::PositionPixmap() { | |||||||
|         } else { |         } else { | ||||||
|             pixmap->SetViewPort(cRect(x0, y0, geoManager.colWidth, viewportHeight)); |             pixmap->SetViewPort(cRect(x0, y0, geoManager.colWidth, viewportHeight)); | ||||||
|         } |         } | ||||||
|     } else if (tvguideConfig.displayMode == eHorizontal) { |     } else if (config.displayMode == eHorizontal) { | ||||||
|         int x0 = geoManager.channelHeaderWidth + geoManager.channelGroupsWidth; |         int x0 = geoManager.channelHeaderWidth + geoManager.channelGroupsWidth; | ||||||
|         int y0 = column->getY(); |         int y0 = column->getY(); | ||||||
|         if ( column->Start() < StartTime() ) { |         if ( column->Start() < StartTime() ) { | ||||||
| @@ -63,7 +63,7 @@ void cEpgGrid::PositionPixmap() { | |||||||
|  |  | ||||||
| void cEpgGrid::SetTimer() { | void cEpgGrid::SetTimer() { | ||||||
|     hasTimer = false; |     hasTimer = false; | ||||||
|     if (tvguideConfig.useRemoteTimers && pRemoteTimers) { |     if (config.useRemoteTimers && pRemoteTimers) { | ||||||
|         RemoteTimers_Event_v1_0 rt; |         RemoteTimers_Event_v1_0 rt; | ||||||
|         rt.event = event; |         rt.event = event; | ||||||
|         if (pRemoteTimers->Service("RemoteTimers::GetTimerByEvent-v1.0", &rt)) |         if (pRemoteTimers->Service("RemoteTimers::GetTimerByEvent-v1.0", &rt)) | ||||||
| @@ -91,54 +91,53 @@ void cEpgGrid::SetSwitchTimer() { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cEpgGrid::setText() { | void cEpgGrid::setText() { | ||||||
|     if (tvguideConfig.displayMode == eVertical) { |     if (config.displayMode == eVertical) { | ||||||
|         cString strText; |         text->Set(event->Title(), fontManager.FontGrid, geoManager.colWidth - 2 * borderWidth); | ||||||
|         strText = cString::sprintf("%s - %s:\n%s", *(event->GetTimeString()), *(event->GetEndTimeString()), event->Title()); |         extText->Set(event->ShortText(), fontManager.FontGridSmall, geoManager.colWidth - 2 * borderWidth); | ||||||
|         text->Set(*(strText), fontManager.FontGrid, geoManager.colWidth-2*borderWidth); |     } | ||||||
|         extText->Set(event->ShortText(), fontManager.FontGridSmall, geoManager.colWidth-2*borderWidth); |     if (config.showTimeInGrid) { | ||||||
|     } else if (tvguideConfig.displayMode == eHorizontal) { |         timeString = cString::sprintf("%s - %s:", *(event->GetTimeString()), *(event->GetEndTimeString())); | ||||||
|         timeString = cString::sprintf("%s - %s", *(event->GetTimeString()), *(event->GetEndTimeString())); |  | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| void cEpgGrid::drawText() { | void cEpgGrid::drawText() { | ||||||
|     tColor colorText = (active)?theme.Color(clrFontActive):theme.Color(clrFont); |     tColor colorText = (active) ? theme.Color(clrFontActive) : theme.Color(clrFont); | ||||||
|     tColor colorTextBack; |     tColor colorTextBack; | ||||||
|     if (tvguideConfig.style == eStyleFlat) |     if (config.style == eStyleFlat) | ||||||
|         colorTextBack = color; |         colorTextBack = color; | ||||||
|     else if (tvguideConfig.style == eStyleGraphical) |     else if (config.style == eStyleGraphical) | ||||||
|         colorTextBack = (active)?theme.Color(clrGridActiveFontBack):theme.Color(clrGridFontBack); |         colorTextBack = (active) ? theme.Color(clrGridActiveFontBack) : theme.Color(clrGridFontBack); | ||||||
|     else |     else | ||||||
|         colorTextBack = clrTransparent; |         colorTextBack = clrTransparent; | ||||||
|     if (tvguideConfig.displayMode == eVertical) { |     if (config.displayMode == eVertical) { | ||||||
|         if (Height()/geoManager.minutePixel < 6) |         if (Height() / geoManager.minutePixel < 6) | ||||||
|             return; |             return; | ||||||
|         int textHeight = fontManager.FontGrid->Height(); |         int textHeight = fontManager.FontGrid->Height(); | ||||||
|  |         int textHeightSmall = fontManager.FontGridSmall->Height(); | ||||||
|         int textLines = text->Lines(); |         int textLines = text->Lines(); | ||||||
|         for (int i=0; i<textLines; i++) { |         int titleY = borderWidth; | ||||||
|             pixmap->DrawText(cPoint(borderWidth, borderWidth + i*textHeight), text->GetLine(i), colorText, colorTextBack, fontManager.FontGrid); |         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 extTextLines = extText->Lines(); | ||||||
|         int offset = (textLines+1)*textHeight - 0.5*textHeight; |         int offset = titleY + (textLines + 0.5) * textHeight; | ||||||
|         textHeight = fontManager.FontGridSmall->Height(); |         if ((Height() - textHeightSmall - 10) > offset) { | ||||||
|         if ((Height()-textHeight-10) > offset) { |             for (int i = 0; i < extTextLines; i++) { | ||||||
|             for (int i=0; i<extTextLines; i++) { |                 pixmap->DrawText(cPoint(borderWidth, offset + i * textHeightSmall), extText->GetLine(i), colorText, colorTextBack, fontManager.FontGridSmall); | ||||||
|                 pixmap->DrawText(cPoint(borderWidth, borderWidth + offset + i*textHeight), extText->GetLine(i), colorText, colorTextBack, fontManager.FontGridSmall); |  | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } else if (tvguideConfig.displayMode == eHorizontal) { |     } else if (config.displayMode == eHorizontal) { | ||||||
|         if (Width()/geoManager.minutePixel < 10) { |         cString strTitle = CutText(event->Title(), viewportHeight - borderWidth, fontManager.FontGridHorizontal).c_str(); | ||||||
|             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; |         int titleY = 0; | ||||||
|         if (tvguideConfig.showTimeInGrid) { |         if (config.showTimeInGrid) { // mit Zeitangabe im Grid | ||||||
|             pixmap->DrawText(cPoint(borderWidth, borderWidth), *timeString, colorText, colorTextBack, fontManager.FontGridHorizontalSmall); |             pixmap->DrawText(cPoint(borderWidth, borderWidth), *timeString, colorText, colorTextBack, fontManager.FontGridHorizontalSmall); | ||||||
|             titleY = fontManager.FontGridHorizontalSmall->Height() + (geoManager.rowHeight - fontManager.FontGridHorizontalSmall->Height() - fontManager.FontGridHorizontal->Height())/2; |             titleY = fontManager.FontGridHorizontalSmall->Height() + (geoManager.rowHeight - fontManager.FontGridHorizontalSmall->Height() - fontManager.FontGridHorizontal->Height()) / 2; | ||||||
|         } else { |         } else { | ||||||
|             titleY = (geoManager.rowHeight - fontManager.FontGridHorizontal->Height())/2; |             titleY = (geoManager.rowHeight - fontManager.FontGridHorizontal->Height()) / 2; | ||||||
|         } |         } | ||||||
|         pixmap->DrawText(cPoint(borderWidth, titleY), *strTitle, colorText, colorTextBack, fontManager.FontGridHorizontal); |         pixmap->DrawText(cPoint(borderWidth, titleY), *strTitle, colorText, colorTextBack, fontManager.FontGridHorizontal); | ||||||
|     } |     } | ||||||
| @@ -170,13 +169,17 @@ void cEpgGrid::drawText() { | |||||||
|  |  | ||||||
| void cEpgGrid::drawIcon(cString iconText, tColor color) { | void cEpgGrid::drawIcon(cString iconText, tColor color) { | ||||||
|  |  | ||||||
|     const cFont *font = (tvguideConfig.displayMode == eVertical) |     const cFont *font = (config.displayMode == eVertical) ? fontManager.FontGrid : fontManager.FontGridHorizontalSmall; | ||||||
|                         ?fontManager.FontGrid |     int textWidth = font->Width(*iconText) + 2 * borderWidth; | ||||||
|                         :fontManager.FontGridHorizontalSmall; |     int textHeight = font->Height() + 10; | ||||||
|     int textWidth = font->Width(*iconText)+2*borderWidth; |     if ((config.displayMode == eHorizontal) && ((Width() - 2 * textWidth) < 0)) | ||||||
|     int textHeight = font->Height()+10; |         pixmap->DrawEllipse( cRect(Width() - textHeight / 2 - borderWidth, Height() - textHeight - borderWidth, textHeight / 2, textHeight / 2), color); | ||||||
|     pixmap->DrawRectangle( cRect(Width() - textWidth - borderWidth, Height() - textHeight - borderWidth, textWidth, textHeight), color); |     else if ((config.displayMode == eVertical) && ((Height() - 2 * textHeight) < 0)) | ||||||
|     pixmap->DrawText(cPoint(Width() - textWidth, Height() - textHeight - borderWidth/2), *iconText, theme.Color(clrFont), color, font); |         pixmap->DrawEllipse( cRect(Width() - textHeight / 2 - borderWidth, borderWidth, textHeight / 2, textHeight / 2), color); | ||||||
|  |     else { | ||||||
|  |         pixmap->DrawEllipse( cRect(Width() - textWidth - borderWidth, Height() - textHeight - borderWidth, textWidth, textHeight), color); | ||||||
|  |         pixmap->DrawText(cPoint(Width() - textWidth, Height() - textHeight - borderWidth / 2), *iconText, theme.Color(clrFont), clrTransparent, font); | ||||||
|  |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| cString cEpgGrid::getTimeString(void) { | cString cEpgGrid::getTimeString(void) { | ||||||
|   | |||||||
| @@ -2,11 +2,11 @@ | |||||||
| #define __TVGUIDE_EPGGRID_H | #define __TVGUIDE_EPGGRID_H | ||||||
|  |  | ||||||
| #include <vdr/epg.h> | #include <vdr/epg.h> | ||||||
| #include "grid.h" | #include "gridelement.h" | ||||||
|  |  | ||||||
| // --- cEpgGrid  ------------------------------------------------------------- | // --- cEpgGrid  ------------------------------------------------------------- | ||||||
|  |  | ||||||
| class cEpgGrid : public cGrid { | class cEpgGrid : public cGridElement { | ||||||
| private: | private: | ||||||
|     const cTimer *timer; |     const cTimer *timer; | ||||||
|     const cEvent *event; |     const cEvent *event; | ||||||
| @@ -16,7 +16,7 @@ private: | |||||||
|     void drawIcon(cString iconText, tColor color); |     void drawIcon(cString iconText, tColor color); | ||||||
|     time_t Duration(void) { return event->Duration(); }; |     time_t Duration(void) { return event->Duration(); }; | ||||||
| public: | public: | ||||||
|     cEpgGrid(cChannelColumn *c, const cEvent *event); |     cEpgGrid(cChannelEpg *c, const cEvent *event); | ||||||
|     virtual ~cEpgGrid(void); |     virtual ~cEpgGrid(void); | ||||||
|     void SetViewportHeight(); |     void SetViewportHeight(); | ||||||
|     void PositionPixmap(); |     void PositionPixmap(); | ||||||
|   | |||||||
| @@ -12,34 +12,34 @@ cFontManager::~cFontManager() { | |||||||
| void cFontManager::SetFonts() { | void cFontManager::SetFonts() { | ||||||
|     InitialiseFontType(); |     InitialiseFontType(); | ||||||
|     //Common Fonts |     //Common Fonts | ||||||
|     FontButton = CreateFont(geoManager.footerHeight/3 + 4 + tvguideConfig.FontButtonDelta); |     FontButton = CreateFont(geoManager.footerHeight/3 + 4 + config.FontButtonDelta); | ||||||
|     FontDetailView = CreateFont(geoManager.osdHeight/30 + tvguideConfig.FontDetailViewDelta); |     FontDetailView = CreateFont(geoManager.osdHeight/30 + config.FontDetailViewDelta); | ||||||
|     FontDetailViewSmall = CreateFont(geoManager.osdHeight/40 + tvguideConfig.FontDetailViewSmallDelta); |     FontDetailViewSmall = CreateFont(geoManager.osdHeight/40 + config.FontDetailViewSmallDelta); | ||||||
|     FontDetailHeader = CreateFont(geoManager.osdHeight/27 + tvguideConfig.FontDetailHeaderDelta); |     FontDetailHeader = CreateFont(geoManager.osdHeight/27 + config.FontDetailHeaderDelta); | ||||||
|     FontDetailHeaderLarge = CreateFont(geoManager.osdHeight/20 + tvguideConfig.FontDetailHeaderDelta); |     FontDetailHeaderLarge = CreateFont(geoManager.osdHeight/20 + config.FontDetailHeaderDelta); | ||||||
|     FontMessageBox = CreateFont(geoManager.osdHeight/33 + tvguideConfig.FontMessageBoxDelta); |     FontMessageBox = CreateFont(geoManager.osdHeight/33 + config.FontMessageBoxDelta); | ||||||
|     FontMessageBoxLarge = CreateFont(geoManager.osdHeight/30 + tvguideConfig.FontMessageBoxLargeDelta);     |     FontMessageBoxLarge = CreateFont(geoManager.osdHeight/30 + config.FontMessageBoxLargeDelta);     | ||||||
|     FontStatusHeader = CreateFont(geoManager.statusHeaderHeight/6 - 4 + tvguideConfig.FontStatusHeaderDelta); |     FontStatusHeader = CreateFont(geoManager.statusHeaderHeight/6 - 4 + config.FontStatusHeaderDelta); | ||||||
|     FontStatusHeaderLarge = CreateFont(geoManager.statusHeaderHeight/5 + tvguideConfig.FontStatusHeaderLargeDelta); |     FontStatusHeaderLarge = CreateFont(geoManager.statusHeaderHeight/5 + config.FontStatusHeaderLargeDelta); | ||||||
|     //Fonts for vertical Display  |     //Fonts for vertical Display  | ||||||
|     FontChannelHeader = CreateFont(geoManager.colWidth/10 + tvguideConfig.FontChannelHeaderDelta); |     FontChannelHeader = CreateFont(geoManager.colWidth/10 + config.FontChannelHeaderDelta); | ||||||
|     FontChannelGroups = CreateFont(geoManager.colWidth/8 + tvguideConfig.FontChannelGroupsDelta); |     FontChannelGroups = CreateFont(geoManager.colWidth/8 + config.FontChannelGroupsDelta); | ||||||
|     FontGrid = CreateFont(geoManager.colWidth/12 + tvguideConfig.FontGridDelta); |     FontGrid = CreateFont(geoManager.colWidth/12 + config.FontGridDelta); | ||||||
|     FontGridSmall = CreateFont(geoManager.colWidth/12 + tvguideConfig.FontGridSmallDelta); |     FontGridSmall = CreateFont(geoManager.colWidth/12 + config.FontGridSmallDelta); | ||||||
|     FontTimeLineWeekday = CreateFont(geoManager.timeLineWidth/3 + tvguideConfig.FontTimeLineWeekdayDelta); |     FontTimeLineWeekday = CreateFont(geoManager.timeLineWidth/3 + config.FontTimeLineWeekdayDelta); | ||||||
|     FontTimeLineDate = CreateFont(geoManager.timeLineWidth/4 + tvguideConfig.FontTimeLineDateDelta); |     FontTimeLineDate = CreateFont(geoManager.timeLineWidth/4 + config.FontTimeLineDateDelta); | ||||||
|     FontTimeLineTime = CreateFont(geoManager.timeLineWidth/4 + tvguideConfig.FontTimeLineTimeDelta); |     FontTimeLineTime = CreateFont(geoManager.timeLineWidth/4 + config.FontTimeLineTimeDelta); | ||||||
|     //Fonts for horizontal Display  |     //Fonts for horizontal Display  | ||||||
|     FontChannelHeaderHorizontal = CreateFont(geoManager.rowHeight/3 + tvguideConfig.FontChannelHeaderHorizontalDelta); |     FontChannelHeaderHorizontal = CreateFont(geoManager.rowHeight/3 + config.FontChannelHeaderHorizontalDelta); | ||||||
|     FontChannelGroupsHorizontal = CreateFont(geoManager.rowHeight/3 + 5 + tvguideConfig.FontChannelGroupsHorizontalDelta); |     FontChannelGroupsHorizontal = CreateFont(geoManager.rowHeight/3 + 5 + config.FontChannelGroupsHorizontalDelta); | ||||||
|     FontGridHorizontal = CreateFont(geoManager.rowHeight/3 + 5 + tvguideConfig.FontGridHorizontalDelta); |     FontGridHorizontal = CreateFont(geoManager.rowHeight/3 + 5 + config.FontGridHorizontalDelta); | ||||||
|     FontGridHorizontalSmall = CreateFont(geoManager.rowHeight/4 + tvguideConfig.FontGridHorizontalSmallDelta); |     FontGridHorizontalSmall = CreateFont(geoManager.rowHeight/4 + config.FontGridHorizontalSmallDelta); | ||||||
|     FontTimeLineDateHorizontal = CreateFont(geoManager.timeLineHeight/2 + 5 + tvguideConfig.FontTimeLineDateHorizontalDelta); |     FontTimeLineDateHorizontal = CreateFont(geoManager.timeLineHeight/2 + 5 + config.FontTimeLineDateHorizontalDelta); | ||||||
|     FontTimeLineTimeHorizontal = CreateFont(geoManager.timeLineHeight/2 + tvguideConfig.FontTimeLineTimeHorizontalDelta); |     FontTimeLineTimeHorizontal = CreateFont(geoManager.timeLineHeight/2 + config.FontTimeLineTimeHorizontalDelta); | ||||||
|     //Fonts for RecMenu |     //Fonts for RecMenu | ||||||
|     FontRecMenuItem = CreateFont(geoManager.osdHeight/30 + tvguideConfig.FontRecMenuItemDelta); |     FontRecMenuItem = CreateFont(geoManager.osdHeight/30 + config.FontRecMenuItemDelta); | ||||||
|     FontRecMenuItemSmall = CreateFont(geoManager.osdHeight/40 + tvguideConfig.FontRecMenuItemSmallDelta); |     FontRecMenuItemSmall = CreateFont(geoManager.osdHeight/40 + config.FontRecMenuItemSmallDelta); | ||||||
|     FontRecMenuItemLarge = CreateFont(geoManager.osdHeight/25 + tvguideConfig.FontRecMenuItemLargeDelta); |     FontRecMenuItemLarge = CreateFont(geoManager.osdHeight/25 + config.FontRecMenuItemLargeDelta); | ||||||
| } | } | ||||||
|  |  | ||||||
| void cFontManager::DeleteFonts() { | void cFontManager::DeleteFonts() { | ||||||
| @@ -71,15 +71,15 @@ void cFontManager::DeleteFonts() { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cFontManager::InitialiseFontType(void) { | void cFontManager::InitialiseFontType(void) { | ||||||
|     if (tvguideConfig.fontIndex == 0) { |     if (config.fontIndex == 0) { | ||||||
|         fontName = tvguideConfig.fontNameDefault; |         fontName = config.fontNameDefault; | ||||||
|     } else { |     } else { | ||||||
|         cStringList availableFonts; |         cStringList availableFonts; | ||||||
|         cFont::GetAvailableFontNames(&availableFonts); |         cFont::GetAvailableFontNames(&availableFonts); | ||||||
|         if (availableFonts[tvguideConfig.fontIndex-1]) { |         if (availableFonts[config.fontIndex-1]) { | ||||||
|             fontName = availableFonts[tvguideConfig.fontIndex-1]; |             fontName = availableFonts[config.fontIndex-1]; | ||||||
|         } else  |         } else  | ||||||
|             fontName = tvguideConfig.fontNameDefault; |             fontName = config.fontNameDefault; | ||||||
|     } |     } | ||||||
|     cFont *test = NULL; |     cFont *test = NULL; | ||||||
|     test = cFont::CreateFont(*fontName, 30); |     test = cFont::CreateFont(*fontName, 30); | ||||||
|   | |||||||
							
								
								
									
										24
									
								
								footer.c
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								footer.c
									
									
									
									
									
								
							| @@ -26,7 +26,7 @@ void cFooter::drawRedButton() { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cFooter::drawGreenButton() { | void cFooter::drawGreenButton() { | ||||||
|     cString text = cString::sprintf("%d %s", tvguideConfig.jumpChannels, tr("Channels back")); |     cString text = cString::sprintf("%d %s", config.jumpChannels, tr("Channels back")); | ||||||
|     DrawButton(*text, theme.Color(clrButtonGreen), theme.Color(clrButtonGreenBorder), oeButtonGreen, positionButtons[1]); |     DrawButton(*text, theme.Color(clrButtonGreen), theme.Color(clrButtonGreenBorder), oeButtonGreen, positionButtons[1]); | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -36,7 +36,7 @@ void cFooter::drawGreenButton(const char *text) { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cFooter::drawYellowButton() { | void cFooter::drawYellowButton() { | ||||||
|     cString text = cString::sprintf("%d %s", tvguideConfig.jumpChannels, tr("Channels forward")); |     cString text = cString::sprintf("%d %s", config.jumpChannels, tr("Channels forward")); | ||||||
|     DrawButton(*text, theme.Color(clrButtonYellow), theme.Color(clrButtonYellowBorder), oeButtonYellow, positionButtons[2]); |     DrawButton(*text, theme.Color(clrButtonYellow), theme.Color(clrButtonYellowBorder), oeButtonYellow, positionButtons[2]); | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -47,14 +47,14 @@ void cFooter::drawYellowButton(const char *text) { | |||||||
|  |  | ||||||
| void cFooter::drawBlueButton(bool detailedEPG) { | void cFooter::drawBlueButton(bool detailedEPG) { | ||||||
|     cString text; |     cString text; | ||||||
|     if (tvguideConfig.blueKeyMode == eBlueKeySwitch) |     if (config.blueKeyMode == eBlueKeySwitch) | ||||||
|         text = tr("Switch to Channel"); |         text = tr("Switch to Channel"); | ||||||
|     else if (tvguideConfig.blueKeyMode == eBlueKeyEPG) { |     else if (config.blueKeyMode == eBlueKeyEPG) { | ||||||
|         if (!detailedEPG) |         if (!detailedEPG) | ||||||
|             text = tr("Detailed EPG"); |             text = tr("Detailed EPG"); | ||||||
|         else |         else | ||||||
|             text = tr("Close detailed EPG"); |             text = tr("Close detailed EPG"); | ||||||
|     } else if (tvguideConfig.blueKeyMode == eBlueKeyFavorites) { |     } else if (config.blueKeyMode == eBlueKeyFavorites) { | ||||||
|         if (!detailedEPG) |         if (!detailedEPG) | ||||||
|             text = tr("Favorites"); |             text = tr("Favorites"); | ||||||
|         else |         else | ||||||
| @@ -80,7 +80,7 @@ void cFooter::SetDetailedViewMode(bool fromRecMenu) { | |||||||
|     if (fromRecMenu) { |     if (fromRecMenu) { | ||||||
|         ClearButton(positionButtons[0]); |         ClearButton(positionButtons[0]); | ||||||
|         ClearButton(positionButtons[3]); |         ClearButton(positionButtons[3]); | ||||||
|     } else if (tvguideConfig.blueKeyMode != eBlueKeySwitch) { |     } else if (config.blueKeyMode != eBlueKeySwitch) { | ||||||
|         ClearButton(positionButtons[3]); |         ClearButton(positionButtons[3]); | ||||||
|         drawBlueButton(true); |         drawBlueButton(true); | ||||||
|     } |     } | ||||||
| @@ -89,7 +89,7 @@ void cFooter::SetDetailedViewMode(bool fromRecMenu) { | |||||||
| void cFooter::LeaveDetailedViewMode(const cChannel *channel) { | void cFooter::LeaveDetailedViewMode(const cChannel *channel) { | ||||||
|     drawRedButton(); |     drawRedButton(); | ||||||
|     drawBlueButton(); |     drawBlueButton(); | ||||||
|     if (tvguideConfig.channelJumpMode == eNumJump) { |     if (config.channelJumpMode == eNumJump) { | ||||||
|         drawGreenButton(); |         drawGreenButton(); | ||||||
|         drawYellowButton(); |         drawYellowButton(); | ||||||
|     } else { |     } else { | ||||||
| @@ -128,20 +128,20 @@ void cFooter::SetButtonPositions(void) { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cFooter::DrawButton(const char *text, tColor color, tColor borderColor, eOsdElementType buttonType, int num) { | void cFooter::DrawButton(const char *text, tColor color, tColor borderColor, eOsdElementType buttonType, int num) { | ||||||
|     tColor colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent; |     tColor colorTextBack = (config.style == eStyleFlat)?color:clrTransparent; | ||||||
|     int left = num * geoManager.buttonWidth + (2 * num + 1) * geoManager.buttonBorder; |     int left = num * geoManager.buttonWidth + (2 * num + 1) * geoManager.buttonBorder; | ||||||
|  |  | ||||||
|     if ((tvguideConfig.style == eStyleBlendingMagick) || (tvguideConfig.style == eStyleBlendingDefault)) { |     if ((config.style == eStyleBlendingMagick) || (config.style == eStyleBlendingDefault)) { | ||||||
|         cImageLoader imgLoader; |         cImageLoader imgLoader; | ||||||
|         imgLoader.DrawBackground(theme.Color(clrButtonBlend), color, geoManager.buttonWidth-4, geoManager.buttonHeight-4); |         imgLoader.DrawBackground(theme.Color(clrButtonBlend), color, geoManager.buttonWidth-4, geoManager.buttonHeight-4); | ||||||
|         footer->DrawRectangle(cRect(left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight), borderColor); |         footer->DrawRectangle(cRect(left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight), borderColor); | ||||||
|         footer->DrawImage(cPoint(left+2, buttonY+2), imgLoader.GetImage());     |         footer->DrawImage(cPoint(left+2, buttonY+2), imgLoader.GetImage());     | ||||||
|         if (tvguideConfig.roundedCorners) { |         if (config.roundedCorners) { | ||||||
|             int borderRadius = 12; |             int borderRadius = 12; | ||||||
|             int borderWidth = 2; |             int borderWidth = 2; | ||||||
|             DrawRoundedCorners(footer, left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight, borderRadius, borderWidth, borderColor); |             DrawRoundedCorners(footer, left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight, borderRadius, borderWidth, borderColor); | ||||||
|         } |         } | ||||||
|     } else if (tvguideConfig.style == eStyleGraphical) { |     } else if (config.style == eStyleGraphical) { | ||||||
|         cImage *button = imgCache.GetOsdElement(buttonType); |         cImage *button = imgCache.GetOsdElement(buttonType); | ||||||
|         if (button) { |         if (button) { | ||||||
|             footer->DrawImage(cPoint(left, buttonY), *button);     |             footer->DrawImage(cPoint(left, buttonY), *button);     | ||||||
| @@ -149,7 +149,7 @@ void cFooter::DrawButton(const char *text, tColor color, tColor borderColor, eOs | |||||||
|     } else { |     } else { | ||||||
|         footer->DrawRectangle(cRect(left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight), borderColor);  |         footer->DrawRectangle(cRect(left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight), borderColor);  | ||||||
|         footer->DrawRectangle(cRect(left+1, buttonY+1, geoManager.buttonWidth-2, geoManager.buttonHeight-2), color); |         footer->DrawRectangle(cRect(left+1, buttonY+1, geoManager.buttonWidth-2, geoManager.buttonHeight-2), color); | ||||||
|         if (tvguideConfig.roundedCorners) { |         if (config.roundedCorners) { | ||||||
|             int borderRadius = 12; |             int borderRadius = 12; | ||||||
|             int borderWidth = 1; |             int borderWidth = 1; | ||||||
|             DrawRoundedCorners(footer, left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight, borderRadius, borderWidth, borderColor); |             DrawRoundedCorners(footer, left, buttonY, geoManager.buttonWidth, geoManager.buttonHeight, borderRadius, borderWidth, borderColor); | ||||||
|   | |||||||
| @@ -20,39 +20,39 @@ bool cGeometryManager::SetGeometry(int osdWidth, int osdHeight, bool force) { | |||||||
| 	this->osdHeight = osdHeight; | 	this->osdHeight = osdHeight; | ||||||
| 	esyslog("tvguide: Set OSD to %d x %d px", osdWidth, osdHeight); | 	esyslog("tvguide: Set OSD to %d x %d px", osdWidth, osdHeight); | ||||||
|  |  | ||||||
| 	statusHeaderHeight = (tvguideConfig.displayStatusHeader)?(tvguideConfig.headerHeightPercent * osdHeight / 100):0; | 	statusHeaderHeight = (config.displayStatusHeader) ? (config.headerHeightPercent * osdHeight / 100):0; | ||||||
|     tvFrameWidth = statusHeaderHeight * 16 / 9; |     tvFrameWidth = statusHeaderHeight * 16 / 9; | ||||||
|     headerContentWidth = (tvguideConfig.scaleVideo)?(osdWidth -  tvFrameWidth):osdWidth; |     headerContentWidth = (config.scaleVideo) ? (osdWidth -  tvFrameWidth):osdWidth; | ||||||
|     channelGroupsWidth = (tvguideConfig.displayChannelGroups)?(tvguideConfig.channelGroupsPercent * osdWidth / 100):0; |     channelGroupsWidth = (config.displayChannelGroups) ? (config.channelGroupsPercent * osdWidth / 100):0; | ||||||
|     channelGroupsHeight = (tvguideConfig.displayChannelGroups)?(tvguideConfig.channelGroupsPercent * osdHeight / 100):0; |     channelGroupsHeight = (config.displayChannelGroups) ? (config.channelGroupsPercent * osdHeight / 100):0; | ||||||
|     channelHeaderWidth = tvguideConfig.channelHeaderWidthPercent * osdWidth / 100; |     channelHeaderWidth = config.channelHeaderWidthPercent * osdWidth / 100; | ||||||
|     channelHeaderHeight = tvguideConfig.channelHeaderHeightPercent * osdHeight / 100; |     channelHeaderHeight = config.channelHeaderHeightPercent * osdHeight / 100; | ||||||
|     timeLineWidth = tvguideConfig.timeLineWidthPercent * osdWidth / 100; |     timeLineWidth = config.timeLineWidthPercent * osdWidth / 100; | ||||||
|     timeLineHeight = tvguideConfig.timeLineHeightPercent * osdHeight / 100; |     timeLineHeight = config.timeLineHeightPercent * osdHeight / 100; | ||||||
|     footerHeight = tvguideConfig.footerHeightPercent * osdHeight / 100; |     footerHeight = config.footerHeightPercent * osdHeight / 100; | ||||||
|     footerY = osdHeight - footerHeight; |     footerY = osdHeight - footerHeight; | ||||||
|  |  | ||||||
|     if (tvguideConfig.displayMode == eVertical) { |     if (config.displayMode == eVertical) { | ||||||
|         colWidth = (osdWidth - timeLineWidth) / tvguideConfig.channelCols; |         colWidth = (osdWidth - timeLineWidth) / config.channelCols; | ||||||
|         rowHeight = 0; |         rowHeight = 0; | ||||||
|         minutePixel = (osdHeight - statusHeaderHeight - channelGroupsHeight - channelHeaderHeight - footerHeight) / tvguideConfig.displayTime; |         minutePixel = (double)(osdHeight - statusHeaderHeight - channelGroupsHeight - channelHeaderHeight - footerHeight) / (double)config.displayTime; | ||||||
|         channelLogoWidth = colWidth; |         channelLogoWidth = colWidth; | ||||||
|         channelLogoHeight = channelHeaderHeight; |         channelLogoHeight = channelHeaderHeight; | ||||||
|         logoWidth = channelLogoWidth/2 - 15; |         logoWidth = channelLogoWidth / 2 - 15; | ||||||
|         logoHeight = logoWidth * tvguideConfig.logoHeightRatio / tvguideConfig.logoWidthRatio; |         logoHeight = logoWidth * config.logoHeightRatio / config.logoWidthRatio; | ||||||
|         timeLineGridWidth = timeLineWidth; |         timeLineGridWidth = timeLineWidth; | ||||||
|         timeLineGridHeight = minutePixel * 30; |         timeLineGridHeight = minutePixel * 30; | ||||||
|         dateVieverWidth = timeLineWidth; |         dateVieverWidth = timeLineWidth; | ||||||
|         dateVieverHeight = (channelHeaderHeight + channelGroupsHeight) * 2 / 3; |         dateVieverHeight = (channelHeaderHeight + channelGroupsHeight) * 2 / 3; | ||||||
|         clockWidth = dateVieverWidth; |         clockWidth = dateVieverWidth; | ||||||
|         clockHeight = (channelHeaderHeight + channelGroupsHeight) - dateVieverHeight; |         clockHeight = (channelHeaderHeight + channelGroupsHeight) - dateVieverHeight; | ||||||
|     } else if (tvguideConfig.displayMode == eHorizontal) { |     } else if (config.displayMode == eHorizontal) { | ||||||
|         colWidth = 0; |         colWidth = 0; | ||||||
|         rowHeight = (osdHeight - statusHeaderHeight - timeLineHeight - footerHeight) / tvguideConfig.channelRows; |         rowHeight = (osdHeight - statusHeaderHeight - timeLineHeight - footerHeight) / config.channelRows; | ||||||
|         minutePixel = (osdWidth - channelHeaderWidth - channelGroupsWidth) / tvguideConfig.displayHorizontalTime; |         minutePixel = (double)(osdWidth - channelHeaderWidth - channelGroupsWidth) / (double)config.displayHorizontalTime; | ||||||
|         channelLogoWidth = channelHeaderWidth; |         channelLogoWidth = channelHeaderWidth; | ||||||
|         channelLogoHeight = rowHeight; |         channelLogoHeight = rowHeight; | ||||||
|         logoWidth = channelLogoHeight * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio; |         logoWidth = channelLogoHeight * config.logoWidthRatio / config.logoHeightRatio; | ||||||
|         logoHeight = channelLogoHeight; |         logoHeight = channelLogoHeight; | ||||||
|         timeLineGridWidth = geoManager.minutePixel * 30; |         timeLineGridWidth = geoManager.minutePixel * 30; | ||||||
|         timeLineGridHeight = geoManager.timeLineHeight; |         timeLineGridHeight = geoManager.timeLineHeight; | ||||||
| @@ -65,7 +65,7 @@ bool cGeometryManager::SetGeometry(int osdWidth, int osdHeight, bool force) { | |||||||
|     buttonWidth = osdWidth / 4 - 2 * buttonBorder; |     buttonWidth = osdWidth / 4 - 2 * buttonBorder; | ||||||
|     buttonHeight = footerHeight - 3 * buttonBorder; |     buttonHeight = footerHeight - 3 * buttonBorder; | ||||||
|  |  | ||||||
|     epgViewHeaderHeight = tvguideConfig.headerHeightPercent * osdHeight / 100; |     epgViewHeaderHeight = config.headerHeightPercent * osdHeight / 100; | ||||||
|  |  | ||||||
|     borderRecMenus = 10; |     borderRecMenus = 10; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -24,7 +24,7 @@ public: | |||||||
|     //Content |     //Content | ||||||
|     int colWidth; |     int colWidth; | ||||||
|     int rowHeight; |     int rowHeight; | ||||||
|     int minutePixel; |     double minutePixel; | ||||||
|     int channelLogoWidth; |     int channelLogoWidth; | ||||||
|     int channelLogoHeight; |     int channelLogoHeight; | ||||||
|     //Timeline |     //Timeline | ||||||
|   | |||||||
| @@ -1,7 +1,7 @@ | |||||||
| #include "channelcolumn.h" | #include "channelepg.h" | ||||||
| #include "grid.h" | #include "gridelement.h" | ||||||
| 
 | 
 | ||||||
| cGrid::cGrid(cChannelColumn *c) { | cGridElement::cGridElement(cChannelEpg *c) { | ||||||
|     this->column = c; |     this->column = c; | ||||||
|     text = new cTextWrapper(); |     text = new cTextWrapper(); | ||||||
|     dirty = true; |     dirty = true; | ||||||
| @@ -10,11 +10,11 @@ cGrid::cGrid(cChannelColumn *c) { | |||||||
|     borderWidth = 10; |     borderWidth = 10; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| cGrid::~cGrid(void) { | cGridElement::~cGridElement(void) { | ||||||
|     delete text; |     delete text; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void cGrid::setBackground() { | void cGridElement::setBackground() { | ||||||
|     if (active) { |     if (active) { | ||||||
|         color = theme.Color(clrHighlight); |         color = theme.Color(clrHighlight); | ||||||
|         colorBlending = theme.Color(clrHighlightBlending); |         colorBlending = theme.Color(clrHighlightBlending); | ||||||
| @@ -29,12 +29,12 @@ void cGrid::setBackground() { | |||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void cGrid::Draw() { | void cGridElement::Draw() { | ||||||
|     if (!pixmap) { |     if (!pixmap) { | ||||||
|         return; |         return; | ||||||
|     } |     } | ||||||
|     if (dirty) { |     if (dirty) { | ||||||
|         if (tvguideConfig.style == eStyleGraphical) { |         if (config.style == eStyleGraphical) { | ||||||
|             drawBackgroundGraphical(bgGrid, active); |             drawBackgroundGraphical(bgGrid, active); | ||||||
|             drawText(); |             drawText(); | ||||||
|         } else { |         } else { | ||||||
| @@ -48,20 +48,20 @@ void cGrid::Draw() { | |||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| bool cGrid::isFirst(void) { | bool cGridElement::isFirst(void) { | ||||||
|     if (column->isFirst(this)) |     if (column->isFirst(this)) | ||||||
|         return true; |         return true; | ||||||
|     return false; |     return false; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| bool cGrid::Match(time_t t) { | bool cGridElement::Match(time_t t) { | ||||||
|     if ((StartTime() < t) && (EndTime() > t)) |     if ((StartTime() < t) && (EndTime() > t)) | ||||||
|         return true; |         return true; | ||||||
|     else |     else | ||||||
|         return false; |         return false; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| int cGrid::calcOverlap(cGrid *neighbor) { | int cGridElement::calcOverlap(cGridElement *neighbor) { | ||||||
|     int overlap = 0; |     int overlap = 0; | ||||||
|     if (intersects(neighbor)) { |     if (intersects(neighbor)) { | ||||||
|         if ((StartTime() <= neighbor->StartTime()) && (EndTime() <= neighbor->EndTime())) { |         if ((StartTime() <= neighbor->StartTime()) && (EndTime() <= neighbor->EndTime())) { | ||||||
| @@ -77,6 +77,6 @@ int cGrid::calcOverlap(cGrid *neighbor) { | |||||||
|     return overlap; |     return overlap; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| bool cGrid::intersects(cGrid *neighbor) { | bool cGridElement::intersects(cGridElement *neighbor) { | ||||||
|     return ! ( (neighbor->EndTime() <= StartTime()) || (neighbor->StartTime() >= EndTime()) );  |     return ! ( (neighbor->EndTime() <= StartTime()) || (neighbor->StartTime() >= EndTime()) );  | ||||||
| } | } | ||||||
| @@ -4,11 +4,11 @@ | |||||||
| #include <vdr/tools.h> | #include <vdr/tools.h> | ||||||
| #include "styledpixmap.h" | #include "styledpixmap.h" | ||||||
| 
 | 
 | ||||||
| class cChannelColumn; | class cChannelEpg; | ||||||
| 
 | 
 | ||||||
| // --- cEpgGrid  -------------------------------------------------------------
 | // --- cEpgGrid  -------------------------------------------------------------
 | ||||||
| 
 | 
 | ||||||
| class cGrid : public cListObject, public cStyledPixmap { | class cGridElement : public cListObject, public cStyledPixmap { | ||||||
| protected: | protected: | ||||||
|     cTextWrapper *text; |     cTextWrapper *text; | ||||||
|     int viewportHeight; |     int viewportHeight; | ||||||
| @@ -19,14 +19,14 @@ protected: | |||||||
|     bool dirty; |     bool dirty; | ||||||
|     bool hasTimer; |     bool hasTimer; | ||||||
|     bool hasSwitchTimer; |     bool hasSwitchTimer; | ||||||
|     bool intersects(cGrid *neighbor); |     bool intersects(cGridElement *neighbor); | ||||||
|     virtual time_t Duration(void) { return 0; }; |     virtual time_t Duration(void) { return 0; }; | ||||||
|     virtual void drawText(void) {}; |     virtual void drawText(void) {}; | ||||||
|     bool dummy; |     bool dummy; | ||||||
| public: | public: | ||||||
|     cGrid(cChannelColumn *c); |     cGridElement(cChannelEpg *c); | ||||||
|     virtual ~cGrid(void); |     virtual ~cGridElement(void); | ||||||
|     cChannelColumn *column; |     cChannelEpg *column; | ||||||
|     virtual void SetViewportHeight(void) {}; |     virtual void SetViewportHeight(void) {}; | ||||||
|     virtual void PositionPixmap(void) {}; |     virtual void PositionPixmap(void) {}; | ||||||
|     virtual void setText(void) {}; |     virtual void setText(void) {}; | ||||||
| @@ -43,7 +43,7 @@ public: | |||||||
|     virtual time_t EndTime(void) { return 0; }; |     virtual time_t EndTime(void) { return 0; }; | ||||||
|     virtual void SetStartTime(time_t start) {}; |     virtual void SetStartTime(time_t start) {}; | ||||||
|     virtual void SetEndTime(time_t end) {}; |     virtual void SetEndTime(time_t end) {}; | ||||||
|     int calcOverlap(cGrid *neighbor); |     int calcOverlap(cGridElement *neighbor); | ||||||
|     virtual void SetTimer(void) {}; |     virtual void SetTimer(void) {}; | ||||||
|     virtual void SetSwitchTimer(void) {}; |     virtual void SetSwitchTimer(void) {}; | ||||||
|     virtual cString getText(void) { return cString("");}; |     virtual cString getText(void) { return cString("");}; | ||||||
							
								
								
									
										30
									
								
								headergrid.c
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								headergrid.c
									
									
									
									
									
								
							| @@ -2,7 +2,7 @@ | |||||||
| #include "tools.h" | #include "tools.h" | ||||||
| #include "headergrid.h" | #include "headergrid.h" | ||||||
|  |  | ||||||
| cHeaderGrid::cHeaderGrid(void) : cGrid(NULL) { | cHeaderGrid::cHeaderGrid(void) : cGridElement(NULL) { | ||||||
|     pixmap = NULL; |     pixmap = NULL; | ||||||
|     pixmapLogo = NULL; |     pixmapLogo = NULL; | ||||||
| } | } | ||||||
| @@ -15,10 +15,10 @@ void cHeaderGrid::createBackground(int num) { | |||||||
|     color = theme.Color(clrHeader); |     color = theme.Color(clrHeader); | ||||||
|     colorBlending = theme.Color(clrHeaderBlending); |     colorBlending = theme.Color(clrHeaderBlending); | ||||||
|     int x, y; |     int x, y; | ||||||
|     if (tvguideConfig.displayMode == eVertical) { |     if (config.displayMode == eVertical) { | ||||||
|         x = geoManager.timeLineWidth + num*geoManager.colWidth; |         x = geoManager.timeLineWidth + num*geoManager.colWidth; | ||||||
|         y = geoManager.statusHeaderHeight + geoManager.channelGroupsHeight; |         y = geoManager.statusHeaderHeight + geoManager.channelGroupsHeight; | ||||||
|     } else if (tvguideConfig.displayMode == eHorizontal) { |     } else if (config.displayMode == eHorizontal) { | ||||||
|         x = geoManager.channelGroupsWidth; |         x = geoManager.channelGroupsWidth; | ||||||
|         y = geoManager.statusHeaderHeight + geoManager.timeLineHeight + num*geoManager.rowHeight; |         y = geoManager.statusHeaderHeight + geoManager.timeLineHeight + num*geoManager.rowHeight; | ||||||
|     } |     } | ||||||
| @@ -28,7 +28,7 @@ void cHeaderGrid::createBackground(int num) { | |||||||
|         return; |         return; | ||||||
|     } |     } | ||||||
|     pixmapLogo->Fill(clrTransparent); |     pixmapLogo->Fill(clrTransparent); | ||||||
|     if (tvguideConfig.style == eStyleGraphical) { |     if (config.style == eStyleGraphical) { | ||||||
|         drawBackgroundGraphical(bgChannelHeader); |         drawBackgroundGraphical(bgChannelHeader); | ||||||
|     } else { |     } else { | ||||||
|         drawBackground(); |         drawBackground(); | ||||||
| @@ -37,9 +37,9 @@ void cHeaderGrid::createBackground(int num) { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cHeaderGrid::drawChannel(const cChannel *channel) { | void cHeaderGrid::drawChannel(const cChannel *channel) { | ||||||
|     if (tvguideConfig.displayMode == eVertical) { |     if (config.displayMode == eVertical) { | ||||||
|         drawChannelVertical(channel); |         drawChannelVertical(channel); | ||||||
|     } else if (tvguideConfig.displayMode == eHorizontal) { |     } else if (config.displayMode == eHorizontal) { | ||||||
|         drawChannelHorizontal(channel); |         drawChannelHorizontal(channel); | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @@ -48,11 +48,11 @@ void cHeaderGrid::drawChannel(const cChannel *channel) { | |||||||
|  |  | ||||||
| void cHeaderGrid::drawChannelHorizontal(const cChannel *channel) { | void cHeaderGrid::drawChannelHorizontal(const cChannel *channel) { | ||||||
|     int logoWidth = geoManager.logoWidth; |     int logoWidth = geoManager.logoWidth; | ||||||
|     int logoX = tvguideConfig.displayChannelName ? 5 : (Width() - logoWidth) / 2; |     int logoX = config.displayChannelName ? 5 : (Width() - logoWidth) / 2; | ||||||
|     int textX = 5; |     int textX = 5; | ||||||
|     int textY = (Height() - fontManager.FontChannelHeaderHorizontal->Height()) / 2; |     int textY = (Height() - fontManager.FontChannelHeaderHorizontal->Height()) / 2; | ||||||
|     bool logoFound = false; |     bool logoFound = false; | ||||||
|     if (!tvguideConfig.hideChannelLogos) { |     if (!config.hideChannelLogos) { | ||||||
|         cImage *logo = imgCache.GetLogo(channel); |         cImage *logo = imgCache.GetLogo(channel); | ||||||
|         if (logo) { |         if (logo) { | ||||||
|             const int logoheight = logo->Height(); |             const int logoheight = logo->Height(); | ||||||
| @@ -65,13 +65,13 @@ void cHeaderGrid::drawChannelHorizontal(const cChannel *channel) { | |||||||
|     if (!logoFound) { |     if (!logoFound) { | ||||||
|         drawText = true; |         drawText = true; | ||||||
|     } |     } | ||||||
|     if (tvguideConfig.displayChannelName) { |     if (config.displayChannelName) { | ||||||
|         drawText = true; |         drawText = true; | ||||||
|         textX += logoWidth + 5; |         textX += logoWidth + 5; | ||||||
|         textWidthMax -= textX; |         textWidthMax -= textX; | ||||||
|     } |     } | ||||||
|     if (drawText) { |     if (drawText) { | ||||||
|         tColor colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent; |         tColor colorTextBack = (config.style == eStyleFlat)?color:clrTransparent; | ||||||
|         cString strChannel = cString::sprintf("%d %s", channel->Number(), channel->Name()); |         cString strChannel = cString::sprintf("%d %s", channel->Number(), channel->Name()); | ||||||
|         strChannel = CutText(*strChannel, textWidthMax, fontManager.FontChannelHeaderHorizontal).c_str(); |         strChannel = CutText(*strChannel, textWidthMax, fontManager.FontChannelHeaderHorizontal).c_str(); | ||||||
|         pixmap->DrawText(cPoint(textX, textY), *strChannel, theme.Color(clrFontHeader), colorTextBack, fontManager.FontChannelHeaderHorizontal); |         pixmap->DrawText(cPoint(textX, textY), *strChannel, theme.Color(clrFontHeader), colorTextBack, fontManager.FontChannelHeaderHorizontal); | ||||||
| @@ -90,7 +90,7 @@ void cHeaderGrid::drawChannelVertical(const cChannel *channel) { | |||||||
|     int lineHeight = fontManager.FontChannelHeader->Height(); |     int lineHeight = fontManager.FontChannelHeader->Height(); | ||||||
|     int yStart = (geoManager.channelHeaderHeight - lines * lineHeight) / 2 + 8; |     int yStart = (geoManager.channelHeaderHeight - lines * lineHeight) / 2 + 8; | ||||||
|     bool logoFound = false; |     bool logoFound = false; | ||||||
|     if (!tvguideConfig.hideChannelLogos) { |     if (!config.hideChannelLogos) { | ||||||
|         cImage *logo = imgCache.GetLogo(channel); |         cImage *logo = imgCache.GetLogo(channel); | ||||||
|         if (logo) { |         if (logo) { | ||||||
|                 pixmapLogo->DrawImage(cPoint((Width() - logoWidth) / 2, 6), *logo); |                 pixmapLogo->DrawImage(cPoint((Width() - logoWidth) / 2, 6), *logo); | ||||||
| @@ -100,13 +100,13 @@ void cHeaderGrid::drawChannelVertical(const cChannel *channel) { | |||||||
|     bool drawText = false; |     bool drawText = false; | ||||||
|     if (!logoFound) { |     if (!logoFound) { | ||||||
|         drawText = true; |         drawText = true; | ||||||
|     } else if (tvguideConfig.displayChannelName) { |     } else if (config.displayChannelName) { | ||||||
|         drawText = true; |         drawText = true; | ||||||
|         yStart = logoHeight; |         yStart = logoHeight; | ||||||
|     } |     } | ||||||
|     if (!drawText) |     if (!drawText) | ||||||
|         return; |         return; | ||||||
|     tColor colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent; |     tColor colorTextBack = (config.style == eStyleFlat)?color:clrTransparent; | ||||||
|     for (int i = 0; i < lines; i++) { |     for (int i = 0; i < lines; i++) { | ||||||
|         int textWidth = fontManager.FontChannelHeader->Width(tw.GetLine(i)); |         int textWidth = fontManager.FontChannelHeader->Width(tw.GetLine(i)); | ||||||
|         int xText = (geoManager.colWidth - textWidth) / 2; |         int xText = (geoManager.colWidth - textWidth) / 2; | ||||||
| @@ -118,12 +118,12 @@ void cHeaderGrid::drawChannelVertical(const cChannel *channel) { | |||||||
|  |  | ||||||
| void cHeaderGrid::setPosition(int num) { | void cHeaderGrid::setPosition(int num) { | ||||||
|     int x, y, width, height; |     int x, y, width, height; | ||||||
|     if (tvguideConfig.displayMode == eVertical) { |     if (config.displayMode == eVertical) { | ||||||
|         x = geoManager.timeLineWidth + num*geoManager.colWidth; |         x = geoManager.timeLineWidth + num*geoManager.colWidth; | ||||||
|         y = geoManager.statusHeaderHeight + geoManager.channelGroupsHeight; |         y = geoManager.statusHeaderHeight + geoManager.channelGroupsHeight; | ||||||
|         width = geoManager.colWidth; |         width = geoManager.colWidth; | ||||||
|         height = geoManager.channelHeaderHeight; |         height = geoManager.channelHeaderHeight; | ||||||
|     } else if (tvguideConfig.displayMode == eHorizontal) { |     } else if (config.displayMode == eHorizontal) { | ||||||
|         x = geoManager.channelGroupsWidth; |         x = geoManager.channelGroupsWidth; | ||||||
|         y = geoManager.statusHeaderHeight + geoManager.timeLineHeight + num*geoManager.rowHeight; |         y = geoManager.statusHeaderHeight + geoManager.timeLineHeight + num*geoManager.rowHeight; | ||||||
|         width = geoManager.channelHeaderWidth; |         width = geoManager.channelHeaderWidth; | ||||||
|   | |||||||
| @@ -1,11 +1,11 @@ | |||||||
| #ifndef __TVGUIDE_HEADERGRID_H | #ifndef __TVGUIDE_HEADERGRID_H | ||||||
| #define __TVGUIDE_HEADERGRID_H | #define __TVGUIDE_HEADERGRID_H | ||||||
|  |  | ||||||
| #include "grid.h" | #include "gridelement.h" | ||||||
|  |  | ||||||
| // --- cHeaderGrid  ------------------------------------------------------------- | // --- cHeaderGrid  ------------------------------------------------------------- | ||||||
|  |  | ||||||
| class cHeaderGrid : public cGrid { | class cHeaderGrid : public cGridElement { | ||||||
| private: | private: | ||||||
|     cPixmap *pixmapLogo; |     cPixmap *pixmapLogo; | ||||||
|     void drawChannelHorizontal(const cChannel *channel); |     void drawChannelHorizontal(const cChannel *channel); | ||||||
|   | |||||||
							
								
								
									
										52
									
								
								imagecache.c
									
									
									
									
									
								
							
							
						
						
									
										52
									
								
								imagecache.c
									
									
									
									
									
								
							| @@ -28,7 +28,7 @@ cImageCache::~cImageCache() { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cImageCache::CreateCache(void) { | void cImageCache::CreateCache(void) { | ||||||
|     if (tvguideConfig.style != eStyleGraphical) |     if (config.style != eStyleGraphical) | ||||||
|         return; |         return; | ||||||
|     esyslog("tvguide: Creating Image Cache"); |     esyslog("tvguide: Creating Image Cache"); | ||||||
|     int start = cTimeMs::Now(); |     int start = cTimeMs::Now(); | ||||||
| @@ -85,7 +85,7 @@ void cImageCache::CreateOsdIconCache(void) { | |||||||
|         InsertIntoOsdElementCache(oeButtonBlue, geoManager.buttonWidth, geoManager.buttonHeight); |         InsertIntoOsdElementCache(oeButtonBlue, geoManager.buttonWidth, geoManager.buttonHeight); | ||||||
|  |  | ||||||
|     //Channel Logo Background |     //Channel Logo Background | ||||||
|     if (tvguideConfig.displayMode == eHorizontal) { |     if (config.displayMode == eHorizontal) { | ||||||
|         success = LoadIcon("osdElements/channellogoback_horizontal"); |         success = LoadIcon("osdElements/channellogoback_horizontal"); | ||||||
|     } else { |     } else { | ||||||
|         success = LoadIcon("osdElements/channellogoback_vertical");         |         success = LoadIcon("osdElements/channellogoback_vertical");         | ||||||
| @@ -95,7 +95,7 @@ void cImageCache::CreateOsdIconCache(void) { | |||||||
|  |  | ||||||
|     //Timeline Elements |     //Timeline Elements | ||||||
|     std::string imgTimeline1, imgTimeline2, imgDateViewer; |     std::string imgTimeline1, imgTimeline2, imgDateViewer; | ||||||
|     if (tvguideConfig.displayMode == eHorizontal) { |     if (config.displayMode == eHorizontal) { | ||||||
|         imgTimeline1 = "osdElements/timeline1_horizontal"; |         imgTimeline1 = "osdElements/timeline1_horizontal"; | ||||||
|         imgTimeline2 = "osdElements/timeline2_horizontal"; |         imgTimeline2 = "osdElements/timeline2_horizontal"; | ||||||
|         imgDateViewer = "osdElements/timeline2_horizontal"; |         imgDateViewer = "osdElements/timeline2_horizontal"; | ||||||
| @@ -129,7 +129,7 @@ void cImageCache::PrepareGridIconCache(void) { | |||||||
|     //Create Buffers for Background |     //Create Buffers for Background | ||||||
|     gridsAvailable = true; |     gridsAvailable = true; | ||||||
|     std::string grid, grid_active; |     std::string grid, grid_active; | ||||||
|     if (tvguideConfig.displayMode == eHorizontal) { |     if (config.displayMode == eHorizontal) { | ||||||
|         grid = "osdElements/grid_horizontal"; |         grid = "osdElements/grid_horizontal"; | ||||||
|         grid_active = "osdElements/grid_active_horizontal"; |         grid_active = "osdElements/grid_active_horizontal"; | ||||||
|     } else { |     } else { | ||||||
| @@ -158,7 +158,7 @@ void cImageCache::PrepareGridIconCache(void) { | |||||||
|     imgBottom = NULL; |     imgBottom = NULL; | ||||||
|     imgBottomActive = NULL; |     imgBottomActive = NULL; | ||||||
|  |  | ||||||
|     if (tvguideConfig.displayMode == eHorizontal) { |     if (config.displayMode == eHorizontal) { | ||||||
|         std::string left = "osdElements/grid_left"; |         std::string left = "osdElements/grid_left"; | ||||||
|         std::string right = "osdElements/grid_right"; |         std::string right = "osdElements/grid_right"; | ||||||
|         std::string left_active = "osdElements/grid_active_left"; |         std::string left_active = "osdElements/grid_active_left"; | ||||||
| @@ -214,7 +214,7 @@ void cImageCache::PrepareGridIconCache(void) { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cImageCache::CreateGridIconCache(void) { | void cImageCache::CreateGridIconCache(void) { | ||||||
|     if (tvguideConfig.displayMode == eHorizontal) { |     if (config.displayMode == eHorizontal) { | ||||||
|         int gridHeight = geoManager.rowHeight; |         int gridHeight = geoManager.rowHeight; | ||||||
|         for (int minutes = 5; minutes <= 120; minutes += 5) { |         for (int minutes = 5; minutes <= 120; minutes += 5) { | ||||||
|             GetGrid(minutes * geoManager.minutePixel, gridHeight, false); |             GetGrid(minutes * geoManager.minutePixel, gridHeight, false); | ||||||
| @@ -233,7 +233,7 @@ void cImageCache::CreateChannelGroupCache(void) { | |||||||
|     groupsBottom = NULL; |     groupsBottom = NULL; | ||||||
|     groupsLeft = NULL; |     groupsLeft = NULL; | ||||||
|     groupsRight = NULL; |     groupsRight = NULL; | ||||||
|     if (tvguideConfig.displayMode == eHorizontal) { |     if (config.displayMode == eHorizontal) { | ||||||
|         std::string channelGroupHead = "osdElements/channelgroup_head"; |         std::string channelGroupHead = "osdElements/channelgroup_head"; | ||||||
|         std::string channelGroupBottom = "osdElements/channelgroup_bottom"; |         std::string channelGroupBottom = "osdElements/channelgroup_bottom"; | ||||||
|         int width = geoManager.channelGroupsWidth; |         int width = geoManager.channelGroupsWidth; | ||||||
| @@ -249,7 +249,7 @@ void cImageCache::CreateChannelGroupCache(void) { | |||||||
|         if (success && heightHeadBottom) { |         if (success && heightHeadBottom) { | ||||||
|             groupsBottom = CreateImage(width, heightHeadBottom, false); |             groupsBottom = CreateImage(width, heightHeadBottom, false); | ||||||
|         } |         } | ||||||
|         for (int size = 1; size <= tvguideConfig.numGrids; ++size) { |         for (int size = 1; size <= config.numGrids; ++size) { | ||||||
|             InsertIntoGroupsCacheHorizontal(size); |             InsertIntoGroupsCacheHorizontal(size); | ||||||
|         } |         } | ||||||
|     } else { |     } else { | ||||||
| @@ -268,7 +268,7 @@ void cImageCache::CreateChannelGroupCache(void) { | |||||||
|         if (success && widthHeadBottom) { |         if (success && widthHeadBottom) { | ||||||
|             groupsRight = CreateImage(widthHeadBottom, height, false); |             groupsRight = CreateImage(widthHeadBottom, height, false); | ||||||
|         } |         } | ||||||
|         for (int size = 1; size <= tvguideConfig.numGrids; ++size) { |         for (int size = 1; size <= config.numGrids; ++size) { | ||||||
|             InsertIntoGroupsCacheVertical(size); |             InsertIntoGroupsCacheVertical(size); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| @@ -276,9 +276,9 @@ void cImageCache::CreateChannelGroupCache(void) { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cImageCache::CreateLogoCache(void) { | void cImageCache::CreateLogoCache(void) { | ||||||
|     if (tvguideConfig.hideChannelLogos) |     if (config.hideChannelLogos) | ||||||
|         return; |         return; | ||||||
|     if (tvguideConfig.numLogosInitial > 0) { |     if (config.numLogosInitial > 0) { | ||||||
|         int channelsCached = 0; |         int channelsCached = 0; | ||||||
| #if VDRVERSNUM >= 20301 | #if VDRVERSNUM >= 20301 | ||||||
|         LOCK_CHANNELS_READ; |         LOCK_CHANNELS_READ; | ||||||
| @@ -286,7 +286,7 @@ void cImageCache::CreateLogoCache(void) { | |||||||
| #else | #else | ||||||
|         for (const cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) { |         for (const cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) { | ||||||
| #endif | #endif | ||||||
|             if (channelsCached >= tvguideConfig.numLogosInitial) |             if (channelsCached >= config.numLogosInitial) | ||||||
|                 break; |                 break; | ||||||
|             if (!channel->GroupSep()) { |             if (!channel->GroupSep()) { | ||||||
|                 bool success = LoadLogo(channel); |                 bool success = LoadLogo(channel); | ||||||
| @@ -351,7 +351,7 @@ cImage *cImageCache::GetLogo(const cChannel *channel) { | |||||||
|     } else { |     } else { | ||||||
|         bool success = LoadLogo(channel); |         bool success = LoadLogo(channel); | ||||||
|         if (success) { |         if (success) { | ||||||
|             if ((tvguideConfig.limitLogoCache) && ((int)logoCache.size() >= tvguideConfig.numLogosMax)) { |             if ((config.limitLogoCache) && ((int)logoCache.size() >= config.numLogosMax)) { | ||||||
|             //logo cache is full, don't cache anymore |             //logo cache is full, don't cache anymore | ||||||
|                 if (tempStaticLogo) { |                 if (tempStaticLogo) { | ||||||
|                     delete tempStaticLogo; |                     delete tempStaticLogo; | ||||||
| @@ -403,7 +403,7 @@ void cImageCache::InsertIntoOsdElementCache(eOsdElementType type, int width, int | |||||||
| void cImageCache::InsertIntoGridCache(std::string name, int width, int height, bool active) { | void cImageCache::InsertIntoGridCache(std::string name, int width, int height, bool active) { | ||||||
|     cImage *image = CreateGrid(width, height, active); |     cImage *image = CreateGrid(width, height, active); | ||||||
|     if (image) { |     if (image) { | ||||||
|         if (tvguideConfig.displayMode == eHorizontal) { |         if (config.displayMode == eHorizontal) { | ||||||
|             AddCornersHorizontal(image, active); |             AddCornersHorizontal(image, active); | ||||||
|         } else { |         } else { | ||||||
|             AddCornersVertical(image, active); |             AddCornersVertical(image, active); | ||||||
| @@ -553,25 +553,25 @@ void cImageCache::AddCornersGroupVertical(cImage *img) { | |||||||
|  |  | ||||||
| bool cImageCache::LoadIcon(std::string name) { | bool cImageCache::LoadIcon(std::string name) { | ||||||
|     bool success = false; |     bool success = false; | ||||||
|     if (tvguideConfig.iconsPathSet) { |     if (config.iconsPathSet) { | ||||||
|         cString iconPathTheme = cString::sprintf("%s%s/", *tvguideConfig.iconPath, *tvguideConfig.themeName); |         cString iconPathTheme = cString::sprintf("%s%s/", *config.iconPath, *config.themeName); | ||||||
|         success = LoadImage(name, *iconPathTheme, "png"); |         success = LoadImage(name, *iconPathTheme, "png"); | ||||||
|         if (success) { |         if (success) { | ||||||
|             return true; |             return true; | ||||||
|         } else { |         } else { | ||||||
|             success = LoadImage(name, *tvguideConfig.iconPath, "png"); |             success = LoadImage(name, *config.iconPath, "png"); | ||||||
|             if (success) { |             if (success) { | ||||||
|                 return true; |                 return true; | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|     if (!success) { |     if (!success) { | ||||||
|         cString iconPathTheme = cString::sprintf("%s%s/", *tvguideConfig.iconPathDefault, *tvguideConfig.themeName); |         cString iconPathTheme = cString::sprintf("%s%s/", *config.iconPathDefault, *config.themeName); | ||||||
|         success = LoadImage(name, *iconPathTheme, "png"); |         success = LoadImage(name, *iconPathTheme, "png"); | ||||||
|         if (success) { |         if (success) { | ||||||
|             return true; |             return true; | ||||||
|         } else { |         } else { | ||||||
|             success = LoadImage(name, *tvguideConfig.iconPathDefault, "png"); |             success = LoadImage(name, *config.iconPathDefault, "png"); | ||||||
|             if (success) { |             if (success) { | ||||||
|                 return true; |                 return true; | ||||||
|             } |             } | ||||||
| @@ -587,24 +587,24 @@ bool cImageCache::LoadLogo(const cChannel *channel) { | |||||||
|     std::string logoLower = StrToLowerCase(channel->Name()); |     std::string logoLower = StrToLowerCase(channel->Name()); | ||||||
|     bool success = false; |     bool success = false; | ||||||
|     cString extension; |     cString extension; | ||||||
|     if (tvguideConfig.logoExtension == 0) { |     if (config.logoExtension == 0) { | ||||||
|         extension = "png"; |         extension = "png"; | ||||||
|     } else if (tvguideConfig.logoExtension == 1) { |     } else if (config.logoExtension == 1) { | ||||||
|         extension = "jpg"; |         extension = "jpg"; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     if (tvguideConfig.logoPathSet) { |     if (config.logoPathSet) { | ||||||
|         success = LoadImage(channelID.c_str(), *tvguideConfig.logoPath, *extension); |         success = LoadImage(channelID.c_str(), *config.logoPath, *extension); | ||||||
|         if (success) |         if (success) | ||||||
|             return true; |             return true; | ||||||
|         success = LoadImage(logoLower.c_str(), *tvguideConfig.logoPath, *extension); |         success = LoadImage(logoLower.c_str(), *config.logoPath, *extension); | ||||||
|         if (success) |         if (success) | ||||||
|             return true; |             return true; | ||||||
|     } |     } | ||||||
|     success = LoadImage(channelID.c_str(), *tvguideConfig.logoPathDefault, *extension); |     success = LoadImage(channelID.c_str(), *config.logoPathDefault, *extension); | ||||||
|     if (success) |     if (success) | ||||||
|         return true; |         return true; | ||||||
|     success = LoadImage(logoLower.c_str(), *tvguideConfig.logoPathDefault, *extension); |     success = LoadImage(logoLower.c_str(), *config.logoPathDefault, *extension); | ||||||
|     return success; |     return success; | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -11,7 +11,6 @@ | |||||||
| using namespace Magick; | using namespace Magick; | ||||||
|  |  | ||||||
| cImageLoader::cImageLoader() { | cImageLoader::cImageLoader() { | ||||||
|     InitializeMagick(NULL); |  | ||||||
| } | } | ||||||
|  |  | ||||||
| cImageLoader::~cImageLoader() { | 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 channelID = StrToLowerCase(*(channel->GetChannelID().ToString())); | ||||||
|     std::string logoLower = StrToLowerCase(channel->Name()); |     std::string logoLower = StrToLowerCase(channel->Name()); | ||||||
|     cString extension; |     cString extension; | ||||||
|     if (tvguideConfig.logoExtension == 0) { |     if (config.logoExtension == 0) { | ||||||
|         extension = "png"; |         extension = "png"; | ||||||
|     } else if (tvguideConfig.logoExtension == 1) { |     } else if (config.logoExtension == 1) { | ||||||
|         extension = "jpg"; |         extension = "jpg"; | ||||||
|     } |     } | ||||||
|     bool success = false; |     bool success = false; | ||||||
|     if (tvguideConfig.logoPathSet) { |     if (config.logoPathSet) { | ||||||
|         success = LoadImage(channelID.c_str(), *tvguideConfig.logoPath, *extension); |         success = LoadImage(channelID.c_str(), *config.logoPath, *extension); | ||||||
|         if (!success) { |         if (!success) { | ||||||
|             success = LoadImage(logoLower.c_str(), *tvguideConfig.logoPath, *extension); |             success = LoadImage(logoLower.c_str(), *config.logoPath, *extension); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|     if (!success) |     if (!success) | ||||||
|         success = LoadImage(channelID.c_str(), *tvguideConfig.logoPathDefault, *extension); |         success = LoadImage(channelID.c_str(), *config.logoPathDefault, *extension); | ||||||
|     if (!success) |     if (!success) | ||||||
|         success = LoadImage(logoLower.c_str(), *tvguideConfig.logoPathDefault, *extension); |         success = LoadImage(logoLower.c_str(), *config.logoPathDefault, *extension); | ||||||
|     if (success) |     if (success) | ||||||
|         buffer.sample(Geometry(width, height)); |         buffer.sample(Geometry(width, height)); | ||||||
|     return success; |     return success; | ||||||
| @@ -48,9 +47,9 @@ bool cImageLoader::LoadEPGImage(int eventID, int width, int height) { | |||||||
|     if ((width == 0)||(height==0)) |     if ((width == 0)||(height==0)) | ||||||
|         return false; |         return false; | ||||||
|     bool success = false; |     bool success = false; | ||||||
|     success = LoadImage(*cString::sprintf("%d", eventID), *tvguideConfig.epgImagePath, "jpg"); |     success = LoadImage(*cString::sprintf("%d", eventID), *config.epgImagePath, "jpg"); | ||||||
|     if (!success) |     if (!success) | ||||||
|         success = LoadImage(*cString::sprintf("%d_0", eventID), *tvguideConfig.epgImagePath, "jpg"); |         success = LoadImage(*cString::sprintf("%d_0", eventID), *config.epgImagePath, "jpg"); | ||||||
|     if (!success) |     if (!success) | ||||||
|         return false; |         return false; | ||||||
|     buffer.sample( Geometry(width, height)); |     buffer.sample( Geometry(width, height)); | ||||||
| @@ -58,12 +57,12 @@ bool cImageLoader::LoadEPGImage(int eventID, int width, int height) { | |||||||
| } | } | ||||||
|  |  | ||||||
| bool cImageLoader::LoadAdditionalEPGImage(cString name) { | bool cImageLoader::LoadAdditionalEPGImage(cString name) { | ||||||
|     int width = tvguideConfig.epgImageWidthLarge; |     int width = config.epgImageWidthLarge; | ||||||
|     int height = tvguideConfig.epgImageHeightLarge; |     int height = config.epgImageHeightLarge; | ||||||
|     if ((width == 0)||(height==0)) |     if ((width == 0)||(height==0)) | ||||||
|         return false; |         return false; | ||||||
|     bool success = false; |     bool success = false; | ||||||
|     success = LoadImage(*name, *tvguideConfig.epgImagePath, "jpg"); |     success = LoadImage(*name, *config.epgImagePath, "jpg"); | ||||||
|     if (!success) |     if (!success) | ||||||
|         return false; |         return false; | ||||||
|     if (height != 0 || width != 0) { |     if (height != 0 || width != 0) { | ||||||
| @@ -84,19 +83,19 @@ bool cImageLoader::LoadIcon(const char *cIcon, int size) { | |||||||
|     if (size==0) |     if (size==0) | ||||||
|         return false; |         return false; | ||||||
|     bool success = false; |     bool success = false; | ||||||
|     if (tvguideConfig.iconsPathSet) { |     if (config.iconsPathSet) { | ||||||
|         cString iconPathTheme = cString::sprintf("%s%s/recmenuicons/", *tvguideConfig.iconPath, *tvguideConfig.themeName); |         cString iconPathTheme = cString::sprintf("%s%s/recmenuicons/", *config.iconPath, *config.themeName); | ||||||
|         success = LoadImage(cIcon, *iconPathTheme, "png"); |         success = LoadImage(cIcon, *iconPathTheme, "png"); | ||||||
|         if (!success) { |         if (!success) { | ||||||
|             cString iconPath = cString::sprintf("%srecmenuicons/", *tvguideConfig.iconPath); |             cString iconPath = cString::sprintf("%srecmenuicons/", *config.iconPath); | ||||||
|             success = LoadImage(cIcon, *iconPath, "png"); |             success = LoadImage(cIcon, *iconPath, "png"); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|     if (!success) { |     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"); |         success = LoadImage(cIcon, *iconPathTheme, "png"); | ||||||
|         if (!success) { |         if (!success) { | ||||||
|             cString iconPath = cString::sprintf("%srecmenuicons/", *tvguideConfig.iconPathDefault); |             cString iconPath = cString::sprintf("%srecmenuicons/", *config.iconPathDefault); | ||||||
|             success = LoadImage(cIcon, *iconPath, "png"); |             success = LoadImage(cIcon, *iconPath, "png"); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| @@ -110,20 +109,20 @@ bool cImageLoader::LoadOsdElement(cString name, int width, int height) { | |||||||
|     if ((width == 0)||(height==0)) |     if ((width == 0)||(height==0)) | ||||||
|         return false; |         return false; | ||||||
|     bool success = false; |     bool success = false; | ||||||
|     if (tvguideConfig.iconsPathSet) { |     if (config.iconsPathSet) { | ||||||
|         cString path = cString::sprintf("%s%s%s", *tvguideConfig.iconPath, *tvguideConfig.themeName, "/osdElements/"); |         cString path = cString::sprintf("%s%s%s", *config.iconPath, *config.themeName, "/osdElements/"); | ||||||
|         success = LoadImage(*name, *path, "png"); |         success = LoadImage(*name, *path, "png"); | ||||||
|         if (!success) { |         if (!success) { | ||||||
|             path = cString::sprintf("%s%s", *tvguideConfig.iconPath, "/osdElements/"); |             path = cString::sprintf("%s%s", *config.iconPath, "/osdElements/"); | ||||||
|             success = LoadImage(*name, *path, "png"); |             success = LoadImage(*name, *path, "png"); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|     if (!success) { |     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"); |         success = LoadImage(*name, *path, "png"); | ||||||
|     } |     } | ||||||
|     if (!success) { |     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"); |         success = LoadImage(*name, *path, "png"); | ||||||
|     } |     } | ||||||
|     if (!success) |     if (!success) | ||||||
|   | |||||||
| @@ -5,7 +5,6 @@ | |||||||
| #include "imagescaler.h" | #include "imagescaler.h" | ||||||
|  |  | ||||||
| cImageMagickWrapper::cImageMagickWrapper() { | cImageMagickWrapper::cImageMagickWrapper() { | ||||||
|     InitializeMagick(NULL); |  | ||||||
| } | } | ||||||
|  |  | ||||||
| cImageMagickWrapper::~cImageMagickWrapper() { | cImageMagickWrapper::~cImageMagickWrapper() { | ||||||
| @@ -77,21 +76,21 @@ bool cImageMagickWrapper::LoadImage(std::string FileName, std::string Path, std: | |||||||
|         std::stringstream sstrImgFile; |         std::stringstream sstrImgFile; | ||||||
|         sstrImgFile << Path << FileName << "." << Extension; |         sstrImgFile << Path << FileName << "." << Extension; | ||||||
|         std::string imgFile = sstrImgFile.str(); |         std::string imgFile = sstrImgFile.str(); | ||||||
|         if (tvguideConfig.debugImageLoading) |         if (config.debugImageLoading) | ||||||
|             esyslog("tvguide: trying to load: %s", imgFile.c_str()); |             esyslog("tvguide: trying to load: %s", imgFile.c_str()); | ||||||
|         buffer.read(imgFile.c_str()); |         buffer.read(imgFile.c_str()); | ||||||
|         if (tvguideConfig.debugImageLoading) |         if (config.debugImageLoading) | ||||||
|             esyslog("tvguide: %s sucessfully loaded", imgFile.c_str()); |             esyslog("tvguide: %s sucessfully loaded", imgFile.c_str()); | ||||||
|     } catch( Magick::Warning &warning ) { |     } catch( Magick::Warning &warning ) { | ||||||
|         if (tvguideConfig.debugImageLoading) |         if (config.debugImageLoading) | ||||||
|             esyslog("tvguide: Magick Warning: %s", warning.what()); |             esyslog("tvguide: Magick Warning: %s", warning.what()); | ||||||
|         return true; |         return true; | ||||||
|     } catch( Magick::Error &error ) { |     } catch( Magick::Error &error ) { | ||||||
|         if (tvguideConfig.debugImageLoading) |         if (config.debugImageLoading) | ||||||
|             esyslog("tvguide: Magick Error: %s", error.what()); |             esyslog("tvguide: Magick Error: %s", error.what()); | ||||||
|         return false; |         return false; | ||||||
|     } catch(...) { |     } catch(...) { | ||||||
|         if (tvguideConfig.debugImageLoading) |         if (config.debugImageLoading) | ||||||
|             esyslog("tvguide: an unknown Magick error occured during image loading"); |             esyslog("tvguide: an unknown Magick error occured during image loading"); | ||||||
|         return false; |         return false; | ||||||
|     } |     } | ||||||
| @@ -102,21 +101,21 @@ bool cImageMagickWrapper::LoadImage(const char *fullpath) { | |||||||
|     if ((fullpath == NULL) || (strlen(fullpath) < 5)) |     if ((fullpath == NULL) || (strlen(fullpath) < 5)) | ||||||
|         return false; |         return false; | ||||||
|     try { |     try { | ||||||
|         if (tvguideConfig.debugImageLoading) |         if (config.debugImageLoading) | ||||||
|             esyslog("tvguide: trying to load: %s", fullpath); |             esyslog("tvguide: trying to load: %s", fullpath); | ||||||
|         buffer.read(fullpath); |         buffer.read(fullpath); | ||||||
|         if (tvguideConfig.debugImageLoading) |         if (config.debugImageLoading) | ||||||
|             esyslog("tvguide: %s sucessfully loaded", fullpath); |             esyslog("tvguide: %s sucessfully loaded", fullpath); | ||||||
|     } catch( Magick::Warning &warning ) { |     } catch( Magick::Warning &warning ) { | ||||||
|         if (tvguideConfig.debugImageLoading) |         if (config.debugImageLoading) | ||||||
|             esyslog("tvguide: Magick Warning: %s", warning.what()); |             esyslog("tvguide: Magick Warning: %s", warning.what()); | ||||||
|         return true; |         return true; | ||||||
|     } catch( Magick::Error &error ) { |     } catch( Magick::Error &error ) { | ||||||
|         if (tvguideConfig.debugImageLoading) |         if (config.debugImageLoading) | ||||||
|             esyslog("tvguide: Magick Error: %s", error.what()); |             esyslog("tvguide: Magick Error: %s", error.what()); | ||||||
|         return false; |         return false; | ||||||
|     } catch(...) { |     } catch(...) { | ||||||
|         if (tvguideConfig.debugImageLoading) |         if (config.debugImageLoading) | ||||||
|             esyslog("tvguide: an unknown Magick error occured during image loading"); |             esyslog("tvguide: an unknown Magick error occured during image loading"); | ||||||
|         return false; |         return false; | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -17,7 +17,7 @@ bool cOsdManager::setOsd() { | |||||||
|  |  | ||||||
| void cOsdManager::setBackground() { | void cOsdManager::setBackground() { | ||||||
|      |      | ||||||
|     if (tvguideConfig.displayStatusHeader && tvguideConfig.scaleVideo) { |     if (config.displayStatusHeader && config.scaleVideo) { | ||||||
|         int widthStatus = cOsd::OsdWidth() - geoManager.statusHeaderHeight * 16 / 9; |         int widthStatus = cOsd::OsdWidth() - geoManager.statusHeaderHeight * 16 / 9; | ||||||
|         osd->DrawRectangle(0, 0, widthStatus, geoManager.statusHeaderHeight, theme.Color(clrBackgroundOSD)); |         osd->DrawRectangle(0, 0, widthStatus, geoManager.statusHeaderHeight, theme.Color(clrBackgroundOSD)); | ||||||
|         osd->DrawRectangle(0, geoManager.statusHeaderHeight, Width(), Height(), theme.Color(clrBackgroundOSD));     |         osd->DrawRectangle(0, geoManager.statusHeaderHeight, Width(), Height(), theme.Color(clrBackgroundOSD));     | ||||||
|   | |||||||
							
								
								
									
										35
									
								
								po/ca_ES.po
									
									
									
									
									
								
							
							
						
						
									
										35
									
								
								po/ca_ES.po
									
									
									
									
									
								
							| @@ -3,7 +3,7 @@ msgid "" | |||||||
| msgstr "" | msgstr "" | ||||||
| "Project-Id-Version: vdr-tvguide 0.0.1\n" | "Project-Id-Version: vdr-tvguide 0.0.1\n" | ||||||
| "Report-Msgid-Bugs-To: <see README>\n" | "Report-Msgid-Bugs-To: <see README>\n" | ||||||
| "POT-Creation-Date: 2019-04-22 14:34+0200\n" | "POT-Creation-Date: 2020-02-17 14:30+0100\n" | ||||||
| "PO-Revision-Date: 2013-09-21 17:49+0200\n" | "PO-Revision-Date: 2013-09-21 17:49+0200\n" | ||||||
| "Last-Translator: My friend <Sampep> Thanks David <Gabychan> <gbonich@gmail.com>\n" | "Last-Translator: My friend <Sampep> Thanks David <Gabychan> <gbonich@gmail.com>\n" | ||||||
| "Language-Team: \n" | "Language-Team: \n" | ||||||
| @@ -57,6 +57,9 @@ msgstr "" | |||||||
| msgid "images" | msgid "images" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
|  | msgid "tvguide: RemoteTimerModifications failed" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "root video folder" | msgid "root video folder" | ||||||
| msgstr "Directori principal per a vídeo" | msgstr "Directori principal per a vídeo" | ||||||
|  |  | ||||||
| @@ -99,12 +102,6 @@ msgstr "" | |||||||
| msgid "recordings done" | msgid "recordings done" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| msgid "What's on now" |  | ||||||
| msgstr "" |  | ||||||
|  |  | ||||||
| msgid "What's on next" |  | ||||||
| msgstr "" |  | ||||||
|  |  | ||||||
| msgid "Instant Record" | msgid "Instant Record" | ||||||
| msgstr "Enregistra a l'instant" | msgstr "Enregistra a l'instant" | ||||||
|  |  | ||||||
| @@ -144,6 +141,9 @@ msgstr "Cerca a les gravacions" | |||||||
| msgid "Set Folder for" | msgid "Set Folder for" | ||||||
| msgstr "Programa carpeta per" | msgstr "Programa carpeta per" | ||||||
|  |  | ||||||
|  | msgid "Timer changed" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "Timer created" | msgid "Timer created" | ||||||
| msgstr "Temporitzador creat" | msgstr "Temporitzador creat" | ||||||
|  |  | ||||||
| @@ -567,6 +567,12 @@ msgstr "No s'han trobat gravacions per" | |||||||
| msgid "No Favorites available" | msgid "No Favorites available" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
|  | msgid "What's on now" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
|  | msgid "What's on next" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "whole term must appear" | msgid "whole term must appear" | ||||||
| msgstr "expressió completa" | msgstr "expressió completa" | ||||||
|  |  | ||||||
| @@ -675,6 +681,9 @@ msgstr "si existeix" | |||||||
| msgid "always" | msgid "always" | ||||||
| msgstr "sempre" | msgstr "sempre" | ||||||
|  |  | ||||||
|  | msgid "Use workaround for HWAccelerated OSD" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "Show Main Menu Entry" | msgid "Show Main Menu Entry" | ||||||
| msgstr "Mostra entrada del menú principal" | msgstr "Mostra entrada del menú principal" | ||||||
|  |  | ||||||
| @@ -882,15 +891,27 @@ msgstr "" | |||||||
| msgid "Use fixed folder" | msgid "Use fixed folder" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
|  | msgid "smart" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
|  | msgid "Instant recording:" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "Folder for instant Recordings" | msgid "Folder for instant Recordings" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| msgid "Folder" | msgid "Folder" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
|  | msgid "Add episode to manual timers" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "Use Remotetimers" | msgid "Use Remotetimers" | ||||||
| msgstr "Utilitza temporitzadors remots" | msgstr "Utilitza temporitzadors remots" | ||||||
|  |  | ||||||
|  | msgid "Favorites:" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "Limit channels in favorites" | msgid "Limit channels in favorites" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										35
									
								
								po/de_DE.po
									
									
									
									
									
								
							
							
						
						
									
										35
									
								
								po/de_DE.po
									
									
									
									
									
								
							| @@ -3,7 +3,7 @@ msgid "" | |||||||
| msgstr "" | msgstr "" | ||||||
| "Project-Id-Version: vdr-tvguide 0.0.1\n" | "Project-Id-Version: vdr-tvguide 0.0.1\n" | ||||||
| "Report-Msgid-Bugs-To: <see README>\n" | "Report-Msgid-Bugs-To: <see README>\n" | ||||||
| "POT-Creation-Date: 2019-04-22 14:34+0200\n" | "POT-Creation-Date: 2020-02-17 14:30+0100\n" | ||||||
| "PO-Revision-Date: 2012-08-25 17:49+0200\n" | "PO-Revision-Date: 2012-08-25 17:49+0200\n" | ||||||
| "Last-Translator: Horst\n" | "Last-Translator: Horst\n" | ||||||
| "Language-Team: \n" | "Language-Team: \n" | ||||||
| @@ -54,6 +54,9 @@ msgstr "Favoriten" | |||||||
| msgid "images" | msgid "images" | ||||||
| msgstr "Bilder" | msgstr "Bilder" | ||||||
|  |  | ||||||
|  | msgid "tvguide: RemoteTimerModifications failed" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "root video folder" | msgid "root video folder" | ||||||
| msgstr "Video Hauptverzeichnis" | msgstr "Video Hauptverzeichnis" | ||||||
|  |  | ||||||
| @@ -96,12 +99,6 @@ msgstr "aktive Timer" | |||||||
| msgid "recordings done" | msgid "recordings done" | ||||||
| msgstr "erledigte Aufnahmen" | 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" | msgid "Instant Record" | ||||||
| msgstr "Aufnahme" | msgstr "Aufnahme" | ||||||
|  |  | ||||||
| @@ -141,6 +138,9 @@ msgstr "In Aufnahmen suchen" | |||||||
| msgid "Set Folder for" | msgid "Set Folder for" | ||||||
| msgstr "Verzeichnis festlegen für" | msgstr "Verzeichnis festlegen für" | ||||||
|  |  | ||||||
|  | msgid "Timer changed" | ||||||
|  | msgstr "Timer geändert" | ||||||
|  |  | ||||||
| msgid "Timer created" | msgid "Timer created" | ||||||
| msgstr "Timer angelegt" | msgstr "Timer angelegt" | ||||||
|  |  | ||||||
| @@ -564,6 +564,12 @@ msgstr "Keine Aufnahmen gefunden für" | |||||||
| msgid "No Favorites available" | msgid "No Favorites available" | ||||||
| msgstr "Keine Favoriten verfügbar" | 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" | msgid "whole term must appear" | ||||||
| msgstr "vollständiger Ausdruck" | msgstr "vollständiger Ausdruck" | ||||||
|  |  | ||||||
| @@ -672,6 +678,9 @@ msgstr "falls vorhanden" | |||||||
| msgid "always" | msgid "always" | ||||||
| msgstr "immer" | msgstr "immer" | ||||||
|  |  | ||||||
|  | msgid "Use workaround for HWAccelerated OSD" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "Show Main Menu Entry" | msgid "Show Main Menu Entry" | ||||||
| msgstr "Hauptmenüeintrag anzeigen" | msgstr "Hauptmenüeintrag anzeigen" | ||||||
|  |  | ||||||
| @@ -879,15 +888,27 @@ msgstr "Verzeichnis aus Liste auswählen" | |||||||
| msgid "Use fixed folder" | msgid "Use fixed folder" | ||||||
| msgstr "Festes Verzeichnis benutzen" | msgstr "Festes Verzeichnis benutzen" | ||||||
|  |  | ||||||
|  | msgid "smart" | ||||||
|  | msgstr "intelligent" | ||||||
|  |  | ||||||
|  | msgid "Instant recording:" | ||||||
|  | msgstr "Sofortaufnahmen:" | ||||||
|  |  | ||||||
| msgid "Folder for instant Recordings" | msgid "Folder for instant Recordings" | ||||||
| msgstr "Verzeichnis für Sofortaufnahmen" | msgstr "Verzeichnis für Sofortaufnahmen" | ||||||
|  |  | ||||||
| msgid "Folder" | msgid "Folder" | ||||||
| msgstr "Verzeichnis" | msgstr "Verzeichnis" | ||||||
|  |  | ||||||
|  | msgid "Add episode to manual timers" | ||||||
|  | msgstr "Untertitel in manuellen Timern" | ||||||
|  |  | ||||||
| msgid "Use Remotetimers" | msgid "Use Remotetimers" | ||||||
| msgstr "RemoteTimers benutzen" | msgstr "RemoteTimers benutzen" | ||||||
|  |  | ||||||
|  | msgid "Favorites:" | ||||||
|  | msgstr "Favoriten:" | ||||||
|  |  | ||||||
| msgid "Limit channels in favorites" | msgid "Limit channels in favorites" | ||||||
| msgstr "Kanäle in Favoriten beschränken" | msgstr "Kanäle in Favoriten beschränken" | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										35
									
								
								po/it_IT.po
									
									
									
									
									
								
							
							
						
						
									
										35
									
								
								po/it_IT.po
									
									
									
									
									
								
							| @@ -3,7 +3,7 @@ msgid "" | |||||||
| msgstr "" | msgstr "" | ||||||
| "Project-Id-Version: vdr-tvguide 0.0.1\n" | "Project-Id-Version: vdr-tvguide 0.0.1\n" | ||||||
| "Report-Msgid-Bugs-To: <see README>\n" | "Report-Msgid-Bugs-To: <see README>\n" | ||||||
| "POT-Creation-Date: 2019-04-22 14:34+0200\n" | "POT-Creation-Date: 2020-02-17 14:30+0100\n" | ||||||
| "PO-Revision-Date: 2012-08-25 17:49+0200\n" | "PO-Revision-Date: 2012-08-25 17:49+0200\n" | ||||||
| "Last-Translator: fiveten_59\n" | "Last-Translator: fiveten_59\n" | ||||||
| "Language-Team: \n" | "Language-Team: \n" | ||||||
| @@ -54,6 +54,9 @@ msgstr "Favoriti" | |||||||
| msgid "images" | msgid "images" | ||||||
| msgstr "Immagini" | msgstr "Immagini" | ||||||
|  |  | ||||||
|  | msgid "tvguide: RemoteTimerModifications failed" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "root video folder" | msgid "root video folder" | ||||||
| msgstr "cartella video di root" | msgstr "cartella video di root" | ||||||
|  |  | ||||||
| @@ -96,12 +99,6 @@ msgstr "Timers attivi" | |||||||
| msgid "recordings done" | msgid "recordings done" | ||||||
| msgstr "registrazione eseguita" | 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" | msgid "Instant Record" | ||||||
| msgstr "Registrazione immediata" | msgstr "Registrazione immediata" | ||||||
|  |  | ||||||
| @@ -141,6 +138,9 @@ msgstr "Cerca nelle registrazioni" | |||||||
| msgid "Set Folder for" | msgid "Set Folder for" | ||||||
| msgstr "Crea cartella per" | msgstr "Crea cartella per" | ||||||
|  |  | ||||||
|  | msgid "Timer changed" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "Timer created" | msgid "Timer created" | ||||||
| msgstr "Timer creato" | msgstr "Timer creato" | ||||||
|  |  | ||||||
| @@ -564,6 +564,12 @@ msgstr "Nessuna registrazione trovata per" | |||||||
| msgid "No Favorites available" | msgid "No Favorites available" | ||||||
| msgstr "Nessun Favoriti disponibile" | 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" | msgid "whole term must appear" | ||||||
| msgstr "vollständiger Ausdruck" | msgstr "vollständiger Ausdruck" | ||||||
|  |  | ||||||
| @@ -672,6 +678,9 @@ msgstr "se esiste" | |||||||
| msgid "always" | msgid "always" | ||||||
| msgstr "sempre" | msgstr "sempre" | ||||||
|  |  | ||||||
|  | msgid "Use workaround for HWAccelerated OSD" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "Show Main Menu Entry" | msgid "Show Main Menu Entry" | ||||||
| msgstr "Hauptmenüeintrag anzeigen" | msgstr "Hauptmenüeintrag anzeigen" | ||||||
|  |  | ||||||
| @@ -879,15 +888,27 @@ msgstr "Scegli dall'elenco cartelle" | |||||||
| msgid "Use fixed folder" | msgid "Use fixed folder" | ||||||
| msgstr "Usa cartella fissa" | msgstr "Usa cartella fissa" | ||||||
|  |  | ||||||
|  | msgid "smart" | ||||||
|  | msgstr "intelligente" | ||||||
|  |  | ||||||
|  | msgid "Instant recording:" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "Folder for instant Recordings" | msgid "Folder for instant Recordings" | ||||||
| msgstr "Cartella per la registrazione immediata" | msgstr "Cartella per la registrazione immediata" | ||||||
|  |  | ||||||
| msgid "Folder" | msgid "Folder" | ||||||
| msgstr "Cartella" | msgstr "Cartella" | ||||||
|  |  | ||||||
|  | msgid "Add episode to manual timers" | ||||||
|  | msgstr "Aggiungi episodi ai timer manuali" | ||||||
|  |  | ||||||
| msgid "Use Remotetimers" | msgid "Use Remotetimers" | ||||||
| msgstr "Usa Remotetimers" | msgstr "Usa Remotetimers" | ||||||
|  |  | ||||||
|  | msgid "Favorites:" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "Limit channels in favorites" | msgid "Limit channels in favorites" | ||||||
| msgstr "Limite dei canali nei favoriti" | msgstr "Limite dei canali nei favoriti" | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										35
									
								
								po/ru_RU.po
									
									
									
									
									
								
							
							
						
						
									
										35
									
								
								po/ru_RU.po
									
									
									
									
									
								
							| @@ -3,7 +3,7 @@ msgid "" | |||||||
| msgstr "" | msgstr "" | ||||||
| "Project-Id-Version: vdr-tvguide 1.0.0\n" | "Project-Id-Version: vdr-tvguide 1.0.0\n" | ||||||
| "Report-Msgid-Bugs-To: <see README>\n" | "Report-Msgid-Bugs-To: <see README>\n" | ||||||
| "POT-Creation-Date: 2019-04-22 14:34+0200\n" | "POT-Creation-Date: 2020-02-17 14:30+0100\n" | ||||||
| "PO-Revision-Date: 2013-09-25 17:49+0400\n" | "PO-Revision-Date: 2013-09-25 17:49+0400\n" | ||||||
| "Last-Translator: AmiD, ilya\n" | "Last-Translator: AmiD, ilya\n" | ||||||
| "Language-Team: Russia-Cherepovets(wm.amid@gmail.com)\n" | "Language-Team: Russia-Cherepovets(wm.amid@gmail.com)\n" | ||||||
| @@ -54,6 +54,9 @@ msgstr "" | |||||||
| msgid "images" | msgid "images" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
|  | msgid "tvguide: RemoteTimerModifications failed" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "root video folder" | msgid "root video folder" | ||||||
| msgstr "Главная видео директория" | msgstr "Главная видео директория" | ||||||
|  |  | ||||||
| @@ -96,12 +99,6 @@ msgstr "" | |||||||
| msgid "recordings done" | msgid "recordings done" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| msgid "What's on now" |  | ||||||
| msgstr "" |  | ||||||
|  |  | ||||||
| msgid "What's on next" |  | ||||||
| msgstr "" |  | ||||||
|  |  | ||||||
| msgid "Instant Record" | msgid "Instant Record" | ||||||
| msgstr "Записать" | msgstr "Записать" | ||||||
|  |  | ||||||
| @@ -141,6 +138,9 @@ msgstr "Искать в записях" | |||||||
| msgid "Set Folder for" | msgid "Set Folder for" | ||||||
| msgstr "Укажите каталог для" | msgstr "Укажите каталог для" | ||||||
|  |  | ||||||
|  | msgid "Timer changed" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "Timer created" | msgid "Timer created" | ||||||
| msgstr "Таймер создан" | msgstr "Таймер создан" | ||||||
|  |  | ||||||
| @@ -564,6 +564,12 @@ msgstr "Не найдено записей:" | |||||||
| msgid "No Favorites available" | msgid "No Favorites available" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
|  | msgid "What's on now" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
|  | msgid "What's on next" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "whole term must appear" | msgid "whole term must appear" | ||||||
| msgstr "фраза" | msgstr "фраза" | ||||||
|  |  | ||||||
| @@ -672,6 +678,9 @@ msgstr "если существует" | |||||||
| msgid "always" | msgid "always" | ||||||
| msgstr "всегда" | msgstr "всегда" | ||||||
|  |  | ||||||
|  | msgid "Use workaround for HWAccelerated OSD" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "Show Main Menu Entry" | msgid "Show Main Menu Entry" | ||||||
| msgstr "Показывать пункт в главном меню" | msgstr "Показывать пункт в главном меню" | ||||||
|  |  | ||||||
| @@ -879,15 +888,27 @@ msgstr "" | |||||||
| msgid "Use fixed folder" | msgid "Use fixed folder" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
|  | msgid "smart" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
|  | msgid "Instant recording:" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "Folder for instant Recordings" | msgid "Folder for instant Recordings" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| msgid "Folder" | msgid "Folder" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
|  | msgid "Add episode to manual timers" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "Use Remotetimers" | msgid "Use Remotetimers" | ||||||
| msgstr "RemoteTimers benutzen" | msgstr "RemoteTimers benutzen" | ||||||
|  |  | ||||||
|  | msgid "Favorites:" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "Limit channels in favorites" | msgid "Limit channels in favorites" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										35
									
								
								po/sk_SK.po
									
									
									
									
									
								
							
							
						
						
									
										35
									
								
								po/sk_SK.po
									
									
									
									
									
								
							| @@ -3,7 +3,7 @@ msgid "" | |||||||
| msgstr "" | msgstr "" | ||||||
| "Project-Id-Version: vdr-tvguide 1.1.0\n" | "Project-Id-Version: vdr-tvguide 1.1.0\n" | ||||||
| "Report-Msgid-Bugs-To: <see README>\n" | "Report-Msgid-Bugs-To: <see README>\n" | ||||||
| "POT-Creation-Date: 2019-04-22 14:34+0200\n" | "POT-Creation-Date: 2020-02-17 14:30+0100\n" | ||||||
| "PO-Revision-Date: 2013-09-15 00:12+0100\n" | "PO-Revision-Date: 2013-09-15 00:12+0100\n" | ||||||
| "Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n" | "Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n" | ||||||
| "Language-Team: \n" | "Language-Team: \n" | ||||||
| @@ -54,6 +54,9 @@ msgstr "" | |||||||
| msgid "images" | msgid "images" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
|  | msgid "tvguide: RemoteTimerModifications failed" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "root video folder" | msgid "root video folder" | ||||||
| msgstr "Hlavn<76> video adres<65>r" | msgstr "Hlavn<76> video adres<65>r" | ||||||
|  |  | ||||||
| @@ -96,12 +99,6 @@ msgstr "" | |||||||
| msgid "recordings done" | msgid "recordings done" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| msgid "What's on now" |  | ||||||
| msgstr "" |  | ||||||
|  |  | ||||||
| msgid "What's on next" |  | ||||||
| msgstr "" |  | ||||||
|  |  | ||||||
| msgid "Instant Record" | msgid "Instant Record" | ||||||
| msgstr "Okam<61>ite nahra<72>" | msgstr "Okam<61>ite nahra<72>" | ||||||
|  |  | ||||||
| @@ -141,6 +138,9 @@ msgstr "Vyh | |||||||
| msgid "Set Folder for" | msgid "Set Folder for" | ||||||
| msgstr "Nastavi<76> adres<65>r pre" | msgstr "Nastavi<76> adres<65>r pre" | ||||||
|  |  | ||||||
|  | msgid "Timer changed" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "Timer created" | msgid "Timer created" | ||||||
| msgstr "Pl<50>n vytvoren<65>" | msgstr "Pl<50>n vytvoren<65>" | ||||||
|  |  | ||||||
| @@ -564,6 +564,12 @@ msgstr "Nena | |||||||
| msgid "No Favorites available" | msgid "No Favorites available" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
|  | msgid "What's on now" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
|  | msgid "What's on next" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "whole term must appear" | msgid "whole term must appear" | ||||||
| msgstr "kompletn<74> v<>raz" | msgstr "kompletn<74> v<>raz" | ||||||
|  |  | ||||||
| @@ -672,6 +678,9 @@ msgstr "ak s | |||||||
| msgid "always" | msgid "always" | ||||||
| msgstr "v<>dy" | msgstr "v<>dy" | ||||||
|  |  | ||||||
|  | msgid "Use workaround for HWAccelerated OSD" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "Show Main Menu Entry" | msgid "Show Main Menu Entry" | ||||||
| msgstr "Zobrazi<7A> v hlavnom menu" | msgstr "Zobrazi<7A> v hlavnom menu" | ||||||
|  |  | ||||||
| @@ -879,15 +888,27 @@ msgstr "" | |||||||
| msgid "Use fixed folder" | msgid "Use fixed folder" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
|  | msgid "smart" | ||||||
|  | msgstr "chytr<74>" | ||||||
|  |  | ||||||
|  | msgid "Instant recording:" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "Folder for instant Recordings" | msgid "Folder for instant Recordings" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| msgid "Folder" | msgid "Folder" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
|  | msgid "Add episode to manual timers" | ||||||
|  | msgstr "Prida<64> epiz<69>dy do ru<72>n<EFBFBD>ho <20>asova<76>a" | ||||||
|  |  | ||||||
| msgid "Use Remotetimers" | msgid "Use Remotetimers" | ||||||
| msgstr "Pou<6F>i<EFBFBD> vzdialen<65> pl<70>nova<76>" | msgstr "Pou<6F>i<EFBFBD> vzdialen<65> pl<70>nova<76>" | ||||||
|  |  | ||||||
|  | msgid "Favorites:" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| msgid "Limit channels in favorites" | msgid "Limit channels in favorites" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										201
									
								
								recmanager.c
									
									
									
									
									
								
							
							
						
						
									
										201
									
								
								recmanager.c
									
									
									
									
									
								
							| @@ -44,7 +44,7 @@ bool cRecManager::RefreshRemoteTimers(void) { | |||||||
| bool cRecManager::CheckEventForTimer(const cEvent *event) { | bool cRecManager::CheckEventForTimer(const cEvent *event) { | ||||||
|     bool hasTimer = false; |     bool hasTimer = false; | ||||||
|  |  | ||||||
|     if (tvguideConfig.useRemoteTimers && pRemoteTimers) { |     if (config.useRemoteTimers && pRemoteTimers) { | ||||||
|         RemoteTimers_GetMatch_v1_0 rtMatch; |         RemoteTimers_GetMatch_v1_0 rtMatch; | ||||||
|         rtMatch.event = event; |         rtMatch.event = event; | ||||||
|         pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch); |         pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch); | ||||||
| @@ -66,7 +66,7 @@ bool cRecManager::CheckEventForTimer(const cEvent *event) { | |||||||
|  |  | ||||||
| const cTimer *cRecManager::GetTimerForEvent(const cEvent *event) { | const cTimer *cRecManager::GetTimerForEvent(const cEvent *event) { | ||||||
|     const cTimer *timer = NULL; |     const cTimer *timer = NULL; | ||||||
|     if (tvguideConfig.useRemoteTimers && pRemoteTimers) { |     if (config.useRemoteTimers && pRemoteTimers) { | ||||||
|         RemoteTimers_GetMatch_v1_0 rtMatch; |         RemoteTimers_GetMatch_v1_0 rtMatch; | ||||||
|         rtMatch.event = event; |         rtMatch.event = event; | ||||||
|         pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch); |         pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch); | ||||||
| @@ -85,7 +85,7 @@ const cTimer *cRecManager::GetTimerForEvent(const cEvent *event) { | |||||||
|  |  | ||||||
| cTimer *cRecManager::createTimer(const cEvent *event, std::string path) { | cTimer *cRecManager::createTimer(const cEvent *event, std::string path) { | ||||||
|     cTimer *timer = NULL; |     cTimer *timer = NULL; | ||||||
|     if (tvguideConfig.useRemoteTimers && pRemoteTimers) { |     if (config.useRemoteTimers && pRemoteTimers) { | ||||||
|         timer = createRemoteTimer(event, path); |         timer = createRemoteTimer(event, path); | ||||||
|     } else { |     } else { | ||||||
|         timer = createLocalTimer(event, path); |         timer = createLocalTimer(event, path); | ||||||
| @@ -96,13 +96,15 @@ cTimer *cRecManager::createTimer(const cEvent *event, std::string path) { | |||||||
| cTimer *cRecManager::createLocalTimer(const cEvent *event, std::string path) { | cTimer *cRecManager::createLocalTimer(const cEvent *event, std::string path) { | ||||||
|     cTimer *timer = new cTimer(event); |     cTimer *timer = new cTimer(event); | ||||||
| #if VDRVERSNUM >= 20301 | #if VDRVERSNUM >= 20301 | ||||||
|     if (Setup.SVDRPPeering && *Setup.SVDRPDefaultHost) |  | ||||||
|         ((cTimer*)timer)->SetRemote(Setup.SVDRPDefaultHost); |  | ||||||
|     LOCK_TIMERS_WRITE; |     LOCK_TIMERS_WRITE; | ||||||
|     cTimer *t = Timers->GetTimer(timer); |     cTimers* timers = Timers; | ||||||
|  |     timers->SetExplicitModify(); | ||||||
|  |     if (Setup.SVDRPPeering && *Setup.SVDRPDefaultHost) | ||||||
|  |         timer->SetRemote(Setup.SVDRPDefaultHost); | ||||||
| #else | #else | ||||||
|     cTimer *t = Timers.GetTimer(timer); |     cTimers* timers = &Timers; | ||||||
| #endif | #endif | ||||||
|  |     cTimer *t = timers->GetTimer(timer); | ||||||
|     if (t) { |     if (t) { | ||||||
|         t->OnOff(); |         t->OnOff(); | ||||||
| #if VDRVERSNUM >= 20301 | #if VDRVERSNUM >= 20301 | ||||||
| @@ -114,19 +116,20 @@ cTimer *cRecManager::createLocalTimer(const cEvent *event, std::string path) { | |||||||
|         timer = t; |         timer = t; | ||||||
|         isyslog("timer %s reactivated", *t->ToDescr()); |         isyslog("timer %s reactivated", *t->ToDescr()); | ||||||
|     } else { |     } else { | ||||||
|  |         SetTimerPath(timer, event, path); | ||||||
|  |         timers->Add(timer); | ||||||
|  |         timers->SetModified(); | ||||||
| #if VDRVERSNUM >= 20301 | #if VDRVERSNUM >= 20301 | ||||||
|         Timers->Add(timer); |         if (!HandleRemoteTimerModifications(timer)) { | ||||||
|  |            timers->Del(timer); | ||||||
|  |            esyslog(tr("tvguide: RemoteTimerModifications failed")); | ||||||
|  |         } else { | ||||||
|  |            isyslog("timer %s added (active)", *timer->ToDescr()); | ||||||
|  |         } | ||||||
| #else | #else | ||||||
|         Timers.Add(timer); |  | ||||||
| #endif |  | ||||||
|         isyslog("timer %s added (active)", *timer->ToDescr()); |         isyslog("timer %s added (active)", *timer->ToDescr()); | ||||||
|     } |  | ||||||
|     SetTimerPath(timer, event, path); |  | ||||||
| #if VDRVERSNUM >= 20301 |  | ||||||
|     Timers->SetModified(); |  | ||||||
| #else |  | ||||||
|     Timers.SetModified(); |  | ||||||
| #endif | #endif | ||||||
|  |     } | ||||||
|     return timer; |     return timer; | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -150,9 +153,9 @@ cTimer *cRecManager::createRemoteTimer(const cEvent *event, std::string path) { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cRecManager::SetTimerPath(cTimer *timer, 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; |         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(), '/', '~'); |         std::replace(recDir.begin(), recDir.end(), '/', '~'); | ||||||
|         if (strchr(recDir.c_str(), '%') != NULL) { |         if (strchr(recDir.c_str(), '%') != NULL) { | ||||||
|             if (epgSearchPlugin->Service("Epgsearch-services-v1.1", epgSearch)) { |             if (epgSearchPlugin->Service("Epgsearch-services-v1.1", epgSearch)) { | ||||||
| @@ -172,35 +175,33 @@ void cRecManager::SetTimerPath(cTimer *timer, const cEvent *event, std::string p | |||||||
|         return; |         return; | ||||||
|     } |     } | ||||||
|     //Set choosen path |     //Set choosen path | ||||||
|  |     bool addSubtitle = false; | ||||||
|  |     if (!isempty(event->ShortText())) { // add subtitle if present | ||||||
|  |         addSubtitle = (config.addSubtitleToTimer != addSubtitleNever); | ||||||
|  |         if (config.addSubtitleToTimer == addSubtitleSmart) | ||||||
|  |             if (event->Duration() > 80 * 60) | ||||||
|  |                 addSubtitle = false; | ||||||
|  |     } | ||||||
|     cString newFileName; |     cString newFileName; | ||||||
|     if (path.size() > 0) { |     if (path.size() > 0) { | ||||||
|         std::replace(path.begin(), path.end(), '/', '~'); |         std::replace(path.begin(), path.end(), '/', '~'); | ||||||
|         newFileName = cString::sprintf("%s~%s", path.c_str(), timer->File()); |         if (addSubtitle) | ||||||
|  |            newFileName = cString::sprintf("%s~%s~%s", path.c_str(), event->Title(), event->ShortText()); | ||||||
|  |         else | ||||||
|  |            newFileName = cString::sprintf("%s~%s", path.c_str(), timer->File()); | ||||||
|     } else { |     } else { | ||||||
|         newFileName = event->Title(); |         if (addSubtitle) | ||||||
|  |            newFileName = cString::sprintf("%s~%s", event->Title(), event->ShortText()); | ||||||
|  |         else | ||||||
|  |            newFileName = event->Title(); | ||||||
|     } |     } | ||||||
|     timer->SetFile(*newFileName); |     timer->SetFile(*newFileName); | ||||||
| } | } | ||||||
|  |  | ||||||
| void cRecManager::DeleteTimer(int timerID) { |  | ||||||
| #if VDRVERSNUM >= 20301 |  | ||||||
|     cTimer *t; |  | ||||||
|     { |  | ||||||
|     LOCK_TIMERS_WRITE; |  | ||||||
|     t = Timers->Get(timerID); |  | ||||||
|     } |  | ||||||
| #else |  | ||||||
|     cTimer *t = Timers.Get(timerID); |  | ||||||
| #endif |  | ||||||
|     if (!t) |  | ||||||
|         return; |  | ||||||
|     DeleteTimer(t); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| void cRecManager::DeleteTimer(const cEvent *event) { | void cRecManager::DeleteTimer(const cEvent *event) { | ||||||
|     if (!event) |     if (!event) | ||||||
|         return; |         return; | ||||||
|     if (tvguideConfig.useRemoteTimers && pRemoteTimers) { |     if (config.useRemoteTimers && pRemoteTimers) { | ||||||
|         DeleteRemoteTimer(event); |         DeleteRemoteTimer(event); | ||||||
|     } else { |     } else { | ||||||
|         DeleteLocalTimer(event); |         DeleteLocalTimer(event); | ||||||
| @@ -226,12 +227,19 @@ void cRecManager::DeleteTimer(const cTimer *timer) { | |||||||
| #if VDRVERSNUM >= 20301 | #if VDRVERSNUM >= 20301 | ||||||
|     LOCK_TIMERS_WRITE; |     LOCK_TIMERS_WRITE; | ||||||
|     cTimers* timers = Timers; |     cTimers* timers = Timers; | ||||||
|  |     if (timer && timer->Remote() && !timer->Recording()) { | ||||||
|  |        if (HandleRemoteTimerModifications(NULL, (cTimer*)timer)) { | ||||||
|  |           timers->Del((cTimer*)timer); | ||||||
|  |        } | ||||||
|  |        timers->SetModified(); | ||||||
|  |     } | ||||||
|     cTimer* t = timers->GetTimer(timer); |     cTimer* t = timers->GetTimer(timer); | ||||||
| #else | #else | ||||||
|     cTimers* timers = &Timers; |     cTimers* timers = &Timers; | ||||||
|     cTimer* t = timers->GetTimer((cTimer*)timer); |     cTimer* t = timers->GetTimer((cTimer*)timer); | ||||||
| #endif | #endif | ||||||
|  |     if (!t) | ||||||
|  |         return; | ||||||
|     if (t->Recording()) { |     if (t->Recording()) { | ||||||
|         t->Skip(); |         t->Skip(); | ||||||
| #if VDRVERSNUM >= 20301 | #if VDRVERSNUM >= 20301 | ||||||
| @@ -239,7 +247,7 @@ void cRecManager::DeleteTimer(const cTimer *timer) { | |||||||
| #else | #else | ||||||
|         cRecordControls::Process(time(NULL)); |         cRecordControls::Process(time(NULL)); | ||||||
| #endif | #endif | ||||||
|         } |     } | ||||||
|     isyslog("timer %s deleted", *t->ToDescr()); |     isyslog("timer %s deleted", *t->ToDescr()); | ||||||
|     timers->Del(t, true); |     timers->Del(t, true); | ||||||
|     timers->SetModified(); |     timers->SetModified(); | ||||||
| @@ -259,24 +267,33 @@ void cRecManager::DeleteRemoteTimer(const cEvent *event) { | |||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| void cRecManager::SaveTimer(const cTimer *t, cTimer newTimerSettings) { | void cRecManager::SaveTimer(const cTimer *t, cTimer *newTimerSettings) { | ||||||
|     if (!t) |     if (!t) | ||||||
|         return; |         return; | ||||||
|  |  | ||||||
| #if VDRVERSNUM >= 20301 | #if VDRVERSNUM >= 20301 | ||||||
|     LOCK_TIMERS_WRITE; |     LOCK_TIMERS_WRITE; | ||||||
|     cTimer *timer = Timers->GetTimer(t); |     cTimers* timers = Timers; | ||||||
|  |     timers->SetExplicitModify(); | ||||||
|  |     if (t && t->Remote()) { | ||||||
|  |        if (!HandleRemoteTimerModifications(newTimerSettings, (cTimer *)t)) { | ||||||
|  |           esyslog(tr("tvguide: RemoteTimerModifications failed")); | ||||||
|  |        } | ||||||
|  |     } | ||||||
| #else | #else | ||||||
|     cTimer *timer = Timers.GetTimer((cTimer*)t); |     cTimers* timers = &Timers; | ||||||
| #endif | #endif | ||||||
|  |     cTimer *timer = timers->GetTimer(t); | ||||||
|     bool active = newTimerSettings.HasFlags(tfActive); |     if (!timer) { | ||||||
|     int prio = newTimerSettings.Priority(); |        return; | ||||||
|     int lifetime = newTimerSettings.Lifetime(); |     } | ||||||
|     time_t day = newTimerSettings.Day(); |     bool active = newTimerSettings->HasFlags(tfActive); | ||||||
|     int start = newTimerSettings.Start(); |     int prio = newTimerSettings->Priority(); | ||||||
|     int stop = newTimerSettings.Stop(); |     int lifetime = newTimerSettings->Lifetime(); | ||||||
|     std::string fileName = newTimerSettings.File(); |     time_t day = newTimerSettings->Day(); | ||||||
|  |     int start = newTimerSettings->Start(); | ||||||
|  |     int stop = newTimerSettings->Stop(); | ||||||
|  |     std::string fileName = newTimerSettings->File(); | ||||||
|  |  | ||||||
|     timer->SetDay(day); |     timer->SetDay(day); | ||||||
|     timer->SetStart(start); |     timer->SetStart(start); | ||||||
| @@ -285,15 +302,15 @@ void cRecManager::SaveTimer(const cTimer *t, cTimer newTimerSettings) { | |||||||
|     timer->SetLifetime(lifetime); |     timer->SetLifetime(lifetime); | ||||||
|     timer->SetFile(fileName.c_str()); |     timer->SetFile(fileName.c_str()); | ||||||
|  |  | ||||||
|     if (timer->HasFlags(tfActive) && !active) |     if (active) | ||||||
|         timer->ClrFlags(tfActive); |        timer->SetFlags(tfActive); | ||||||
|     else if (!timer->HasFlags(tfActive) && active) |     else | ||||||
|         timer->SetFlags(tfActive); |        timer->ClrFlags(tfActive); | ||||||
|  |  | ||||||
| #if VDRVERSNUM < 20300 | #if VDRVERSNUM < 20300 | ||||||
|     timer->SetEventFromSchedule(); |     timer->SetEventFromSchedule(); | ||||||
| #endif | #endif | ||||||
|     if (tvguideConfig.useRemoteTimers && pRemoteTimers) { |     if (config.useRemoteTimers && pRemoteTimers) { | ||||||
|         RemoteTimers_Timer_v1_0 rt; |         RemoteTimers_Timer_v1_0 rt; | ||||||
|         rt.timer = timer; |         rt.timer = timer; | ||||||
|         if (!pRemoteTimers->Service("RemoteTimers::ModTimer-v1.0", &rt)) |         if (!pRemoteTimers->Service("RemoteTimers::ModTimer-v1.0", &rt)) | ||||||
| @@ -301,14 +318,13 @@ void cRecManager::SaveTimer(const cTimer *t, cTimer newTimerSettings) { | |||||||
|         RefreshRemoteTimers(); |         RefreshRemoteTimers(); | ||||||
|     } else { |     } else { | ||||||
| #if VDRVERSNUM >= 20301 | #if VDRVERSNUM >= 20301 | ||||||
|         Timers->SetModified(); |         timers->SetModified(); | ||||||
| #else | #else | ||||||
|         Timers.SetModified(); |         timers.SetModified(); | ||||||
| #endif | #endif | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| bool cRecManager::IsRecorded(const cEvent *event) { | bool cRecManager::IsRecorded(const cEvent *event) { | ||||||
| #if VDRVERSNUM >= 20301 | #if VDRVERSNUM >= 20301 | ||||||
|     LOCK_TIMERS_WRITE; |     LOCK_TIMERS_WRITE; | ||||||
| @@ -341,11 +357,10 @@ cTVGuideTimerConflicts *cRecManager::CheckTimerConflict(void) { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cRecManager::CreateSeriesTimer(cTimer *seriesTimer) { | void cRecManager::CreateSeriesTimer(cTimer *seriesTimer) { | ||||||
| #if VDRVERSNUM >= 20301 | #if VDRVERSNUM < 20300 | ||||||
| #else |  | ||||||
|     seriesTimer->SetEventFromSchedule(); |     seriesTimer->SetEventFromSchedule(); | ||||||
| #endif | #endif | ||||||
|     if (tvguideConfig.useRemoteTimers && pRemoteTimers) { |     if (config.useRemoteTimers && pRemoteTimers) { | ||||||
|         RemoteTimers_Timer_v1_0 rt; |         RemoteTimers_Timer_v1_0 rt; | ||||||
|         rt.timer = seriesTimer; |         rt.timer = seriesTimer; | ||||||
|         if (!pRemoteTimers->Service("RemoteTimers::NewTimer-v1.0", &rt)) |         if (!pRemoteTimers->Service("RemoteTimers::NewTimer-v1.0", &rt)) | ||||||
| @@ -355,12 +370,11 @@ void cRecManager::CreateSeriesTimer(cTimer *seriesTimer) { | |||||||
| #if VDRVERSNUM >= 20301 | #if VDRVERSNUM >= 20301 | ||||||
|         LOCK_TIMERS_WRITE; |         LOCK_TIMERS_WRITE; | ||||||
|         cTimers* timers = Timers; |         cTimers* timers = Timers; | ||||||
|  | #else | ||||||
|  |         cTimers* timers = &Timers; | ||||||
|  | #endif | ||||||
|         timers->Add(seriesTimer); |         timers->Add(seriesTimer); | ||||||
|         timers->SetModified(); |         timers->SetModified(); | ||||||
| #else |  | ||||||
|         Timers.Add(seriesTimer); |  | ||||||
|         Timers.SetModified(); |  | ||||||
| #endif |  | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -597,7 +611,7 @@ void cRecManager::DeleteSearchTimer(cTVGuideSearchTimer *searchTimer, bool delTi | |||||||
|         timers = &Timers; |         timers = &Timers; | ||||||
| #endif | #endif | ||||||
|         cTimer *timer = timers->First(); |         cTimer *timer = timers->First(); | ||||||
|         while(timer) { |         while (timer) { | ||||||
|             if (!timer->Recording()) { |             if (!timer->Recording()) { | ||||||
|                 char* searchID = GetAuxValue(timer, "s-id"); |                 char* searchID = GetAuxValue(timer, "s-id"); | ||||||
|                 if (searchID) { |                 if (searchID) { | ||||||
| @@ -726,8 +740,8 @@ const cEvent **cRecManager::LoadReruns(const cEvent *event, int &numResults) { | |||||||
|     if (epgSearchAvailable && !isempty(event->Title())) { |     if (epgSearchAvailable && !isempty(event->Title())) { | ||||||
|         Epgsearch_searchresults_v1_0 data; |         Epgsearch_searchresults_v1_0 data; | ||||||
|         std::string strQuery = event->Title(); |         std::string strQuery = event->Title(); | ||||||
|         if (tvguideConfig.useSubtitleRerun > 0) { |         if (config.useSubtitleRerun > 0) { | ||||||
|             if (tvguideConfig.useSubtitleRerun == 2 || !isempty(event->ShortText())) |             if (config.useSubtitleRerun == 2 || !isempty(event->ShortText())) | ||||||
|                 strQuery += "~"; |                 strQuery += "~"; | ||||||
|             if (!isempty(event->ShortText())) |             if (!isempty(event->ShortText())) | ||||||
|                 strQuery += event->ShortText(); |                 strQuery += event->ShortText(); | ||||||
| @@ -789,31 +803,23 @@ const cEvent **cRecManager::WhatsOnNow(bool nowOrNext, int &numResults) { | |||||||
|     std::vector<const cEvent*> tmpResults; |     std::vector<const cEvent*> tmpResults; | ||||||
| #if VDRVERSNUM >= 20301 | #if VDRVERSNUM >= 20301 | ||||||
|     LOCK_CHANNELS_READ; |     LOCK_CHANNELS_READ; | ||||||
|  |     const cChannels* channels = Channels; | ||||||
|     LOCK_SCHEDULES_READ; |     LOCK_SCHEDULES_READ; | ||||||
|     const cSchedules* schedules = Schedules; |     const cSchedules* schedules = Schedules; | ||||||
| #else | #else | ||||||
|  |     cChannels* channels = &Channels; | ||||||
|     cSchedulesLock schedulesLock; |     cSchedulesLock schedulesLock; | ||||||
|     const cSchedules *schedules = cSchedules::Schedules(schedulesLock); |     const cSchedules *schedules = cSchedules::Schedules(schedulesLock); | ||||||
| #endif | #endif | ||||||
|     const cChannel *startChannel = NULL, *stopChannel = NULL; |     const cChannel *startChannel = NULL, *stopChannel = NULL; | ||||||
|     if (tvguideConfig.favLimitChannels) { |     if (config.favLimitChannels) { | ||||||
| #if VDRVERSNUM >= 20301 |         startChannel = channels->GetByNumber(config.favStartChannel); | ||||||
|         startChannel = Channels->GetByNumber(tvguideConfig.favStartChannel); |         stopChannel = channels->GetByNumber(config.favStopChannel); | ||||||
|         stopChannel = Channels->GetByNumber(tvguideConfig.favStopChannel); |  | ||||||
|     } |     } | ||||||
|     if (!startChannel) |     if (!startChannel) | ||||||
|         startChannel = Channels->First(); |         startChannel = channels->First(); | ||||||
|  |  | ||||||
|     for (const cChannel *channel = startChannel; channel; channel = Channels->Next(channel)) { |     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 |  | ||||||
|         if (channel->GroupSep()) continue; |         if (channel->GroupSep()) continue; | ||||||
|         const cSchedule *Schedule = schedules->GetSchedule(channel); |         const cSchedule *Schedule = schedules->GetSchedule(channel); | ||||||
|         if (!Schedule) continue; |         if (!Schedule) continue; | ||||||
| @@ -842,13 +848,13 @@ const cEvent **cRecManager::UserDefinedTime(int userTime, int &numResults) { | |||||||
|     std::vector<const cEvent*> tmpResults; |     std::vector<const cEvent*> tmpResults; | ||||||
|     int favTime = 0; |     int favTime = 0; | ||||||
|     if (userTime == 1) { |     if (userTime == 1) { | ||||||
|         favTime = tvguideConfig.favTime1; |         favTime = config.favTime1; | ||||||
|     } else if (userTime == 2) { |     } else if (userTime == 2) { | ||||||
|         favTime = tvguideConfig.favTime2; |         favTime = config.favTime2; | ||||||
|     } else if (userTime == 3) { |     } else if (userTime == 3) { | ||||||
|         favTime = tvguideConfig.favTime3; |         favTime = config.favTime3; | ||||||
|     } else if (userTime == 4) { |     } else if (userTime == 4) { | ||||||
|         favTime = tvguideConfig.favTime4; |         favTime = config.favTime4; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     time_t now = time(0); |     time_t now = time(0); | ||||||
| @@ -865,32 +871,23 @@ const cEvent **cRecManager::UserDefinedTime(int userTime, int &numResults) { | |||||||
|  |  | ||||||
| #if VDRVERSNUM >= 20301 | #if VDRVERSNUM >= 20301 | ||||||
|     LOCK_CHANNELS_READ; |     LOCK_CHANNELS_READ; | ||||||
|  |     const cChannels* channels = Channels; | ||||||
|     LOCK_SCHEDULES_READ; |     LOCK_SCHEDULES_READ; | ||||||
| //    const cChannels* channels = Channels; |  | ||||||
|     const cSchedules* schedules = Schedules; |     const cSchedules* schedules = Schedules; | ||||||
| #else | #else | ||||||
|  |     cChannels* channels = &Channels; | ||||||
|     cSchedulesLock schedulesLock; |     cSchedulesLock schedulesLock; | ||||||
|     const cSchedules *schedules = cSchedules::Schedules(schedulesLock); |     const cSchedules *schedules = cSchedules::Schedules(schedulesLock); | ||||||
| #endif | #endif | ||||||
|     const cChannel *startChannel = NULL, *stopChannel = NULL; |     const cChannel *startChannel = NULL, *stopChannel = NULL; | ||||||
|     if (tvguideConfig.favLimitChannels) { |     if (config.favLimitChannels) { | ||||||
| #if VDRVERSNUM >= 20301 |         startChannel = channels->GetByNumber(config.favStartChannel); | ||||||
|         startChannel = Channels->GetByNumber(tvguideConfig.favStartChannel); |         stopChannel = channels->GetByNumber(config.favStopChannel); | ||||||
|         stopChannel = Channels->GetByNumber(tvguideConfig.favStopChannel); |  | ||||||
|     } |     } | ||||||
|     if (!startChannel) |     if (!startChannel) | ||||||
|         startChannel = Channels->First(); |         startChannel = channels->First(); | ||||||
|  |  | ||||||
|     for (const cChannel *channel = startChannel; channel; channel = Channels->Next(channel)) { |     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 |  | ||||||
|         if (channel->GroupSep()) continue; |         if (channel->GroupSep()) continue; | ||||||
|         const cSchedule *Schedule = schedules->GetSchedule(channel); |         const cSchedule *Schedule = schedules->GetSchedule(channel); | ||||||
|         if (!Schedule) continue; |         if (!Schedule) continue; | ||||||
|   | |||||||
| @@ -34,11 +34,10 @@ public: | |||||||
|     cTimer *createRemoteTimer(const cEvent *event, std::string path); |     cTimer *createRemoteTimer(const cEvent *event, std::string path); | ||||||
|     void SetTimerPath(cTimer *timer, const cEvent *event, std::string path); |     void SetTimerPath(cTimer *timer, const cEvent *event, std::string path); | ||||||
|     void DeleteTimer(const cTimer *timer); |     void DeleteTimer(const cTimer *timer); | ||||||
|     void DeleteTimer(int timerID); |  | ||||||
|     void DeleteTimer(const cEvent *event); |     void DeleteTimer(const cEvent *event); | ||||||
|     void DeleteLocalTimer(const cEvent *event); |     void DeleteLocalTimer(const cEvent *event); | ||||||
|     void DeleteRemoteTimer(const cEvent *event); |     void DeleteRemoteTimer(const cEvent *event); | ||||||
|     void SaveTimer(const cTimer *timer, cTimer newTimerSettings); |     void SaveTimer(const cTimer *timer, cTimer *newTimerSettings); | ||||||
|     bool IsRecorded(const cEvent *event); |     bool IsRecorded(const cEvent *event); | ||||||
|     cTVGuideTimerConflicts *CheckTimerConflict(void); |     cTVGuideTimerConflicts *CheckTimerConflict(void); | ||||||
|     void CreateSeriesTimer(cTimer *seriesTimer); |     void CreateSeriesTimer(cTimer *seriesTimer); | ||||||
|   | |||||||
| @@ -532,7 +532,7 @@ void cRecMenu::Arrange(bool scroll) { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cRecMenu::Display(bool scroll) { | void cRecMenu::Display(bool scroll) { | ||||||
|     if (tvguideConfig.style == eStyleGraphical) { |     if (config.style == eStyleGraphical) { | ||||||
|         drawBackgroundGraphical(bgRecMenuBack); |         drawBackgroundGraphical(bgRecMenuBack); | ||||||
|     } else { |     } else { | ||||||
|         pixmap->Fill(theme.Color(clrBackground)); |         pixmap->Fill(theme.Color(clrBackground)); | ||||||
| @@ -674,7 +674,7 @@ eRecMenuState cRecMenu::ProcessKey(eKeys Key) { | |||||||
| cImage *cRecMenu::createScrollbar(int width, int height, tColor clrBgr, tColor clrBlend) { | cImage *cRecMenu::createScrollbar(int width, int height, tColor clrBgr, tColor clrBlend) { | ||||||
|     cImage *image = new cImage(cSize(width, height)); |     cImage *image = new cImage(cSize(width, height)); | ||||||
|     image->Fill(clrBgr); |     image->Fill(clrBgr); | ||||||
|     if (tvguideConfig.style != eStyleFlat) { |     if (config.style != eStyleFlat) { | ||||||
|         int numSteps = 64; |         int numSteps = 64; | ||||||
|         int alphaStep = 0x03; |         int alphaStep = 0x03; | ||||||
|         if (height < 30) |         if (height < 30) | ||||||
|   | |||||||
							
								
								
									
										167
									
								
								recmenuitem.c
									
									
									
									
									
								
							
							
						
						
									
										167
									
								
								recmenuitem.c
									
									
									
									
									
								
							| @@ -36,7 +36,7 @@ void cRecMenuItem::SetPixmaps(void) { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cRecMenuItem::setBackground(void) { | void cRecMenuItem::setBackground(void) { | ||||||
|     if (tvguideConfig.style == eStyleGraphical) { |     if (config.style == eStyleGraphical) { | ||||||
|         if (defaultBackground) { |         if (defaultBackground) { | ||||||
|             drawBackgroundGraphical(bgButton, active); |             drawBackgroundGraphical(bgButton, active); | ||||||
|         } |         } | ||||||
| @@ -52,7 +52,7 @@ void cRecMenuItem::setBackground(void) { | |||||||
|             colorBlending = theme.Color(clrGrid1Blending); |             colorBlending = theme.Color(clrGrid1Blending); | ||||||
|             colorText = theme.Color(clrFont); |             colorText = theme.Color(clrFont); | ||||||
|         } |         } | ||||||
|         colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent; |         colorTextBack = (config.style == eStyleFlat)?color:clrTransparent; | ||||||
|         if (defaultBackground) { |         if (defaultBackground) { | ||||||
|             drawBackground(); |             drawBackground(); | ||||||
|             drawBorder(); |             drawBorder(); | ||||||
| @@ -177,7 +177,7 @@ void cRecMenuItemButtonYesNo::Show(void) { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cRecMenuItemButtonYesNo::setBackground() { | void cRecMenuItemButtonYesNo::setBackground() { | ||||||
|     if (tvguideConfig.style == eStyleGraphical) { |     if (config.style == eStyleGraphical) { | ||||||
|         drawBackgroundGraphical(bgButton, yesActive&&active); |         drawBackgroundGraphical(bgButton, yesActive&&active); | ||||||
|         colorTextBack = clrTransparent; |         colorTextBack = clrTransparent; | ||||||
|         colorTextNoBack = clrTransparent; |         colorTextNoBack = clrTransparent; | ||||||
| @@ -213,8 +213,8 @@ void cRecMenuItemButtonYesNo::setBackground() { | |||||||
|                                 theme.Color(clrGrid1Blending)); |                                 theme.Color(clrGrid1Blending)); | ||||||
|             colorTextNo = theme.Color(clrFont); |             colorTextNo = theme.Color(clrFont); | ||||||
|         } |         } | ||||||
|         colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent; |         colorTextBack = (config.style == eStyleFlat)?color:clrTransparent; | ||||||
|         colorTextNoBack = (tvguideConfig.style == eStyleFlat)?colorNoBack:clrTransparent; |         colorTextNoBack = (config.style == eStyleFlat)?colorNoBack:clrTransparent; | ||||||
|         drawBackground(); |         drawBackground(); | ||||||
|         drawBorder(); |         drawBorder(); | ||||||
|         pixmapNo->drawBackground(); |         pixmapNo->drawBackground(); | ||||||
| @@ -297,22 +297,17 @@ void cRecMenuItemInfo::Draw(void) { | |||||||
|  |  | ||||||
| // --- cRecMenuItemInt  ------------------------------------------------------- | // --- cRecMenuItemInt  ------------------------------------------------------- | ||||||
| cRecMenuItemInt::cRecMenuItemInt(cString text, | cRecMenuItemInt::cRecMenuItemInt(cString text, | ||||||
|                                 int initialVal, |  | ||||||
|                                 int minVal, |                                 int minVal, | ||||||
|                                 int maxVal, |                                 int maxVal, | ||||||
| //                                bool refresh; |  | ||||||
|                                 bool active,  |                                 bool active,  | ||||||
|                                 int *callback, |                                 int *callback, | ||||||
|                                 eRecMenuState action, |                                 eRecMenuState action) { | ||||||
|                                 int indent) { |  | ||||||
|     selectable = true; |     selectable = true; | ||||||
|     this->text = text; |     this->text = text; | ||||||
|     this->currentVal = initialVal; |     this->currentVal = *callback; | ||||||
|     this->minVal = minVal; |     this->minVal = minVal; | ||||||
|     this->maxVal = maxVal; |     this->maxVal = maxVal; | ||||||
| //    this->refresh = refresh; |  | ||||||
|     this->active = active; |     this->active = active; | ||||||
|     this->indent = indent; |  | ||||||
|     this->callback = callback; |     this->callback = callback; | ||||||
|     this->action = action; |     this->action = action; | ||||||
|     height = 3 * font->Height() / 2; |     height = 3 * font->Height() / 2; | ||||||
| @@ -352,7 +347,7 @@ void cRecMenuItemInt::setBackground() { | |||||||
|  |  | ||||||
| void cRecMenuItemInt::Draw(void) { | void cRecMenuItemInt::Draw(void) { | ||||||
|     int textY = (height - font->Height()) / 2; |     int textY = (height - font->Height()) / 2; | ||||||
|     pixmap->DrawText(cPoint(10 + indent * 30, textY), *text, colorText, colorTextBack, font); |     pixmap->DrawText(cPoint(10, textY), *text, colorText, colorTextBack, font); | ||||||
|     DrawValue();     |     DrawValue();     | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -410,38 +405,32 @@ eRecMenuState cRecMenuItemInt::ProcessKey(eKeys Key) { | |||||||
|  |  | ||||||
| // --- cRecMenuItemBool  ------------------------------------------------------- | // --- cRecMenuItemBool  ------------------------------------------------------- | ||||||
| cRecMenuItemBool::cRecMenuItemBool(cString text, | cRecMenuItemBool::cRecMenuItemBool(cString text, | ||||||
|                                    bool initialVal, |  | ||||||
|                                    bool refresh, |  | ||||||
|                                    bool active, |                                    bool active, | ||||||
|                                    bool *callback, |                                    bool *callback, | ||||||
|                                    eRecMenuState action, |                                    eRecMenuState action, | ||||||
|                                    int indent) { |                                    bool refresh) { | ||||||
|     selectable = true; |     selectable = true; | ||||||
|     this->text = text; |     this->text = text; | ||||||
|     this->yes = initialVal; |     this->yes = *callback; | ||||||
|     this->refresh = refresh; |     this->refresh = refresh; | ||||||
|     this->active = active; |     this->active = active; | ||||||
|     this->callback = callback; |     this->callback = callback; | ||||||
|     this->indent = indent; |  | ||||||
|     this->action = action; |     this->action = action; | ||||||
|     height = 3 * font->Height() / 2; |     height = 3 * font->Height() / 2; | ||||||
|     pixmapVal = NULL; |     pixmapVal = NULL; | ||||||
| } | } | ||||||
|  |  | ||||||
| cRecMenuItemBool::cRecMenuItemBool(cString text, | cRecMenuItemBool::cRecMenuItemBool(cString text, | ||||||
|                                    bool initialVal, |  | ||||||
|                                    bool refresh, |  | ||||||
|                                    bool active, |                                    bool active, | ||||||
|                                    int *callback, |                                    int *callback, | ||||||
|                                    eRecMenuState action, |                                    eRecMenuState action, | ||||||
|                                    int indent) { |                                    bool refresh) { | ||||||
|     selectable = true; |     selectable = true; | ||||||
|     this->text = text; |     this->text = text; | ||||||
|     this->yes = initialVal; |     this->yes = *callback; | ||||||
|     this->refresh = refresh; |     this->refresh = refresh; | ||||||
|     this->active = active; |     this->active = active; | ||||||
|     this->callback = (bool*)callback; |     this->callback = (bool*)callback; | ||||||
|     this->indent = indent; |  | ||||||
|     this->action = action; |     this->action = action; | ||||||
|     height = 3 * font->Height() / 2; |     height = 3 * font->Height() / 2; | ||||||
|     pixmapVal = NULL; |     pixmapVal = NULL; | ||||||
| @@ -474,13 +463,13 @@ void cRecMenuItemBool::Show(void) { | |||||||
|  |  | ||||||
| void cRecMenuItemBool::Draw(void) { | void cRecMenuItemBool::Draw(void) { | ||||||
|     int textY = (height - font->Height()) / 2; |     int textY = (height - font->Height()) / 2; | ||||||
|     pixmap->DrawText(cPoint(10 + indent * 30, textY), *text, colorText, colorTextBack, font); |     pixmap->DrawText(cPoint(10, textY), *text, colorText, colorTextBack, font); | ||||||
|     DrawValue();     |     DrawValue();     | ||||||
| } | } | ||||||
|  |  | ||||||
| void cRecMenuItemBool::DrawValue(void) { | void cRecMenuItemBool::DrawValue(void) { | ||||||
|     pixmapVal->Fill(clrTransparent); |     pixmapVal->Fill(clrTransparent); | ||||||
|     std::string strIcon = yes?"yes":"no"; |     std::string strIcon = yes ? "yes" : "no"; | ||||||
|     int iconSize = height - 8; |     int iconSize = height - 8; | ||||||
|     int iconX = width - iconSize - 10; |     int iconX = width - iconSize - 10; | ||||||
|     int iconY = (height - iconSize) / 2; |     int iconY = (height - iconSize) / 2; | ||||||
| @@ -515,24 +504,20 @@ eRecMenuState cRecMenuItemBool::ProcessKey(eKeys Key) { | |||||||
| // --- cRecMenuItemSelect  ------------------------------------------------------- | // --- cRecMenuItemSelect  ------------------------------------------------------- | ||||||
| cRecMenuItemSelect::cRecMenuItemSelect(cString text, | cRecMenuItemSelect::cRecMenuItemSelect(cString text, | ||||||
|                                        std::vector<std::string> Strings, |                                        std::vector<std::string> Strings, | ||||||
|                                        int initialVal, |  | ||||||
|                                        bool active, |                                        bool active, | ||||||
|                                        int *callback, |                                        int *callback, | ||||||
|                                        eRecMenuState action, |                                        eRecMenuState action, | ||||||
|                                        bool refresh, |                                        bool refresh) { | ||||||
|                                        int indent) { |  | ||||||
|     selectable = true; |     selectable = true; | ||||||
|     this->text = text; |     this->text = text; | ||||||
|     strings = Strings; |     strings = Strings; | ||||||
|     numValues = Strings.size(); |     numValues = Strings.size(); | ||||||
|     if ((initialVal < 0) || (initialVal > numValues-1)) |     this->currentVal = *callback; | ||||||
|  |     if ((this->currentVal < 0) || (this->currentVal > numValues - 1)) | ||||||
|         this->currentVal = 0; |         this->currentVal = 0; | ||||||
|     else |  | ||||||
|         this->currentVal = initialVal; |  | ||||||
|     this->active = active; |     this->active = active; | ||||||
|     this->callback = callback; |     this->callback = callback; | ||||||
|     this->refresh = refresh; |     this->refresh = refresh; | ||||||
|     this->indent = indent; |  | ||||||
|     this->action = action; |     this->action = action; | ||||||
|     height = 3 * font->Height() / 2; |     height = 3 * font->Height() / 2; | ||||||
|     pixmapVal = NULL; |     pixmapVal = NULL; | ||||||
| @@ -565,7 +550,7 @@ void cRecMenuItemSelect::Show(void) { | |||||||
|  |  | ||||||
| void cRecMenuItemSelect::Draw(void) { | void cRecMenuItemSelect::Draw(void) { | ||||||
|     int textY = (height - font->Height()) / 2; |     int textY = (height - font->Height()) / 2; | ||||||
|     pixmap->DrawText(cPoint(10 + indent * 30, textY), *text, colorText, colorTextBack, font); |     pixmap->DrawText(cPoint(10, textY), *text, colorText, colorTextBack, font); | ||||||
|     DrawValue();     |     DrawValue();     | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -629,20 +614,18 @@ cRecMenuItemSelectDirectory::cRecMenuItemSelectDirectory(cString text, | |||||||
|                                                          bool active, |                                                          bool active, | ||||||
|                                                          char *callback, |                                                          char *callback, | ||||||
|                                                          eRecMenuState action, |                                                          eRecMenuState action, | ||||||
|                                                          bool isSearchTimer, |                                                          bool isSearchTimer) { | ||||||
|                                                          int indent) { |  | ||||||
|     selectable = true; |     selectable = true; | ||||||
|     this->text = text; |     this->text = text; | ||||||
|     this->originalFolder = originalFolder; |     this->originalFolder = originalFolder; | ||||||
|     this->active = active; |     this->active = active; | ||||||
|     this->callback = callback; |     this->callback = callback; | ||||||
|     this->indent = indent; |  | ||||||
|     this->action = action; |     this->action = action; | ||||||
|     height = 3 * font->Height() / 2; |     height = 3 * font->Height() / 2; | ||||||
|     pixmapVal = NULL; |     pixmapVal = NULL; | ||||||
|     folders.push_back(tr("root video folder")); |     folders.push_back(tr("root video folder")); | ||||||
|     if (isSearchTimer && tvguideConfig.instRecFixedFolder.size() > 0) |     if (isSearchTimer && config.instRecFixedFolder.size() > 0) | ||||||
|         folders.push_back(tvguideConfig.instRecFixedFolder); |         folders.push_back(config.instRecFixedFolder); | ||||||
|     ReadRecordingDirectories(&folders, NULL, ""); |     ReadRecordingDirectories(&folders, NULL, ""); | ||||||
|     numValues = folders.size(); |     numValues = folders.size(); | ||||||
|     this->currentVal = GetInitial(); |     this->currentVal = GetInitial(); | ||||||
| @@ -675,16 +658,16 @@ void cRecMenuItemSelectDirectory::Show(void) { | |||||||
|  |  | ||||||
| void cRecMenuItemSelectDirectory::Draw(void) { | void cRecMenuItemSelectDirectory::Draw(void) { | ||||||
|     int textY = (height - font->Height()) / 2; |     int textY = (height - font->Height()) / 2; | ||||||
|     pixmap->DrawText(cPoint(10 + indent * 30, textY), *text, colorText, colorTextBack, font); |     pixmap->DrawText(cPoint(10, textY), *text, colorText, colorTextBack, font); | ||||||
|     DrawValue();     |     DrawValue();     | ||||||
| } | } | ||||||
|  |  | ||||||
| void cRecMenuItemSelectDirectory::DrawValue(void) { | void cRecMenuItemSelectDirectory::DrawValue(void) { | ||||||
|     pixmapVal->Fill(clrTransparent); |     pixmapVal->Fill(clrTransparent); | ||||||
|     int iconSize = min(128, height); |     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; |     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 iconLeftX = textX - iconSize; | ||||||
|     int iconRightX = width - iconSize; |     int iconRightX = width - iconSize; | ||||||
|     int iconY = (height - iconSize) / 2; |     int iconY = (height - iconSize) / 2; | ||||||
| @@ -750,13 +733,12 @@ int cRecMenuItemSelectDirectory::GetInitial(void) { | |||||||
|  |  | ||||||
| // --- cRecMenuItemText  ------------------------------------------------------- | // --- cRecMenuItemText  ------------------------------------------------------- | ||||||
| cRecMenuItemText::cRecMenuItemText(cString title, | cRecMenuItemText::cRecMenuItemText(cString title, | ||||||
|                                    char *initialVal, |  | ||||||
|                                    int length, |                                    int length, | ||||||
|                                    bool active, |                                    bool active, | ||||||
|                                    char *callback) { |                                    char *callback) { | ||||||
|     selectable = true; |     selectable = true; | ||||||
|     this->title = title; |     this->title = title; | ||||||
|     value = initialVal; |     value = callback; | ||||||
|     this->active = active; |     this->active = active; | ||||||
|     this->callback = callback; |     this->callback = callback; | ||||||
|     height = 3 * font->Height(); |     height = 3 * font->Height(); | ||||||
| @@ -1323,21 +1305,18 @@ eRecMenuState cRecMenuItemText::ProcessKey(eKeys Key) { | |||||||
|  |  | ||||||
| // --- cRecMenuItemTime  ------------------------------------------------------- | // --- cRecMenuItemTime  ------------------------------------------------------- | ||||||
| cRecMenuItemTime::cRecMenuItemTime(cString text, | cRecMenuItemTime::cRecMenuItemTime(cString text, | ||||||
|                                    int initialVal, |  | ||||||
|                                    bool active, |                                    bool active, | ||||||
|                                    int *callback, |                                    int *callback, | ||||||
|                                    eRecMenuState action, |                                    eRecMenuState action) { | ||||||
|                                    int indent) { |  | ||||||
|     selectable = true; |     selectable = true; | ||||||
|     this->text = text; |     this->text = text; | ||||||
|     this->value = initialVal; |     this->value = *callback; | ||||||
|     hh = value / 100; |     hh = value / 100; | ||||||
|     mm = value % 100; |     mm = value % 100; | ||||||
|     pos = 0; |     pos = 0; | ||||||
|     fresh = true; |     fresh = true; | ||||||
|     this->active = active; |     this->active = active; | ||||||
|     this->callback = callback; |     this->callback = callback; | ||||||
|     this->indent = indent; |  | ||||||
|     this->action = action; |     this->action = action; | ||||||
|     height = 3 * font->Height() / 2; |     height = 3 * font->Height() / 2; | ||||||
|     pixmapVal = NULL; |     pixmapVal = NULL; | ||||||
| @@ -1370,7 +1349,7 @@ void cRecMenuItemTime::Show(void) { | |||||||
|  |  | ||||||
| void cRecMenuItemTime::Draw(void) { | void cRecMenuItemTime::Draw(void) { | ||||||
|     int textY = (height - font->Height()) / 2; |     int textY = (height - font->Height()) / 2; | ||||||
|     pixmap->DrawText(cPoint(10 + indent * 30, textY), *text, colorText, colorTextBack, font); |     pixmap->DrawText(cPoint(10, textY), *text, colorText, colorTextBack, font); | ||||||
|     DrawValue();     |     DrawValue();     | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -1469,13 +1448,12 @@ eRecMenuState cRecMenuItemTime::ProcessKey(eKeys Key) { | |||||||
|  |  | ||||||
| // --- cRecMenuItemDay  ------------------------------------------------------- | // --- cRecMenuItemDay  ------------------------------------------------------- | ||||||
| cRecMenuItemDay::cRecMenuItemDay(cString text, | cRecMenuItemDay::cRecMenuItemDay(cString text, | ||||||
|                                  time_t initialVal, |  | ||||||
|                                  bool active, |                                  bool active, | ||||||
|                                  time_t *callback, |                                  time_t *callback, | ||||||
|                                  eRecMenuState action) { |                                  eRecMenuState action) { | ||||||
|     selectable = true; |     selectable = true; | ||||||
|     this->text = text; |     this->text = text; | ||||||
|     this->currentVal = cTimer::SetTime(initialVal, 0); |     this->currentVal = cTimer::SetTime(*callback, 0); | ||||||
|     this->active = active; |     this->active = active; | ||||||
|     this->callback = callback; |     this->callback = callback; | ||||||
|     this->action = action; |     this->action = action; | ||||||
| @@ -1615,9 +1593,9 @@ void cRecMenuItemTimer::Draw(void) { | |||||||
|         channelName = channel->Name(); |         channelName = channel->Name(); | ||||||
|     } |     } | ||||||
|     int logoX = DrawIcons(); |     int logoX = DrawIcons(); | ||||||
|     int logoWidth = height * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio; |     int logoWidth = height * config.logoWidthRatio / config.logoHeightRatio; | ||||||
|     cImageLoader imgLoader; |     cImageLoader imgLoader; | ||||||
|     if (!tvguideConfig.hideChannelLogos) { |     if (!config.hideChannelLogos) { | ||||||
|         if (imgLoader.LoadLogo(channel, logoWidth, height)) { |         if (imgLoader.LoadLogo(channel, logoWidth, height)) { | ||||||
|             cImage logo = imgLoader.GetImage(); |             cImage logo = imgLoader.GetImage(); | ||||||
|             pixmapIcons->DrawImage(cPoint(logoX, 0), logo); |             pixmapIcons->DrawImage(cPoint(logoX, 0), logo); | ||||||
| @@ -1865,9 +1843,9 @@ void cRecMenuItemEvent::Draw(void) { | |||||||
|     cString channelName = ""; |     cString channelName = ""; | ||||||
|     if (channel) |     if (channel) | ||||||
|         channelName = channel->Name(); |         channelName = channel->Name(); | ||||||
|     int logoWidth = height * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio; |     int logoWidth = height * config.logoWidthRatio / config.logoHeightRatio; | ||||||
|     cImageLoader imgLoader; |     cImageLoader imgLoader; | ||||||
|     if (!tvguideConfig.hideChannelLogos) { |     if (!config.hideChannelLogos) { | ||||||
|         if (imgLoader.LoadLogo(channel, logoWidth, height)) { |         if (imgLoader.LoadLogo(channel, logoWidth, height)) { | ||||||
|             cImage logo = imgLoader.GetImage(); |             cImage logo = imgLoader.GetImage(); | ||||||
|             pixmapText->DrawImage(cPoint(logoX, (height - logo.Height()) / 2), logo); |             pixmapText->DrawImage(cPoint(logoX, (height - logo.Height()) / 2), logo); | ||||||
| @@ -1957,15 +1935,21 @@ eRecMenuState cRecMenuItemEvent::ProcessKey(eKeys Key) { | |||||||
|  |  | ||||||
| // --- cRecMenuItemChannelChooser ------------------------------------------------------- | // --- cRecMenuItemChannelChooser ------------------------------------------------------- | ||||||
| cRecMenuItemChannelChooser::cRecMenuItemChannelChooser(cString text, | cRecMenuItemChannelChooser::cRecMenuItemChannelChooser(cString text, | ||||||
|                                                        const cChannel *initialChannel, |  | ||||||
|                                                        bool active, |                                                        bool active, | ||||||
|                                                        int *callback, |                                                        int *callback, | ||||||
|                                                        eRecMenuState action, |                                                        eRecMenuState action) { | ||||||
|                                                        int indent) { |  | ||||||
|     selectable = true; |     selectable = true; | ||||||
|     this->text = text; |     this->text = text; | ||||||
|     this->channel = initialChannel; | #if VDRVERSNUM >= 20301 | ||||||
|     if (initialChannel) |     { | ||||||
|  |     LOCK_CHANNELS_READ; | ||||||
|  |     channels = Channels; | ||||||
|  |     } | ||||||
|  | #else | ||||||
|  |     channels = &Channels; | ||||||
|  | #endif | ||||||
|  |     this->channel = channels->GetByNumber(*callback); | ||||||
|  |     if (callback) | ||||||
|         initialChannelSet = true; |         initialChannelSet = true; | ||||||
|     else |     else | ||||||
|         initialChannelSet = false; |         initialChannelSet = false; | ||||||
| @@ -1973,10 +1957,8 @@ cRecMenuItemChannelChooser::cRecMenuItemChannelChooser(cString text, | |||||||
|     fresh = true; |     fresh = true; | ||||||
|     this->active = active; |     this->active = active; | ||||||
|     this->callback = callback; |     this->callback = callback; | ||||||
|     this->indent = indent; |  | ||||||
|     this->action = action; |     this->action = action; | ||||||
|     height = 3 * font->Height() / 2; |     height = 3 * font->Height() / 2; | ||||||
| //    height = 2 * font->Height(); |  | ||||||
|     pixmapChannel = NULL; |     pixmapChannel = NULL; | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -2007,7 +1989,7 @@ void cRecMenuItemChannelChooser::Show(void) { | |||||||
|  |  | ||||||
| void cRecMenuItemChannelChooser::Draw(void) { | void cRecMenuItemChannelChooser::Draw(void) { | ||||||
|     int textY = (height - font->Height()) / 2; |     int textY = (height - font->Height()) / 2; | ||||||
|     pixmap->DrawText(cPoint(10 + indent * 30, textY), *text, colorText, colorTextBack, font); |     pixmap->DrawText(cPoint(10, textY), *text, colorText, colorTextBack, font); | ||||||
|     DrawValue();     |     DrawValue();     | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -2018,7 +2000,7 @@ void cRecMenuItemChannelChooser::DrawValue(void) { | |||||||
|         cString textVal = cString::sprintf("%d - %s", channel->Number(), channel->Name()); |         cString textVal = cString::sprintf("%d - %s", channel->Number(), channel->Name()); | ||||||
|         int textX = width - font->Width(*textVal) - 10; |         int textX = width - font->Width(*textVal) - 10; | ||||||
|         pixmapChannel->DrawText(cPoint(textX, textY), *textVal, colorText, clrTransparent, font); |         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; |         int logoX = textX - logoWidth - 10; | ||||||
|         cImageLoader imgLoader; |         cImageLoader imgLoader; | ||||||
|         if (imgLoader.LoadLogo(channel, logoWidth, height - 10)) { |         if (imgLoader.LoadLogo(channel, logoWidth, height - 10)) { | ||||||
| @@ -2046,12 +2028,6 @@ eRecMenuState cRecMenuItemChannelChooser::ProcessKey(eKeys Key) { | |||||||
|             if (!channel) |             if (!channel) | ||||||
|                 return rmsConsumed; |                 return rmsConsumed; | ||||||
|             const cChannel *prev = channel; |             const cChannel *prev = channel; | ||||||
| #if VDRVERSNUM >= 20301 |  | ||||||
|             LOCK_CHANNELS_READ; |  | ||||||
|             const cChannels* channels = Channels; |  | ||||||
| #else |  | ||||||
|             const cChannels* channels = &Channels; |  | ||||||
| #endif |  | ||||||
|             const cChannel *firstChannel = channels->First(); |             const cChannel *firstChannel = channels->First(); | ||||||
|             if(firstChannel->GroupSep()) |             if(firstChannel->GroupSep()) | ||||||
|                 firstChannel = channels->Next(firstChannel); |                 firstChannel = channels->Next(firstChannel); | ||||||
| @@ -2077,12 +2053,6 @@ eRecMenuState cRecMenuItemChannelChooser::ProcessKey(eKeys Key) { | |||||||
|             break; } |             break; } | ||||||
|         case kRight: { |         case kRight: { | ||||||
|             fresh = true; |             fresh = true; | ||||||
| #if VDRVERSNUM >= 20301 |  | ||||||
|             LOCK_CHANNELS_READ; |  | ||||||
|             const cChannels* channels = Channels; |  | ||||||
| #else |  | ||||||
|             const cChannels* channels = &Channels; |  | ||||||
| #endif |  | ||||||
|             if (!channel) { |             if (!channel) { | ||||||
|                 channel = channels->First(); |                 channel = channels->First(); | ||||||
|                 if(channel->GroupSep()) |                 if(channel->GroupSep()) | ||||||
| @@ -2111,12 +2081,7 @@ eRecMenuState cRecMenuItemChannelChooser::ProcessKey(eKeys Key) { | |||||||
|                fresh = false; |                fresh = false; | ||||||
|             } |             } | ||||||
|             channelNumber = channelNumber * 10 + (Key - k0); |             channelNumber = channelNumber * 10 + (Key - k0); | ||||||
| #if VDRVERSNUM >= 20301 |             chanNew = channels->GetByNumber(channelNumber); | ||||||
|             LOCK_CHANNELS_READ; |  | ||||||
|             const cChannel *chanNew = Channels->GetByNumber(channelNumber); |  | ||||||
| #else |  | ||||||
|             const cChannel *chanNew = Channels.GetByNumber(channelNumber); |  | ||||||
| #endif |  | ||||||
|             if (chanNew) { |             if (chanNew) { | ||||||
|                 channel = chanNew; |                 channel = chanNew; | ||||||
|                 DrawValue(); |                 DrawValue(); | ||||||
| @@ -2135,20 +2100,16 @@ eRecMenuState cRecMenuItemChannelChooser::ProcessKey(eKeys Key) { | |||||||
|  |  | ||||||
| // --- cRecMenuItemDayChooser ------------------------------------------------------- | // --- cRecMenuItemDayChooser ------------------------------------------------------- | ||||||
| cRecMenuItemDayChooser::cRecMenuItemDayChooser(cString text, | cRecMenuItemDayChooser::cRecMenuItemDayChooser(cString text, | ||||||
|                                                int weekdays, |  | ||||||
|                                                bool active, |                                                bool active, | ||||||
|                                                int *callback, |                                                int *callback) { | ||||||
|                                                int indent) { |  | ||||||
|     selectable = true; |     selectable = true; | ||||||
|     this->text = text; |     this->text = text; | ||||||
|  |     this->weekdays = *callback; | ||||||
|     if (weekdays < 1) |     if (weekdays < 1) | ||||||
|         weekdays *= -1; |         weekdays *= -1; | ||||||
|     this->weekdays = weekdays; |  | ||||||
|     this->active = active; |     this->active = active; | ||||||
|     this->callback = callback; |     this->callback = callback; | ||||||
|     this->indent = indent; |  | ||||||
|     height = 3 * font->Height() / 2; |     height = 3 * font->Height() / 2; | ||||||
| //    height = 2 * font->Height(); |  | ||||||
|     selectedDay = 0; |     selectedDay = 0; | ||||||
|     pixmapWeekdays = NULL; |     pixmapWeekdays = NULL; | ||||||
|     pixmapWeekdaysSelect = NULL; |     pixmapWeekdaysSelect = NULL; | ||||||
| @@ -2189,13 +2150,13 @@ void cRecMenuItemDayChooser::Show(void) { | |||||||
| void cRecMenuItemDayChooser::SetSizes(void) { | void cRecMenuItemDayChooser::SetSizes(void) { | ||||||
|     days = trVDR("MTWTFSS"); |     days = trVDR("MTWTFSS"); | ||||||
|     int maxWidth = 0; |     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)); |         int charWidth = font->Width(days.at(i)); | ||||||
|         if (charWidth > maxWidth) |         if (charWidth > maxWidth) | ||||||
|             maxWidth = charWidth; |             maxWidth = charWidth; | ||||||
|     }     |     }     | ||||||
|     daysSize = min(maxWidth + 15, height-4); |     daysSize = min(maxWidth + 15, height - 4); | ||||||
|     daysX = width - 10 - 7*daysSize; |     daysX = width - 10 - 7 * daysSize; | ||||||
|     daysY = (height  - daysSize) / 2; |     daysY = (height  - daysSize) / 2; | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -2210,20 +2171,20 @@ void cRecMenuItemDayChooser::setBackground() { | |||||||
|  |  | ||||||
| void cRecMenuItemDayChooser::Draw(void) { | void cRecMenuItemDayChooser::Draw(void) { | ||||||
|     int textY = (height - font->Height()) / 2; |     int textY = (height - font->Height()) / 2; | ||||||
|     pixmap->DrawText(cPoint(10 + indent * 30, textY), *text, colorText, colorTextBack, font); |     pixmap->DrawText(cPoint(10, textY), *text, colorText, colorTextBack, font); | ||||||
|     DrawDays(); |     DrawDays(); | ||||||
| } | } | ||||||
|  |  | ||||||
| void cRecMenuItemDayChooser::DrawDays(void) { | void cRecMenuItemDayChooser::DrawDays(void) { | ||||||
|     pixmapWeekdays->Fill(clrTransparent); |     pixmapWeekdays->Fill(clrTransparent); | ||||||
|     int textY = (height - font->Height()) / 2; |     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; |     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)); |         cString strDay = cString::sprintf("%c", days.at(day)); | ||||||
|         pixmapWeekdays->DrawRectangle(cRect(currentX+2, daysY+2, daysSize-4, daysSize-4), theme.Color(clrBackground)); |         pixmapWeekdays->DrawRectangle(cRect(currentX + 2, daysY + 2, daysSize - 4, daysSize - 4), theme.Color(clrBackground)); | ||||||
|         tColor colorDay = WeekDaySet(day)?theme.Color(clrRecMenuDayActive) |         tColor colorDay = WeekDaySet(day) ? theme.Color(clrRecMenuDayActive) | ||||||
|                                          :theme.Color(clrRecMenuDayInactive); |                                           : theme.Color(clrRecMenuDayInactive); | ||||||
|         int textX = currentX + (daysSize - font->Width(*strDay)) / 2; |         int textX = currentX + (daysSize - font->Width(*strDay)) / 2; | ||||||
|         pixmapWeekdays->DrawText(cPoint(textX, textY), *strDay, colorDay, clrTransparent, font); |         pixmapWeekdays->DrawText(cPoint(textX, textY), *strDay, colorDay, clrTransparent, font); | ||||||
|         currentX += daysSize; |         currentX += daysSize; | ||||||
| @@ -2233,7 +2194,7 @@ void cRecMenuItemDayChooser::DrawDays(void) { | |||||||
| void cRecMenuItemDayChooser::DrawHighlight(int day) { | void cRecMenuItemDayChooser::DrawHighlight(int day) { | ||||||
|     pixmapWeekdaysSelect->Fill(clrTransparent); |     pixmapWeekdaysSelect->Fill(clrTransparent); | ||||||
|     if (day > -1) { |     if (day > -1) { | ||||||
|         int currentX = daysX + day*daysSize; |         int currentX = daysX + day * daysSize; | ||||||
|         pixmapWeekdaysSelect->DrawRectangle(cRect(currentX, daysY, daysSize, daysSize), theme.Color(clrRecMenuDayHighlight)); |         pixmapWeekdaysSelect->DrawRectangle(cRect(currentX, daysY, daysSize, daysSize), theme.Color(clrRecMenuDayHighlight)); | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @@ -2259,13 +2220,13 @@ eRecMenuState cRecMenuItemDayChooser::ProcessKey(eKeys Key) { | |||||||
|     switch (Key & ~k_Repeat) { |     switch (Key & ~k_Repeat) { | ||||||
|         case kLeft: { |         case kLeft: { | ||||||
|             selectedDay--; |             selectedDay--; | ||||||
|             if (selectedDay<0) |             if (selectedDay < 0) | ||||||
|                 selectedDay += 7; |                 selectedDay += 7; | ||||||
|             DrawHighlight(selectedDay); |             DrawHighlight(selectedDay); | ||||||
|             return rmsConsumed; |             return rmsConsumed; | ||||||
|             break; } |             break; } | ||||||
|         case kRight: { |         case kRight: { | ||||||
|             selectedDay = (selectedDay+1)%7; |             selectedDay = (selectedDay + 1) % 7; | ||||||
|             DrawHighlight(selectedDay); |             DrawHighlight(selectedDay); | ||||||
|             return rmsConsumed; |             return rmsConsumed; | ||||||
|             break; } |             break; } | ||||||
| @@ -2417,10 +2378,10 @@ void cRecMenuItemTimelineHeader::DrawCurrentTimer(void) { | |||||||
|     const cChannel *channel = timer->Channel(); |     const cChannel *channel = timer->Channel(); | ||||||
|     int x = 0; |     int x = 0; | ||||||
|     if (channel) { |     if (channel) { | ||||||
|         int logoWidth = infoHeight * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio; |         int logoWidth = infoHeight * config.logoWidthRatio / config.logoHeightRatio; | ||||||
|         bool logoDrawn = false; |         bool logoDrawn = false; | ||||||
|         cImageLoader imgLoader; |         cImageLoader imgLoader; | ||||||
|         if (!tvguideConfig.hideChannelLogos) { |         if (!config.hideChannelLogos) { | ||||||
|             if (imgLoader.LoadLogo(channel, logoWidth, infoHeight)) { |             if (imgLoader.LoadLogo(channel, logoWidth, infoHeight)) { | ||||||
|                 cImage logo = imgLoader.GetImage(); |                 cImage logo = imgLoader.GetImage(); | ||||||
|                 pixmapTimerInfo->DrawImage(cPoint(0, 0), logo); |                 pixmapTimerInfo->DrawImage(cPoint(0, 0), logo); | ||||||
| @@ -2428,7 +2389,7 @@ void cRecMenuItemTimelineHeader::DrawCurrentTimer(void) { | |||||||
|                 logoDrawn = true; |                 logoDrawn = true; | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         if (tvguideConfig.hideChannelLogos || !logoDrawn) { |         if (config.hideChannelLogos || !logoDrawn) { | ||||||
|             int channelNameWidth = fontSmall->Width(channel->Name()); |             int channelNameWidth = fontSmall->Width(channel->Name()); | ||||||
|             pixmapTimerInfo->DrawText(cPoint(10, (infoHeight - fontSmall->Height())/2), channel->Name(), colorText, clrTransparent, fontSmall); |             pixmapTimerInfo->DrawText(cPoint(10, (infoHeight - fontSmall->Height())/2), channel->Name(), colorText, clrTransparent, fontSmall); | ||||||
|             x += channelNameWidth + 20; |             x += channelNameWidth + 20; | ||||||
|   | |||||||
| @@ -194,21 +194,16 @@ private: | |||||||
|     int *callback; |     int *callback; | ||||||
|     int minVal; |     int minVal; | ||||||
|     int maxVal; |     int maxVal; | ||||||
| //    bool refresh; |  | ||||||
|     int indent; |  | ||||||
|     cPixmap *pixmapVal; |     cPixmap *pixmapVal; | ||||||
|     bool fresh; |     bool fresh; | ||||||
|     void DrawValue(void); |     void DrawValue(void); | ||||||
| public: | public: | ||||||
|     cRecMenuItemInt(cString text, |     cRecMenuItemInt(cString text, | ||||||
|                     int initialVal, |  | ||||||
|                     int minVal, |                     int minVal, | ||||||
|                     int maxVal, |                     int maxVal, | ||||||
| //                    bool refresh = false, |  | ||||||
|                     bool active = false, |                     bool active = false, | ||||||
|                     int *callback = NULL, |                     int *callback = NULL, | ||||||
|                     eRecMenuState action = rmsNotConsumed, |                     eRecMenuState action = rmsNotConsumed); | ||||||
|                     int indent = 0); |  | ||||||
|     virtual ~cRecMenuItemInt(void); |     virtual ~cRecMenuItemInt(void); | ||||||
|     void SetPixmaps(void); |     void SetPixmaps(void); | ||||||
|     void Hide(void); |     void Hide(void); | ||||||
| @@ -224,26 +219,21 @@ class cRecMenuItemBool : public cRecMenuItem { | |||||||
| private: | private: | ||||||
|     cString text; |     cString text; | ||||||
|     bool yes; |     bool yes; | ||||||
|     int indent; |  | ||||||
|     bool *callback; |     bool *callback; | ||||||
|     cPixmap *pixmapVal; |     cPixmap *pixmapVal; | ||||||
|     bool refresh; |     bool refresh; | ||||||
|     void DrawValue(void); |     void DrawValue(void); | ||||||
| public: | public: | ||||||
|     cRecMenuItemBool(cString text, |     cRecMenuItemBool(cString text, | ||||||
|                      bool initialVal, |  | ||||||
|                      bool refresh = false, |  | ||||||
|                      bool active = false, |                      bool active = false, | ||||||
|                      bool *callback = NULL, |                      bool *callback = NULL, | ||||||
|                      eRecMenuState action = rmsNotConsumed, |                      eRecMenuState action = rmsNotConsumed, | ||||||
|                      int indent = 0); |                      bool refresh = false); | ||||||
|     cRecMenuItemBool(cString text, |     cRecMenuItemBool(cString text, | ||||||
|                      bool initialVal, |  | ||||||
|                      bool refresh = false, |  | ||||||
|                      bool active = false, |                      bool active = false, | ||||||
|                      int *callback = NULL, |                      int *callback = NULL, | ||||||
|                      eRecMenuState action = rmsNotConsumed, |                      eRecMenuState action = rmsNotConsumed, | ||||||
|                      int indent = 0); |                      bool refresh = false); | ||||||
|     virtual ~cRecMenuItemBool(void); |     virtual ~cRecMenuItemBool(void); | ||||||
|     void SetPixmaps(void); |     void SetPixmaps(void); | ||||||
|     void Hide(void); |     void Hide(void); | ||||||
| @@ -260,7 +250,6 @@ private: | |||||||
|     int currentVal; |     int currentVal; | ||||||
|     int *callback; |     int *callback; | ||||||
|     bool refresh; |     bool refresh; | ||||||
|     int indent; |  | ||||||
|     std::vector<std::string> strings; |     std::vector<std::string> strings; | ||||||
|     int numValues; |     int numValues; | ||||||
|     cPixmap *pixmapVal; |     cPixmap *pixmapVal; | ||||||
| @@ -268,12 +257,10 @@ private: | |||||||
| public: | public: | ||||||
|     cRecMenuItemSelect(cString text, |     cRecMenuItemSelect(cString text, | ||||||
|                        std::vector<std::string> Strings, |                        std::vector<std::string> Strings, | ||||||
|                        int initialVal, |  | ||||||
|                        bool active = false, |                        bool active = false, | ||||||
|                        int *callback = NULL, |                        int *callback = NULL, | ||||||
|                        eRecMenuState action = rmsNotConsumed, |                        eRecMenuState action = rmsNotConsumed, | ||||||
|                        bool refresh = false, |                        bool refresh = false); | ||||||
|                        int indent = 0); |  | ||||||
|     virtual ~cRecMenuItemSelect(void); |     virtual ~cRecMenuItemSelect(void); | ||||||
|     void SetPixmaps(void); |     void SetPixmaps(void); | ||||||
|     void Hide(void); |     void Hide(void); | ||||||
| @@ -292,7 +279,6 @@ private: | |||||||
|     std::vector<std::string> folders; |     std::vector<std::string> folders; | ||||||
|     int currentVal; |     int currentVal; | ||||||
|     char *callback; |     char *callback; | ||||||
|     int indent; |  | ||||||
|     int numValues; |     int numValues; | ||||||
|     cPixmap *pixmapVal; |     cPixmap *pixmapVal; | ||||||
|     void DrawValue(void); |     void DrawValue(void); | ||||||
| @@ -304,8 +290,7 @@ public: | |||||||
|                                 bool active = false, |                                 bool active = false, | ||||||
|                                 char *callback = NULL, |                                 char *callback = NULL, | ||||||
|                                 eRecMenuState action = rmsNotConsumed, |                                 eRecMenuState action = rmsNotConsumed, | ||||||
|                                 bool isSearchTimer = false, |                                 bool isSearchTimer = false); | ||||||
|                                 int indent = 0); |  | ||||||
|     virtual ~cRecMenuItemSelectDirectory(void); |     virtual ~cRecMenuItemSelectDirectory(void); | ||||||
|     void SetPixmaps(void); |     void SetPixmaps(void); | ||||||
|     void Hide(void); |     void Hide(void); | ||||||
| @@ -358,7 +343,6 @@ private: | |||||||
|     void DrawValue(char *newValue); |     void DrawValue(char *newValue); | ||||||
| public: | public: | ||||||
|     cRecMenuItemText(cString title, |     cRecMenuItemText(cString title, | ||||||
|                      char *initialVal, |  | ||||||
|                      int length, |                      int length, | ||||||
|                      bool active = false, |                      bool active = false, | ||||||
|                      char *callback = NULL); |                      char *callback = NULL); | ||||||
| @@ -379,7 +363,6 @@ private: | |||||||
|     cString text; |     cString text; | ||||||
|     int value; |     int value; | ||||||
|     int *callback; |     int *callback; | ||||||
|     int indent; |  | ||||||
|     int mm; |     int mm; | ||||||
|     int hh; |     int hh; | ||||||
|     int pos; |     int pos; | ||||||
| @@ -388,11 +371,9 @@ private: | |||||||
|     void DrawValue(void); |     void DrawValue(void); | ||||||
| public: | public: | ||||||
|     cRecMenuItemTime(cString text, |     cRecMenuItemTime(cString text, | ||||||
|                     int initialVal, |  | ||||||
|                     bool active = false, |                     bool active = false, | ||||||
|                     int *callback = NULL, |                     int *callback = NULL, | ||||||
|                     eRecMenuState action = rmsNotConsumed, |                     eRecMenuState action = rmsNotConsumed); | ||||||
|                     int indent = 0); |  | ||||||
|     virtual ~cRecMenuItemTime(void); |     virtual ~cRecMenuItemTime(void); | ||||||
|     void SetPixmaps(void); |     void SetPixmaps(void); | ||||||
|     void Hide(void); |     void Hide(void); | ||||||
| @@ -412,7 +393,6 @@ private: | |||||||
|     void DrawValue(void); |     void DrawValue(void); | ||||||
| public: | public: | ||||||
|     cRecMenuItemDay(cString text, |     cRecMenuItemDay(cString text, | ||||||
|                     time_t initialVal, |  | ||||||
|                     bool active = false, |                     bool active = false, | ||||||
|                     time_t *callback = NULL, |                     time_t *callback = NULL, | ||||||
|                     eRecMenuState action = rmsNotConsumed); |                     eRecMenuState action = rmsNotConsumed); | ||||||
| @@ -509,21 +489,25 @@ public: | |||||||
| class cRecMenuItemChannelChooser : public cRecMenuItem { | class cRecMenuItemChannelChooser : public cRecMenuItem { | ||||||
| private: | private: | ||||||
|     cString text; |     cString text; | ||||||
|  | #if VDRVERSNUM >= 20301 | ||||||
|  |     const cChannels *channels; | ||||||
|  |     const cChannel *chanNew; | ||||||
|  | #else | ||||||
|  |     cChannels *channels; | ||||||
|  |     cChannel *chanNew; | ||||||
|  | #endif | ||||||
|     const cChannel *channel; |     const cChannel *channel; | ||||||
|     int channelNumber; |     int channelNumber; | ||||||
|     int *callback; |     int *callback; | ||||||
|     int indent; |  | ||||||
|     bool initialChannelSet; |     bool initialChannelSet; | ||||||
|     bool fresh; |     bool fresh; | ||||||
|     cPixmap *pixmapChannel; |     cPixmap *pixmapChannel; | ||||||
|     void DrawValue(void); |     void DrawValue(void); | ||||||
| public: | public: | ||||||
|     cRecMenuItemChannelChooser (cString text, |     cRecMenuItemChannelChooser (cString text, | ||||||
|                                 const cChannel *initialChannel, |  | ||||||
|                                 bool active = false, |                                 bool active = false, | ||||||
|                                 int *callback = NULL, |                                 int *callback = NULL, | ||||||
|                                 eRecMenuState action = rmsNotConsumed, |                                 eRecMenuState action = rmsNotConsumed); | ||||||
|                                 int indent = 0); |  | ||||||
|     virtual ~cRecMenuItemChannelChooser(void); |     virtual ~cRecMenuItemChannelChooser(void); | ||||||
|     void SetPixmaps(void); |     void SetPixmaps(void); | ||||||
|     void Hide(void); |     void Hide(void); | ||||||
| @@ -539,7 +523,6 @@ private: | |||||||
|     cString text; |     cString text; | ||||||
|     int weekdays; |     int weekdays; | ||||||
|     int *callback; |     int *callback; | ||||||
|     int indent; |  | ||||||
|     bool epgsearchMode; |     bool epgsearchMode; | ||||||
|     std::string days; |     std::string days; | ||||||
|     int daysX; |     int daysX; | ||||||
| @@ -555,10 +538,8 @@ private: | |||||||
|     bool WeekDaySet(unsigned day); |     bool WeekDaySet(unsigned day); | ||||||
| public: | public: | ||||||
|     cRecMenuItemDayChooser (cString text, |     cRecMenuItemDayChooser (cString text, | ||||||
|                             int weekdays, |  | ||||||
|                             bool active = false, |                             bool active = false, | ||||||
|                             int *callback = NULL, |                             int *callback = NULL); | ||||||
|                             int indent = 0); |  | ||||||
|     virtual ~cRecMenuItemDayChooser(void); |     virtual ~cRecMenuItemDayChooser(void); | ||||||
|     void SetPixmaps(void); |     void SetPixmaps(void); | ||||||
|     void Hide(void); |     void Hide(void); | ||||||
|   | |||||||
							
								
								
									
										347
									
								
								recmenus.c
									
									
									
									
									
								
							
							
						
						
									
										347
									
								
								recmenus.c
									
									
									
									
									
								
							| @@ -1,13 +1,13 @@ | |||||||
| #include "services/remotetimers.h" | #include "services/remotetimers.h" | ||||||
| #include "tools.h" | #include "tools.h" | ||||||
| #include "recmenumanager.h" | #include "recmenuview.h" | ||||||
| #include "recmenus.h" | #include "recmenus.h" | ||||||
|  |  | ||||||
| // --- cRecMenuMain  --------------------------------------------------------- | // --- cRecMenuMain  --------------------------------------------------------- | ||||||
| cRecMenuMain::cRecMenuMain(bool epgSearchAvailable, bool timerActive, bool switchTimerActive) { | cRecMenuMain::cRecMenuMain(bool epgSearchAvailable, bool timerActive, bool switchTimerActive) { | ||||||
|     eRecMenuState action = rmsInstantRecord; |     eRecMenuState action = rmsInstantRecord; | ||||||
|     if (!timerActive) { |     if (!timerActive) { | ||||||
|         if (tvguideConfig.instRecFolderMode == eFolderSelect) |         if (config.instRecFolderMode == eFolderSelect) | ||||||
|             action = rmsInstantRecordFolder; |             action = rmsInstantRecordFolder; | ||||||
|         AddMenuItem(new cRecMenuItemButton(tr("Instant Record"), action, true, false, false, true)); |         AddMenuItem(new cRecMenuItemButton(tr("Instant Record"), action, true, false, false, true)); | ||||||
|     } else { |     } else { | ||||||
| @@ -22,7 +22,7 @@ cRecMenuMain::cRecMenuMain(bool epgSearchAvailable, bool timerActive, bool switc | |||||||
|         AddMenuItem(new cRecMenuItemButton(tr("Search Timers"), rmsSearchTimers, false, false, false, true)); |         AddMenuItem(new cRecMenuItemButton(tr("Search Timers"), rmsSearchTimers, false, false, false, true)); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     if (tvguideConfig.instRecFolderMode == eFolderSelect) |     if (config.instRecFolderMode == eFolderSelect) | ||||||
|         action = rmsSeriesTimerFolder; |         action = rmsSeriesTimerFolder; | ||||||
|     else |     else | ||||||
|         action = rmsSeriesTimer; |         action = rmsSeriesTimer; | ||||||
| @@ -103,7 +103,7 @@ std::string cRecMenuAskFolder::GetFolder(void) { | |||||||
| } | } | ||||||
|  |  | ||||||
| // --- cRecMenuConfirmTimer  --------------------------------------------------------- | // --- cRecMenuConfirmTimer  --------------------------------------------------------- | ||||||
| cRecMenuConfirmTimer::cRecMenuConfirmTimer(const cEvent *event) { | cRecMenuConfirmTimer::cRecMenuConfirmTimer(const cEvent *event, bool timerChanged) { | ||||||
|     SetWidthPercent(50); |     SetWidthPercent(50); | ||||||
| #if VDRVERSNUM >= 20301 | #if VDRVERSNUM >= 20301 | ||||||
|     LOCK_CHANNELS_READ; |     LOCK_CHANNELS_READ; | ||||||
| @@ -111,9 +111,8 @@ cRecMenuConfirmTimer::cRecMenuConfirmTimer(const cEvent *event) { | |||||||
| #else | #else | ||||||
|     const cString channelName = Channels.GetByChannelID(event->ChannelID())->Name(); |     const cString channelName = Channels.GetByChannelID(event->ChannelID())->Name(); | ||||||
| #endif | #endif | ||||||
|     cString message; |  | ||||||
|     bool eventHasTimer = false; |     bool eventHasTimer = false; | ||||||
|     if (tvguideConfig.useRemoteTimers && pRemoteTimers) { |     if (config.useRemoteTimers && pRemoteTimers) { | ||||||
|         RemoteTimers_GetMatch_v1_0 rtMatch; |         RemoteTimers_GetMatch_v1_0 rtMatch; | ||||||
|         rtMatch.event = event; |         rtMatch.event = event; | ||||||
|         pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch); |         pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch); | ||||||
| @@ -123,11 +122,9 @@ cRecMenuConfirmTimer::cRecMenuConfirmTimer(const cEvent *event) { | |||||||
|     } else { |     } else { | ||||||
|         eventHasTimer = event->HasTimer(); |         eventHasTimer = event->HasTimer(); | ||||||
|     } |     } | ||||||
|     if (eventHasTimer) { |     const cString message = (eventHasTimer) ? (timerChanged) ? tr("Timer changed") | ||||||
|         message = tr("Timer created"); |                                                              : tr("Timer created") | ||||||
|     } else { |                                             : tr("Timer NOT created"); | ||||||
|         message = tr("Timer NOT created"); |  | ||||||
|     } |  | ||||||
|     cString text = cString::sprintf("%s\n%s\n%s %s - %s\n%s",  |     cString text = cString::sprintf("%s\n%s\n%s %s - %s\n%s",  | ||||||
|                                     *message,  |                                     *message,  | ||||||
|                                     *channelName, |                                     *channelName, | ||||||
| @@ -426,7 +423,7 @@ cRecMenuEditTimer::cRecMenuEditTimer(const cTimer *timer, eRecMenuState nextStat | |||||||
|     AddMenuItemInitial(infoItem); |     AddMenuItemInitial(infoItem); | ||||||
|                  |                  | ||||||
|     timerActive = false; |     timerActive = false; | ||||||
|     if (tvguideConfig.useRemoteTimers && pRemoteTimers) { |     if (config.useRemoteTimers && pRemoteTimers) { | ||||||
|         RemoteTimers_GetMatch_v1_0 rtMatch; |         RemoteTimers_GetMatch_v1_0 rtMatch; | ||||||
|         rtMatch.event = timer->Event(); |         rtMatch.event = timer->Event(); | ||||||
|         pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch); |         pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch); | ||||||
| @@ -444,12 +441,12 @@ cRecMenuEditTimer::cRecMenuEditTimer(const cTimer *timer, eRecMenuState nextStat | |||||||
|     lifetime = timer->Lifetime(); |     lifetime = timer->Lifetime(); | ||||||
|     strncpy(folder, GetDirectoryFromTimer(timer->File()).c_str(), TEXTINPUTLENGTH); |     strncpy(folder, GetDirectoryFromTimer(timer->File()).c_str(), TEXTINPUTLENGTH); | ||||||
|      |      | ||||||
|     AddMenuItemInitial(new cRecMenuItemBool(tr("Timer Active"), timerActive, false, true, &timerActive)); |     AddMenuItemInitial(new cRecMenuItemBool(tr("Timer Active"), true, &timerActive)); | ||||||
|     AddMenuItemInitial(new cRecMenuItemInt(tr("Priority"), prio, 0, MAXPRIORITY, false, &prio)); |     AddMenuItemInitial(new cRecMenuItemInt(tr("Priority"), 0, MAXPRIORITY, false, &prio)); | ||||||
|     AddMenuItemInitial(new cRecMenuItemInt(tr("Lifetime"), lifetime, 0, MAXLIFETIME, false, &lifetime)); |     AddMenuItemInitial(new cRecMenuItemInt(tr("Lifetime"), 0, MAXLIFETIME, false, &lifetime)); | ||||||
|     AddMenuItemInitial(new cRecMenuItemDay(tr("Day"), day, false, &day)); |     AddMenuItemInitial(new cRecMenuItemDay(tr("Day"), false, &day)); | ||||||
|     AddMenuItemInitial(new cRecMenuItemTime(tr("Timer start time"), start, false, &start)); |     AddMenuItemInitial(new cRecMenuItemTime(tr("Timer start time"), false, &start)); | ||||||
|     AddMenuItemInitial(new cRecMenuItemTime(tr("Timer stop time"), stop, false, &stop)); |     AddMenuItemInitial(new cRecMenuItemTime(tr("Timer stop time"), false, &stop)); | ||||||
|     cString fileInfo = cString::sprintf("%s:\n%s", tr("Timer File"), timer->File()); |     cString fileInfo = cString::sprintf("%s:\n%s", tr("Timer File"), timer->File()); | ||||||
|     cRecMenuItemInfo *fileInfoItem = new cRecMenuItemInfo(*fileInfo, false); |     cRecMenuItemInfo *fileInfoItem = new cRecMenuItemInfo(*fileInfo, false); | ||||||
|     fileInfoItem->CalculateHeight(width - 2 * border); |     fileInfoItem->CalculateHeight(width - 2 * border); | ||||||
| @@ -470,17 +467,17 @@ const cTimer *cRecMenuEditTimer::GetOriginalTimer(void) { | |||||||
|     return originalTimer; |     return originalTimer; | ||||||
| } | } | ||||||
|  |  | ||||||
| cTimer cRecMenuEditTimer::GetTimer(void) { | cTimer *cRecMenuEditTimer::GetTimer(void) { | ||||||
|     cTimer t; |     cTimer *t = (cTimer *)originalTimer; | ||||||
|     if (timerActive) |     if (timerActive) | ||||||
|         t.SetFlags(tfActive); |         t->SetFlags(tfActive); | ||||||
|     else  |     else  | ||||||
|         t.SetFlags(tfNone); |         t->ClrFlags(tfActive); | ||||||
|     t.SetDay(day); |     t->SetDay(day); | ||||||
|     t.SetStart(start); |     t->SetStart(start); | ||||||
|     t.SetStop(stop); |     t->SetStop(stop); | ||||||
|     t.SetPriority(prio); |     t->SetPriority(prio); | ||||||
|     t.SetLifetime(lifetime); |     t->SetLifetime(lifetime); | ||||||
|     std::string newFolder(folder); |     std::string newFolder(folder); | ||||||
|     std::string newFile = originalTimer->File(); |     std::string newFile = originalTimer->File(); | ||||||
|     size_t found = newFile.find_last_of('~'); |     size_t found = newFile.find_last_of('~'); | ||||||
| @@ -495,7 +492,7 @@ cTimer cRecMenuEditTimer::GetTimer(void) { | |||||||
|             newFile = *cString::sprintf("%s~%s", newFolder.c_str(), newFile.c_str()); |             newFile = *cString::sprintf("%s~%s", newFolder.c_str(), newFile.c_str()); | ||||||
|     } |     } | ||||||
|     std::replace(newFile.begin(), newFile.end(), '/', '~'); |     std::replace(newFile.begin(), newFile.end(), '/', '~'); | ||||||
|     t.SetFile(newFile.c_str()); |     t->SetFile(newFile.c_str()); | ||||||
|     return t; |     return t; | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -522,18 +519,14 @@ cRecMenuSeriesTimer::cRecMenuSeriesTimer(const cChannel *initialChannel, const c | |||||||
|     infoItem->CalculateHeight(width - 2 * border); |     infoItem->CalculateHeight(width - 2 * border); | ||||||
|     SetHeader(infoItem); |     SetHeader(infoItem); | ||||||
|  |  | ||||||
|     AddMenuItem(new cRecMenuItemBool(tr("Timer Active"), timerActive, false, false, &timerActive)); |     AddMenuItem(new cRecMenuItemBool(tr("Timer Active"), false, &timerActive)); | ||||||
| #if VDRVERSNUM >= 20301 |     AddMenuItem(new cRecMenuItemChannelChooser(tr("Channel"), false, &channel)); | ||||||
|     AddMenuItem(new cRecMenuItemChannelChooser(tr("Channel"), initialChannel, false, &channel)); |     AddMenuItem(new cRecMenuItemTime(tr("Series Timer start time"), false, &start)); | ||||||
| #else |     AddMenuItem(new cRecMenuItemTime(tr("Series Timer stop time"), false, &stop)); | ||||||
|     AddMenuItem(new cRecMenuItemChannelChooser(tr("Channel"), (cChannel*)initialChannel, false, &channel)); |     AddMenuItem(new cRecMenuItemDayChooser(tr("Days to record"), false, &dayOfWeek)); | ||||||
| #endif |     AddMenuItem(new cRecMenuItemDay(tr("Day to start"), false, &tstart)); | ||||||
|     AddMenuItem(new cRecMenuItemTime(tr("Series Timer start time"), start, false, &start)); |     AddMenuItem(new cRecMenuItemInt(tr("Priority"), 0, MAXPRIORITY, false, &priority)); | ||||||
|     AddMenuItem(new cRecMenuItemTime(tr("Series Timer stop time"), stop, false, &stop)); |     AddMenuItem(new cRecMenuItemInt(tr("Lifetime"), 0, MAXLIFETIME, false, &lifetime)); | ||||||
|     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 cRecMenuItemButtonYesNo(tr("Create Timer"), tr("Cancel"), rmsSeriesTimerCreate, rmsClose, true)); |     AddMenuItem(new cRecMenuItemButtonYesNo(tr("Create Timer"), tr("Cancel"), rmsSeriesTimerCreate, rmsClose, true)); | ||||||
|  |  | ||||||
| @@ -615,7 +608,7 @@ cRecMenuSearchTimer::cRecMenuSearchTimer(const cEvent *event) { | |||||||
|     infoItem->CalculateHeight(width - 2 * border); |     infoItem->CalculateHeight(width - 2 * border); | ||||||
|     SetHeader(infoItem); |     SetHeader(infoItem); | ||||||
|     strncpy(searchString, event->Title(), TEXTINPUTLENGTH); |     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)); |     AddMenuItemInitial(new cRecMenuItemButtonYesNo(tr("Continue"), tr("Cancel"), rmsSearchTimerOptions, rmsClose, true)); | ||||||
|     CalculateHeight(); |     CalculateHeight(); | ||||||
|     CreatePixmap(); |     CreatePixmap(); | ||||||
| @@ -721,13 +714,22 @@ int cRecMenuSearchTimers::GetTotalNumMenuItems(void) { | |||||||
| cRecMenuSearchTimerEdit::cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer, std::vector<std::string> channelGroups) { | cRecMenuSearchTimerEdit::cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer, std::vector<std::string> channelGroups) { | ||||||
|     init = true; |     init = true; | ||||||
|     deleteMenuItems = false; |     deleteMenuItems = false; | ||||||
|     this->searchTimer = searchTimer; |  | ||||||
|     this->sT = searchTimer; |     this->sT = searchTimer; | ||||||
|     this->channelGroups = channelGroups; |     this->channelGroups = channelGroups; | ||||||
|     strncpy(searchString, sT.searchString.c_str(), TEXTINPUTLENGTH); |     strncpy(searchString, sT.searchString.c_str(), TEXTINPUTLENGTH); | ||||||
|     channelgroupIndex = -1; |     channelgroupIndex = -1; | ||||||
|     std::string dir = sT.directory; |     std::string dir = sT.directory; | ||||||
|     strncpy(directory, dir.c_str(), TEXTINPUTLENGTH); |     strncpy(directory, dir.c_str(), TEXTINPUTLENGTH); | ||||||
|  |     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.GetSearchModes(&searchModes); | ||||||
|     sT.GetUseChannelModes(&useChannelModes); |     sT.GetUseChannelModes(&useChannelModes); | ||||||
| @@ -758,6 +760,31 @@ cRecMenuSearchTimerEdit::~cRecMenuSearchTimerEdit(void) { | |||||||
|     mainMenuItems.clear(); |     mainMenuItems.clear(); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | 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; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | 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); | ||||||
|  | } | ||||||
|  |  | ||||||
| int cRecMenuSearchTimerEdit::SplitChannelGroups(std::vector<std::string> *channelGroups, std::vector<std::string> *channelgroups) { | int cRecMenuSearchTimerEdit::SplitChannelGroups(std::vector<std::string> *channelGroups, std::vector<std::string> *channelgroups) { | ||||||
|     int i = 0; |     int i = 0; | ||||||
|     int j = 0; |     int j = 0; | ||||||
| @@ -789,94 +816,82 @@ void cRecMenuSearchTimerEdit::CreateMenuItems(void) { | |||||||
|         mainMenuItems.clear(); |         mainMenuItems.clear(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     mainMenuItems.push_back(new cRecMenuItemText(tr("Search term"), searchString, TEXTINPUTLENGTH, init, searchString)); |     mainMenuItems.push_back(new cRecMenuItemText(tr("Search term"), TEXTINPUTLENGTH, init, searchString)); | ||||||
|     mainMenuItems.push_back(new cRecMenuItemBool(tr("Active"), sT.useAsSearchTimer, true, false, &sT.useAsSearchTimer, rmsSearchTimerSave)); |     mainMenuItems.push_back(new cRecMenuItemBool(tr("Active"), false, &sT.useAsSearchTimer, rmsSearchTimerSave, true)); | ||||||
|     mainMenuItems.push_back(new cRecMenuItemSelect(tr("Search mode"), searchModes, sT.mode, false, &sT.mode, rmsSearchTimerSave, true)); |     mainMenuItems.push_back(new cRecMenuItemSelect(tr("Search mode"), searchModes, false, &sT.mode, rmsSearchTimerSave, true)); | ||||||
|     if (sT.mode == 5) { |     if (sT.mode == 5) { | ||||||
|         mainMenuItems.push_back(new cRecMenuItemInt(tr("Tolerance"), sT.fuzzyTolerance, 1, 9, false, &sT.fuzzyTolerance, rmsSearchTimerSave, 1)); |         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"), sT.useCase, false, false, &sT.useCase, rmsSearchTimerSave)); |     mainMenuItems.push_back(new cRecMenuItemBool(tr("Match case"), false, &sT.useCase, rmsSearchTimerSave)); | ||||||
|     mainMenuItems.push_back(new cRecMenuItemBool(tr("Use title"), sT.useTitle, false, false, &sT.useTitle, rmsSearchTimerSave)); |     mainMenuItems.push_back(new cRecMenuItemBool(tr("Use title"), false, &sT.useTitle, rmsSearchTimerSave)); | ||||||
|     mainMenuItems.push_back(new cRecMenuItemBool(tr("Use subtitle"), sT.useSubtitle, false, false, &sT.useSubtitle, rmsSearchTimerSave)); |     mainMenuItems.push_back(new cRecMenuItemBool(tr("Use subtitle"), false, &sT.useSubtitle, rmsSearchTimerSave)); | ||||||
|     mainMenuItems.push_back(new cRecMenuItemBool(tr("Use description"), sT.useDescription, false, false, &sT.useDescription, rmsSearchTimerSave)); |     mainMenuItems.push_back(new cRecMenuItemBool(tr("Use description"), false, &sT.useDescription, rmsSearchTimerSave)); | ||||||
| //    mainMenuItems.push_back(new cRecMenuItemBool(tr("Use content descriptor"), sT.useContentDescriptors, false, false, &sT.useContentDescriptors, rmsSearchTimerSave)); | //    mainMenuItems.push_back(new cRecMenuItemBool(tr("Use content descriptor"), false, &sT.useContentDescriptors, rmsSearchTimerSave)); | ||||||
|     mainMenuItems.push_back(new cRecMenuItemSelect(tr("Use channel"), useChannelModes, sT.useChannel, false, &sT.useChannel, rmsSearchTimerSave, true)); |     mainMenuItems.push_back(new cRecMenuItemSelect(tr("Use channel"), useChannelModes, false, &sT.useChannel, rmsSearchTimerSave, true)); | ||||||
|     if (sT.useChannel == 1) { |     if (sT.useChannel == 1) { | ||||||
|         startChannel = (sT.channelMin) ? sT.channelMin->Number() : 0; |         mainMenuItems.push_back(new cRecMenuItemChannelChooser(cString::sprintf("%s%s", *indent, tr("from channel")), false, &startChannel, rmsSearchTimerSave)); | ||||||
|         stopChannel = (sT.channelMax) ? sT.channelMax->Number() : 0; |         mainMenuItems.push_back(new cRecMenuItemChannelChooser(cString::sprintf("%s%s", *indent, tr("to channel")), false, &stopChannel, rmsSearchTimerSave)); | ||||||
|         if (startChannel == 0) startChannel = 1; |  | ||||||
|         if (stopChannel == 0) stopChannel = 1; |  | ||||||
| #if VDRVERSNUM >= 20301 |  | ||||||
|         { |  | ||||||
|         LOCK_CHANNELS_READ; |  | ||||||
|         mainMenuItems.push_back(new cRecMenuItemChannelChooser(tr("from channel"), Channels->GetByNumber(startChannel), false, &startChannel, rmsSearchTimerSave, 1)); |  | ||||||
|         mainMenuItems.push_back(new cRecMenuItemChannelChooser(tr("to channel"), Channels->GetByNumber(stopChannel), false, &stopChannel, rmsSearchTimerSave, 1)); |  | ||||||
|         } |  | ||||||
| #else |  | ||||||
|         mainMenuItems.push_back(new cRecMenuItemChannelChooser(tr("from channel"), Channels.GetByNumber(startChannel), false, &startChannel, rmsSearchTimerSave, 1)); |  | ||||||
|         mainMenuItems.push_back(new cRecMenuItemChannelChooser(tr("to channel"), Channels.GetByNumber(stopChannel), false, &stopChannel, rmsSearchTimerSave, 1)); |  | ||||||
| #endif |  | ||||||
|     } |     } | ||||||
|     else if ((sT.useChannel == 2) && (channelgroups.size() > 0)) { |     else if ((sT.useChannel == 2) && (channelgroups.size() > 0)) { | ||||||
|         mainMenuItems.push_back(new cRecMenuItemSelect(tr("Channel group"), channelgroups, channelgroupIndex, false, &channelgroupIndex, rmsSearchTimerSave, false, 1)); |         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"), sT.useTime, true, false, &sT.useTime, rmsSearchTimerSave)); |     mainMenuItems.push_back(new cRecMenuItemBool(tr("Use time"), false, &sT.useTime, rmsSearchTimerSave, true)); | ||||||
|     if (sT.useTime) { |     if (sT.useTime) { | ||||||
|         mainMenuItems.push_back(new cRecMenuItemTime(tr("Start after"), sT.startTime, false, &sT.startTime, rmsSearchTimerSave, 1)); |         mainMenuItems.push_back(new cRecMenuItemTime(cString::sprintf("%s%s", *indent, tr("Start after")), false, &sT.startTime, rmsSearchTimerSave)); | ||||||
|         mainMenuItems.push_back(new cRecMenuItemTime(tr("Start before"), sT.stopTime, false, &sT.stopTime, rmsSearchTimerSave, 1)); |         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"), sT.useDuration, true, false, &sT.useDuration, rmsSearchTimerSave)); |     mainMenuItems.push_back(new cRecMenuItemBool(tr("Use duration"), false, &sT.useDuration, rmsSearchTimerSave, true)); | ||||||
|     if (sT.useDuration) { |     if (sT.useDuration) { | ||||||
|         mainMenuItems.push_back(new cRecMenuItemTime(tr("Min. duration"), sT.minDuration, false, &sT.minDuration, rmsSearchTimerSave, 1)); |         mainMenuItems.push_back(new cRecMenuItemTime(cString::sprintf("%s%s", *indent, tr("Min. duration")), false, &sT.minDuration, rmsSearchTimerSave)); | ||||||
|         mainMenuItems.push_back(new cRecMenuItemTime(tr("Max. duration"), sT.maxDuration, false, &sT.maxDuration, rmsSearchTimerSave, 1)); |         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"), sT.useDayOfWeek, true, false, &sT.useDayOfWeek, rmsSearchTimerSave)); |     mainMenuItems.push_back(new cRecMenuItemBool(tr("Use day of week"), false, &sT.useDayOfWeek, rmsSearchTimerSave, true)); | ||||||
|     if (sT.useDayOfWeek) |     if (sT.useDayOfWeek) | ||||||
|         mainMenuItems.push_back(new cRecMenuItemDayChooser(tr("Day of week"), sT.dayOfWeek, false, &sT.dayOfWeek, 1)); |         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"), sT.useInFavorites, false, false, &sT.useInFavorites, rmsSearchTimerSave)); |     mainMenuItems.push_back(new cRecMenuItemBool(tr("Use in Favorites"), false, &sT.useInFavorites, rmsSearchTimerSave)); | ||||||
|     mainMenuItems.push_back(new cRecMenuItemBool(tr("Use as search timer"), sT.useAsSearchTimer, true, false, &sT.useAsSearchTimer, rmsSearchTimerSave)); |     mainMenuItems.push_back(new cRecMenuItemBool(tr("Use as search timer"), false, &sT.useAsSearchTimer, rmsSearchTimerSave, true)); | ||||||
|     if (sT.useAsSearchTimer) { |     if (sT.useAsSearchTimer) { | ||||||
|         mainMenuItems.push_back(new cRecMenuItemSelect(tr("Action"), searchTimerModes, sT.action, false, &sT.action, rmsSearchTimerSave, true, 1)); |         mainMenuItems.push_back(new cRecMenuItemSelect(cString::sprintf("%s%s", *indent, tr("Action")), searchTimerModes, false, &sT.action, rmsSearchTimerSave, true)); | ||||||
|         if (sT.action == searchTimerActionSwitchOnly) { |         if (sT.action == searchTimerActionSwitchOnly) { | ||||||
|             mainMenuItems.push_back(new cRecMenuItemInt(tr("Switch ... minutes before start"), sT.switchMinsBefore, 0, 99, false, &sT.switchMinsBefore, rmsSearchTimerSave, 2)); |             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(tr("Unmute sound"), sT.unmuteSoundOnSwitch, false, false, &sT.unmuteSoundOnSwitch, rmsSearchTimerSave, 2)); |             mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s", *indent, *indent, tr("Unmute sound")), false, &sT.unmuteSoundOnSwitch, rmsSearchTimerSave)); | ||||||
|         } |         } | ||||||
|         if (sT.action ==  searchTimerActionAnnounceAndSwitch) { |         if (sT.action ==  searchTimerActionAnnounceAndSwitch) { | ||||||
|             mainMenuItems.push_back(new cRecMenuItemInt(tr("Ask ... minutes before start"), sT.switchMinsBefore, 0, 99, false, &sT.switchMinsBefore, rmsSearchTimerSave, 2)); |             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(tr("Unmute sound"), sT.unmuteSoundOnSwitch, false, false, &sT.unmuteSoundOnSwitch, rmsSearchTimerSave, 2)); |             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)) { |         if ((sT.action == searchTimerActionRecord) || (sT.action == searchTimerActionInactiveRecord)) { | ||||||
|             mainMenuItems.push_back(new cRecMenuItemBool(tr("Series Recording"), sT.useEpisode, false, false, &sT.useEpisode, rmsSearchTimerSave, 2)); |             mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s", *indent, *indent, tr("Series Recording")), false, &sT.useEpisode, rmsSearchTimerSave)); | ||||||
|             mainMenuItems.push_back(new cRecMenuItemSelectDirectory(tr("Directory"), std::string(directory), false, directory, rmsSearchTimerSave, true, 2)); |             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(tr("Delete recordings after ... days"), sT.delAfterDays, 0, 999, false, &sT.delAfterDays, rmsSearchTimerSave, 2)); |             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) { |             if (sT.delAfterDays > 0) { | ||||||
|                 mainMenuItems.push_back(new cRecMenuItemInt(tr("Keep ... recordings"), sT.recordingsKeep, 0, 999, false, &sT.recordingsKeep, rmsSearchTimerSave, 3)); |                 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(tr("Pause when ... recordings exist"), sT.pauseOnNrRecordings, 0, 999, false, &sT.pauseOnNrRecordings, rmsSearchTimerSave, 2)); |             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(tr("Avoid Repeats"), sT.avoidRepeats, true, false, &sT.avoidRepeats, rmsSearchTimerSave, 2)); |             mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s", *indent, *indent, tr("Avoid Repeats")), false, &sT.avoidRepeats, rmsSearchTimerSave, true)); | ||||||
|             if (sT.avoidRepeats) { |             if (sT.avoidRepeats) { | ||||||
|                 mainMenuItems.push_back(new cRecMenuItemInt(tr("Allowed repeats"), sT.allowedRepeats, 0, 99, false, &sT.allowedRepeats, rmsSearchTimerSave, 3)); |                 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) { |                 if (sT.allowedRepeats > 0) { | ||||||
|                     mainMenuItems.push_back(new cRecMenuItemInt(tr("Only repeats within ... days"), sT.repeatsWithinDays, 0, 999, false, &sT.repeatsWithinDays, rmsSearchTimerSave, 4)); |                     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(tr("Compare Title"), sT.compareTitle, false, false, &sT.compareTitle, rmsSearchTimerSave, 3)); |                 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(tr("Compare Subtitle"), sT.compareSubtitle, false, false, &sT.compareSubtitle, rmsSearchTimerSave, 3)); |                 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(tr("Compare Description"), sT.compareSummary, true, false, &sT.compareSummary, rmsSearchTimerSave, 3)); |                 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) { |                 if (sT.compareSummary) { | ||||||
|                     mainMenuItems.push_back(new cRecMenuItemInt(tr("Min. match in %"), sT.compareSummaryMatchInPercent, 1, 100, false, &sT.compareSummaryMatchInPercent, rmsSearchTimerSave, 4)); |                     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(tr("Compare date"), compareDateModes, sT.compareDate, false, &sT.compareDate, rmsSearchTimerSave, false, 3)); |                 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(tr("Priority"), sT.priority, 0, 99, false, &sT.priority, rmsSearchTimerSave, 2)); |             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(tr("Lifetime"), sT.lifetime, 0, 99, false, &sT.lifetime, rmsSearchTimerSave, 2)); |             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(tr("Time margin for start in minutes"), sT.marginStart, 0, 30, false, &sT.marginStart, rmsSearchTimerSave, 2)); |             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(tr("Time margin for stop in minutes"), sT.marginStop, 0, 30, false, &sT.marginStop, rmsSearchTimerSave, 2)); |             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(tr("Use VPS"), sT.useVPS, false, false, &sT.useVPS, rmsSearchTimerSave, 2)); |             mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s", *indent, *indent, tr("Use VPS")), false, &sT.useVPS, rmsSearchTimerSave)); | ||||||
|             mainMenuItems.push_back(new cRecMenuItemSelect(tr("Auto delete"), delModes, sT.delMode, false, &sT.delMode, rmsSearchTimerSave, true, 2)); |             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) |             if (sT.delMode == 1) | ||||||
|                 mainMenuItems.push_back(new cRecMenuItemInt(tr("after ... recordings"), sT.delAfterCountRecs, 0, 999, false, &sT.delAfterCountRecs, rmsSearchTimerSave, 3)); |                 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) |             else if (sT.delMode == 2) | ||||||
|                 mainMenuItems.push_back(new cRecMenuItemInt(tr("after ... days after first rec."), sT.delAfterDaysOfFirstRec, 0, 999, false, &sT.delAfterDaysOfFirstRec, rmsSearchTimerSave, 3)); |                 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)); |     mainMenuItems.push_back(new cRecMenuItemButton(tr("Display Results for Search Timer"), rmsSearchTimerTest, false)); | ||||||
| @@ -907,75 +922,34 @@ void cRecMenuSearchTimerEdit::CreateMenuItems(void) { | |||||||
| } | } | ||||||
|  |  | ||||||
| cTVGuideSearchTimer cRecMenuSearchTimerEdit::GetSearchTimer(void) { | cTVGuideSearchTimer cRecMenuSearchTimerEdit::GetSearchTimer(void) { | ||||||
|     searchTimer.SetSearchString(searchString); |     sT.searchString = searchString; | ||||||
|     searchTimer.SetSearchMode(sT.mode); |  | ||||||
|     searchTimer.SetFuzzyTolerance(sT.fuzzyTolerance); |  | ||||||
|     searchTimer.SetUseCase(sT.useCase); |  | ||||||
|     searchTimer.SetUseTitle(sT.useTitle); |  | ||||||
|     searchTimer.SetUseSubtitle(sT.useSubtitle); |  | ||||||
|     searchTimer.SetUseDesription(sT.useDescription); |  | ||||||
|     if (sT.useChannel == 1) { |     if (sT.useChannel == 1) { | ||||||
|         searchTimer.SetStartChannel(startChannel); | #if VDRVERSNUM >= 20301 | ||||||
|         searchTimer.SetStopChannel(stopChannel); |         { | ||||||
|  |         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 | ||||||
|     } |     } | ||||||
|     if (sT.useChannel == 2) { |     if (sT.useChannel == 2) { | ||||||
|         if (channelgroups.size() > 0) { |         if (channelgroups.size() > 0) { | ||||||
|             std::string & channelGroup = channelgroups[channelgroupIndex]; |             std::string & channelGroup = channelgroups[channelgroupIndex]; | ||||||
|             searchTimer.SetChannelGroup(channelGroup); |             sT.channelGroup = channelGroup; | ||||||
|         } else { |         } else { | ||||||
|             sT.useChannel = 0; |             sT.useChannel = 0; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|     searchTimer.SetUseChannel(sT.useChannel); |  | ||||||
|     searchTimer.SetUseTime(sT.useTime); |  | ||||||
|     if (sT.useTime) { |  | ||||||
|         searchTimer.SetStartTime(sT.startTime); |  | ||||||
|         searchTimer.SetStopTime(sT.stopTime); |  | ||||||
|     } |  | ||||||
|     searchTimer.SetUseDuration(sT.useDuration); |  | ||||||
|     if (sT.useDuration) { |  | ||||||
|         searchTimer.SetMinDuration(sT.minDuration); |  | ||||||
|         searchTimer.SetMaxDuration(sT.maxDuration); |  | ||||||
|     } |  | ||||||
|     searchTimer.SetUseDayOfWeek(sT.useDayOfWeek); |  | ||||||
|     if (sT.useDayOfWeek) { |     if (sT.useDayOfWeek) { | ||||||
|         searchTimer.SetDayOfWeek(sT.dayOfWeek); |         sT.dayOfWeek = SetDayOfWeek(dayOfWeek); | ||||||
|     } |     } | ||||||
|     searchTimer.SetUseAsSearchTimer(sT.useAsSearchTimer); |  | ||||||
|     searchTimer.SetAction(sT.action); |  | ||||||
|     searchTimer.SetSwitchMinsBefore(sT.switchMinsBefore); |  | ||||||
|     searchTimer.SetUnmuteSoundOnSwitch(sT.unmuteSoundOnSwitch); |  | ||||||
|     searchTimer.SetPriority(sT.priority); |  | ||||||
|     searchTimer.SetLifetime(sT.lifetime); |  | ||||||
|     searchTimer.SetUseEpisode(sT.useEpisode); |  | ||||||
|     std::string dir(directory); |     std::string dir(directory); | ||||||
|     std::replace(dir.begin(), dir.end(), '/', '~'); |     std::replace(dir.begin(), dir.end(), '/', '~'); | ||||||
|     searchTimer.SetDirectory(dir); |     sT.directory = dir; | ||||||
|     searchTimer.SetDelAfterDays(sT.delAfterDays); |     return sT; | ||||||
|     searchTimer.SetRecordingsKeep(sT.recordingsKeep); |  | ||||||
|     searchTimer.SetPauseOnNrRecordings(sT.pauseOnNrRecordings); |  | ||||||
|     searchTimer.SetMarginStart(sT.marginStart); |  | ||||||
|     searchTimer.SetMarginStop(sT.marginStop); |  | ||||||
|     searchTimer.SetUseVPS(sT.useVPS); |  | ||||||
|     searchTimer.SetAvoidRepeats(sT.avoidRepeats); |  | ||||||
|     if (sT.avoidRepeats) { |  | ||||||
|         searchTimer.SetAllowedRepeats(sT.allowedRepeats); |  | ||||||
|         if (sT.repeatsWithinDays > 0) { |  | ||||||
|             searchTimer.SetRepeatsWithinDays(sT.repeatsWithinDays); |  | ||||||
|         } |  | ||||||
|         searchTimer.SetCompareTitle(sT.compareTitle); |  | ||||||
|         searchTimer.SetCompareSubtitle(sT.compareSubtitle); |  | ||||||
|         searchTimer.SetCompareSummary(sT.compareSummary); |  | ||||||
|         if (sT.compareSummary) { |  | ||||||
|             searchTimer.SetCompareSummaryMatchInPercent(sT.compareSummaryMatchInPercent); |  | ||||||
|         } |  | ||||||
|         searchTimer.SetCompareDate(sT.compareDate); |  | ||||||
|     } |  | ||||||
|     searchTimer.SetUseInFavorites(sT.useInFavorites); |  | ||||||
|     searchTimer.SetDelMode(sT.delMode); |  | ||||||
|     searchTimer.SetDelAfterCountRecs(sT.delAfterCountRecs); |  | ||||||
|     searchTimer.SetDelAfterDaysOfFirstRec(sT.delAfterDaysOfFirstRec); |  | ||||||
|     return searchTimer; |  | ||||||
| } | } | ||||||
|  |  | ||||||
| int cRecMenuSearchTimerEdit::GetTotalNumMenuItems(void) {  | int cRecMenuSearchTimerEdit::GetTotalNumMenuItems(void) {  | ||||||
| @@ -1137,8 +1111,8 @@ cRecMenuSearchTimerNothingFound::cRecMenuSearchTimerNothingFound(std::string sea | |||||||
|  |  | ||||||
| // --- cRecMenuSwitchTimer  --------------------------------------------------------- | // --- cRecMenuSwitchTimer  --------------------------------------------------------- | ||||||
| cRecMenuSwitchTimer::cRecMenuSwitchTimer(void) { | cRecMenuSwitchTimer::cRecMenuSwitchTimer(void) { | ||||||
|     switchMinsBefore = tvguideConfig.switchMinsBefore; |     switchMinsBefore = config.switchMinsBefore; | ||||||
|     switchMode = tvguideConfig.switchMode; |     switchMode = config.switchMode; | ||||||
|  |  | ||||||
|     SetWidthPercent(60); |     SetWidthPercent(60); | ||||||
|      |      | ||||||
| @@ -1147,12 +1121,12 @@ cRecMenuSwitchTimer::cRecMenuSwitchTimer(void) { | |||||||
|     infoItem->CalculateHeight(width - 2 * border); |     infoItem->CalculateHeight(width - 2 * border); | ||||||
|     AddMenuItem(infoItem); |     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; |     std::vector<std::string> switchModeItems; | ||||||
|     switchModeItems.push_back(tr("switch")); |     switchModeItems.push_back(tr("switch")); | ||||||
|     switchModeItems.push_back(tr("announce only")); |     switchModeItems.push_back(tr("announce only")); | ||||||
|     switchModeItems.push_back(tr("ask for switch")); |     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)); |     AddMenuItem(new cRecMenuItemButtonYesNo(tr("Create"), tr("Cancel"), rmsSwitchTimerCreate, rmsClose, true)); | ||||||
|      |      | ||||||
| @@ -1220,16 +1194,16 @@ cRecMenuSearch::cRecMenuSearch(std::string searchString, bool withOptions) { | |||||||
|     cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText, true); |     cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText, true); | ||||||
|     infoItem->CalculateHeight(width - 2 * border); |     infoItem->CalculateHeight(width - 2 * border); | ||||||
|     SetHeader(infoItem); |     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) { |     if (withOptions) { | ||||||
|         std::vector<std::string> searchModes; |         std::vector<std::string> searchModes; | ||||||
|         cTVGuideSearchTimer searchTimer; |         cTVGuideSearchTimer searchTimer; | ||||||
|         searchTimer.GetSearchModes(&searchModes); |         searchTimer.GetSearchModes(&searchModes); | ||||||
|         AddMenuItemInitial(new cRecMenuItemSelect(tr("Search Mode"), searchModes, 0, false, &mode)); |         AddMenuItemInitial(new cRecMenuItemSelect(tr("Search Mode"), searchModes, false, &mode)); | ||||||
|         AddMenuItemInitial(new cRecMenuItemChannelChooser(tr("Channel to Search"), NULL, false, &channelNr)); |         AddMenuItemInitial(new cRecMenuItemChannelChooser(tr("Channel to Search"), false, &channelNr)); | ||||||
|         AddMenuItemInitial(new cRecMenuItemBool(tr("Search in title"), true, false, false, &useTitle)); |         AddMenuItemInitial(new cRecMenuItemBool(tr("Search in title"), false, &useTitle)); | ||||||
|         AddMenuItemInitial(new cRecMenuItemBool(tr("Search in Subtitle"), true, false, false, &useSubTitle)); |         AddMenuItemInitial(new cRecMenuItemBool(tr("Search in Subtitle"), false, &useSubTitle)); | ||||||
|         AddMenuItemInitial(new cRecMenuItemBool(tr("Search in Description"), false, false, false, &useDescription)); |         AddMenuItemInitial(new cRecMenuItemBool(tr("Search in Description"), false, &useDescription)); | ||||||
|     } else { |     } else { | ||||||
|         AddMenuItemInitial(new cRecMenuItemButton(tr("Show Search Options"), rmsSearchWithOptions, false)); |         AddMenuItemInitial(new cRecMenuItemButton(tr("Show Search Options"), rmsSearchWithOptions, false)); | ||||||
|     } |     } | ||||||
| @@ -1363,7 +1337,7 @@ cRecMenuRecordingSearch::cRecMenuRecordingSearch(std::string search) { | |||||||
|     infoItem->CalculateHeight(width - 2 * border); |     infoItem->CalculateHeight(width - 2 * border); | ||||||
|     SetHeader(infoItem); |     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)); |     AddMenuItem(new cRecMenuItemButtonYesNo(tr("Perform Search"), tr("Cancel"), rmsRecordingSearchResult, rmsClose, true)); | ||||||
|     CalculateHeight(); |     CalculateHeight(); | ||||||
|     CreatePixmap(); |     CreatePixmap(); | ||||||
| @@ -1457,14 +1431,19 @@ void cRecMenuTimeline::GetTimersForDay(void) { | |||||||
|     timersToday.clear(); |     timersToday.clear(); | ||||||
| #if VDRVERSNUM >= 20301 | #if VDRVERSNUM >= 20301 | ||||||
|     LOCK_TIMERS_READ; |     LOCK_TIMERS_READ; | ||||||
| //    const cTimers* timers = Timers; |     const cTimers* timers = Timers; | ||||||
|     for (const cTimer *t = Timers->First(); t; t = Timers->Next(t)) { |  | ||||||
| #else | #else | ||||||
|     for (const cTimer *t = Timers.First(); t; t = Timers.Next(t)) { |     const cTimers* timers = &Timers; | ||||||
| #endif | #endif | ||||||
|  |     cSortedTimers SortedTimers(timers); | ||||||
|  |     int i = 0; | ||||||
|  |     while (i < SortedTimers.Size()) { | ||||||
|  |         const cTimer *t = SortedTimers[i]; | ||||||
|         if (((t->StartTime() > timeStart) && (t->StartTime() <= timeStop)) || ((t->StopTime() > timeStart) && (t->StopTime() <= timeStop))) { |         if (((t->StartTime() > timeStart) && (t->StartTime() <= timeStop)) || ((t->StopTime() > timeStart) && (t->StopTime() <= timeStop))) { | ||||||
|             timersToday.push_back(t); |             if (t->HasFlags(tfActive)) | ||||||
|  |                 timersToday.push_back(t); | ||||||
|         } |         } | ||||||
|  |         i++; | ||||||
|     } |     } | ||||||
|     numTimersToday = timersToday.size(); |     numTimersToday = timersToday.size(); | ||||||
| } | } | ||||||
| @@ -1607,26 +1586,26 @@ cRecMenuFavorites::~cRecMenuFavorites(void) { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cRecMenuFavorites::CreateFavoritesMenuItems(void) { | void cRecMenuFavorites::CreateFavoritesMenuItems(void) { | ||||||
|     if (tvguideConfig.favWhatsOnNow) { |     if (config.favWhatsOnNow) { | ||||||
|         myMenuItems.push_back(new cRecMenuItemFavoriteStatic(tr("What's on now"), rmsFavoritesNow, false)); |         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)); |         myMenuItems.push_back(new cRecMenuItemFavoriteStatic(tr("What's on next"), rmsFavoritesNext, false)); | ||||||
|     } |     } | ||||||
|     if (tvguideConfig.favUseTime1) { |     if (config.favUseTime1) { | ||||||
|         std::string desc = *cString::sprintf("%s (%s)", tvguideConfig.descUser1.c_str(), NiceTime(tvguideConfig.favTime1).c_str()); |         std::string desc = *cString::sprintf("%s (%s)", config.descUser1.c_str(), NiceTime(config.favTime1).c_str()); | ||||||
|         myMenuItems.push_back(new cRecMenuItemFavoriteStatic(desc, rmsFavoritesUser1, false)); |         myMenuItems.push_back(new cRecMenuItemFavoriteStatic(desc, rmsFavoritesUser1, false)); | ||||||
|     } |     } | ||||||
|     if (tvguideConfig.favUseTime2) { |     if (config.favUseTime2) { | ||||||
|         std::string desc = *cString::sprintf("%s (%s)", tvguideConfig.descUser2.c_str(), NiceTime(tvguideConfig.favTime2).c_str()); |         std::string desc = *cString::sprintf("%s (%s)", config.descUser2.c_str(), NiceTime(config.favTime2).c_str()); | ||||||
|         myMenuItems.push_back(new cRecMenuItemFavoriteStatic(desc, rmsFavoritesUser2, false)); |         myMenuItems.push_back(new cRecMenuItemFavoriteStatic(desc, rmsFavoritesUser2, false)); | ||||||
|     } |     } | ||||||
|     if (tvguideConfig.favUseTime3) { |     if (config.favUseTime3) { | ||||||
|         std::string desc = *cString::sprintf("%s (%s)", tvguideConfig.descUser3.c_str(), NiceTime(tvguideConfig.favTime3).c_str()); |         std::string desc = *cString::sprintf("%s (%s)", config.descUser3.c_str(), NiceTime(config.favTime3).c_str()); | ||||||
|         myMenuItems.push_back(new cRecMenuItemFavoriteStatic(desc, rmsFavoritesUser3, false)); |         myMenuItems.push_back(new cRecMenuItemFavoriteStatic(desc, rmsFavoritesUser3, false)); | ||||||
|     } |     } | ||||||
|     if (tvguideConfig.favUseTime4) { |     if (config.favUseTime4) { | ||||||
|         std::string desc = *cString::sprintf("%s (%s)", tvguideConfig.descUser4.c_str(), NiceTime(tvguideConfig.favTime4).c_str()); |         std::string desc = *cString::sprintf("%s (%s)", config.descUser4.c_str(), NiceTime(config.favTime4).c_str()); | ||||||
|         myMenuItems.push_back(new cRecMenuItemFavoriteStatic(desc, rmsFavoritesUser4, false)); |         myMenuItems.push_back(new cRecMenuItemFavoriteStatic(desc, rmsFavoritesUser4, false)); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -47,7 +47,7 @@ public: | |||||||
| // --- cRecMenuConfirmTimer  --------------------------------------------------------- | // --- cRecMenuConfirmTimer  --------------------------------------------------------- | ||||||
| class cRecMenuConfirmTimer: public cRecMenu { | class cRecMenuConfirmTimer: public cRecMenu { | ||||||
| public: | public: | ||||||
|     cRecMenuConfirmTimer(const cEvent *event); |     cRecMenuConfirmTimer(const cEvent *event, bool timerChanged = false); | ||||||
|     virtual ~cRecMenuConfirmTimer(void) {}; |     virtual ~cRecMenuConfirmTimer(void) {}; | ||||||
| }; | }; | ||||||
|  |  | ||||||
| @@ -136,7 +136,7 @@ public: | |||||||
|     cRecMenuEditTimer(const cTimer *timer, eRecMenuState nextState); |     cRecMenuEditTimer(const cTimer *timer, eRecMenuState nextState); | ||||||
|     const cTimer *GetOriginalTimer(void); |     const cTimer *GetOriginalTimer(void); | ||||||
|     virtual ~cRecMenuEditTimer(void) {}; |     virtual ~cRecMenuEditTimer(void) {}; | ||||||
|     cTimer GetTimer(void); |     cTimer *GetTimer(void); | ||||||
| }; | }; | ||||||
|  |  | ||||||
| /****************************************************************************************** | /****************************************************************************************** | ||||||
| @@ -216,7 +216,6 @@ public: | |||||||
| // --- cRecMenuSearchTimerEdit  --------------------------------------------------------- | // --- cRecMenuSearchTimerEdit  --------------------------------------------------------- | ||||||
| class cRecMenuSearchTimerEdit: public cRecMenu { | class cRecMenuSearchTimerEdit: public cRecMenu { | ||||||
| private: | private: | ||||||
|     cTVGuideSearchTimer searchTimer; |  | ||||||
|     cTVGuideSearchTimer sT; |     cTVGuideSearchTimer sT; | ||||||
|     std::vector<std::string> searchModes; |     std::vector<std::string> searchModes; | ||||||
|     std::vector<std::string> useChannelModes; |     std::vector<std::string> useChannelModes; | ||||||
| @@ -226,17 +225,21 @@ private: | |||||||
|     std::vector<std::string> delModes; |     std::vector<std::string> delModes; | ||||||
|     std::vector<std::string> channelgroups; |     std::vector<std::string> channelgroups; | ||||||
|     std::vector<cRecMenuItem*> mainMenuItems; |     std::vector<cRecMenuItem*> mainMenuItems; | ||||||
|  |     cString indent; | ||||||
|     bool init; |     bool init; | ||||||
|     int numMenuItems; |     int numMenuItems; | ||||||
|     int useChannelPos; |     int useChannelPos; | ||||||
|     int useTimePos; |     int useTimePos; | ||||||
|     int useDayOfWeekPos; |     int useDayOfWeekPos; | ||||||
|  |     int DayOfWeek(int dayofWeek = 0); | ||||||
|  |     int SetDayOfWeek(int VDRDayOfWeek); | ||||||
|     int avoidRepeatsPos; |     int avoidRepeatsPos; | ||||||
|     char searchString[TEXTINPUTLENGTH]; |     char searchString[TEXTINPUTLENGTH]; | ||||||
|     bool timerActive; |     bool timerActive; | ||||||
|     int startChannel; |     int startChannel; | ||||||
|     int stopChannel; |     int stopChannel; | ||||||
|     int channelgroupIndex; |     int channelgroupIndex; | ||||||
|  |     int dayOfWeek; | ||||||
|     char directory[TEXTINPUTLENGTH]; |     char directory[TEXTINPUTLENGTH]; | ||||||
|     int SplitChannelGroups(std::vector<std::string> *channelGroups, std::vector<std::string> *channelgroups); |     int SplitChannelGroups(std::vector<std::string> *channelGroups, std::vector<std::string> *channelgroups); | ||||||
| public: | public: | ||||||
|   | |||||||
| @@ -2,9 +2,9 @@ | |||||||
| #include "recmenus.h" | #include "recmenus.h" | ||||||
| #include "switchtimer.h" | #include "switchtimer.h" | ||||||
| #include "timerconflict.h" | #include "timerconflict.h" | ||||||
| #include "recmenumanager.h" | #include "recmenuview.h" | ||||||
| 
 | 
 | ||||||
| cRecMenuManager::cRecMenuManager(void) { | cRecMenuView::cRecMenuView(void) { | ||||||
|     footer = NULL; |     footer = NULL; | ||||||
|     active = false; |     active = false; | ||||||
|     activeMenu = NULL; |     activeMenu = NULL; | ||||||
| @@ -16,7 +16,7 @@ cRecMenuManager::cRecMenuManager(void) { | |||||||
|     detailViewActive = false; |     detailViewActive = false; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| cRecMenuManager::~cRecMenuManager(void) { | cRecMenuView::~cRecMenuView(void) { | ||||||
|     if (activeMenu) { |     if (activeMenu) { | ||||||
|         active = false; |         active = false; | ||||||
|         delete activeMenu; |         delete activeMenu; | ||||||
| @@ -29,7 +29,7 @@ cRecMenuManager::~cRecMenuManager(void) { | |||||||
|     delete recManager; |     delete recManager; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void cRecMenuManager::Start(const cEvent *event) { | void cRecMenuView::Start(const cEvent *event) { | ||||||
|     active = true; |     active = true; | ||||||
|     activeMenuBuffer = NULL; |     activeMenuBuffer = NULL; | ||||||
|     detailViewActive = false; |     detailViewActive = false; | ||||||
| @@ -40,7 +40,7 @@ void cRecMenuManager::Start(const cEvent *event) { | |||||||
|     osdManager.flush(); |     osdManager.flush(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void cRecMenuManager::StartFavorites(void) { | void cRecMenuView::StartFavorites(void) { | ||||||
|     active = true; |     active = true; | ||||||
|     activeMenuBuffer = NULL; |     activeMenuBuffer = NULL; | ||||||
|     detailViewActive = false; |     detailViewActive = false; | ||||||
| @@ -53,7 +53,7 @@ void cRecMenuManager::StartFavorites(void) { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| void cRecMenuManager::Close(void) { | void cRecMenuView::Close(void) { | ||||||
|     event = NULL; |     event = NULL; | ||||||
|     active = false; |     active = false; | ||||||
|     if (activeMenu) { |     if (activeMenu) { | ||||||
| @@ -67,12 +67,12 @@ void cRecMenuManager::Close(void) { | |||||||
|     DeleteBackground(); |     DeleteBackground(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void cRecMenuManager::SetBackground(void) { | void cRecMenuView::SetBackground(void) { | ||||||
|     int backgroundWidth = geoManager.osdWidth; |     int backgroundWidth = geoManager.osdWidth; | ||||||
|     int backgroundHeight = geoManager.osdHeight; |     int backgroundHeight = geoManager.osdHeight; | ||||||
|     pixmapBackground = osdManager.requestPixmap(3, cRect(0, 0, backgroundWidth, backgroundHeight)); |     pixmapBackground = osdManager.requestPixmap(3, cRect(0, 0, backgroundWidth, backgroundHeight)); | ||||||
|     pixmapBackground->Fill(theme.Color(clrRecMenuBackground)); |     pixmapBackground->Fill(theme.Color(clrRecMenuBackground)); | ||||||
|     if (tvguideConfig.scaleVideo) { |     if (config.scaleVideo) { | ||||||
|         int tvHeight = geoManager.statusHeaderHeight; |         int tvHeight = geoManager.statusHeaderHeight; | ||||||
|         int tvWidth = tvHeight * 16 / 9; |         int tvWidth = tvHeight * 16 / 9; | ||||||
|         int tvX = geoManager.osdWidth - tvWidth; |         int tvX = geoManager.osdWidth - tvWidth; | ||||||
| @@ -80,16 +80,80 @@ void cRecMenuManager::SetBackground(void) { | |||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void cRecMenuManager::DeleteBackground(void) { | void cRecMenuView::DeleteBackground(void) { | ||||||
|     osdManager.releasePixmap(pixmapBackground); |     osdManager.releasePixmap(pixmapBackground); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { | void cRecMenuView::DisplaySearchTimerList(void) { | ||||||
|  |     delete activeMenu; | ||||||
|  |     std::vector<cTVGuideSearchTimer> searchTimers; | ||||||
|  |     recManager->GetSearchTimers(&searchTimers); | ||||||
|  |     activeMenu = new cRecMenuSearchTimers(searchTimers); | ||||||
|  |     activeMenu->Display(); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | bool cRecMenuView::DisplayTimerConflict(const cTimer *timer) { | ||||||
|  |     int timerID = 0; | ||||||
|  | #if VDRVERSNUM >= 20301 | ||||||
|  |     LOCK_TIMERS_READ; | ||||||
|  |     for (const cTimer *t = Timers->First(); t; t = Timers->Next(t)) { | ||||||
|  | #else | ||||||
|  |     for (const cTimer *t = Timers.First(); t; t = Timers.Next(t)) { | ||||||
|  | #endif | ||||||
|  |         if (t == timer) | ||||||
|  |             return DisplayTimerConflict(timerID); | ||||||
|  |         timerID++; | ||||||
|  |     } | ||||||
|  |     return false; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | bool cRecMenuView::DisplayTimerConflict(int timerID) { | ||||||
|  |     if (timerConflicts) | ||||||
|  |         delete timerConflicts; | ||||||
|  |     timerConflicts = recManager->CheckTimerConflict(); | ||||||
|  |     if (!timerConflicts) | ||||||
|  |         return false; | ||||||
|  |     int showTimerConflict = timerConflicts->GetCorrespondingConflict(timerID); | ||||||
|  |     if (showTimerConflict > -1) { | ||||||
|  |         timerConflicts->SetCurrentConflict(showTimerConflict); | ||||||
|  |         cTVGuideTimerConflict *conflict = timerConflicts->GetCurrentConflict(); | ||||||
|  |         if (!conflict) | ||||||
|  |             return false; | ||||||
|  |         activeMenu = new cRecMenuTimerConflict(conflict); | ||||||
|  |         activeMenu->Display(); | ||||||
|  |         return true; | ||||||
|  |     } | ||||||
|  |     return false; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | void cRecMenuView::DisplayFavoriteResults(std::string header, const cEvent **result, int numResults) { | ||||||
|  |     if (numResults) { | ||||||
|  |         activeMenuBuffer = activeMenu; | ||||||
|  |         activeMenuBuffer->Hide(); | ||||||
|  |         activeMenu = new cRecMenuSearchTimerResults(header, result, numResults, "", rmsFavoritesRecord); | ||||||
|  |         activeMenu->Display(); | ||||||
|  |     } else { | ||||||
|  |         activeMenuBuffer = activeMenu; | ||||||
|  |         activeMenuBuffer->Hide(); | ||||||
|  |         activeMenu = new cRecMenuSearchTimerNothingFound(header); | ||||||
|  |         activeMenu->Display(); | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | void cRecMenuView::DisplayDetailedView(const cEvent *ev) { | ||||||
|  |     activeMenu->Hide(); | ||||||
|  |     detailView = new cDetailView(ev, footer); | ||||||
|  |     footer->SetDetailedViewMode(true); | ||||||
|  |     detailView->Start(); | ||||||
|  |     detailViewActive = true; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | eOSState cRecMenuView::StateMachine(eRecMenuState nextState) { | ||||||
|     eOSState state = osContinue; |     eOSState state = osContinue; | ||||||
|     switch (nextState) { |     switch (nextState) { | ||||||
|         /***************************************************************************************
 | /***************************************************************************************
 | ||||||
|         *    INSTANT RECORDING | *    INSTANT RECORDING | ||||||
|         ****************************************************************************************/ | ****************************************************************************************/ | ||||||
|         case rmsInstantRecord: { |         case rmsInstantRecord: { | ||||||
|         //caller: main menu or folder chooser
 |         //caller: main menu or folder chooser
 | ||||||
|         //Creating timer for active Event, if no conflict, confirm and exit
 |         //Creating timer for active Event, if no conflict, confirm and exit
 | ||||||
| @@ -111,6 +175,47 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { | |||||||
|             activeMenu = new cRecMenuAskFolder(event, rmsInstantRecord); |             activeMenu = new cRecMenuAskFolder(event, rmsInstantRecord); | ||||||
|             activeMenu->Display(); |             activeMenu->Display(); | ||||||
|             break; |             break; | ||||||
|  |         case rmsDeleteTimer: { | ||||||
|  |             //caller: main menu
 | ||||||
|  |             //delete timer for active event
 | ||||||
|  |             delete activeMenu; | ||||||
|  |             if (recManager->IsRecorded(event)) { | ||||||
|  |                 activeMenu = new cRecMenuAskDeleteTimer(event); | ||||||
|  |             } else { | ||||||
|  |                 recManager->DeleteTimer(event); | ||||||
|  |                 activeMenu = new cRecMenuConfirmDeleteTimer(event); | ||||||
|  |             } | ||||||
|  |             activeMenu->Display(); | ||||||
|  |             break; } | ||||||
|  |         case rmsDeleteTimerConfirmation: { | ||||||
|  |             //delete running timer for active event
 | ||||||
|  |             recManager->DeleteTimer(event); | ||||||
|  |             delete activeMenu; | ||||||
|  |             activeMenu = new cRecMenuConfirmDeleteTimer(event); | ||||||
|  |             activeMenu->Display(); | ||||||
|  |             break; } | ||||||
|  |         case rmsEditTimer: { | ||||||
|  |             //edit timer for active event
 | ||||||
|  |             const cTimer *timer = recManager->GetTimerForEvent(event); | ||||||
|  |             if (timer) { | ||||||
|  |                 delete activeMenu; | ||||||
|  |                 activeMenu = new cRecMenuEditTimer(timer, rmsSaveTimer); | ||||||
|  |                 activeMenu->Display(); | ||||||
|  |             } | ||||||
|  |             break; } | ||||||
|  |         case rmsSaveTimer: { | ||||||
|  |             //caller: cRecMenuEditTimer
 | ||||||
|  |             //save timer for active event
 | ||||||
|  |             cTimer *timerModified; | ||||||
|  |             const cTimer *originalTimer; | ||||||
|  |             if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) { | ||||||
|  |                 timerModified = menu->GetTimer(); | ||||||
|  |                 originalTimer = menu->GetOriginalTimer(); | ||||||
|  |             } else break; | ||||||
|  |             recManager->SaveTimer(originalTimer, timerModified); | ||||||
|  |             Close(); | ||||||
|  |             state = osEnd; | ||||||
|  |             break; } | ||||||
|         case rmsIgnoreTimerConflict: |         case rmsIgnoreTimerConflict: | ||||||
|         //caller: cRecMenuTimerConflict
 |         //caller: cRecMenuTimerConflict
 | ||||||
|         //Confirming created Timer
 |         //Confirming created Timer
 | ||||||
| @@ -129,7 +234,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { | |||||||
|             LOCK_TIMERS_READ; |             LOCK_TIMERS_READ; | ||||||
|             const cTimer *t = Timers->Get(timerID); |             const cTimer *t = Timers->Get(timerID); | ||||||
| #else | #else | ||||||
|             cTimer *t = Timers.Get(timerID); |             const cTimer *t = Timers.Get(timerID); | ||||||
| #endif | #endif | ||||||
|             if (t) { |             if (t) { | ||||||
|                 const cEvent *ev = t->Event(); |                 const cEvent *ev = t->Event(); | ||||||
| @@ -146,10 +251,19 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { | |||||||
|                 timerIndex = menu->GetTimerConflictIndex(); |                 timerIndex = menu->GetTimerConflictIndex(); | ||||||
|             } else break; |             } else break; | ||||||
|             int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex); |             int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex); | ||||||
|             recManager->DeleteTimer(timerID); |             const cTimers* timers; | ||||||
|  | #if VDRVERSNUM >= 20301 | ||||||
|  |             { | ||||||
|  |             LOCK_TIMERS_READ; | ||||||
|  |             timers = Timers; | ||||||
|  |             } | ||||||
|  | #else | ||||||
|  |             timers = &Timers; | ||||||
|  | #endif | ||||||
|  |             recManager->DeleteTimer(timers->Get(timerID)->Event()); | ||||||
|             delete activeMenu; |             delete activeMenu; | ||||||
|             if (!DisplayTimerConflict(timerID)) { |             if (!DisplayTimerConflict(timerID)) { | ||||||
|                 activeMenu = new cRecMenuConfirmTimer(event); |                 activeMenu = new cRecMenuConfirmTimer(timers->Get(timerID)->Event()); | ||||||
|                 activeMenu->Display(); |                 activeMenu->Display(); | ||||||
|             } |             } | ||||||
|             break; } |             break; } | ||||||
| @@ -176,7 +290,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { | |||||||
|         case rmsSaveTimerConflictMenu: { |         case rmsSaveTimerConflictMenu: { | ||||||
|             //caller: cRecMenuEditTimer
 |             //caller: cRecMenuEditTimer
 | ||||||
|             //save timer from current timer conflict
 |             //save timer from current timer conflict
 | ||||||
|             cTimer timerModified; |             cTimer *timerModified; | ||||||
|             const cTimer *originalTimer; |             const cTimer *originalTimer; | ||||||
|             if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) { |             if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) { | ||||||
|                 timerModified = menu->GetTimer(); |                 timerModified = menu->GetTimer(); | ||||||
| @@ -185,62 +299,13 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { | |||||||
|             recManager->SaveTimer(originalTimer, timerModified); |             recManager->SaveTimer(originalTimer, timerModified); | ||||||
|             delete activeMenu; |             delete activeMenu; | ||||||
|             if (!DisplayTimerConflict(originalTimer)) { |             if (!DisplayTimerConflict(originalTimer)) { | ||||||
|                 activeMenu = new cRecMenuConfirmTimer(event); |                 activeMenu = new cRecMenuConfirmTimer(originalTimer->Event(), true); | ||||||
|                 activeMenu->Display(); |                 activeMenu->Display(); | ||||||
|             } |             } | ||||||
|             break; } |             break; } | ||||||
|         case rmsDeleteTimer: | /***************************************************************************************
 | ||||||
|             //caller: main menu
 | *    SERIES TIMER | ||||||
|             //delete timer for active event
 | ****************************************************************************************/ | ||||||
|             delete activeMenu; |  | ||||||
|             if (recManager->IsRecorded(event)) { |  | ||||||
|                 activeMenu = new cRecMenuAskDeleteTimer(event); |  | ||||||
|             } else { |  | ||||||
|                 recManager->DeleteTimer(event); |  | ||||||
|                 activeMenu = new cRecMenuConfirmDeleteTimer(event); |  | ||||||
|             } |  | ||||||
|             activeMenu->Display(); |  | ||||||
|             break; |  | ||||||
|         case rmsDeleteTimerConfirmation: |  | ||||||
|             //delete running timer for active event
 |  | ||||||
|             recManager->DeleteTimer(event); |  | ||||||
|             delete activeMenu; |  | ||||||
|             activeMenu = new cRecMenuConfirmDeleteTimer(event); |  | ||||||
|             activeMenu->Display(); |  | ||||||
|             break; |  | ||||||
|         case rmsEditTimer: { |  | ||||||
|             //edit timer for active event
 |  | ||||||
|             const cTimer *timer; |  | ||||||
| #if VDRVERSNUM >= 20301 |  | ||||||
|             { |  | ||||||
|             LOCK_TIMERS_READ; |  | ||||||
|             timer = recManager->GetTimerForEvent(event); |  | ||||||
|             } |  | ||||||
| #else |  | ||||||
|             timer = recManager->GetTimerForEvent(event); |  | ||||||
| #endif |  | ||||||
|             if (timer) { |  | ||||||
|                 delete activeMenu; |  | ||||||
|                 activeMenu = new cRecMenuEditTimer(timer, rmsSaveTimer); |  | ||||||
|                 activeMenu->Display(); |  | ||||||
|             } |  | ||||||
|             break; } |  | ||||||
|         case rmsSaveTimer: { |  | ||||||
|             //caller: cRecMenuEditTimer
 |  | ||||||
|             //save timer for active event
 |  | ||||||
|             cTimer timerModified; |  | ||||||
|             const cTimer *originalTimer; |  | ||||||
|             if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) { |  | ||||||
|                 timerModified = menu->GetTimer(); |  | ||||||
|                 originalTimer = menu->GetOriginalTimer(); |  | ||||||
|             } else break; |  | ||||||
|             recManager->SaveTimer(originalTimer, timerModified); |  | ||||||
|             state = osEnd; |  | ||||||
|             Close(); |  | ||||||
|             break; } |  | ||||||
|         /***************************************************************************************
 |  | ||||||
|         *    SERIES TIMER |  | ||||||
|         ****************************************************************************************/ |  | ||||||
|         case rmsSeriesTimer: { |         case rmsSeriesTimer: { | ||||||
|             //caller: main menu oder folder chooser
 |             //caller: main menu oder folder chooser
 | ||||||
|             std::string recFolder = ""; |             std::string recFolder = ""; | ||||||
| @@ -275,9 +340,9 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { | |||||||
|             activeMenu = new cRecMenuConfirmSeriesTimer(seriesTimer); |             activeMenu = new cRecMenuConfirmSeriesTimer(seriesTimer); | ||||||
|             activeMenu->Display(); |             activeMenu->Display(); | ||||||
|             break; } |             break; } | ||||||
|         /**********************************************************************************************
 | /**********************************************************************************************
 | ||||||
|          *    SEARCH TIMER | *    SEARCH TIMER | ||||||
|          ***********************************************************************************************/ | ***********************************************************************************************/ | ||||||
|         case rmsSearchTimer: |         case rmsSearchTimer: | ||||||
|             //Caller: main menu
 |             //Caller: main menu
 | ||||||
|             //set search String for search timer
 |             //set search String for search timer
 | ||||||
| @@ -363,13 +428,12 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { | |||||||
|                 activeMenuBuffer = activeMenu; |                 activeMenuBuffer = activeMenu; | ||||||
|                 activeMenuBuffer->Hide(); |                 activeMenuBuffer->Hide(); | ||||||
|                 activeMenu = new cRecMenuSearchTimerResults(searchTimer.GetSearchString(), searchResult, numSearchResults, "", recState); |                 activeMenu = new cRecMenuSearchTimerResults(searchTimer.GetSearchString(), searchResult, numSearchResults, "", recState); | ||||||
|                 activeMenu->Display(); |  | ||||||
|             } else { |             } else { | ||||||
|                activeMenuBuffer = activeMenu; |                activeMenuBuffer = activeMenu; | ||||||
|                activeMenuBuffer->Hide(); |                activeMenuBuffer->Hide(); | ||||||
|                activeMenu = new cRecMenuSearchTimerNothingFound(searchTimer.GetSearchString()); |                activeMenu = new cRecMenuSearchTimerNothingFound(searchTimer.GetSearchString()); | ||||||
|                activeMenu->Display(); |  | ||||||
|             } |             } | ||||||
|  |             activeMenu->Display(); | ||||||
|             break; } |             break; } | ||||||
|         case rmsSearchTimerSave: { |         case rmsSearchTimerSave: { | ||||||
|             //caller: cRecMenuSearchTimerEdit, cRecMenuSearchTimerTemplatesCreate
 |             //caller: cRecMenuSearchTimerEdit, cRecMenuSearchTimerTemplatesCreate
 | ||||||
| @@ -448,66 +512,9 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { | |||||||
|             activeMenu = new cRecMenuSearchConfirmTimer(ev, rmsFavoritesRecordConfirm); |             activeMenu = new cRecMenuSearchConfirmTimer(ev, rmsFavoritesRecordConfirm); | ||||||
|             activeMenu->Display(); |             activeMenu->Display(); | ||||||
|             break; } |             break; } | ||||||
|         /**********************************************************************************************
 | /**********************************************************************************************
 | ||||||
|          *    SWITCH TIMER | *    SEARCH | ||||||
|          ***********************************************************************************************/ | ***********************************************************************************************/ | ||||||
|         case rmsSwitchTimer: |  | ||||||
|             delete activeMenu; |  | ||||||
|             activeMenu = new cRecMenuSwitchTimer(); |  | ||||||
|             activeMenu->Display(); |  | ||||||
|             break; |  | ||||||
|         case rmsSwitchTimerCreate: { |  | ||||||
|             cSwitchTimer switchTimer; |  | ||||||
|             if (cRecMenuSwitchTimer *menu = dynamic_cast<cRecMenuSwitchTimer*>(activeMenu)) { |  | ||||||
|                 switchTimer = menu->GetSwitchTimer(); |  | ||||||
|             } else break; |  | ||||||
|             bool success = recManager->CreateSwitchTimer(event, switchTimer); |  | ||||||
|             delete activeMenu; |  | ||||||
|             activeMenu = new cRecMenuSwitchTimerConfirm(success); |  | ||||||
|             activeMenu->Display(); |  | ||||||
|             break; } |  | ||||||
|         case rmsSwitchTimerDelete: |  | ||||||
|             recManager->DeleteSwitchTimer(event); |  | ||||||
|             delete activeMenu; |  | ||||||
|             activeMenu = new cRecMenuSwitchTimerDelete(); |  | ||||||
|             activeMenu->Display(); |  | ||||||
|             break; |  | ||||||
|         /**********************************************************************************************
 |  | ||||||
|          *    RECORDINGS SEARCH |  | ||||||
|          ***********************************************************************************************/ |  | ||||||
|         case rmsRecordingSearch: { |  | ||||||
|             //caller: main menu or rmsRecordingSearchResult
 |  | ||||||
|             std::string searchString = event->Title(); |  | ||||||
|             if (cRecMenuRecordingSearchResults *menu = dynamic_cast<cRecMenuRecordingSearchResults*>(activeMenu)) { |  | ||||||
|                 searchString = menu->GetSearchString(); |  | ||||||
|             }; |  | ||||||
|             delete activeMenu; |  | ||||||
|             activeMenu = new cRecMenuRecordingSearch(searchString); |  | ||||||
|             activeMenu->Display(); |  | ||||||
|             break; } |  | ||||||
|         case rmsRecordingSearchResult:  { |  | ||||||
|             //caller: cRecMenuRecordingSearch
 |  | ||||||
|             std::string searchString; |  | ||||||
|             if (cRecMenuRecordingSearch *menu = dynamic_cast<cRecMenuRecordingSearch*>(activeMenu)) { |  | ||||||
|                 searchString = menu->GetSearchString(); |  | ||||||
|             } else break; |  | ||||||
|             delete activeMenu; |  | ||||||
|             if (searchString.size() < 4) { |  | ||||||
|                 activeMenu = new cRecMenuRecordingSearch(searchString); |  | ||||||
|             } else { |  | ||||||
|                 int numSearchResults = 0; |  | ||||||
|                 const cRecording **searchResult = recManager->SearchForRecordings(searchString, numSearchResults); |  | ||||||
|                 if (numSearchResults == 0) { |  | ||||||
|                     activeMenu = new cRecMenuRecordingSearchNotFound(searchString); |  | ||||||
|                 } else { |  | ||||||
|                     activeMenu = new cRecMenuRecordingSearchResults(searchString, searchResult, numSearchResults); |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
|             activeMenu->Display(); |  | ||||||
|             break; } |  | ||||||
|         /**********************************************************************************************
 |  | ||||||
|          *    SEARCH |  | ||||||
|          ***********************************************************************************************/ |  | ||||||
|         case rmsSearch: |         case rmsSearch: | ||||||
|         case rmsSearchWithOptions: { |         case rmsSearchWithOptions: { | ||||||
|             //caller: main menu, cRecMenuSearch, cRecMenuSearchResults
 |             //caller: main menu, cRecMenuSearch, cRecMenuSearchResults
 | ||||||
| @@ -587,9 +594,33 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { | |||||||
|             activeMenu->UpdateActiveMenuItem(); |             activeMenu->UpdateActiveMenuItem(); | ||||||
|             activeMenu->Show(); |             activeMenu->Show(); | ||||||
|             break; |             break; | ||||||
|         /**********************************************************************************************
 | /**********************************************************************************************
 | ||||||
|          *    CHECK FOR TIMER CONFLICTS | *    SWITCH TIMER | ||||||
|          ***********************************************************************************************/ | ***********************************************************************************************/ | ||||||
|  |         case rmsSwitchTimer: | ||||||
|  |             delete activeMenu; | ||||||
|  |             activeMenu = new cRecMenuSwitchTimer(); | ||||||
|  |             activeMenu->Display(); | ||||||
|  |             break; | ||||||
|  |         case rmsSwitchTimerCreate: { | ||||||
|  |             cSwitchTimer switchTimer; | ||||||
|  |             if (cRecMenuSwitchTimer *menu = dynamic_cast<cRecMenuSwitchTimer*>(activeMenu)) { | ||||||
|  |                 switchTimer = menu->GetSwitchTimer(); | ||||||
|  |             } else break; | ||||||
|  |             bool success = recManager->CreateSwitchTimer(event, switchTimer); | ||||||
|  |             delete activeMenu; | ||||||
|  |             activeMenu = new cRecMenuSwitchTimerConfirm(success); | ||||||
|  |             activeMenu->Display(); | ||||||
|  |             break; } | ||||||
|  |         case rmsSwitchTimerDelete: | ||||||
|  |             recManager->DeleteSwitchTimer(event); | ||||||
|  |             delete activeMenu; | ||||||
|  |             activeMenu = new cRecMenuSwitchTimerDelete(); | ||||||
|  |             activeMenu->Display(); | ||||||
|  |             break; | ||||||
|  | /**********************************************************************************************
 | ||||||
|  | *    CHECK FOR TIMER CONFLICTS | ||||||
|  | ***********************************************************************************************/ | ||||||
|         case rmsTimerConflicts: { |         case rmsTimerConflicts: { | ||||||
|             //caller: main menu
 |             //caller: main menu
 | ||||||
|             //Show timer conflict
 |             //Show timer conflict
 | ||||||
| @@ -645,13 +676,12 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { | |||||||
|                         activeMenuBuffer = activeMenu; |                         activeMenuBuffer = activeMenu; | ||||||
|                         activeMenuBuffer->Hide(); |                         activeMenuBuffer->Hide(); | ||||||
|                         activeMenu = new cRecMenuRerunResults(event, reruns, numReruns); |                         activeMenu = new cRecMenuRerunResults(event, reruns, numReruns); | ||||||
|                         activeMenu->Display(); |  | ||||||
|                     } else { |                     } else { | ||||||
|                         activeMenuBuffer = activeMenu; |                         activeMenuBuffer = activeMenu; | ||||||
|                         activeMenuBuffer->Hide(); |                         activeMenuBuffer->Hide(); | ||||||
|                         activeMenu = new cRecMenuNoRerunsFound((event->Title())?event->Title():""); |                         activeMenu = new cRecMenuNoRerunsFound((event->Title()) ? event->Title() : ""); | ||||||
|                         activeMenu->Display(); |  | ||||||
|                     } |                     } | ||||||
|  |                     activeMenu->Display(); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|             break; } |             break; } | ||||||
| @@ -695,9 +725,9 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { | |||||||
|                 activeMenu->Display(); |                 activeMenu->Display(); | ||||||
|             } |             } | ||||||
|             break; } |             break; } | ||||||
|         /**********************************************************************************************
 | /**********************************************************************************************
 | ||||||
|          *    TIMELINE | *    TIMELINE | ||||||
|          ***********************************************************************************************/ | ***********************************************************************************************/ | ||||||
|        case rmsTimeline: { |        case rmsTimeline: { | ||||||
|             if (timerConflicts) { |             if (timerConflicts) { | ||||||
|                 delete timerConflicts; |                 delete timerConflicts; | ||||||
| @@ -719,7 +749,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { | |||||||
|             } |             } | ||||||
|             break;} |             break;} | ||||||
|         case rmsTimelineTimerSave: { |         case rmsTimelineTimerSave: { | ||||||
|             cTimer timerModified; |             cTimer *timerModified; | ||||||
|             const cTimer *originalTimer; |             const cTimer *originalTimer; | ||||||
|             if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) { |             if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) { | ||||||
|                 timerModified = menu->GetTimer(); |                 timerModified = menu->GetTimer(); | ||||||
| @@ -739,14 +769,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { | |||||||
|             if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) { |             if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) { | ||||||
|                 timer = menu->GetOriginalTimer(); |                 timer = menu->GetOriginalTimer(); | ||||||
|             } else break; |             } else break; | ||||||
| #if VDRVERSNUM >= 20301 |             recManager->DeleteTimer(timer); | ||||||
|             { |  | ||||||
|             LOCK_TIMERS_WRITE; |  | ||||||
|             recManager->DeleteTimer(Timers->GetTimer(timer)); |  | ||||||
|             } |  | ||||||
| #else |  | ||||||
|             recManager->DeleteTimer(Timers.GetTimer((cTimer*)timer)); |  | ||||||
| #endif |  | ||||||
|             delete activeMenu; |             delete activeMenu; | ||||||
|             if (timerConflicts) { |             if (timerConflicts) { | ||||||
|                 delete timerConflicts; |                 delete timerConflicts; | ||||||
| @@ -755,9 +778,42 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { | |||||||
|             activeMenu = new cRecMenuTimeline(timerConflicts); |             activeMenu = new cRecMenuTimeline(timerConflicts); | ||||||
|             activeMenu->Display(); |             activeMenu->Display(); | ||||||
|             break; } |             break; } | ||||||
|         /**********************************************************************************************
 | /**********************************************************************************************
 | ||||||
|          *    FAVORITES | *    RECORDINGS SEARCH | ||||||
|          *********************************************************************************************/ | ***********************************************************************************************/ | ||||||
|  |         case rmsRecordingSearch: { | ||||||
|  |             //caller: main menu or rmsRecordingSearchResult
 | ||||||
|  |             std::string searchString = event->Title(); | ||||||
|  |             if (cRecMenuRecordingSearchResults *menu = dynamic_cast<cRecMenuRecordingSearchResults*>(activeMenu)) { | ||||||
|  |                 searchString = menu->GetSearchString(); | ||||||
|  |             }; | ||||||
|  |             delete activeMenu; | ||||||
|  |             activeMenu = new cRecMenuRecordingSearch(searchString); | ||||||
|  |             activeMenu->Display(); | ||||||
|  |             break; } | ||||||
|  |         case rmsRecordingSearchResult:  { | ||||||
|  |             //caller: cRecMenuRecordingSearch
 | ||||||
|  |             std::string searchString; | ||||||
|  |             if (cRecMenuRecordingSearch *menu = dynamic_cast<cRecMenuRecordingSearch*>(activeMenu)) { | ||||||
|  |                 searchString = menu->GetSearchString(); | ||||||
|  |             } else break; | ||||||
|  |             delete activeMenu; | ||||||
|  |             if (searchString.size() < 4) { | ||||||
|  |                 activeMenu = new cRecMenuRecordingSearch(searchString); | ||||||
|  |             } else { | ||||||
|  |                 int numSearchResults = 0; | ||||||
|  |                 const cRecording **searchResult = recManager->SearchForRecordings(searchString, numSearchResults); | ||||||
|  |                 if (numSearchResults == 0) { | ||||||
|  |                     activeMenu = new cRecMenuRecordingSearchNotFound(searchString); | ||||||
|  |                 } else { | ||||||
|  |                     activeMenu = new cRecMenuRecordingSearchResults(searchString, searchResult, numSearchResults); | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |             activeMenu->Display(); | ||||||
|  |             break; } | ||||||
|  | /**********************************************************************************************
 | ||||||
|  | *    FAVORITES | ||||||
|  | *********************************************************************************************/ | ||||||
|         case rmsFavoritesRecord: { |         case rmsFavoritesRecord: { | ||||||
|             //caller: cRecMenuSearchTimerResults
 |             //caller: cRecMenuSearchTimerResults
 | ||||||
|             const cEvent *ev = NULL; |             const cEvent *ev = NULL; | ||||||
| @@ -797,27 +853,27 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { | |||||||
|         case rmsFavoritesUser1: { |         case rmsFavoritesUser1: { | ||||||
|             int numResults = 0; |             int numResults = 0; | ||||||
|             const cEvent **result = recManager->UserDefinedTime(1, numResults); |             const cEvent **result = recManager->UserDefinedTime(1, numResults); | ||||||
|             DisplayFavoriteResults(tvguideConfig.descUser1, result, numResults); |             DisplayFavoriteResults(config.descUser1, result, numResults); | ||||||
|             break; } |             break; } | ||||||
|         case rmsFavoritesUser2: { |         case rmsFavoritesUser2: { | ||||||
|             int numResults = 0; |             int numResults = 0; | ||||||
|             const cEvent **result = recManager->UserDefinedTime(2, numResults); |             const cEvent **result = recManager->UserDefinedTime(2, numResults); | ||||||
|             DisplayFavoriteResults(tvguideConfig.descUser2, result, numResults); |             DisplayFavoriteResults(config.descUser2, result, numResults); | ||||||
|             break; } |             break; } | ||||||
|         case rmsFavoritesUser3: { |         case rmsFavoritesUser3: { | ||||||
|             int numResults = 0; |             int numResults = 0; | ||||||
|             const cEvent **result = recManager->UserDefinedTime(3, numResults); |             const cEvent **result = recManager->UserDefinedTime(3, numResults); | ||||||
|             DisplayFavoriteResults(tvguideConfig.descUser3, result, numResults); |             DisplayFavoriteResults(config.descUser3, result, numResults); | ||||||
|             break; } |             break; } | ||||||
|         case rmsFavoritesUser4: { |         case rmsFavoritesUser4: { | ||||||
|             int numResults = 0; |             int numResults = 0; | ||||||
|             const cEvent **result = recManager->UserDefinedTime(4, numResults); |             const cEvent **result = recManager->UserDefinedTime(4, numResults); | ||||||
|             DisplayFavoriteResults(tvguideConfig.descUser4, result, numResults); |             DisplayFavoriteResults(config.descUser4, result, numResults); | ||||||
|             break; } |             break; } | ||||||
| 
 | 
 | ||||||
|         /**********************************************************************************************
 | /**********************************************************************************************
 | ||||||
|          *    COMMON | *    COMMON | ||||||
|          *********************************************************************************************/ | *********************************************************************************************/ | ||||||
|         case rmsClose: { |         case rmsClose: { | ||||||
|             if (activeMenuBuffer == NULL) { |             if (activeMenuBuffer == NULL) { | ||||||
|                 state = osEnd; |                 state = osEnd; | ||||||
| @@ -837,71 +893,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) { | |||||||
|     return state; |     return state; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void cRecMenuManager::DisplayFavoriteResults(std::string header, const cEvent **result, int numResults) { | eOSState cRecMenuView::ProcessKey(eKeys Key) { | ||||||
|     if (numResults) { |  | ||||||
|         activeMenuBuffer = activeMenu; |  | ||||||
|         activeMenuBuffer->Hide(); |  | ||||||
|         activeMenu = new cRecMenuSearchTimerResults(header, result, numResults, "", rmsFavoritesRecord); |  | ||||||
|         activeMenu->Display(); |  | ||||||
|     } else { |  | ||||||
|         activeMenuBuffer = activeMenu; |  | ||||||
|         activeMenuBuffer->Hide(); |  | ||||||
|         activeMenu = new cRecMenuSearchTimerNothingFound(header); |  | ||||||
|         activeMenu->Display(); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| void cRecMenuManager::DisplaySearchTimerList(void) { |  | ||||||
|     delete activeMenu; |  | ||||||
|     std::vector<cTVGuideSearchTimer> searchTimers; |  | ||||||
|     recManager->GetSearchTimers(&searchTimers); |  | ||||||
|     activeMenu = new cRecMenuSearchTimers(searchTimers); |  | ||||||
|     activeMenu->Display(); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| bool cRecMenuManager::DisplayTimerConflict(const cTimer *timer) { |  | ||||||
|     int timerID = 0; |  | ||||||
| #if VDRVERSNUM >= 20301 |  | ||||||
|     LOCK_TIMERS_READ; |  | ||||||
|     for (const cTimer *t = Timers->First(); t; t = Timers->Next(t)) { |  | ||||||
| #else |  | ||||||
|     for (const cTimer *t = Timers.First(); t; t = Timers.Next(t)) { |  | ||||||
| #endif |  | ||||||
|         if (t == timer) |  | ||||||
|             return DisplayTimerConflict(timerID); |  | ||||||
|         timerID++; |  | ||||||
|     } |  | ||||||
|     return false; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| bool cRecMenuManager::DisplayTimerConflict(int timerID) { |  | ||||||
|     if (timerConflicts) |  | ||||||
|         delete timerConflicts; |  | ||||||
|     timerConflicts = recManager->CheckTimerConflict(); |  | ||||||
|     if (!timerConflicts) |  | ||||||
|         return false; |  | ||||||
|     int showTimerConflict = timerConflicts->GetCorrespondingConflict(timerID); |  | ||||||
|     if (showTimerConflict > -1) { |  | ||||||
|         timerConflicts->SetCurrentConflict(showTimerConflict); |  | ||||||
|         cTVGuideTimerConflict *conflict = timerConflicts->GetCurrentConflict(); |  | ||||||
|         if (!conflict) |  | ||||||
|             return false; |  | ||||||
|         activeMenu = new cRecMenuTimerConflict(conflict); |  | ||||||
|         activeMenu->Display(); |  | ||||||
|         return true; |  | ||||||
|     } |  | ||||||
|     return false; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| void cRecMenuManager::DisplayDetailedView(const cEvent *ev) { |  | ||||||
|     activeMenu->Hide(); |  | ||||||
|     detailView = new cDetailView(ev, footer); |  | ||||||
|     footer->SetDetailedViewMode(true); |  | ||||||
|     detailView->Start(); |  | ||||||
|     detailViewActive = true; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| eOSState cRecMenuManager::ProcessKey(eKeys Key) { |  | ||||||
|     eOSState state = osContinue; |     eOSState state = osContinue; | ||||||
|     eRecMenuState nextState = rmsContinue; |     eRecMenuState nextState = rmsContinue; | ||||||
|     if (!activeMenu) |     if (!activeMenu) | ||||||
| @@ -1,13 +1,13 @@ | |||||||
| #ifndef __TVGUIDE_RECMENUMANAGER_H | #ifndef __TVGUIDE_RECMENUVIEW_H | ||||||
| #define __TVGUIDE_RECMENUMANAGER_H | #define __TVGUIDE_RECMENUVIEW_H | ||||||
| 
 | 
 | ||||||
| #include "recmenu.h" | #include "recmenu.h" | ||||||
| #include "recmanager.h" | #include "recmanager.h" | ||||||
| #include "services/epgsearch.h" | #include "services/epgsearch.h" | ||||||
| #include "footer.h" | #include "footer.h" | ||||||
| 
 | 
 | ||||||
| // --- cRecMenuManager  -------------------------------------------------------------
 | // --- cRecMenuView  -------------------------------------------------------------
 | ||||||
| class cRecMenuManager { | class cRecMenuView { | ||||||
| private: | private: | ||||||
|     cFooter *footer; |     cFooter *footer; | ||||||
|     bool active; |     bool active; | ||||||
| @@ -30,8 +30,8 @@ private: | |||||||
|     void DisplayFavoriteResults(std::string header, const cEvent **result, int numResults); |     void DisplayFavoriteResults(std::string header, const cEvent **result, int numResults); | ||||||
|     eOSState StateMachine(eRecMenuState nextState); |     eOSState StateMachine(eRecMenuState nextState); | ||||||
| public: | public: | ||||||
|     cRecMenuManager(void); |     cRecMenuView(void); | ||||||
|     virtual ~cRecMenuManager(void); |     virtual ~cRecMenuView(void); | ||||||
|     void SetFooter(cFooter *footer) { this->footer = footer; }; |     void SetFooter(cFooter *footer) { this->footer = footer; }; | ||||||
|     bool isActive(void) { return active; }; |     bool isActive(void) { return active; }; | ||||||
|     void Start(const cEvent *event); |     void Start(const cEvent *event); | ||||||
| @@ -40,4 +40,4 @@ public: | |||||||
|     eOSState ProcessKey(eKeys Key); |     eOSState ProcessKey(eKeys Key); | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| #endif //__TVGUIDE_RECMENUMANAGER_H
 | #endif //__TVGUIDE_RECMENUVIEW_H
 | ||||||
| @@ -17,9 +17,11 @@ cTVGuideSearchTimer::cTVGuideSearchTimer(void) { | |||||||
|     stopTime = 2359; |     stopTime = 2359; | ||||||
|     useChannel = false; |     useChannel = false; | ||||||
| #if VDRVERSNUM >= 20301 | #if VDRVERSNUM >= 20301 | ||||||
|  |     { | ||||||
|     LOCK_CHANNELS_READ; |     LOCK_CHANNELS_READ; | ||||||
|     channelMin = Channels->GetByNumber(cDevice::CurrentChannel()); |     channelMin = Channels->GetByNumber(cDevice::CurrentChannel()); | ||||||
|     channelMax = Channels->GetByNumber(cDevice::CurrentChannel()); |     channelMax = Channels->GetByNumber(cDevice::CurrentChannel()); | ||||||
|  |     } | ||||||
| #else | #else | ||||||
|     channelMin = Channels.GetByNumber(cDevice::CurrentChannel()); |     channelMin = Channels.GetByNumber(cDevice::CurrentChannel()); | ||||||
|     channelMax = Channels.GetByNumber(cDevice::CurrentChannel()); |     channelMax = Channels.GetByNumber(cDevice::CurrentChannel()); | ||||||
| @@ -38,7 +40,7 @@ cTVGuideSearchTimer::cTVGuideSearchTimer(void) { | |||||||
|     dayOfWeek = 0; |     dayOfWeek = 0; | ||||||
|     directory = ""; |     directory = ""; | ||||||
|     useEpisode = 0; |     useEpisode = 0; | ||||||
|     priority = 99; |     priority = 50; | ||||||
|     lifetime = 99; |     lifetime = 99; | ||||||
|     marginStart = 5; |     marginStart = 5; | ||||||
|     marginStop = 5; |     marginStop = 5; | ||||||
| @@ -47,19 +49,21 @@ cTVGuideSearchTimer::cTVGuideSearchTimer(void) { | |||||||
|     useExtEPGInfo = 0; |     useExtEPGInfo = 0; | ||||||
|     extEPGInfoValues = ""; |     extEPGInfoValues = ""; | ||||||
|     avoidRepeats = 1; |     avoidRepeats = 1; | ||||||
|     allowedRepeats = 1; |  | ||||||
|     compareTitle = 1; |     compareTitle = 1; | ||||||
|     compareSubtitle = 2; |     compareSubtitle = 1; | ||||||
|     compareSummary = 1; |     compareSummary = 1; | ||||||
|  |     compareSummaryMatchInPercent = 90; | ||||||
|  |     compareDate = 0; | ||||||
|  |     allowedRepeats = 1; | ||||||
|     catvaluesAvoidRepeat = 0; |     catvaluesAvoidRepeat = 0; | ||||||
|     repeatsWithinDays = 0; |     repeatsWithinDays = 0; | ||||||
|     delAfterDays = 0; |     delAfterDays = 0; | ||||||
|     recordingsKeep = 0; |     recordingsKeep = 0; | ||||||
|     switchMinsBefore = 0; |     switchMinsBefore = 1; | ||||||
|     pauseOnNrRecordings = 0; |     pauseOnNrRecordings = 0; | ||||||
|     blacklistMode = 0; |     blacklistMode = 0; | ||||||
|     blacklists = ""; |     blacklists = ""; | ||||||
|     fuzzyTolerance = 0; |     fuzzyTolerance = 1; | ||||||
|     useInFavorites = 0; |     useInFavorites = 0; | ||||||
|     menuTemplate = 0; |     menuTemplate = 0; | ||||||
|     delMode = 0; |     delMode = 0; | ||||||
| @@ -69,9 +73,7 @@ cTVGuideSearchTimer::cTVGuideSearchTimer(void) { | |||||||
|     useAsSearchTimerTil = 0; |     useAsSearchTimerTil = 0; | ||||||
|     ignoreMissingEPGCats = 0; |     ignoreMissingEPGCats = 0; | ||||||
|     unmuteSoundOnSwitch = 0; |     unmuteSoundOnSwitch = 0; | ||||||
|     compareSummaryMatchInPercent = 0; |  | ||||||
|     contentsFilter = ""; |     contentsFilter = ""; | ||||||
|     compareDate = 0; |  | ||||||
| } | } | ||||||
|  |  | ||||||
| cTVGuideSearchTimer::~cTVGuideSearchTimer(void) { | cTVGuideSearchTimer::~cTVGuideSearchTimer(void) { | ||||||
| @@ -95,31 +97,6 @@ void cTVGuideSearchTimer::SetTemplate(std::string tmpl) { | |||||||
|     strTimer = searchTimerString.str(); |     strTimer = searchTimerString.str(); | ||||||
| } | } | ||||||
|  |  | ||||||
| int cTVGuideSearchTimer::DayOfWeek(void) { |  | ||||||
|     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;  |  | ||||||
| } |  | ||||||
|  |  | ||||||
| void cTVGuideSearchTimer::SetDayOfWeek(int VDRDayOfWeek) {  |  | ||||||
|     int epgSearchDayOfWeek = 0; |  | ||||||
|     for (int i=0; i < 7; i++) { |  | ||||||
|         if (VDRDayOfWeek & (1 << i)) { |  | ||||||
|             epgSearchDayOfWeek += pow(2, (i+1)%7); |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
|     this->dayOfWeek = epgSearchDayOfWeek * (-1); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| /* | /* | ||||||
|     0 - unique search timer id |     0 - unique search timer id | ||||||
|     1 - the search term |     1 - the search term | ||||||
| @@ -606,26 +583,6 @@ void cTVGuideSearchTimer::GetDelModes(std::vector<std::string> *delModes) { | |||||||
|     delModes->push_back(tr("count days")); |     delModes->push_back(tr("count days")); | ||||||
| } | } | ||||||
|  |  | ||||||
| void cTVGuideSearchTimer::SetStartChannel(int startChannel) |  | ||||||
| { |  | ||||||
| #if VDRVERSNUM >= 20301 |  | ||||||
|    LOCK_CHANNELS_READ; |  | ||||||
|    channelMin = Channels->GetByNumber(startChannel); |  | ||||||
| #else |  | ||||||
|    channelMin = Channels.GetByNumber(startChannel); |  | ||||||
| #endif |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| void cTVGuideSearchTimer::SetStopChannel(int stopChannel) |  | ||||||
| { |  | ||||||
| #if VDRVERSNUM >= 20301 |  | ||||||
|    LOCK_CHANNELS_READ; |  | ||||||
|    channelMax = Channels->GetByNumber(stopChannel); |  | ||||||
| #else |  | ||||||
|    channelMax = Channels.GetByNumber(stopChannel); |  | ||||||
| #endif |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| void cTVGuideSearchTimer::Dump(void) { | void cTVGuideSearchTimer::Dump(void) { | ||||||
|     esyslog("tvguide searchtimer: strTimer: %s", strTimer.c_str()); |     esyslog("tvguide searchtimer: strTimer: %s", strTimer.c_str()); | ||||||
|     esyslog("tvguide searchtimer: ID: %d", ID); |     esyslog("tvguide searchtimer: ID: %d", ID); | ||||||
|   | |||||||
| @@ -12,13 +12,8 @@ protected: | |||||||
|     int         startTime; |     int         startTime; | ||||||
|     int      	stopTime; |     int      	stopTime; | ||||||
|     int         useChannel; |     int         useChannel; | ||||||
| #if VDRVERSNUM >= 20301 |  | ||||||
|     const cChannel    *channelMin; |     const cChannel    *channelMin; | ||||||
|     const cChannel    *channelMax; |     const cChannel    *channelMax; | ||||||
| #else |  | ||||||
|     cChannel 	*channelMin; |  | ||||||
|     cChannel 	*channelMax; |  | ||||||
| #endif |  | ||||||
|     std::string channelGroup; |     std::string channelGroup; | ||||||
|     int      	useCase; |     int      	useCase; | ||||||
|     int      	mode; |     int      	mode; | ||||||
| @@ -79,54 +74,9 @@ public: | |||||||
|     //GETTER |     //GETTER | ||||||
|     std::string GetSearchString(void) const { return searchString; }; |     std::string GetSearchString(void) const { return searchString; }; | ||||||
|     bool IsActive(void); |     bool IsActive(void); | ||||||
|     int DayOfWeek(void); |  | ||||||
|     bool UseInFavorites(void) { return useInFavorites; }; |     bool UseInFavorites(void) { return useInFavorites; }; | ||||||
|     //SETTER |     //SETTER | ||||||
|     void SetSearchString(std::string searchString) { this->searchString = searchString; }; |     void SetSearchString(std::string searchString) { this->searchString = searchString; }; | ||||||
|     void SetSearchMode(int searchMode) { mode = searchMode; }; |  | ||||||
|     void SetFuzzyTolerance(int fuzzyTolerance) { this->fuzzyTolerance = fuzzyTolerance; }; |  | ||||||
|     void SetUseCase(bool useCase) { this->useCase = useCase; }; |  | ||||||
|     void SetUseTitle(bool useTitle) { this->useTitle = useTitle; }; |  | ||||||
|     void SetUseSubtitle(bool useSubtitle) { this->useSubtitle = useSubtitle; }; |  | ||||||
|     void SetUseDesription(bool useDescription) { this->useDescription = useDescription; }; |  | ||||||
|     void SetUseChannel(int useChannel) { this->useChannel = useChannel; }; |  | ||||||
|     void SetStartChannel(int startChannel); |  | ||||||
|     void SetStopChannel(int stopChannel); |  | ||||||
|     void SetChannelGroup(std::string channelGroup) { this->channelGroup = channelGroup; }; |  | ||||||
|     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 SetUseDuration(bool useDuration) { this->useDuration = useDuration; }; |  | ||||||
|     void SetMinDuration(int minDuration) { this->minDuration = minDuration; }; |  | ||||||
|     void SetMaxDuration(int maxDuration) { this->maxDuration = maxDuration; }; |  | ||||||
|     void SetUseEpisode(int useEpisode) { this->useEpisode = useEpisode; }; |  | ||||||
|     void SetDirectory(std::string directory) { this-> directory = directory; }; |  | ||||||
|     void SetDelAfterDays(int delAfterDays) { this->delAfterDays = delAfterDays; }; |  | ||||||
|     void SetRecordingsKeep(int recordingsKeep) { this->recordingsKeep = recordingsKeep; }; |  | ||||||
|     void SetPauseOnNrRecordings(int  pauseOnNrRecordings) { this-> pauseOnNrRecordings = pauseOnNrRecordings; }; |  | ||||||
|     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 SetRepeatsWithinDays(int repeatsWithinDays) { this-> repeatsWithinDays = repeatsWithinDays; }; |  | ||||||
|     void SetCompareTitle(bool compareTitle) { this->compareTitle = compareTitle; }; |  | ||||||
|     void SetCompareSubtitle(bool compareSubtitle) { this->compareSubtitle = compareSubtitle; }; |  | ||||||
|     void SetCompareSummary(bool compareSummary) { this->compareSummary = compareSummary; }; |  | ||||||
|     void SetCompareSummaryMatchInPercent(int compareSummaryMatchInPercent) { this->compareSummaryMatchInPercent = compareSummaryMatchInPercent; }; |  | ||||||
|     void SetCompareDate(int compareDate) { this->compareDate = compareDate; }; |  | ||||||
|     void SetUseInFavorites(bool useInFavorites) { this->useInFavorites = useInFavorites; }; |  | ||||||
|     void SetUseAsSearchTimer(bool useAsSearchTimer) { this->useAsSearchTimer = useAsSearchTimer; }; |  | ||||||
|     void SetAction(int action) { this->action = action; }; |  | ||||||
|     void SetSwitchMinsBefore(int switchMinsBefore) { this->switchMinsBefore = switchMinsBefore; }; |  | ||||||
|     void SetUnmuteSoundOnSwitch(bool unmuteSoundOnSwitch) { this->unmuteSoundOnSwitch = unmuteSoundOnSwitch; }; |  | ||||||
|     void SetDelMode(bool delMode) { this->delMode = delMode; }; |  | ||||||
|     void SetDelAfterCountRecs(bool delAfterCountRecs) { this->delAfterCountRecs = delAfterCountRecs; }; |  | ||||||
|     void SetDelAfterDaysOfFirstRec(bool delAfterDaysOfFirstRec) { this->delAfterDaysOfFirstRec = delAfterDaysOfFirstRec; }; |  | ||||||
|     //COMMON |     //COMMON | ||||||
|     int GetNumTimers(void); |     int GetNumTimers(void); | ||||||
|     int GetNumRecordings(void); |     int GetNumRecordings(void); | ||||||
|   | |||||||
| @@ -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/timers.h> | ||||||
|  | #include <vdr/epg.h> | ||||||
|  | #include <vdr/osdbase.h> | ||||||
|  |  | ||||||
| // RemoteTimers services | /* | ||||||
| struct RemoteTimers_Event_v1_0 { |  * If the Data argument is NULL, all service calls return true. | ||||||
|     //in |  * Otherwise the return value indicates success or failure of the service call. | ||||||
|     const cEvent *event; |  * | ||||||
|     //out |  * The service calls are not thread safe and must be called from the VDR main loop. | ||||||
|     cTimer *timer; |  */ | ||||||
|     cString errorMsg; |  | ||||||
|  | /* | ||||||
|  |  * 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 { | struct RemoteTimers_GetMatch_v1_0 { | ||||||
|     //in | //in | ||||||
|     const cEvent *event; | 	const cEvent	*event; | ||||||
|     //out | //out | ||||||
|     cTimer *timer; | 	cTimer		*timer; | ||||||
|     int timerMatch; | 	int		timerMatch; | ||||||
|     int timerType; | 	int		timerType; | ||||||
|     bool isRemote; | 	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 { | struct RemoteTimers_Timer_v1_0 { | ||||||
|     //in+out | //in+out | ||||||
|     cTimer *timer; | 	cTimer		*timer; | ||||||
|     //out | //out | ||||||
|     cString errorMsg; | 	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 | ||||||
|   | |||||||
							
								
								
									
										547
									
								
								setup.c
									
									
									
									
									
								
							
							
						
						
									
										547
									
								
								setup.c
									
									
									
									
									
								
							| @@ -1,7 +1,7 @@ | |||||||
| #include "setup.h" | #include "setup.h" | ||||||
|  |  | ||||||
| cTvguideSetup::cTvguideSetup() { | cTvguideSetup::cTvguideSetup() { | ||||||
|     tmpTvguideConfig = tvguideConfig; |     tmpConfig = config; | ||||||
|     Setup(); |     Setup(); | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -9,8 +9,8 @@ cTvguideSetup::~cTvguideSetup() { | |||||||
|     geoManager.SetGeometry(cOsd::OsdWidth(), cOsd::OsdHeight(), true); |     geoManager.SetGeometry(cOsd::OsdWidth(), cOsd::OsdHeight(), true); | ||||||
|     fontManager.DeleteFonts(); |     fontManager.DeleteFonts(); | ||||||
|     fontManager.SetFonts(); |     fontManager.SetFonts(); | ||||||
|     tvguideConfig.LoadTheme(); |     config.LoadTheme(); | ||||||
|     tvguideConfig.setDynamicValues(); |     config.setDynamicValues(); | ||||||
|     imgCache.Clear(); |     imgCache.Clear(); | ||||||
|     imgCache.CreateCache(); |     imgCache.CreateCache(); | ||||||
| } | } | ||||||
| @@ -40,15 +40,15 @@ eOSState cTvguideSetup::ProcessKey(eKeys Key) { | |||||||
|         if ((Key == kOk && !hadSubMenu)) { |         if ((Key == kOk && !hadSubMenu)) { | ||||||
|             const char* ItemText = Get(Current())->Text(); |             const char* ItemText = Get(Current())->Text(); | ||||||
|             if (strcmp(ItemText, tr("General Settings")) == 0) |             if (strcmp(ItemText, tr("General Settings")) == 0) | ||||||
|                 state = AddSubMenu(new cMenuSetupGeneral(&tmpTvguideConfig)); |                 state = AddSubMenu(new cMenuSetupGeneral(&tmpConfig)); | ||||||
|             if (strcmp(ItemText, tr("Screen Presentation")) == 0) |             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) |             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) |             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) |             if (strcmp(ItemText, tr("Image Loading and Caching")) == 0) | ||||||
|                 state = AddSubMenu(new cMenuSetupImageCache(&tmpTvguideConfig));   |                 state = AddSubMenu(new cMenuSetupImageCache(&tmpConfig));   | ||||||
|         } |         } | ||||||
|     }    |     }    | ||||||
|     return state; |     return state; | ||||||
| @@ -56,108 +56,112 @@ eOSState cTvguideSetup::ProcessKey(eKeys Key) { | |||||||
|  |  | ||||||
| void cTvguideSetup::Store(void) { | void cTvguideSetup::Store(void) { | ||||||
|  |  | ||||||
|     tvguideConfig = tmpTvguideConfig; |     config = tmpConfig; | ||||||
|     SetupStore("debugImageLoading", tvguideConfig.debugImageLoading); |     SetupStore("debugImageLoading", config.debugImageLoading); | ||||||
|     SetupStore("useNopacityTheme", tvguideConfig.useNopacityTheme); |     SetupStore("useNopacityTheme", config.useNopacityTheme); | ||||||
|     SetupStore("themeIndex", tvguideConfig.themeIndex); |     SetupStore("themeIndex", config.themeIndex); | ||||||
|     SetupStore("showMainMenuEntry", tvguideConfig.showMainMenuEntry); |     SetupStore("useHWAccel", config.useHWAccel); | ||||||
|     SetupStore("replaceOriginalSchedule", tvguideConfig.replaceOriginalSchedule); |     SetupStore("showMainMenuEntry", config.showMainMenuEntry); | ||||||
|     SetupStore("displayMode", tvguideConfig.displayMode); |     SetupStore("replaceOriginalSchedule", config.replaceOriginalSchedule); | ||||||
|     SetupStore("showTimeInGrid", tvguideConfig.showTimeInGrid); |     SetupStore("displayMode", config.displayMode); | ||||||
|     SetupStore("displayStatusHeader", tvguideConfig.displayStatusHeader); |     SetupStore("showTimeInGrid", config.showTimeInGrid); | ||||||
|     SetupStore("displayChannelGroups", tvguideConfig.displayChannelGroups); |     SetupStore("displayStatusHeader", config.displayStatusHeader); | ||||||
|     SetupStore("displayTimeBase", tvguideConfig.displayTimeBase); |     SetupStore("displayChannelGroups", config.displayChannelGroups); | ||||||
|     SetupStore("headerHeightPercent", tvguideConfig.headerHeightPercent); |     SetupStore("displayTimeBase", config.displayTimeBase); | ||||||
|     SetupStore("channelGroupsPercent", tvguideConfig.channelGroupsPercent); |     SetupStore("headerHeightPercent", config.headerHeightPercent); | ||||||
|     SetupStore("epgViewBorder", tvguideConfig.epgViewBorder); |     SetupStore("channelGroupsPercent", config.channelGroupsPercent); | ||||||
|     SetupStore("scaleVideo", tvguideConfig.scaleVideo); |     SetupStore("epgViewBorder", config.epgViewBorder); | ||||||
|     SetupStore("decorateVideo", tvguideConfig.decorateVideo); |     SetupStore("scaleVideo", config.scaleVideo); | ||||||
|     SetupStore("roundedCorners", tvguideConfig.roundedCorners); |     SetupStore("decorateVideo", config.decorateVideo); | ||||||
|     SetupStore("timeFormat", tvguideConfig.timeFormat); |     SetupStore("roundedCorners", config.roundedCorners); | ||||||
|     SetupStore("channelCols", tvguideConfig.channelCols); |     SetupStore("timeFormat", config.timeFormat); | ||||||
|     SetupStore("channelRows", tvguideConfig.channelRows); |     SetupStore("channelCols", config.channelCols); | ||||||
|     SetupStore("displayTime", tvguideConfig.displayTime); |     SetupStore("channelRows", config.channelRows); | ||||||
|     SetupStore("displayHorizontalTime", tvguideConfig.displayHorizontalTime); |     SetupStore("displayTime", config.displayTime); | ||||||
|     SetupStore("bigStepHours", tvguideConfig.bigStepHours); |     SetupStore("displayHorizontalTime", config.displayHorizontalTime); | ||||||
|     SetupStore("hugeStepHours", tvguideConfig.hugeStepHours); |     SetupStore("bigStepHours", config.bigStepHours); | ||||||
|     SetupStore("channelJumpMode", tvguideConfig.channelJumpMode); |     SetupStore("bigStepHoursHorizontal", config.bigStepHoursHorizontal); | ||||||
|     SetupStore("blueKeyMode", tvguideConfig.blueKeyMode); |     SetupStore("hugeStepHours", config.hugeStepHours); | ||||||
|     SetupStore("numkeyMode", tvguideConfig.numkeyMode); |     SetupStore("hugeStepHoursHorizontal", config.hugeStepHoursHorizontal); | ||||||
|     SetupStore("useRemoteTimers", tvguideConfig.useRemoteTimers); |     SetupStore("channelJumpMode", config.channelJumpMode); | ||||||
|     SetupStore("closeOnSwitch", tvguideConfig.closeOnSwitch); |     SetupStore("blueKeyMode", config.blueKeyMode); | ||||||
|     SetupStore("hideLastGroup", tvguideConfig.hideLastGroup); |     SetupStore("numkeyMode", config.numkeyMode); | ||||||
|     SetupStore("hideChannelLogos", tvguideConfig.hideChannelLogos); |     SetupStore("useRemoteTimers", config.useRemoteTimers); | ||||||
|     SetupStore("logoExtension", tvguideConfig.logoExtension); |     SetupStore("closeOnSwitch", config.closeOnSwitch); | ||||||
|     SetupStore("logoWidthRatio", tvguideConfig.logoWidthRatio); |     SetupStore("hideLastGroup", config.hideLastGroup); | ||||||
|     SetupStore("logoHeightRatio", tvguideConfig.logoHeightRatio); |     SetupStore("hideChannelLogos", config.hideChannelLogos); | ||||||
|     SetupStore("hideEpgImages", tvguideConfig.hideEpgImages); |     SetupStore("logoExtension", config.logoExtension); | ||||||
|     SetupStore("epgImageWidth", tvguideConfig.epgImageWidth); |     SetupStore("logoWidthRatio", config.logoWidthRatio); | ||||||
|     SetupStore("epgImageHeight", tvguideConfig.epgImageHeight); |     SetupStore("logoHeightRatio", config.logoHeightRatio); | ||||||
|     SetupStore("numAdditionalEPGPictures", tvguideConfig.numAdditionalEPGPictures); |     SetupStore("hideEpgImages", config.hideEpgImages); | ||||||
|     SetupStore("epgImageWidthLarge", tvguideConfig.epgImageWidthLarge); |     SetupStore("epgImageWidth", config.epgImageWidth); | ||||||
|     SetupStore("epgImageHeightLarge", tvguideConfig.epgImageHeightLarge); |     SetupStore("epgImageHeight", config.epgImageHeight); | ||||||
|     SetupStore("detailedViewScrollStep", tvguideConfig.detailedViewScrollStep); |     SetupStore("numAdditionalEPGPictures", config.numAdditionalEPGPictures); | ||||||
|     SetupStore("timeLineWidthPercent", tvguideConfig.timeLineWidthPercent); |     SetupStore("epgImageWidthLarge", config.epgImageWidthLarge); | ||||||
|     SetupStore("timeLineHeightPercent", tvguideConfig.timeLineHeightPercent); |     SetupStore("epgImageHeightLarge", config.epgImageHeightLarge); | ||||||
|     SetupStore("displayChannelName", tvguideConfig.displayChannelName); |     SetupStore("detailedViewScrollStep", config.detailedViewScrollStep); | ||||||
|     SetupStore("channelHeaderWidthPercent", tvguideConfig.channelHeaderWidthPercent); |     SetupStore("timeLineWidthPercent", config.timeLineWidthPercent); | ||||||
|     SetupStore("channelHeaderHeightPercent", tvguideConfig.channelHeaderHeightPercent); |     SetupStore("timeLineHeightPercent", config.timeLineHeightPercent); | ||||||
|     SetupStore("footerHeightPercent", tvguideConfig.footerHeightPercent); |     SetupStore("displayChannelName", config.displayChannelName); | ||||||
|     SetupStore("instRecFolderMode", tvguideConfig.instRecFolderMode); |     SetupStore("channelHeaderWidthPercent", config.channelHeaderWidthPercent); | ||||||
|     SetupStore("instRecFixedFolder", tvguideConfig.instRecFixedFolder.c_str()); |     SetupStore("channelHeaderHeightPercent", config.channelHeaderHeightPercent); | ||||||
|     SetupStore("favWhatsOnNow", tvguideConfig.favWhatsOnNow); |     SetupStore("footerHeightPercent", config.footerHeightPercent); | ||||||
|     SetupStore("favWhatsOnNext", tvguideConfig.favWhatsOnNext); |     SetupStore("instRecFolderMode", config.instRecFolderMode); | ||||||
|     SetupStore("favUseTime1", tvguideConfig.favUseTime1); |     SetupStore("instRecFixedFolder", config.instRecFixedFolder.c_str()); | ||||||
|     SetupStore("favUseTime2", tvguideConfig.favUseTime2); |     SetupStore("AddSubtitleToTimerMode", config.addSubtitleToTimer); | ||||||
|     SetupStore("favUseTime3", tvguideConfig.favUseTime3); |     SetupStore("favWhatsOnNow", config.favWhatsOnNow); | ||||||
|     SetupStore("favUseTime4", tvguideConfig.favUseTime4); |     SetupStore("favWhatsOnNext", config.favWhatsOnNext); | ||||||
|     SetupStore("favTime1", tvguideConfig.favTime1); |     SetupStore("favUseTime1", config.favUseTime1); | ||||||
|     SetupStore("favTime2", tvguideConfig.favTime2); |     SetupStore("favUseTime2", config.favUseTime2); | ||||||
|     SetupStore("favTime3", tvguideConfig.favTime3); |     SetupStore("favUseTime3", config.favUseTime3); | ||||||
|     SetupStore("favTime4", tvguideConfig.favTime4); |     SetupStore("favUseTime4", config.favUseTime4); | ||||||
|     SetupStore("descUser1", tvguideConfig.descUser1.c_str()); |     SetupStore("favTime1", config.favTime1); | ||||||
|     SetupStore("descUser2", tvguideConfig.descUser2.c_str()); |     SetupStore("favTime2", config.favTime2); | ||||||
|     SetupStore("descUser3", tvguideConfig.descUser3.c_str()); |     SetupStore("favTime3", config.favTime3); | ||||||
|     SetupStore("descUser4", tvguideConfig.descUser4.c_str()); |     SetupStore("favTime4", config.favTime4); | ||||||
|     SetupStore("favLimitChannels", tvguideConfig.favLimitChannels); |     SetupStore("descUser1", config.descUser1.c_str()); | ||||||
|     SetupStore("favStartChannel", tvguideConfig.favStartChannel); |     SetupStore("descUser2", config.descUser2.c_str()); | ||||||
|     SetupStore("favStopChannel", tvguideConfig.favStopChannel); |     SetupStore("descUser3", config.descUser3.c_str()); | ||||||
|     SetupStore("switchMode", tvguideConfig.switchMode); |     SetupStore("descUser4", config.descUser4.c_str()); | ||||||
|     SetupStore("switchMinsBefore", tvguideConfig.switchMinsBefore); |     SetupStore("favLimitChannels", config.favLimitChannels); | ||||||
|     SetupStore("fontIndex", tvguideConfig.fontIndex); |     SetupStore("favStartChannel", config.favStartChannel); | ||||||
|     SetupStore("FontButtonDelta", tvguideConfig.FontButtonDelta); |     SetupStore("favStopChannel", config.favStopChannel); | ||||||
|     SetupStore("FontDetailViewDelta", tvguideConfig.FontDetailViewDelta); |     SetupStore("switchMode", config.switchMode); | ||||||
|     SetupStore("FontDetailHeaderDelta", tvguideConfig.FontDetailHeaderDelta); |     SetupStore("switchMinsBefore", config.switchMinsBefore); | ||||||
|     SetupStore("FontMessageBoxDelta", tvguideConfig.FontMessageBoxDelta); |     SetupStore("fontIndex", config.fontIndex); | ||||||
|     SetupStore("FontMessageBoxLargeDelta", tvguideConfig.FontMessageBoxLargeDelta); |     SetupStore("FontButtonDelta", config.FontButtonDelta); | ||||||
|     SetupStore("FontStatusHeaderDelta", tvguideConfig.FontStatusHeaderDelta); |     SetupStore("FontDetailViewDelta", config.FontDetailViewDelta); | ||||||
|     SetupStore("FontStatusHeaderLargeDelta", tvguideConfig.FontStatusHeaderLargeDelta); |     SetupStore("FontDetailHeaderDelta", config.FontDetailHeaderDelta); | ||||||
|     SetupStore("FontChannelHeaderDelta", tvguideConfig.FontChannelHeaderDelta); |     SetupStore("FontMessageBoxDelta", config.FontMessageBoxDelta); | ||||||
|     SetupStore("FontChannelGroupsDelta", tvguideConfig.FontChannelGroupsDelta); |     SetupStore("FontMessageBoxLargeDelta", config.FontMessageBoxLargeDelta); | ||||||
|     SetupStore("FontGridDelta", tvguideConfig.FontGridDelta); |     SetupStore("FontStatusHeaderDelta", config.FontStatusHeaderDelta); | ||||||
|     SetupStore("FontGridSmallDelta", tvguideConfig.FontGridSmallDelta); |     SetupStore("FontStatusHeaderLargeDelta", config.FontStatusHeaderLargeDelta); | ||||||
|     SetupStore("FontTimeLineWeekdayDelta", tvguideConfig.FontTimeLineWeekdayDelta); |     SetupStore("FontChannelHeaderDelta", config.FontChannelHeaderDelta); | ||||||
|     SetupStore("FontTimeLineDateDelta", tvguideConfig.FontTimeLineDateDelta); |     SetupStore("FontChannelGroupsDelta", config.FontChannelGroupsDelta); | ||||||
|     SetupStore("FontTimeLineTimeDelta", tvguideConfig.FontTimeLineTimeDelta); |     SetupStore("FontGridDelta", config.FontGridDelta); | ||||||
|     SetupStore("FontChannelHeaderHorizontalDelta", tvguideConfig.FontChannelHeaderHorizontalDelta); |     SetupStore("FontGridSmallDelta", config.FontGridSmallDelta); | ||||||
|     SetupStore("FontChannelGroupsHorizontalDelta", tvguideConfig.FontChannelGroupsHorizontalDelta); |     SetupStore("FontTimeLineWeekdayDelta", config.FontTimeLineWeekdayDelta); | ||||||
|     SetupStore("FontGridHorizontalDelta", tvguideConfig.FontGridHorizontalDelta); |     SetupStore("FontTimeLineDateDelta", config.FontTimeLineDateDelta); | ||||||
|     SetupStore("FontGridHorizontalSmallDelta", tvguideConfig.FontGridHorizontalSmallDelta); |     SetupStore("FontTimeLineTimeDelta", config.FontTimeLineTimeDelta); | ||||||
|     SetupStore("FontTimeLineDateHorizontalDelta", tvguideConfig.FontTimeLineDateHorizontalDelta); |     SetupStore("FontChannelHeaderHorizontalDelta", config.FontChannelHeaderHorizontalDelta); | ||||||
|     SetupStore("FontTimeLineTimeHorizontalDelta", tvguideConfig.FontTimeLineTimeHorizontalDelta); |     SetupStore("FontChannelGroupsHorizontalDelta", config.FontChannelGroupsHorizontalDelta); | ||||||
|     SetupStore("FontRecMenuItemDelta", tvguideConfig.FontRecMenuItemDelta); |     SetupStore("FontGridHorizontalDelta", config.FontGridHorizontalDelta); | ||||||
|     SetupStore("FontRecMenuItemSmallDelta", tvguideConfig.FontRecMenuItemSmallDelta); |     SetupStore("FontGridHorizontalSmallDelta", config.FontGridHorizontalSmallDelta); | ||||||
|     SetupStore("FontRecMenuItemLargeDelta", tvguideConfig.FontRecMenuItemLargeDelta); |     SetupStore("FontTimeLineDateHorizontalDelta", config.FontTimeLineDateHorizontalDelta); | ||||||
|     SetupStore("displayRerunsDetailEPGView", tvguideConfig.displayRerunsDetailEPGView); |     SetupStore("FontTimeLineTimeHorizontalDelta", config.FontTimeLineTimeHorizontalDelta); | ||||||
|     SetupStore("numReruns", tvguideConfig.numReruns); |     SetupStore("FontRecMenuItemDelta", config.FontRecMenuItemDelta); | ||||||
|     SetupStore("useSubtitleRerun", tvguideConfig.useSubtitleRerun); |     SetupStore("FontRecMenuItemSmallDelta", config.FontRecMenuItemSmallDelta); | ||||||
|     SetupStore("numLogosInitial", tvguideConfig.numLogosInitial); |     SetupStore("FontRecMenuItemLargeDelta", config.FontRecMenuItemLargeDelta); | ||||||
|     SetupStore("numLogosMax", tvguideConfig.numLogosMax); |     SetupStore("displayRerunsDetailEPGView", config.displayRerunsDetailEPGView); | ||||||
|     SetupStore("limitLogoCache", tvguideConfig.limitLogoCache); |     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, 40) { | cMenuSetupSubMenu::cMenuSetupSubMenu(const char* Title, cTVGuideConfig* data) : cOsdMenu(Title, 40) { | ||||||
|     tmpTvguideConfig = data; |     tmpConfig = data; | ||||||
|     indent = "    "; |     indent = "    "; | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -183,7 +187,7 @@ eOSState cMenuSetupSubMenu::ProcessKey(eKeys Key) { | |||||||
|  |  | ||||||
| //----- General Settings ------------------------------------------------------------------------------------------------------------- | //----- General Settings ------------------------------------------------------------------------------------------------------------- | ||||||
|  |  | ||||||
| cMenuSetupGeneral::cMenuSetupGeneral(cTvguideConfig* data)  : cMenuSetupSubMenu(tr("General Settings"), data) { | cMenuSetupGeneral::cMenuSetupGeneral(cTVGuideConfig* data)  : cMenuSetupSubMenu(tr("General Settings"), data) { | ||||||
|     themes.Load(*cString("tvguide")); |     themes.Load(*cString("tvguide")); | ||||||
|     timeFormatItems[0] = "12h"; |     timeFormatItems[0] = "12h"; | ||||||
|     timeFormatItems[1] = "24h"; |     timeFormatItems[1] = "24h"; | ||||||
| @@ -203,47 +207,53 @@ cMenuSetupGeneral::cMenuSetupGeneral(cTvguideConfig* data)  : cMenuSetupSubMenu( | |||||||
| void cMenuSetupGeneral::Set(void) { | void cMenuSetupGeneral::Set(void) { | ||||||
|     int currentItem = Current(); |     int currentItem = Current(); | ||||||
|     Clear(); |     Clear(); | ||||||
|     Add(new cMenuEditBoolItem(tr("Show Main Menu Entry"), &tmpTvguideConfig->showMainMenuEntry)); |     Add(new cMenuEditBoolItem(tr("Use workaround for HWAccelerated OSD"), &tmpConfig->useHWAccel)); | ||||||
|     Add(new cMenuEditBoolItem(tr("Replace VDR Schedules Menu"), &tmpTvguideConfig->replaceOriginalSchedule)); |     Add(new cMenuEditBoolItem(tr("Show Main Menu Entry"), &tmpConfig->showMainMenuEntry)); | ||||||
|     Add(new cMenuEditBoolItem(tr("Use appropriate nOpacity Theme"), &tmpTvguideConfig->useNopacityTheme)); |     Add(new cMenuEditBoolItem(tr("Replace VDR Schedules Menu"), &tmpConfig->replaceOriginalSchedule)); | ||||||
|     if (!tmpTvguideConfig->useNopacityTheme) { |     Add(new cMenuEditBoolItem(tr("Use appropriate nOpacity Theme"), &tmpConfig->useNopacityTheme)); | ||||||
|  |     if (!tmpConfig->useNopacityTheme) { | ||||||
|         if (themes.NumThemes()) |         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())); | ||||||
|     } |     } | ||||||
|     if (tmpTvguideConfig->displayMode == eVertical) { |     if (tmpConfig->displayMode == eVertical) { | ||||||
|         Add(new cMenuEditIntItem(tr("Time to display in minutes"), &tmpTvguideConfig->displayTime, 60, 320)); |         Add(new cMenuEditIntItem(tr("Time to display in minutes"), &tmpConfig->displayTime, 60, 320)); | ||||||
|     } else if (tmpTvguideConfig->displayMode == eHorizontal) { |     } else if (tmpConfig->displayMode == eHorizontal) { | ||||||
|         Add(new cMenuEditIntItem(tr("Time to display in minutes"), &tmpTvguideConfig->displayHorizontalTime, 60, 320)); |         Add(new cMenuEditIntItem(tr("Time to display in minutes"), &tmpConfig->displayHorizontalTime, 60, 320)); | ||||||
|     } |     } | ||||||
|     Add(new cMenuEditBoolItem(tr("Rounded Corners"), &tmpTvguideConfig->roundedCorners)); |     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("Channel Jump Mode (Keys Green / Yellow)"), &tmpConfig->channelJumpMode, 2,  jumpMode)); | ||||||
|     Add(new cMenuEditStraItem(tr("Keys Blue and OK"), &tmpTvguideConfig->blueKeyMode, 3,  blueMode)); |     Add(new cMenuEditStraItem(tr("Keys Blue and OK"), &tmpConfig->blueKeyMode, 3,  blueMode)); | ||||||
|     Add(new cMenuEditBoolItem(tr("Close TVGuide after channel switch"), &tmpTvguideConfig->closeOnSwitch)); |     Add(new cMenuEditBoolItem(tr("Close TVGuide after channel switch"), &tmpConfig->closeOnSwitch)); | ||||||
|     Add(new cMenuEditStraItem(tr("Functionality of numeric Keys"), &tmpTvguideConfig->numkeyMode, 2,  numMode)); |     Add(new cMenuEditStraItem(tr("Functionality of numeric Keys"), &tmpConfig->numkeyMode, 2,  numMode)); | ||||||
|     Add(new cMenuEditBoolItem(tr("Hide last Channel Group"), &tmpTvguideConfig->hideLastGroup)); |     Add(new cMenuEditBoolItem(tr("Hide last Channel Group"), &tmpConfig->hideLastGroup)); | ||||||
|     Add(new cMenuEditIntItem(tr("Big Step (Keys 1 / 3) in hours"), &tmpTvguideConfig->bigStepHours, 1, 12)); |     if (tmpConfig->displayMode == eVertical) { | ||||||
|     Add(new cMenuEditIntItem(tr("Huge Step (Keys 4 / 6) in hours"), &tmpTvguideConfig->hugeStepHours, 13, 48)); |         Add(new cMenuEditIntItem(tr("Big Step (Keys 1 / 3) in hours"), &tmpConfig->bigStepHours, 1, 12)); | ||||||
|     Add(new cMenuEditStraItem(tr("Time Format (12h/24h)"), &tmpTvguideConfig->timeFormat, 2,  timeFormatItems)); |         Add(new cMenuEditIntItem(tr("Huge Step (Keys 4 / 6) in hours"), &tmpConfig->hugeStepHours, 13, 48)); | ||||||
|     Add(new cMenuEditIntItem(tr("EPG Window Text Scrolling Speed"), &tmpTvguideConfig->detailedViewScrollStep, 1, 30)); |     } else if (tmpConfig->displayMode == eHorizontal) { | ||||||
|     Add(new cMenuEditBoolItem(tr("Display Reruns in detailed EPG View"), &tmpTvguideConfig->displayRerunsDetailEPGView)); |         Add(new cMenuEditIntItem(tr("Big Step (Keys 1 / 3) in hours"), &tmpConfig->bigStepHoursHorizontal, 1, 12)); | ||||||
|     if (tmpTvguideConfig->displayRerunsDetailEPGView) { |         Add(new cMenuEditIntItem(tr("Huge Step (Keys 4 / 6) in hours"), &tmpConfig->hugeStepHoursHorizontal, 13, 48)); | ||||||
|         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("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)); |     SetCurrent(Get(currentItem)); | ||||||
|     Display(); |     Display(); | ||||||
| } | } | ||||||
|  |  | ||||||
| eOSState cMenuSetupGeneral::ProcessKey(eKeys Key) { | eOSState cMenuSetupGeneral::ProcessKey(eKeys Key) { | ||||||
|     bool olduseNopacityTheme = tmpTvguideConfig->useNopacityTheme; |     bool olduseNopacityTheme = tmpConfig->useNopacityTheme; | ||||||
|     bool olddisplayRerunsDetailEPGView = tmpTvguideConfig->displayRerunsDetailEPGView; |     bool olddisplayRerunsDetailEPGView = tmpConfig->displayRerunsDetailEPGView; | ||||||
|     eOSState state = cOsdMenu::ProcessKey(Key); |     eOSState state = cOsdMenu::ProcessKey(Key); | ||||||
|     if (Key == kOk) { |     if (Key == kOk) { | ||||||
|         state = osBack; |         state = osBack; | ||||||
|     } else if (Key != kNone) { |     } else if (Key != kNone) { | ||||||
|         if (tmpTvguideConfig->useNopacityTheme != olduseNopacityTheme || |         if (tmpConfig->useNopacityTheme != olduseNopacityTheme || | ||||||
| 	    tmpTvguideConfig->displayRerunsDetailEPGView != olddisplayRerunsDetailEPGView) { | 	    tmpConfig->displayRerunsDetailEPGView != olddisplayRerunsDetailEPGView) { | ||||||
|             Set(); |             Set(); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| @@ -252,7 +262,7 @@ eOSState cMenuSetupGeneral::ProcessKey(eKeys Key) { | |||||||
|  |  | ||||||
| //----- Screen Presentation ------------------------------------------------------------------------------------------------------------- | //----- Screen Presentation ------------------------------------------------------------------------------------------------------------- | ||||||
|  |  | ||||||
| cMenuSetupScreenLayout::cMenuSetupScreenLayout(cTvguideConfig* data)  : cMenuSetupSubMenu(tr("Screen Presentation"), data) { | cMenuSetupScreenLayout::cMenuSetupScreenLayout(cTVGuideConfig* data)  : cMenuSetupSubMenu(tr("Screen Presentation"), data) { | ||||||
|     displayModeItems[0] = "vertical"; |     displayModeItems[0] = "vertical"; | ||||||
|     displayModeItems[1] = "horizontal"; |     displayModeItems[1] = "horizontal"; | ||||||
|     hideChannelLogosItems[0] = trVDR("yes"); |     hideChannelLogosItems[0] = trVDR("yes"); | ||||||
| @@ -266,55 +276,55 @@ void cMenuSetupScreenLayout::Set(void) { | |||||||
|     int currentItem = Current(); |     int currentItem = Current(); | ||||||
|     Clear(); |     Clear(); | ||||||
|      |      | ||||||
|     Add(new cMenuEditStraItem(tr("Display Mode"), &tmpTvguideConfig->displayMode, 2,  displayModeItems)); |     Add(new cMenuEditStraItem(tr("Display Mode"), &tmpConfig->displayMode, 2,  displayModeItems)); | ||||||
|     if (tmpTvguideConfig->displayMode == eVertical) { |     if (tmpConfig->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("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)")), &tmpTvguideConfig->timeLineWidthPercent, 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")), &tmpTvguideConfig->channelCols, 3, 12)); |         Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Number of Channels to display")), &tmpConfig->channelCols, 3, 12)); | ||||||
|     } else if (tmpTvguideConfig->displayMode == eHorizontal) { |     } else if (tmpConfig->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("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)")), &tmpTvguideConfig->timeLineHeightPercent, 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")), &tmpTvguideConfig->channelRows, 3, 12)); |         Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Number of Channels to display")), &tmpConfig->channelRows, 3, 12)); | ||||||
|         Add(new cMenuEditBoolItem(*cString::sprintf("%s%s", *indent, tr("Display time in EPG Grids")), &tmpTvguideConfig->showTimeInGrid)); |  | ||||||
|     } |     } | ||||||
|     Add(new cMenuEditIntItem(tr("Height of Headers (Status Header and EPG View, Perc. of osd height)"), &tmpTvguideConfig->headerHeightPercent, 10, 50)); |     Add(new cMenuEditBoolItem(tr("Display time in EPG Grids"), &tmpConfig->showTimeInGrid)); | ||||||
|     Add(new cMenuEditIntItem(tr("Height of Footer (Perc. of osd height)"), &tmpTvguideConfig->footerHeightPercent, 3, 20)); |     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)); |     Add(new cMenuEditBoolItem(tr("Display status header"), &tmpConfig->displayStatusHeader)); | ||||||
|     if (tmpTvguideConfig->displayStatusHeader) { |     if (tmpConfig->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("Scale video to upper right corner")), &tmpConfig->scaleVideo)); | ||||||
|         Add(new cMenuEditBoolItem(*cString::sprintf("%s%s", *indent, tr("Rounded corners around video frame")), &tmpTvguideConfig->decorateVideo)); |         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 Names in Header"), &tmpConfig->displayChannelName)); | ||||||
|     Add(new cMenuEditBoolItem(tr("Display channel groups"), &tmpTvguideConfig->displayChannelGroups)); |     Add(new cMenuEditBoolItem(tr("Display channel groups"), &tmpConfig->displayChannelGroups)); | ||||||
|     if (tmpTvguideConfig->displayChannelGroups) { |     if (tmpConfig->displayChannelGroups) { | ||||||
|         if (tmpTvguideConfig->displayMode == eVertical) { |         if (tmpConfig->displayMode == eVertical) { | ||||||
|             Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Height of channel groups (Perc. of osd height)")), &tmpTvguideConfig->channelGroupsPercent, 3, 30)); |             Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Height of channel groups (Perc. of osd height)")), &tmpConfig->channelGroupsPercent, 3, 30)); | ||||||
|         } else if (tmpTvguideConfig->displayMode == eHorizontal) { |         } else if (tmpConfig->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 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 cMenuEditBoolItem(tr("Display current time baseline"), &tmpConfig->displayTimeBase)); | ||||||
|     Add(new cMenuEditStraItem(tr("Show Channel Logos"), &tmpTvguideConfig->hideChannelLogos, 2,  hideChannelLogosItems));    |     Add(new cMenuEditStraItem(tr("Show Channel Logos"), &tmpConfig->hideChannelLogos, 2,  hideChannelLogosItems));    | ||||||
|     if (!tmpTvguideConfig->hideChannelLogos) { |     if (!tmpConfig->hideChannelLogos) { | ||||||
|         Add(InfoItem(tr("Logo Path used"), *tvguideConfig.logoPath)); |         Add(InfoItem(tr("Logo Path used"), *config.logoPath)); | ||||||
|         Add(new cMenuEditStraItem(*cString::sprintf("%s%s", *indent, tr("Logo Extension")), &tmpTvguideConfig->logoExtension, 2,  logoExtensionItems)); |         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")), &tmpTvguideConfig->logoWidthRatio, 1, 1000)); |         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")), &tmpTvguideConfig->logoHeightRatio, 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));  |     Add(new cMenuEditStraItem(tr("Show EPG Images"), &tmpConfig->hideEpgImages, 2,  hideChannelLogosItems));  | ||||||
|     if (!tmpTvguideConfig->hideEpgImages) { |     if (!tmpConfig->hideEpgImages) { | ||||||
|         Add(InfoItem(tr("EPG Images Path used"), *tvguideConfig.epgImagePath)); |         Add(InfoItem(tr("EPG Images Path used"), *config.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 width")), &tmpConfig->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("EPG Image height")), &tmpConfig->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("Number of additional EPG Images")), &tmpConfig->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 width")), &tmpConfig->epgImageWidthLarge, 1, 800)); | ||||||
|         Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Additional EPG Image height")), &tmpTvguideConfig->epgImageHeightLarge, 0, 800)); |         Add(new cMenuEditIntItem(*cString::sprintf("%s%s", *indent, tr("Additional EPG Image height")), &tmpConfig->epgImageHeightLarge, 0, 800)); | ||||||
|     } |     } | ||||||
|      |      | ||||||
|     SetCurrent(Get(currentItem)); |     SetCurrent(Get(currentItem)); | ||||||
| @@ -322,20 +332,20 @@ void cMenuSetupScreenLayout::Set(void) { | |||||||
| } | } | ||||||
|  |  | ||||||
| eOSState cMenuSetupScreenLayout::ProcessKey(eKeys Key) { | eOSState cMenuSetupScreenLayout::ProcessKey(eKeys Key) { | ||||||
|     int olddisplayMode = tmpTvguideConfig->displayMode; |     int olddisplayMode = tmpConfig->displayMode; | ||||||
|     bool olddisplayStatusHeader = tmpTvguideConfig->displayStatusHeader; |     bool olddisplayStatusHeader = tmpConfig->displayStatusHeader; | ||||||
|     bool olddisplayChannelGroups = tmpTvguideConfig->displayChannelGroups; |     bool olddisplayChannelGroups = tmpConfig->displayChannelGroups; | ||||||
|     int oldhideChannelLogos = tmpTvguideConfig->hideChannelLogos; |     int oldhideChannelLogos = tmpConfig->hideChannelLogos; | ||||||
|     int oldhideEpgImages = tmpTvguideConfig->hideEpgImages; |     int oldhideEpgImages = tmpConfig->hideEpgImages; | ||||||
|     eOSState state = cOsdMenu::ProcessKey(Key); |     eOSState state = cOsdMenu::ProcessKey(Key); | ||||||
|     if (Key == kOk) { |     if (Key == kOk) { | ||||||
|         state = osBack; |         state = osBack; | ||||||
|     } else if (Key != kNone) { |     } else if (Key != kNone) { | ||||||
|         if (tmpTvguideConfig->displayMode != olddisplayMode || |         if (tmpConfig->displayMode != olddisplayMode || | ||||||
|             tmpTvguideConfig->displayStatusHeader != olddisplayStatusHeader || |             tmpConfig->displayStatusHeader != olddisplayStatusHeader || | ||||||
|             tmpTvguideConfig->displayChannelGroups != olddisplayChannelGroups || |             tmpConfig->displayChannelGroups != olddisplayChannelGroups || | ||||||
|             tmpTvguideConfig->hideChannelLogos != oldhideChannelLogos || |             tmpConfig->hideChannelLogos != oldhideChannelLogos || | ||||||
|             tmpTvguideConfig->hideEpgImages != oldhideEpgImages) { |             tmpConfig->hideEpgImages != oldhideEpgImages) { | ||||||
|             Set(); |             Set(); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| @@ -344,9 +354,9 @@ eOSState cMenuSetupScreenLayout::ProcessKey(eKeys Key) { | |||||||
|  |  | ||||||
| //-----Fonts and Fontsizes ------------------------------------------------------------------------------------------------------- | //-----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); |     cFont::GetAvailableFontNames(&fontNames); | ||||||
|     fontNames.Insert(strdup(tvguideConfig.fontNameDefault)); |     fontNames.Insert(strdup(config.fontNameDefault)); | ||||||
|     Set(); |     Set(); | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -354,37 +364,37 @@ void cMenuSetupFont::Set(void) { | |||||||
|     int currentItem = Current(); |     int currentItem = Current(); | ||||||
|     Clear(); |     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 Font Size"), &tmpConfig->FontStatusHeaderDelta, -30, 30));     | ||||||
|     Add(new cMenuEditIntItem(tr("Status Header Large Font Size"), &tmpTvguideConfig->FontStatusHeaderLargeDelta, -30, 30)); |     Add(new cMenuEditIntItem(tr("Status Header Large Font Size"), &tmpConfig->FontStatusHeaderLargeDelta, -30, 30)); | ||||||
|     Add(new cMenuEditIntItem(tr("Detail EPG View Font Size"), &tmpTvguideConfig->FontDetailViewDelta, -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"), &tmpTvguideConfig->FontDetailHeaderDelta, -30, 30)); |     Add(new cMenuEditIntItem(tr("Detail EPG View Header Font Size"), &tmpConfig->FontDetailHeaderDelta, -30, 30)); | ||||||
|     Add(new cMenuEditIntItem(tr("Message Font Size"), &tmpTvguideConfig->FontMessageBoxDelta, -30, 30)); |     Add(new cMenuEditIntItem(tr("Message Font Size"), &tmpConfig->FontMessageBoxDelta, -30, 30)); | ||||||
|     Add(new cMenuEditIntItem(tr("Message Large Font Size"), &tmpTvguideConfig->FontMessageBoxLargeDelta, -30, 30)); |     Add(new cMenuEditIntItem(tr("Message Large Font Size"), &tmpConfig->FontMessageBoxLargeDelta, -30, 30)); | ||||||
|     Add(new cMenuEditIntItem(tr("Button Font Size"), &tmpTvguideConfig->FontButtonDelta, -30, 30)); |     Add(new cMenuEditIntItem(tr("Button Font Size"), &tmpConfig->FontButtonDelta, -30, 30)); | ||||||
|  |  | ||||||
|  |  | ||||||
|     if (tmpTvguideConfig->displayMode == eVertical) { |     if (tmpConfig->displayMode == eVertical) { | ||||||
|         Add(new cMenuEditIntItem(tr("Channel Header Font Size"), &tmpTvguideConfig->FontChannelHeaderDelta, -30, 30)); |         Add(new cMenuEditIntItem(tr("Channel Header Font Size"), &tmpConfig->FontChannelHeaderDelta, -30, 30)); | ||||||
|         Add(new cMenuEditIntItem(tr("Channel Groups Font Size"), &tmpTvguideConfig->FontChannelGroupsDelta, -30, 30)); |         Add(new cMenuEditIntItem(tr("Channel Groups Font Size"), &tmpConfig->FontChannelGroupsDelta, -30, 30)); | ||||||
|         Add(new cMenuEditIntItem(tr("Grid Font Size"), &tmpTvguideConfig->FontGridDelta, -30, 30)); |         Add(new cMenuEditIntItem(tr("Grid Font Size"), &tmpConfig->FontGridDelta, -30, 30)); | ||||||
|         Add(new cMenuEditIntItem(tr("Grid Font Small Size"), &tmpTvguideConfig->FontGridSmallDelta, -30, 30)); |         Add(new cMenuEditIntItem(tr("Grid Font Small Size"), &tmpConfig->FontGridSmallDelta, -30, 30)); | ||||||
|         Add(new cMenuEditIntItem(tr("Timeline Weekday Font Size"), &tmpTvguideConfig->FontTimeLineWeekdayDelta, -30, 30)); |         Add(new cMenuEditIntItem(tr("Timeline Weekday Font Size"), &tmpConfig->FontTimeLineWeekdayDelta, -30, 30)); | ||||||
|         Add(new cMenuEditIntItem(tr("Timeline Date Font Size"), &tmpTvguideConfig->FontTimeLineDateDelta, -30, 30)); |         Add(new cMenuEditIntItem(tr("Timeline Date Font Size"), &tmpConfig->FontTimeLineDateDelta, -30, 30)); | ||||||
|         Add(new cMenuEditIntItem(tr("Timeline Time Font Size"), &tmpTvguideConfig->FontTimeLineTimeDelta, -30, 30)); |         Add(new cMenuEditIntItem(tr("Timeline Time Font Size"), &tmpConfig->FontTimeLineTimeDelta, -30, 30)); | ||||||
|     } else if (tmpTvguideConfig->displayMode == eHorizontal) { |     } else if (tmpConfig->displayMode == eHorizontal) { | ||||||
|         Add(new cMenuEditIntItem(tr("Channel Header Font Size"), &tmpTvguideConfig->FontChannelHeaderHorizontalDelta, -30, 30)); |         Add(new cMenuEditIntItem(tr("Channel Header Font Size"), &tmpConfig->FontChannelHeaderHorizontalDelta, -30, 30)); | ||||||
|         Add(new cMenuEditIntItem(tr("Channel Groups Font Size"), &tmpTvguideConfig->FontChannelGroupsHorizontalDelta, -30, 30)); |         Add(new cMenuEditIntItem(tr("Channel Groups Font Size"), &tmpConfig->FontChannelGroupsHorizontalDelta, -30, 30)); | ||||||
|         Add(new cMenuEditIntItem(tr("Grid Font Size"), &tmpTvguideConfig->FontGridHorizontalDelta, -30, 30)); |         Add(new cMenuEditIntItem(tr("Grid Font Size"), &tmpConfig->FontGridHorizontalDelta, -30, 30)); | ||||||
|         Add(new cMenuEditIntItem(tr("Grid Font Small Size"), &tmpTvguideConfig->FontGridHorizontalSmallDelta, -30, 30)); |         Add(new cMenuEditIntItem(tr("Grid Font Small Size"), &tmpConfig->FontGridHorizontalSmallDelta, -30, 30)); | ||||||
|         Add(new cMenuEditIntItem(tr("Timeline Date Font Size"), &tmpTvguideConfig->FontTimeLineDateHorizontalDelta, -30, 30)); |         Add(new cMenuEditIntItem(tr("Timeline Date Font Size"), &tmpConfig->FontTimeLineDateHorizontalDelta, -30, 30)); | ||||||
|         Add(new cMenuEditIntItem(tr("Timeline Time Font Size"), &tmpTvguideConfig->FontTimeLineTimeHorizontalDelta, -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 Font Size"), &tmpConfig->FontRecMenuItemDelta, -30, 30)); | ||||||
|     Add(new cMenuEditIntItem(tr("Search & Recording Menu Small Font Size"), &tmpTvguideConfig->FontRecMenuItemSmallDelta, -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"), &tmpTvguideConfig->FontRecMenuItemLargeDelta, -30, 30)); |     Add(new cMenuEditIntItem(tr("Search & Recording Menu Header Font Size"), &tmpConfig->FontRecMenuItemLargeDelta, -30, 30)); | ||||||
|  |  | ||||||
|     SetCurrent(Get(currentItem)); |     SetCurrent(Get(currentItem)); | ||||||
|     Display(); |     Display(); | ||||||
| @@ -392,7 +402,7 @@ void cMenuSetupFont::Set(void) { | |||||||
|  |  | ||||||
| //----- Recording Menus and Favorites ------------------------------------------------------------------------------------------------------- | //----- 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(description1, data->descUser1.c_str(), sizeof(description1)); | ||||||
|     strn0cpy(description2, data->descUser2.c_str(), sizeof(description2)); |     strn0cpy(description2, data->descUser2.c_str(), sizeof(description2)); | ||||||
|     strn0cpy(description3, data->descUser3.c_str(), sizeof(description3)); |     strn0cpy(description3, data->descUser3.c_str(), sizeof(description3)); | ||||||
| @@ -401,6 +411,9 @@ cMenuSetupFavorites::cMenuSetupFavorites(cTvguideConfig* data)  : cMenuSetupSubM | |||||||
|     recFolderMode[1] = tr("Select from folder list"); |     recFolderMode[1] = tr("Select from folder list"); | ||||||
|     recFolderMode[2] = tr("Use fixed folder"); |     recFolderMode[2] = tr("Use fixed folder"); | ||||||
|     strn0cpy(fixedFolder, data->instRecFixedFolder.c_str(), sizeof(fixedFolder)); |     strn0cpy(fixedFolder, data->instRecFixedFolder.c_str(), sizeof(fixedFolder)); | ||||||
|  |     addSubtitleMode[0] = tr("never"); | ||||||
|  |     addSubtitleMode[1] = tr("smart"); | ||||||
|  |     addSubtitleMode[2] = tr("always"); | ||||||
|     switchModeItems[0] = (tr("switch")); |     switchModeItems[0] = (tr("switch")); | ||||||
|     switchModeItems[1] = (tr("announce only")); |     switchModeItems[1] = (tr("announce only")); | ||||||
|     switchModeItems[2] = (tr("ask for switch")); |     switchModeItems[2] = (tr("ask for switch")); | ||||||
| @@ -411,44 +424,46 @@ void cMenuSetupFavorites::Set(void) { | |||||||
|     int currentItem = Current(); |     int currentItem = Current(); | ||||||
|     Clear(); |     Clear(); | ||||||
|  |  | ||||||
|     Add(new cMenuEditStraItem(tr("Folder for instant Recordings"), &tmpTvguideConfig->instRecFolderMode, 3,  recFolderMode)); |     Add(new cOsdItem(tr("Instant recording:"), osUnknown, false)); | ||||||
|     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))); |         Add(new cMenuEditStrItem(cString::sprintf("%s%s", *indent, tr("Folder")), fixedFolder, sizeof(fixedFolder), trVDR(FileNameChars))); | ||||||
|     } |     } | ||||||
|  |     Add(new cMenuEditStraItem(tr("Add episode to manual timers"), &tmpConfig->addSubtitleToTimer, 3, addSubtitleMode)); | ||||||
|     if (pRemoteTimers) |     if (pRemoteTimers) | ||||||
|         Add(new cMenuEditBoolItem(tr("Use Remotetimers"), &tmpTvguideConfig->useRemoteTimers)); |         Add(new cMenuEditBoolItem(tr("Use Remotetimers"), &tmpConfig->useRemoteTimers)); | ||||||
|  |     Add(new cOsdItem(tr("Favorites:"), osUnknown, false)); | ||||||
|     Add(new cMenuEditBoolItem(tr("Limit channels in favorites"), &tmpTvguideConfig->favLimitChannels)); |     Add(new cMenuEditBoolItem(tr("Limit channels in favorites"), &tmpConfig->favLimitChannels)); | ||||||
|     if (tmpTvguideConfig->favLimitChannels) { |     if (tmpConfig->favLimitChannels) { | ||||||
|         Add(new cMenuEditChanItem(tr("Start Channel"), &tmpTvguideConfig->favStartChannel)); |         Add(new cMenuEditChanItem(tr("Start Channel"), &tmpConfig->favStartChannel)); | ||||||
|         Add(new cMenuEditChanItem(tr("Stop Channel"), &tmpTvguideConfig->favStopChannel)); |         Add(new cMenuEditChanItem(tr("Stop Channel"), &tmpConfig->favStopChannel)); | ||||||
|     } |     } | ||||||
|     Add(new cMenuEditBoolItem(tr("Use \"What's on now\" in favorites"), &tmpTvguideConfig->favWhatsOnNow)); |     Add(new cMenuEditBoolItem(tr("Use \"What's on now\" in favorites"), &tmpConfig->favWhatsOnNow)); | ||||||
|     Add(new cMenuEditBoolItem(tr("Use \"What's on next\" in favorites"), &tmpTvguideConfig->favWhatsOnNext)); |     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 cOsdItem(tr("User defined times in favorites:"), osUnknown, false)); | ||||||
|     Add(new cMenuEditBoolItem(tr("Use user defined time 1"), &tmpTvguideConfig->favUseTime1)); |     Add(new cMenuEditBoolItem(tr("Use user defined time 1"), &tmpConfig->favUseTime1)); | ||||||
|     if (tmpTvguideConfig->favUseTime1) { |     if (tmpConfig->favUseTime1) { | ||||||
|         Add(new cMenuEditStrItem(cString::sprintf("%s%s", *indent, tr("Description")), description1, sizeof(description1), trVDR(FileNameChars))); |         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"), &tmpTvguideConfig->favUseTime2)); |     Add(new cMenuEditBoolItem(tr("Use user defined time 2"), &tmpConfig->favUseTime2)); | ||||||
|     if (tmpTvguideConfig->favUseTime2) { |     if (tmpConfig->favUseTime2) { | ||||||
|         Add(new cMenuEditStrItem(cString::sprintf("%s%s", *indent, tr("Description")), description2, sizeof(description2), trVDR(FileNameChars))); |         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"), &tmpTvguideConfig->favUseTime3)); |     Add(new cMenuEditBoolItem(tr("Use user defined time 3"), &tmpConfig->favUseTime3)); | ||||||
|     if (tmpTvguideConfig->favUseTime3) { |     if (tmpConfig->favUseTime3) { | ||||||
|         Add(new cMenuEditStrItem(cString::sprintf("%s%s", *indent, tr("Description")), description3, sizeof(description3), trVDR(FileNameChars))); |         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"), &tmpTvguideConfig->favUseTime4)); |     Add(new cMenuEditBoolItem(tr("Use user defined time 4"), &tmpConfig->favUseTime4)); | ||||||
|     if (tmpTvguideConfig->favUseTime4) { |     if (tmpConfig->favUseTime4) { | ||||||
|         Add(new cMenuEditStrItem(cString::sprintf("%s%s", *indent, tr("Description")), description4, sizeof(description4), trVDR(FileNameChars))); |         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 cMenuEditTimeItem(cString::sprintf("%s%s", *indent, tr("Time")), &tmpConfig->favTime4)); | ||||||
|     } |     } | ||||||
|     Add(new cOsdItem(tr("Switchtimer:"), osUnknown, false)); |     Add(new cOsdItem(tr("Switchtimer:"), osUnknown, false)); | ||||||
|     Add(new cMenuEditStraItem(tr("Switch Mode"), &tmpTvguideConfig->switchMode, 3,  switchModeItems)); |     Add(new cMenuEditStraItem(tr("Switch Mode"), &tmpConfig->switchMode, 3,  switchModeItems)); | ||||||
|     Add(new cMenuEditIntItem(tr("Switch (x)min before start of the show"), &tmpTvguideConfig->switchMinsBefore, 0, 10)); |     Add(new cMenuEditIntItem(tr("Switch (x)min before start of the show"), &tmpConfig->switchMinsBefore, 0, 10)); | ||||||
|  |  | ||||||
|  |  | ||||||
|     SetCurrent(Get(currentItem)); |     SetCurrent(Get(currentItem)); | ||||||
| @@ -457,21 +472,21 @@ void cMenuSetupFavorites::Set(void) { | |||||||
|  |  | ||||||
| eOSState cMenuSetupFavorites::ProcessKey(eKeys Key) { | eOSState cMenuSetupFavorites::ProcessKey(eKeys Key) { | ||||||
|  |  | ||||||
|     int tmpFavUseTime1 = tmpTvguideConfig->favUseTime1; |     int tmpFavUseTime1 = tmpConfig->favUseTime1; | ||||||
|     int tmpFavUseTime2 = tmpTvguideConfig->favUseTime2; |     int tmpFavUseTime2 = tmpConfig->favUseTime2; | ||||||
|     int tmpFavUseTime3 = tmpTvguideConfig->favUseTime3; |     int tmpFavUseTime3 = tmpConfig->favUseTime3; | ||||||
|     int tmpFavUseTime4 = tmpTvguideConfig->favUseTime4; |     int tmpFavUseTime4 = tmpConfig->favUseTime4; | ||||||
|     int tmpFavLimitChannels = tmpTvguideConfig->favLimitChannels; |     int tmpFavLimitChannels = tmpConfig->favLimitChannels; | ||||||
|     int tmpFolderMode = tmpTvguideConfig->instRecFolderMode; |     int tmpFolderMode = tmpConfig->instRecFolderMode; | ||||||
|  |  | ||||||
|     eOSState state = cOsdMenu::ProcessKey(Key); |     eOSState state = cOsdMenu::ProcessKey(Key); | ||||||
|  |  | ||||||
|     if ((tmpFavUseTime1 != tmpTvguideConfig->favUseTime1) || |     if ((tmpFavUseTime1 != tmpConfig->favUseTime1) || | ||||||
|         (tmpFavUseTime2 != tmpTvguideConfig->favUseTime2) || |         (tmpFavUseTime2 != tmpConfig->favUseTime2) || | ||||||
|         (tmpFavUseTime3 != tmpTvguideConfig->favUseTime3) || |         (tmpFavUseTime3 != tmpConfig->favUseTime3) || | ||||||
|         (tmpFavUseTime4 != tmpTvguideConfig->favUseTime4) || |         (tmpFavUseTime4 != tmpConfig->favUseTime4) || | ||||||
|         (tmpFavLimitChannels != tmpTvguideConfig->favLimitChannels) || |         (tmpFavLimitChannels != tmpConfig->favLimitChannels) || | ||||||
|         (tmpFolderMode != tmpTvguideConfig->instRecFolderMode) ) { |         (tmpFolderMode != tmpConfig->instRecFolderMode) ) { | ||||||
|         Set(); |         Set(); | ||||||
|         Display(); |         Display(); | ||||||
|     } |     } | ||||||
| @@ -479,10 +494,10 @@ eOSState cMenuSetupFavorites::ProcessKey(eKeys Key) { | |||||||
|     if (state == osUnknown) { |     if (state == osUnknown) { | ||||||
|         switch (Key) { |         switch (Key) { | ||||||
|         case kOk: { |         case kOk: { | ||||||
|             tmpTvguideConfig->descUser1 = cString::sprintf("%s", description1); |             tmpConfig->descUser1 = cString::sprintf("%s", description1); | ||||||
|             tmpTvguideConfig->descUser2 = cString::sprintf("%s", description2); |             tmpConfig->descUser2 = cString::sprintf("%s", description2); | ||||||
|             tmpTvguideConfig->descUser3 = cString::sprintf("%s", description3); |             tmpConfig->descUser3 = cString::sprintf("%s", description3); | ||||||
|             tmpTvguideConfig->descUser4 = cString::sprintf("%s", description4); |             tmpConfig->descUser4 = cString::sprintf("%s", description4); | ||||||
|             return osBack; } |             return osBack; } | ||||||
|         default: |         default: | ||||||
|             break; |             break; | ||||||
| @@ -493,26 +508,26 @@ eOSState cMenuSetupFavorites::ProcessKey(eKeys Key) { | |||||||
| } | } | ||||||
|  |  | ||||||
| //-----Image Caching------------------------------------------------------------------------------------------------------------- | //-----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(); |     Set(); | ||||||
| } | } | ||||||
|  |  | ||||||
| void cMenuSetupImageCache::Set(void) { | void cMenuSetupImageCache::Set(void) { | ||||||
|     int currentItem = Current(); |     int currentItem = Current(); | ||||||
|     Clear(); |     Clear(); | ||||||
|     Add(new cMenuEditBoolItem(tr("Create Log Messages for image loading"), &tmpTvguideConfig->debugImageLoading)); |     Add(new cMenuEditBoolItem(tr("Create Log Messages for image loading"), &tmpConfig->debugImageLoading)); | ||||||
|     Add(new cMenuEditBoolItem(tr("Limit Logo Cache"), &tmpTvguideConfig->limitLogoCache)); |     Add(new cMenuEditBoolItem(tr("Limit Logo Cache"), &tmpConfig->limitLogoCache)); | ||||||
|     if (&tmpTvguideConfig->limitLogoCache) { |     if (&tmpConfig->limitLogoCache) { | ||||||
|         Add(new cMenuEditIntItem(cString::sprintf("%s%s", *indent, tr("Maximal number of logos to cache")), &tmpTvguideConfig->numLogosMax, 1, 9999)); |         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("Cache Sizes"), "")); | ||||||
|     Add(InfoItem(tr("OSD Element Cache"), (imgCache.GetCacheSize(ctOsdElement)).c_str())); |     Add(InfoItem(tr("OSD Element Cache"), cString::sprintf("\t%s", (imgCache.GetCacheSize(ctOsdElement)).c_str()))); | ||||||
|     Add(InfoItem(tr("Logo cache"), (imgCache.GetCacheSize(ctLogo)).c_str())); |     Add(InfoItem(tr("Logo cache"), cString::sprintf("\t%s", (imgCache.GetCacheSize(ctLogo)).c_str()))); | ||||||
|     Add(InfoItem(tr("EPG Grid Cache"), (imgCache.GetCacheSize(ctGrid)).c_str())); |     Add(InfoItem(tr("EPG Grid Cache"), cString::sprintf("\t%s", (imgCache.GetCacheSize(ctGrid)).c_str()))); | ||||||
|     Add(InfoItem(tr("Channel Groups Cache"), (imgCache.GetCacheSize(ctChannelGroup)).c_str())); |     Add(InfoItem(tr("Channel Groups Cache"), cString::sprintf("\t%s", (imgCache.GetCacheSize(ctChannelGroup)).c_str()))); | ||||||
|     Add(InfoItem(tr("Recording Menus Icon Cache"), (imgCache.GetCacheSize(ctIcon)).c_str())); |     Add(InfoItem(tr("Recording Menus Icon Cache"), cString::sprintf("\t%s", (imgCache.GetCacheSize(ctIcon)).c_str()))); | ||||||
|  |  | ||||||
|     SetCurrent(Get(currentItem)); |     SetCurrent(Get(currentItem)); | ||||||
|     Display(); |     Display(); | ||||||
|   | |||||||
							
								
								
									
										19
									
								
								setup.h
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								setup.h
									
									
									
									
									
								
							| @@ -4,12 +4,14 @@ | |||||||
| #include <vdr/menuitems.h> | #include <vdr/menuitems.h> | ||||||
| #include "config.h" | #include "config.h" | ||||||
|  |  | ||||||
|  | extern cTVGuideConfig config; | ||||||
|  |  | ||||||
| class cTvguideSetup : public cMenuSetupPage { | class cTvguideSetup : public cMenuSetupPage { | ||||||
|     public: |     public: | ||||||
|         cTvguideSetup(void); |         cTvguideSetup(void); | ||||||
|         virtual ~cTvguideSetup();        |         virtual ~cTvguideSetup();        | ||||||
|     private: |     private: | ||||||
|         cTvguideConfig tmpTvguideConfig; |         cTVGuideConfig tmpConfig; | ||||||
|         void Setup(void); |         void Setup(void); | ||||||
|     protected: |     protected: | ||||||
|         virtual eOSState ProcessKey(eKeys Key); |         virtual eOSState ProcessKey(eKeys Key); | ||||||
| @@ -19,13 +21,13 @@ class cTvguideSetup : public cMenuSetupPage { | |||||||
|  |  | ||||||
| class cMenuSetupSubMenu : public cOsdMenu { | class cMenuSetupSubMenu : public cOsdMenu { | ||||||
|     protected: |     protected: | ||||||
|         cTvguideConfig *tmpTvguideConfig; |         cTVGuideConfig *tmpConfig; | ||||||
|         virtual eOSState ProcessKey(eKeys Key); |         virtual eOSState ProcessKey(eKeys Key); | ||||||
|         virtual void Set(void) = 0; |         virtual void Set(void) = 0; | ||||||
|         cOsdItem *InfoItem(const char *label, const char *value); |         cOsdItem *InfoItem(const char *label, const char *value); | ||||||
|         cString indent; |         cString indent; | ||||||
|     public: |     public: | ||||||
|         cMenuSetupSubMenu(const char *Title, cTvguideConfig *data); |         cMenuSetupSubMenu(const char *Title, cTVGuideConfig *data); | ||||||
| }; | }; | ||||||
|  |  | ||||||
| class cMenuSetupGeneral : public cMenuSetupSubMenu { | class cMenuSetupGeneral : public cMenuSetupSubMenu { | ||||||
| @@ -39,7 +41,7 @@ class cMenuSetupGeneral : public cMenuSetupSubMenu { | |||||||
|         const char *useSubtitleRerunTexts[3]; |         const char *useSubtitleRerunTexts[3]; | ||||||
|         void Set(void); |         void Set(void); | ||||||
|     public: |     public: | ||||||
|         cMenuSetupGeneral(cTvguideConfig *data); |         cMenuSetupGeneral(cTVGuideConfig *data); | ||||||
| }; | }; | ||||||
|  |  | ||||||
| class cMenuSetupScreenLayout : public cMenuSetupSubMenu { | class cMenuSetupScreenLayout : public cMenuSetupSubMenu { | ||||||
| @@ -50,7 +52,7 @@ class cMenuSetupScreenLayout : public cMenuSetupSubMenu { | |||||||
|         const char * logoExtensionItems[2]; |         const char * logoExtensionItems[2]; | ||||||
|         void Set(void); |         void Set(void); | ||||||
|     public: |     public: | ||||||
|         cMenuSetupScreenLayout(cTvguideConfig *data); |         cMenuSetupScreenLayout(cTVGuideConfig *data); | ||||||
| }; | }; | ||||||
|  |  | ||||||
| class cMenuSetupFont : public cMenuSetupSubMenu { | class cMenuSetupFont : public cMenuSetupSubMenu { | ||||||
| @@ -58,7 +60,7 @@ class cMenuSetupFont : public cMenuSetupSubMenu { | |||||||
|         cStringList fontNames; |         cStringList fontNames; | ||||||
|         void Set(void); |         void Set(void); | ||||||
|     public: |     public: | ||||||
|         cMenuSetupFont(cTvguideConfig *data); |         cMenuSetupFont(cTVGuideConfig *data); | ||||||
| }; | }; | ||||||
|  |  | ||||||
| class cMenuSetupFavorites : public cMenuSetupSubMenu { | class cMenuSetupFavorites : public cMenuSetupSubMenu { | ||||||
| @@ -68,19 +70,20 @@ class cMenuSetupFavorites : public cMenuSetupSubMenu { | |||||||
|         char description3[256]; |         char description3[256]; | ||||||
|         char description4[256]; |         char description4[256]; | ||||||
|         const char * recFolderMode[3]; |         const char * recFolderMode[3]; | ||||||
|  |         const char * addSubtitleMode[3]; | ||||||
|         const char * switchModeItems[3]; |         const char * switchModeItems[3]; | ||||||
|         char fixedFolder[256]; |         char fixedFolder[256]; | ||||||
|         void Set(void); |         void Set(void); | ||||||
|         virtual eOSState ProcessKey(eKeys Key); |         virtual eOSState ProcessKey(eKeys Key); | ||||||
|     public: |     public: | ||||||
|         cMenuSetupFavorites(cTvguideConfig *data); |         cMenuSetupFavorites(cTVGuideConfig *data); | ||||||
| }; | }; | ||||||
|  |  | ||||||
| class cMenuSetupImageCache : public cMenuSetupSubMenu { | class cMenuSetupImageCache : public cMenuSetupSubMenu { | ||||||
|     protected: |     protected: | ||||||
|         void Set(void); |         void Set(void); | ||||||
|     public: |     public: | ||||||
|         cMenuSetupImageCache(cTvguideConfig *data); |         cMenuSetupImageCache(cTVGuideConfig *data); | ||||||
| }; | }; | ||||||
|  |  | ||||||
| #endif //__TVGUIDE_SETUP_H | #endif //__TVGUIDE_SETUP_H | ||||||
|   | |||||||
| @@ -17,7 +17,7 @@ cStatusHeader::cStatusHeader(void) { | |||||||
| cStatusHeader::~cStatusHeader(void) { | cStatusHeader::~cStatusHeader(void) { | ||||||
|     osdManager.releasePixmap(pixmapText); |     osdManager.releasePixmap(pixmapText); | ||||||
|     osdManager.releasePixmap(pixmapTVFrame); |     osdManager.releasePixmap(pixmapTVFrame); | ||||||
|     if (tvguideConfig.scaleVideo) { |     if (config.scaleVideo) { | ||||||
|         cRect vidWin = cDevice::PrimaryDevice()->CanScaleVideo(cRect::Null); |         cRect vidWin = cDevice::PrimaryDevice()->CanScaleVideo(cRect::Null); | ||||||
|         cDevice::PrimaryDevice()->ScaleVideo(vidWin); |         cDevice::PrimaryDevice()->ScaleVideo(vidWin); | ||||||
|     } |     } | ||||||
| @@ -26,8 +26,8 @@ cStatusHeader::~cStatusHeader(void) { | |||||||
| void cStatusHeader::Draw(void) { | void cStatusHeader::Draw(void) { | ||||||
|     pixmapText->Fill(clrTransparent); |     pixmapText->Fill(clrTransparent); | ||||||
|     pixmapTVFrame->Fill(clrTransparent); |     pixmapTVFrame->Fill(clrTransparent); | ||||||
|     if (tvguideConfig.style == eStyleGraphical) { |     if (config.style == eStyleGraphical) { | ||||||
|         if (tvguideConfig.scaleVideo) { |         if (config.scaleVideo) { | ||||||
|             drawBackgroundGraphical(bgStatusHeaderWindowed); |             drawBackgroundGraphical(bgStatusHeaderWindowed); | ||||||
|             cImage *tvFrameBack = imgCache.GetOsdElement(oeStatusHeaderTVFrame); |             cImage *tvFrameBack = imgCache.GetOsdElement(oeStatusHeaderTVFrame); | ||||||
|             if (tvFrameBack) |             if (tvFrameBack) | ||||||
| @@ -36,7 +36,7 @@ void cStatusHeader::Draw(void) { | |||||||
|             drawBackgroundGraphical(bgStatusHeaderFull); |             drawBackgroundGraphical(bgStatusHeaderFull); | ||||||
|         } |         } | ||||||
|     } else { |     } else { | ||||||
|         if (tvguideConfig.decorateVideo) { |         if (config.decorateVideo) { | ||||||
|             DecorateVideoFrame(); |             DecorateVideoFrame(); | ||||||
|         } |         } | ||||||
|         drawBackground(); |         drawBackground(); | ||||||
| @@ -45,7 +45,7 @@ void cStatusHeader::Draw(void) { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cStatusHeader::ScaleVideo(void) { | void cStatusHeader::ScaleVideo(void) { | ||||||
|     if (tvguideConfig.scaleVideo) { |     if (config.scaleVideo) { | ||||||
|         int width = height * 16 / 9; |         int width = height * 16 / 9; | ||||||
|         int x = osdManager.Left() + geoManager.osdWidth - width; |         int x = osdManager.Left() + geoManager.osdWidth - width; | ||||||
|         int y = osdManager.Top(); |         int y = osdManager.Top(); | ||||||
| @@ -55,11 +55,11 @@ void cStatusHeader::ScaleVideo(void) { | |||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| void cStatusHeader::DrawInfoText(cGrid *grid) { | void cStatusHeader::DrawInfoText(cGridElement *grid) { | ||||||
|     int border = 10; |     int border = 10; | ||||||
|     int textWidth = 0; |     int textWidth = 0; | ||||||
|     textWidth = width - 2 * border; |     textWidth = width - 2 * border; | ||||||
|     tColor colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent; |     tColor colorTextBack = (config.style == eStyleFlat)?color:clrTransparent; | ||||||
|     pixmapText->Fill(clrTransparent); |     pixmapText->Fill(clrTransparent); | ||||||
|     int x = border; |     int x = border; | ||||||
|     int y = border; |     int y = border; | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ | |||||||
| #define __TVGUIDE_STATUSHEADER_H | #define __TVGUIDE_STATUSHEADER_H | ||||||
|  |  | ||||||
| #include "styledpixmap.h" | #include "styledpixmap.h" | ||||||
| #include "grid.h" | #include "gridelement.h" | ||||||
|  |  | ||||||
| // --- cStatusHeader  ------------------------------------------------------------- | // --- cStatusHeader  ------------------------------------------------------------- | ||||||
|  |  | ||||||
| @@ -19,7 +19,7 @@ public: | |||||||
|     virtual ~cStatusHeader(void); |     virtual ~cStatusHeader(void); | ||||||
|     void Draw(void); |     void Draw(void); | ||||||
|     void ScaleVideo(void); |     void ScaleVideo(void); | ||||||
|     void DrawInfoText(cGrid *grid); |     void DrawInfoText(cGridElement *grid); | ||||||
| }; | }; | ||||||
|  |  | ||||||
| #endif //__TVGUIDE_STATUSHEADER_H | #endif //__TVGUIDE_STATUSHEADER_H | ||||||
| @@ -22,9 +22,9 @@ void cStyledPixmap::setPixmap(cPixmap *pixmap) { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cStyledPixmap::drawBackground() { | void cStyledPixmap::drawBackground() { | ||||||
|     if (tvguideConfig.style == eStyleBlendingDefault){ |     if (config.style == eStyleBlendingDefault){ | ||||||
|         drawBlendedBackground(); |         drawBlendedBackground(); | ||||||
|     } else if (tvguideConfig.style == eStyleBlendingMagick){ |     } else if (config.style == eStyleBlendingMagick){ | ||||||
|         drawSparsedBackground(); |         drawSparsedBackground(); | ||||||
|     } else { |     } else { | ||||||
|         pixmap->Fill(color); |         pixmap->Fill(color); | ||||||
| @@ -129,7 +129,7 @@ void cStyledPixmap::drawBorder() { | |||||||
|     int height = pixmap->ViewPort().Height(); |     int height = pixmap->ViewPort().Height(); | ||||||
|      |      | ||||||
|     drawDefaultBorder(width, height); |     drawDefaultBorder(width, height); | ||||||
|     if (tvguideConfig.roundedCorners) { |     if (config.roundedCorners) { | ||||||
|         int borderRadius = 12; |         int borderRadius = 12; | ||||||
|         drawRoundedCorners(width, height, borderRadius); |         drawRoundedCorners(width, height, borderRadius); | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -3,7 +3,7 @@ | |||||||
|  |  | ||||||
| #include <vdr/osd.h> | #include <vdr/osd.h> | ||||||
| #include <vdr/epg.h> | #include <vdr/epg.h> | ||||||
| #include "timer.h" | #include "timemanager.h" | ||||||
| #include "config.h" | #include "config.h" | ||||||
|  |  | ||||||
| enum eBackgroundType { | enum eBackgroundType { | ||||||
|   | |||||||
| @@ -6,15 +6,13 @@ cSwitchTimers SwitchTimers; | |||||||
| cSwitchTimer::cSwitchTimer(void) { | cSwitchTimer::cSwitchTimer(void) { | ||||||
|     eventID = 0; |     eventID = 0; | ||||||
|     startTime = 0; |     startTime = 0; | ||||||
|     switchMinsBefore = tvguideConfig.switchMinsBefore; |     switchMinsBefore = config.switchMinsBefore; | ||||||
|     switchMode = tvguideConfig.switchMode; |     switchMode = config.switchMode; | ||||||
| } | } | ||||||
|  |  | ||||||
| cSwitchTimer::cSwitchTimer(const cEvent* Event) { | cSwitchTimer::cSwitchTimer(const cEvent* Event) { | ||||||
|     eventID = 0; |     eventID = 0; | ||||||
|     startTime = 0; |     startTime = 0; | ||||||
| //    switchMinsBefore = tvguideConfig.switchMinsBefore; |  | ||||||
| //    switchModes = tvguideConfig.switchModes; |  | ||||||
|     if (Event) { |     if (Event) { | ||||||
|       eventID = Event->EventID(); |       eventID = Event->EventID(); | ||||||
|       channelID = Event->ChannelID(); |       channelID = Event->ChannelID(); | ||||||
|   | |||||||
							
								
								
									
										260
									
								
								timeline.c
									
									
									
									
									
								
							
							
						
						
									
										260
									
								
								timeline.c
									
									
									
									
									
								
							| @@ -1,71 +1,51 @@ | |||||||
| #include "imageloader.h" | #include "imageloader.h" | ||||||
| #include "timeline.h" | #include "timeline.h" | ||||||
|  |  | ||||||
| cTimeLine::cTimeLine(cMyTime *myTime) { | cTimeLine::cTimeLine(cTimeManager *timeManager) { | ||||||
|     this->myTime = myTime; |     this->timeManager = timeManager; | ||||||
|     if (tvguideConfig.displayMode == eVertical) { |     lastClock = ""; | ||||||
|         dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(0,  |     timeBase = NULL; | ||||||
|                                                                          geoManager.statusHeaderHeight + geoManager.clockHeight,  |     int x11, x21, y11, y21, x12, x22, y12, y22; | ||||||
|                                                                          geoManager.dateVieverWidth,  |     if (config.displayMode == eVertical) { | ||||||
|                                                                          geoManager.dateVieverHeight))); |         x11 = 0; | ||||||
|         timeline = osdManager.requestPixmap(2, cRect(0,  |         x21 = geoManager.dateVieverWidth; | ||||||
|                                                      geoManager.statusHeaderHeight + geoManager.channelHeaderHeight + geoManager.channelGroupsHeight,  |         y11 = geoManager.statusHeaderHeight + geoManager.clockHeight; | ||||||
|                                                      geoManager.timeLineWidth,  |         y21 = geoManager.dateVieverHeight; | ||||||
|                                                      geoManager.osdHeight - geoManager.statusHeaderHeight - geoManager.channelHeaderHeight - geoManager.channelGroupsHeight - geoManager.footerHeight) |         x12 = 0; | ||||||
|                                              , cRect(0, |         x22 = geoManager.timeLineWidth; | ||||||
|                                                      0,  |         y12 = geoManager.statusHeaderHeight + geoManager.channelHeaderHeight + geoManager.channelGroupsHeight; | ||||||
|                                                      geoManager.timeLineWidth,  |         y22 = geoManager.osdHeight - geoManager.statusHeaderHeight - geoManager.channelHeaderHeight - geoManager.channelGroupsHeight - geoManager.footerHeight; | ||||||
|                                                      1440*geoManager.minutePixel)); |     } else if (config.displayMode == eHorizontal) { | ||||||
|         timeBase = osdManager.requestPixmap(3, cRect(0,  |         x11 = geoManager.clockWidth; | ||||||
|                                                      geoManager.statusHeaderHeight + geoManager.channelGroupsHeight + geoManager.channelHeaderHeight,  |         x21 = geoManager.dateVieverWidth; | ||||||
|                                                      geoManager.osdWidth,  |         y11 = geoManager.statusHeaderHeight; | ||||||
|                                                      geoManager.timeLineGridHeight)); |         y21 = geoManager.dateVieverHeight; | ||||||
|     } else if (tvguideConfig.displayMode == eHorizontal) { |         x12 = geoManager.channelHeaderWidth + geoManager.channelGroupsWidth; | ||||||
|         dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(geoManager.clockWidth,  |         x22 = geoManager.osdWidth - geoManager.channelHeaderWidth - geoManager.channelGroupsWidth; | ||||||
|                                                                          geoManager.statusHeaderHeight,  |         y12 = geoManager.statusHeaderHeight; | ||||||
|                                                                          geoManager.dateVieverWidth, |         y22 = geoManager.timeLineHeight; | ||||||
|                                                                          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); |     dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(x11, y11, x21, y21))); | ||||||
|     int clockY; |     timeline = osdManager.requestPixmap(2, cRect(x12, y12, x22, y22)); | ||||||
|     int clockX; |     clock = new cStyledPixmap(osdManager.requestPixmap(3, cRect(0,  | ||||||
|     if (tvguideConfig.displayMode == eVertical) { |                                                                 geoManager.statusHeaderHeight,  | ||||||
|        clockY = geoManager.statusHeaderHeight; |  | ||||||
|        clockX = 0; |  | ||||||
|        } |  | ||||||
|     else { |  | ||||||
|        clockY = geoManager.statusHeaderHeight; |  | ||||||
|        clockX = 0; |  | ||||||
|        } |  | ||||||
|     clock = new cStyledPixmap(osdManager.requestPixmap(3, cRect(clockX,  |  | ||||||
|                                                                 clockY,  |  | ||||||
|                                                                 geoManager.clockWidth,  |                                                                 geoManager.clockWidth,  | ||||||
|                                                                 geoManager.clockHeight))); |                                                                 geoManager.clockHeight))); | ||||||
| } | } | ||||||
|  |  | ||||||
| cTimeLine::~cTimeLine(void) { | cTimeLine::~cTimeLine(void) { | ||||||
|     delete dateViewer; |  | ||||||
|     osdManager.releasePixmap(timeline); |  | ||||||
|     if (clock) |     if (clock) | ||||||
|        delete clock; |        delete clock; | ||||||
|  |     osdManager.releasePixmap(timeBase); | ||||||
|  |     osdManager.releasePixmap(timeline); | ||||||
|  |     if (dateViewer) | ||||||
|  |         delete dateViewer; | ||||||
| } | } | ||||||
|  |  | ||||||
| void cTimeLine::drawDateViewer() { | void cTimeLine::DrawDateViewer(void) { | ||||||
|     cString weekDay = myTime->GetWeekday(); |     cString weekDay = timeManager->GetWeekday(); | ||||||
|     cString date = myTime->GetDate();    |     cString date = timeManager->GetDate();    | ||||||
|     if (tvguideConfig.style != eStyleGraphical) { |     if (config.style != eStyleGraphical) { | ||||||
|         dateViewer->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending)); |         dateViewer->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending)); | ||||||
|         dateViewer->drawBackground(); |         dateViewer->drawBackground(); | ||||||
|         dateViewer->drawBorder(); |         dateViewer->drawBorder(); | ||||||
| @@ -78,9 +58,9 @@ void cTimeLine::drawDateViewer() { | |||||||
|             dateViewer->Fill(clrTransparent); |             dateViewer->Fill(clrTransparent); | ||||||
|     } |     } | ||||||
|     tColor colorFont = theme.Color(clrButtonYellow); |     tColor colorFont = theme.Color(clrButtonYellow); | ||||||
|     tColor colorFontBack = (tvguideConfig.style == eStyleFlat) ? theme.Color(clrHeader) : clrTransparent; |     tColor colorFontBack = (config.style == eStyleFlat) ? theme.Color(clrHeader) : clrTransparent; | ||||||
|  |  | ||||||
|     if (tvguideConfig.displayMode == eVertical) { |     if (config.displayMode == eVertical) { | ||||||
|         int textHeightWeekday = fontManager.FontTimeLineWeekday->Height(); |         int textHeightWeekday = fontManager.FontTimeLineWeekday->Height(); | ||||||
|         int textHeightDate = fontManager.FontTimeLineDate->Height(); |         int textHeightDate = fontManager.FontTimeLineDate->Height(); | ||||||
|         int weekdayWidth = fontManager.FontTimeLineWeekday->Width(*weekDay); |         int weekdayWidth = fontManager.FontTimeLineWeekday->Width(*weekDay); | ||||||
| @@ -88,7 +68,7 @@ void cTimeLine::drawDateViewer() { | |||||||
|         int y = ((geoManager.dateVieverHeight - textHeightWeekday - textHeightDate) / 2); |         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 - weekdayWidth) / 2, y), *weekDay, colorFont, colorFontBack, fontManager.FontTimeLineWeekday); | ||||||
|         dateViewer->DrawText(cPoint((geoManager.timeLineWidth - dateWidth) / 2, y + textHeightWeekday), *date, colorFont, colorFontBack, fontManager.FontTimeLineDate); |         dateViewer->DrawText(cPoint((geoManager.timeLineWidth - dateWidth) / 2, y + textHeightWeekday), *date, colorFont, colorFontBack, fontManager.FontTimeLineDate); | ||||||
|     } else if (tvguideConfig.displayMode == eHorizontal) { |     } else if (config.displayMode == eHorizontal) { | ||||||
|         cString strDate = cString::sprintf("%s %s", *weekDay, *date); |         cString strDate = cString::sprintf("%s %s", *weekDay, *date); | ||||||
|         int x = ((dateViewer->Width() - fontManager.FontTimeLineDateHorizontal->Width(*strDate)) / 2); |         int x = ((dateViewer->Width() - fontManager.FontTimeLineDateHorizontal->Width(*strDate)) / 2); | ||||||
|         int y = ((dateViewer->Height() - fontManager.FontTimeLineDateHorizontal->Height()) / 2); |         int y = ((dateViewer->Height() - fontManager.FontTimeLineDateHorizontal->Height()) / 2); | ||||||
| @@ -96,8 +76,8 @@ void cTimeLine::drawDateViewer() { | |||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| void cTimeLine::drawTimeline() { | void cTimeLine::DrawTimeline(void) { | ||||||
|     timeline->SetTile(true); | //    timeline->SetTile(true); | ||||||
|     timeline->Fill(clrTransparent); |     timeline->Fill(clrTransparent); | ||||||
|     tColor colorFont, colorBackground; |     tColor colorFont, colorBackground; | ||||||
|      |      | ||||||
| @@ -105,12 +85,12 @@ void cTimeLine::drawTimeline() { | |||||||
|     int imgHeight = geoManager.timeLineGridHeight; |     int imgHeight = geoManager.timeLineGridHeight; | ||||||
|     const cImage *img1 = NULL; |     const cImage *img1 = NULL; | ||||||
|     const cImage *img2 = NULL; |     const cImage *img2 = NULL; | ||||||
|     if (tvguideConfig.style == eStyleGraphical) { |     if (config.style == eStyleGraphical) { | ||||||
|         img1 = imgCache.GetOsdElement(oeTimeline1); |         img1 = imgCache.GetOsdElement(oeTimeline1); | ||||||
|         img2 = imgCache.GetOsdElement(oeTimeline2); |         img2 = imgCache.GetOsdElement(oeTimeline2); | ||||||
|     } else { |     } else { | ||||||
|         img1 = createBackgroundImage(imgWidth, imgHeight, theme.Color(clrTimeline1), theme.Color(clrTimeline1Blending)); |         img1 = CreateBackgroundImage(imgWidth, imgHeight, theme.Color(clrTimeline1), theme.Color(clrTimeline1Blending)); | ||||||
|         img2 = createBackgroundImage(imgWidth, imgHeight, theme.Color(clrTimeline2), theme.Color(clrTimeline2Blending)); |         img2 = CreateBackgroundImage(imgWidth, imgHeight, theme.Color(clrTimeline2), theme.Color(clrTimeline2Blending)); | ||||||
|     } |     } | ||||||
|     const cImage *img = NULL; |     const cImage *img = NULL; | ||||||
|     if (!img1 || !img2) |     if (!img1 || !img2) | ||||||
| @@ -118,61 +98,72 @@ void cTimeLine::drawTimeline() { | |||||||
|     int textWidth, posX, posY; |     int textWidth, posX, posY; | ||||||
|     char timetext[10]; |     char timetext[10]; | ||||||
|      |      | ||||||
|     for (int i=0; i<48; i++) { |     int halfHours; | ||||||
|         if (i%2==0) { |     if (config.displayMode == eVertical) | ||||||
|  |         halfHours = config.displayTime / 30 + 1; | ||||||
|  |     else | ||||||
|  |         halfHours = config.displayHorizontalTime / 30 + 1; | ||||||
|  |  | ||||||
|  |     time_t tStart = timeManager->GetStart(); | ||||||
|  |     tm *t = localtime ( &tStart ); | ||||||
|  |  | ||||||
|  |     int x = 2 * t->tm_hour + ((t->tm_min == 0) ? 0 : 1); | ||||||
|  |     for (int j = x; j < (x + halfHours); j++) { | ||||||
|  |         int i = (j >= 48) ? (j - 48) : j; | ||||||
|  |         if (i % 2 == 0) { | ||||||
|             img = img1; |             img = img1; | ||||||
|             colorFont = theme.Color(clrTimeline2); |             colorFont = theme.Color(clrTimeline2); | ||||||
|             colorBackground = (tvguideConfig.style == eStyleFlat)?theme.Color(clrTimeline1):clrTransparent; |             colorBackground = (config.style == eStyleFlat)?theme.Color(clrTimeline1):clrTransparent; | ||||||
|             if (tvguideConfig.timeFormat == e12Hours) { |             if (config.timeFormat == e12Hours) { | ||||||
|                 if (i == 0) |                 if (i == 0) | ||||||
|                     sprintf(timetext, "12:00 PM"); |                     sprintf(timetext, "12:00 PM"); | ||||||
|                 else if (i/2 < 13) |                 else if (i/2 < 13) | ||||||
|                     sprintf(timetext, "%d:00 AM", i/2); |                     sprintf(timetext, "%d:00 AM", i / 2); | ||||||
|                 else  |                 else  | ||||||
|                     sprintf(timetext, "%d:00 PM", i/2-12); |                     sprintf(timetext, "%d:00 PM", i / 2 - 12); | ||||||
|             } else { |             } else { | ||||||
|                 sprintf(timetext, "%d:00", i/2); |                 sprintf(timetext, "%d:00", i / 2); | ||||||
|             } |             } | ||||||
|         } else { |         } else { | ||||||
|             img = img2; |             img = img2; | ||||||
|             colorFont = theme.Color(clrTimeline1); |             colorFont = theme.Color(clrTimeline1); | ||||||
|             colorBackground = (tvguideConfig.style == eStyleFlat)?theme.Color(clrTimeline2):clrTransparent; |             colorBackground = (config.style == eStyleFlat)?theme.Color(clrTimeline2):clrTransparent; | ||||||
|             if (tvguideConfig.timeFormat == e12Hours) { |             if (config.timeFormat == e12Hours) { | ||||||
|                 if (i == 1) |                 if (i == 1) | ||||||
|                     sprintf(timetext, "12:30 PM"); |                     sprintf(timetext, "12:30 PM"); | ||||||
|                 else if (i/2 < 13) |                 else if (i/2 < 13) | ||||||
|                     sprintf(timetext, "%d:30 AM", i/2); |                     sprintf(timetext, "%d:30 AM", i / 2); | ||||||
|                 else  |                 else  | ||||||
|                     sprintf(timetext, "%d:30 PM", i/2-12); |                     sprintf(timetext, "%d:30 PM", i / 2 - 12); | ||||||
|             } else { |             } else { | ||||||
|                 sprintf(timetext, "%d:30", i/2); |                 sprintf(timetext, "%d:30", i / 2); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         if (tvguideConfig.displayMode == eVertical) { |         if (config.displayMode == eVertical) { | ||||||
|             posY = i*geoManager.minutePixel*30; |             posY = (j - x) * geoManager.minutePixel * 30; | ||||||
|             timeline->DrawImage(cPoint(0, posY), *img); |             timeline->DrawImage(cPoint(0, posY), *img); | ||||||
|             if (tvguideConfig.style != eStyleGraphical) { |             if (config.style != eStyleGraphical) { | ||||||
|                 decorateTile(0, posY, imgWidth+2, imgHeight); |                 DecorateTile(0, posY, imgWidth + 2, imgHeight); | ||||||
|             } |             } | ||||||
|             textWidth = fontManager.FontTimeLineTime->Width(timetext); |             textWidth = fontManager.FontTimeLineTime->Width(timetext); | ||||||
|             timeline->DrawText(cPoint((geoManager.timeLineWidth-textWidth)/2, posY + 5), timetext, colorFont, colorBackground, fontManager.FontTimeLineTime); |             timeline->DrawText(cPoint((geoManager.timeLineWidth-textWidth) / 2, posY + 5), timetext, colorFont, colorBackground, fontManager.FontTimeLineTime); | ||||||
|         } else if (tvguideConfig.displayMode == eHorizontal) { |         } else if (config.displayMode == eHorizontal) { | ||||||
|             posX = i*geoManager.minutePixel*30; |             posX = (j - x) * geoManager.minutePixel * 30; | ||||||
|             timeline->DrawImage(cPoint(posX, 0), *img); |             timeline->DrawImage(cPoint(posX, 0), *img); | ||||||
|             if (tvguideConfig.style != eStyleGraphical) { |             if (config.style != eStyleGraphical) { | ||||||
|                 decorateTile(posX, 0, imgWidth, imgHeight+2); |                 DecorateTile(posX, 0, imgWidth, imgHeight + 2); | ||||||
|             } |             } | ||||||
|             timeline->DrawText(cPoint(posX + 15, (dateViewer->Height() - fontManager.FontTimeLineTimeHorizontal->Height())/2), timetext, colorFont, colorBackground, fontManager.FontTimeLineTimeHorizontal); |             timeline->DrawText(cPoint(posX + 15, (dateViewer->Height() - fontManager.FontTimeLineTimeHorizontal->Height()) / 2), timetext, colorFont, colorBackground, fontManager.FontTimeLineTimeHorizontal); | ||||||
|        } |        } | ||||||
|     } |     } | ||||||
|     setTimeline(); |     DrawTimeIndicator(); | ||||||
|     if (tvguideConfig.style != eStyleGraphical) { |     if (config.style != eStyleGraphical) { | ||||||
|         delete img1; |         delete img1; | ||||||
|         delete img2; |         delete img2; | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| void cTimeLine::decorateTile(int posX, int posY, int tileWidth, int tileHeight) { | 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,tileWidth,2), clrTransparent);          //top | ||||||
|     timeline->DrawRectangle(cRect(posX,posY,2,tileHeight), clrTransparent);         //left |     timeline->DrawRectangle(cRect(posX,posY,2,tileHeight), clrTransparent);         //left | ||||||
|     timeline->DrawRectangle(cRect(posX,posY + tileHeight-2,tileWidth,2), clrTransparent);   //bottom |     timeline->DrawRectangle(cRect(posX,posY + tileHeight-2,tileWidth,2), clrTransparent);   //bottom | ||||||
| @@ -183,13 +174,13 @@ void cTimeLine::decorateTile(int posX, int posY, int tileWidth, int tileHeight) | |||||||
|     timeline->DrawRectangle(cRect(2+posX,posY+tileHeight-3,tileWidth-4,1), theme.Color(clrBorder));     //bottom |     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 |     timeline->DrawRectangle(cRect(posX+tileWidth-3,posY+2,1,tileHeight-4), theme.Color(clrBorder));     //right | ||||||
|      |      | ||||||
|     if (tvguideConfig.roundedCorners) { |     if (config.roundedCorners) { | ||||||
|         int borderRadius = 12; |         int borderRadius = 12; | ||||||
|         drawRoundedCorners(posX, posY, tileWidth, tileHeight, borderRadius); |         DrawRoundedCorners(posX, posY, tileWidth, tileHeight, borderRadius); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| void cTimeLine::drawRoundedCorners(int posX, int posY, int width, int height, int radius) { | 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+2,posY+2,radius,radius), theme.Color(clrBorder), -2); | ||||||
|     timeline->DrawEllipse(cRect(posX+1,posY+1,radius,radius), clrTransparent, -2); |     timeline->DrawEllipse(cRect(posX+1,posY+1,radius,radius), clrTransparent, -2); | ||||||
|  |  | ||||||
| @@ -205,23 +196,36 @@ void cTimeLine::drawRoundedCorners(int posX, int posY, int width, int height, in | |||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| void cTimeLine::drawCurrentTimeBase(void) { | void cTimeLine::DrawTimeIndicator(void) { | ||||||
|     timeBase->Fill(clrTransparent); |     if (!config.displayTimeBase) | ||||||
|     bool nowVisible = myTime->NowVisible(); |  | ||||||
|     if (!nowVisible) |  | ||||||
|         return; |         return; | ||||||
|     int deltaTime = (myTime->GetNow() - myTime->GetStart()) / 60 * geoManager.minutePixel; |     if (!timeManager->NowVisible()) { | ||||||
|     if (tvguideConfig.displayMode == eVertical) { |        if (timeBase) | ||||||
|         timeBase->DrawRectangle(cRect(0, deltaTime - 2, timeBase->ViewPort().Width(), 4), theme.Color(clrTimeBase)); |           timeBase->Fill(clrTransparent); | ||||||
|     } else { |        return; | ||||||
|         timeBase->DrawRectangle(cRect(deltaTime-2, 0, 4, timeBase->ViewPort().Height()), theme.Color(clrTimeBase)); |  | ||||||
|     } |     } | ||||||
|  |     int deltaTime = (time(0) - timeManager->GetStart()) / 60 * geoManager.minutePixel; | ||||||
|  |     osdManager.releasePixmap(timeBase); | ||||||
|  |     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 *cTimeLine::createBackgroundImage(int width, int height, tColor clrBgr, tColor clrBlend) { |  | ||||||
|     cImage *image = NULL; |     cImage *image = NULL; | ||||||
|     if (tvguideConfig.style == eStyleBlendingDefault) { |     if (config.style == eStyleBlendingDefault) { | ||||||
|         image = new cImage(cSize(width, height)); |         image = new cImage(cSize(width, height)); | ||||||
|         image->Fill(clrBgr); |         image->Fill(clrBgr); | ||||||
|         int stepY = 0.5*height / 64; |         int stepY = 0.5*height / 64; | ||||||
| @@ -236,7 +240,7 @@ cImage *cTimeLine::createBackgroundImage(int width, int height, tColor clrBgr, t | |||||||
|             } |             } | ||||||
|             alpha += 0x04; |             alpha += 0x04; | ||||||
|         } |         } | ||||||
|     } else  if (tvguideConfig.style == eStyleBlendingMagick) { |     } else  if (config.style == eStyleBlendingMagick) { | ||||||
|         cImageLoader imgLoader; |         cImageLoader imgLoader; | ||||||
|         if (imgLoader.DrawBackground(clrBgr, clrBlend, width, height)) { |         if (imgLoader.DrawBackground(clrBgr, clrBlend, width, height)) { | ||||||
|             image = new cImage(imgLoader.GetImage()); |             image = new cImage(imgLoader.GetImage()); | ||||||
| @@ -248,35 +252,25 @@ cImage *cTimeLine::createBackgroundImage(int width, int height, tColor clrBgr, t | |||||||
|     return image; |     return image; | ||||||
| } | } | ||||||
|  |  | ||||||
| void cTimeLine::setTimeline() { | bool cTimeLine::DrawClock(void) { | ||||||
|     int offset = myTime->GetTimelineOffset(); |     cString currentTime = timeManager->GetCurrentTime(); | ||||||
|     int xNew, yNew; |     if (strcmp(currentTime, lastClock)) { | ||||||
|     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); |        clock->Fill(clrTransparent); | ||||||
|     cString currentTime = myTime->GetCurrentTime(); |        const cFont *font = (config.displayMode == eVertical) ? fontManager.FontTimeLineTime : fontManager.FontTimeLineTimeHorizontal; | ||||||
|     const cFont *font = (tvguideConfig.displayMode == eVertical)?fontManager.FontTimeLineTime:fontManager.FontTimeLineTimeHorizontal; |        int textHeight = font->Height(); | ||||||
|     int textHeight = font->Height(); |        int clockTextWidth = font->Width(*currentTime); | ||||||
|     int clockTextWidth = font->Width(*currentTime); |        tColor colorFontBack = (config.style == eStyleFlat) ? theme.Color(clrHeader) : clrTransparent; | ||||||
|     tColor colorFontBack = (tvguideConfig.style == eStyleFlat)?theme.Color(clrHeader):clrTransparent; |        if (config.style == eStyleGraphical) { | ||||||
|     if (tvguideConfig.style == eStyleGraphical) { |           clock->drawBackgroundGraphical(bgClock); | ||||||
|        clock->drawBackgroundGraphical(bgClock); |        } else { | ||||||
|     } else { |           clock->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending)); | ||||||
|        clock->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending)); |           clock->drawBackground(); | ||||||
|        clock->drawBackground(); |           clock->drawBorder(); | ||||||
|        clock->drawBorder(); |        } | ||||||
|  |        clock->DrawText(cPoint((geoManager.clockWidth - clockTextWidth) / 2, (geoManager.clockHeight - textHeight) / 2), *currentTime, theme.Color(clrFont), colorFontBack, font); | ||||||
|  |        lastClock = currentTime; | ||||||
|  |        DrawTimeIndicator(); | ||||||
|  |        return true; | ||||||
|     } |     } | ||||||
|     clock->DrawText(cPoint((geoManager.clockWidth-clockTextWidth)/2, (geoManager.clockHeight-textHeight)/2), *currentTime, theme.Color(clrFont), colorFontBack, font); |     return false; | ||||||
| } | } | ||||||
|   | |||||||
							
								
								
									
										22
									
								
								timeline.h
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								timeline.h
									
									
									
									
									
								
							| @@ -1,29 +1,29 @@ | |||||||
| #ifndef __TVGUIDE_TIMELINE_H | #ifndef __TVGUIDE_TIMELINE_H | ||||||
| #define __TVGUIDE_TIMELINE_H | #define __TVGUIDE_TIMELINE_H | ||||||
|  |  | ||||||
| #include "timer.h" | #include "timemanager.h" | ||||||
| #include "styledpixmap.h" | #include "styledpixmap.h" | ||||||
|  |  | ||||||
| // --- cTimeLine  ------------------------------------------------------------- | // --- cTimeLine  ------------------------------------------------------------- | ||||||
|  |  | ||||||
| class cTimeLine  { | class cTimeLine  { | ||||||
| private: | private: | ||||||
|     cMyTime *myTime; |     cTimeManager *timeManager; | ||||||
|     cStyledPixmap *dateViewer; |     cStyledPixmap *dateViewer; | ||||||
|     cPixmap *timeline; |     cPixmap *timeline; | ||||||
|     cStyledPixmap *clock; |     cStyledPixmap *clock; | ||||||
|     cPixmap *timeBase; |     cPixmap *timeBase; | ||||||
|     void decorateTile(int posX, int posY, int tileWidth, int tileHeight); |     cString lastClock; | ||||||
|     void drawRoundedCorners(int posX, int posY, int width, int height, int radius); |     void DecorateTile(int posX, int posY, int tileWidth, int tileHeight); | ||||||
|     cImage *createBackgroundImage(int width, int height, tColor clrBgr, tColor clrBlend); |     void DrawRoundedCorners(int posX, int posY, int width, int height, int radius); | ||||||
|     void drawCurrentTimeBase(void); |     cImage *CreateBackgroundImage(int width, int height, tColor clrBgr, tColor clrBlend); | ||||||
| public: | public: | ||||||
|     cTimeLine(cMyTime *myTime); |     cTimeLine(cTimeManager *timeManager); | ||||||
|     virtual ~cTimeLine(void); |     virtual ~cTimeLine(void); | ||||||
|     void setTimeline(); |     void DrawDateViewer(void); | ||||||
|     void drawDateViewer(); |     void DrawTimeline(void); | ||||||
|     void drawTimeline(); |     void DrawTimeIndicator(void); | ||||||
|     void drawClock(); |     bool DrawClock(void); | ||||||
| }; | }; | ||||||
|  |  | ||||||
| #endif //__TVGUIDE_TIMELINE_H | #endif //__TVGUIDE_TIMELINE_H | ||||||
| @@ -1,12 +1,20 @@ | |||||||
| #include <time.h> | #include <time.h> | ||||||
| #include <vdr/tools.h> | #include <vdr/tools.h> | ||||||
| #include "config.h" | #include "config.h" | ||||||
| #include "timer.h" | #include "timemanager.h" | ||||||
| 
 | 
 | ||||||
| cMyTime::~cMyTime(void) { | cTimeManager::cTimeManager(void) { | ||||||
|  |     if (config.displayMode == eVertical) { | ||||||
|  |         displaySeconds = (geoManager.osdHeight - geoManager.statusHeaderHeight - geoManager.channelHeaderHeight - geoManager.channelGroupsHeight - geoManager.footerHeight) / geoManager.minutePixel * 60; | ||||||
|  |     } else if (config.displayMode == eHorizontal) { | ||||||
|  |         displaySeconds = (geoManager.osdWidth - geoManager.channelHeaderWidth - geoManager.channelGroupsWidth) / geoManager.minutePixel * 60; | ||||||
|  |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| cString cMyTime::printTime(time_t displayTime) { | cTimeManager::~cTimeManager(void) { | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | cString cTimeManager::printTime(time_t displayTime) { | ||||||
|     struct tm *ts; |     struct tm *ts; | ||||||
|     ts = localtime(&displayTime); |     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); |     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); | ||||||
| @@ -14,44 +22,36 @@ cString cMyTime::printTime(time_t displayTime) { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| void cMyTime::Now() {    | void cTimeManager::Now() {    | ||||||
|     t = time(0); |     t = time(0); | ||||||
|     tStart = t; |     tStart = t; | ||||||
|     tStart = GetRounded(); |     tStart = GetRounded(); | ||||||
|     if (tvguideConfig.displayMode == eVertical) { |     tEnd   = tStart + displaySeconds; | ||||||
|         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 cTimeManager::AddStep(int step) { | ||||||
|  |     tStart += step * 60; | ||||||
|  |     tEnd    = tStart + displaySeconds; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | void cTimeManager::DelStep(int step) { | ||||||
|  |     if ((tStart - step * 60) + 30 * 60 < t) { | ||||||
|  |         Now(); | ||||||
|  |     } else { | ||||||
|  |         tStart -= step * 60; | ||||||
|  |         tEnd    = tStart + displaySeconds; | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void cMyTime::AddStep(int step) { | void cTimeManager::SetTime(time_t newTime) { | ||||||
|     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; |     tStart = newTime; | ||||||
|     if (tvguideConfig.displayMode == eVertical) { |     tEnd   = tStart + displaySeconds; | ||||||
|         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) { | time_t cTimeManager::getPrevPrimetime(time_t current) { | ||||||
|     tm *st = localtime(¤t); |     tm *st = localtime(¤t); | ||||||
|     if (st->tm_hour < 21) { |     if (st->tm_hour < 21) { | ||||||
|         current -= 24 * 60* 60; |         current -= 24 * 60 * 60; | ||||||
|         st = localtime(¤t); |         st = localtime(¤t); | ||||||
|     } |     } | ||||||
|     st->tm_hour = 20; |     st->tm_hour = 20; | ||||||
| @@ -60,10 +60,10 @@ time_t cMyTime::getPrevPrimetime(time_t current) { | |||||||
|     return primeTime; |     return primeTime; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| time_t cMyTime::getNextPrimetime(time_t current){ | time_t cTimeManager::getNextPrimetime(time_t current){ | ||||||
|     tm *st = localtime(¤t); |     tm *st = localtime(¤t); | ||||||
|     if (st->tm_hour > 19) { |     if (st->tm_hour > 19) { | ||||||
|         current += 24 * 60* 60; |         current += 24 * 60 * 60; | ||||||
|         st = localtime(¤t); |         st = localtime(¤t); | ||||||
|     } |     } | ||||||
|     st->tm_hour = 20; |     st->tm_hour = 20; | ||||||
| @@ -72,45 +72,45 @@ time_t cMyTime::getNextPrimetime(time_t current){ | |||||||
|     return primeTime; |     return primeTime; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| bool cMyTime::tooFarInPast(time_t current) { | bool cTimeManager::tooFarInPast(time_t current) { | ||||||
|     if (current < t) { |     if (current < t) { | ||||||
|         return true; |         return true; | ||||||
|     } |     } | ||||||
|     return false; |     return false; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| cString cMyTime::GetCurrentTime() { | cString cTimeManager::GetCurrentTime() { | ||||||
|     char buf[25]; |     char buf[25]; | ||||||
|     t = time(0); |     t = time(0); | ||||||
|     tm *st = localtime(&t); |     tm *st = localtime(&t); | ||||||
|     //snprintf(text, sizeof(text), "%d:%02d", st->tm_hour, st->tm_min);
 |     //snprintf(text, sizeof(text), "%d:%02d", st->tm_hour, st->tm_min);
 | ||||||
|     if (tvguideConfig.timeFormat == e12Hours) { |     if (config.timeFormat == e12Hours) { | ||||||
|         strftime(buf, sizeof(buf), "%I:%M %p", st); |         strftime(buf, sizeof(buf), "%I:%M %p", st); | ||||||
|     } else if (tvguideConfig.timeFormat == e24Hours) |     } else if (config.timeFormat == e24Hours) | ||||||
|         strftime(buf, sizeof(buf), "%H:%M", st); |         strftime(buf, sizeof(buf), "%H:%M", st); | ||||||
|     return buf; |     return buf; | ||||||
|      |      | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| cString cMyTime::GetDate() { | cString cTimeManager::GetDate() { | ||||||
|     char text[6]; |     char text[6]; | ||||||
|     tm *st = localtime(&tStart); |     tm *st = localtime(&tStart); | ||||||
|     snprintf(text, sizeof(text), "%d.%d", st->tm_mday, st->tm_mon+1); |     snprintf(text, sizeof(text), "%d.%d", st->tm_mday, st->tm_mon+1); | ||||||
|     return text; |     return text; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| cString cMyTime::GetWeekday() { | cString cTimeManager::GetWeekday() { | ||||||
|     return WeekDayName(tStart); |     return WeekDayName(tStart); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| int cMyTime::GetTimelineOffset() { | int cTimeManager::GetTimelineOffset() { | ||||||
|     tm *st = localtime(&tStart); |     tm *st = localtime(&tStart); | ||||||
|     int offset = st->tm_hour*60; |     int offset = st->tm_hour*60; | ||||||
|     offset += st->tm_min; |     offset += st->tm_min; | ||||||
|     return offset; |     return offset; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| time_t cMyTime::GetRounded() { | time_t cTimeManager::GetRounded() { | ||||||
|     tm *rounded = localtime ( &tStart ); |     tm *rounded = localtime ( &tStart ); | ||||||
|     rounded->tm_sec = 0; |     rounded->tm_sec = 0; | ||||||
|     if (rounded->tm_min > 29) |     if (rounded->tm_min > 29) | ||||||
| @@ -120,14 +120,14 @@ time_t cMyTime::GetRounded() { | |||||||
|     return mktime(rounded); |     return mktime(rounded); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| bool cMyTime::NowVisible(void) { | bool cTimeManager::NowVisible(void) { | ||||||
|     if (t > tStart) |     if (t > tStart) | ||||||
|         return true; |         return true; | ||||||
|     return false; |     return false; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| void cMyTime::debug() { | void cTimeManager::debug() { | ||||||
|     esyslog("t: %s, tStart: %s, tEnd: %s", *TimeString(t), *TimeString(tStart), *TimeString(tEnd)); |     esyslog("t: %s, tStart: %s, tEnd: %s", *TimeString(t), *TimeString(tStart), *TimeString(tEnd)); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @@ -1,23 +1,26 @@ | |||||||
| #ifndef __TVGUIDE_TIMER_H | #ifndef __TVGUIDE_TIMEMANAGER_H | ||||||
| #define __TVGUIDE_TIMER_H | #define __TVGUIDE_TIMEMANAGER_H | ||||||
| 
 | 
 | ||||||
| #include <vdr/tools.h> | #include <vdr/tools.h> | ||||||
|  | #include "config.h" | ||||||
| 
 | 
 | ||||||
| // --- cMyTime ------------------------------------------------------------- 
 | // --- cTimeManager ------------------------------------------------------------- 
 | ||||||
| 
 | 
 | ||||||
| class cMyTime { | class cTimeManager { | ||||||
|     private: |     private: | ||||||
|         time_t t; |         time_t t; | ||||||
|         time_t tStart; |         time_t tStart; | ||||||
|         time_t tEnd; |         time_t tEnd; | ||||||
|  |         int displaySeconds; | ||||||
|  |         eTimeFormat timeFormat; | ||||||
|     public: |     public: | ||||||
|         cMyTime(){}; |         cTimeManager(); | ||||||
|         virtual ~cMyTime(void); |         virtual ~cTimeManager(void); | ||||||
|         static cString printTime(time_t displayTime); |         static cString printTime(time_t displayTime); | ||||||
|         void Now(); |         void Now(); | ||||||
|         time_t GetNow() { return t; }; |         time_t GetNow() { return t; }; | ||||||
|         void AddStep(int step); |         void AddStep(int step); | ||||||
|         bool DelStep(int step); |         void DelStep(int step); | ||||||
|         void SetTime(time_t newTime); |         void SetTime(time_t newTime); | ||||||
|         time_t Get() {return t;}; |         time_t Get() {return t;}; | ||||||
|         time_t GetStart() {return tStart;}; |         time_t GetStart() {return tStart;}; | ||||||
| @@ -31,6 +34,7 @@ class cMyTime { | |||||||
|         int GetTimelineOffset(); |         int GetTimelineOffset(); | ||||||
|         time_t GetRounded(); |         time_t GetRounded(); | ||||||
|         bool NowVisible(void); |         bool NowVisible(void); | ||||||
|  |         int GetDisplaySeconds(void) { return displaySeconds; }; | ||||||
|         void debug(); |         void debug(); | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| @@ -49,4 +53,4 @@ class cTimeInterval { | |||||||
|         cTimeInterval *Union(cTimeInterval *interval); |         cTimeInterval *Union(cTimeInterval *interval); | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| #endif //__TVGUIDE_TIMER_H
 | #endif //__TVGUIDE_TIMEMANAGER_H
 | ||||||
| @@ -2,7 +2,7 @@ | |||||||
| #include <vector> | #include <vector> | ||||||
| #include <vdr/timers.h> | #include <vdr/timers.h> | ||||||
| #include "tools.h" | #include "tools.h" | ||||||
| #include "timer.h" | #include "timemanager.h" | ||||||
| #include "timerconflict.h" | #include "timerconflict.h" | ||||||
|  |  | ||||||
| cTVGuideTimerConflict::cTVGuideTimerConflict(void) { | cTVGuideTimerConflict::cTVGuideTimerConflict(void) { | ||||||
|   | |||||||
							
								
								
									
										68
									
								
								tools.c
									
									
									
									
									
								
							
							
						
						
									
										68
									
								
								tools.c
									
									
									
									
									
								
							| @@ -23,32 +23,49 @@ cPlugin *GetScraperPlugin(void) { | |||||||
| /**************************************************************************************** | /**************************************************************************************** | ||||||
| *            CUTTEXT | *            CUTTEXT | ||||||
| ****************************************************************************************/ | ****************************************************************************************/ | ||||||
| std::string CutText(std::string text, int width, const cFont *font) { | std::string utf8_substr(const std::string& str, unsigned int start, long unsigned int leng) { | ||||||
|     if (width <= font->Size()) |     if (leng==0) { return ""; } | ||||||
|         return text.c_str(); |     unsigned int c, i, ix, q; | ||||||
|     if (font->Width(text.c_str()) < width) |     long unsigned int min=std::string::npos, max=std::string::npos; | ||||||
|         return text.c_str(); |     for (q=0, i=0, ix=str.length(); i < ix; i++, q++) { | ||||||
|     cTextWrapper twText; |         if (q==start){ min=i; } | ||||||
|     twText.Set(text.c_str(), font, width); |         if (q<=start+leng || leng==std::string::npos){ max=i; } | ||||||
|     std::string cuttedTextNative = twText.GetLine(0); |  | ||||||
|     std::stringstream sstrText; |         c = (unsigned char) str[i]; | ||||||
|     sstrText << cuttedTextNative << "..."; |         if      (c>=0   && c<=127) i+=0; | ||||||
|     std::string cuttedText = sstrText.str(); |         else if ((c & 0xE0) == 0xC0) i+=1; | ||||||
|     int actWidth = font->Width(cuttedText.c_str()); |         else if ((c & 0xF0) == 0xE0) i+=2; | ||||||
|     if (actWidth > width) { |         else if ((c & 0xF8) == 0xF0) i+=3; | ||||||
|         int overlap = actWidth - width; |         //else if (($c & 0xFC) == 0xF8) i+=4; // 111110bb //byte 5, unnecessary in 4 byte UTF-8 | ||||||
|         int charWidth = font->Width("."); |         //else if (($c & 0xFE) == 0xFC) i+=5; // 1111110b //byte 6, unnecessary in 4 byte UTF-8 | ||||||
|         if (charWidth == 0) |         else return "";//invalid utf8 | ||||||
|             charWidth = 1; |     } | ||||||
|         int cutChars = overlap / charWidth; |     if (q<=start+leng || leng==std::string::npos){ max=i; } | ||||||
|         if (cutChars > 0) { |     if (min==std::string::npos || max==std::string::npos) { return ""; } | ||||||
|             cuttedTextNative = cuttedTextNative.substr(0, cuttedTextNative.length() - cutChars); |     return str.substr(min,max); | ||||||
|             std::stringstream sstrText2; | } | ||||||
|             sstrText2 << cuttedTextNative << "..."; |  | ||||||
|             cuttedText = sstrText2.str(); | std::string CutText(std::string text, int width, const cFont *font) { | ||||||
|         } |     int actWidth = font->Width(text.c_str()); | ||||||
|  |     if (actWidth <= width) { | ||||||
|  |         return text.c_str(); | ||||||
|  |     } else { | ||||||
|  |         int i = std::max(width / font->Size(), 1) - 1; | ||||||
|  |         std::string cuttext, oldtext; | ||||||
|  |         cuttext = utf8_substr(text, 0, i); | ||||||
|  |         do { | ||||||
|  |             oldtext = cuttext; | ||||||
|  |             i++; | ||||||
|  |             cuttext = utf8_substr(text, 0, i); | ||||||
|  |             std::stringstream sstrText; | ||||||
|  |             sstrText << cuttext << "..."; | ||||||
|  |             actWidth = font->Width(sstrText.str().c_str()); | ||||||
|  |         } | ||||||
|  |         while (actWidth < width); | ||||||
|  |         std::stringstream sstrText2; | ||||||
|  |         sstrText2 << oldtext << "..."; | ||||||
|  |         return sstrText2.str(); | ||||||
|     } |     } | ||||||
|     return cuttedText; |  | ||||||
| } | } | ||||||
|  |  | ||||||
| /**************************************************************************************** | /**************************************************************************************** | ||||||
| @@ -113,7 +130,6 @@ void ReadRecordingDirectories(std::vector<std::string> *folders, cList<cNestedIt | |||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| /**************************************************************************************** | /**************************************************************************************** | ||||||
| *            DrawRoundedCorners | *            DrawRoundedCorners | ||||||
| ****************************************************************************************/ | ****************************************************************************************/ | ||||||
|   | |||||||
							
								
								
									
										1
									
								
								tools.h
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								tools.h
									
									
									
									
									
								
							| @@ -9,6 +9,7 @@ | |||||||
|  |  | ||||||
| cPlugin *GetScraperPlugin(void); | cPlugin *GetScraperPlugin(void); | ||||||
|  |  | ||||||
|  | std::string utf8_substr(const std::string& str, unsigned int start=0, long unsigned int leng=std::string::npos); | ||||||
| std::string CutText(std::string text, int width, const cFont *font); | std::string CutText(std::string text, int width, const cFont *font); | ||||||
| std::string StrToLowerCase(std::string str); | std::string StrToLowerCase(std::string str); | ||||||
| std::string GetDirectoryFromTimer(std::string file); | std::string GetDirectoryFromTimer(std::string file); | ||||||
|   | |||||||
							
								
								
									
										33
									
								
								tvguide.c
									
									
									
									
									
								
							
							
						
						
									
										33
									
								
								tvguide.c
									
									
									
									
									
								
							| @@ -12,6 +12,7 @@ | |||||||
| #include <vdr/plugin.h> | #include <vdr/plugin.h> | ||||||
| #include <vdr/device.h> | #include <vdr/device.h> | ||||||
| #include <vdr/menu.h> | #include <vdr/menu.h> | ||||||
|  | #include <Magick++.h> | ||||||
|  |  | ||||||
| #define DEFINE_CONFIG 1 | #define DEFINE_CONFIG 1 | ||||||
| #include "geometrymanager.h" | #include "geometrymanager.h" | ||||||
| @@ -26,7 +27,7 @@ | |||||||
| #error "VDR-2.0.0 API version or greater is required!" | #error "VDR-2.0.0 API version or greater is required!" | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| static const char *VERSION        = "1.2.8"; | static const char *VERSION        = "1.2.17"; | ||||||
| static const char *DESCRIPTION    = tr("A fancy 2d EPG Viewer"); | static const char *DESCRIPTION    = tr("A fancy 2d EPG Viewer"); | ||||||
| static const char *MAINMENUENTRY  = "Tvguide"; | static const char *MAINMENUENTRY  = "Tvguide"; | ||||||
|  |  | ||||||
| @@ -45,7 +46,7 @@ public: | |||||||
|   virtual void MainThreadHook(void); |   virtual void MainThreadHook(void); | ||||||
|   virtual cString Active(void); |   virtual cString Active(void); | ||||||
|   virtual time_t WakeupTime(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 cOsdObject *MainMenuAction(void); | ||||||
|   virtual cMenuSetupPage *SetupMenu(void); |   virtual cMenuSetupPage *SetupMenu(void); | ||||||
|   virtual bool SetupParse(const char *Name, const char *Value); |   virtual bool SetupParse(const char *Name, const char *Value); | ||||||
| @@ -62,9 +63,9 @@ cPluginTvguide::~cPluginTvguide() { | |||||||
|  |  | ||||||
| const char *cPluginTvguide::CommandLineHelp(void) { | const char *cPluginTvguide::CommandLineHelp(void) { | ||||||
|     return  |     return  | ||||||
|          "  -e <IMAGESDIR>, --epgimages=<IMAGESDIR> Set directory where epgimages are stored.\n" |          "  -e <IMAGESDIR>, --epgimages=<IMAGESDIR>  Set directory where epgimages are stored.\n" | ||||||
| 	       "  -i <ICONDIR>, --icons=<ICONDIR>         Set directory where icons are stored.\n" |          "  -i <ICONDIR>,   --iconpath=<ICONDIR>     Set directory where icons are stored.\n" | ||||||
|          "  -l <LOGODIR>, --logodir=<LOGODIR>       Set directory where logos are stored.\n"; |          "  -l <LOGODIR>,   --logopath=<LOGODIR>     Set directory where logos are stored.\n"; | ||||||
| } | } | ||||||
|  |  | ||||||
| bool cPluginTvguide::ProcessArgs(int argc, char *argv[]) { | 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) { |   while ((c = getopt_long(argc, argv, "e:i:l:", long_options, NULL)) != -1) { | ||||||
|     switch (c) { |     switch (c) { | ||||||
|       case 'e': |       case 'e': | ||||||
|         tvguideConfig.SetImagesPath(cString(optarg)); |         config.SetImagesPath(cString(optarg)); | ||||||
|         break; |         break; | ||||||
|       case 'i': |       case 'i': | ||||||
|       	tvguideConfig.SetIconsPath(cString(optarg)); |       	config.SetIconsPath(cString(optarg)); | ||||||
| 	      break; | 	      break; | ||||||
|       case 'l': |       case 'l': | ||||||
|         tvguideConfig.SetLogoPath(cString(optarg)); |         config.SetLogoPath(cString(optarg)); | ||||||
|         break; |         break; | ||||||
|       default: |       default: | ||||||
|         return false; |         return false; | ||||||
| @@ -93,11 +94,15 @@ bool cPluginTvguide::ProcessArgs(int argc, char *argv[]) { | |||||||
|   return true; |   return true; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | __attribute__((constructor)) static void init(void) { | ||||||
|  |    Magick::InitializeMagick(NULL); | ||||||
|  | } | ||||||
|  |  | ||||||
| bool cPluginTvguide::Initialize(void) { | bool cPluginTvguide::Initialize(void) { | ||||||
|     tvguideConfig.SetDefaultPathes(); |     config.SetDefaultPathes(); | ||||||
|     tvguideConfig.LoadTheme(); |     config.LoadTheme(); | ||||||
|     tvguideConfig.SetStyle(); |     config.SetStyle(); | ||||||
|     tvguideConfig.setDynamicValues(); |     config.setDynamicValues(); | ||||||
|     geoManager.SetGeometry(cOsd::OsdWidth(), cOsd::OsdHeight()); |     geoManager.SetGeometry(cOsd::OsdWidth(), cOsd::OsdHeight()); | ||||||
|     fontManager.SetFonts(); |     fontManager.SetFonts(); | ||||||
|     imgCache.CreateCache(); |     imgCache.CreateCache(); | ||||||
| @@ -134,11 +139,11 @@ cMenuSetupPage *cPluginTvguide::SetupMenu(void) { | |||||||
| } | } | ||||||
|  |  | ||||||
| bool cPluginTvguide::SetupParse(const char *Name, const char *Value) { | 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) { | 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) |       if (Data == NULL) | ||||||
|          return true; |          return true; | ||||||
|       cOsdObject **guide = (cOsdObject**) Data; |       cOsdObject **guide = (cOsdObject**) Data; | ||||||
|   | |||||||
							
								
								
									
										282
									
								
								tvguideosd.c
									
									
									
									
									
								
							
							
						
						
									
										282
									
								
								tvguideosd.c
									
									
									
									
									
								
							| @@ -15,14 +15,14 @@ cTvGuideOsd::cTvGuideOsd(void) { | |||||||
|     detailViewActive = false; |     detailViewActive = false; | ||||||
|     activeGrid = NULL; |     activeGrid = NULL; | ||||||
|     timeLine = NULL; |     timeLine = NULL; | ||||||
|     recMenuManager = NULL; |     recMenuView = NULL; | ||||||
|     channelJumper = NULL; |     channelJumper = NULL; | ||||||
| } | } | ||||||
|  |  | ||||||
| cTvGuideOsd::~cTvGuideOsd() { | cTvGuideOsd::~cTvGuideOsd() { | ||||||
|     delete myTime; |     delete timeManager; | ||||||
|     columns.Clear(); |     columns.Clear(); | ||||||
|     if (tvguideConfig.displayStatusHeader) { |     if (config.displayStatusHeader) { | ||||||
|         delete statusHeader; |         delete statusHeader; | ||||||
|     } |     } | ||||||
|     if (detailView) |     if (detailView) | ||||||
| @@ -30,7 +30,7 @@ cTvGuideOsd::~cTvGuideOsd() { | |||||||
|     delete timeLine; |     delete timeLine; | ||||||
|     delete channelGroups; |     delete channelGroups; | ||||||
|     delete footer; |     delete footer; | ||||||
|     delete recMenuManager; |     delete recMenuView; | ||||||
|     if (channelJumper) |     if (channelJumper) | ||||||
|         delete channelJumper; |         delete channelJumper; | ||||||
|     osdManager.deleteOsd(); |     osdManager.deleteOsd(); | ||||||
| @@ -41,9 +41,9 @@ void cTvGuideOsd::Show(void) { | |||||||
|     bool ok = false; |     bool ok = false; | ||||||
|     ok = osdManager.setOsd(); |     ok = osdManager.setOsd(); | ||||||
|     if (ok) { |     if (ok) { | ||||||
|         bool themeChanged = tvguideConfig.LoadTheme(); |         bool themeChanged = config.LoadTheme(); | ||||||
|         tvguideConfig.SetStyle(); |         config.SetStyle(); | ||||||
|         tvguideConfig.setDynamicValues(); |         config.setDynamicValues(); | ||||||
|         bool geoChanged = geoManager.SetGeometry(cOsd::OsdWidth(), cOsd::OsdHeight()); |         bool geoChanged = geoManager.SetGeometry(cOsd::OsdWidth(), cOsd::OsdHeight()); | ||||||
|         if (themeChanged || geoChanged) { |         if (themeChanged || geoChanged) { | ||||||
|             fontManager.DeleteFonts(); |             fontManager.DeleteFonts(); | ||||||
| @@ -52,15 +52,15 @@ void cTvGuideOsd::Show(void) { | |||||||
|             imgCache.CreateCache(); |             imgCache.CreateCache(); | ||||||
|         } |         } | ||||||
|         osdManager.setBackground(); |         osdManager.setBackground(); | ||||||
|         myTime = new cMyTime(); |         timeManager = new cTimeManager(); | ||||||
|         myTime->Now(); |         timeManager->Now(); | ||||||
|         SwitchTimers.Load(AddDirectory(cPlugin::ConfigDirectory("epgsearch"), "epgsearchswitchtimers.conf")); |         SwitchTimers.Load(AddDirectory(cPlugin::ConfigDirectory("epgsearch"), "epgsearchswitchtimers.conf")); | ||||||
|         recMenuManager = new cRecMenuManager(); |         recMenuView = new cRecMenuView(); | ||||||
|         pRemoteTimers = cPluginManager::CallFirstService("RemoteTimers::RefreshTimers-v1.0", NULL); |         pRemoteTimers = cPluginManager::CallFirstService("RemoteTimers::RefreshTimers-v1.0", NULL); | ||||||
|         if (pRemoteTimers) { |         if (pRemoteTimers) { | ||||||
|             isyslog("tvguide: remotetimers-plugin is available"); |             isyslog("tvguide: remotetimers-plugin is available"); | ||||||
|         } |         } | ||||||
|         if (tvguideConfig.useRemoteTimers && pRemoteTimers) { |         if (config.useRemoteTimers && pRemoteTimers) { | ||||||
|             cString errorMsg; |             cString errorMsg; | ||||||
|             if (!pRemoteTimers->Service("RemoteTimers::RefreshTimers-v1.0", &errorMsg)) { |             if (!pRemoteTimers->Service("RemoteTimers::RefreshTimers-v1.0", &errorMsg)) { | ||||||
|                 esyslog("tvguide: %s", *errorMsg); |                 esyslog("tvguide: %s", *errorMsg); | ||||||
| @@ -73,7 +73,7 @@ void cTvGuideOsd::Show(void) { | |||||||
|  |  | ||||||
| void cTvGuideOsd::drawOsd() { | void cTvGuideOsd::drawOsd() { | ||||||
|     cPixmap::Lock(); |     cPixmap::Lock(); | ||||||
|     int numBack = tvguideConfig.numGrids / 2; |     int numBack = config.numGrids / 2; | ||||||
|     int offset = 0; |     int offset = 0; | ||||||
|     const cChannel *newStartChannel; |     const cChannel *newStartChannel; | ||||||
| #if VDRVERSNUM >= 20301 | #if VDRVERSNUM >= 20301 | ||||||
| @@ -106,21 +106,21 @@ void cTvGuideOsd::drawOsd() { | |||||||
|     if (offset < 0) |     if (offset < 0) | ||||||
|         offset = 0; |         offset = 0; | ||||||
|      |      | ||||||
|     if (tvguideConfig.displayStatusHeader) { |     if (config.displayStatusHeader) { | ||||||
|         statusHeader = new cStatusHeader(); |         statusHeader = new cStatusHeader(); | ||||||
|         statusHeader->Draw(); |         statusHeader->Draw(); | ||||||
|         statusHeader->ScaleVideo(); |         statusHeader->ScaleVideo(); | ||||||
|     } |     } | ||||||
|     timeLine = new cTimeLine(myTime); |     timeLine = new cTimeLine(timeManager); | ||||||
|     timeLine->drawDateViewer(); |     timeLine->DrawDateViewer(); | ||||||
|     timeLine->drawTimeline(); |     timeLine->DrawTimeline(); | ||||||
|     timeLine->drawClock(); |     timeLine->DrawClock(); | ||||||
|     channelGroups = new cChannelGroups(); |     channelGroups = new cChannelGroups(); | ||||||
|     channelGroups->ReadChannelGroups(); |     channelGroups->ReadChannelGroups(); | ||||||
|     footer = new cFooter(channelGroups); |     footer = new cFooter(channelGroups); | ||||||
|     recMenuManager->SetFooter(footer); |     recMenuView->SetFooter(footer); | ||||||
|     footer->drawRedButton(); |     footer->drawRedButton(); | ||||||
|     if (tvguideConfig.channelJumpMode == eNumJump) { |     if (config.channelJumpMode == eNumJump) { | ||||||
|         footer->drawGreenButton(); |         footer->drawGreenButton(); | ||||||
|         footer->drawYellowButton(); |         footer->drawYellowButton(); | ||||||
|     } |     } | ||||||
| @@ -152,7 +152,7 @@ void cTvGuideOsd::readChannels(const cChannel *channelStart) { | |||||||
|             if (channelGroups->IsInLastGroup(channel)) { |             if (channelGroups->IsInLastGroup(channel)) { | ||||||
|                 break; |                 break; | ||||||
|             } |             } | ||||||
|             cChannelColumn *column = new cChannelColumn(i, channel, myTime); |             cChannelEpg *column = new cChannelEpg(i, channel, timeManager); | ||||||
|             if (column->readGrids()) { |             if (column->readGrids()) { | ||||||
|                 columns.Add(column); |                 columns.Add(column); | ||||||
|                 i++; |                 i++; | ||||||
| @@ -160,14 +160,14 @@ void cTvGuideOsd::readChannels(const cChannel *channelStart) { | |||||||
|                 delete column; |                 delete column; | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         if (i == tvguideConfig.numGrids) { |         if (i == config.numGrids) { | ||||||
|             foundEnough = true; |             foundEnough = true; | ||||||
|             break; |             break; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|     if (!foundEnough) { |     if (!foundEnough) { | ||||||
|         int numCurrent = columns.Count(); |         int numCurrent = columns.Count(); | ||||||
|         int numBack = tvguideConfig.numGrids - numCurrent; |         int numBack = config.numGrids - numCurrent; | ||||||
|         int newChannelNumber = columns.First()->getChannel()->Number() - numBack; |         int newChannelNumber = columns.First()->getChannel()->Number() - numBack; | ||||||
|         const cChannel *newStart = channels->GetByNumber(newChannelNumber); |         const cChannel *newStart = channels->GetByNumber(newChannelNumber); | ||||||
|         readChannels(newStart); |         readChannels(newStart); | ||||||
| @@ -180,46 +180,46 @@ void cTvGuideOsd::drawGridsChannelJump(int offset) { | |||||||
|     activeGrid = columns.Get(offset)->getActive(); |     activeGrid = columns.Get(offset)->getActive(); | ||||||
|     if (activeGrid) |     if (activeGrid) | ||||||
|         activeGrid->SetActive(); |         activeGrid->SetActive(); | ||||||
|     if (tvguideConfig.displayStatusHeader) { |     if (config.displayStatusHeader) { | ||||||
|         statusHeader->DrawInfoText(activeGrid); |         statusHeader->DrawInfoText(activeGrid); | ||||||
|     } |     } | ||||||
|     if (activeGrid && (tvguideConfig.channelJumpMode == eGroupJump)) { |     if (activeGrid && (config.channelJumpMode == eGroupJump)) { | ||||||
|         footer->UpdateGroupButtons(activeGrid->column->getChannel()); |         footer->UpdateGroupButtons(activeGrid->column->getChannel()); | ||||||
|     } |     } | ||||||
|     if (tvguideConfig.displayChannelGroups) { |     if (config.displayChannelGroups) { | ||||||
|         channelGroups->DrawChannelGroups(columns.First()->getChannel(), columns.Last()->getChannel()); |         channelGroups->DrawChannelGroups(columns.First()->getChannel(), columns.Last()->getChannel()); | ||||||
|     } |     } | ||||||
|     for (cChannelColumn *column = columns.First(); column; column = columns.Next(column)) { |     for (cChannelEpg *column = columns.First(); column; column = columns.Next(column)) { | ||||||
|         column->createHeader(); |         column->createHeader(); | ||||||
|         column->drawGrids(); |         column->drawGrids(); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| void cTvGuideOsd::drawGridsTimeJump() { | void cTvGuideOsd::drawGridsTimeJump(bool last) { | ||||||
|     if (columns.Count() == 0) |     if (columns.Count() == 0) | ||||||
|         return; |         return; | ||||||
|     cChannelColumn *colActive = NULL; |     cChannelEpg *colActive = NULL; | ||||||
|     if (activeGrid) { |     if (activeGrid) { | ||||||
|         colActive = activeGrid->column; |         colActive = activeGrid->column; | ||||||
|     } else { |     } else { | ||||||
|         colActive = columns.First(); |         colActive = columns.First(); | ||||||
|     } |     } | ||||||
|     for (cChannelColumn *column = columns.First(); column; column = columns.Next(column)) { |     for (cChannelEpg *column = columns.First(); column; column = columns.Next(column)) { | ||||||
|         column->clearGrids(); |         column->clearGrids(); | ||||||
|         column->readGrids(); |         column->readGrids(); | ||||||
|         column->drawGrids(); |         column->drawGrids(); | ||||||
|     } |     } | ||||||
|     activeGrid = colActive->getActive(); |     activeGrid = colActive->getActive(last); | ||||||
|     if (activeGrid) { |     if (activeGrid) { | ||||||
|         activeGrid->SetActive(); |         activeGrid->SetActive(); | ||||||
|         activeGrid->Draw(); |         activeGrid->Draw(); | ||||||
|         if (tvguideConfig.displayStatusHeader) { |         if (config.displayStatusHeader) { | ||||||
|             statusHeader->DrawInfoText(activeGrid); |             statusHeader->DrawInfoText(activeGrid); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| void cTvGuideOsd::setNextActiveGrid(cGrid *next) { | void cTvGuideOsd::setNextActiveGrid(cGridElement *next) { | ||||||
|     if (!next || !activeGrid) { |     if (!next || !activeGrid) { | ||||||
|         return; |         return; | ||||||
|     } |     } | ||||||
| @@ -228,13 +228,13 @@ void cTvGuideOsd::setNextActiveGrid(cGrid *next) { | |||||||
|     activeGrid = next; |     activeGrid = next; | ||||||
|     activeGrid->SetActive(); |     activeGrid->SetActive(); | ||||||
|     activeGrid->Draw(); |     activeGrid->Draw(); | ||||||
|     if (tvguideConfig.displayStatusHeader) { |     if (config.displayStatusHeader) { | ||||||
|         statusHeader->DrawInfoText(activeGrid); |         statusHeader->DrawInfoText(activeGrid); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| void cTvGuideOsd::channelForward() { | void cTvGuideOsd::channelForward() { | ||||||
|     cChannelColumn *colRight = columns.Next(activeGrid->column); |     cChannelEpg *colRight = columns.Next(activeGrid->column); | ||||||
|     bool colAdded = false; |     bool colAdded = false; | ||||||
|     if (!colRight) { |     if (!colRight) { | ||||||
|         const cChannel *channelRight = activeGrid->column->getChannel(); |         const cChannel *channelRight = activeGrid->column->getChannel(); | ||||||
| @@ -252,7 +252,7 @@ void cTvGuideOsd::channelForward() { | |||||||
|                 if (channelGroups->IsInLastGroup(channelRight)) { |                 if (channelGroups->IsInLastGroup(channelRight)) { | ||||||
|                     break; |                     break; | ||||||
|                 } |                 } | ||||||
|                 colRight = new cChannelColumn(tvguideConfig.numGrids - 1, channelRight, myTime); |                 colRight = new cChannelEpg(config.numGrids - 1, channelRight, timeManager); | ||||||
|                 if (colRight->readGrids()) { |                 if (colRight->readGrids()) { | ||||||
|                     break; |                     break; | ||||||
|                 } else { |                 } else { | ||||||
| @@ -263,11 +263,11 @@ void cTvGuideOsd::channelForward() { | |||||||
|         } |         } | ||||||
|         if (colRight) { |         if (colRight) { | ||||||
|             colAdded = true; |             colAdded = true; | ||||||
|             if (columns.Count() == tvguideConfig.numGrids) { |             if (columns.Count() == config.numGrids) { | ||||||
|                 cChannelColumn *cFirst = columns.First(); |                 cChannelEpg *cFirst = columns.First(); | ||||||
|                 columns.Del(cFirst); |                 columns.Del(cFirst); | ||||||
|             } |             } | ||||||
|             for (cChannelColumn *column = columns.First(); column; column = columns.Next(column)) { |             for (cChannelEpg *column = columns.First(); column; column = columns.Next(column)) { | ||||||
|                 column->SetNum(column->GetNum() - 1); |                 column->SetNum(column->GetNum() - 1); | ||||||
|                 column->drawHeader(); |                 column->drawHeader(); | ||||||
|                 column->drawGrids(); |                 column->drawGrids(); | ||||||
| @@ -278,22 +278,22 @@ void cTvGuideOsd::channelForward() { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
|     if (colRight) { |     if (colRight) { | ||||||
|         cGrid *right = colRight->getNeighbor(activeGrid); |         cGridElement *right = colRight->getNeighbor(activeGrid); | ||||||
|         if (right) { |         if (right) { | ||||||
|             setNextActiveGrid(right); |             setNextActiveGrid(right); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|     if (tvguideConfig.displayChannelGroups && colAdded) { |     if (config.displayChannelGroups && colAdded) { | ||||||
|         channelGroups->DrawChannelGroups(columns.First()->getChannel(), columns.Last()->getChannel()); |         channelGroups->DrawChannelGroups(columns.First()->getChannel(), columns.Last()->getChannel()); | ||||||
|     } |     } | ||||||
|     if (activeGrid && (tvguideConfig.channelJumpMode == eGroupJump)) { |     if (activeGrid && (config.channelJumpMode == eGroupJump)) { | ||||||
|         footer->UpdateGroupButtons(activeGrid->column->getChannel()); |         footer->UpdateGroupButtons(activeGrid->column->getChannel()); | ||||||
|     } |     } | ||||||
|     osdManager.flush(); |     osdManager.flush(); | ||||||
| } | } | ||||||
|  |  | ||||||
| void cTvGuideOsd::channelBack() { | void cTvGuideOsd::channelBack() { | ||||||
|     cChannelColumn *colLeft = columns.Prev(activeGrid->column); |     cChannelEpg *colLeft = columns.Prev(activeGrid->column); | ||||||
|     bool colAdded = false; |     bool colAdded = false; | ||||||
|     if (!colLeft) { |     if (!colLeft) { | ||||||
|         const cChannel *channelLeft = activeGrid->column->getChannel(); |         const cChannel *channelLeft = activeGrid->column->getChannel(); | ||||||
| @@ -308,7 +308,7 @@ void cTvGuideOsd::channelBack() { | |||||||
| #endif | #endif | ||||||
|         while (channelLeft = channels->Prev(channelLeft)) { |         while (channelLeft = channels->Prev(channelLeft)) { | ||||||
|             if (!channelLeft->GroupSep()) { |             if (!channelLeft->GroupSep()) { | ||||||
|                 colLeft = new cChannelColumn(0, channelLeft, myTime); |                 colLeft = new cChannelEpg(0, channelLeft, timeManager); | ||||||
|                 if (colLeft->readGrids()) { |                 if (colLeft->readGrids()) { | ||||||
|                     break; |                     break; | ||||||
|                 } else { |                 } else { | ||||||
| @@ -319,11 +319,11 @@ void cTvGuideOsd::channelBack() { | |||||||
|         } |         } | ||||||
|         if (colLeft) { |         if (colLeft) { | ||||||
|             colAdded = true; |             colAdded = true; | ||||||
|             if (columns.Count() == tvguideConfig.numGrids) { |             if (columns.Count() == config.numGrids) { | ||||||
|                 cChannelColumn *cLast = columns.Last(); |                 cChannelEpg *cLast = columns.Last(); | ||||||
|                 columns.Del(cLast); |                 columns.Del(cLast); | ||||||
|             } |             } | ||||||
|             for (cChannelColumn *column = columns.First(); column; column = columns.Next(column)) { |             for (cChannelEpg *column = columns.First(); column; column = columns.Next(column)) { | ||||||
|                 column->SetNum(column->GetNum() + 1); |                 column->SetNum(column->GetNum() + 1); | ||||||
|                 column->drawHeader(); |                 column->drawHeader(); | ||||||
|                 column->drawGrids(); |                 column->drawGrids(); | ||||||
| @@ -335,16 +335,16 @@ void cTvGuideOsd::channelBack() { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     if (colLeft) { |     if (colLeft) { | ||||||
|         cGrid *left = colLeft->getNeighbor(activeGrid); |         cGridElement *left = colLeft->getNeighbor(activeGrid); | ||||||
|         if (left) { |         if (left) { | ||||||
|             setNextActiveGrid(left); |             setNextActiveGrid(left); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|     if (tvguideConfig.displayChannelGroups && colAdded) { |     if (config.displayChannelGroups && colAdded) { | ||||||
|         channelGroups->DrawChannelGroups(columns.First()->getChannel(), columns.Last()->getChannel()); |         channelGroups->DrawChannelGroups(columns.First()->getChannel(), columns.Last()->getChannel()); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     if (activeGrid && (tvguideConfig.channelJumpMode == eGroupJump)) { |     if (activeGrid && (config.channelJumpMode == eGroupJump)) { | ||||||
|         footer->UpdateGroupButtons(activeGrid->column->getChannel()); |         footer->UpdateGroupButtons(activeGrid->column->getChannel()); | ||||||
|     } |     } | ||||||
|     osdManager.flush(); |     osdManager.flush(); | ||||||
| @@ -352,14 +352,14 @@ void cTvGuideOsd::channelBack() { | |||||||
|  |  | ||||||
| void cTvGuideOsd::timeForward() { | void cTvGuideOsd::timeForward() { | ||||||
|     bool actionDone = false; |     bool actionDone = false; | ||||||
|     if ( (myTime->GetEnd() - activeGrid->EndTime())/60 < 30 ) { |     if ((timeManager->GetEnd() - activeGrid->EndTime())/60 < 30 ) { | ||||||
|         ScrollForward(); |         ScrollForward(); | ||||||
|         actionDone = true; |         actionDone = true; | ||||||
|     } |     } | ||||||
|     cGrid *next = activeGrid->column->getNext(activeGrid); |     cGridElement *next = activeGrid->column->getNext(activeGrid); | ||||||
|     if (next) { |     if (next) { | ||||||
|         if (   (next->EndTime() < myTime->GetEnd()) |         if (   (next->EndTime() < timeManager->GetEnd()) | ||||||
|             || ( (myTime->GetEnd() - next->StartTime())/60 > 30 ) ) { |             || ( (timeManager->GetEnd() - next->StartTime())/60 > 30 ) ) { | ||||||
|             setNextActiveGrid(next); |             setNextActiveGrid(next); | ||||||
|             actionDone = true; |             actionDone = true; | ||||||
|         } |         } | ||||||
| @@ -371,27 +371,33 @@ void cTvGuideOsd::timeForward() { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cTvGuideOsd::ScrollForward() { | void cTvGuideOsd::ScrollForward() { | ||||||
|     myTime->AddStep(tvguideConfig.stepMinutes); |     timeManager->AddStep(config.stepMinutes); | ||||||
|     timeLine->drawDateViewer(); |     if (config.useHWAccel) { | ||||||
|     timeLine->drawClock(); |         drawGridsTimeJump(true); | ||||||
|     timeLine->setTimeline(); |         timeLine->DrawDateViewer(); | ||||||
|     for (cChannelColumn *column = columns.First(); column; column = columns.Next(column)) { |         timeLine->DrawClock(); | ||||||
|         column->AddNewGridsAtEnd(); |         timeLine->DrawTimeline(); | ||||||
|         column->ClearOutdatedStart(); |     } else { | ||||||
|         column->drawGrids(); |         timeLine->DrawDateViewer(); | ||||||
|  |         timeLine->DrawTimeline(); | ||||||
|  |         for (cChannelEpg *column = columns.First(); column; column = columns.Next(column)) { | ||||||
|  |             column->AddNewGridsAtEnd(); | ||||||
|  |             column->ClearOutdatedStart(); | ||||||
|  |             column->drawGrids(); | ||||||
|  |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| void cTvGuideOsd::timeBack() { | void cTvGuideOsd::timeBack() { | ||||||
|     bool actionDone = false; |     bool actionDone = false; | ||||||
|     if ( (activeGrid->StartTime() - myTime->GetStart())/60 < 30 ) { |     if ((activeGrid->StartTime() - timeManager->GetStart())/60 < 30 ) { | ||||||
|         ScrollBack(); |         ScrollBack(); | ||||||
|         actionDone = true; |         actionDone = true; | ||||||
|     } |     } | ||||||
|     cGrid *prev = activeGrid->column->getPrev(activeGrid); |     cGridElement *prev = activeGrid->column->getPrev(activeGrid); | ||||||
|     if (prev) { |     if (prev) { | ||||||
|         if (   (prev->StartTime() > myTime->GetStart()) |         if (   (prev->StartTime() > timeManager->GetStart()) | ||||||
|             || ( (prev->EndTime() - myTime->GetStart())/60 > 30 ) |             || ( (prev->EndTime() - timeManager->GetStart())/60 > 30 ) | ||||||
|             || ( prev->isFirst()) ) { |             || ( prev->isFirst()) ) { | ||||||
|             setNextActiveGrid(prev); |             setNextActiveGrid(prev); | ||||||
|             actionDone = true; |             actionDone = true; | ||||||
| @@ -404,16 +410,20 @@ void cTvGuideOsd::timeBack() { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cTvGuideOsd::ScrollBack() { | void cTvGuideOsd::ScrollBack() { | ||||||
|     bool tooFarInPast = myTime->DelStep(tvguideConfig.stepMinutes); |     timeManager->DelStep(config.stepMinutes); | ||||||
|     if (tooFarInPast) |     if (config.useHWAccel) { | ||||||
|         return; |         drawGridsTimeJump(); | ||||||
|     timeLine->drawDateViewer(); |         timeLine->DrawDateViewer(); | ||||||
|     timeLine->drawClock(); |         timeLine->DrawClock(); | ||||||
|     timeLine->setTimeline(); |         timeLine->DrawTimeline(); | ||||||
|     for (cChannelColumn *column = columns.First(); column; column = columns.Next(column)) { |     } else { | ||||||
|         column->AddNewGridsAtStart(); |         timeLine->DrawDateViewer(); | ||||||
|         column->ClearOutdatedEnd(); |         timeLine->DrawTimeline(); | ||||||
|         column->drawGrids(); |         for (cChannelEpg *column = columns.First(); column; column = columns.Next(column)) { | ||||||
|  |             column->AddNewGridsAtStart(); | ||||||
|  |             column->ClearOutdatedEnd(); | ||||||
|  |             column->drawGrids(); | ||||||
|  |         }    | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -421,9 +431,9 @@ void cTvGuideOsd::processKeyUp() { | |||||||
|     if (!activeGrid) { |     if (!activeGrid) { | ||||||
|         return; |         return; | ||||||
|     } |     } | ||||||
|     if (tvguideConfig.displayMode == eVertical) { |     if (config.displayMode == eVertical) { | ||||||
|         timeBack(); |         timeBack(); | ||||||
|     } else if (tvguideConfig.displayMode == eHorizontal) { |     } else if (config.displayMode == eHorizontal) { | ||||||
|         channelBack(); |         channelBack(); | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @@ -432,9 +442,9 @@ void cTvGuideOsd::processKeyDown() { | |||||||
|     if (!activeGrid) { |     if (!activeGrid) { | ||||||
|             return; |             return; | ||||||
|     } |     } | ||||||
|     if (tvguideConfig.displayMode == eVertical) { |     if (config.displayMode == eVertical) { | ||||||
|         timeForward(); |         timeForward(); | ||||||
|     } else if (tvguideConfig.displayMode == eHorizontal) { |     } else if (config.displayMode == eHorizontal) { | ||||||
|         channelForward(); |         channelForward(); | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @@ -442,9 +452,9 @@ void cTvGuideOsd::processKeyDown() { | |||||||
| void cTvGuideOsd::processKeyLeft() { | void cTvGuideOsd::processKeyLeft() { | ||||||
|     if (activeGrid == NULL) |     if (activeGrid == NULL) | ||||||
|         return; |         return; | ||||||
|     if (tvguideConfig.displayMode == eVertical) { |     if (config.displayMode == eVertical) { | ||||||
|         channelBack(); |         channelBack(); | ||||||
|     } else if (tvguideConfig.displayMode == eHorizontal) { |     } else if (config.displayMode == eHorizontal) { | ||||||
|         timeBack(); |         timeBack(); | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @@ -452,9 +462,9 @@ void cTvGuideOsd::processKeyLeft() { | |||||||
| void cTvGuideOsd::processKeyRight() { | void cTvGuideOsd::processKeyRight() { | ||||||
|     if (activeGrid == NULL) |     if (activeGrid == NULL) | ||||||
|         return; |         return; | ||||||
|     if (tvguideConfig.displayMode == eVertical) { |     if (config.displayMode == eVertical) { | ||||||
|         channelForward(); |         channelForward(); | ||||||
|     } else if (tvguideConfig.displayMode == eHorizontal) { |     } else if (config.displayMode == eHorizontal) { | ||||||
|         timeForward(); |         timeForward(); | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @@ -462,7 +472,7 @@ void cTvGuideOsd::processKeyRight() { | |||||||
| void cTvGuideOsd::processKeyRed() { | void cTvGuideOsd::processKeyRed() { | ||||||
|     if  ((activeGrid == NULL) || activeGrid->isDummy()) |     if  ((activeGrid == NULL) || activeGrid->isDummy()) | ||||||
|         return; |         return; | ||||||
|     recMenuManager->Start(activeGrid->GetEvent()); |     recMenuView->Start(activeGrid->GetEvent()); | ||||||
| } | } | ||||||
|  |  | ||||||
| void cTvGuideOsd::processKeyGreen() { | void cTvGuideOsd::processKeyGreen() { | ||||||
| @@ -474,7 +484,7 @@ void cTvGuideOsd::processKeyGreen() { | |||||||
|     int currentCol = activeGrid->column->GetNum(); |     int currentCol = activeGrid->column->GetNum(); | ||||||
|     const cChannel *prev = NULL; |     const cChannel *prev = NULL; | ||||||
|      |      | ||||||
|     if (tvguideConfig.channelJumpMode == eGroupJump) { |     if (config.channelJumpMode == eGroupJump) { | ||||||
|         int prevNum = channelGroups->GetPrevGroupChannelNumber(currentChannel); |         int prevNum = channelGroups->GetPrevGroupChannelNumber(currentChannel); | ||||||
|         if (prevNum) { |         if (prevNum) { | ||||||
| #if VDRVERSNUM >= 20301 | #if VDRVERSNUM >= 20301 | ||||||
| @@ -484,8 +494,8 @@ void cTvGuideOsd::processKeyGreen() { | |||||||
|             prev = Channels.GetByNumber(prevNum); |             prev = Channels.GetByNumber(prevNum); | ||||||
| #endif | #endif | ||||||
|         }     |         }     | ||||||
|     } else if (tvguideConfig.channelJumpMode == eNumJump) { |     } else if (config.channelJumpMode == eNumJump) { | ||||||
|         int i = tvguideConfig.jumpChannels + 1; |         int i = config.jumpChannels + 1; | ||||||
| #if VDRVERSNUM >= 20301 | #if VDRVERSNUM >= 20301 | ||||||
|         LOCK_CHANNELS_READ; |         LOCK_CHANNELS_READ; | ||||||
|         for (const cChannel *channel = firstChannel; channel; channel = Channels->Prev(channel)) { |         for (const cChannel *channel = firstChannel; channel; channel = Channels->Prev(channel)) { | ||||||
| @@ -503,7 +513,7 @@ void cTvGuideOsd::processKeyGreen() { | |||||||
|     if (prev) { |     if (prev) { | ||||||
|         readChannels(prev); |         readChannels(prev); | ||||||
|         if (columns.Count() > 0) { |         if (columns.Count() > 0) { | ||||||
|             if (tvguideConfig.channelJumpMode == eGroupJump) |             if (config.channelJumpMode == eGroupJump) | ||||||
|                 drawGridsChannelJump(); |                 drawGridsChannelJump(); | ||||||
|             else |             else | ||||||
|                 drawGridsChannelJump(currentCol); |                 drawGridsChannelJump(currentCol); | ||||||
| @@ -520,7 +530,7 @@ void cTvGuideOsd::processKeyYellow() { | |||||||
|     const cChannel *firstChannel = columns.First()->getChannel(); |     const cChannel *firstChannel = columns.First()->getChannel(); | ||||||
|     const cChannel *next = NULL; |     const cChannel *next = NULL; | ||||||
|      |      | ||||||
|     if (tvguideConfig.channelJumpMode == eGroupJump) { |     if (config.channelJumpMode == eGroupJump) { | ||||||
|         int nextNum = channelGroups->GetNextGroupChannelNumber(currentChannel); |         int nextNum = channelGroups->GetNextGroupChannelNumber(currentChannel); | ||||||
|         if (nextNum) { |         if (nextNum) { | ||||||
| #if VDRVERSNUM >= 20301 | #if VDRVERSNUM >= 20301 | ||||||
| @@ -530,7 +540,7 @@ void cTvGuideOsd::processKeyYellow() { | |||||||
|             next = Channels.GetByNumber(nextNum); |             next = Channels.GetByNumber(nextNum); | ||||||
| #endif | #endif | ||||||
|         }     |         }     | ||||||
|     } else if (tvguideConfig.channelJumpMode == eNumJump) { |     } else if (config.channelJumpMode == eNumJump) { | ||||||
|         int i=0; |         int i=0; | ||||||
| #if VDRVERSNUM >= 20301 | #if VDRVERSNUM >= 20301 | ||||||
|         LOCK_CHANNELS_READ; |         LOCK_CHANNELS_READ; | ||||||
| @@ -545,7 +555,7 @@ void cTvGuideOsd::processKeyYellow() { | |||||||
|                 next = channel; |                 next = channel; | ||||||
|                 i++; |                 i++; | ||||||
|             } |             } | ||||||
|             if (i == (tvguideConfig.jumpChannels+1)) { |             if (i == (config.jumpChannels+1)) { | ||||||
|                 break; |                 break; | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| @@ -553,7 +563,7 @@ void cTvGuideOsd::processKeyYellow() { | |||||||
|     if (next) { |     if (next) { | ||||||
|         readChannels(next); |         readChannels(next); | ||||||
|         if (columns.Count() > 0) { |         if (columns.Count() > 0) { | ||||||
|             if (tvguideConfig.channelJumpMode == eGroupJump) |             if (config.channelJumpMode == eGroupJump) | ||||||
|                 drawGridsChannelJump(); |                 drawGridsChannelJump(); | ||||||
|             else |             else | ||||||
|                 drawGridsChannelJump(currentCol); |                 drawGridsChannelJump(currentCol); | ||||||
| @@ -563,22 +573,22 @@ void cTvGuideOsd::processKeyYellow() { | |||||||
| } | } | ||||||
|  |  | ||||||
| eOSState cTvGuideOsd::processKeyBlue(bool *alreadyUnlocked) { | eOSState cTvGuideOsd::processKeyBlue(bool *alreadyUnlocked) { | ||||||
|     if (tvguideConfig.blueKeyMode == eBlueKeySwitch) { |     if (config.blueKeyMode == eBlueKeySwitch) { | ||||||
|         return ChannelSwitch(alreadyUnlocked); |         return ChannelSwitch(alreadyUnlocked); | ||||||
|     } else if (tvguideConfig.blueKeyMode == eBlueKeyEPG) { |     } else if (config.blueKeyMode == eBlueKeyEPG) { | ||||||
|         DetailedEPG(); |         DetailedEPG(); | ||||||
|     } else if (tvguideConfig.blueKeyMode == eBlueKeyFavorites) { |     } else if (config.blueKeyMode == eBlueKeyFavorites) { | ||||||
|         recMenuManager->StartFavorites(); |         recMenuView->StartFavorites(); | ||||||
|     } |     } | ||||||
|     return osContinue; |     return osContinue; | ||||||
| } | } | ||||||
|  |  | ||||||
| eOSState cTvGuideOsd::processKeyOk(bool *alreadyUnlocked) { | eOSState cTvGuideOsd::processKeyOk(bool *alreadyUnlocked) { | ||||||
|     if (tvguideConfig.blueKeyMode == eBlueKeySwitch) { |     if (config.blueKeyMode == eBlueKeySwitch) { | ||||||
|         DetailedEPG(); |         DetailedEPG(); | ||||||
|     } else if (tvguideConfig.blueKeyMode == eBlueKeyEPG) { |     } else if (config.blueKeyMode == eBlueKeyEPG) { | ||||||
|         return ChannelSwitch(alreadyUnlocked); |         return ChannelSwitch(alreadyUnlocked); | ||||||
|     } else if (tvguideConfig.blueKeyMode == eBlueKeyFavorites) { |     } else if (config.blueKeyMode == eBlueKeyFavorites) { | ||||||
|         DetailedEPG(); |         DetailedEPG(); | ||||||
|     } |     } | ||||||
|     return osContinue; |     return osContinue; | ||||||
| @@ -592,7 +602,7 @@ eOSState cTvGuideOsd::ChannelSwitch(bool *alreadyUnlocked) { | |||||||
|         cPixmap::Unlock(); |         cPixmap::Unlock(); | ||||||
|         *alreadyUnlocked = true; |         *alreadyUnlocked = true; | ||||||
|         cDevice::PrimaryDevice()->SwitchChannel(currentChannel, true); |         cDevice::PrimaryDevice()->SwitchChannel(currentChannel, true); | ||||||
|         if (tvguideConfig.closeOnSwitch) { |         if (config.closeOnSwitch) { | ||||||
|             if (detailView) { |             if (detailView) { | ||||||
|                 delete detailView; |                 delete detailView; | ||||||
|                 detailView = NULL; |                 detailView = NULL; | ||||||
| @@ -616,7 +626,7 @@ void cTvGuideOsd::DetailedEPG() { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cTvGuideOsd::processNumKey(int numKey) { | void cTvGuideOsd::processNumKey(int numKey) { | ||||||
|     if (tvguideConfig.numkeyMode == 0) { |     if (config.numkeyMode == 0) { | ||||||
|         //timely jumps with 1,3,4,6,7,9 |         //timely jumps with 1,3,4,6,7,9 | ||||||
|         TimeJump(numKey); |         TimeJump(numKey); | ||||||
|     } else { |     } else { | ||||||
| @@ -628,53 +638,54 @@ void cTvGuideOsd::processNumKey(int numKey) { | |||||||
| void cTvGuideOsd::TimeJump(int mode) { | void cTvGuideOsd::TimeJump(int mode) { | ||||||
|     switch (mode) { |     switch (mode) { | ||||||
|         case 1: { |         case 1: { | ||||||
|             bool tooFarInPast = myTime->DelStep(tvguideConfig.bigStepHours*60); |             timeManager->DelStep(((config.displayMode == eVertical) ? config.bigStepHours : config.bigStepHoursHorizontal) * 60); | ||||||
|             if (tooFarInPast) |             } | ||||||
|                 return; |  | ||||||
|         } |  | ||||||
|             break; |             break; | ||||||
|         case 3: { |         case 3: { | ||||||
|             myTime->AddStep(tvguideConfig.bigStepHours*60); |             timeManager->AddStep(((config.displayMode == eVertical) ? config.bigStepHours : config.bigStepHoursHorizontal) * 60); | ||||||
|         } |             } | ||||||
|             break; |             break; | ||||||
|         case 4: { |         case 4: { | ||||||
|             bool tooFarInPast = myTime->DelStep(tvguideConfig.hugeStepHours*60); |             timeManager->DelStep(((config.displayMode == eVertical) ? config.hugeStepHours : config.hugeStepHoursHorizontal) * 60); | ||||||
|             if (tooFarInPast) |             } | ||||||
|                 return; |  | ||||||
|         } |  | ||||||
|             break; |             break; | ||||||
|         case 6: { |         case 6: { | ||||||
|             myTime->AddStep(tvguideConfig.hugeStepHours*60); |             timeManager->AddStep(((config.displayMode == eVertical) ? config.hugeStepHours : config.hugeStepHoursHorizontal) * 60); | ||||||
|         } |             } | ||||||
|             break; |             break; | ||||||
|         case 7: { |         case 7: { | ||||||
|             cMyTime primeChecker; |             cTimeManager primeChecker; | ||||||
|             primeChecker.Now(); |             primeChecker.Now(); | ||||||
|             time_t prevPrime = primeChecker.getPrevPrimetime(myTime->GetStart()); |             time_t prevPrime = primeChecker.getPrevPrimetime(timeManager->GetStart()); | ||||||
|             if (primeChecker.tooFarInPast(prevPrime)) |             if (primeChecker.tooFarInPast(prevPrime)) | ||||||
|                 return; |                 return; | ||||||
|             myTime->SetTime(prevPrime); |             timeManager->SetTime(prevPrime); | ||||||
|         } |             } | ||||||
|             break; |             break; | ||||||
|         case 9: { |         case 9: { | ||||||
|             cMyTime primeChecker; |             cTimeManager primeChecker; | ||||||
|             time_t nextPrime = primeChecker.getNextPrimetime(myTime->GetStart()); |             time_t nextPrime = primeChecker.getNextPrimetime(timeManager->GetStart()); | ||||||
|             myTime->SetTime(nextPrime); |             timeManager->SetTime(nextPrime); | ||||||
|         } |             } | ||||||
|             break; |             break; | ||||||
|         default: |         default: | ||||||
|             return; |             return; | ||||||
|     } |     } | ||||||
|     drawGridsTimeJump(); |     drawGridsTimeJump(); | ||||||
|     timeLine->drawDateViewer(); |     timeLine->DrawDateViewer(); | ||||||
|     timeLine->drawClock(); |     timeLine->DrawClock(); | ||||||
|     timeLine->setTimeline(); |     timeLine->DrawTimeline(); | ||||||
|     osdManager.flush(); |     osdManager.flush(); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | int cTvGuideOsd::GetLastValidChannel(void) { | ||||||
|  |     return channelGroups->GetLastValidChannel(); | ||||||
|  | } | ||||||
|  |  | ||||||
| void cTvGuideOsd::ChannelJump(int num) { | void cTvGuideOsd::ChannelJump(int num) { | ||||||
|     if (!channelJumper) { |     if (!channelJumper) { | ||||||
|         channelJumper = new cChannelJump(channelGroups); |         int lastValidChannel = GetLastValidChannel(); | ||||||
|  |         channelJumper = new cChannelJump(channelGroups, lastValidChannel); | ||||||
|     } |     } | ||||||
|     channelJumper->Set(num); |     channelJumper->Set(num); | ||||||
|     channelJumper->DrawText(); |     channelJumper->DrawText(); | ||||||
| @@ -708,7 +719,7 @@ void cTvGuideOsd::CheckTimeout(void) { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cTvGuideOsd::SetTimers() { | void cTvGuideOsd::SetTimers() { | ||||||
|     for (cChannelColumn *column = columns.First(); column; column = columns.Next(column)) { |     for (cChannelEpg *column = columns.First(); column; column = columns.Next(column)) { | ||||||
|         column->SetTimers(); |         column->SetTimers(); | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @@ -717,8 +728,8 @@ eOSState cTvGuideOsd::ProcessKey(eKeys Key) { | |||||||
|     eOSState state = osContinue; |     eOSState state = osContinue; | ||||||
|     cPixmap::Lock(); |     cPixmap::Lock(); | ||||||
|     bool alreadyUnlocked = false; |     bool alreadyUnlocked = false; | ||||||
|     if (recMenuManager->isActive()) { |     if (recMenuView->isActive()) { | ||||||
|         state = recMenuManager->ProcessKey(Key); |         state = recMenuView->ProcessKey(Key); | ||||||
|         if (state == osEnd) { |         if (state == osEnd) { | ||||||
|             SetTimers();                 |             SetTimers();                 | ||||||
|             osdManager.flush(); |             osdManager.flush(); | ||||||
| @@ -734,13 +745,13 @@ eOSState cTvGuideOsd::ProcessKey(eKeys Key) { | |||||||
|             delete detailView; |             delete detailView; | ||||||
|             detailView = NULL; |             detailView = NULL; | ||||||
|             detailViewActive = false; |             detailViewActive = false; | ||||||
|             if ((tvguideConfig.blueKeyMode == eBlueKeySwitch) || (tvguideConfig.blueKeyMode == eBlueKeyFavorites)) { |             if ((config.blueKeyMode == eBlueKeySwitch) || (config.blueKeyMode == eBlueKeyFavorites)) { | ||||||
|                 state = ChannelSwitch(&alreadyUnlocked); |                 state = ChannelSwitch(&alreadyUnlocked); | ||||||
|             } else { |             } else { | ||||||
|                 osdManager.flush(); |                 osdManager.flush(); | ||||||
|                 state = osContinue; |                 state = osContinue; | ||||||
|             } |             } | ||||||
|         } else if ((Key & ~k_Repeat) == kOk && (tvguideConfig.blueKeyMode == eBlueKeyEPG)) { |         } else if ((Key & ~k_Repeat) == kOk && (config.blueKeyMode == eBlueKeyEPG)) { | ||||||
|             delete detailView; |             delete detailView; | ||||||
|             detailView = NULL; |             detailView = NULL; | ||||||
|             detailViewActive = false; |             detailViewActive = false; | ||||||
| @@ -766,11 +777,18 @@ eOSState cTvGuideOsd::ProcessKey(eKeys Key) { | |||||||
|             case kYellow:   processKeyYellow(); break; |             case kYellow:   processKeyYellow(); break; | ||||||
|             case kBlue:     state = processKeyBlue(&alreadyUnlocked); break; |             case kBlue:     state = processKeyBlue(&alreadyUnlocked); break; | ||||||
|             case kOk:       state = processKeyOk(&alreadyUnlocked); break; |             case kOk:       state = processKeyOk(&alreadyUnlocked); break; | ||||||
|             case kBack:     state=osEnd; break;     |             case kBack:     state = osEnd; break;     | ||||||
|             case k0 ... k9: processNumKey(Key - k0); break; |             case k0 ... k9: processNumKey(Key - k0); break; | ||||||
|  |             case kFastRew:  TimeJump(1); break; // Doesnt work, if used from timeshiftmode | ||||||
|  |             case kFastFwd:  TimeJump(3); break; | ||||||
|  |             case kPrev:     TimeJump(4); break; | ||||||
|  |             case kNext:     TimeJump(6); break; | ||||||
|             case kNone:     if (channelJumper) CheckTimeout(); break; |             case kNone:     if (channelJumper) CheckTimeout(); break; | ||||||
|             default:        break; |             default:        break; | ||||||
|         } |         } | ||||||
|  |         if (timeLine->DrawClock()) { | ||||||
|  |             osdManager.flush(); | ||||||
|  |         } | ||||||
|     } |     } | ||||||
|     if (!alreadyUnlocked) { |     if (!alreadyUnlocked) { | ||||||
|         cPixmap::Unlock(); |         cPixmap::Unlock(); | ||||||
| @@ -782,7 +800,7 @@ void cTvGuideOsd::dump() { | |||||||
|     esyslog("tvguide: ------Dumping Content---------"); |     esyslog("tvguide: ------Dumping Content---------"); | ||||||
|     activeGrid->debug(); |     activeGrid->debug(); | ||||||
| //    int i=1; | //    int i=1; | ||||||
|     for (cChannelColumn *col = columns.First(); col; col = columns.Next(col)) { |     for (cChannelEpg *col = columns.First(); col; col = columns.Next(col)) { | ||||||
|         col->dumpGrids(); |         col->dumpGrids(); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
							
								
								
									
										21
									
								
								tvguideosd.h
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								tvguideosd.h
									
									
									
									
									
								
							| @@ -1,36 +1,37 @@ | |||||||
| #ifndef __TVGUIDE_TVGUIDEOSD_H | #ifndef __TVGUIDE_TVGUIDEOSD_H | ||||||
| #define __TVGUIDE_TVGUIDEOSD_H | #define __TVGUIDE_TVGUIDEOSD_H | ||||||
|  |  | ||||||
| #include "timer.h" | #include "timemanager.h" | ||||||
| #include "grid.h" | #include "gridelement.h" | ||||||
| #include "channelcolumn.h" | #include "channelepg.h" | ||||||
| #include "statusheader.h" | #include "statusheader.h" | ||||||
| #include "detailview.h" | #include "detailview.h" | ||||||
| #include "timeline.h" | #include "timeline.h" | ||||||
| #include "channelgroups.h" | #include "channelgroups.h" | ||||||
| #include "footer.h" | #include "footer.h" | ||||||
| #include "recmenumanager.h" | #include "recmenuview.h" | ||||||
| #include "channeljump.h" | #include "channeljump.h" | ||||||
|  |  | ||||||
| // --- cTvGuideOsd ------------------------------------------------------------- | // --- cTvGuideOsd ------------------------------------------------------------- | ||||||
|  |  | ||||||
| class cTvGuideOsd : public cOsdObject { | class cTvGuideOsd : public cOsdObject { | ||||||
| private: | private: | ||||||
|   cMyTime *myTime; |   cTimeManager *timeManager; | ||||||
|   cList<cChannelColumn> columns; |   cList<cChannelEpg> columns; | ||||||
|   cGrid *activeGrid; |   cGridElement *activeGrid; | ||||||
|   cStatusHeader *statusHeader; |   cStatusHeader *statusHeader; | ||||||
|   cDetailView *detailView; |   cDetailView *detailView; | ||||||
|   cTimeLine *timeLine; |   cTimeLine *timeLine; | ||||||
|   cChannelGroups *channelGroups; |   cChannelGroups *channelGroups; | ||||||
|   cFooter *footer; |   cFooter *footer; | ||||||
|   cRecMenuManager *recMenuManager; |   cRecMenuView *recMenuView; | ||||||
|   cChannelJump *channelJumper; |   cChannelJump *channelJumper; | ||||||
|  |   int GetLastValidChannel(void); | ||||||
|   bool detailViewActive; |   bool detailViewActive; | ||||||
|   void drawOsd(); |   void drawOsd(); | ||||||
|   void readChannels(const cChannel *channelStart); |   void readChannels(const cChannel *channelStart); | ||||||
|   void drawGridsChannelJump(int offset = 0); |   void drawGridsChannelJump(int offset = 0); | ||||||
|   void drawGridsTimeJump(); |   void drawGridsTimeJump(bool last = false); | ||||||
|   void processKeyUp(); |   void processKeyUp(); | ||||||
|   void processKeyDown(); |   void processKeyDown(); | ||||||
|   void processKeyLeft(); |   void processKeyLeft(); | ||||||
| @@ -44,7 +45,7 @@ private: | |||||||
|   void TimeJump(int mode); |   void TimeJump(int mode); | ||||||
|   void ChannelJump(int num); |   void ChannelJump(int num); | ||||||
|   void CheckTimeout(void); |   void CheckTimeout(void); | ||||||
|   void setNextActiveGrid(cGrid *next); |   void setNextActiveGrid(cGridElement *next); | ||||||
|   void channelForward(); |   void channelForward(); | ||||||
|   void channelBack(); |   void channelBack(); | ||||||
|   void timeForward(); |   void timeForward(); | ||||||
|   | |||||||
							
								
								
									
										36
									
								
								view.c
									
									
									
									
									
								
							
							
						
						
									
										36
									
								
								view.c
									
									
									
									
									
								
							| @@ -5,7 +5,7 @@ | |||||||
| * cView | * cView | ||||||
| ********************************************************************************************/ | ********************************************************************************************/ | ||||||
|  |  | ||||||
| cView::cView(void) { | cView::cView(void) : cThread("View") { | ||||||
|     activeView = 0; |     activeView = 0; | ||||||
|     scrollable = false; |     scrollable = false; | ||||||
|     tabbed = false; |     tabbed = false; | ||||||
| @@ -71,7 +71,7 @@ void cView::SetGeometry(void) { | |||||||
|     scrollbarWidth = 40; |     scrollbarWidth = 40; | ||||||
|     width = geoManager.osdWidth - scrollbarWidth; |     width = geoManager.osdWidth - scrollbarWidth; | ||||||
|     height = geoManager.osdHeight; |     height = geoManager.osdHeight; | ||||||
|     border = tvguideConfig.epgViewBorder; |     border = config.epgViewBorder; | ||||||
|     headerWidth = geoManager.headerContentWidth; |     headerWidth = geoManager.headerContentWidth; | ||||||
|     headerHeight = geoManager.epgViewHeaderHeight; |     headerHeight = geoManager.epgViewHeaderHeight; | ||||||
|     if (tabbed) |     if (tabbed) | ||||||
| @@ -89,8 +89,8 @@ void cView::DrawHeader(void) { | |||||||
|     } |     } | ||||||
|     pixmapHeader->Fill(clrTransparent); |     pixmapHeader->Fill(clrTransparent); | ||||||
|     pixmapHeaderLogo->Fill(clrTransparent); |     pixmapHeaderLogo->Fill(clrTransparent); | ||||||
|     if (tvguideConfig.style == eStyleGraphical) { |     if (config.style == eStyleGraphical) { | ||||||
|         if (tvguideConfig.scaleVideo) { |         if (config.scaleVideo) { | ||||||
|             pixmapHeader->drawBackgroundGraphical(bgStatusHeaderWindowed); |             pixmapHeader->drawBackgroundGraphical(bgStatusHeaderWindowed); | ||||||
|         } else { |         } else { | ||||||
|             pixmapHeader->drawBackgroundGraphical(bgStatusHeaderFull); |             pixmapHeader->drawBackgroundGraphical(bgStatusHeaderFull); | ||||||
| @@ -101,9 +101,9 @@ void cView::DrawHeader(void) { | |||||||
|     } |     } | ||||||
|     //Channel Logo |     //Channel Logo | ||||||
|     int logoHeight = 2 * headerHeight / 3; |     int logoHeight = 2 * headerHeight / 3; | ||||||
|     int logoWidth = logoHeight * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio; |     int logoWidth = logoHeight * config.logoWidthRatio / config.logoHeightRatio; | ||||||
|     int xText = border / 2; |     int xText = border / 2; | ||||||
|     if (channel && !tvguideConfig.hideChannelLogos) { |     if (channel && !config.hideChannelLogos) { | ||||||
|         cImageLoader imgLoader; |         cImageLoader imgLoader; | ||||||
|         if (imgLoader.LoadLogo(channel, logoWidth, logoHeight)) { |         if (imgLoader.LoadLogo(channel, logoWidth, logoHeight)) { | ||||||
|             cImage logo = imgLoader.GetImage(); |             cImage logo = imgLoader.GetImage(); | ||||||
| @@ -116,7 +116,7 @@ void cView::DrawHeader(void) { | |||||||
|     int yDateTime = border / 2; |     int yDateTime = border / 2; | ||||||
|     int yTitle = (headerHeight - fontHeaderLarge->Height()) / 2; |     int yTitle = (headerHeight - fontHeaderLarge->Height()) / 2; | ||||||
|     int ySubtitle = headerHeight - fontHeader->Height() - border / 3; |     int ySubtitle = headerHeight - fontHeader->Height() - border / 3; | ||||||
|     int textWidthMax = headerWidth - xText; |     int textWidthMax = headerWidth - xText - border / 2; | ||||||
|     pixmapHeader->DrawText(cPoint(xText, yDateTime), CutText(dateTime, textWidthMax, fontHeader).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeader); |     pixmapHeader->DrawText(cPoint(xText, yDateTime), CutText(dateTime, textWidthMax, fontHeader).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeader); | ||||||
|     pixmapHeader->DrawText(cPoint(xText, yTitle), CutText(title, textWidthMax, fontHeaderLarge).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeaderLarge); |     pixmapHeader->DrawText(cPoint(xText, yTitle), CutText(title, textWidthMax, fontHeaderLarge).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeaderLarge); | ||||||
|     pixmapHeader->DrawText(cPoint(xText, ySubtitle), CutText(subTitle, textWidthMax, fontHeader).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeader); |     pixmapHeader->DrawText(cPoint(xText, ySubtitle), CutText(subTitle, textWidthMax, fontHeader).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeader); | ||||||
| @@ -125,7 +125,7 @@ void cView::DrawHeader(void) { | |||||||
|     if (!event) |     if (!event) | ||||||
|         return; |         return; | ||||||
|     const cTimer *ti; |     const cTimer *ti; | ||||||
|     if (tvguideConfig.useRemoteTimers && pRemoteTimers) { |     if (config.useRemoteTimers && pRemoteTimers) { | ||||||
|         RemoteTimers_GetMatch_v1_0 rtMatch; |         RemoteTimers_GetMatch_v1_0 rtMatch; | ||||||
|         rtMatch.event = event; |         rtMatch.event = event; | ||||||
|         pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch); |         pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch); | ||||||
| @@ -450,7 +450,7 @@ void cView::DrawScrollbar(void) { | |||||||
| cImage *cView::CreateScrollbarImage(int width, int height, tColor clrBgr, tColor clrBlend) { | cImage *cView::CreateScrollbarImage(int width, int height, tColor clrBgr, tColor clrBlend) { | ||||||
|     cImage *image = new cImage(cSize(width, height)); |     cImage *image = new cImage(cSize(width, height)); | ||||||
|     image->Fill(clrBgr); |     image->Fill(clrBgr); | ||||||
|     if (tvguideConfig.style != eStyleFlat) { |     if (config.style != eStyleFlat) { | ||||||
|         int numSteps = 64; |         int numSteps = 64; | ||||||
|         int alphaStep = 0x03; |         int alphaStep = 0x03; | ||||||
|         if (height < 30) |         if (height < 30) | ||||||
| @@ -485,7 +485,7 @@ bool cView::KeyUp(void) { | |||||||
|     if (aktHeight >= 0) { |     if (aktHeight >= 0) { | ||||||
|         return false; |         return false; | ||||||
|     } |     } | ||||||
|     int step = tvguideConfig.detailedViewScrollStep * font->Height(); |     int step = config.detailedViewScrollStep * font->Height(); | ||||||
|     int newY = aktHeight + step; |     int newY = aktHeight + step; | ||||||
|     if (newY > 0) |     if (newY > 0) | ||||||
|         newY = 0; |         newY = 0; | ||||||
| @@ -503,7 +503,7 @@ bool cView::KeyDown(void) { | |||||||
|     if (totalHeight - ((-1)*aktHeight) == screenHeight) { |     if (totalHeight - ((-1)*aktHeight) == screenHeight) { | ||||||
|         return false; |         return false; | ||||||
|     }  |     }  | ||||||
|     int step = tvguideConfig.detailedViewScrollStep * font->Height(); |     int step = config.detailedViewScrollStep * font->Height(); | ||||||
|     int newY = aktHeight - step; |     int newY = aktHeight - step; | ||||||
|     if ((-1)*newY > totalHeight - screenHeight) |     if ((-1)*newY > totalHeight - screenHeight) | ||||||
|         newY = (-1)*(totalHeight - screenHeight); |         newY = (-1)*(totalHeight - screenHeight); | ||||||
| @@ -522,7 +522,7 @@ cEPGView::cEPGView(void) : cView() { | |||||||
| } | } | ||||||
|  |  | ||||||
| cEPGView::~cEPGView(void) { | cEPGView::~cEPGView(void) { | ||||||
|     Cancel(-1); |     Cancel(2); | ||||||
|     while (Active()) |     while (Active()) | ||||||
|         cCondWait::SleepMs(10); |         cCondWait::SleepMs(10); | ||||||
| } | } | ||||||
| @@ -540,9 +540,9 @@ void cEPGView::SetTabs(void) { | |||||||
|  |  | ||||||
| void cEPGView::CheckEPGImages(void) { | void cEPGView::CheckEPGImages(void) { | ||||||
|     if (eventID > 0) { |     if (eventID > 0) { | ||||||
|         for (int i=1; i <= tvguideConfig.numAdditionalEPGPictures; i++) { |         for (int i=1; i <= config.numAdditionalEPGPictures; i++) { | ||||||
|             cString epgimage; |             cString epgimage; | ||||||
|             epgimage = cString::sprintf("%s%d_%d.jpg", *tvguideConfig.epgImagePath, eventID, i); |             epgimage = cString::sprintf("%s%d_%d.jpg", *config.epgImagePath, eventID, i); | ||||||
|             FILE *fp = fopen(*epgimage, "r"); |             FILE *fp = fopen(*epgimage, "r"); | ||||||
|             if (fp) { |             if (fp) { | ||||||
|                 std::stringstream ss; |                 std::stringstream ss; | ||||||
| @@ -560,8 +560,8 @@ void cEPGView::CheckEPGImages(void) { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cEPGView::DrawImages(void) { | void cEPGView::DrawImages(void) { | ||||||
|     int imgWidth = tvguideConfig.epgImageWidthLarge; |     int imgWidth = config.epgImageWidthLarge; | ||||||
|     int imgHeight = tvguideConfig.epgImageHeightLarge; |     int imgHeight = config.epgImageHeightLarge; | ||||||
|  |  | ||||||
|     int totalHeight = numEPGPics * (imgHeight + border); |     int totalHeight = numEPGPics * (imgHeight + border); | ||||||
|  |  | ||||||
| @@ -641,7 +641,7 @@ cSeriesView::cSeriesView(int seriesId, int episodeId) : cView() { | |||||||
| } | } | ||||||
|  |  | ||||||
| cSeriesView::~cSeriesView(void) { | cSeriesView::~cSeriesView(void) { | ||||||
|     Cancel(-1); |     Cancel(3); | ||||||
|     while (Active()) |     while (Active()) | ||||||
|         cCondWait::SleepMs(10); |         cCondWait::SleepMs(10); | ||||||
| } | } | ||||||
| @@ -863,7 +863,7 @@ cMovieView::cMovieView(int movieId) : cView() { | |||||||
| } | } | ||||||
|  |  | ||||||
| cMovieView::~cMovieView(void) { | cMovieView::~cMovieView(void) { | ||||||
|     Cancel(-1); |     Cancel(3); | ||||||
|     while (Active()) |     while (Active()) | ||||||
|         cCondWait::SleepMs(10); |         cCondWait::SleepMs(10); | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user