Compare commits

...

231 Commits

Author SHA1 Message Date
kamel5 5ef383453f Version 1.3.6 2022-06-25 13:30:04 +02:00
kamel5 5638c408c1 Better fit channel logo in search result 2022-06-25 13:29:18 +02:00
kamel5 519a87a471 Adapt epgsearch "allow empty" in searchtimer edit 2022-06-25 13:12:24 +02:00
kamel5 a87a1db7c2 Remove SetHeader and SetFooter 2022-06-25 13:00:13 +02:00
kamel5 00ea3fb5ff Rename isDummy() to IsDummy() 2022-06-18 17:03:15 +02:00
kamel5 93af9304c8 Cosmetic change in osdmanager.* 2022-06-18 17:03:15 +02:00
kamel5 d8663ff309 Cosmetic change in geometrymanager.c 2022-06-18 17:03:15 +02:00
kamel5 8e26759d4e Rename GetTimerValue() to GetTimer() 2022-06-18 17:03:15 +02:00
kamel5 5923c9c0ed Rename setActive() to SetActive() 2022-06-18 17:03:15 +02:00
kamel5 6174461af6 Rename isActive() to IsActive() 2022-06-18 17:03:15 +02:00
kamel5 018a8946b7 Rename GetEventValue() to GetEvent() 2022-06-18 17:03:15 +02:00
kamel5 c3dbae705a Rename GetActive() to GetNumActive() 2022-06-18 17:03:15 +02:00
kamel5 0289731158 Refactor cRecMenuTimeline 2022-06-18 17:03:15 +02:00
kamel5 1f1498a734 Refactor cRecMenuAskFolder 2022-06-18 17:03:15 +02:00
kamel5 e707ec7d4f Refactor cRecMenuFavorites 2022-06-18 17:03:15 +02:00
kamel5 bb7d03c7ed Refactor cRecMenuRecordingSearchNotFound 2022-06-18 17:03:15 +02:00
kamel5 b804b63353 Refactor cRecMenuRecordingSearchResults 2022-06-18 17:03:15 +02:00
kamel5 a7e0aacdf1 Refactor cRecMenuRecordingSearch 2022-06-18 17:03:15 +02:00
kamel5 37a31d0768 Refactor cRecMenuSearchConfirmTimer 2022-06-18 17:03:15 +02:00
kamel5 380e84afcd Refactor cRecMenuSearchNothingFound 2022-06-18 17:03:15 +02:00
kamel5 412a78a112 Refactor cRecMenuSearchResults 2022-06-18 17:03:15 +02:00
kamel5 5cc50e465d Refactor cRecMenuSearch 2022-06-18 17:03:15 +02:00
kamel5 a3dc78f70a Refactor cRecMenuSwitchTimerDelete 2022-06-18 17:03:15 +02:00
kamel5 403af35519 Refactor cRecMenuSwitchTimerConfirm 2022-06-18 17:03:15 +02:00
kamel5 97c8bc23fd Refactor cRecMenuSwitchTimer 2022-06-18 17:03:15 +02:00
kamel5 95fd68a6be Refactor cRecMenuSearchTimerNothingFound 2022-06-18 17:03:15 +02:00
kamel5 66659a865d Refactor cRecMenuSearchTimerResults 2022-06-18 17:03:15 +02:00
kamel5 4f95cffdb2 Refactor cRecMenuSearchTimerTemplatesCreate 2022-06-18 17:03:15 +02:00
kamel5 7f7a16498c Refactor cRecMenuSearchTimerCreateConfirm 2022-06-18 17:03:15 +02:00
kamel5 f900446195 Refactor cRecMenuSearchTimerDeleteConfirm 2022-06-18 17:03:15 +02:00
kamel5 d24bbefe4c Refactor cRecMenuSearchTimerEdit 2022-06-18 17:03:15 +02:00
kamel5 54ce728fa5 Refactor cRecMenuSearchTimers 2022-06-18 17:03:15 +02:00
kamel5 a4cc2a4fa8 Refactor cRecMenuSearchTimerTemplates 2022-06-18 17:03:15 +02:00
kamel5 30fc49af0c Refactor cRecMenuSearchTimer 2022-06-18 17:03:15 +02:00
kamel5 cf9250e50b Refactor cRecMenuConfirmSeriesTimer 2022-06-18 17:03:15 +02:00
kamel5 2531526a4d Refactor cRecMenuSeriesTimer 2022-06-18 17:03:15 +02:00
kamel5 37db3b185c Refactor cRecMenuEditTimer 2022-06-18 17:03:15 +02:00
kamel5 e4ef6c4ee5 Refactor cRecMenuConfirmRerunUsed 2022-06-18 17:03:15 +02:00
kamel5 51b1896c6d Refactor cRecMenuNoRerunsFound 2022-06-18 17:03:15 +02:00
kamel5 ec7d45f960 Refactor cRecMenuRerunResults 2022-06-18 17:03:15 +02:00
kamel5 0837137ea8 Refactor cRecMenuNoTimerConflict 2022-06-18 17:03:15 +02:00
kamel5 33196207d0 Refactor cRecMenuTimerConflict 2022-06-18 17:03:15 +02:00
kamel5 73e331f97f Refactor cRecMenuTimerConflicts 2022-06-18 17:03:15 +02:00
kamel5 56cab4a666 Refactor cRecMenuAskDeleteTimer 2022-06-18 17:03:15 +02:00
kamel5 a4294b1f54 Refactor cRecMenuConfirmDeleteTimer 2022-06-18 17:03:15 +02:00
kamel5 ce690366f8 Refactor cRecMenuConfirmTimer 2022-06-18 17:03:02 +02:00
kamel5 9565eda1aa Fix typo 2022-06-18 16:10:07 +02:00
kamel5 637617bd12 Fix a segfault
In the function "cDetailView::InitiateView" there was a
segfault when the "call->type = tNone".
2022-06-18 12:38:50 +02:00
kamel5 eb259fb961 Fixed possible segfault when showing scrollbar in search result lists
A segfault is possible if numSteps is greater than height in
"cRecMenu::createScrollbar()".
2022-04-29 12:18:36 +02:00
kamel5 e2d67769dc Changed the size and location of the channel logos to better fit in place
This leads to a better positioning of the channel logos if they are
displayed in the EPG grid
2022-04-29 12:08:51 +02:00
kamel5 936db4a087 Display errors in search recordings 2021-12-15 15:20:34 +01:00
kamel5 6af3193b02 In menu "Search Recordins" get ChannelName from 'RecInfo'
Alternatively fallback via 'ChannelID' from the active channel list.
2021-12-15 14:48:39 +01:00
kamel5 2d46769a3e Eliminate "Warnung: ISO-C++17 erlaubt Speicherklassenangabe »register« nicht [-Wregister]" 2021-12-15 14:42:41 +01:00
kamel5 6663910058 Version 1.3.5 2021-05-22 11:43:26 +02:00
kamel5 896a4abf75 Update iceblue theme 2021-05-22 11:41:31 +02:00
kamel5 4e062c0a8d Fix for VDR-2.5.4 2021-05-22 11:40:58 +02:00
kamel5 2f497adf01 Version 1.3.4 2021-01-11 11:36:25 +01:00
kamel5 decfb2d39d Coemetic changes 2021-01-11 11:33:16 +01:00
kamel5 5f4ea6b30d gcc11fix 2021-01-11 11:19:01 +01:00
kamel5 435a74d9cf Version 1.3.3 2020-08-06 19:05:42 +02:00
kamel5 fc47c35bea Version 1.3.2 2020-08-06 12:47:03 +02:00
kamel5 4d80c6900d Optional deactivation of the timer confirmation messages 2020-08-06 12:47:03 +02:00
kamel5 78d6e980ee Wrap title in detailview header 2020-08-06 12:47:03 +02:00
kamel5 69356e9c43 Add "Timer On/Off" to recmenu 2020-08-06 12:46:59 +02:00
kamel5 bf3a8a430b Center some channel logos 2020-08-02 19:50:55 +02:00
kamel5 52c41ff5af Fixed display groupname in cChannelGroupGrid::DrawHorizontal 2020-07-25 13:35:03 +02:00
kamel5 5870b1ae4c Version 1.3.1 2020-03-11 15:08:32 +01:00
kamel5 69b851c9ed Fixed a segfault 2020-03-11 14:59:03 +01:00
kamel5 8335ab0e41 Fixes for <VDR-2.3.1 compatibility 2020-03-07 16:55:49 +01:00
kamel5 240cbe87e0 Version 1.3.0 2020-03-06 14:03:36 +01:00
kamel5 ee68d2eb2f Fixed messages in DisplayTimerConflict 2020-03-06 14:01:47 +01:00
kamel5 eb3a4113be Fixed horizontal alignment in timeline 2020-03-06 14:01:47 +01:00
kamel5 7ec89bf12b Fixed stopIndex in cRecMenu::JumpBegin 2020-03-06 14:01:47 +01:00
kamel5 f653594c4a Fixes for <VDR-2.3.1 compatibility 2020-03-04 15:26:27 +01:00
kamel5 8129d116fb Show numTimersToday in timeline 2020-03-02 13:33:58 +01:00
kamel5 874f5cd9d5 Fixed a problem in DisplayTimerConflict 2020-03-02 12:47:04 +01:00
kamel5 9044e092f8 Version 1.2.17 2020-02-17 16:08:14 +01:00
kamel5 b96f800240 Add episode to manual timer 2020-02-17 16:05:43 +01:00
kamel5 5d9ed1439a Fixed a remote timer problem 2020-02-17 15:51:51 +01:00
kamel5 66a0c15aea Final fix for utf8 CutText 2020-02-17 15:51:47 +01:00
kamel5 8db88c2556 Version 1.2.16 2020-01-10 11:11:55 +01:00
kamel5 509b64d78f RecMenu "Timer Timeline" displays now sorted active timer 2020-01-10 11:05:28 +01:00
kamel5 15b7074b4e Separate "displayTime" for horizontal and vertical view 2020-01-09 14:30:05 +01:00
kamel5 3fee6ab13f Optimize display "REC" sign in epgview 2020-01-09 14:29:47 +01:00
kamel5 ffd3e2c79f Refactor CutText in horizontal epgview 2020-01-09 14:29:30 +01:00
kamel5 c77f74321f Refactor Timeline 2020-01-06 15:14:45 +01:00
kamel5 efe06b8e98 Fixed a possible deadlook in cEPGView::cEPGView 2020-01-06 15:14:45 +01:00
kamel5 6540e21444 Optimize TimeJump 2020-01-06 15:14:45 +01:00
kamel5 2e4a43133e Fixed a error in DeleteTimerConflictMenu 2020-01-06 15:14:45 +01:00
kamel5 bcf2ce757c Fixed a timer changed message 2020-01-06 15:14:42 +01:00
kamel5 263a734a0d Version 1.2.15 2019-11-03 13:46:13 +01:00
kamel5 7300fdf91c Workaround for HWAccelerated OSD 2019-11-03 13:08:07 +01:00
kamel5 89e9086943 Version 1.2.14 2019-10-19 16:41:09 +02:00
kamel5 e236d9e571 Optimize cTimeLine::drawClock 2019-10-19 15:10:20 +02:00
kamel5 8794891599 Fixed a error while changing a Theme 2019-10-19 15:10:13 +02:00
kamel5 cd62a9bd6b Diplay the current TimeBase throughout the whole timeline 2019-10-19 15:10:06 +02:00
kamel5 3f0bd75011 Can switch off and optimize diplay time in epggrid "displayMode == Vertical" 2019-10-19 15:09:59 +02:00
kamel5 a711aed160 Version 1.2.13 2019-10-14 18:16:28 +02:00
kamel5 cdb5a46145 Revert "Diplay the current TimeBase throughout the whole timeline"
This reverts commit b707292 because of a segfault.
2019-10-14 16:51:52 +02:00
kamel5 fc784f34e5 Version 1.2.12 2019-10-14 12:58:40 +02:00
kamel5 b707292485 Diplay the current TimeBase throughout the whole timeline 2019-10-14 12:58:35 +02:00
kamel5 587fbe1f44 Fixed updating current TimeBase 2019-10-13 13:46:29 +02:00
kamel5 9173d14b10 Fixed updating current time 2019-10-13 13:46:23 +02:00
kamel5 3386c05e91 Version 1.2.11 2019-09-07 17:32:20 +02:00
kamel5 a1eaf7a865 Optical change in cMenuSetupImageCache 2019-09-07 17:24:01 +02:00
kamel5 41eb32389d Fixed a possible deadlock in detailview 2019-09-07 17:23:32 +02:00
kamel5 f4369c0772 Fix a segfault with graphicsmagick > 1.3.31 2019-09-05 17:08:12 +02:00
kamel5 0203cb3f01 Version 1.2.10 2019-07-20 11:53:04 +02:00
kamel5 152662d519 Rework cRecMenuItemDayChooser 2019-07-19 15:59:44 +02:00
kamel5 b17fd9b7aa Rework cRecMenuItemDay 2019-07-19 11:38:07 +02:00
kamel5 fb165b2b43 Rework cRecMenuItemTime 2019-07-19 11:38:07 +02:00
kamel5 e31070cd76 Rework cRecMenuItemText 2019-07-19 11:38:07 +02:00
kamel5 15ce11db5f Rework cRecMenuItemBool 2019-07-19 11:38:07 +02:00
kamel5 0d3dd79585 Rework cRecMenuItemInt 2019-07-19 11:38:07 +02:00
kamel5 7f8ac2a2a8 Rework cRecMenuItemSelect 2019-07-19 11:38:07 +02:00
kamel5 31f72f2ad8 Rework cRecMenuItemChannelChooser 2019-07-19 11:38:04 +02:00
kamel5 a1aa300259 Rework indent & refresh 2019-07-18 16:53:27 +02:00
kamel5 b7970e5723 Fixed cRecMenuItemSelectDirectory::DrawValue 2019-07-18 13:38:53 +02:00
kamel5 3f9327b8e4 Simplify cRecMenuSearchTimerEdit::GetSearchTimer 2019-07-14 14:22:26 +02:00
kamel5 bff9d78ff3 Rename grid.* to gridelement.* 2019-07-11 15:11:26 +02:00
kamel5 d21b1496f0 Change cGrid to cGridElement 2019-07-11 15:06:07 +02:00
kamel5 5ff172c987 Rename timer.* to timemanager.* 2019-07-11 14:40:41 +02:00
kamel5 6b3eda282f Change cMyTime to cTimeManager 2019-07-11 14:34:31 +02:00
kamel5 107f3f945f lastValidChannel 2019-07-11 14:19:44 +02:00
kamel5 45a2d6bee0 Cosmetic changes in channelgroups.c 2019-07-11 13:40:00 +02:00
kamel5 700543b394 GetLastValidChannel 2019-07-11 13:20:23 +02:00
kamel5 1df9641621 Rename channelcolumn.* to channelepg.* 2019-07-11 12:07:35 +02:00
kamel5 3ed46bd881 Rename channelcolumn to channelepg 2019-07-11 12:06:18 +02:00
kamel5 81759f95cb Change cTvguideConfig to cTVGuideConfig 2019-07-11 11:44:46 +02:00
kamel5 0766d67980 Change tvguideConfig to Config 2019-07-11 11:44:39 +02:00
kamel5 3513f82a8c Change tmpTvguideConfig to tmpConfig 2019-07-11 11:13:51 +02:00
kamel5 7a79059414 Change files to unix 2019-07-11 11:07:13 +02:00
kamel5 ceadc0bbfe Rework recmenuview.c 2019-07-10 18:54:44 +02:00
kamel5 e09279ca32 set ff=unix recmenuview.* 2019-07-10 18:54:29 +02:00
kamel5 27e9004629 Rename recmenumanager.* to recmenuview.* 2019-07-10 17:41:35 +02:00
kamel5 194aa06a4e Update remotetimers.h 2019-07-10 17:41:35 +02:00
kamel5 f046493a00 Cosmetic changes 2019-07-10 17:41:35 +02:00
kamel5 fd7b1b9ab7 Rework cRecManager::UserDefinedTime 2019-07-10 17:41:30 +02:00
kamel5 c4e25b899c Rework cRecManager::WhatsOnNow 2019-07-10 17:41:25 +02:00
kamel5 059936c6d7 Rework cRecManager::DeleteTimer 2019-07-10 17:41:16 +02:00
kamel5 549d42b487 Rework cRecManager::createLocalTimer 2019-07-10 17:41:00 +02:00
kamel5 ad1f0ba0d6 Fixed a compiler error for VDR < 2.3.0 and Cosmetic changes 2019-07-06 13:44:55 +02:00
kamel5 69711400fa Version 1.2.9 2019-07-05 15:09:33 +02:00
kamel5 463b6369d2 Fixed dayOfWeek error in RecMenuSearchTimerEdit 2019-07-05 14:51:21 +02:00
kamel5 0b37464dd0 Change SetStartChannel() and SetStopChannel() 2019-07-04 13:16:13 +02:00
kamel5 cf171d8732 Cosmetic Changes 2019-07-04 12:38:47 +02:00
kamel5 d666b8701e Change locking in cTVGuideSearchTimer::cTVGuideSearchTimer 2019-07-03 12:54:57 +02:00
kamel5 6139016102 Change some default values for searchtimer 2019-07-03 12:39:58 +02:00
kamel5 1c99501776 Correct plugin options in README and CommandLineHelp 2019-06-20 15:40:53 +02:00
kamel5 b484f6cfc1 Version 1.2.8 2019-06-20 13:45:13 +02:00
kamel5 c04ca30792 Remove some debugging 2019-06-19 13:28:22 +02:00
kamel5 ba9c04a4bc Delete rmsSearchTimerEditAdvanced 2019-06-19 13:24:27 +02:00
kamel5 cb2c604d71 Update i18n 2019-06-17 16:17:11 +02:00
kamel5 b8b95f61ed Add more options to cRecMenuSearchTimerEdit 2019-06-17 16:11:09 +02:00
kamel5 507ecc60f6 Eliminate all currentMenuItems 2019-06-17 14:39:11 +02:00
kamel5 ef4ff3d115 Some refatoring to searchTimer 2019-06-17 14:38:17 +02:00
kamel5 1c591b5408 Eliminate InitMenuItems in cRecMenuSearchTimerEdit 2019-06-17 14:38:09 +02:00
kamel5 5b1e174316 Move some inits to cRecMenuSearchTimerEdit::cRecMenuSearchTimerEdit 2019-06-17 14:36:03 +02:00
kamel5 1a2da2da0a Eliminate AddSubMenu in cRecMenuSearchTimerEdit 2019-06-17 14:36:03 +02:00
kamel5 b83ad6df81 Add some parameter to cTVGuideSearchTimer 2019-06-17 14:36:03 +02:00
kamel5 0a931b97dc Cosmetic changes 2019-06-17 14:36:03 +02:00
kamel5 3cce1d2ead Delete advancedOptions in cRecMenuSearchTimerEdit 2019-06-17 14:35:53 +02:00
kamel5 f6a7ae497c Some changes to RecMenuItems 2019-06-16 14:50:15 +02:00
kamel5 803b28aad9 Cosmetic changes in searchtimer.c 2019-06-16 14:49:59 +02:00
kamel5 d5f46dacc6 Add some Modes to searchtimer.* 2019-06-16 14:23:44 +02:00
kamel5 763f9d4e52 Changes in recmenu.c 2019-06-16 14:01:22 +02:00
kamel5 82e404a74e Add cRecManager::GetSearchExtCats and cRecManager::GetBlacklists 2019-06-16 13:45:47 +02:00
kamel5 872a0618f8 Cosmetic changes 2019-06-16 13:36:05 +02:00
kamel5 d0c1519463 Version 1.2.7 2019-06-02 11:14:37 +02:00
kamel5 c081bc5ca1 Correct a compiler error 2019-05-04 12:59:14 +02:00
kamel5 8b1651401c Optical changes in favorites and searchtimer menu 2019-04-26 11:15:08 +02:00
kamel5 5df21a4707 Eliminate a "invalid lock sequence report" in tvguideosd.c 2019-04-23 13:44:44 +02:00
kamel5 e7753834bc Version 1.2.6 2019-04-14 13:58:22 +02:00
kamel5 d1e5e240ec Change channel icon size in cRecMenuSearchTimerEdit 2019-04-14 13:58:15 +02:00
kamel5 6e83787437 Channelgroup in cRecMenuSearchTimerEdit 2019-04-14 13:58:07 +02:00
kamel5 333a3d397f Add .gitignore 2019-04-14 13:58:01 +02:00
kamel5 80acee49e1 Changes for Rec Icon in DrawHeader 2019-04-10 16:59:22 +02:00
kamel5 6095fb4dbc Update services/epgsearch.h 2019-04-09 16:20:50 +02:00
kamel5 e01a63b29e Optimizations in setup menu 2019-04-09 15:08:16 +02:00
kamel5 0975e97519 Different setup parameter for displayTime in horizontal and vertical mode 2019-04-09 15:06:39 +02:00
kamel5 929d8db9ba Optical changes in displaymode vertical 2019-04-09 14:50:42 +02:00
kamel5 56250e3af8 Update services/epgsearch.h 2019-04-07 18:27:53 +02:00
kamel5 d825d700eb Correct an error in setup page 2019-04-07 15:58:55 +02:00
kamel5 ae206f4768 Eliminate a compiler warning in searchtimer.c 2019-04-07 12:59:55 +02:00
kamel5 c7f0131d52 Some cosmetic changes 2019-04-07 12:57:22 +02:00
kamel5 52d887d854 Some changes for VDR < 2.3.0 2019-04-07 12:57:14 +02:00
kamel5 6f7042d41f Correct an error with the recording sign in grid 2019-04-07 12:56:53 +02:00
kamel5 9009f4f385 A german DESCRIPTION 2019-04-07 12:55:44 +02:00
kamel5 b70112ae50 Version 1.2.5 2019-04-05 13:23:09 +02:00
kamel5 9df447454c Add switchMode to setup menu 2019-04-05 13:20:17 +02:00
kamel5 8ae5d34bef Inactive timer in DrawHeader 2019-04-03 14:00:05 +02:00
kamel5 7d44c8f91f Correct Warnung: Variable »ti« gesetzt 2019-04-01 17:05:07 +02:00
kamel5 e399518900 Some changes for VDR < 2.3.0 2019-04-01 17:04:23 +02:00
kamel5 dfb2c2b031 Eliminate a seqfault in cRecManager::DeleteSearchTimer 2019-04-01 17:00:44 +02:00
kamel5 060089548a Fixed a "invalid lock sequence report" in "cRecManager::PerformSearchTimerSearch" 2019-04-01 17:00:16 +02:00
kamel5 56014ea736 Correct x position in EPG grid view 2019-03-28 18:21:32 +01:00
kamel5 f56219c93c Correct x position in cRecMenuItemEvent::Draw 2019-03-28 18:21:32 +01:00
kamel5 7ca598f64e Compile again with VDR < 2.3.0 2019-03-28 18:20:20 +01:00
kamel5 4474b5f5b5 Version 1.2.4 2019-03-23 16:41:50 +01:00
kamel5 d5ecea55a6 Update "services/epgsearch.h" 2019-03-23 15:55:42 +01:00
kamel5 3a940d061c Center channel logos in favorite view 2019-03-23 15:44:46 +01:00
kamel5 10f6d90f16 Eliminate some warnings 2019-03-23 15:42:41 +01:00
kamel5 168973331c Fixed a "invalid lock sequence report" 2019-03-23 12:35:25 +01:00
kamel5 ff599e4cda Add "switchMinsBefore" to setup menu 2019-03-22 15:06:14 +01:00
kamel5 f7e5ac3208 Some cosmetic changes 2019-03-22 13:21:18 +01:00
kamel5 a8ca6f19da Set ff=unix for some files 2019-03-22 13:17:22 +01:00
kamel5 68af1b2086 Correct a switchtimer error 2019-03-20 16:12:54 +01:00
kamel5 d9b8af10e7 Makefile change from imagemagick to graphicsmagick 2019-02-28 14:10:27 +01:00
kamel5 9f98eddc41 Add italian translation 2019-02-28 13:45:22 +01:00
kamel5 431e99d1d4 Support for new SVDRPPeering 2019-02-04 12:02:46 +01:00
kamel5 415e433c73 Version 1.2.3 2019-01-27 12:22:47 +01:00
kamel5 0f092903e8 Clock in timeline if displaymode horizontal 2019-01-27 11:55:31 +01:00
kamel5 e62ea368e8 Change in cEpgGrid::SetTimer 2019-01-27 11:50:59 +01:00
kamel5 c1fe8a8dfd Center channel logos in EPG grid view 2019-01-27 11:42:29 +01:00
kamel5 d0969687ea Center channel logos in EPG detail view 2019-01-27 11:42:24 +01:00
kamel5 b086cf85dc Changes for locking in cChannelColumn::SetTimers() 2019-01-27 11:41:49 +01:00
kamel5 b054fa2c12 Updated hasTimer 2019-01-27 11:40:33 +01:00
kamel5 aa26a69ef8 Changes in cRecManager::DeleteTimer 2019-01-27 11:39:34 +01:00
kamel5 91488f0f60 Changes in cRecManager::SaveTimer 2019-01-27 11:39:15 +01:00
kamel5 39dfe767fc Changes for LOCKING 2019-01-27 11:38:58 +01:00
kamel5 8f1f2dea33 Correct view of vdr's switchtimer 2019-01-27 11:38:27 +01:00
kamel5 f592012442 Eliminate deadlock in "EditTimer" 2019-01-27 11:34:31 +01:00
kamel5 c6d01ba60b Eliminate deadlock in "DeleteTimer" 2019-01-27 11:34:22 +01:00
kamel5 d5b3844dcc Show vdr's switchtimer 2019-01-27 11:33:48 +01:00
kamel5 2ed3344bb9 Some changes for LOCKING 2019-01-27 11:32:20 +01:00
kamel5 82fb45a088 Cosmetic changes 2019-01-27 11:31:16 +01:00
kamel5 e476e0e8c0 Show inactive timer 2019-01-27 11:30:14 +01:00
kamel5 881c95a61c New Makefile style 2019-01-27 11:30:07 +01:00
kamel5 bf2937d86c Cosmetic changes / SwitchTimer& operator / std:min,std:max 2019-01-27 11:30:01 +01:00
kamel5 6ae27238af Reinsert old tvscraper compatibility 2019-01-27 11:29:55 +01:00
kamel5 cbc6f44264 Compile under VDR 2.3.1 2019-01-27 11:29:38 +01:00
79 changed files with 13297 additions and 10356 deletions

5
.gitignore vendored Normal file
View File

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

163
HISTORY
View File

@ -138,3 +138,166 @@ Version 1.2.2
- added scraper2vdr support - added scraper2vdr support
- introduced tabbed EPG detail view - introduced tabbed EPG detail view
Version 1.2.3
- Compile under VDR 2.3.1+
- Reinsert old tvscraper compatibility
- New Makefile style
- Show inactive timer in EPG grid
- Center channel logos in EPG
- Clock in timeline if displaymode horizontal
Version 1.2.4
- Add Support for new SVDRPPeering
- Add italian translation
- Use graphicsmagick instead of imagemagick
- Correct a switchtimer error
- Add "switchMinsBefore" to setup menu
- Eliminate some warnings
- Center channel logos in favorite view
- Update "services/epgsearch.h"
Version 1.2.5
- Compile again with VDR < 2.3.0
- Correct some x positions in EPG grid
- Fixed a "invalid lock sequence report" in "cRecManager::PerformSearchTimerSearch"
- Eliminate a seqfault in "cRecManager::DeleteSearchTimer"
- Show Inactive timer in DrawHeader
- Add "switchMode" to setup menu
Version 1.2.6
- Some changes for VDR < 2.3.0
- Changes for Rec Icon in DrawHeader and Grid
- Eliminate a compiler warning in searchtimer.c
- Correct an error in setup page
- Optical changes in displaymode vertical
- Different setup parameter for displayTime in horizontal and vertical mode
- Optimizations in setup menu
- Add .gitignore
- Channelgroup in cRecMenuSearchTimerEdit
(Create and modify of channelgroups isn't yet possible, should be done in epgsearch)
- Change channel icon size in cRecMenuSearchTimerEdit
Version 1.2.7
- Eliminate a "invalid lock sequence report" in tvguideosd.c
- Optical changes in favorites and searchtimer menu
- Changes in README
Version 1.2.8
- Some refactoring
- Update i18n
- Add almost all search timer options to cRecMenuSearchTimerEdit,
only one is missing: "Use content descriptor"
(Create and modify of channelgroups and blacklists isn't possible,
because the epgsearch service interface doesn't support that,
should be done in epgsearch)
Version 1.2.9
- Correct plugin options in README and CommandLineHelp
- Change locking in cTVGuideSearchTimer::cTVGuideSearchTimer
- Fixed a dayOfWeek error in RecMenuSearchTimerEdit
Version 1.2.10
- Update remotetimers.h
- Simplify cRecMenuSearchTimerEdit::GetSearchTimer
- Fixed cRecMenuItemSelectDirectory::DrawValue
- Some rework
Version 1.2.11
- Fixed a segfault with graphicsmagick > 1.3.31
- Fixed a possible deadlock in detailview
- Optical changes in cMenuSetupImageCache
Version 1.2.12
- Fixed updating current time
- Fixed updating current TimeBase
- Diplay the current TimeBase throughout the whole timeline
Version 1.2.13
- Revert "Diplay the current TimeBase throughout the whole timeline"
Version 1.2.14
- Diplay the current TimeBase throughout the whole timeline
- Can switch off and optimize diplay time in epggrid "displayMode == Vertical"
- Fixed a error while changing a Theme
Version 1.2.15
- Workaround for HWAccelerated OSD
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
Version 1.3.0
- last version with <VDR-2.3.1 compatibility
- Fixed a possible seqfault in DisplayTimerConflict
- Show numTimersToday in timeline
- Fixed stopIndex in cRecMenu::JumpBegin
- Fixed horizontal alignment in timeline
- Fixed messages in DisplayTimerConflict
Version 1.3.1
- Fixes for <VDR-2.3.1 compatibility
- Fixed a segfault while starting tvguide
Version 1.3.2
- Fixed display groupname in cChannelGroupGrid::DrawHorizontal
- Center some channel logos
- Add "Timer On/Off" to recmenu
- Wrap title in detailview header
- Optional deactivation of the timer confirmation messages
Version 1.3.3
- Bugfix
Version 1.3.4
- Fix for gcc11
Version 1.3.5
- Fix for VDR-2.5.4
- Update iceblue theme
Version 1.3.6
- Fix segfault when tvscraper returns "call->type = tNone"
- In menu "Search Recordins" get ChannelName from 'RecInfo'
- Display errors in search recordings
- Fixed possible segfault when showing scrollbar in search result lists
- Adapt epgsearch "allow empty" for searchtimer
- some rework
- optical optimization

View File

@ -4,7 +4,8 @@
# $Id$ # $Id$
# External image lib to use: imagemagick, graphicsmagick # External image lib to use: imagemagick, graphicsmagick
IMAGELIB = imagemagick #IMAGELIB = imagemagick
IMAGELIB = graphicsmagick
# The official name of this plugin. # The official name of this plugin.
# This name will be used in the '-P...' option of VDR to load the plugin. # This name will be used in the '-P...' option of VDR to load the plugin.
@ -59,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:
@ -68,7 +69,8 @@ all: $(SOFILE) i18n
### Implicit rules: ### Implicit rules:
%.o: %.c %.o: %.c
$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $< @echo CC $@
$(Q)$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
### Dependencies: ### Dependencies:
@ -88,17 +90,21 @@ I18Nmsgs = $(addprefix $(DESTDIR)$(LOCDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLU
I18Npot = $(PODIR)/$(PLUGIN).pot I18Npot = $(PODIR)/$(PLUGIN).pot
%.mo: %.po %.mo: %.po
msgfmt -c -o $@ $< @echo MO $@
$(Q)msgfmt -c -o $@ $<
$(I18Npot): $(wildcard *.c) $(I18Npot): $(wildcard *.c)
xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='<see README>' -o $@ `ls $^` @echo GT $@
$(Q)xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='<see README>' -o $@ `ls $^`
%.po: $(I18Npot) %.po: $(I18Npot)
msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $< @echo PO $@
$(Q)msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $<
@touch $@ @touch $@
$(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo $(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
install -D -m644 $< $@ @echo IN $@
$(Q)install -D -m644 $< $@
.PHONY: i18n .PHONY: i18n
i18n: $(I18Nmo) $(I18Npot) i18n: $(I18Nmo) $(I18Npot)
@ -108,10 +114,12 @@ install-i18n: $(I18Nmsgs)
### Targets: ### Targets:
$(SOFILE): $(OBJS) $(SOFILE): $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) $(LIBS) -o $@ @echo LD $@
$(Q)$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) $(LIBS) -o $@
install-lib: $(SOFILE) install-lib: $(SOFILE)
install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION) @echo IN $@
$(Q)install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION)
install-themes: install-themes:
@mkdir -p $(DESTDIR)$(VDRCONFDIR)/themes @mkdir -p $(DESTDIR)$(VDRCONFDIR)/themes

14
README
View File

@ -1,10 +1,14 @@
This is a "plugin" for the Video Disk Recorder (VDR). This is a "plugin" for the Video Disk Recorder (VDR).
Written by: Louis Braun <louis DOT braun AT gmx DOT de> TVGuide on GitLab: https://gitlab.com/kamel5/tvguide
Project's homepage: http://projects.vdr-developer.org/projects/plg-tvguide Original Written by: Louis Braun <louis DOT braun AT gmx DOT de>
Latest version available at: http://projects.vdr-developer.org/projects/plg-tvguide/files Original Project's homepage: http://projects.vdr-developer.org/projects/plg-tvguide
Latest version available at: https://gitlab.com/kamel5/tvguide
Original version available at: http://projects.vdr-developer.org/projects/plg-tvguide/files
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -40,13 +44,13 @@ After "normal" Plugin installation you have to care about the paths for the
used Icons, the channel logos and epg images. The following paths can be set 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

View File

@ -1,62 +0,0 @@
#ifndef __TVGUIDE_CHANNELCOLUMN_H
#define __TVGUIDE_CHANNELCOLUMN_H
#include <vdr/tools.h>
#include "grid.h"
#include "epggrid.h"
#include "headergrid.h"
#include "switchtimer.h"
class cGrid;
class cEpgGrid;
class cHeaderGrid;
// --- cChannelColumn -------------------------------------------------------------
class cChannelColumn : public cListObject, public cStyledPixmap {
private:
cMyTime *myTime;
int num;
const cChannel *channel;
cHeaderGrid *header;
cList<cGrid> grids;
cSchedulesLock *schedulesLock;
const cSchedules *schedules;
bool hasTimer;
bool hasSwitchTimer;
cGrid *addEpgGrid(const cEvent *event, cGrid *firstGrid, bool color);
cGrid *addDummyGrid(time_t start, time_t end, cGrid *firstGrid, bool color);
public:
cChannelColumn(int num, const cChannel *channel, cMyTime *myTime);
virtual ~cChannelColumn(void);
void createHeader();
void drawHeader();
bool readGrids();
void drawGrids();
int getX();
int getY();
int Start() { return myTime->GetStart(); };
int Stop() { return myTime->GetEnd(); };
const char* Name() { return channel->Name(); };
const cChannel * getChannel() {return channel;}
cGrid * getActive();
cGrid * getNext(cGrid *activeGrid);
cGrid * getPrev(cGrid *activeGrid);
cGrid * getNeighbor(cGrid *activeGrid);
bool isFirst(cGrid *grid);
void AddNewGridsAtStart();
void AddNewGridsAtEnd();
void ClearOutdatedStart();
void ClearOutdatedEnd();
int GetNum() {return num;};
void SetNum(int num) {this->num = num;};
void setTimer() {hasTimer = channel->HasTimer();};
bool HasTimer() { return hasTimer; };
void setSwitchTimer() {hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel);};
bool HasSwitchTimer() { return hasSwitchTimer; };
void SetTimers();
void clearGrids();
void dumpGrids();
};
#endif //__TVGUIDE_CHANNELCOLUMN_H

View File

@ -1,53 +1,67 @@
#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
hasTimer = channel->HasTimer(); hasTimer = channel->HasTimer();
#endif
hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel); hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel);
#if VDRVERSNUM < 20301
schedulesLock = new cSchedulesLock(false, 100); schedulesLock = new cSchedulesLock(false, 100);
#endif
header = NULL; header = NULL;
} }
cChannelColumn::~cChannelColumn(void) { cChannelEpg::~cChannelEpg(void) {
if (header) if (header)
delete header; delete header;
grids.Clear(); grids.Clear();
#if VDRVERSNUM < 20301
delete schedulesLock; delete schedulesLock;
#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
const cSchedules* schedules;
{
LOCK_SCHEDULES_READ;
schedules = Schedules;
}
#else
schedules = cSchedules::Schedules(*schedulesLock); schedules = cSchedules::Schedules(*schedulesLock);
#endif
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;
@ -58,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);
@ -83,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)) {
@ -170,29 +186,37 @@ 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
#if VDRVERSNUM >= 20301
const cSchedules* schedules;
{
LOCK_SCHEDULES_READ;
schedules = Schedules;
}
#else
schedules = cSchedules::Schedules(*schedulesLock); schedules = cSchedules::Schedules(*schedulesLock);
#endif
const cSchedule *Schedule = NULL; const cSchedule *Schedule = NULL;
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;
} }
@ -201,46 +225,54 @@ 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;
} }
} }
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
#if VDRVERSNUM >= 20301
const cSchedules* schedules;
{
LOCK_SCHEDULES_READ;
schedules = Schedules;
}
#else
schedules = cSchedules::Schedules(*schedulesLock); schedules = cSchedules::Schedules(*schedulesLock);
#endif
const cSchedule *Schedule = NULL; const cSchedule *Schedule = NULL;
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;
} }
@ -249,45 +281,45 @@ 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;
} }
} }
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;
@ -295,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;
@ -319,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)
@ -330,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)
@ -341,13 +373,15 @@ cGrid *cChannelColumn::addDummyGrid(time_t start, time_t end, cGrid *firstGrid,
return dummy; return dummy;
} }
void cChannelColumn::SetTimers() { void cChannelEpg::SetTimers() {
#if VDRVERSNUM < 20301
hasTimer = channel->HasTimer(); hasTimer = channel->HasTimer();
#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 != grid->HasTimer()) if (gridHadTimer || gridHadTimer != grid->HasTimer())
grid->SetDirty(); grid->SetDirty();
bool gridHadSwitchTimer = grid->HasSwitchTimer(); bool gridHadSwitchTimer = grid->HasSwitchTimer();
grid->SetSwitchTimer(); grid->SetSwitchTimer();
@ -357,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++;
} }
} }

69
channelepg.h Normal file
View File

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

View File

@ -36,61 +36,60 @@ 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;
height = (end - start + 1) * geoManager.rowHeight; height = (end - start + 1) * geoManager.rowHeight;
} }
pixmap = osdManager.requestPixmap(1, cRect(x, y, width, height)); pixmap = osdManager.CreatePixmap(1, cRect(x, y, width, height));
} }
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);
} }
} }
void cChannelGroupGrid::DrawVertical(tColor colorText, tColor colorTextBack) { void cChannelGroupGrid::DrawVertical(tColor colorText, tColor colorTextBack) {
int textY = (Height() - fontManager.FontChannelGroups->Height()) / 2; int textY = (Height() - fontManager.FontChannelGroups->Height()) / 2;
cString text = CutText(name, Width() - 4, fontManager.FontChannelGroups).c_str(); cString text = cString::sprintf("%s", CutText(name, Width() - 4, fontManager.FontChannelGroups).c_str());
int textWidth = fontManager.FontChannelGroups->Width(*text); int textWidth = fontManager.FontChannelGroups->Width(*text);
int x = (Width() - textWidth) / 2; int x = (Width() - textWidth) / 2;
pixmap->DrawText(cPoint(x, textY), *text, colorText, colorTextBack, fontManager.FontChannelGroups); pixmap->DrawText(cPoint(x, textY), *text, colorText, colorTextBack, fontManager.FontChannelGroups);
} }
void cChannelGroupGrid::DrawHorizontal(tColor colorText, tColor colorTextBack) { void cChannelGroupGrid::DrawHorizontal(tColor colorText, tColor colorTextBack) {
std::string nameUpper = name; std::string groupName = name;
std::transform(nameUpper.begin(), nameUpper.end(),nameUpper.begin(), ::toupper); int numChars = groupName.length();
int numChars = nameUpper.length();
int charHeight = fontManager.FontChannelGroupsHorizontal->Height(); int charHeight = fontManager.FontChannelGroupsHorizontal->Height();
int textHeight = numChars * charHeight; int textHeight = numChars * charHeight;
int y = 5; int y = 5;
if ((textHeight +5) < Height()) { if ((textHeight + 5) < Height()) {
y = (Height() - textHeight) / 2; y = (Height() - textHeight) / 2;
} }
for (int i=0; i < numChars; i++) { for (int i = 0; i < numChars; i++) {
if (((y + 2*charHeight) > Height()) && ((i+1)<numChars)) { if (((y + 2 * charHeight) > Height()) && ((i + 1) < numChars)) {
int x = (Width() - fontManager.FontChannelGroupsHorizontal->Width("...")) / 2; int x = (Width() - fontManager.FontChannelGroupsHorizontal->Width("...")) / 2;
pixmap->DrawText(cPoint(x, y), "...", colorText, colorTextBack, fontManager.FontChannelGroupsHorizontal); pixmap->DrawText(cPoint(x, y), "...", colorText, colorTextBack, fontManager.FontChannelGroupsHorizontal);
break; break;
} }
cString currentChar = cString::sprintf("%c", nameUpper.at(i)); cString currentChar = cString::sprintf("%s", utf8_substr(groupName.c_str(), i, 1).c_str());
int x = (Width() - fontManager.FontChannelGroupsHorizontal->Width(*currentChar)) / 2; int x = (Width() - fontManager.FontChannelGroupsHorizontal->Width(*currentChar)) / 2;
pixmap->DrawText(cPoint(x, y), *currentChar, colorText, colorTextBack, fontManager.FontChannelGroupsHorizontal); pixmap->DrawText(cPoint(x, y), *currentChar, colorText, colorTextBack, fontManager.FontChannelGroupsHorizontal);
y += fontManager.FontChannelGroupsHorizontal->Height(); y += fontManager.FontChannelGroupsHorizontal->Height();

View File

@ -1,4 +1,5 @@
#include <vector> #include <vector>
#include "config.h"
#include "channelgroups.h" #include "channelgroups.h"
cChannelGroups::cChannelGroups(void) { cChannelGroups::cChannelGroups(void) {
@ -10,19 +11,25 @@ cChannelGroups::~cChannelGroups(void) {
void cChannelGroups::ReadChannelGroups(void) { void cChannelGroups::ReadChannelGroups(void) {
bool setStart = false; bool setStart = false;
int lastChannelNumber = 0; int lastChannelNumber = 0;
const cChannel *first = Channels.First(); #if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ;
const cChannels *channels = Channels;
#else
const cChannels *channels = &Channels;
#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;
} }
for (const cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) { for (const cChannel *channel = channels->First(); channel; channel = channels->Next(channel)) {
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;
@ -31,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();
} }
} }
@ -60,7 +67,7 @@ const char* cChannelGroups::GetPrev(int group) {
const char* cChannelGroups::GetNext(int group) { const char* cChannelGroups::GetNext(int group) {
if (group > -1) { if (group > -1) {
if ((group+1) < channelGroups.size()) if ((group+1) < (int)channelGroups.size())
return channelGroups[group+1].GetName(); return channelGroups[group+1].GetName();
} }
return ""; return "";
@ -80,14 +87,14 @@ int cChannelGroups::GetNextGroupChannelNumber(const cChannel *channel) {
int currentGroup = GetGroup(channel); int currentGroup = GetGroup(channel);
if (currentGroup == -1) if (currentGroup == -1)
return 0; return 0;
if ((currentGroup+1) < channelGroups.size()) { if ((currentGroup+1) < (int)channelGroups.size()) {
return channelGroups[currentGroup+1].StartChannel(); return channelGroups[currentGroup+1].StartChannel();
} }
return 0; return 0;
} }
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()) {
@ -103,7 +110,12 @@ void cChannelGroups::DrawChannelGroups(const cChannel *start, const cChannel *st
int groupLast = group; int groupLast = group;
int line = 0; int line = 0;
int lineStart = 0; int lineStart = 0;
#if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ;
for (const cChannel *channel = Channels->Next(start); channel; channel = Channels->Next(channel)) {
#else
for (const cChannel *channel = Channels.Next(start); channel; channel = Channels.Next(channel)) { for (const cChannel *channel = Channels.Next(start); channel; channel = Channels.Next(channel)) {
#endif
if (channel->GroupSep()) if (channel->GroupSep())
continue; continue;
group = GetGroup(channel); group = GetGroup(channel);
@ -131,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) {

View File

@ -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 -------------------------------------------------------------

View File

@ -6,37 +6,33 @@
#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;
maxChannels = Channels.MaxNumber();
} else {
maxChannels = channelGroups->GetLastValidChannel();
}
timeout = Setup.ChannelEntryTimeout; timeout = Setup.ChannelEntryTimeout;
startTime = cTimeMs::Now(); startTime = 0;
SetPixmaps(); SetPixmaps();
Draw(); Draw();
} }
cChannelJump::~cChannelJump(void) { cChannelJump::~cChannelJump(void) {
osdManager.releasePixmap(pixmapBack); osdManager.DestroyPixmap(pixmapBack);
osdManager.releasePixmap(pixmapText); osdManager.DestroyPixmap(pixmapText);
} }
void cChannelJump::SetPixmaps(void) { void cChannelJump::SetPixmaps(void) {
int x = (geoManager.osdWidth - geoManager.channelJumpWidth)/2; int x = (geoManager.osdWidth - geoManager.channelJumpWidth)/2;
int y = (geoManager.osdHeight - geoManager.channelJumpHeight)/2; int y = (geoManager.osdHeight - geoManager.channelJumpHeight)/2;
pixmapBack = osdManager.requestPixmap(4, cRect(x, y, geoManager.channelJumpWidth, geoManager.channelJumpHeight)); pixmapBack = osdManager.CreatePixmap(4, cRect(x, y, geoManager.channelJumpWidth, geoManager.channelJumpHeight));
pixmap = osdManager.requestPixmap(5, cRect(x, y, geoManager.channelJumpWidth, geoManager.channelJumpHeight)); pixmap = osdManager.CreatePixmap(5, cRect(x, y, geoManager.channelJumpWidth, geoManager.channelJumpHeight));
pixmapText = osdManager.requestPixmap(6, cRect(x, y, geoManager.channelJumpWidth, geoManager.channelJumpHeight)); pixmapText = osdManager.CreatePixmap(6, cRect(x, y, geoManager.channelJumpWidth, geoManager.channelJumpHeight));
} }
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));

View File

@ -10,15 +10,15 @@ private:
int channel; int channel;
cChannelGroups *channelGroups; cChannelGroups *channelGroups;
int maxChannels; int maxChannels;
int startTime; long unsigned int startTime;
int timeout; long unsigned int timeout;
cPixmap *pixmapBack; cPixmap *pixmapBack;
cPixmap *pixmapText; cPixmap *pixmapText;
void SetPixmaps(void); void SetPixmaps(void);
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);

View File

@ -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,7 +10,8 @@ cTvguideConfig::cTvguideConfig() {
showTimeInGrid = 1; showTimeInGrid = 1;
channelCols = 5; channelCols = 5;
channelRows = 10; channelRows = 10;
displayTime = 160; displayTime = 180;
displayHorizontalTime = 180;
displayStatusHeader = 1; displayStatusHeader = 1;
displayChannelGroups = 1; displayChannelGroups = 1;
displayTimeBase = 1; displayTimeBase = 1;
@ -26,10 +28,14 @@ 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;
timerMessage = 1;
closeOnSwitch = 1; closeOnSwitch = 1;
numkeyMode = 0; numkeyMode = 0;
useRemoteTimers = 0; useRemoteTimers = 0;
@ -64,6 +70,8 @@ cTvguideConfig::cTvguideConfig() {
favLimitChannels = 0; favLimitChannels = 0;
favStartChannel = 0; favStartChannel = 0;
favStopChannel = 0; favStopChannel = 0;
switchMode = 0;
switchMinsBefore = 2;
fontIndex = 0; fontIndex = 0;
fontNameDefault = "VDRSymbols Sans:Book"; fontNameDefault = "VDRSymbols Sans:Book";
FontButtonDelta = 0; FontButtonDelta = 0;
@ -92,6 +100,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 = "";
@ -109,25 +118,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"));
@ -164,6 +174,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) {
@ -175,7 +186,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");
@ -192,25 +203,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));
@ -226,7 +237,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());
@ -234,9 +245,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);
@ -255,12 +267,15 @@ bool cTvguideConfig::SetupParse(const char *Name, const char *Value) {
else if (strcmp(Name, "channelCols") == 0) channelCols = atoi(Value); else if (strcmp(Name, "channelCols") == 0) channelCols = atoi(Value);
else if (strcmp(Name, "channelRows") == 0) channelRows = atoi(Value); else if (strcmp(Name, "channelRows") == 0) channelRows = atoi(Value);
else if (strcmp(Name, "displayTime") == 0) displayTime = atoi(Value); else if (strcmp(Name, "displayTime") == 0) displayTime = atoi(Value);
else if (strcmp(Name, "displayHorizontalTime") == 0) displayHorizontalTime = atoi(Value);
else if (strcmp(Name, "hideChannelLogos") == 0) hideChannelLogos = atoi(Value); else if (strcmp(Name, "hideChannelLogos") == 0) hideChannelLogos = atoi(Value);
else if (strcmp(Name, "logoExtension") == 0) logoExtension = atoi(Value); else if (strcmp(Name, "logoExtension") == 0) logoExtension = atoi(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);
@ -282,6 +297,8 @@ 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, "timerMessage") == 0) timerMessage = 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);
@ -299,6 +316,8 @@ bool cTvguideConfig::SetupParse(const char *Name, const char *Value) {
else if (strcmp(Name, "favLimitChannels") == 0) favLimitChannels = atoi(Value); else if (strcmp(Name, "favLimitChannels") == 0) favLimitChannels = atoi(Value);
else if (strcmp(Name, "favStartChannel") == 0) favStartChannel = atoi(Value); else if (strcmp(Name, "favStartChannel") == 0) favStartChannel = atoi(Value);
else if (strcmp(Name, "favStopChannel") == 0) favStopChannel = atoi(Value); else if (strcmp(Name, "favStopChannel") == 0) favStopChannel = atoi(Value);
else if (strcmp(Name, "switchMode") == 0) switchMode = atoi(Value);
else if (strcmp(Name, "switchMinsBefore") == 0) switchMinsBefore = atoi(Value);
else if (strcmp(Name, "fontIndex") == 0) fontIndex = atoi(Value); else if (strcmp(Name, "fontIndex") == 0) fontIndex = atoi(Value);
else if (strcmp(Name, "FontButtonDelta") == 0) FontButtonDelta = atoi(Value); else if (strcmp(Name, "FontButtonDelta") == 0) FontButtonDelta = atoi(Value);
else if (strcmp(Name, "FontDetailViewDelta") == 0) FontDetailViewDelta = atoi(Value); else if (strcmp(Name, "FontDetailViewDelta") == 0) FontDetailViewDelta = atoi(Value);

View File

@ -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;
@ -58,6 +65,7 @@ class cTvguideConfig {
int channelRows; int channelRows;
int numGrids; int numGrids;
int displayTime; int displayTime;
int displayHorizontalTime;
int displayStatusHeader; int displayStatusHeader;
int displayChannelGroups; int displayChannelGroups;
int displayTimeBase; int displayTimeBase;
@ -74,10 +82,14 @@ 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 timerMessage;
int addSubtitleToTimer;
int closeOnSwitch; int closeOnSwitch;
int numkeyMode; int numkeyMode;
int useRemoteTimers; int useRemoteTimers;
@ -118,6 +130,8 @@ class cTvguideConfig {
int favLimitChannels; int favLimitChannels;
int favStartChannel; int favStartChannel;
int favStopChannel; int favStopChannel;
int switchMode;
int switchMinsBefore;
int fontIndex; int fontIndex;
const char *fontNameDefault; const char *fontNameDefault;
int FontButtonDelta; int FontButtonDelta;
@ -146,6 +160,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;
@ -172,7 +187,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;
@ -180,7 +195,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;

View File

@ -1,32 +1,39 @@
#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
LOCK_CHANNELS_READ;
footer->LeaveDetailedViewMode(Channels->GetByChannelID(event->ChannelID()));
#else
footer->LeaveDetailedViewMode(Channels.GetByChannelID(event->ChannelID())); footer->LeaveDetailedViewMode(Channels.GetByChannelID(event->ChannelID()));
#endif
if (view) if (view)
delete view; delete view;
} }
void cDetailView::InitiateView(void) { void cDetailView::InitiateView(void) {
static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr"); static cPlugin *pScraper = GetScraperPlugin();
ScraperGetEventType call; ScraperGetEventType call;
if (!event) if (!event)
return; return;
call.event = event; call.event = event;
if (!pScraper2Vdr) { if (!pScraper) {
view = new cEPGView(); view = new cEPGView();
} else if (pScraper2Vdr->Service("GetEventType", &call)) { } else if (pScraper->Service("GetEventType", &call)) {
if (call.type == tMovie) { if (call.type == tMovie) {
view = new cMovieView(call.movieId); view = new cMovieView(call.movieId);
} else if (call.type == tSeries) { } else if (call.type == tSeries) {
view = new cSeriesView(call.seriesId, call.episodeId); view = new cSeriesView(call.seriesId, call.episodeId);
} else {
view = new cEPGView();
} }
} else { } else {
view = new cEPGView(); view = new cEPGView();
@ -42,7 +49,12 @@ void cDetailView::InitiateView(void) {
dateTime = cString::sprintf("%s %s - %s (%d %s)", *event->GetDateString(), *event->GetTimeString(), *event->GetEndTimeString(), event->Duration()/60, tr("min")); dateTime = cString::sprintf("%s %s - %s (%d %s)", *event->GetDateString(), *event->GetTimeString(), *event->GetEndTimeString(), event->Duration()/60, tr("min"));
} }
view->SetDateTime(*dateTime); view->SetDateTime(*dateTime);
#if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ;
view->SetChannel(Channels->GetByChannelID(event->ChannelID(), true));
#else
view->SetChannel(Channels.GetByChannelID(event->ChannelID(), true)); view->SetChannel(Channels.GetByChannelID(event->ChannelID(), true));
#endif
view->SetEventID(event->EventID()); view->SetEventID(event->EventID());
view->SetEvent(event); view->SetEvent(event);
} }
@ -64,8 +76,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();
} }
@ -85,12 +97,17 @@ 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++;
sstrReruns << *DayDateTime(r->event->StartTime()); sstrReruns << *DayDateTime(r->event->StartTime());
#if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ;
const cChannel *channel = Channels->GetByChannelID(r->event->ChannelID(), true, true);
#else
cChannel *channel = Channels.GetByChannelID(r->event->ChannelID(), true, true); cChannel *channel = Channels.GetByChannelID(r->event->ChannelID(), true, true);
#endif
if (channel) { if (channel) {
sstrReruns << ", " << trVDR("Channel") << " " << channel->Number() << ":"; sstrReruns << ", " << trVDR("Channel") << " " << channel->Number() << ":";
sstrReruns << " " << channel->ShortName(true); sstrReruns << " " << channel->ShortName(true);
@ -132,14 +149,14 @@ eOSState cDetailView::ProcessKey(eKeys Key) {
bool scrolled = view->KeyUp(); bool scrolled = view->KeyUp();
if (scrolled) { if (scrolled) {
view->DrawScrollbar(); view->DrawScrollbar();
osdManager.flush(); osdManager.Flush();
} }
break; } break; }
case kDown: { case kDown: {
bool scrolled = view->KeyDown(); bool scrolled = view->KeyDown();
if (scrolled) { if (scrolled) {
view->DrawScrollbar(); view->DrawScrollbar();
osdManager.flush(); osdManager.Flush();
} }
break; } break; }
case kLeft: case kLeft:

View File

@ -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,31 +27,31 @@ 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() ) {
y0 += (StartTime() - column->Start())/60*geoManager.minutePixel; y0 += (StartTime() - column->Start())/60*geoManager.minutePixel;
} }
if (!pixmap) { if (!pixmap) {
pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, geoManager.colWidth, viewportHeight)); pixmap = osdManager.CreatePixmap(-1, cRect(x0, y0, geoManager.colWidth, viewportHeight));
} else if (dirty) { } else if (dirty) {
osdManager.releasePixmap(pixmap); osdManager.DestroyPixmap(pixmap);
pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, geoManager.colWidth, viewportHeight)); pixmap = osdManager.CreatePixmap(-1, cRect(x0, y0, geoManager.colWidth, viewportHeight));
} 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() ) {
x0 += (StartTime() - column->Start())/60*geoManager.minutePixel; x0 += (StartTime() - column->Start())/60*geoManager.minutePixel;
} }
if (!pixmap) { if (!pixmap) {
pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, viewportHeight, geoManager.rowHeight)); pixmap = osdManager.CreatePixmap(-1, cRect(x0, y0, viewportHeight, geoManager.rowHeight));
} else if (dirty) { } else if (dirty) {
osdManager.releasePixmap(pixmap); osdManager.DestroyPixmap(pixmap);
pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, viewportHeight, geoManager.rowHeight)); pixmap = osdManager.CreatePixmap(-1, cRect(x0, y0, viewportHeight, geoManager.rowHeight));
} else { } else {
pixmap->SetViewPort(cRect(x0, y0, viewportHeight, geoManager.rowHeight)); pixmap->SetViewPort(cRect(x0, y0, viewportHeight, geoManager.rowHeight));
} }
@ -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);

View File

@ -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);

140
epggrid.c
View File

@ -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;
@ -20,9 +20,9 @@ cEpgGrid::~cEpgGrid(void) {
void cEpgGrid::SetViewportHeight() { void cEpgGrid::SetViewportHeight() {
int viewportHeightOld = viewportHeight; int viewportHeightOld = viewportHeight;
if ( column->Start() > StartTime() ) { if ( column->Start() > StartTime() ) {
viewportHeight = (min((int)EndTime(), column->Stop()) - column->Start()) /60; viewportHeight = (std::min((int)EndTime(), column->Stop()) - column->Start()) / 60;
} else if ( column->Stop() < EndTime() ) { } else if ( column->Stop() < EndTime() ) {
viewportHeight = (column->Stop() - StartTime()) /60; viewportHeight = (column->Stop() - StartTime()) / 60;
if (viewportHeight < 0) viewportHeight = 0; if (viewportHeight < 0) viewportHeight = 0;
} else { } else {
viewportHeight = Duration() / 60; viewportHeight = Duration() / 60;
@ -33,28 +33,27 @@ void cEpgGrid::SetViewportHeight() {
} }
void cEpgGrid::PositionPixmap() { void cEpgGrid::PositionPixmap() {
int x0, y0; if (config.displayMode == eVertical) {
if (tvguideConfig.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() ) {
y0 += (StartTime() - column->Start())/60*geoManager.minutePixel; y0 += (StartTime() - column->Start()) / 60 * geoManager.minutePixel;
} }
if (!pixmap) { if (!pixmap) {
pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, geoManager.colWidth, viewportHeight), pixmap = osdManager.CreatePixmap(-1, cRect(x0, y0, geoManager.colWidth, viewportHeight),
cRect(0, 0, geoManager.colWidth, Duration()/60*geoManager.minutePixel)); cRect(0, 0, geoManager.colWidth, Duration() / 60 * geoManager.minutePixel));
} 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() ) {
x0 += (StartTime() - column->Start())/60*geoManager.minutePixel; x0 += (StartTime() - column->Start()) / 60 * geoManager.minutePixel;
} }
if (!pixmap) { if (!pixmap) {
pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, viewportHeight, geoManager.rowHeight), pixmap = osdManager.CreatePixmap(-1, cRect(x0, y0, viewportHeight, geoManager.rowHeight),
cRect(0, 0, Duration()/60*geoManager.minutePixel, geoManager.rowHeight)); cRect(0, 0, Duration() / 60 * geoManager.minutePixel, geoManager.rowHeight));
} else { } else {
pixmap->SetViewPort(cRect(x0, y0, viewportHeight, geoManager.rowHeight )); pixmap->SetViewPort(cRect(x0, y0, viewportHeight, geoManager.rowHeight ));
} }
@ -63,17 +62,23 @@ void cEpgGrid::PositionPixmap() {
} }
void cEpgGrid::SetTimer() { void cEpgGrid::SetTimer() {
if (tvguideConfig.useRemoteTimers && pRemoteTimers) { hasTimer = false;
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))
hasTimer = true; hasTimer = true;
else #if VDRVERSNUM >= 20301
hasTimer = false; } else {
eTimerMatch TimerMatch = tmNone;
LOCK_TIMERS_READ;
const cTimers *timers = Timers;
if (timers->GetMatch(event, &TimerMatch) && (TimerMatch == tmFull))
hasTimer = true;
#else
} else if (column->HasTimer()) { } else if (column->HasTimer()) {
hasTimer = event->HasTimer(); hasTimer = event->HasTimer();
} else { #endif
hasTimer = false;
} }
} }
@ -86,72 +91,95 @@ 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);
} }
if (hasSwitchTimer) if (hasSwitchTimer)
drawIcon("Switch", theme.Color(clrButtonYellow)); drawIcon("Switch", theme.Color(clrButtonYellow));
if (hasTimer) if (hasTimer) {
const cTimer *timer = NULL;
#if VDRVERSNUM >= 20301
{
LOCK_TIMERS_READ;
timer = Timers->GetMatch(event);
}
#else
timer = Timers.GetMatch(event);
#endif
if (timer)
#ifdef SWITCHONLYPATCH
if (timer->HasFlags(tfSwitchOnly))
drawIcon("Switch", theme.Color(clrButtonYellow));
else if (timer->HasFlags(tfActive))
#else /* SWITCHONLY */
if (timer->HasFlags(tfActive))
#endif /* SWITCHONLY */
drawIcon("REC", theme.Color(clrButtonRed)); drawIcon("REC", theme.Color(clrButtonRed));
else
drawIcon("REC", theme.Color(clrButtonGreen));
}
} }
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) {

View File

@ -2,12 +2,13 @@
#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 cEvent *event; const cEvent *event;
cTextWrapper *extText; cTextWrapper *extText;
cString timeString; cString timeString;
@ -15,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();

View File

@ -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);

View File

@ -8,7 +8,7 @@ cFooter::cFooter(cChannelGroups *channelGroups) {
currentGroup = -1; currentGroup = -1;
buttonY = (geoManager.footerHeight - geoManager.buttonHeight)/2; buttonY = (geoManager.footerHeight - geoManager.buttonHeight)/2;
SetButtonPositions(); SetButtonPositions();
footer = osdManager.requestPixmap(2, cRect( 0, footer = osdManager.CreatePixmap(2, cRect( 0,
geoManager.footerY, geoManager.footerY,
geoManager.osdWidth, geoManager.osdWidth,
geoManager.footerHeight), geoManager.footerHeight),
@ -17,7 +17,7 @@ cFooter::cFooter(cChannelGroups *channelGroups) {
} }
cFooter::~cFooter(void) { cFooter::~cFooter(void) {
osdManager.releasePixmap(footer); osdManager.DestroyPixmap(footer);
} }
void cFooter::drawRedButton() { void cFooter::drawRedButton() {
@ -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);

View File

@ -20,50 +20,52 @@ 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;
clockWidth = tvFrameWidth / 3; footerHeight = config.footerHeightPercent * osdHeight / 100;
clockHeight = timeLineHeight;
footerHeight = tvguideConfig.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; dateVieverHeight = (channelHeaderHeight + channelGroupsHeight) * 2 / 3;
} else if (tvguideConfig.displayMode == eHorizontal) { clockWidth = dateVieverWidth;
clockHeight = (channelHeaderHeight + channelGroupsHeight) - dateVieverHeight;
} 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.displayTime; 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;
dateVieverWidth = channelHeaderWidth + channelGroupsWidth; dateVieverWidth = (channelHeaderWidth + channelGroupsWidth) * 3 / 5;
dateVieverHeight = timeLineHeight; dateVieverHeight = timeLineHeight;
clockWidth = (channelHeaderWidth + channelGroupsWidth) - dateVieverWidth;
clockHeight = timeLineHeight;
} }
buttonBorder = footerHeight / 6; buttonBorder = footerHeight / 6;
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;

View File

@ -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

58
grid.h
View File

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

View File

@ -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()) );
} }

58
gridelement.h Normal file
View File

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

View File

@ -2,33 +2,33 @@
#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;
} }
cHeaderGrid::~cHeaderGrid(void) { cHeaderGrid::~cHeaderGrid(void) {
osdManager.releasePixmap(pixmapLogo); osdManager.DestroyPixmap(pixmapLogo);
} }
void cHeaderGrid::createBackground(int num) { 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;
} }
pixmap = osdManager.requestPixmap(1, cRect(x, y, geoManager.channelLogoWidth, geoManager.channelLogoHeight)); pixmap = osdManager.CreatePixmap(1, cRect(x, y, geoManager.channelLogoWidth, geoManager.channelLogoHeight));
pixmapLogo = osdManager.requestPixmap(2, cRect(x, y, geoManager.channelLogoWidth, geoManager.channelLogoHeight)); pixmapLogo = osdManager.CreatePixmap(2, cRect(x, y, geoManager.channelLogoWidth, geoManager.channelLogoHeight));
if ((!pixmap) || (!pixmapLogo)){ if ((!pixmap) || (!pixmapLogo)){
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,23 +37,27 @@ 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);
} }
} }
// Draw Channel horizontal view
void cHeaderGrid::drawChannelHorizontal(const cChannel *channel) { void cHeaderGrid::drawChannelHorizontal(const cChannel *channel) {
int logoWidth = geoManager.logoWidth; int logoWidth = geoManager.logoWidth;
int logoX = tvguideConfig.displayChannelName?2:(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) {
pixmapLogo->DrawImage(cPoint(logoX, 0), *logo); const int logoheight = logo->Height();
const int logowidth = logo->Width();
pixmapLogo->DrawImage(cPoint(logoX + ((logoWidth - logowidth) / 2), (Height() - logoheight) / 2), *logo);
logoFound = true; logoFound = true;
} }
} }
@ -61,63 +65,67 @@ void cHeaderGrid::drawChannelHorizontal(const cChannel *channel) {
int textWidthMax = Width() - 10; int textWidthMax = Width() - 10;
if (!logoFound) { if (!logoFound) {
drawText = true; drawText = true;
} else if (tvguideConfig.displayChannelName) { }
if (config.displayChannelName) {
drawText = true; drawText = true;
textX += logoWidth; textX += logoWidth + 5;
textWidthMax -= logoWidth; 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);
} }
} }
// Draw Channel vertical view
void cHeaderGrid::drawChannelVertical(const cChannel *channel) { void cHeaderGrid::drawChannelVertical(const cChannel *channel) {
int logoWidth = geoManager.logoWidth;
int logoHeight = geoManager.logoHeight; int logoHeight = geoManager.logoHeight;
cTextWrapper tw; cTextWrapper tw;
cString headerText = cString::sprintf("%d - %s", channel->Number(), channel->Name()); cString headerText = cString::sprintf("%d - %s", channel->Number(), channel->Name());
tw.Set(*headerText, fontManager.FontChannelHeader, geoManager.colWidth - 8); tw.Set(*headerText, fontManager.FontChannelHeader, geoManager.colWidth - 8);
int lines = tw.Lines(); int lines = tw.Lines();
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, 4), *logo); const int logoheight = logo->Height();
const int logowidth = logo->Width();
pixmapLogo->DrawImage(cPoint((Width() - logowidth) / 2, (logoHeight - logoheight) / 2), *logo);
logoFound = true; logoFound = true;
} }
} }
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;
if (xText < 0) if (xText < 0)
xText = 0; xText = 0;
pixmap->DrawText(cPoint(xText, yStart + i*lineHeight), tw.GetLine(i), theme.Color(clrFontHeader), colorTextBack, fontManager.FontChannelHeader); pixmap->DrawText(cPoint(xText, yStart + i * lineHeight), tw.GetLine(i), theme.Color(clrFontHeader), colorTextBack, fontManager.FontChannelHeader);
} }
} }
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;

View File

@ -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);

View File

@ -28,25 +28,25 @@ 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();
int startNext = cTimeMs::Now(); int startNext = cTimeMs::Now();
CreateOsdIconCache(); CreateOsdIconCache();
esyslog("tvguide: Osd Icon Cash created in %d ms", int(cTimeMs::Now()-startNext)); esyslog("tvguide: Osd Icon Cache created in %d ms", int(cTimeMs::Now()-startNext));
startNext = cTimeMs::Now(); startNext = cTimeMs::Now();
PrepareGridIconCache(); PrepareGridIconCache();
CreateGridIconCache(); CreateGridIconCache();
esyslog("tvguide: Grid Icon Cash created in %d ms", int(cTimeMs::Now()-startNext)); esyslog("tvguide: Grid Icon Cache created in %d ms", int(cTimeMs::Now()-startNext));
startNext = cTimeMs::Now(); startNext = cTimeMs::Now();
CreateChannelGroupCache(); CreateChannelGroupCache();
esyslog("tvguide: Channelgroup Cash created in %d ms", int(cTimeMs::Now()-startNext)); esyslog("tvguide: Channelgroup Cache created in %d ms", int(cTimeMs::Now()-startNext));
startNext = cTimeMs::Now(); startNext = cTimeMs::Now();
CreateLogoCache(); CreateLogoCache();
esyslog("tvguide: Logo Cash created in %d ms", int(cTimeMs::Now()-startNext)); esyslog("tvguide: Logo Cache created in %d ms", int(cTimeMs::Now()-startNext));
startNext = cTimeMs::Now(); startNext = cTimeMs::Now();
esyslog("tvguide: Complete Image Cash created in %d ms", int(cTimeMs::Now()-start)); esyslog("tvguide: Complete Image Cache created in %d ms", int(cTimeMs::Now()-start));
} }
void cImageCache::CreateOsdIconCache(void) { void cImageCache::CreateOsdIconCache(void) {
@ -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,12 +276,17 @@ 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
LOCK_CHANNELS_READ;
for (const cChannel *channel = Channels->First(); channel; channel = Channels->Next(channel)) {
#else
for (const cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) { for (const cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) {
if (channelsCached >= tvguideConfig.numLogosInitial) #endif
if (channelsCached >= config.numLogosInitial)
break; break;
if (!channel->GroupSep()) { if (!channel->GroupSep()) {
bool success = LoadLogo(channel); bool success = LoadLogo(channel);
@ -346,13 +351,13 @@ cImage *cImageCache::GetLogo(const cChannel *channel) {
} else { } else {
bool success = LoadLogo(channel); bool success = LoadLogo(channel);
if (success) { if (success) {
if ((tvguideConfig.limitLogoCache) && (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;
tempStaticLogo = NULL; tempStaticLogo = NULL;
} }
tempStaticLogo = CreateImage(geoManager.logoWidth, geoManager.logoHeight); tempStaticLogo = CreateImage(geoManager.logoWidth * 0.8, geoManager.logoHeight * 0.8);
return tempStaticLogo; return tempStaticLogo;
} else { } else {
//add requested logo to cache //add requested logo to cache
@ -398,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);
@ -455,7 +460,7 @@ void cImageCache::AddCornersHorizontal(cImage *img, bool active) {
} }
if (!cornerLeft || !cornerRight) if (!cornerLeft || !cornerRight)
return; return;
int maxX = min(cornerWidth, imgWidth); int maxX = std::min(cornerWidth, imgWidth);
for (int row = 0; row < cornerHeight; row++) { for (int row = 0; row < cornerHeight; row++) {
for (int col = 0; col < maxX; ++col) { for (int col = 0; col < maxX; ++col) {
img->SetPixel(cPoint(col, row), cornerLeft->GetPixel(cPoint(col, row))); img->SetPixel(cPoint(col, row), cornerLeft->GetPixel(cPoint(col, row)));
@ -477,7 +482,7 @@ void cImageCache::AddCornersVertical(cImage *img, bool active) {
} }
if (!cornerHead || !cornerBottom) if (!cornerHead || !cornerBottom)
return; return;
int maxY = min(cornerHeight, imgHeight); int maxY = std::min(cornerHeight, imgHeight);
for (int row = 0; row < maxY; row++) { for (int row = 0; row < maxY; row++) {
for (int col = 0; col < cornerWidth; ++col) { for (int col = 0; col < cornerWidth; ++col) {
img->SetPixel(cPoint(col, row), cornerHead->GetPixel(cPoint(col, row))); img->SetPixel(cPoint(col, row), cornerHead->GetPixel(cPoint(col, row)));
@ -522,7 +527,7 @@ void cImageCache::AddCornersGroupHorizontal(cImage *img) {
int imgWidth = img->Width(); int imgWidth = img->Width();
int imgHeight = img->Height(); int imgHeight = img->Height();
int heightHeadBottom = groupsHead->Height(); int heightHeadBottom = groupsHead->Height();
int maxY = min(heightHeadBottom, imgHeight); int maxY = std::min(heightHeadBottom, imgHeight);
for (int row = 0; row < maxY; row++) { for (int row = 0; row < maxY; row++) {
for (int col = 0; col < imgWidth; ++col) { for (int col = 0; col < imgWidth; ++col) {
img->SetPixel(cPoint(col, row), groupsHead->GetPixel(cPoint(col, row))); img->SetPixel(cPoint(col, row), groupsHead->GetPixel(cPoint(col, row)));
@ -537,7 +542,7 @@ void cImageCache::AddCornersGroupVertical(cImage *img) {
int imgWidth = img->Width(); int imgWidth = img->Width();
int imgHeight = img->Height(); int imgHeight = img->Height();
int widthLeftRight = groupsLeft->Width(); int widthLeftRight = groupsLeft->Width();
int maxX = min(widthLeftRight, imgWidth); int maxX = std::min(widthLeftRight, imgWidth);
for (int row = 0; row < imgHeight; row++) { for (int row = 0; row < imgHeight; row++) {
for (int col = 0; col < maxX; ++col) { for (int col = 0; col < maxX; ++col) {
img->SetPixel(cPoint(col, row), groupsLeft->GetPixel(cPoint(col, row))); img->SetPixel(cPoint(col, row), groupsLeft->GetPixel(cPoint(col, row)));
@ -548,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;
} }
@ -582,29 +587,29 @@ 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;
} }
void cImageCache::InsertIntoLogoCache(std::string channelID) { void cImageCache::InsertIntoLogoCache(std::string channelID) {
cImage *image = CreateImage(geoManager.logoWidth, geoManager.logoHeight); cImage *image = CreateImage(geoManager.logoWidth * 0.8, geoManager.logoHeight * 0.8);
logoCache.insert(std::pair<std::string, cImage*>(channelID, image)); logoCache.insert(std::pair<std::string, cImage*>(channelID, image));
} }

View File

@ -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)
@ -173,7 +172,7 @@ void cImageLoader::CreateGradient(tColor back, tColor blend, int width, int heig
for (int x = 0; x < width; x++) { for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) { for (int y = 0; y < height; y++) {
PixelPacket *pixel = pixels + y * width + x; PixelPacket *pixel = pixels + y * width + x;
int opacity = (maxw / width * x + maxh - maxh / height * y) / 2; unsigned int opacity = (maxw / width * x + maxh - maxh / height * y) / 2;
pixel->opacity = (opacity <= MaxRGB) ? opacity : MaxRGB; pixel->opacity = (opacity <= MaxRGB) ? opacity : MaxRGB;
} }
} }

View File

@ -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;
} }
@ -145,7 +144,7 @@ void cImageMagickWrapper::CreateGradient(tColor back, tColor blend, int width, i
for (int x = 0; x < width; x++) { for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) { for (int y = 0; y < height; y++) {
PixelPacket *pixel = pixels + y * width + x; PixelPacket *pixel = pixels + y * width + x;
int opacity = (maxw / width * x + maxh - maxh / height * y) / 2; unsigned int opacity = (maxw / width * x + maxh - maxh / height * y) / 2;
pixel->opacity = (opacity <= MaxRGB) ? opacity : MaxRGB; pixel->opacity = (opacity <= MaxRGB) ? opacity : MaxRGB;
} }
} }

View File

@ -2,12 +2,21 @@
#include "osdmanager.h" #include "osdmanager.h"
cOsdManager::cOsdManager(void) { cOsdManager::cOsdManager(void) {
osd = NULL;
} }
bool cOsdManager::setOsd() { void cOsdManager::Lock(void) {
mutex.Lock();
}
void cOsdManager::Unlock(void) {
mutex.Unlock();
}
bool cOsdManager::CreateOsd(void) {
osd = cOsdProvider::NewOsd(cOsd::OsdLeft(), cOsd::OsdTop()); osd = cOsdProvider::NewOsd(cOsd::OsdLeft(), cOsd::OsdTop());
if (osd) { if (osd) {
tArea Area = { 0, 0, cOsd::OsdWidth(), cOsd::OsdHeight(), 32 }; tArea Area = { 0, 0, cOsd::OsdWidth() - 1, cOsd::OsdHeight() - 1, 32 };
if (osd->SetAreas(&Area, 1) == oeOk) { if (osd->SetAreas(&Area, 1) == oeOk) {
return true; return true;
} }
@ -15,9 +24,16 @@ bool cOsdManager::setOsd() {
return false; return false;
} }
void cOsdManager::setBackground() { void cOsdManager::DeleteOsd(void) {
Lock();
delete osd;
osd = NULL;
Unlock();
}
if (tvguideConfig.displayStatusHeader && tvguideConfig.scaleVideo) { void cOsdManager::SetBackground(void) {
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));
@ -27,12 +43,20 @@ void cOsdManager::setBackground() {
} }
cPixmap *cOsdManager::requestPixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort) { cPixmap *cOsdManager::CreatePixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort) {
if (osd)
return osd->CreatePixmap(Layer, ViewPort, DrawPort); return osd->CreatePixmap(Layer, ViewPort, DrawPort);
return NULL;
} }
void cOsdManager::releasePixmap(cPixmap *pixmap) { void cOsdManager::DestroyPixmap(cPixmap *pixmap) {
if (!pixmap) if (!osd || !pixmap)
return; return;
osd->DestroyPixmap(pixmap); osd->DestroyPixmap(pixmap);
} }
void cOsdManager::Flush(void) {
if (osd) {
osd->Flush();
}
}

View File

@ -4,20 +4,23 @@
#include <vdr/osd.h> #include <vdr/osd.h>
class cOsdManager { class cOsdManager {
private: private:
cOsd *osd; cOsd *osd;
public: cMutex mutex;
public:
cOsdManager(void); cOsdManager(void);
bool setOsd(); void Lock(void);
void setBackground(); void Unlock(void);
void flush() {osd->Flush();}; bool CreateOsd(void);
cPixmap *requestPixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort = cRect::Null); void DeleteOsd(void);
void releasePixmap(cPixmap *pixmap); void SetBackground(void);
void deleteOsd() {delete osd;}; cPixmap *CreatePixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort = cRect::Null);
int Width() { return osd->Width(); }; void DestroyPixmap(cPixmap *pixmap);
int Height() { return osd->Height(); }; void Flush(void);
int Top() { return osd->Top(); }; int Width(void) { return osd->Width(); };
int Left() { return osd->Left(); }; int Height(void) { return osd->Height(); };
int Top(void) { return osd->Top(); };
int Left(void) { return osd->Left(); };
}; };
#endif //__TVGUIDE_OSDMANAGER_H #endif //__TVGUIDE_OSDMANAGER_H

View File

@ -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: 2014-05-10 17:24+0200\n" "POT-Creation-Date: 2022-04-29 16:05+0200\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"
@ -25,7 +25,7 @@ msgid "min"
msgstr "min" msgstr "min"
msgid "Reruns of " msgid "Reruns of "
msgstr "" msgstr "Reemissions "
msgid "No reruns found" msgid "No reruns found"
msgstr "" msgstr ""
@ -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"
@ -72,6 +75,15 @@ msgstr "tots els canals"
msgid "unknown channel" msgid "unknown channel"
msgstr "canal desconegut" msgstr "canal desconegut"
msgid "with"
msgstr ""
msgid "errors"
msgstr ""
msgid "error"
msgstr ""
msgid "Duration" msgid "Duration"
msgstr "Durada" msgstr "Durada"
@ -99,21 +111,18 @@ 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"
msgid "Delete Timer" msgid "Timer On/Off"
msgstr "Esborra temporitzador" msgstr "Temporitzador On/Off"
msgid "Edit Timer" msgid "Edit Timer"
msgstr "Edita temporitzador" msgstr "Edita temporitzador"
msgid "Delete Timer"
msgstr "Esborra temporitzador"
msgid "Timer Timeline" msgid "Timer Timeline"
msgstr "" msgstr ""
@ -144,6 +153,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"
@ -168,14 +180,14 @@ msgstr "Sí"
msgid "No" msgid "No"
msgstr "No" msgstr "No"
msgid "One" msgid "Timer Conflicts"
msgstr "Un" msgstr "Conflicte al temporitzador"
msgid "detected" msgid "detected"
msgstr "detectat" msgstr "detectat"
msgid "Timer Conflicts" msgid "Ignore Conflicts"
msgstr "Conflicte al temporitzador" msgstr "Ignora conflictes"
msgid "Show conflict" msgid "Show conflict"
msgstr "Mostra conflicte" msgstr "Mostra conflicte"
@ -183,9 +195,6 @@ msgstr "Mostra conflicte"
msgid "timers involved" msgid "timers involved"
msgstr "temporitzadors involucrats" msgstr "temporitzadors involucrats"
msgid "Ignore Conflicts"
msgstr "Ignora conflictes"
msgid "Ignore Conflict" msgid "Ignore Conflict"
msgstr "Ignora conflicte" msgstr "Ignora conflicte"
@ -216,6 +225,12 @@ msgstr ""
msgid "replaced by rerun" msgid "replaced by rerun"
msgstr "" msgstr ""
msgid "Save"
msgstr "Desa"
msgid "Cancel"
msgstr "Cancel·la"
msgid "Timer Active" msgid "Timer Active"
msgstr "Temporitzador actiu" msgstr "Temporitzador actiu"
@ -240,14 +255,11 @@ msgstr ""
msgid "New Folder" msgid "New Folder"
msgstr "" msgstr ""
msgid "Save" msgid "Create Series Timer based on:"
msgstr "Desa" msgstr "Programa enregistrament de Sèries segons:"
msgid "Cancel" msgid "Create Timer"
msgstr "Cancel·la" msgstr "Crea temporitzador"
msgid "Create Series Timer based on"
msgstr "Programa enregistrament de Sèries segons"
msgid "Series Timer start time" msgid "Series Timer start time"
msgstr "Inici temporitzador Sèries" msgstr "Inici temporitzador Sèries"
@ -261,9 +273,6 @@ msgstr "Dies a enregistrar"
msgid "Day to start" msgid "Day to start"
msgstr "Dia d'inici" msgstr "Dia d'inici"
msgid "Create Timer"
msgstr "Crea temporitzador"
msgid "Series Timer created" msgid "Series Timer created"
msgstr "Sèrie programada" msgstr "Sèrie programada"
@ -273,17 +282,17 @@ msgstr "Inici"
msgid "Stop" msgid "Stop"
msgstr "Final" msgstr "Final"
msgid "Configure Search Timer based on" msgid "Configure Search Timer based on:"
msgstr "Configura cerca de temporitzadors segons" msgstr "Configura cerca de temporitzadors segons:"
msgid "Search Expression:"
msgstr "Cerca expressió:"
msgid "Continue" msgid "Continue"
msgstr "Continua" msgstr "Continua"
msgid "Configure Search Timer for Search String" msgid "Search Expression:"
msgstr "Configura cerca de temporitzadors amb text" msgstr "Cerca expressió:"
msgid "Configure Search Timer for Search String:"
msgstr "Configura cerca de temporitzadors amb text:"
msgid "Manually configure Options" msgid "Manually configure Options"
msgstr "Opcions de configuració manual" msgstr "Opcions de configuració manual"
@ -303,79 +312,106 @@ msgstr ""
msgid "Save Search Timer" msgid "Save Search Timer"
msgstr "" msgstr ""
msgid "Search String" msgid "Search term"
msgstr "" msgstr ""
msgid "Active" msgid "Active"
msgstr "" msgstr ""
msgid "Search Mode" msgid "Search mode"
msgstr "Mode de cerca" msgstr ""
msgid "Use Title" msgid "Tolerance"
msgstr ""
msgid "Match case"
msgstr ""
msgid "Use title"
msgstr "Utilitza títol" msgstr "Utilitza títol"
msgid "Use Subtitle" msgid "Use subtitle"
msgstr "Utilitza subtítol" msgstr "Utilitza subtítol"
msgid "Use Description" msgid "Use description"
msgstr "Utilitza descripció" msgstr "Utilitza descripció"
msgid "Limit Channels" msgid "Use channel"
msgstr "Canals restringits" msgstr "Canals restringits"
msgid "Use Time" msgid "from channel"
msgstr "Utilitza temps"
msgid "Display advanced Options"
msgstr ""
msgid "Limit Days of the Week"
msgstr ""
msgid "Time margin for start in minutes"
msgstr ""
msgid "Time margin for stop in minutes"
msgstr ""
msgid "Series Recording"
msgstr ""
msgid "Folder"
msgstr ""
msgid "Use VPS"
msgstr ""
msgid "Avoid Repeats"
msgstr ""
msgid "Use in Favorites"
msgstr ""
msgid "Hide advanced Options"
msgstr ""
msgid "Display Results for Search Timer"
msgstr "Mostra resultats de la cerca"
msgid "Start Channel"
msgstr "Inicia canal" msgstr "Inicia canal"
msgid "Stop Channel" msgid "to channel"
msgstr "Atura canal" msgstr "Atura canal"
msgid "Channel group"
msgstr ""
msgid "Use time"
msgstr "Utilitza temps"
msgid "Start after" msgid "Start after"
msgstr "Comença després" msgstr "Comença després"
msgid "Start before" msgid "Start before"
msgstr "Comença abans" msgstr "Comença abans"
msgid "Select Days" msgid "Use duration"
msgstr "Utilitza Durada"
msgid "Min. duration"
msgstr "" msgstr ""
msgid "Number of allowed repeats" msgid "Max. duration"
msgstr ""
msgid "Use day of week"
msgstr ""
msgid "Day of week"
msgstr ""
msgid "Use in Favorites"
msgstr ""
msgid "Use as search timer"
msgstr ""
msgid "Action"
msgstr ""
msgid "Switch ... minutes before start"
msgstr ""
msgid "Unmute sound"
msgstr ""
msgid "Ask ... minutes before start"
msgstr ""
msgid "Series Recording"
msgstr ""
msgid "Directory"
msgstr ""
msgid "Delete recordings after ... days"
msgstr ""
msgid "Keep ... recordings"
msgstr ""
msgid "Pause when ... recordings exist"
msgstr ""
msgid "Avoid Repeats"
msgstr ""
msgid "Allowed repeats"
msgstr ""
msgid "Only repeats within ... days"
msgstr "" msgstr ""
msgid "Compare Title" msgid "Compare Title"
@ -387,6 +423,33 @@ msgstr ""
msgid "Compare Description" msgid "Compare Description"
msgstr "" msgstr ""
msgid "Min. match in %"
msgstr ""
msgid "Compare date"
msgstr ""
msgid "Time margin for start in minutes"
msgstr ""
msgid "Time margin for stop in minutes"
msgstr ""
msgid "Use VPS"
msgstr ""
msgid "Auto delete"
msgstr ""
msgid "after ... recordings"
msgstr ""
msgid "after ... days after first rec."
msgstr ""
msgid "Display Results for Search Timer"
msgstr "Mostra resultats de la cerca"
msgid "Really delete Search Timer" msgid "Really delete Search Timer"
msgstr "" msgstr ""
@ -396,7 +459,7 @@ msgstr ""
msgid "Delete Search Timer and created Timers" msgid "Delete Search Timer and created Timers"
msgstr "" msgstr ""
msgid "Search Timer sucessfully created." msgid "Search Timer sucessfully created"
msgstr "S'ha creat cerca de temporitzador" msgstr "S'ha creat cerca de temporitzador"
msgid "Search Timer update initialised" msgid "Search Timer update initialised"
@ -420,12 +483,12 @@ msgstr "Utilitza una altra plantilla"
msgid "search results for Favorite" msgid "search results for Favorite"
msgstr "" msgstr ""
msgid "search result for Favorite"
msgstr ""
msgid "search results for Search Timer" msgid "search results for Search Timer"
msgstr "cerca resultats per temporitzador" msgstr "cerca resultats per temporitzador"
msgid "search result for Favorite"
msgstr ""
msgid "search result for Search Timer" msgid "search result for Search Timer"
msgstr "cerca resultat per temporitzador" msgstr "cerca resultat per temporitzador"
@ -435,8 +498,8 @@ msgstr "No s'ha trobat la cadena de text"
msgid "Configure Options for Switchtimer" msgid "Configure Options for Switchtimer"
msgstr "Opcions de configuració de canvi de temporitzador" msgstr "Opcions de configuració de canvi de temporitzador"
msgid "Minutes before switching" msgid "Create"
msgstr "Minuts abans del canvi" msgstr "Crea"
msgid "switch" msgid "switch"
msgstr "canvia" msgstr "canvia"
@ -447,12 +510,12 @@ msgstr "només anunci"
msgid "ask for switch" msgid "ask for switch"
msgstr "pregunta pel canvi" msgstr "pregunta pel canvi"
msgid "Minutes before switching"
msgstr "Minuts abans del canvi"
msgid "Switch Mode" msgid "Switch Mode"
msgstr "Mode de canvi" msgstr "Mode de canvi"
msgid "Create"
msgstr "Crea"
msgid "Switch Timer sucessfully created" msgid "Switch Timer sucessfully created"
msgstr "Canvi de temporitzador creat" msgstr "Canvi de temporitzador creat"
@ -462,6 +525,12 @@ msgstr "No s'ha creat el canvi de temporitzador"
msgid "Switch Timer deleted" msgid "Switch Timer deleted"
msgstr "Canvi de temporitzador esborrat" msgstr "Canvi de temporitzador esborrat"
msgid "Perform Search"
msgstr "Realitza la cerca"
msgid "Search Mode"
msgstr "Mode de cerca"
msgid "Channel to Search" msgid "Channel to Search"
msgstr "Canal a cercar" msgstr "Canal a cercar"
@ -477,9 +546,6 @@ msgstr "Cerca a la descripció"
msgid "Show Search Options" msgid "Show Search Options"
msgstr "Mostra opcions de cerca" msgstr "Mostra opcions de cerca"
msgid "Perform Search"
msgstr "Realitza la cerca"
msgid "search results for" msgid "search results for"
msgstr "resultats de cerca per" msgstr "resultats de cerca per"
@ -495,12 +561,12 @@ msgstr ""
msgid "Found" msgid "Found"
msgstr "Trobada" msgstr "Trobada"
msgid "recording"
msgstr "gravació"
msgid "recordings" msgid "recordings"
msgstr "gravacions" msgstr "gravacions"
msgid "recording"
msgstr "gravació"
msgid "for" msgid "for"
msgstr "per" msgstr "per"
@ -510,6 +576,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"
@ -525,6 +597,57 @@ msgstr "coincidència exacta"
msgid "regular expression" msgid "regular expression"
msgstr "expressió regular" msgstr "expressió regular"
msgid "fuzzy"
msgstr ""
msgid "allow empty"
msgstr ""
msgid "Interval"
msgstr ""
msgid "Channel Group"
msgstr ""
msgid "only FTA"
msgstr ""
msgid "same day"
msgstr ""
msgid "same week"
msgstr ""
msgid "same month"
msgstr ""
msgid "Record"
msgstr ""
msgid "Announce by OSD"
msgstr ""
msgid "Switch only"
msgstr ""
msgid "Announce and switch"
msgstr ""
msgid "Announce by mail"
msgstr ""
msgid "Inactive record"
msgstr ""
msgid "no"
msgstr ""
msgid "count recordings"
msgstr ""
msgid "count days"
msgstr ""
msgid "General Settings" msgid "General Settings"
msgstr "Preferències" msgstr "Preferències"
@ -570,6 +693,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"
@ -646,7 +772,7 @@ msgid "Display time in EPG Grids"
msgstr "Mostra el temps a l'EPG" msgstr "Mostra el temps a l'EPG"
msgid "Height of Headers (Status Header and EPG View, Perc. of osd height)" msgid "Height of Headers (Status Header and EPG View, Perc. of osd height)"
msgstr "" msgstr "Alçada capçalera d'estat (% alçada OSD)"
msgid "Height of Footer (Perc. of osd height)" msgid "Height of Footer (Perc. of osd height)"
msgstr "" msgstr ""
@ -777,19 +903,49 @@ 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 "Utilitza carpetes per gravacions a l'instant"
msgid "Folder"
msgstr ""
msgid "Add episode to manual timers"
msgstr "" msgstr ""
msgid "Use Remotetimers" msgid "Use Remotetimers"
msgstr "Utilitza temporitzadors remots" msgstr "Utilitza temporitzadors remots"
msgid "Show timer confirmation messages"
msgstr ""
msgid "Favorites:"
msgstr ""
msgid "Limit channels in favorites"
msgstr ""
msgid "Start Channel"
msgstr "Inicia canal"
msgid "Stop Channel"
msgstr "Atura canal"
msgid "Use \"What's on now\" in favorites" msgid "Use \"What's on now\" in favorites"
msgstr "" msgstr ""
msgid "Use \"What's on next\" in favorites" msgid "Use \"What's on next\" in favorites"
msgstr "" msgstr ""
msgid "Use user defined time 1 in favorites" msgid "User defined times in favorites:"
msgstr ""
msgid "Use user defined time 1"
msgstr "" msgstr ""
msgid "Description" msgid "Description"
@ -798,16 +954,19 @@ msgstr ""
msgid "Time" msgid "Time"
msgstr "" msgstr ""
msgid "Use user defined time 2 in favorites" msgid "Use user defined time 2"
msgstr "" msgstr ""
msgid "Use user defined time 3 in favorites" msgid "Use user defined time 3"
msgstr "" msgstr ""
msgid "Use user defined time 4 in favorites" msgid "Use user defined time 4"
msgstr "" msgstr ""
msgid "Limit channels in favorites" msgid "Switchtimer:"
msgstr ""
msgid "Switch (x)min before start of the show"
msgstr "" msgstr ""
msgid "Create Log Messages for image loading" msgid "Create Log Messages for image loading"
@ -840,6 +999,9 @@ msgstr ""
msgid "Recording Menus Icon Cache" msgid "Recording Menus Icon Cache"
msgstr "" msgstr ""
msgid "A fancy 2d EPG Viewer"
msgstr ""
msgid "No Cast available" msgid "No Cast available"
msgstr "" msgstr ""
@ -850,7 +1012,7 @@ msgid "EPG Info"
msgstr "" msgstr ""
msgid "Reruns" msgid "Reruns"
msgstr "" msgstr "Reemissions"
msgid "Recording Information" msgid "Recording Information"
msgstr "" msgstr ""
@ -909,9 +1071,6 @@ msgstr ""
msgid "yes" msgid "yes"
msgstr "" msgstr ""
msgid "no"
msgstr ""
msgid "Adult" msgid "Adult"
msgstr "" msgstr ""

396
po/de_DE.po Executable file → Normal file
View File

@ -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: 2014-05-10 17:24+0200\n" "POT-Creation-Date: 2022-04-29 16:05+0200\n"
"PO-Revision-Date: 2012-08-25 17:49+0200\n" "PO-Revision-Date: 2012-08-25 17:49+0200\n"
"Last-Translator: Horst\n" "Last-Translator: Horst\n"
"Language-Team: \n" "Language-Team: \n"
@ -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"
@ -69,6 +72,15 @@ msgstr "alle Kanäle"
msgid "unknown channel" msgid "unknown channel"
msgstr "unbekannter Kanal" msgstr "unbekannter Kanal"
msgid "with"
msgstr "mit"
msgid "errors"
msgstr "Fehler"
msgid "error"
msgstr "Fehler"
msgid "Duration" msgid "Duration"
msgstr "Dauer" msgstr "Dauer"
@ -96,21 +108,18 @@ 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"
msgid "Delete Timer" msgid "Timer On/Off"
msgstr "Timer löschen" msgstr "Timer Ein/Aus"
msgid "Edit Timer" msgid "Edit Timer"
msgstr "Timer bearbeiten" msgstr "Timer bearbeiten"
msgid "Delete Timer"
msgstr "Timer löschen"
msgid "Timer Timeline" msgid "Timer Timeline"
msgstr "Timer Tagesübersicht" msgstr "Timer Tagesübersicht"
@ -141,6 +150,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"
@ -165,14 +177,14 @@ msgstr "Ja"
msgid "No" msgid "No"
msgstr "Nein" msgstr "Nein"
msgid "One" msgid "Timer Conflicts"
msgstr "Ein" msgstr "Timerkonflikte"
msgid "detected" msgid "detected"
msgstr "gefunden" msgstr "gefunden"
msgid "Timer Conflicts" msgid "Ignore Conflicts"
msgstr "Timerkonflikte" msgstr "Konflikte ignorieren"
msgid "Show conflict" msgid "Show conflict"
msgstr "Konflikt zeigen" msgstr "Konflikt zeigen"
@ -180,9 +192,6 @@ msgstr "Konflikt zeigen"
msgid "timers involved" msgid "timers involved"
msgstr "Timer beteiligt" msgstr "Timer beteiligt"
msgid "Ignore Conflicts"
msgstr "Konflikte ignorieren"
msgid "Ignore Conflict" msgid "Ignore Conflict"
msgstr "Konflikt ignorieren" msgstr "Konflikt ignorieren"
@ -213,6 +222,12 @@ msgstr "Timer für"
msgid "replaced by rerun" msgid "replaced by rerun"
msgstr "ersetzt durch Wiederholung" msgstr "ersetzt durch Wiederholung"
msgid "Save"
msgstr "Speichern"
msgid "Cancel"
msgstr "Abbrechen"
msgid "Timer Active" msgid "Timer Active"
msgstr "Timer aktiv" msgstr "Timer aktiv"
@ -237,14 +252,11 @@ msgstr "Timer Datei"
msgid "New Folder" msgid "New Folder"
msgstr "Neues Verzeichnis" msgstr "Neues Verzeichnis"
msgid "Save" msgid "Create Series Timer based on:"
msgstr "Speichern" msgstr "Serientimer anlegen basierend auf:"
msgid "Cancel" msgid "Create Timer"
msgstr "Abbrechen" msgstr "Timer anlegen"
msgid "Create Series Timer based on"
msgstr "Serientimer anlegen basierend auf"
msgid "Series Timer start time" msgid "Series Timer start time"
msgstr "Serientimer Start Zeit" msgstr "Serientimer Start Zeit"
@ -258,9 +270,6 @@ msgstr "Tage"
msgid "Day to start" msgid "Day to start"
msgstr "Beginnen am" msgstr "Beginnen am"
msgid "Create Timer"
msgstr "Timer anlegen"
msgid "Series Timer created" msgid "Series Timer created"
msgstr "Serientimer angelegt" msgstr "Serientimer angelegt"
@ -270,17 +279,17 @@ msgstr "Start"
msgid "Stop" msgid "Stop"
msgstr "Stop" msgstr "Stop"
msgid "Configure Search Timer based on" msgid "Configure Search Timer based on:"
msgstr "Suchtimer konfigurieren basierend auf" msgstr "Suchtimer konfigurieren basierend auf:"
msgid "Search Expression:"
msgstr "Suchausdruck:"
msgid "Continue" msgid "Continue"
msgstr "Weiter" msgstr "Weiter"
msgid "Configure Search Timer for Search String" msgid "Search Expression:"
msgstr "Suchtimer konfigurieren für Suchbegriff" msgstr "Suchausdruck:"
msgid "Configure Search Timer for Search String:"
msgstr "Suchtimer konfigurieren für Suchbegriff:"
msgid "Manually configure Options" msgid "Manually configure Options"
msgstr "Optionen manuell konfigurieren" msgstr "Optionen manuell konfigurieren"
@ -300,68 +309,44 @@ msgstr "Suchtimer konfigurieren"
msgid "Save Search Timer" msgid "Save Search Timer"
msgstr "Suchtimer speichern" msgstr "Suchtimer speichern"
msgid "Search String" msgid "Search term"
msgstr "Suchbegriff" msgstr "Suchbegriff"
msgid "Active" msgid "Active"
msgstr "Aktiv" msgstr "Aktiv"
msgid "Search Mode" msgid "Search mode"
msgstr "Suchmodus" msgstr "Suchmodus"
msgid "Use Title" msgid "Tolerance"
msgstr "Titel benutzen" msgstr "Toleranz"
msgid "Use Subtitle" msgid "Match case"
msgstr "Untertitel benutzen" msgstr "Groß/klein"
msgid "Use Description" msgid "Use title"
msgstr "Beschreibung benutzen" msgstr "Verwende Titel"
msgid "Limit Channels" msgid "Use subtitle"
msgstr "Kanäle einschränken" msgstr "Verwende Untertitel"
msgid "Use Time" msgid "Use description"
msgstr "Zeit benutzen" msgstr "Verwende Beschreibung"
msgid "Display advanced Options" msgid "Use channel"
msgstr "Erweiterte Optionen anzeigen" msgstr "Verwende Kanal"
msgid "Limit Days of the Week" msgid "from channel"
msgstr "Wochentage beschränken" msgstr "von Kanal"
msgid "Time margin for start in minutes" msgid "to channel"
msgstr "Zeit vor Start in Minuten" msgstr "bis Kanal"
msgid "Time margin for stop in minutes" msgid "Channel group"
msgstr "Zeit nach Ende in Minuten" msgstr "Kanalgruppe"
msgid "Series Recording" msgid "Use time"
msgstr "Serienaufnahme" msgstr "Verwende Uhrzeit"
msgid "Folder"
msgstr "Verzeichnis"
msgid "Use VPS"
msgstr "VPS benutzen"
msgid "Avoid Repeats"
msgstr "Wiederholungen vermeiden"
msgid "Use in Favorites"
msgstr "Als Favorit benutzen"
msgid "Hide advanced Options"
msgstr "Erweiterte Optionen ausblenden"
msgid "Display Results for Search Timer"
msgstr "Ergebnisse für Suchtimer anzeigen"
msgid "Start Channel"
msgstr "Startkanal"
msgid "Stop Channel"
msgstr "Stopkanal"
msgid "Start after" msgid "Start after"
msgstr "Beginn nach" msgstr "Beginn nach"
@ -369,20 +354,98 @@ msgstr "Beginn nach"
msgid "Start before" msgid "Start before"
msgstr "Beginn vor" msgstr "Beginn vor"
msgid "Select Days" msgid "Use duration"
msgstr "Tage bestimmen" msgstr "Verwende Dauer"
msgid "Number of allowed repeats" msgid "Min. duration"
msgstr "Anzahl erlaubter Wiederholungen" msgstr "Min. Dauer"
msgid "Max. duration"
msgstr "Max. Dauer"
msgid "Use day of week"
msgstr "Verwende Wochentag"
msgid "Day of week"
msgstr "Wochentag"
msgid "Use in Favorites"
msgstr "Als Favorit benutzen"
msgid "Use as search timer"
msgstr "Als Suchtimer verwenden"
msgid "Action"
msgstr "Aktion"
msgid "Switch ... minutes before start"
msgstr "Umschalten ... Minuten vor Start"
msgid "Unmute sound"
msgstr "Ton anschalten"
msgid "Ask ... minutes before start"
msgstr "Nachfrage ... Minuten vor Start"
msgid "Series Recording"
msgstr "Serienaufnahme"
msgid "Directory"
msgstr "Verzeichnis"
msgid "Delete recordings after ... days"
msgstr "Aufn. nach ... Tagen löschen"
msgid "Keep ... recordings"
msgstr "Behalte ... Aufnahmen"
msgid "Pause when ... recordings exist"
msgstr "Pause, wenn ... Aufnahmen exist."
msgid "Avoid Repeats"
msgstr "Vermeide Wiederholung"
msgid "Allowed repeats"
msgstr "Erlaubte Wiederholungen"
msgid "Only repeats within ... days"
msgstr "Nur Wiederh. innerhalb von ... Tagen"
msgid "Compare Title" msgid "Compare Title"
msgstr "Titel vergleichen" msgstr "Vergleiche Titel"
msgid "Compare Subtitle" msgid "Compare Subtitle"
msgstr "Untertitel vergleichen" msgstr "Vergleiche Untertitel"
msgid "Compare Description" msgid "Compare Description"
msgstr "Beschreibung vergleichen" msgstr "Vergleiche Beschreibung"
msgid "Min. match in %"
msgstr "Min. Übereinstimmung in %"
msgid "Compare date"
msgstr "Vergleiche Zeitpunkt"
msgid "Time margin for start in minutes"
msgstr "Vorlauf zum Timer-Beginn (min)"
msgid "Time margin for stop in minutes"
msgstr "Nachlauf zum Timer-Ende (min)"
msgid "Use VPS"
msgstr "Verwende VPS"
msgid "Auto delete"
msgstr "automatisch löschen"
msgid "after ... recordings"
msgstr "nach ... Aufnahmen"
msgid "after ... days after first rec."
msgstr "nach ... Tagen nach erster Aufn."
msgid "Display Results for Search Timer"
msgstr "Ergebnisse für Suchtimer anzeigen"
msgid "Really delete Search Timer" msgid "Really delete Search Timer"
msgstr "Suchtimer wirklich löschen" msgstr "Suchtimer wirklich löschen"
@ -393,7 +456,7 @@ msgstr "Nur Suchtimer löschen"
msgid "Delete Search Timer and created Timers" msgid "Delete Search Timer and created Timers"
msgstr "Suchtimer und erzeugte Timer löschen" msgstr "Suchtimer und erzeugte Timer löschen"
msgid "Search Timer sucessfully created." msgid "Search Timer sucessfully created"
msgstr "Suchtimer erfolgreich angelegt" msgstr "Suchtimer erfolgreich angelegt"
msgid "Search Timer update initialised" msgid "Search Timer update initialised"
@ -417,12 +480,12 @@ msgstr "Anderes Template benutzen"
msgid "search results for Favorite" msgid "search results for Favorite"
msgstr "Suchergebnisse für Favorit" msgstr "Suchergebnisse für Favorit"
msgid "search result for Favorite"
msgstr "Suchergebnis für Favorit"
msgid "search results for Search Timer" msgid "search results for Search Timer"
msgstr "Treffer für Suchtimer" msgstr "Treffer für Suchtimer"
msgid "search result for Favorite"
msgstr "Suchergebnis für Favorit"
msgid "search result for Search Timer" msgid "search result for Search Timer"
msgstr "Treffer für Suchtimer" msgstr "Treffer für Suchtimer"
@ -432,8 +495,8 @@ msgstr "Keine Treffer für Suchbegriff"
msgid "Configure Options for Switchtimer" msgid "Configure Options for Switchtimer"
msgstr "Optionen für Umschalttimer konfigurieren" msgstr "Optionen für Umschalttimer konfigurieren"
msgid "Minutes before switching" msgid "Create"
msgstr "Minuten vor umschalten" msgstr "Anlegen"
msgid "switch" msgid "switch"
msgstr "umschalten" msgstr "umschalten"
@ -444,12 +507,12 @@ msgstr "nur ankündigen"
msgid "ask for switch" msgid "ask for switch"
msgstr "vor umschalten fragen" msgstr "vor umschalten fragen"
msgid "Minutes before switching"
msgstr "Minuten vor umschalten"
msgid "Switch Mode" msgid "Switch Mode"
msgstr "Umschaltmodus" msgstr "Umschaltmodus"
msgid "Create"
msgstr "Anlegen"
msgid "Switch Timer sucessfully created" msgid "Switch Timer sucessfully created"
msgstr "Umschalttimer erfolgreich angelegt" msgstr "Umschalttimer erfolgreich angelegt"
@ -459,6 +522,12 @@ msgstr "Umschalttimer NICHT erfolgreich angelegt"
msgid "Switch Timer deleted" msgid "Switch Timer deleted"
msgstr "Umschalttimer gelöscht" msgstr "Umschalttimer gelöscht"
msgid "Perform Search"
msgstr "Suche ausführen"
msgid "Search Mode"
msgstr "Suchmodus"
msgid "Channel to Search" msgid "Channel to Search"
msgstr "Suche auf Kanal" msgstr "Suche auf Kanal"
@ -474,9 +543,6 @@ msgstr "In Beschreibung suchen"
msgid "Show Search Options" msgid "Show Search Options"
msgstr "Suchoptionen anzeigen" msgstr "Suchoptionen anzeigen"
msgid "Perform Search"
msgstr "Suche ausführen"
msgid "search results for" msgid "search results for"
msgstr "Suchergebnisse für" msgstr "Suchergebnisse für"
@ -492,12 +558,12 @@ msgstr "Suchausdruck muss mindestens drei Zeichen haben"
msgid "Found" msgid "Found"
msgstr " " msgstr " "
msgid "recording"
msgstr "Aufnahme gefunden"
msgid "recordings" msgid "recordings"
msgstr "Aufnahmen gefunden" msgstr "Aufnahmen gefunden"
msgid "recording"
msgstr "Aufnahme gefunden"
msgid "for" msgid "for"
msgstr "für" msgstr "für"
@ -507,6 +573,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"
@ -522,6 +594,57 @@ msgstr "exakt"
msgid "regular expression" msgid "regular expression"
msgstr "Regulärer Ausdruck" msgstr "Regulärer Ausdruck"
msgid "fuzzy"
msgstr "unscharf"
msgid "allow empty"
msgstr "erlaube leere"
msgid "Interval"
msgstr "Bereich"
msgid "Channel Group"
msgstr "Kanalgruppe"
msgid "only FTA"
msgstr "ohne PayTV"
msgid "same day"
msgstr "gleicher Tag"
msgid "same week"
msgstr "gleiche Woche"
msgid "same month"
msgstr "gleicher Monat"
msgid "Record"
msgstr "Aufnehmen"
msgid "Announce by OSD"
msgstr "per OSD ankündigen"
msgid "Switch only"
msgstr "Nur umschalten"
msgid "Announce and switch"
msgstr "Ankündigen und Umschalten"
msgid "Announce by mail"
msgstr "per Mail ankündigen"
msgid "Inactive record"
msgstr "inaktive Aufnahme"
msgid "no"
msgstr "Nein"
msgid "count recordings"
msgstr "Anzahl Aufnahmen"
msgid "count days"
msgstr "Anzahl Tage"
msgid "General Settings" msgid "General Settings"
msgstr "Allgemeine Einstellungen" msgstr "Allgemeine Einstellungen"
@ -567,6 +690,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"
@ -774,20 +900,50 @@ 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"
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 "Show timer confirmation messages"
msgstr "Timer Bestätigungsmeldungen anzeigen"
msgid "Favorites:"
msgstr "Favoriten:"
msgid "Limit channels in favorites"
msgstr "Kanäle in Favoriten beschränken"
msgid "Start Channel"
msgstr "von Kanal"
msgid "Stop Channel"
msgstr "bis Kanal"
msgid "Use \"What's on now\" in favorites" msgid "Use \"What's on now\" in favorites"
msgstr "\"Was läuft jetzt\" in Favoriten benutzen" msgstr "\"Was läuft jetzt\" in Favoriten benutzen"
msgid "Use \"What's on next\" in favorites" msgid "Use \"What's on next\" in favorites"
msgstr "\"Was läuft als nächstes\" in Favoriten benutzen" msgstr "\"Was läuft als nächstes\" in Favoriten benutzen"
msgid "Use user defined time 1 in favorites" msgid "User defined times in favorites:"
msgstr "Benutzerdef. Zeit 1 in Favoriten benutzen" msgstr "Nutzer definierte Zeiten in Favoriten:"
msgid "Use user defined time 1"
msgstr "Verw. benutzerdef. Zeit 1"
msgid "Description" msgid "Description"
msgstr "Beschreibung" msgstr "Beschreibung"
@ -795,23 +951,26 @@ msgstr "Beschreibung"
msgid "Time" msgid "Time"
msgstr "Zeit" msgstr "Zeit"
msgid "Use user defined time 2 in favorites" msgid "Use user defined time 2"
msgstr "Benutzerdef. Zeit 2 in Favoriten benutzen" msgstr "Verw. benutzerdef. Zeit 2"
msgid "Use user defined time 3 in favorites" msgid "Use user defined time 3"
msgstr "Benutzerdef. Zeit 3 in Favoriten benutzen" msgstr "Verw. benutzerdef. Zeit 3"
msgid "Use user defined time 4 in favorites" msgid "Use user defined time 4"
msgstr "Benutzerdef. Zeit 4 in Favoriten benutzen" msgstr "Verw. benutzerdef. Zeit 4"
msgid "Limit channels in favorites" msgid "Switchtimer:"
msgstr "Kanäle in Favoriten beschränken" msgstr "Umschalttimer:"
msgid "Switch (x)min before start of the show"
msgstr "Umschalten (x)min vor der Sendung"
msgid "Create Log Messages for image loading" msgid "Create Log Messages for image loading"
msgstr "Log Nachrichten für das Laden der Bilder erzeugen" msgstr "Log Nachrichten für das Laden der Bilder erzeugen"
msgid "Limit Logo Cache" msgid "Limit Logo Cache"
msgstr "Logo Cash beschränken" msgstr "Logo Cache beschränken"
msgid "Maximal number of logos to cache" msgid "Maximal number of logos to cache"
msgstr "Maximale Anzahl Logos" msgstr "Maximale Anzahl Logos"
@ -837,6 +996,9 @@ msgstr "Kanalgruppen Cache"
msgid "Recording Menus Icon Cache" msgid "Recording Menus Icon Cache"
msgstr "Recording Menüs Icon Cache" msgstr "Recording Menüs Icon Cache"
msgid "A fancy 2d EPG Viewer"
msgstr "Eine schicke Programm Vorschau"
msgid "No Cast available" msgid "No Cast available"
msgstr "Keine Besetzung vorhanden" msgstr "Keine Besetzung vorhanden"
@ -850,7 +1012,7 @@ msgid "Reruns"
msgstr "Wiederholungen" msgstr "Wiederholungen"
msgid "Recording Information" msgid "Recording Information"
msgstr "" msgstr "Aufnahme Information"
msgid "Image Galery" msgid "Image Galery"
msgstr "Bildergalerie" msgstr "Bildergalerie"
@ -906,9 +1068,6 @@ msgstr "Überblick"
msgid "yes" msgid "yes"
msgstr "Ja" msgstr "Ja"
msgid "no"
msgstr "Nein"
msgid "Adult" msgid "Adult"
msgstr "Nur für Erwachsene" msgstr "Nur für Erwachsene"
@ -939,3 +1098,8 @@ msgstr "TheMovieDB Popularität"
msgid "TheMovieDB Vote Average" msgid "TheMovieDB Vote Average"
msgstr "TheMovieDB durchschnittliche Bewertung" msgstr "TheMovieDB durchschnittliche Bewertung"
#~ msgid "Display advanced Options"
#~ msgstr "Erweiterte Optionen anzeigen"
#~ msgid "Hide advanced Options"
#~ msgstr "Erweiterte Optionen ausblenden"

1108
po/it_IT.po Normal file

File diff suppressed because it is too large Load Diff

View File

@ -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: 2014-05-10 17:24+0200\n" "POT-Creation-Date: 2022-04-29 16:05+0200\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"
@ -22,7 +22,7 @@ msgid "min"
msgstr "мин" msgstr "мин"
msgid "Reruns of " msgid "Reruns of "
msgstr "" msgstr "ПОВТОРЫ ЭТОЙ "
msgid "No reruns found" msgid "No reruns found"
msgstr "" msgstr ""
@ -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 "Главная видео директория"
@ -69,6 +72,15 @@ msgstr "все каналы"
msgid "unknown channel" msgid "unknown channel"
msgstr "неизвестный канал" msgstr "неизвестный канал"
msgid "with"
msgstr ""
msgid "errors"
msgstr ""
msgid "error"
msgstr ""
msgid "Duration" msgid "Duration"
msgstr "Продолжительность" msgstr "Продолжительность"
@ -96,21 +108,18 @@ 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 "Записать"
msgid "Delete Timer" msgid "Timer On/Off"
msgstr "Удалить таймер" msgstr "таймер Вкл/Выкл"
msgid "Edit Timer" msgid "Edit Timer"
msgstr "Редактировать таймер" msgstr "Редактировать таймер"
msgid "Delete Timer"
msgstr "Удалить таймер"
msgid "Timer Timeline" msgid "Timer Timeline"
msgstr "" msgstr ""
@ -141,6 +150,9 @@ msgstr "Искать в записях"
msgid "Set Folder for" msgid "Set Folder for"
msgstr "Укажите каталог для" msgstr "Укажите каталог для"
msgid "Timer changed"
msgstr ""
msgid "Timer created" msgid "Timer created"
msgstr "Таймер создан" msgstr "Таймер создан"
@ -165,14 +177,14 @@ msgstr "Да"
msgid "No" msgid "No"
msgstr "Нет" msgstr "Нет"
msgid "One" msgid "Timer Conflicts"
msgstr "Один" msgstr "Таймер-конфликты"
msgid "detected" msgid "detected"
msgstr "обнаружен" msgstr "обнаружен"
msgid "Timer Conflicts" msgid "Ignore Conflicts"
msgstr "Таймер-конфликты" msgstr "Игнорировать конфликты"
msgid "Show conflict" msgid "Show conflict"
msgstr "Показать конфликты" msgstr "Показать конфликты"
@ -180,9 +192,6 @@ msgstr "Показать конфликты"
msgid "timers involved" msgid "timers involved"
msgstr "Таймер" msgstr "Таймер"
msgid "Ignore Conflicts"
msgstr "Игнорировать конфликты"
msgid "Ignore Conflict" msgid "Ignore Conflict"
msgstr "Игнорировать конфликт" msgstr "Игнорировать конфликт"
@ -213,6 +222,12 @@ msgstr ""
msgid "replaced by rerun" msgid "replaced by rerun"
msgstr "" msgstr ""
msgid "Save"
msgstr "Сохранить"
msgid "Cancel"
msgstr "Отменить"
msgid "Timer Active" msgid "Timer Active"
msgstr "Таймер активен" msgstr "Таймер активен"
@ -237,14 +252,11 @@ msgstr ""
msgid "New Folder" msgid "New Folder"
msgstr "" msgstr ""
msgid "Save" msgid "Create Series Timer based on:"
msgstr "Сохранить" msgstr "Настроить циклический таймер:"
msgid "Cancel" msgid "Create Timer"
msgstr "Отменить" msgstr "Создать"
msgid "Create Series Timer based on"
msgstr "Настроить циклический таймер"
msgid "Series Timer start time" msgid "Series Timer start time"
msgstr "Время с" msgstr "Время с"
@ -258,9 +270,6 @@ msgstr "Дни недели"
msgid "Day to start" msgid "Day to start"
msgstr "Начиная с" msgstr "Начиная с"
msgid "Create Timer"
msgstr "Создать"
msgid "Series Timer created" msgid "Series Timer created"
msgstr "Циклический таймер создан" msgstr "Циклический таймер создан"
@ -270,17 +279,17 @@ msgstr "Старт"
msgid "Stop" msgid "Stop"
msgstr "Стоп" msgstr "Стоп"
msgid "Configure Search Timer based on" msgid "Configure Search Timer based on:"
msgstr "Настроить поисковый таймер" msgstr "Настроить поисковый таймер:"
msgid "Search Expression:"
msgstr "Искать выражение:"
msgid "Continue" msgid "Continue"
msgstr "Продолжить" msgstr "Продолжить"
msgid "Configure Search Timer for Search String" msgid "Search Expression:"
msgstr "Настройка таймера поиска по ключевым словам" msgstr "Искать выражение:"
msgid "Configure Search Timer for Search String:"
msgstr "Настройка таймера поиска по ключевым словам:"
msgid "Manually configure Options" msgid "Manually configure Options"
msgstr "Ручная настройка параметров" msgstr "Ручная настройка параметров"
@ -295,84 +304,111 @@ msgid "No Search Timers Configured"
msgstr "" msgstr ""
msgid "Configure Search Timer Options" msgid "Configure Search Timer Options"
msgstr "" msgstr "Настроить параметры таймера"
msgid "Save Search Timer" msgid "Save Search Timer"
msgstr "" msgstr ""
msgid "Search String" msgid "Search term"
msgstr "" msgstr ""
msgid "Active" msgid "Active"
msgstr "" msgstr ""
msgid "Search Mode" msgid "Search mode"
msgstr "Режим поиска" msgstr ""
msgid "Use Title" msgid "Tolerance"
msgstr ""
msgid "Match case"
msgstr ""
msgid "Use title"
msgstr "Искать в названиях" msgstr "Искать в названиях"
msgid "Use Subtitle" msgid "Use subtitle"
msgstr "Искать в эпизодах" msgstr "Искать в эпизодах"
msgid "Use Description" msgid "Use description"
msgstr "Искать в описаниях" msgstr "Искать в описаниях"
msgid "Limit Channels" msgid "Use channel"
msgstr "Ограничить список каналов" msgstr "Ограничить список каналов"
msgid "Use Time" msgid "from channel"
msgstr ""
msgid "to channel"
msgstr ""
msgid "Channel group"
msgstr ""
msgid "Use time"
msgstr "Время" msgstr "Время"
msgid "Display advanced Options"
msgstr ""
msgid "Limit Days of the Week"
msgstr ""
msgid "Time margin for start in minutes"
msgstr ""
msgid "Time margin for stop in minutes"
msgstr ""
msgid "Series Recording"
msgstr ""
msgid "Folder"
msgstr ""
msgid "Use VPS"
msgstr ""
msgid "Avoid Repeats"
msgstr ""
msgid "Use in Favorites"
msgstr ""
msgid "Hide advanced Options"
msgstr ""
msgid "Display Results for Search Timer"
msgstr "Тест"
msgid "Start Channel"
msgstr "С канала"
msgid "Stop Channel"
msgstr "По канал"
msgid "Start after" msgid "Start after"
msgstr "С" msgstr "С"
msgid "Start before" msgid "Start before"
msgstr "До" msgstr "До"
msgid "Select Days" msgid "Use duration"
msgstr "" msgstr ""
msgid "Number of allowed repeats" msgid "Min. duration"
msgstr ""
msgid "Max. duration"
msgstr ""
msgid "Use day of week"
msgstr ""
msgid "Day of week"
msgstr ""
msgid "Use in Favorites"
msgstr ""
msgid "Use as search timer"
msgstr ""
msgid "Action"
msgstr ""
msgid "Switch ... minutes before start"
msgstr ""
msgid "Unmute sound"
msgstr ""
msgid "Ask ... minutes before start"
msgstr ""
msgid "Series Recording"
msgstr ""
msgid "Directory"
msgstr ""
msgid "Delete recordings after ... days"
msgstr ""
msgid "Keep ... recordings"
msgstr ""
msgid "Pause when ... recordings exist"
msgstr ""
msgid "Avoid Repeats"
msgstr ""
msgid "Allowed repeats"
msgstr ""
msgid "Only repeats within ... days"
msgstr "" msgstr ""
msgid "Compare Title" msgid "Compare Title"
@ -384,6 +420,33 @@ msgstr ""
msgid "Compare Description" msgid "Compare Description"
msgstr "" msgstr ""
msgid "Min. match in %"
msgstr ""
msgid "Compare date"
msgstr ""
msgid "Time margin for start in minutes"
msgstr ""
msgid "Time margin for stop in minutes"
msgstr ""
msgid "Use VPS"
msgstr ""
msgid "Auto delete"
msgstr ""
msgid "after ... recordings"
msgstr ""
msgid "after ... days after first rec."
msgstr ""
msgid "Display Results for Search Timer"
msgstr "Тест"
msgid "Really delete Search Timer" msgid "Really delete Search Timer"
msgstr "" msgstr ""
@ -393,7 +456,7 @@ msgstr ""
msgid "Delete Search Timer and created Timers" msgid "Delete Search Timer and created Timers"
msgstr "" msgstr ""
msgid "Search Timer sucessfully created." msgid "Search Timer sucessfully created"
msgstr "Поисковый таймер создан" msgstr "Поисковый таймер создан"
msgid "Search Timer update initialised" msgid "Search Timer update initialised"
@ -417,12 +480,12 @@ msgstr "Использовать другие шаблоны"
msgid "search results for Favorite" msgid "search results for Favorite"
msgstr "" msgstr ""
msgid "search result for Favorite"
msgstr ""
msgid "search results for Search Timer" msgid "search results for Search Timer"
msgstr "Совпадений найдено" msgstr "Совпадений найдено"
msgid "search result for Favorite"
msgstr ""
msgid "search result for Search Timer" msgid "search result for Search Timer"
msgstr "Совпадение найдено" msgstr "Совпадение найдено"
@ -432,8 +495,8 @@ msgstr "Совпадений НЕ найдено"
msgid "Configure Options for Switchtimer" msgid "Configure Options for Switchtimer"
msgstr "Настройка таймера переключения" msgstr "Настройка таймера переключения"
msgid "Minutes before switching" msgid "Create"
msgstr "Минут до события" msgstr "Создать"
msgid "switch" msgid "switch"
msgstr "Переключить" msgstr "Переключить"
@ -444,12 +507,12 @@ msgstr "Только предупредить"
msgid "ask for switch" msgid "ask for switch"
msgstr "Спросить о переключении" msgstr "Спросить о переключении"
msgid "Minutes before switching"
msgstr "Минут до события"
msgid "Switch Mode" msgid "Switch Mode"
msgstr "Режим переключения" msgstr "Режим переключения"
msgid "Create"
msgstr "Создать"
msgid "Switch Timer sucessfully created" msgid "Switch Timer sucessfully created"
msgstr "Таймер переключения создан" msgstr "Таймер переключения создан"
@ -459,6 +522,12 @@ msgstr "Таймер переключения НЕ был создан!"
msgid "Switch Timer deleted" msgid "Switch Timer deleted"
msgstr "Таймер переключения удален" msgstr "Таймер переключения удален"
msgid "Perform Search"
msgstr "Найти"
msgid "Search Mode"
msgstr "Режим поиска"
msgid "Channel to Search" msgid "Channel to Search"
msgstr "Канал для поиска" msgstr "Канал для поиска"
@ -474,9 +543,6 @@ msgstr "Искать в описаниях"
msgid "Show Search Options" msgid "Show Search Options"
msgstr "Показать параметры поиска" msgstr "Показать параметры поиска"
msgid "Perform Search"
msgstr "Найти"
msgid "search results for" msgid "search results for"
msgstr "Найдено по запросу" msgstr "Найдено по запросу"
@ -492,12 +558,12 @@ msgstr ""
msgid "Found" msgid "Found"
msgstr "Найдено" msgstr "Найдено"
msgid "recording"
msgstr "запись"
msgid "recordings" msgid "recordings"
msgstr "записей" msgstr "записей"
msgid "recording"
msgstr "запись"
msgid "for" msgid "for"
msgstr "для" msgstr "для"
@ -507,6 +573,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 "фраза"
@ -522,6 +594,57 @@ msgstr "точное совпадение"
msgid "regular expression" msgid "regular expression"
msgstr "регулярные выражения" msgstr "регулярные выражения"
msgid "fuzzy"
msgstr ""
msgid "allow empty"
msgstr ""
msgid "Interval"
msgstr ""
msgid "Channel Group"
msgstr ""
msgid "only FTA"
msgstr ""
msgid "same day"
msgstr ""
msgid "same week"
msgstr ""
msgid "same month"
msgstr ""
msgid "Record"
msgstr ""
msgid "Announce by OSD"
msgstr ""
msgid "Switch only"
msgstr ""
msgid "Announce and switch"
msgstr ""
msgid "Announce by mail"
msgstr ""
msgid "Inactive record"
msgstr ""
msgid "no"
msgstr ""
msgid "count recordings"
msgstr ""
msgid "count days"
msgstr ""
msgid "General Settings" msgid "General Settings"
msgstr "Основные настройки" msgstr "Основные настройки"
@ -567,6 +690,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 "Показывать пункт в главном меню"
@ -643,7 +769,7 @@ msgid "Display time in EPG Grids"
msgstr "Показывать время в сетке EPG" msgstr "Показывать время в сетке EPG"
msgid "Height of Headers (Status Header and EPG View, Perc. of osd height)" msgid "Height of Headers (Status Header and EPG View, Perc. of osd height)"
msgstr "" msgstr "Высота верхней панели (% от высоты OSD)"
msgid "Height of Footer (Perc. of osd height)" msgid "Height of Footer (Perc. of osd height)"
msgstr "" msgstr ""
@ -774,19 +900,49 @@ 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 "Использовать директории для быстрой записи"
msgid "Folder"
msgstr ""
msgid "Add episode to manual timers"
msgstr "" msgstr ""
msgid "Use Remotetimers" msgid "Use Remotetimers"
msgstr "RemoteTimers benutzen" msgstr "RemoteTimers benutzen"
msgid "Show timer confirmation messages"
msgstr ""
msgid "Favorites:"
msgstr ""
msgid "Limit channels in favorites"
msgstr ""
msgid "Start Channel"
msgstr "С канала"
msgid "Stop Channel"
msgstr "По канал"
msgid "Use \"What's on now\" in favorites" msgid "Use \"What's on now\" in favorites"
msgstr "" msgstr ""
msgid "Use \"What's on next\" in favorites" msgid "Use \"What's on next\" in favorites"
msgstr "" msgstr ""
msgid "Use user defined time 1 in favorites" msgid "User defined times in favorites:"
msgstr ""
msgid "Use user defined time 1"
msgstr "" msgstr ""
msgid "Description" msgid "Description"
@ -795,16 +951,19 @@ msgstr ""
msgid "Time" msgid "Time"
msgstr "" msgstr ""
msgid "Use user defined time 2 in favorites" msgid "Use user defined time 2"
msgstr "" msgstr ""
msgid "Use user defined time 3 in favorites" msgid "Use user defined time 3"
msgstr "" msgstr ""
msgid "Use user defined time 4 in favorites" msgid "Use user defined time 4"
msgstr "" msgstr ""
msgid "Limit channels in favorites" msgid "Switchtimer:"
msgstr ""
msgid "Switch (x)min before start of the show"
msgstr "" msgstr ""
msgid "Create Log Messages for image loading" msgid "Create Log Messages for image loading"
@ -837,6 +996,9 @@ msgstr ""
msgid "Recording Menus Icon Cache" msgid "Recording Menus Icon Cache"
msgstr "" msgstr ""
msgid "A fancy 2d EPG Viewer"
msgstr ""
msgid "No Cast available" msgid "No Cast available"
msgstr "" msgstr ""
@ -847,7 +1009,7 @@ msgid "EPG Info"
msgstr "" msgstr ""
msgid "Reruns" msgid "Reruns"
msgstr "" msgstr "ПОВТОРЫ"
msgid "Recording Information" msgid "Recording Information"
msgstr "" msgstr ""
@ -906,9 +1068,6 @@ msgstr ""
msgid "yes" msgid "yes"
msgstr "" msgstr ""
msgid "no"
msgstr ""
msgid "Adult" msgid "Adult"
msgstr "" msgstr ""

View File

@ -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: 2014-05-10 17:24+0200\n" "POT-Creation-Date: 2022-04-29 16:05+0200\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"
@ -22,7 +22,7 @@ msgid "min"
msgstr "min" msgstr "min"
msgid "Reruns of " msgid "Reruns of "
msgstr "" msgstr "Repríza tohto "
msgid "No reruns found" msgid "No reruns found"
msgstr "" msgstr ""
@ -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ý video adresár" msgstr "Hlavný video adresár"
@ -69,6 +72,15 @@ msgstr "v
msgid "unknown channel" msgid "unknown channel"
msgstr "neznámy Kanal" msgstr "neznámy Kanal"
msgid "with"
msgstr ""
msgid "errors"
msgstr ""
msgid "error"
msgstr ""
msgid "Duration" msgid "Duration"
msgstr "Då¾ka" msgstr "Då¾ka"
@ -96,21 +108,18 @@ 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¾ite nahra»" msgstr "Okam¾ite nahra»"
msgid "Delete Timer" msgid "Timer On/Off"
msgstr "Vymaza» plán nahrávania" msgstr "Zap./Vyp. plán nahrávania"
msgid "Edit Timer" msgid "Edit Timer"
msgstr "Upravi» plán nahrávania" msgstr "Upravi» plán nahrávania"
msgid "Delete Timer"
msgstr "Vymaza» plán nahrávania"
msgid "Timer Timeline" msgid "Timer Timeline"
msgstr "" msgstr ""
@ -141,6 +150,9 @@ msgstr "Vyh
msgid "Set Folder for" msgid "Set Folder for"
msgstr "Nastavi» adresár pre" msgstr "Nastavi» adresár pre"
msgid "Timer changed"
msgstr ""
msgid "Timer created" msgid "Timer created"
msgstr "Plán vytvorený" msgstr "Plán vytvorený"
@ -165,14 +177,14 @@ msgstr "
msgid "No" msgid "No"
msgstr "Nie" msgstr "Nie"
msgid "One" msgid "Timer Conflicts"
msgstr "Jeden" msgstr "Konflikty plánov"
msgid "detected" msgid "detected"
msgstr "nájdených" msgstr "nájdených"
msgid "Timer Conflicts" msgid "Ignore Conflicts"
msgstr "Konflikty plánov" msgstr "Ignorova» konflikty"
msgid "Show conflict" msgid "Show conflict"
msgstr "Zobrazi» konflikt" msgstr "Zobrazi» konflikt"
@ -180,9 +192,6 @@ msgstr "Zobrazi
msgid "timers involved" msgid "timers involved"
msgstr "plány komplikované" msgstr "plány komplikované"
msgid "Ignore Conflicts"
msgstr "Ignorova» konflikty"
msgid "Ignore Conflict" msgid "Ignore Conflict"
msgstr "Ignorova» konflikt" msgstr "Ignorova» konflikt"
@ -213,6 +222,12 @@ msgstr ""
msgid "replaced by rerun" msgid "replaced by rerun"
msgstr "" msgstr ""
msgid "Save"
msgstr "Ulo¾i»"
msgid "Cancel"
msgstr "Zru¹i»"
msgid "Timer Active" msgid "Timer Active"
msgstr "Plán aktívny" msgstr "Plán aktívny"
@ -237,14 +252,11 @@ msgstr ""
msgid "New Folder" msgid "New Folder"
msgstr "" msgstr ""
msgid "Save" msgid "Create Series Timer based on:"
msgstr "Ulo¾i»" msgstr "Vytvorenie plánu na základe série:"
msgid "Cancel" msgid "Create Timer"
msgstr "Zru¹i»" msgstr "Vytvori» plán"
msgid "Create Series Timer based on"
msgstr "Vytvorenie plánu na základe série"
msgid "Series Timer start time" msgid "Series Timer start time"
msgstr "Sériový plán zaèína" msgstr "Sériový plán zaèína"
@ -258,9 +270,6 @@ msgstr "Dni"
msgid "Day to start" msgid "Day to start"
msgstr "Zaèína dòa" msgstr "Zaèína dòa"
msgid "Create Timer"
msgstr "Vytvori» plán"
msgid "Series Timer created" msgid "Series Timer created"
msgstr "Vytvorený sériový plán" msgstr "Vytvorený sériový plán"
@ -270,17 +279,17 @@ msgstr "
msgid "Stop" msgid "Stop"
msgstr "Stop" msgstr "Stop"
msgid "Configure Search Timer based on" msgid "Configure Search Timer based on:"
msgstr "Vyhµadávanie plánu nastavi» na základe" msgstr "Vyhµadávanie plánu nastavi» na základe:"
msgid "Search Expression:"
msgstr "Hµadaný výraz:"
msgid "Continue" msgid "Continue"
msgstr "Ïal¹ie" msgstr "Ïal¹ie"
msgid "Configure Search Timer for Search String" msgid "Search Expression:"
msgstr "Konfigurácia vyhµadávania plánu pre hµadané kµúèové slovo " msgstr "Hµadaný výraz:"
msgid "Configure Search Timer for Search String:"
msgstr "Konfigurácia vyhµadávania plánu pre hµadané kµúèové slovo:"
msgid "Manually configure Options" msgid "Manually configure Options"
msgstr "Ruène konfigurova» mo¾nosti" msgstr "Ruène konfigurova» mo¾nosti"
@ -300,79 +309,106 @@ msgstr ""
msgid "Save Search Timer" msgid "Save Search Timer"
msgstr "" msgstr ""
msgid "Search String" msgid "Search term"
msgstr "" msgstr ""
msgid "Active" msgid "Active"
msgstr "" msgstr ""
msgid "Search Mode" msgid "Search mode"
msgstr "Re¾im vyhµadávania" msgstr ""
msgid "Use Title" msgid "Tolerance"
msgstr ""
msgid "Match case"
msgstr ""
msgid "Use title"
msgstr "Pou¾i» názov" msgstr "Pou¾i» názov"
msgid "Use Subtitle" msgid "Use subtitle"
msgstr "Pou¾i» titulky" msgstr "Pou¾i» titulky"
msgid "Use Description" msgid "Use description"
msgstr "Pou¾i» popis" msgstr "Pou¾i» popis"
msgid "Limit Channels" msgid "Use channel"
msgstr "Obmedzi» kanály" msgstr "Obmedzi» kanály"
msgid "Use Time" msgid "from channel"
msgstr ""
msgid "to channel"
msgstr ""
msgid "Channel group"
msgstr ""
msgid "Use time"
msgstr "Pou¾i» èas" msgstr "Pou¾i» èas"
msgid "Display advanced Options"
msgstr ""
msgid "Limit Days of the Week"
msgstr ""
msgid "Time margin for start in minutes"
msgstr ""
msgid "Time margin for stop in minutes"
msgstr ""
msgid "Series Recording"
msgstr ""
msgid "Folder"
msgstr ""
msgid "Use VPS"
msgstr ""
msgid "Avoid Repeats"
msgstr ""
msgid "Use in Favorites"
msgstr ""
msgid "Hide advanced Options"
msgstr ""
msgid "Display Results for Search Timer"
msgstr "Pozrie» výsledky pre vyhµadávanie plánov"
msgid "Start Channel"
msgstr "Od kanálu"
msgid "Stop Channel"
msgstr "Po kanál"
msgid "Start after" msgid "Start after"
msgstr "Zaèiatok po" msgstr "Zaèiatok po"
msgid "Start before" msgid "Start before"
msgstr "Zaèiatok pred" msgstr "Zaèiatok pred"
msgid "Select Days" msgid "Use duration"
msgstr "" msgstr ""
msgid "Number of allowed repeats" msgid "Min. duration"
msgstr ""
msgid "Max. duration"
msgstr ""
msgid "Use day of week"
msgstr ""
msgid "Day of week"
msgstr ""
msgid "Use in Favorites"
msgstr ""
msgid "Use as search timer"
msgstr ""
msgid "Action"
msgstr ""
msgid "Switch ... minutes before start"
msgstr ""
msgid "Unmute sound"
msgstr ""
msgid "Ask ... minutes before start"
msgstr ""
msgid "Series Recording"
msgstr ""
msgid "Directory"
msgstr ""
msgid "Delete recordings after ... days"
msgstr ""
msgid "Keep ... recordings"
msgstr ""
msgid "Pause when ... recordings exist"
msgstr ""
msgid "Avoid Repeats"
msgstr ""
msgid "Allowed repeats"
msgstr ""
msgid "Only repeats within ... days"
msgstr "" msgstr ""
msgid "Compare Title" msgid "Compare Title"
@ -384,6 +420,33 @@ msgstr ""
msgid "Compare Description" msgid "Compare Description"
msgstr "" msgstr ""
msgid "Min. match in %"
msgstr ""
msgid "Compare date"
msgstr ""
msgid "Time margin for start in minutes"
msgstr ""
msgid "Time margin for stop in minutes"
msgstr ""
msgid "Use VPS"
msgstr ""
msgid "Auto delete"
msgstr ""
msgid "after ... recordings"
msgstr ""
msgid "after ... days after first rec."
msgstr ""
msgid "Display Results for Search Timer"
msgstr "Pozrie» výsledky pre vyhµadávanie plánov"
msgid "Really delete Search Timer" msgid "Really delete Search Timer"
msgstr "" msgstr ""
@ -393,8 +456,8 @@ msgstr ""
msgid "Delete Search Timer and created Timers" msgid "Delete Search Timer and created Timers"
msgstr "" msgstr ""
msgid "Search Timer sucessfully created." msgid "Search Timer sucessfully created"
msgstr "Vyhµadávaè plánu vytvorený." msgstr "Vyhµadávaè plánu vytvorený"
msgid "Search Timer update initialised" msgid "Search Timer update initialised"
msgstr "Vyhladávaè plánu inicializovaný" msgstr "Vyhladávaè plánu inicializovaný"
@ -417,12 +480,12 @@ msgstr "Pou
msgid "search results for Favorite" msgid "search results for Favorite"
msgstr "" msgstr ""
msgid "search result for Favorite"
msgstr ""
msgid "search results for Search Timer" msgid "search results for Search Timer"
msgstr "nájdené výsledky vyhµadávania plánu" msgstr "nájdené výsledky vyhµadávania plánu"
msgid "search result for Favorite"
msgstr ""
msgid "search result for Search Timer" msgid "search result for Search Timer"
msgstr "nájdený výsledok vyhµadávania plánu" msgstr "nájdený výsledok vyhµadávania plánu"
@ -432,8 +495,8 @@ msgstr "H
msgid "Configure Options for Switchtimer" msgid "Configure Options for Switchtimer"
msgstr "Konfigurova» mo¾nosti pre prepínací plán" msgstr "Konfigurova» mo¾nosti pre prepínací plán"
msgid "Minutes before switching" msgid "Create"
msgstr "Minúty pred prepnutím" msgstr "Vytvori»"
msgid "switch" msgid "switch"
msgstr "Prepnú»" msgstr "Prepnú»"
@ -444,12 +507,12 @@ msgstr "iba ozn
msgid "ask for switch" msgid "ask for switch"
msgstr "opýta» sa na prepnutie" msgstr "opýta» sa na prepnutie"
msgid "Minutes before switching"
msgstr "Minúty pred prepnutím"
msgid "Switch Mode" msgid "Switch Mode"
msgstr "Prepínací re¾im" msgstr "Prepínací re¾im"
msgid "Create"
msgstr "Vytvori»"
msgid "Switch Timer sucessfully created" msgid "Switch Timer sucessfully created"
msgstr "Prepnutie je naplánované" msgstr "Prepnutie je naplánované"
@ -459,6 +522,12 @@ msgstr "Pl
msgid "Switch Timer deleted" msgid "Switch Timer deleted"
msgstr "Plán prepnutia vymazaný" msgstr "Plán prepnutia vymazaný"
msgid "Perform Search"
msgstr "Vykona» vyhµadávanie"
msgid "Search Mode"
msgstr "Re¾im vyhµadávania"
msgid "Channel to Search" msgid "Channel to Search"
msgstr "Hµada» na kanále" msgstr "Hµada» na kanále"
@ -474,9 +543,6 @@ msgstr "H
msgid "Show Search Options" msgid "Show Search Options"
msgstr "Zobrazi» mo¾nosti vyhµadávania" msgstr "Zobrazi» mo¾nosti vyhµadávania"
msgid "Perform Search"
msgstr "Vykona» vyhµadávanie"
msgid "search results for" msgid "search results for"
msgstr "vyhµadané výsledky pre" msgstr "vyhµadané výsledky pre"
@ -492,12 +558,12 @@ msgstr ""
msgid "Found" msgid "Found"
msgstr "Nájdené" msgstr "Nájdené"
msgid "recording"
msgstr "nahrávka"
msgid "recordings" msgid "recordings"
msgstr "nahrávky" msgstr "nahrávky"
msgid "recording"
msgstr "nahrávka"
msgid "for" msgid "for"
msgstr "pre" msgstr "pre"
@ -507,6 +573,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ý výraz" msgstr "kompletný výraz"
@ -522,6 +594,57 @@ msgstr "presn
msgid "regular expression" msgid "regular expression"
msgstr "regulárny výraz" msgstr "regulárny výraz"
msgid "fuzzy"
msgstr ""
msgid "allow empty"
msgstr ""
msgid "Interval"
msgstr ""
msgid "Channel Group"
msgstr ""
msgid "only FTA"
msgstr ""
msgid "same day"
msgstr ""
msgid "same week"
msgstr ""
msgid "same month"
msgstr ""
msgid "Record"
msgstr ""
msgid "Announce by OSD"
msgstr ""
msgid "Switch only"
msgstr ""
msgid "Announce and switch"
msgstr ""
msgid "Announce by mail"
msgstr ""
msgid "Inactive record"
msgstr ""
msgid "no"
msgstr ""
msgid "count recordings"
msgstr ""
msgid "count days"
msgstr ""
msgid "General Settings" msgid "General Settings"
msgstr "V¹eobecné nastavenia" msgstr "V¹eobecné nastavenia"
@ -567,6 +690,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» v hlavnom menu" msgstr "Zobrazi» v hlavnom menu"
@ -643,7 +769,7 @@ msgid "Display time in EPG Grids"
msgstr "Zobrazi» èas v EPG mrie¾ke" msgstr "Zobrazi» èas v EPG mrie¾ke"
msgid "Height of Headers (Status Header and EPG View, Perc. of osd height)" msgid "Height of Headers (Status Header and EPG View, Perc. of osd height)"
msgstr "" msgstr "Vý¹ka stavovej hlavièky (% z OSD vý¹ky)"
msgid "Height of Footer (Perc. of osd height)" msgid "Height of Footer (Perc. of osd height)"
msgstr "" msgstr ""
@ -774,19 +900,49 @@ msgstr ""
msgid "Use fixed folder" msgid "Use fixed folder"
msgstr "" msgstr ""
msgid "Folder for instant Recordings" msgid "smart"
msgstr "chytrý"
msgid "Instant recording:"
msgstr "" msgstr ""
msgid "Folder for instant Recordings"
msgstr "Pou¾i» adresáre pre okam¾ité nahrávky"
msgid "Folder"
msgstr ""
msgid "Add episode to manual timers"
msgstr "Prida¿ epizódy do ru¿ného ¿asova¿a"
msgid "Use Remotetimers" msgid "Use Remotetimers"
msgstr "Pou¾i» vzdialený plánovaè" msgstr "Pou¾i» vzdialený plánovaè"
msgid "Show timer confirmation messages"
msgstr ""
msgid "Favorites:"
msgstr ""
msgid "Limit channels in favorites"
msgstr ""
msgid "Start Channel"
msgstr "Od kanálu"
msgid "Stop Channel"
msgstr "Po kanál"
msgid "Use \"What's on now\" in favorites" msgid "Use \"What's on now\" in favorites"
msgstr "" msgstr ""
msgid "Use \"What's on next\" in favorites" msgid "Use \"What's on next\" in favorites"
msgstr "" msgstr ""
msgid "Use user defined time 1 in favorites" msgid "User defined times in favorites:"
msgstr ""
msgid "Use user defined time 1"
msgstr "" msgstr ""
msgid "Description" msgid "Description"
@ -795,16 +951,19 @@ msgstr ""
msgid "Time" msgid "Time"
msgstr "" msgstr ""
msgid "Use user defined time 2 in favorites" msgid "Use user defined time 2"
msgstr "" msgstr ""
msgid "Use user defined time 3 in favorites" msgid "Use user defined time 3"
msgstr "" msgstr ""
msgid "Use user defined time 4 in favorites" msgid "Use user defined time 4"
msgstr "" msgstr ""
msgid "Limit channels in favorites" msgid "Switchtimer:"
msgstr ""
msgid "Switch (x)min before start of the show"
msgstr "" msgstr ""
msgid "Create Log Messages for image loading" msgid "Create Log Messages for image loading"
@ -837,6 +996,9 @@ msgstr ""
msgid "Recording Menus Icon Cache" msgid "Recording Menus Icon Cache"
msgstr "" msgstr ""
msgid "A fancy 2d EPG Viewer"
msgstr ""
msgid "No Cast available" msgid "No Cast available"
msgstr "" msgstr ""
@ -847,7 +1009,7 @@ msgid "EPG Info"
msgstr "" msgstr ""
msgid "Reruns" msgid "Reruns"
msgstr "" msgstr "Repríza"
msgid "Recording Information" msgid "Recording Information"
msgstr "" msgstr ""
@ -906,9 +1068,6 @@ msgstr ""
msgid "yes" msgid "yes"
msgstr "" msgstr ""
msgid "no"
msgstr ""
msgid "Adult" msgid "Adult"
msgstr "" msgstr ""

View File

@ -1,4 +1,4 @@
#define __STL_CONFIG_H #define DISABLE_TEMPLATES_COLLIDING_WITH_STL
#include <string> #include <string>
#include <sstream> #include <sstream>
@ -10,6 +10,7 @@
#include "tools.h" #include "tools.h"
#include "switchtimer.h" #include "switchtimer.h"
#include "timerconflict.h" #include "timerconflict.h"
#include <vdr/timers.h>
#include "recmanager.h" #include "recmanager.h"
static int CompareRecording(const void *p1, const void *p2) { static int CompareRecording(const void *p1, const void *p2) {
@ -43,33 +44,48 @@ 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);
if (rtMatch.timerMatch == tmFull) if (rtMatch.timerMatch == tmFull)
hasTimer = true; hasTimer = true;
} else } else {
#if VDRVERSNUM >= 20301
eTimerMatch TimerMatch = tmNone;
LOCK_TIMERS_READ;
const cTimers *timers = Timers;
if (timers->GetMatch(event, &TimerMatch) && (TimerMatch == tmFull))
hasTimer = true;
#else
hasTimer = event->HasTimer(); hasTimer = event->HasTimer();
#endif
}
return hasTimer; return hasTimer;
} }
cTimer *cRecManager::GetTimerForEvent(const cEvent *event) { const cTimer *cRecManager::GetTimerForEvent(const cEvent *event) {
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);
timer = rtMatch.timer; timer = rtMatch.timer;
} else return timer;
}
#if VDRVERSNUM >= 20301
LOCK_TIMERS_READ;
timer = Timers->GetMatch(event);
#else
timer = Timers.GetMatch(event); timer = Timers.GetMatch(event);
#endif
return timer; return timer;
} }
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);
@ -79,20 +95,42 @@ 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);
cTimer *t = Timers.GetTimer(timer); #if VDRVERSNUM >= 20301
LOCK_TIMERS_WRITE;
cTimers* timers = Timers;
timers->SetExplicitModify();
if (Setup.SVDRPPeering && *Setup.SVDRPDefaultHost)
timer->SetRemote(Setup.SVDRPDefaultHost);
#else
cTimers* timers = &Timers;
#endif
cTimer *t = timers->GetTimer(timer);
if (t) { if (t) {
t->OnOff(); t->OnOff();
#if VDRVERSNUM >= 20301
t->SetEvent(event);
#else
t->SetEventFromSchedule(); t->SetEventFromSchedule();
#endif
delete timer; delete timer;
timer = t; timer = t;
isyslog("timer %s reactivated", *t->ToDescr()); isyslog("timer %s reactivated", *t->ToDescr());
} else { } else {
Timers.Add(timer); SetTimerPath(timer, event, path);
timers->Add(timer);
timers->SetModified();
#if VDRVERSNUM >= 20301
if (!HandleRemoteTimerModifications(timer)) {
timers->Del(timer);
esyslog(tr("tvguide: RemoteTimerModifications failed"));
} else {
isyslog("timer %s added (active)", *timer->ToDescr()); isyslog("timer %s added (active)", *timer->ToDescr());
} }
SetTimerPath(timer, event, path); #else
Timers.SetModified(); isyslog("timer %s added (active)", *timer->ToDescr());
return timer; #endif
}
return timers->GetTimer(timer);
} }
cTimer *cRecManager::createRemoteTimer(const cEvent *event, std::string path) { cTimer *cRecManager::createRemoteTimer(const cEvent *event, std::string path) {
@ -115,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)) {
@ -137,27 +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(), '/', '~');
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()); newFileName = cString::sprintf("%s~%s", path.c_str(), timer->File());
} else { } else {
if (addSubtitle)
newFileName = cString::sprintf("%s~%s", event->Title(), event->ShortText());
else
newFileName = event->Title(); newFileName = event->Title();
} }
timer->SetFile(*newFileName); timer->SetFile(*newFileName);
} }
void cRecManager::DeleteTimer(int timerID) {
cTimer *t = Timers.Get(timerID);
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);
@ -165,21 +209,48 @@ void cRecManager::DeleteTimer(const cEvent *event) {
} }
void cRecManager::DeleteLocalTimer(const cEvent *event) { void cRecManager::DeleteLocalTimer(const cEvent *event) {
cTimer *t = Timers.GetMatch(event); const cTimer *t;
#if VDRVERSNUM >= 20301
{
LOCK_TIMERS_READ;
t = Timers->GetMatch(event);
}
#else
t = Timers.GetMatch(event);
#endif
if (!t) if (!t)
return; return;
DeleteTimer(t); DeleteTimer(t);
} }
void cRecManager::DeleteTimer(const cTimer *timer) {
void cRecManager::DeleteTimer(cTimer *timer) { #if VDRVERSNUM >= 20301
if (timer->Recording()) { LOCK_TIMERS_WRITE;
timer->Skip(); cTimers* timers = Timers;
cRecordControls::Process(time(NULL)); if (timer && timer->Remote() && !timer->Recording()) {
if (HandleRemoteTimerModifications(NULL, (cTimer*)timer)) {
timers->Del((cTimer*)timer);
} }
isyslog("timer %s deleted", *timer->ToDescr()); timers->SetModified();
Timers.Del(timer, true); }
Timers.SetModified(); cTimer* t = timers->GetTimer(timer);
#else
cTimers* timers = &Timers;
cTimer* t = timers->GetTimer((cTimer*)timer);
#endif
if (!t)
return;
if (t->Recording()) {
t->Skip();
#if VDRVERSNUM >= 20301
cRecordControls::Process(timers, time(NULL));
#else
cRecordControls::Process(time(NULL));
#endif
}
isyslog("timer %s deleted", *t->ToDescr());
timers->Del(t, true);
timers->SetModified();
} }
void cRecManager::DeleteRemoteTimer(const cEvent *event) { void cRecManager::DeleteRemoteTimer(const cEvent *event) {
@ -196,17 +267,51 @@ void cRecManager::DeleteRemoteTimer(const cEvent *event) {
} }
} }
void cRecManager::SaveTimer(cTimer *timer, cTimer newTimerSettings) { void cRecManager::OnOffTimer(const cEvent *event) {
if (!timer) const cTimer *t;
#if VDRVERSNUM >= 20301
{
LOCK_TIMERS_READ;
t = Timers->GetMatch(event);
}
#else
t = Timers.GetMatch(event);
#endif
if (!t)
return;
SaveTimer(t);
}
void cRecManager::SaveTimer(const cTimer *t, cTimer *newTimerSettings) {
if (!t)
return; return;
bool active = newTimerSettings.HasFlags(tfActive); #if VDRVERSNUM >= 20301
int prio = newTimerSettings.Priority(); LOCK_TIMERS_WRITE;
int lifetime = newTimerSettings.Lifetime(); cTimers* timers = Timers;
time_t day = newTimerSettings.Day(); timers->SetExplicitModify();
int start = newTimerSettings.Start(); if (t && t->Remote()) {
int stop = newTimerSettings.Stop(); if (!HandleRemoteTimerModifications(newTimerSettings, (cTimer *)t)) {
std::string fileName = newTimerSettings.File(); esyslog(tr("tvguide: RemoteTimerModifications failed"));
}
}
cTimer *timer = timers->GetTimer(t);
#else
cTimers* timers = &Timers;
cTimer *timer = timers->GetTimer((cTimer *)t);
#endif
if (!timer) {
return;
}
bool active = true;
if (newTimerSettings) {
int prio = newTimerSettings->Priority();
int lifetime = newTimerSettings->Lifetime();
time_t day = newTimerSettings->Day();
int start = newTimerSettings->Start();
int stop = newTimerSettings->Stop();
std::string fileName = newTimerSettings->File();
timer->SetDay(day); timer->SetDay(day);
timer->SetStart(start); timer->SetStart(start);
@ -215,26 +320,36 @@ void cRecManager::SaveTimer(cTimer *timer, cTimer newTimerSettings) {
timer->SetLifetime(lifetime); timer->SetLifetime(lifetime);
timer->SetFile(fileName.c_str()); timer->SetFile(fileName.c_str());
if (timer->HasFlags(tfActive) && !active) active = newTimerSettings->HasFlags(tfActive);
timer->ClrFlags(tfActive); } else
else if (!timer->HasFlags(tfActive) && active) active = !timer->HasFlags(tfActive);
timer->SetFlags(tfActive);
if (active)
timer->SetFlags(tfActive);
else
timer->ClrFlags(tfActive);
#if VDRVERSNUM < 20300
timer->SetEventFromSchedule(); timer->SetEventFromSchedule();
if (tvguideConfig.useRemoteTimers && pRemoteTimers) { #endif
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))
rt.timer = NULL; rt.timer = NULL;
RefreshRemoteTimers(); RefreshRemoteTimers();
} else { } else {
Timers.SetModified(); timers->SetModified();
} }
} }
bool cRecManager::IsRecorded(const cEvent *event) { bool cRecManager::IsRecorded(const cEvent *event) {
#if VDRVERSNUM >= 20301
LOCK_TIMERS_WRITE;
cTimer *timer = Timers->GetMatch(event);
#else
cTimer *timer = Timers.GetMatch(event); cTimer *timer = Timers.GetMatch(event);
#endif
if (!timer) if (!timer)
return false; return false;
return timer->Recording(); return timer->Recording();
@ -260,16 +375,24 @@ cTVGuideTimerConflicts *cRecManager::CheckTimerConflict(void) {
} }
void cRecManager::CreateSeriesTimer(cTimer *seriesTimer) { void cRecManager::CreateSeriesTimer(cTimer *seriesTimer) {
#if VDRVERSNUM < 20300
seriesTimer->SetEventFromSchedule(); seriesTimer->SetEventFromSchedule();
if (tvguideConfig.useRemoteTimers && pRemoteTimers) { #endif
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))
isyslog("%s", *rt.errorMsg); isyslog("%s", *rt.errorMsg);
RefreshRemoteTimers(); RefreshRemoteTimers();
} else { } else {
Timers.Add(seriesTimer); #if VDRVERSNUM >= 20301
Timers.SetModified(); LOCK_TIMERS_WRITE;
cTimers* timers = Timers;
#else
cTimers* timers = &Timers;
#endif
timers->Add(seriesTimer);
timers->SetModified();
} }
} }
@ -316,9 +439,16 @@ const cEvent **cRecManager::PerformSearchTimerSearch(std::string epgSearchString
numResults = results.size(); numResults = results.size();
if (numResults > 0) { if (numResults > 0) {
searchResults = new const cEvent *[numResults]; searchResults = new const cEvent *[numResults];
cSchedulesLock schedulesLock;
const cSchedules *schedules; const cSchedules *schedules;
#if VDRVERSNUM >= 20301
{
LOCK_SCHEDULES_READ;
schedules = Schedules;
}
#else
cSchedulesLock schedulesLock;
schedules = cSchedules::Schedules(schedulesLock); schedules = cSchedules::Schedules(schedulesLock);
#endif
const cEvent *event = NULL; const cEvent *event = NULL;
int index=0; int index=0;
for (std::list<std::string>::iterator it=results.begin(); it != results.end(); ++it) { for (std::list<std::string>::iterator it=results.begin(); it != results.end(); ++it) {
@ -328,7 +458,15 @@ const cEvent **cRecManager::PerformSearchTimerSearch(std::string epgSearchString
int eventID = atoi(flds[1].c_str()); int eventID = atoi(flds[1].c_str());
std::string channelID = flds[7]; std::string channelID = flds[7];
tChannelID chanID = tChannelID::FromString(channelID.c_str()); tChannelID chanID = tChannelID::FromString(channelID.c_str());
cChannel *channel = Channels.GetByChannelID(chanID); const cChannel *channel;
#if VDRVERSNUM >= 20301
{
LOCK_CHANNELS_READ;
channel = Channels->GetByChannelID(chanID);
}
#else
channel = Channels.GetByChannelID(chanID);
#endif
if (channel) { if (channel) {
const cSchedule *Schedule = NULL; const cSchedule *Schedule = NULL;
Schedule = schedules->GetSchedule(channel); Schedule = schedules->GetSchedule(channel);
@ -389,6 +527,52 @@ void cRecManager::GetSearchTimers(std::vector<cTVGuideSearchTimer> *searchTimer)
std::sort(searchTimer->begin(), searchTimer->end()); std::sort(searchTimer->begin(), searchTimer->end());
} }
void cRecManager::GetSearchExtCats(std::vector<std::string> *searchExtCats) {
if (!epgSearchAvailable) {
return;
}
Epgsearch_services_v1_1 *epgSearch = new Epgsearch_services_v1_1;
if (epgSearchPlugin->Service("Epgsearch-services-v1.1", epgSearch)) {
std::list<std::string> list;
list = epgSearch->handler->ExtEPGInfoList();
for (std::list<std::string>::iterator it = list.begin(); it != list.end(); it++) {
searchExtCats->push_back(*it);
}
}
}
void cRecManager::GetChannelGroups(std::vector<std::string> *channelGroups) {
if (!epgSearchAvailable) {
return;
}
Epgsearch_services_v1_1 *epgSearch = new Epgsearch_services_v1_1;
if (epgSearchPlugin->Service("Epgsearch-services-v1.1", epgSearch)) {
std::list<std::string> list;
list = epgSearch->handler->ChanGrpList();
for (std::list<std::string>::iterator it = list.begin(); it != list.end(); it++) {
channelGroups->push_back(*it);
}
}
std::sort(channelGroups->begin(), channelGroups->end());
}
void cRecManager::GetBlacklists(std::vector<std::string> *blacklists) {
if (!epgSearchAvailable) {
return;
}
Epgsearch_services_v1_1 *epgSearch = new Epgsearch_services_v1_1;
if (epgSearchPlugin->Service("Epgsearch-services-v1.1", epgSearch)) {
std::list<std::string> list;
list = epgSearch->handler->BlackList();
for (std::list<std::string>::iterator it = list.begin(); it != list.end(); it++) {
blacklists->push_back(*it);
}
}
}
int cRecManager::CreateSearchTimer(std::string epgSearchString) { int cRecManager::CreateSearchTimer(std::string epgSearchString) {
int timerID = -1; int timerID = -1;
if (!epgSearchAvailable) if (!epgSearchAvailable)
@ -435,24 +619,33 @@ void cRecManager::DeleteSearchTimer(cTVGuideSearchTimer *searchTimer, bool delTi
return; return;
int searchTimerID = searchTimer->GetID(); int searchTimerID = searchTimer->GetID();
if (delTimers) { if (delTimers) {
cTimer *timer = Timers.First(); cTimers* timers;
while(timer) { #if VDRVERSNUM >= 20301
{
LOCK_TIMERS_WRITE;
timers = Timers;
}
#else
timers = &Timers;
#endif
cTimer *timer = timers->First();
while (timer) {
if (!timer->Recording()) { if (!timer->Recording()) {
char* searchID = GetAuxValue(timer, "s-id"); char* searchID = GetAuxValue(timer, "s-id");
if (searchID) { if (searchID) {
if (searchTimerID == atoi(searchID)) { if (searchTimerID == atoi(searchID)) {
cTimer* timerNext = Timers.Next(timer); cTimer* timerNext = timers->Next(timer);
DeleteTimer(timer); DeleteTimer(timer);
timer = timerNext; timer = timerNext;
} else { } else {
timer = Timers.Next(timer); timer = timers->Next(timer);
} }
free(searchID); free(searchID);
} else { } else {
timer = Timers.Next(timer); timer = timers->Next(timer);
} }
} else { } else {
timer = Timers.Next(timer); timer = timers->Next(timer);
} }
} }
} }
@ -460,9 +653,9 @@ void cRecManager::DeleteSearchTimer(cTVGuideSearchTimer *searchTimer, bool delTi
if (epgSearchPlugin->Service("Epgsearch-services-v1.1", epgSearch)) { if (epgSearchPlugin->Service("Epgsearch-services-v1.1", epgSearch)) {
bool success = epgSearch->handler->DelSearchTimer(searchTimerID); bool success = epgSearch->handler->DelSearchTimer(searchTimerID);
if (success) { if (success) {
esyslog("tvguide: search timer \"%s\" sucessfully deleted", searchTimer->SearchString().c_str()); esyslog("tvguide: search timer \"%s\" sucessfully deleted", searchTimer->GetSearchString().c_str());
} else { } else {
esyslog("tvguide: error deleting search timer \"%s\"", searchTimer->SearchString().c_str()); esyslog("tvguide: error deleting search timer \"%s\"", searchTimer->GetSearchString().c_str());
} }
} }
} }
@ -475,14 +668,14 @@ void cRecManager::UpdateSearchTimers(void) {
} }
} }
// announceOnly: 0 = switch, 1 = announce only, 2 = ask for switch // switchMode: 0 = switch, 1 = announce only, 2 = ask for switch
bool cRecManager::CreateSwitchTimer(const cEvent *event, cSwitchTimer switchTimer) { bool cRecManager::CreateSwitchTimer(const cEvent *event, cSwitchTimer switchTimer) {
if (epgSearchAvailable && event) { if (epgSearchAvailable && event) {
Epgsearch_switchtimer_v1_0 data; Epgsearch_switchtimer_v1_0 data;
data.event = event; data.event = event;
data.mode = 1; data.mode = 1;
data.switchMinsBefore = switchTimer.switchMinsBefore; data.switchMinsBefore = switchTimer.switchMinsBefore;
data.announceOnly = switchTimer.announceOnly; data.announceOnly = switchTimer.switchMode;
data.success = false; data.success = false;
epgSearchPlugin->Service("Epgsearch-switchtimer-v1.0", &data); epgSearchPlugin->Service("Epgsearch-switchtimer-v1.0", &data);
cSwitchTimer *t = new cSwitchTimer(event); cSwitchTimer *t = new cSwitchTimer(event);
@ -505,13 +698,20 @@ void cRecManager::DeleteSwitchTimer(const cEvent *event) {
} }
} }
cRecording **cRecManager::SearchForRecordings(std::string searchString, int &numResults) { const cRecording **cRecManager::SearchForRecordings(std::string searchString, int &numResults) {
cRecording **matchingRecordings = NULL; const cRecording **matchingRecordings = NULL;
int num = 0; int num = 0;
numResults = 0; numResults = 0;
for (cRecording *recording = Recordings.First(); recording; recording = Recordings.Next(recording)) { #if VDRVERSNUM >= 20301
LOCK_RECORDINGS_READ;
const cRecordings* recordings = Recordings;
#else
const cRecordings* recordings = &Recordings;
#endif
for (const cRecording *recording = recordings->First(); recording; recording = recordings->Next(recording)) {
std::string s1 = recording->Name(); std::string s1 = recording->Name();
std::string s2 = searchString; std::string s2 = searchString;
if (s1.empty() || s2.empty()) continue; if (s1.empty() || s2.empty()) continue;
@ -542,7 +742,7 @@ cRecording **cRecManager::SearchForRecordings(std::string searchString, int &num
} }
if (match) { if (match) {
matchingRecordings = (cRecording **)realloc(matchingRecordings, (num + 1) * sizeof(cRecording *)); matchingRecordings = (const cRecording **)realloc(matchingRecordings, (num + 1) * sizeof(cRecording *));
matchingRecordings[num++] = recording; matchingRecordings[num++] = recording;
} }
} }
@ -558,8 +758,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();
@ -619,17 +819,25 @@ void cRecManager::GetFavorites(std::vector<cTVGuideSearchTimer> *favorites) {
const cEvent **cRecManager::WhatsOnNow(bool nowOrNext, int &numResults) { const cEvent **cRecManager::WhatsOnNow(bool nowOrNext, int &numResults) {
std::vector<const cEvent*> tmpResults; std::vector<const cEvent*> tmpResults;
#if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ;
const cChannels* channels = Channels;
LOCK_SCHEDULES_READ;
const cSchedules* schedules = Schedules;
#else
cChannels* channels = &Channels;
cSchedulesLock schedulesLock; cSchedulesLock schedulesLock;
const cSchedules *schedules = cSchedules::Schedules(schedulesLock); const cSchedules *schedules = cSchedules::Schedules(schedulesLock);
#endif
const cChannel *startChannel = NULL, *stopChannel = NULL; const cChannel *startChannel = NULL, *stopChannel = NULL;
if (tvguideConfig.favLimitChannels) { if (config.favLimitChannels) {
startChannel = Channels.GetByNumber(tvguideConfig.favStartChannel); startChannel = channels->GetByNumber(config.favStartChannel);
stopChannel = Channels.GetByNumber(tvguideConfig.favStopChannel); stopChannel = channels->GetByNumber(config.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)) {
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;
@ -658,13 +866,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);
@ -679,17 +887,25 @@ const cEvent **cRecManager::UserDefinedTime(int userTime, int &numResults) {
if (searchTime < now) if (searchTime < now)
searchTime += 24*60*60; searchTime += 24*60*60;
#if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ;
const cChannels* channels = Channels;
LOCK_SCHEDULES_READ;
const cSchedules* schedules = Schedules;
#else
cChannels* channels = &Channels;
cSchedulesLock schedulesLock; cSchedulesLock schedulesLock;
const cSchedules *schedules = cSchedules::Schedules(schedulesLock); const cSchedules *schedules = cSchedules::Schedules(schedulesLock);
#endif
const cChannel *startChannel = NULL, *stopChannel = NULL; const cChannel *startChannel = NULL, *stopChannel = NULL;
if (tvguideConfig.favLimitChannels) { if (config.favLimitChannels) {
startChannel = Channels.GetByNumber(tvguideConfig.favStartChannel); startChannel = channels->GetByNumber(config.favStartChannel);
stopChannel = Channels.GetByNumber(tvguideConfig.favStopChannel); stopChannel = channels->GetByNumber(config.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)) {
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;

View File

@ -28,17 +28,17 @@ public:
bool EpgSearchAvailable(void) {return epgSearchAvailable;}; bool EpgSearchAvailable(void) {return epgSearchAvailable;};
bool RefreshRemoteTimers(void); bool RefreshRemoteTimers(void);
bool CheckEventForTimer(const cEvent *event); bool CheckEventForTimer(const cEvent *event);
cTimer *GetTimerForEvent(const cEvent *event); const cTimer *GetTimerForEvent(const cEvent *event);
cTimer *createTimer(const cEvent *event, std::string path = ""); cTimer *createTimer(const cEvent *event, std::string path = "");
cTimer *createLocalTimer(const cEvent *event, std::string path); cTimer *createLocalTimer(const cEvent *event, std::string path);
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(cTimer *timer); void OnOffTimer(const cEvent *event);
void DeleteTimer(int timerID); void DeleteTimer(const cTimer *timer);
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(cTimer *timer, cTimer newTimerSettings); void SaveTimer(const cTimer *timer, cTimer *newTimerSettings = NULL);
bool IsRecorded(const cEvent *event); bool IsRecorded(const cEvent *event);
cTVGuideTimerConflicts *CheckTimerConflict(void); cTVGuideTimerConflicts *CheckTimerConflict(void);
void CreateSeriesTimer(cTimer *seriesTimer); void CreateSeriesTimer(cTimer *seriesTimer);
@ -46,13 +46,16 @@ public:
const cEvent **PerformSearch(Epgsearch_searchresults_v1_0 data, int &numResults); const cEvent **PerformSearch(Epgsearch_searchresults_v1_0 data, int &numResults);
void ReadEPGSearchTemplates(std::vector<TVGuideEPGSearchTemplate> *epgTemplates); void ReadEPGSearchTemplates(std::vector<TVGuideEPGSearchTemplate> *epgTemplates);
void GetSearchTimers(std::vector<cTVGuideSearchTimer> *timers); void GetSearchTimers(std::vector<cTVGuideSearchTimer> *timers);
void GetSearchExtCats(std::vector<std::string> *searchExtCats);
void GetChannelGroups(std::vector<std::string> *channelGroups);
void GetBlacklists(std::vector<std::string> *blacklists);
int CreateSearchTimer(std::string epgSearchString); int CreateSearchTimer(std::string epgSearchString);
bool SaveSearchTimer(cTVGuideSearchTimer *searchTimer); bool SaveSearchTimer(cTVGuideSearchTimer *searchTimer);
void DeleteSearchTimer(cTVGuideSearchTimer *searchTimer, bool delTimers); void DeleteSearchTimer(cTVGuideSearchTimer *searchTimer, bool delTimers);
void UpdateSearchTimers(void); void UpdateSearchTimers(void);
bool CreateSwitchTimer(const cEvent *event, cSwitchTimer switchTimer); bool CreateSwitchTimer(const cEvent *event, cSwitchTimer switchTimer);
void DeleteSwitchTimer(const cEvent *event); void DeleteSwitchTimer(const cEvent *event);
cRecording **SearchForRecordings(std::string searchString, int &numResults); const cRecording **SearchForRecordings(std::string searchString, int &numResults);
const cEvent **LoadReruns(const cEvent *event, int &numResults); const cEvent **LoadReruns(const cEvent *event, int &numResults);
void GetFavorites(std::vector<cTVGuideSearchTimer> *favorites); void GetFavorites(std::vector<cTVGuideSearchTimer> *favorites);
const cEvent **WhatsOnNow(bool nowOrNext, int &numResults); const cEvent **WhatsOnNow(bool nowOrNext, int &numResults);

128
recmenu.c
View File

@ -5,7 +5,7 @@
cRecMenu::cRecMenu(void) { cRecMenu::cRecMenu(void) {
border = geoManager.borderRecMenus; border = geoManager.borderRecMenus;
height = 2*border; height = 2 * border;
headerHeight = 0; headerHeight = 0;
footerHeight = 0; footerHeight = 0;
currentHeight = 0; currentHeight = 0;
@ -28,7 +28,7 @@ cRecMenu::~cRecMenu(void) {
if (footer) if (footer)
delete footer; delete footer;
if (pixmapScrollBar) if (pixmapScrollBar)
osdManager.releasePixmap(pixmapScrollBar); osdManager.DestroyPixmap(pixmapScrollBar);
if (imgScrollBar) if (imgScrollBar)
delete imgScrollBar; delete imgScrollBar;
} }
@ -54,49 +54,53 @@ int cRecMenu::CalculateOptimalWidth(void) {
} }
bool cRecMenu::CalculateHeight(bool reDraw) { bool cRecMenu::CalculateHeight(bool reDraw) {
int newHeight = 2*border; int newHeight = 2 * border;
if (header) bool returnvalue = false;
if (header) {
newHeight += headerHeight; newHeight += headerHeight;
}
for (std::list<cRecMenuItem*>::iterator item = menuItems.begin(); item != menuItems.end(); item++) { for (std::list<cRecMenuItem*>::iterator item = menuItems.begin(); item != menuItems.end(); item++) {
newHeight += (*item)->GetHeight(); newHeight += (*item)->GetHeight();
} }
if (footer) if (footer) {
newHeight += footerHeight; newHeight += footerHeight;
}
y = (geoManager.osdHeight - newHeight) / 2; y = (geoManager.osdHeight - newHeight) / 2;
if (newHeight != height) { if (newHeight != height) {
height = newHeight; height = newHeight;
returnvalue = true;
}
if (scrollable && !reDraw) { if (scrollable && !reDraw) {
width += scrollbarWidth + border; width += scrollbarWidth + border;
returnvalue = true;
} }
return true; return returnvalue;
}
return false;
} }
void cRecMenu::CreatePixmap(void) { void cRecMenu::CreatePixmap(void) {
if (pixmap) if (pixmap)
osdManager.releasePixmap(pixmap); osdManager.DestroyPixmap(pixmap);
pixmap = osdManager.requestPixmap(3, cRect(x, y, width, height)); pixmap = osdManager.CreatePixmap(3, cRect(x, y, width, height));
if (scrollable) { if (scrollable) {
int scrollBarX = x + width - scrollbarWidth - border; int scrollBarX = x + width - scrollbarWidth - border;
int scrollBarY = y + border + headerHeight; int scrollBarY = y + border + headerHeight;
int scrollBarHeight = height - headerHeight - footerHeight - 2 * border; int scrollBarHeight = height - headerHeight - footerHeight - 2 * border;
if (pixmapScrollBar) if (pixmapScrollBar)
osdManager.releasePixmap(pixmapScrollBar); osdManager.DestroyPixmap(pixmapScrollBar);
pixmapScrollBar = osdManager.requestPixmap(4, cRect(scrollBarX, scrollBarY, scrollbarWidth, scrollBarHeight)); pixmapScrollBar = osdManager.CreatePixmap(4, cRect(scrollBarX, scrollBarY, scrollbarWidth, scrollBarHeight));
} else } else
pixmapScrollBar = NULL; pixmapScrollBar = NULL;
} }
void cRecMenu::SetHeader(cRecMenuItem *header) { void cRecMenu::AddHeader(cRecMenuItem *header) {
this->header = header; this->header = header;
headerHeight = header->GetHeight(); headerHeight = header->GetHeight();
height += headerHeight; height += headerHeight;
} }
void cRecMenu::SetFooter(cRecMenuItem *footer) { void cRecMenu::AddFooter(cRecMenuItem *footer) {
this->footer = footer; this->footer = footer;
footerHeight = footer->GetHeight(); footerHeight = footer->GetHeight();
height += footerHeight; height += footerHeight;
@ -117,12 +121,11 @@ void cRecMenu::InitMenu(bool complete) {
numItems = 0; numItems = 0;
if (scrollable) { if (scrollable) {
width -= scrollbarWidth + border; width -= scrollbarWidth + border;
osdManager.releasePixmap(pixmapScrollBar); osdManager.DestroyPixmap(pixmapScrollBar);
pixmapScrollBar = NULL; pixmapScrollBar = NULL;
delete imgScrollBar; DELETENULL(imgScrollBar);
imgScrollBar = NULL;
} }
osdManager.releasePixmap(pixmap); osdManager.DestroyPixmap(pixmap);
pixmap = NULL; pixmap = NULL;
for (std::list<cRecMenuItem*>::iterator it = menuItems.begin(); it != menuItems.end(); it++) { for (std::list<cRecMenuItem*>::iterator it = menuItems.begin(); it != menuItems.end(); it++) {
if (deleteMenuItems) if (deleteMenuItems)
@ -141,7 +144,6 @@ void cRecMenu::InitMenu(bool complete) {
} }
void cRecMenu::AddMenuItem(cRecMenuItem *item, bool inFront) { void cRecMenu::AddMenuItem(cRecMenuItem *item, bool inFront) {
item->Show(); item->Show();
if (!inFront) if (!inFront)
@ -153,7 +155,7 @@ void cRecMenu::AddMenuItem(cRecMenuItem *item, bool inFront) {
bool cRecMenu::AddMenuItemInitial(cRecMenuItem *item, bool inFront) { bool cRecMenu::AddMenuItemInitial(cRecMenuItem *item, bool inFront) {
currentHeight += item->GetHeight(); currentHeight += item->GetHeight();
int totalHeight = headerHeight + footerHeight + currentHeight + 2*border; int totalHeight = headerHeight + footerHeight + currentHeight + 2*border;
if (totalHeight >= geoManager.osdHeight - 10) { if (totalHeight >= geoManager.osdHeight - 80) {
scrollable = true; scrollable = true;
currentHeight -= item->GetHeight(); currentHeight -= item->GetHeight();
if (deleteMenuItems) { if (deleteMenuItems) {
@ -176,14 +178,14 @@ void cRecMenu::Activate(cRecMenuItem *itemOld, cRecMenuItem *item) {
itemOld->setInactive(); itemOld->setInactive();
itemOld->setBackground(); itemOld->setBackground();
itemOld->Draw(); itemOld->Draw();
item->setActive(); item->SetActive();
item->setBackground(); item->setBackground();
item->Draw(); item->Draw();
} }
bool cRecMenu::ActivatePrev(void) { bool cRecMenu::ActivatePrev(void) {
cRecMenuItem *activeItem = GetActiveMenuItem(); cRecMenuItem *activeItem = GetActiveMenuItem();
if (!scrollable && footer && footer->isActive()) { if (!scrollable && footer && footer->IsActive()) {
if (menuItems.size() > 0) { if (menuItems.size() > 0) {
cRecMenuItem *itemLast = menuItems.back(); cRecMenuItem *itemLast = menuItems.back();
Activate(footer, itemLast); Activate(footer, itemLast);
@ -214,7 +216,7 @@ bool cRecMenu::ActivatePrev(void) {
} }
bool cRecMenu::ScrollUp(void) { bool cRecMenu::ScrollUp(void) {
if (footer && footer->isActive()) { if (footer && footer->IsActive()) {
if (menuItems.size() > 0) if (menuItems.size() > 0)
Activate(footer, menuItems.back()); Activate(footer, menuItems.back());
} else { } else {
@ -272,7 +274,7 @@ bool cRecMenu::ActivateNext(void) {
if (next) { if (next) {
Activate(activeItem , next); Activate(activeItem , next);
return true; return true;
} else if (!scrollable && footer && footer->isSelectable() && !footer->isActive()) { } else if (!scrollable && footer && footer->isSelectable() && !footer->IsActive()) {
Activate(activeItem , footer); Activate(activeItem , footer);
return true; return true;
} }
@ -310,7 +312,7 @@ bool cRecMenu::ScrollDown(void) {
ActivateNext(); ActivateNext();
} else { } else {
//last item reached, activate footer if not already active //last item reached, activate footer if not already active
if ((footer) && !(footer->isActive())) { if ((footer) && !(footer->IsActive())) {
cRecMenuItem *activeItem = GetActiveMenuItem(); cRecMenuItem *activeItem = GetActiveMenuItem();
Activate(activeItem , footer); Activate(activeItem , footer);
} else { } else {
@ -332,7 +334,7 @@ void cRecMenu::PageUp(void) {
Activate(footer, menuItems.front()); Activate(footer, menuItems.front());
return; return;
} }
int newActive = GetActive() - numItems; int newActive = GetNumActive() - numItems;
if (newActive < 0) if (newActive < 0)
newActive = 0; newActive = 0;
activeItem->setInactive(); activeItem->setInactive();
@ -345,7 +347,7 @@ void cRecMenu::PageUp(void) {
bool spaceLeft = true; bool spaceLeft = true;
while (newItem = GetMenuItem(startIndex-1)) { while (newItem = GetMenuItem(startIndex-1)) {
if (startIndex-1 == newActive) if (startIndex-1 == newActive)
newItem->setActive(); newItem->SetActive();
spaceLeft = AddMenuItemInitial(newItem, true); spaceLeft = AddMenuItemInitial(newItem, true);
if (!spaceLeft) if (!spaceLeft)
break; break;
@ -357,8 +359,8 @@ void cRecMenu::PageUp(void) {
break; break;
} }
} }
if (GetActive() == numItems) if (GetNumActive() == numItems)
menuItems.front()->setActive(); menuItems.front()->SetActive();
if (CalculateHeight(true)) if (CalculateHeight(true))
CreatePixmap(); CreatePixmap();
Arrange(deleteMenuItems); Arrange(deleteMenuItems);
@ -376,7 +378,7 @@ void cRecMenu::PageDown(void) {
JumpEnd(); JumpEnd();
return; return;
} }
int newActive = GetActive() + numItems; int newActive = GetNumActive() + numItems;
activeItem->setInactive(); activeItem->setInactive();
activeItem->setBackground(); activeItem->setBackground();
ClearMenuItems(); ClearMenuItems();
@ -387,7 +389,7 @@ void cRecMenu::PageDown(void) {
bool spaceLeft = true; bool spaceLeft = true;
while (newItem = GetMenuItem(stopIndex)) { while (newItem = GetMenuItem(stopIndex)) {
if (stopIndex == newActive) if (stopIndex == newActive)
newItem->setActive(); newItem->SetActive();
spaceLeft = AddMenuItemInitial(newItem); spaceLeft = AddMenuItemInitial(newItem);
if (!spaceLeft) if (!spaceLeft)
break; break;
@ -399,8 +401,8 @@ void cRecMenu::PageDown(void) {
break; break;
} }
} }
if (GetActive() == GetTotalNumMenuItems()) if (GetNumActive() == GetTotalNumMenuItems())
menuItems.back()->setActive(); menuItems.back()->SetActive();
if (CalculateHeight(true)) if (CalculateHeight(true))
CreatePixmap(); CreatePixmap();
Arrange(deleteMenuItems); Arrange(deleteMenuItems);
@ -434,14 +436,16 @@ void cRecMenu::JumpBegin(void) {
if (currentItem >= numItems) if (currentItem >= numItems)
break; break;
} }
Arrange(true); if (CalculateHeight(true))
CreatePixmap();
Arrange(false);
startIndex = 0; startIndex = 0;
stopIndex = numItems-1; stopIndex = currentItem;
cRecMenuItem *first = menuItems.front(); cRecMenuItem *first = menuItems.front();
first->setActive(); first->SetActive();
first->setBackground(); first->setBackground();
first->Draw(); first->Draw();
Display(true); Display(false);
} }
} }
@ -470,7 +474,7 @@ void cRecMenu::JumpEnd(void) {
activeItem->setBackground(); activeItem->setBackground();
ClearMenuItems(); ClearMenuItems();
int totalNumItems = GetTotalNumMenuItems(); int totalNumItems = GetTotalNumMenuItems();
int currentItem = totalNumItems-1; int currentItem = totalNumItems - 1;
int itemsAdded = 0; int itemsAdded = 0;
cRecMenuItem *newItem = NULL; cRecMenuItem *newItem = NULL;
while (newItem = GetMenuItem(currentItem)) { while (newItem = GetMenuItem(currentItem)) {
@ -480,20 +484,22 @@ void cRecMenu::JumpEnd(void) {
if (itemsAdded >= numItems) if (itemsAdded >= numItems)
break; break;
} }
Arrange(true); if (CalculateHeight(true))
CreatePixmap();
Arrange(false);
stopIndex = totalNumItems; stopIndex = totalNumItems;
startIndex = stopIndex - numItems; startIndex = stopIndex - numItems;
if (footer) { if (footer) {
footer->setActive(); footer->SetActive();
footer->setBackground(); footer->setBackground();
footer->Draw(); footer->Draw();
} else { } else {
cRecMenuItem *last = menuItems.back(); cRecMenuItem *last = menuItems.back();
last->setActive(); last->SetActive();
last->setBackground(); last->setBackground();
last->Draw(); last->Draw();
} }
Display(true); Display(false);
} }
} }
@ -525,7 +531,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));
@ -582,13 +588,17 @@ void cRecMenu::UpdateActiveMenuItem(void) {
void cRecMenu::DrawScrollBar(void) { void cRecMenu::DrawScrollBar(void) {
if (!pixmapScrollBar)
return;
pixmapScrollBar->Fill(theme.Color(clrBorder)); pixmapScrollBar->Fill(theme.Color(clrBorder));
pixmapScrollBar->DrawRectangle(cRect(2,2,pixmapScrollBar->ViewPort().Width()-4, pixmapScrollBar->ViewPort().Height() - 4), theme.Color(clrBackground)); pixmapScrollBar->DrawRectangle(cRect(2, 2, pixmapScrollBar->ViewPort().Width() - 4, pixmapScrollBar->ViewPort().Height() - 4), theme.Color(clrBackground));
int totalNumItems = GetTotalNumMenuItems(); int totalNumItems = GetTotalNumMenuItems();
if (imgScrollBar == NULL) { if (!totalNumItems)
return;
if (!imgScrollBar) {
int scrollBarImgHeight = (pixmapScrollBar->ViewPort().Height() - 8) * numItems / totalNumItems; int scrollBarImgHeight = (pixmapScrollBar->ViewPort().Height() - 8) * numItems / totalNumItems;
imgScrollBar = createScrollbar(pixmapScrollBar->ViewPort().Width()-8, scrollBarImgHeight, theme.Color(clrHighlight), theme.Color(clrHighlightBlending)); imgScrollBar = createScrollbar(pixmapScrollBar->ViewPort().Width() - 8, scrollBarImgHeight, theme.Color(clrHighlight), theme.Color(clrHighlightBlending));
} }
int offset = (pixmapScrollBar->ViewPort().Height() - 8) * startIndex / totalNumItems; int offset = (pixmapScrollBar->ViewPort().Height() - 8) * startIndex / totalNumItems;
pixmapScrollBar->DrawImage(cPoint(4, 2 + offset), *imgScrollBar); pixmapScrollBar->DrawImage(cPoint(4, 2 + offset), *imgScrollBar);
@ -596,10 +606,10 @@ void cRecMenu::DrawScrollBar(void) {
cRecMenuItem *cRecMenu::GetActiveMenuItem(void) { cRecMenuItem *cRecMenu::GetActiveMenuItem(void) {
for (std::list<cRecMenuItem*>::iterator item = menuItems.begin(); item != menuItems.end(); item++) { for (std::list<cRecMenuItem*>::iterator item = menuItems.begin(); item != menuItems.end(); item++) {
if ((*item)->isActive()) if ((*item)->IsActive())
return *item; return *item;
} }
if (footer && footer->isActive()) if (footer && footer->IsActive())
return footer; return footer;
return NULL; return NULL;
} }
@ -614,10 +624,10 @@ cRecMenuItem *cRecMenu::GetMenuItemAt(int num) {
return NULL; return NULL;
} }
int cRecMenu::GetActive(void) { int cRecMenu::GetNumActive(void) {
int numActive = startIndex; int numActive = startIndex;
for (std::list<cRecMenuItem*>::iterator item = menuItems.begin(); item != menuItems.end(); item++) { for (std::list<cRecMenuItem*>::iterator item = menuItems.begin(); item != menuItems.end(); item++) {
if ((*item)->isActive()) { if ((*item)->IsActive()) {
break; break;
} }
numActive++; numActive++;
@ -667,25 +677,21 @@ 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 (height >= 32 && config.style != eStyleFlat) {
int numSteps = 64; int numSteps = 64;
int alphaStep = 0x03; int alphaStep = 0x03;
if (height < 30) if (height < 100) {
return image;
else if (height < 100) {
numSteps = 32; numSteps = 32;
alphaStep = 0x06; alphaStep = 0x06;
} }
int stepY = 0.5*height / numSteps; int stepY = std::max(1, (int)(0.5 * height / numSteps));
if (stepY == 0)
stepY = 1;
int alpha = 0x40; int alpha = 0x40;
tColor clr; tColor clr;
for (int i = 0; i<numSteps; i++) { for (int i = 0; i < numSteps; i++) {
clr = AlphaBlend(clrBgr, clrBlend, alpha); clr = AlphaBlend(clrBgr, clrBlend, alpha);
for (int y = i*stepY; y < (i+1)*stepY; y++) { for (int y = i * stepY; y < (i + 1) * stepY; y++) {
for (int x=0; x<width; x++) { for (int x = 0; x < width; x++) {
image->SetPixel(cPoint(x,y), clr); image->SetPixel(cPoint(x, y), clr);
} }
} }
alpha += alphaStep; alpha += alphaStep;

View File

@ -37,8 +37,8 @@ protected:
int CalculateOptimalWidth(void); int CalculateOptimalWidth(void);
bool CalculateHeight(bool reDraw = false); bool CalculateHeight(bool reDraw = false);
void CreatePixmap(void); void CreatePixmap(void);
void SetHeader(cRecMenuItem *header); void AddHeader(cRecMenuItem *header);
void SetFooter(cRecMenuItem *footer); void AddFooter(cRecMenuItem *footer);
void ClearMenuItems(bool destructor = false); void ClearMenuItems(bool destructor = false);
void InitMenu(bool complete); void InitMenu(bool complete);
bool AddMenuItemInitial(cRecMenuItem *item, bool inFront = false); bool AddMenuItemInitial(cRecMenuItem *item, bool inFront = false);
@ -53,7 +53,7 @@ protected:
virtual int GetTotalNumMenuItems(void) { return 0; }; virtual int GetTotalNumMenuItems(void) { return 0; };
virtual void CreateMenuItems(void) {}; virtual void CreateMenuItems(void) {};
int GetStartIndex(void) { return startIndex; }; int GetStartIndex(void) { return startIndex; };
int GetActive(void); int GetNumActive(void);
public: public:
cRecMenu(void); cRecMenu(void);
virtual ~cRecMenu(void); virtual ~cRecMenu(void);

File diff suppressed because it is too large Load Diff

View File

@ -25,6 +25,7 @@ enum eRecMenuState {
rmsSearchRerunsTimerConflictMenu, rmsSearchRerunsTimerConflictMenu,
rmsSaveTimerConflictMenu, rmsSaveTimerConflictMenu,
rmsTimerConflictShowInfo, rmsTimerConflictShowInfo,
rmsOnOffTimer,
rmsDeleteTimer, rmsDeleteTimer,
rmsDeleteTimerConfirmation, rmsDeleteTimerConfirmation,
rmsEditTimer, rmsEditTimer,
@ -46,7 +47,6 @@ enum eRecMenuState {
rmsSearchTimerOptions, rmsSearchTimerOptions,
rmsSearchTimers, rmsSearchTimers,
rmsSearchTimerEdit, rmsSearchTimerEdit,
rmsSearchTimerEditAdvanced,
rmsSearchTimerTest, rmsSearchTimerTest,
rmsSearchTimerSave, rmsSearchTimerSave,
rmsSearchTimerCreateWithTemplate, rmsSearchTimerCreateWithTemplate,
@ -110,10 +110,10 @@ public:
virtual int GetHeight(void) { return height; }; virtual int GetHeight(void) { return height; };
virtual int GetWidth(void) { return 0; }; virtual int GetWidth(void) { return 0; };
virtual void CalculateHeight(int textWidth) {}; virtual void CalculateHeight(int textWidth) {};
virtual void setActive(void) { this->active = true; } virtual void SetActive(void) { this->active = true; }
virtual void setInactive(void) { this->active = false; } virtual void setInactive(void) { this->active = false; }
bool isSelectable(void) { return selectable; } bool isSelectable(void) { return selectable; }
bool isActive(void) { return active; } bool IsActive(void) { return active; }
virtual void setBackground(void); virtual void setBackground(void);
virtual void Draw(void) {}; virtual void Draw(void) {};
virtual void Hide(void) { if (pixmap) pixmap->SetLayer(-1);}; virtual void Hide(void) { if (pixmap) pixmap->SetLayer(-1);};
@ -122,8 +122,7 @@ public:
virtual time_t GetTimeValue(void) { return 0; }; virtual time_t GetTimeValue(void) { return 0; };
virtual bool GetBoolValue(void) { return false; }; virtual bool GetBoolValue(void) { return false; };
virtual cString GetStringValue(void) { return cString(""); }; virtual cString GetStringValue(void) { return cString(""); };
virtual const cEvent *GetEventValue(void) { return NULL; }; virtual const cEvent *GetEvent(void) { return NULL; };
virtual cTimer *GetTimerValue(void) { return NULL; };
virtual eRecMenuState ProcessKey(eKeys Key) { return rmsNotConsumed; }; virtual eRecMenuState ProcessKey(eKeys Key) { return rmsNotConsumed; };
}; };
@ -175,12 +174,18 @@ public:
// --- cRecMenuItemInfo ------------------------------------------------------- // --- cRecMenuItemInfo -------------------------------------------------------
class cRecMenuItemInfo : public cRecMenuItem { class cRecMenuItemInfo : public cRecMenuItem {
private: private:
int numLines;
cString text; cString text;
std::string line1;
std::string line2;
std::string line3;
std::string line4;
cTextWrapper wrapper; cTextWrapper wrapper;
int border; int border;
const cFont *fontInfo; const cFont *fontInfo;
public: public:
cRecMenuItemInfo(const char *text, bool largeFont = false); cRecMenuItemInfo(const char *text, bool largeFont = false);
cRecMenuItemInfo(std::string line1, int numLines = 1, std::string line2 = "", std::string line3 = "", std::string line4 = "", int width = 80, bool largeFont = false);
virtual ~cRecMenuItemInfo(void); virtual ~cRecMenuItemInfo(void);
void setBackground(void); void setBackground(void);
void CalculateHeight(int textWidth); void CalculateHeight(int textWidth);
@ -200,7 +205,6 @@ private:
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 active = false, bool active = false,
@ -227,11 +231,15 @@ private:
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,
bool refresh = false);
cRecMenuItemBool(cString text,
bool active = false,
int *callback = NULL,
eRecMenuState action = rmsNotConsumed,
bool refresh = false);
virtual ~cRecMenuItemBool(void); virtual ~cRecMenuItemBool(void);
void SetPixmaps(void); void SetPixmaps(void);
void Hide(void); void Hide(void);
@ -247,6 +255,7 @@ private:
cString text; cString text;
int currentVal; int currentVal;
int *callback; int *callback;
bool refresh;
std::vector<std::string> strings; std::vector<std::string> strings;
int numValues; int numValues;
cPixmap *pixmapVal; cPixmap *pixmapVal;
@ -254,10 +263,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);
virtual ~cRecMenuItemSelect(void); virtual ~cRecMenuItemSelect(void);
void SetPixmaps(void); void SetPixmaps(void);
void Hide(void); void Hide(void);
@ -340,7 +349,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);
@ -369,7 +377,6 @@ 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);
@ -392,7 +399,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);
@ -480,7 +486,7 @@ public:
void SetPixmaps(void); void SetPixmaps(void);
void Hide(void); void Hide(void);
void Show(void); void Show(void);
const cEvent *GetEventValue(void) { return event; }; const cEvent *GetEvent(void) { return event; };
eRecMenuState ProcessKey(eKeys Key); eRecMenuState ProcessKey(eKeys Key);
void Draw(void); void Draw(void);
}; };
@ -489,7 +495,14 @@ public:
class cRecMenuItemChannelChooser : public cRecMenuItem { class cRecMenuItemChannelChooser : public cRecMenuItem {
private: private:
cString text; cString text;
cChannel *channel; #if VDRVERSNUM >= 20301
const cChannels *channels;
const cChannel *chanNew;
#else
cChannels *channels;
cChannel *chanNew;
#endif
const cChannel *channel;
int channelNumber; int channelNumber;
int *callback; int *callback;
bool initialChannelSet; bool initialChannelSet;
@ -498,7 +511,6 @@ private:
void DrawValue(void); void DrawValue(void);
public: public:
cRecMenuItemChannelChooser (cString text, cRecMenuItemChannelChooser (cString text,
cChannel *initialChannel,
bool active = false, bool active = false,
int *callback = NULL, int *callback = NULL,
eRecMenuState action = rmsNotConsumed); eRecMenuState action = rmsNotConsumed);
@ -532,7 +544,6 @@ 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);
virtual ~cRecMenuItemDayChooser(void); virtual ~cRecMenuItemDayChooser(void);
@ -548,10 +559,10 @@ public:
// --- cRecMenuItemRecording ------------------------------------------------------- // --- cRecMenuItemRecording -------------------------------------------------------
class cRecMenuItemRecording : public cRecMenuItem { class cRecMenuItemRecording : public cRecMenuItem {
private: private:
cRecording *recording; const cRecording *recording;
cPixmap *pixmapText; cPixmap *pixmapText;
public: public:
cRecMenuItemRecording(cRecording *recording, bool active); cRecMenuItemRecording(const cRecording *recording, bool active);
virtual ~cRecMenuItemRecording(void); virtual ~cRecMenuItemRecording(void);
void SetPixmaps(void); void SetPixmaps(void);
void Hide(void); void Hide(void);
@ -563,24 +574,26 @@ public:
class cRecMenuItemTimelineHeader : public cRecMenuItem { class cRecMenuItemTimelineHeader : public cRecMenuItem {
private: private:
time_t day; time_t day;
cTimer *timer; const cTimer *timer;
std::vector<cTVGuideTimerConflict*> conflicts; std::vector<cTVGuideTimerConflict*> conflicts;
cPixmap *pixmapTimeline; cPixmap *pixmapTimeline;
cPixmap *pixmapTimerInfo; cPixmap *pixmapTimerInfo;
cPixmap *pixmapTimerConflicts; cPixmap *pixmapTimerConflicts;
int width5Mins; float width5Mins;
int x0; int x0;
int numTimersToday;
bool timelineDrawn; bool timelineDrawn;
void DrawTimeline(void); void DrawTimeline(void);
void DrawTimerConflicts(void); void DrawTimerConflicts(void);
void DrawCurrentTimer(void); void DrawCurrentTimer(void);
public: public:
cRecMenuItemTimelineHeader(time_t day, std::vector<cTVGuideTimerConflict*> conflictsToday); cRecMenuItemTimelineHeader(time_t day, int numTimersToday, std::vector<cTVGuideTimerConflict*> conflictsToday);
virtual ~cRecMenuItemTimelineHeader(void); virtual ~cRecMenuItemTimelineHeader(void);
void SetDay(time_t day) { this->day = day; }; void SetDay(time_t day) { this->day = day; };
void SetPixmaps(void); void SetPixmaps(void);
void SetCurrentTimer(cTimer *timer) { this->timer = timer; }; void SetCurrentTimer(const cTimer *timer) { this->timer = timer; };
void UnsetCurrentTimer(void) { timer = NULL; }; void UnsetCurrentTimer(void) { timer = NULL; };
void SetNumTimersToday(int numTimersToday) { this->numTimersToday = numTimersToday; };
void RefreshTimerDisplay(void); void RefreshTimerDisplay(void);
void Hide(void); void Hide(void);
void Show(void); void Show(void);
@ -590,13 +603,13 @@ public:
// --- cRecMenuItemTimelineTimer ------------------------------------------------------- // --- cRecMenuItemTimelineTimer -------------------------------------------------------
class cRecMenuItemTimelineTimer : public cRecMenuItem { class cRecMenuItemTimelineTimer : public cRecMenuItem {
private: private:
cTimer *timer; const cTimer *timer;
std::vector<cTVGuideTimerConflict*> conflicts; std::vector<cTVGuideTimerConflict*> conflicts;
cPixmap *pixmapBack; cPixmap *pixmapBack;
cPixmap *pixmapTimerConflicts; cPixmap *pixmapTimerConflicts;
cRecMenuItemTimelineHeader *header; cRecMenuItemTimelineHeader *header;
int x0; int x0;
int width5Mins; float width5Mins;
time_t start; time_t start;
time_t stop; time_t stop;
void DrawBackground(void); void DrawBackground(void);
@ -605,15 +618,15 @@ private:
void DrawTimerConflicts(void); void DrawTimerConflicts(void);
void DrawNoTimerInfo(void); void DrawNoTimerInfo(void);
public: public:
cRecMenuItemTimelineTimer(cTimer *timer, time_t start, time_t stop, std::vector<cTVGuideTimerConflict*> conflictsToday, cRecMenuItemTimelineHeader *header, bool active); cRecMenuItemTimelineTimer(const cTimer *timer, time_t start, time_t stop, std::vector<cTVGuideTimerConflict*> conflictsToday, cRecMenuItemTimelineHeader *header, bool active);
virtual ~cRecMenuItemTimelineTimer(void); virtual ~cRecMenuItemTimelineTimer(void);
void setActive(void); void SetActive(void);
void setInactive(void); void setInactive(void);
void SetPixmaps(void); void SetPixmaps(void);
void Hide(void); void Hide(void);
void Show(void); void Show(void);
void Draw(void); void Draw(void);
cTimer *GetTimerValue(void); const cTimer *GetTimer(void);
eRecMenuState ProcessKey(eKeys Key); eRecMenuState ProcessKey(eKeys Key);
}; };

1526
recmenus.c

File diff suppressed because it is too large Load Diff

View File

@ -10,6 +10,15 @@
#include "switchtimer.h" #include "switchtimer.h"
#include "recmanager.h" #include "recmanager.h"
typedef enum {
searchTimerActionRecord = 0,
searchTimerActionAnnounceViaOSD,
searchTimerActionSwitchOnly,
searchTimerActionAnnounceAndSwitch,
searchTimerActionAnnounceViaMail,
searchTimerActionInactiveRecord
} searchTimerAction;
// --- cRecMenuMain --------------------------------------------------------- // --- cRecMenuMain ---------------------------------------------------------
class cRecMenuMain : public cRecMenu { class cRecMenuMain : public cRecMenu {
public: public:
@ -38,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) {};
}; };
@ -68,11 +77,12 @@ public:
class cRecMenuTimerConflict: public cRecMenu { class cRecMenuTimerConflict: public cRecMenu {
private: private:
cTVGuideTimerConflict *conflict; cTVGuideTimerConflict *conflict;
int totalNumMenuItems;
public: public:
cRecMenuTimerConflict(cTVGuideTimerConflict *conflict); cRecMenuTimerConflict(cTVGuideTimerConflict *conflict, eRecMenuState nextAction = rmsClose);
virtual ~cRecMenuTimerConflict(void) {};
cRecMenuItem *GetMenuItem(int number); cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void); int GetTotalNumMenuItems(void);
virtual ~cRecMenuTimerConflict(void) {};
int GetTimerConflictIndex(void); int GetTimerConflictIndex(void);
}; };
@ -115,7 +125,7 @@ public:
// --- cRecMenuEditTimer --------------------------------------------------------- // --- cRecMenuEditTimer ---------------------------------------------------------
class cRecMenuEditTimer: public cRecMenu { class cRecMenuEditTimer: public cRecMenu {
private: private:
cTimer *originalTimer; const cTimer *originalTimer;
bool timerActive; bool timerActive;
time_t day; time_t day;
int start; int start;
@ -124,10 +134,10 @@ private:
int lifetime; int lifetime;
char folder[TEXTINPUTLENGTH]; char folder[TEXTINPUTLENGTH];
public: public:
cRecMenuEditTimer(cTimer *timer, eRecMenuState nextState); cRecMenuEditTimer(const cTimer *timer, eRecMenuState nextState);
const cTimer *GetOriginalTimer(void);
virtual ~cRecMenuEditTimer(void) {}; virtual ~cRecMenuEditTimer(void) {};
cTimer GetTimer(void); cTimer *GetTimer(void);
cTimer *GetOriginalTimer(void);
}; };
/****************************************************************************************** /******************************************************************************************
@ -148,7 +158,7 @@ class cRecMenuSeriesTimer: public cRecMenu {
int lifetime; int lifetime;
void CalculateTimes(const cEvent *event); void CalculateTimes(const cEvent *event);
public: public:
cRecMenuSeriesTimer(cChannel *initialChannel, const cEvent *event, std::string folder); cRecMenuSeriesTimer(const cChannel *initialChannel, const cEvent *event, std::string folder);
virtual ~cRecMenuSeriesTimer(void) {}; virtual ~cRecMenuSeriesTimer(void) {};
cTimer *GetTimer(void); cTimer *GetTimer(void);
}; };
@ -195,62 +205,46 @@ class cRecMenuSearchTimers: public cRecMenu {
private: private:
int numSearchTimers; int numSearchTimers;
std::vector<cTVGuideSearchTimer> searchTimers; std::vector<cTVGuideSearchTimer> searchTimers;
void SetMenuItems(void);
public: public:
cRecMenuSearchTimers(std::vector<cTVGuideSearchTimer> searchTimers); cRecMenuSearchTimers(std::vector<cTVGuideSearchTimer> searchTimers);
virtual ~cRecMenuSearchTimers(void) {};
cRecMenuItem *GetMenuItem(int number); cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void); int GetTotalNumMenuItems(void);
cTVGuideSearchTimer GetSearchTimer(void); cTVGuideSearchTimer GetSearchTimer(void);
virtual ~cRecMenuSearchTimers(void);
}; };
// --- cRecMenuSearchTimerEdit --------------------------------------------------------- // --- cRecMenuSearchTimerEdit ---------------------------------------------------------
class cRecMenuSearchTimerEdit: public cRecMenu { class cRecMenuSearchTimerEdit: public cRecMenu {
private: private:
bool advancedOptions; cTVGuideSearchTimer sT;
cTVGuideSearchTimer searchTimer; std::vector<std::string> searchModes;
std::vector<std::string> subTitleModes;
std::vector<std::string> useChannelModes;
std::vector<std::string> channelGroups;
std::vector<std::string> compareDateModes;
std::vector<std::string> searchTimerModes;
std::vector<std::string> delModes;
std::vector<std::string> channelgroups;
std::vector<cRecMenuItem*> mainMenuItems; std::vector<cRecMenuItem*> mainMenuItems;
std::vector<cRecMenuItem*> useChannelSubMenu; cString indent;
std::vector<cRecMenuItem*> useTimeSubMenu; bool init;
std::vector<cRecMenuItem*> useDayOfWeekSubMenu;
std::vector<cRecMenuItem*> avoidRepeatSubMenu;
std::vector<cRecMenuItem*> currentMenuItems;
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 mode;
bool useTitle;
bool useSubtitle;
bool useDescription;
bool useChannel;
int startChannel; int startChannel;
int stopChannel; int stopChannel;
bool useTime; int channelgroupIndex;
int startTime;
int stopTime;
bool useDayOfWeek;
int dayOfWeek; int dayOfWeek;
int priority;
int lifetime;
bool useEpisode;
char directory[TEXTINPUTLENGTH]; char directory[TEXTINPUTLENGTH];
int marginStart; int SplitChannelGroups(std::vector<std::string> *channelGroups, std::vector<std::string> *channelgroups);
int marginStop;
bool useVPS;
bool avoidRepeats;
int allowedRepeats;
bool compareTitle;
bool compareSubtitle;
bool compareSummary;
bool useInFavorites;
void InitMenuItems(void);
void AddSubMenu(std::vector<cRecMenuItem*> *subMenu);
public: public:
cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer, bool advancedOptions); cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer, std::vector<std::string> channelGroups);
void CreateMenuItems(void); void CreateMenuItems(void);
virtual ~cRecMenuSearchTimerEdit(void); virtual ~cRecMenuSearchTimerEdit(void);
cTVGuideSearchTimer GetSearchTimer(void); cTVGuideSearchTimer GetSearchTimer(void);
@ -264,7 +258,7 @@ private:
cTVGuideSearchTimer searchTimer; cTVGuideSearchTimer searchTimer;
public: public:
cRecMenuSearchTimerDeleteConfirm(cTVGuideSearchTimer searchTimer); cRecMenuSearchTimerDeleteConfirm(cTVGuideSearchTimer searchTimer);
virtual ~cRecMenuSearchTimerDeleteConfirm(void); virtual ~cRecMenuSearchTimerDeleteConfirm(void) {};
cTVGuideSearchTimer GetSearchTimer(void); cTVGuideSearchTimer GetSearchTimer(void);
}; };
@ -319,7 +313,7 @@ public:
class cRecMenuSwitchTimer: public cRecMenu { class cRecMenuSwitchTimer: public cRecMenu {
private: private:
int switchMinsBefore; int switchMinsBefore;
int announceOnly; int switchMode;
public: public:
cRecMenuSwitchTimer(void); cRecMenuSwitchTimer(void);
virtual ~cRecMenuSwitchTimer(void) {}; virtual ~cRecMenuSwitchTimer(void) {};
@ -412,10 +406,10 @@ public:
class cRecMenuRecordingSearchResults: public cRecMenu { class cRecMenuRecordingSearchResults: public cRecMenu {
private: private:
std::string searchString; std::string searchString;
cRecording **searchResults; const cRecording **searchResults;
int numResults; int numResults;
public: public:
cRecMenuRecordingSearchResults(std::string searchString, cRecording **searchResults, int numResults); cRecMenuRecordingSearchResults(std::string searchString, const cRecording **searchResults, int numResults);
cRecMenuItem *GetMenuItem(int number); cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void); int GetTotalNumMenuItems(void);
virtual ~cRecMenuRecordingSearchResults(void) { virtual ~cRecMenuRecordingSearchResults(void) {
@ -438,7 +432,7 @@ public:
// --- cRecMenuTimeline --------------------------------------------------------- // --- cRecMenuTimeline ---------------------------------------------------------
class cRecMenuTimeline: public cRecMenu { class cRecMenuTimeline: public cRecMenu {
private: private:
std::vector<cTimer*> timersToday; std::vector<const cTimer*> timersToday;
int numTimersToday; int numTimersToday;
time_t today; time_t today;
time_t timeStart; time_t timeStart;
@ -454,12 +448,11 @@ private:
void ClearMenu(void); void ClearMenu(void);
public: public:
cRecMenuTimeline(cTVGuideTimerConflicts *timerConflicts); cRecMenuTimeline(cTVGuideTimerConflicts *timerConflicts);
virtual ~cRecMenuTimeline(void) {};
cRecMenuItem *GetMenuItem(int number); cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void); int GetTotalNumMenuItems(void);
virtual ~cRecMenuTimeline(void) {
};
eRecMenuState ProcessKey(eKeys Key); eRecMenuState ProcessKey(eKeys Key);
cTimer *GetTimer(void); const cTimer *GetTimer(void);
}; };
/****************************************************************************************** /******************************************************************************************

View File

@ -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;
@ -37,10 +37,10 @@ void cRecMenuManager::Start(const cEvent *event) {
this->event = event; this->event = event;
activeMenu = new cRecMenuMain(recManager->EpgSearchAvailable(), recManager->CheckEventForTimer(event), SwitchTimers.EventInSwitchList(event)); activeMenu = new cRecMenuMain(recManager->EpgSearchAvailable(), recManager->CheckEventForTimer(event), SwitchTimers.EventInSwitchList(event));
activeMenu->Display(); activeMenu->Display();
osdManager.flush(); osdManager.Flush();
} }
void cRecMenuManager::StartFavorites(void) { void cRecMenuView::StartFavorites(void) {
active = true; active = true;
activeMenuBuffer = NULL; activeMenuBuffer = NULL;
detailViewActive = false; detailViewActive = false;
@ -49,11 +49,11 @@ void cRecMenuManager::StartFavorites(void) {
recManager->GetFavorites(&favorites); recManager->GetFavorites(&favorites);
activeMenu = new cRecMenuFavorites(favorites); activeMenu = new cRecMenuFavorites(favorites);
activeMenu->Display(); activeMenu->Display();
osdManager.flush(); osdManager.Flush();
} }
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.CreatePixmap(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,83 @@ void cRecMenuManager::SetBackground(void) {
} }
} }
void cRecMenuManager::DeleteBackground(void) { void cRecMenuView::DeleteBackground(void) {
osdManager.releasePixmap(pixmapBackground); osdManager.DestroyPixmap(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) {
#if VDRVERSNUM >= 20301
LOCK_TIMERS_READ;
for (const cTimer *t = Timers->First(); t; t = Timers->Next(t)) {
if (t == timer)
return DisplayTimerConflict(timer->Id() - 1);
#else
int timerID = 0;
for (const cTimer *t = Timers.First(); t; t = Timers.Next(t)) {
if (t == timer)
return DisplayTimerConflict(timerID);
timerID++;
#endif
}
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;
delete activeMenu;
activeMenu = new cRecMenuTimerConflict(conflict, rmsIgnoreTimerConflict);
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
@ -97,11 +164,16 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
if (cRecMenuAskFolder *menu = dynamic_cast<cRecMenuAskFolder*>(activeMenu)) { if (cRecMenuAskFolder *menu = dynamic_cast<cRecMenuAskFolder*>(activeMenu)) {
recFolder = menu->GetFolder(); recFolder = menu->GetFolder();
} }
delete activeMenu;
cTimer *timer = recManager->createTimer(event, recFolder); cTimer *timer = recManager->createTimer(event, recFolder);
if (!DisplayTimerConflict(timer)) { if (!DisplayTimerConflict(timer)) {
if (config.timerMessage) {
delete activeMenu;
activeMenu = new cRecMenuConfirmTimer(event); activeMenu = new cRecMenuConfirmTimer(event);
activeMenu->Display(); activeMenu->Display();
} else {
Close();
state = osEnd;
}
} }
break; } break; }
case rmsInstantRecordFolder: case rmsInstantRecordFolder:
@ -111,12 +183,83 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
activeMenu = new cRecMenuAskFolder(event, rmsInstantRecord); activeMenu = new cRecMenuAskFolder(event, rmsInstantRecord);
activeMenu->Display(); activeMenu->Display();
break; break;
case rmsOnOffTimer: {
//caller: main menu
//De/Activate timer for active event
recManager->OnOffTimer(event);
if (config.timerMessage) {
delete activeMenu;
activeMenu = new cRecMenuConfirmTimer(event, true);
activeMenu->Display();
} else {
Close();
state = osEnd;
}
break; }
case rmsDeleteTimer: {
//caller: main menu
//delete timer for active event
if (recManager->IsRecorded(event)) {
delete activeMenu;
activeMenu = new cRecMenuAskDeleteTimer(event);
activeMenu->Display();
} else {
recManager->DeleteTimer(event);
if (config.timerMessage) {
delete activeMenu;
activeMenu = new cRecMenuConfirmDeleteTimer(event);
activeMenu->Display();
} else {
Close();
state = osEnd;
}
}
break; }
case rmsDeleteTimerConfirmation: {
//delete running timer for active event
recManager->DeleteTimer(event);
if (config.timerMessage) {
delete activeMenu;
activeMenu = new cRecMenuConfirmDeleteTimer(event);
activeMenu->Display();
} else {
Close();
state = osEnd;
}
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
if (config.timerMessage) {
delete activeMenu; delete activeMenu;
activeMenu = new cRecMenuConfirmTimer(event); activeMenu = new cRecMenuConfirmTimer(event);
activeMenu->Display(); activeMenu->Display();
} else {
Close();
state = osEnd;
}
break; break;
case rmsTimerConflictShowInfo: { case rmsTimerConflictShowInfo: {
//caller: cRecMenuTimerConflict //caller: cRecMenuTimerConflict
@ -124,8 +267,19 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
if (cRecMenuTimerConflict *menu = dynamic_cast<cRecMenuTimerConflict*>(activeMenu)) { if (cRecMenuTimerConflict *menu = dynamic_cast<cRecMenuTimerConflict*>(activeMenu)) {
timerIndex = menu->GetTimerConflictIndex(); timerIndex = menu->GetTimerConflictIndex();
} else break; } else break;
const cTimers* timers;
#if VDRVERSNUM >= 20301
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex) + 1;
{
LOCK_TIMERS_READ;
timers = Timers;
}
const cTimer *t = timers->GetById(timerID);
#else
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex); int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex);
cTimer *t = Timers.Get(timerID); timers = &Timers;
const cTimer *t = timers->Get(timerID);
#endif
if (t) { if (t) {
const cEvent *ev = t->Event(); const cEvent *ev = t->Event();
if (ev) { if (ev) {
@ -140,12 +294,30 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
if (cRecMenuTimerConflict *menu = dynamic_cast<cRecMenuTimerConflict*>(activeMenu)) { if (cRecMenuTimerConflict *menu = dynamic_cast<cRecMenuTimerConflict*>(activeMenu)) {
timerIndex = menu->GetTimerConflictIndex(); timerIndex = menu->GetTimerConflictIndex();
} else break; } else break;
const cTimers* timers;
const cEvent *event;
#if VDRVERSNUM >= 20301
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex) + 1;
{
LOCK_TIMERS_READ;
timers = Timers;
}
event = timers->GetById(timerID)->Event();
#else
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex); int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex);
recManager->DeleteTimer(timerID); timers = &Timers;
delete activeMenu; event = timers->Get(timerID)->Event();
#endif
recManager->DeleteTimer(event);
if (!DisplayTimerConflict(timerID)) { if (!DisplayTimerConflict(timerID)) {
activeMenu = new cRecMenuConfirmTimer(event); if (config.timerMessage) {
delete activeMenu;
activeMenu = new cRecMenuConfirmDeleteTimer(event);
activeMenu->Display(); activeMenu->Display();
} else {
Close();
state = osEnd;
}
} }
break; } break; }
case rmsEditTimerConflictMenu: { case rmsEditTimerConflictMenu: {
@ -155,8 +327,19 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
if (cRecMenuTimerConflict *menu = dynamic_cast<cRecMenuTimerConflict*>(activeMenu)) { if (cRecMenuTimerConflict *menu = dynamic_cast<cRecMenuTimerConflict*>(activeMenu)) {
timerIndex = menu->GetTimerConflictIndex(); timerIndex = menu->GetTimerConflictIndex();
} else break; } else break;
const cTimers* timers;
#if VDRVERSNUM >= 20301
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex) + 1;
{
LOCK_TIMERS_READ;
timers = Timers;
}
const cTimer *timer = timers->GetById(timerID);
#else
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex); int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex);
cTimer *timer = Timers.Get(timerID); timers = &Timers;
const cTimer *timer = timers->Get(timerID);
#endif
if (timer) { if (timer) {
delete activeMenu; delete activeMenu;
activeMenu = new cRecMenuEditTimer(timer, rmsSaveTimerConflictMenu); activeMenu = new cRecMenuEditTimer(timer, rmsSaveTimerConflictMenu);
@ -166,63 +349,27 @@ 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;
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();
originalTimer = menu->GetOriginalTimer(); originalTimer = menu->GetOriginalTimer();
} else break; } else break;
recManager->SaveTimer(originalTimer, timerModified); recManager->SaveTimer(originalTimer, timerModified);
delete activeMenu;
if (!DisplayTimerConflict(originalTimer)) { if (!DisplayTimerConflict(originalTimer)) {
activeMenu = new cRecMenuConfirmTimer(event); if (config.timerMessage) {
activeMenu->Display();
}
break; }
case rmsDeleteTimer:
//caller: main menu
//delete timer for active event
delete activeMenu; delete activeMenu;
if (recManager->IsRecorded(event)) { activeMenu = new cRecMenuConfirmTimer(originalTimer->Event(), true);
activeMenu = new cRecMenuAskDeleteTimer(event); activeMenu->Display();
} else { } 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
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;
cTimer *originalTimer;
if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) {
timerModified = menu->GetTimer();
originalTimer = menu->GetOriginalTimer();
} else break;
recManager->SaveTimer(originalTimer, timerModified);
state = osEnd;
Close(); Close();
state = osEnd;
}
}
break; } break; }
/*************************************************************************************** /***************************************************************************************
* SERIES TIMER * SERIES TIMER
****************************************************************************************/ ****************************************************************************************/
case rmsSeriesTimer: { case rmsSeriesTimer: {
//caller: main menu oder folder chooser //caller: main menu oder folder chooser
std::string recFolder = ""; std::string recFolder = "";
@ -230,7 +377,12 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
recFolder = menu->GetFolder(); recFolder = menu->GetFolder();
} }
delete activeMenu; delete activeMenu;
#if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ;
const cChannel *channel = Channels->GetByChannelID(event->ChannelID());
#else
cChannel *channel = Channels.GetByChannelID(event->ChannelID()); cChannel *channel = Channels.GetByChannelID(event->ChannelID());
#endif
activeMenu = new cRecMenuSeriesTimer(channel, event, recFolder); activeMenu = new cRecMenuSeriesTimer(channel, event, recFolder);
activeMenu->Display(); activeMenu->Display();
break; } break; }
@ -252,9 +404,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
@ -286,7 +438,9 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
if (epgSearchTemplates.size() > 0) { if (epgSearchTemplates.size() > 0) {
activeMenu = new cRecMenuSearchTimerTemplates(searchTimer, epgSearchTemplates); activeMenu = new cRecMenuSearchTimerTemplates(searchTimer, epgSearchTemplates);
} else { } else {
activeMenu = new cRecMenuSearchTimerEdit(searchTimer, false); std::vector<std::string> channelGroups;
recManager->GetChannelGroups(&channelGroups);
activeMenu = new cRecMenuSearchTimerEdit(searchTimer, channelGroups);
} }
} }
activeMenu->Display(); activeMenu->Display();
@ -295,21 +449,20 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
//caller: main menu //caller: main menu
DisplaySearchTimerList(); DisplaySearchTimerList();
break; } break; }
case rmsSearchTimerEdit: case rmsSearchTimerEdit: {
case rmsSearchTimerEditAdvanced: {
//caller: cRecMenuSearchTimers, cRecMenuSearchTimerEdit, cRecMenuSearchTimerTemplates //caller: cRecMenuSearchTimers, cRecMenuSearchTimerEdit, cRecMenuSearchTimerTemplates
cTVGuideSearchTimer searchTimer; cTVGuideSearchTimer searchTimer;
bool advancedOptions = false;
if (cRecMenuSearchTimers *menu = dynamic_cast<cRecMenuSearchTimers*>(activeMenu)) { if (cRecMenuSearchTimers *menu = dynamic_cast<cRecMenuSearchTimers*>(activeMenu)) {
searchTimer = menu->GetSearchTimer(); searchTimer = menu->GetSearchTimer();
} else if (cRecMenuSearchTimerEdit *menu = dynamic_cast<cRecMenuSearchTimerEdit*>(activeMenu)) { } else if (cRecMenuSearchTimerEdit *menu = dynamic_cast<cRecMenuSearchTimerEdit*>(activeMenu)) {
searchTimer = menu->GetSearchTimer(); searchTimer = menu->GetSearchTimer();
advancedOptions = (nextState == rmsSearchTimerEditAdvanced)?true:false;
} else if (cRecMenuSearchTimerTemplates *menu = dynamic_cast<cRecMenuSearchTimerTemplates*>(activeMenu)) { } else if (cRecMenuSearchTimerTemplates *menu = dynamic_cast<cRecMenuSearchTimerTemplates*>(activeMenu)) {
searchTimer = menu->GetSearchTimer(); searchTimer = menu->GetSearchTimer();
} else break; } else break;
delete activeMenu; delete activeMenu;
activeMenu = new cRecMenuSearchTimerEdit(searchTimer, advancedOptions); std::vector<std::string> channelGroups;
recManager->GetChannelGroups(&channelGroups);
activeMenu = new cRecMenuSearchTimerEdit(searchTimer, channelGroups);
activeMenu->Display(); activeMenu->Display();
break; } break; }
case rmsSearchTimerTest: { case rmsSearchTimerTest: {
@ -338,14 +491,13 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
if (numSearchResults) { if (numSearchResults) {
activeMenuBuffer = activeMenu; activeMenuBuffer = activeMenu;
activeMenuBuffer->Hide(); activeMenuBuffer->Hide();
activeMenu = new cRecMenuSearchTimerResults(searchTimer.SearchString(), 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.SearchString()); activeMenu = new cRecMenuSearchTimerNothingFound(searchTimer.GetSearchString());
activeMenu->Display();
} }
activeMenu->Display();
break; } break; }
case rmsSearchTimerSave: { case rmsSearchTimerSave: {
//caller: cRecMenuSearchTimerEdit, cRecMenuSearchTimerTemplatesCreate //caller: cRecMenuSearchTimerEdit, cRecMenuSearchTimerTemplatesCreate
@ -424,66 +576,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;
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
@ -563,9 +658,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
@ -593,7 +712,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
} else break; } else break;
timerConflicts->SetCurrentConflict(timerConflict); timerConflicts->SetCurrentConflict(timerConflict);
delete activeMenu; delete activeMenu;
activeMenu = new cRecMenuTimerConflict(timerConflicts->GetCurrentConflict()); activeMenu = new cRecMenuTimerConflict(timerConflicts->GetCurrentConflict(), rmsTimerConflicts);
activeMenu->Display(); activeMenu->Display();
break; } break; }
case rmsSearchRerunsTimerConflictMenu: { case rmsSearchRerunsTimerConflictMenu: {
@ -605,8 +724,19 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
if (cRecMenuTimerConflict *menu = dynamic_cast<cRecMenuTimerConflict*>(activeMenu)) { if (cRecMenuTimerConflict *menu = dynamic_cast<cRecMenuTimerConflict*>(activeMenu)) {
timerConflict = menu->GetTimerConflictIndex(); timerConflict = menu->GetTimerConflictIndex();
} else break; } else break;
const cTimers* timers;
#if VDRVERSNUM >= 20301
int timerID = timerConflicts->GetCurrentConflictTimerID(timerConflict) + 1;
{
LOCK_TIMERS_READ;
timers = Timers;
}
const cTimer *timer = timers->GetById(timerID);
#else
int timerID = timerConflicts->GetCurrentConflictTimerID(timerConflict); int timerID = timerConflicts->GetCurrentConflictTimerID(timerConflict);
cTimer *timer = Timers.Get(timerID); timers = &Timers;
const cTimer *timer = timers->Get(timerID);
#endif
if (timer) { if (timer) {
const cEvent *event = timer->Event(); const cEvent *event = timer->Event();
if (event) { if (event) {
@ -616,13 +746,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; }
@ -648,7 +777,16 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
originalConflictIndex = menu->GetTimerConflictIndex(); originalConflictIndex = menu->GetTimerConflictIndex();
} else break; } else break;
int originalTimerID = timerConflicts->GetCurrentConflictTimerID(originalConflictIndex); int originalTimerID = timerConflicts->GetCurrentConflictTimerID(originalConflictIndex);
cTimer *timerOriginal = Timers.Get(originalTimerID); const cTimers* timers;
#if VDRVERSNUM >= 20301
{
LOCK_TIMERS_READ;
timers = Timers;
}
#else
timers = &Timers;
#endif
const cTimer *timerOriginal = timers->Get(originalTimerID);
if (replace && timerOriginal) { if (replace && timerOriginal) {
recManager->DeleteTimer(timerOriginal->Event()); recManager->DeleteTimer(timerOriginal->Event());
recManager->createTimer(replace); recManager->createTimer(replace);
@ -661,9 +799,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;
@ -674,7 +812,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
activeMenu->Display(); activeMenu->Display();
break; } break; }
case rmsTimelineTimerEdit: { case rmsTimelineTimerEdit: {
cTimer *timer; const cTimer *timer;
if (cRecMenuTimeline *menu = dynamic_cast<cRecMenuTimeline*>(activeMenu)) { if (cRecMenuTimeline *menu = dynamic_cast<cRecMenuTimeline*>(activeMenu)) {
timer = menu->GetTimer(); timer = menu->GetTimer();
} else break; } else break;
@ -685,8 +823,8 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
} }
break;} break;}
case rmsTimelineTimerSave: { case rmsTimelineTimerSave: {
cTimer timerModified; cTimer *timerModified;
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();
originalTimer = menu->GetOriginalTimer(); originalTimer = menu->GetOriginalTimer();
@ -701,7 +839,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
activeMenu->Display(); activeMenu->Display();
break; } break; }
case rmsTimelineTimerDelete: { case rmsTimelineTimerDelete: {
cTimer *timer; const cTimer *timer;
if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) { if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) {
timer = menu->GetOriginalTimer(); timer = menu->GetOriginalTimer();
} else break; } else break;
@ -714,9 +852,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;
@ -756,27 +927,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;
@ -796,66 +967,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(cTimer *timer) {
int timerID = 0;
for (cTimer *t = Timers.First(); t; t = Timers.Next(t)) {
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)
@ -882,12 +994,12 @@ eOSState cRecMenuManager::ProcessKey(eKeys Key) {
activeMenu->UpdateActiveMenuItem(); activeMenu->UpdateActiveMenuItem();
activeMenu->Show(); activeMenu->Show();
state = osContinue; state = osContinue;
osdManager.flush(); osdManager.Flush();
} }
return state; return state;
} }
state = StateMachine(nextState); state = StateMachine(nextState);
} }
osdManager.flush(); osdManager.Flush();
return state; return state;
} }

View File

@ -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;
@ -15,6 +15,7 @@ private:
cRecMenu *activeMenuBuffer; cRecMenu *activeMenuBuffer;
cRecMenu *activeMenuBuffer2; cRecMenu *activeMenuBuffer2;
const cEvent *event; const cEvent *event;
const cEvent *displayEvent;
cRecManager *recManager; cRecManager *recManager;
cTVGuideTimerConflicts *timerConflicts; cTVGuideTimerConflicts *timerConflicts;
cDetailView *detailView; cDetailView *detailView;
@ -23,20 +24,20 @@ private:
void SetBackground(void); void SetBackground(void);
void DeleteBackground(void); void DeleteBackground(void);
void DisplaySearchTimerList(void); void DisplaySearchTimerList(void);
bool DisplayTimerConflict(cTimer *timer); bool DisplayTimerConflict(const cTimer *timer);
bool DisplayTimerConflict(int timerID); bool DisplayTimerConflict(int timerID);
void DisplayDetailedView(const cEvent *ev); void DisplayDetailedView(const cEvent *ev);
void DisplayFavoriteResults(std::string header, const cEvent **result, int numResults); void DisplayFavoriteResults(std::string header, const cEvent **result, int numResults);
eOSState StateMachine(eRecMenuState nextState);
public: public:
cRecMenuManager(void); cRecMenuView(void);
virtual ~cRecMenuManager(void); virtual ~cRecMenuView(void);
void SetFooter(cFooter *footer) { this->footer = footer; }; void AddFooter(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);
void StartFavorites(void); void StartFavorites(void);
void Close(void); void Close(void);
eOSState StateMachine(eRecMenuState nextState);
eOSState ProcessKey(eKeys Key); eOSState ProcessKey(eKeys Key);
}; };
#endif //__TVGUIDE_RECMENUMANAGER_H #endif //__TVGUIDE_RECMENUVIEW_H

View File

@ -16,8 +16,16 @@ cTVGuideSearchTimer::cTVGuideSearchTimer(void) {
startTime = 0000; startTime = 0000;
stopTime = 2359; stopTime = 2359;
useChannel = false; useChannel = false;
#if VDRVERSNUM >= 20301
{
LOCK_CHANNELS_READ;
channelMin = Channels->GetByNumber(cDevice::CurrentChannel());
channelMax = Channels->GetByNumber(cDevice::CurrentChannel());
}
#else
channelMin = Channels.GetByNumber(cDevice::CurrentChannel()); channelMin = Channels.GetByNumber(cDevice::CurrentChannel());
channelMax = Channels.GetByNumber(cDevice::CurrentChannel()); channelMax = Channels.GetByNumber(cDevice::CurrentChannel());
#endif
channelGroup = ""; channelGroup = "";
useCase = false; useCase = false;
mode = 0; mode = 0;
@ -32,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;
@ -41,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;
@ -63,16 +73,14 @@ 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) {
} }
bool cTVGuideSearchTimer::operator < (const cTVGuideSearchTimer& other) const { bool cTVGuideSearchTimer::operator < (const cTVGuideSearchTimer& other) const {
std::string searchStringOther = other.SearchString(); std::string searchStringOther = other.GetSearchString();
searchStringOther = StrToLowerCase(searchStringOther); searchStringOther = StrToLowerCase(searchStringOther);
std::string thisSearchString = StrToLowerCase(searchString); std::string thisSearchString = StrToLowerCase(searchString);
int comp = thisSearchString.compare(searchStringOther); int comp = thisSearchString.compare(searchStringOther);
@ -89,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
@ -236,28 +219,42 @@ bool cTVGuideSearchTimer::Parse(bool readTemplate) {
channelMin = NULL; channelMin = NULL;
channelMax = NULL; channelMax = NULL;
} else if (useChannel == 1) { } else if (useChannel == 1) {
int minNum = 0, maxNum = 0;
int fields = sscanf(values[value].c_str(), "%d-%d", &minNum, &maxNum);
if (fields == 0) { // stored with ID
char *channelMinbuffer = NULL; char *channelMinbuffer = NULL;
char *channelMaxbuffer = NULL; char *channelMaxbuffer = NULL;
int channels = sscanf(values[value].c_str(), "%a[^|]|%a[^|]", &channelMinbuffer, &channelMaxbuffer); int channels = sscanf(values[value].c_str(), "%m[^|]|%m[^|]", &channelMinbuffer, &channelMaxbuffer);
#if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ;
channelMin = Channels->GetByChannelID(tChannelID::FromString(channelMinbuffer), true, true);
#else
channelMin = Channels.GetByChannelID(tChannelID::FromString(channelMinbuffer), true, true); channelMin = Channels.GetByChannelID(tChannelID::FromString(channelMinbuffer), true, true);
#endif
if (!channelMin) { if (!channelMin) {
esyslog("ERROR: channel '%s' not defined", channelMinbuffer);
channelMin = channelMax = NULL; channelMin = channelMax = NULL;
useChannel = 0; useChannel = 0;
} }
if (channels == 1) if (channels == 1)
channelMax = channelMin; channelMax = channelMin;
else { else {
#if VDRVERSNUM >= 20301
channelMax = Channels->GetByChannelID(tChannelID::FromString(channelMaxbuffer), true, true);
#else
channelMax = Channels.GetByChannelID(tChannelID::FromString(channelMaxbuffer), true, true); channelMax = Channels.GetByChannelID(tChannelID::FromString(channelMaxbuffer), true, true);
#endif
if (!channelMax) { if (!channelMax) {
esyslog("ERROR: channel '%s' not defined", channelMaxbuffer);
channelMin = channelMax = NULL; channelMin = channelMax = NULL;
useChannel = 0; useChannel = 0;
} }
} }
free(channelMinbuffer); free(channelMinbuffer);
free(channelMaxbuffer); free(channelMaxbuffer);
} else if (useChannel == 2) {
channelGroup = values[value];
} }
} else if (useChannel == 2)
channelGroup = values[value];
break; break;
case 7: case 7:
useCase = atoi(values[value].c_str()); useCase = atoi(values[value].c_str());
@ -500,18 +497,22 @@ std::string cTVGuideSearchTimer::BuildSearchString(void) {
return strTimer; return strTimer;
} }
bool cTVGuideSearchTimer::Active(void) { bool cTVGuideSearchTimer::IsActive(void) {
if (useAsSearchTimer) if (useAsSearchTimer)
return true; return true;
return false; return false;
} }
int cTVGuideSearchTimer::GetNumTimers(void) { int cTVGuideSearchTimer::GetNumTimers(void) {
int numTimers = 0; int numTimers = 0;
if (ID < 0) if (ID < 0)
return numTimers; return numTimers;
#if VDRVERSNUM >= 20301
LOCK_TIMERS_READ;
for (const cTimer *timer = Timers->First(); timer; timer = Timers->Next(timer)) {
#else
for (cTimer *timer = Timers.First(); timer; timer = Timers.Next(timer)) { for (cTimer *timer = Timers.First(); timer; timer = Timers.Next(timer)) {
#endif
char* searchID = GetAuxValue(timer, "s-id"); char* searchID = GetAuxValue(timer, "s-id");
if (!searchID) continue; if (!searchID) continue;
if (ID == atoi(searchID)) if (ID == atoi(searchID))
@ -525,7 +526,12 @@ int cTVGuideSearchTimer::GetNumRecordings(void) {
int numRecordings = 0; int numRecordings = 0;
if (ID < 0) if (ID < 0)
return numRecordings; return numRecordings;
#if VDRVERSNUM >= 20301
LOCK_RECORDINGS_READ;
for (const cRecording *recording = Recordings->First(); recording; recording = Recordings->Next(recording)) {
#else
for (cRecording *recording = Recordings.First(); recording; recording = Recordings.Next(recording)) { for (cRecording *recording = Recordings.First(); recording; recording = Recordings.Next(recording)) {
#endif
if (recording->IsEdited()) if (recording->IsEdited())
continue; continue;
if (!recording->Info()) if (!recording->Info())
@ -545,8 +551,43 @@ void cTVGuideSearchTimer::GetSearchModes(std::vector<std::string> *searchModes)
searchModes->push_back(tr("one term must exist")); searchModes->push_back(tr("one term must exist"));
searchModes->push_back(tr("exact match")); searchModes->push_back(tr("exact match"));
searchModes->push_back(tr("regular expression")); searchModes->push_back(tr("regular expression"));
searchModes->push_back(tr("fuzzy"));
} }
void cTVGuideSearchTimer::GetSubTitleModes(std::vector<std::string> *subTitleModes) {
subTitleModes->push_back(trVDR("no"));
subTitleModes->push_back(trVDR("yes"));
subTitleModes->push_back(tr("allow empty"));
}
void cTVGuideSearchTimer::GetUseChannelModes(std::vector<std::string> *useChannelModes) {
useChannelModes->push_back(tr("No"));
useChannelModes->push_back(tr("Interval"));
useChannelModes->push_back(tr("Channel Group"));
useChannelModes->push_back(tr("only FTA"));
}
void cTVGuideSearchTimer::GetCompareDateModes(std::vector<std::string> *compareDateModes) {
compareDateModes->push_back(tr("No"));
compareDateModes->push_back(tr("same day"));
compareDateModes->push_back(tr("same week"));
compareDateModes->push_back(tr("same month"));
}
void cTVGuideSearchTimer::GetSearchTimerModes(std::vector<std::string> *searchTimerModes) {
searchTimerModes->push_back(tr("Record"));
searchTimerModes->push_back(tr("Announce by OSD"));
searchTimerModes->push_back(tr("Switch only"));
searchTimerModes->push_back(tr("Announce and switch"));
searchTimerModes->push_back(tr("Announce by mail"));
searchTimerModes->push_back(tr("Inactive record"));
}
void cTVGuideSearchTimer::GetDelModes(std::vector<std::string> *delModes) {
delModes->push_back(tr("no"));
delModes->push_back(tr("count recordings"));
delModes->push_back(tr("count days"));
}
void cTVGuideSearchTimer::Dump(void) { void cTVGuideSearchTimer::Dump(void) {
esyslog("tvguide searchtimer: strTimer: %s", strTimer.c_str()); esyslog("tvguide searchtimer: strTimer: %s", strTimer.c_str());
@ -567,4 +608,3 @@ void cTVGuideSearchTimer::Dump(void) {
esyslog("tvguide searchtimer: useSubtitle: %d", useSubtitle); esyslog("tvguide searchtimer: useSubtitle: %d", useSubtitle);
esyslog("tvguide searchtimer: useDescription: %d", useDescription); esyslog("tvguide searchtimer: useDescription: %d", useDescription);
} }

View File

@ -3,7 +3,8 @@
class cTVGuideSearchTimer { class cTVGuideSearchTimer {
private: friend class cRecMenuSearchTimerEdit;
protected:
std::string strTimer; std::string strTimer;
int ID; int ID;
std::string searchString; std::string searchString;
@ -11,8 +12,8 @@ private:
int startTime; int startTime;
int stopTime; int stopTime;
int useChannel; int useChannel;
cChannel *channelMin; const cChannel *channelMin;
cChannel *channelMax; const cChannel *channelMax;
std::string channelGroup; std::string channelGroup;
int useCase; int useCase;
int mode; int mode;
@ -71,65 +72,20 @@ public:
std::string BuildSearchString(void); std::string BuildSearchString(void);
int GetID(void) { return ID; }; int GetID(void) { return ID; };
//GETTER //GETTER
std::string SearchString(void) const { return searchString; }; std::string GetSearchString(void) const { return searchString; };
bool Active(void); bool IsActive(void);
bool UseTitle(void) { return useTitle; };
bool UseSubtitle(void) { return useSubtitle; };
bool UseDescription(void) { return useDescription; };
int SearchMode(void) { return mode; };
bool UseChannel(void) { return useChannel; };
int StartChannel(void) { return (channelMin)?channelMin->Number():0; };
int StopChannel(void) { return (channelMax)?channelMax->Number():0; };
bool UseTime(void) { return useTime; };
int StartTime(void) { return startTime; };
int StopTime(void) { return stopTime; };
bool UseDayOfWeek(void) { return useDayOfWeek; };
int DayOfWeek(void);
int UseEpisode(void) { return useEpisode; };
std::string Directory(void) { return directory; };
int Priority(void) { return priority; };
int Lifetime(void) { return lifetime; };
int MarginStart(void) { return marginStart; };
int MarginStop(void) { return marginStop; };
bool UseVPS(void) { return useVPS; };
bool AvoidRepeats(void) { return avoidRepeats; };
int AllowedRepeats(void) { return allowedRepeats; };
bool CompareTitle(void) { return compareTitle; };
bool CompareSubtitle(void) { return compareSubtitle; };
bool CompareSummary(void) { return compareSummary; };
bool UseInFavorites(void) { return useInFavorites; }; bool UseInFavorites(void) { return useInFavorites; };
//SETTER //SETTER
void SetSearchString(std::string searchString) { this->searchString = searchString; }; void SetSearchString(std::string searchString) { this->searchString = searchString; };
void SetActive(bool active) { useAsSearchTimer = active; };
void SetSearchMode(int searchMode) { mode = searchMode; };
void SetUseTitle(bool useTitle) { this->useTitle = useTitle; };
void SetUseSubtitle(bool useSubtitle) { this->useSubtitle = useSubtitle; };
void SetUseDesription(bool useDescription) { this->useDescription = useDescription; };
void SetUseChannel(bool useChannel) { this->useChannel = useChannel; };
void SetStartChannel(int startChannel) { channelMin = Channels.GetByNumber(startChannel); };
void SetStopChannel(int stopChannel) { channelMax = Channels.GetByNumber(stopChannel); };
void SetUseTime(bool useTime) { this->useTime = useTime; };
void SetStartTime(int startTime) { this->startTime = startTime; };
void SetStopTime(int stopTime) { this->stopTime = stopTime; };
void SetUseDayOfWeek(bool useDayOfWeek) { this->useDayOfWeek = useDayOfWeek; };
void SetDayOfWeek(int VDRDayOfWeek);
void SetUseEpisode(int useEpisode) { this->useEpisode = useEpisode; };
void SetDirectory(std::string directory) { this-> directory = directory; };
void SetPriority(int priority) { this->priority = priority; };
void SetLifetime(int lifetime) { this->lifetime = lifetime; };
void SetMarginStart(int marginStart) { this->marginStart = marginStart; };
void SetMarginStop(int marginStop) { this->marginStop = marginStop; };
void SetUseVPS(bool useVPS) { this->useVPS = useVPS; };
void SetAvoidRepeats(bool avoidRepeats) { this->avoidRepeats = avoidRepeats; };
void SetAllowedRepeats(int allowedRepeats) { this->allowedRepeats = allowedRepeats; };
void SetCompareTitle(bool compareTitle) { this->compareTitle = compareTitle; };
void SetCompareSubtitle(bool compareSubtitle) { this->compareSubtitle = compareSubtitle; };
void SetCompareSummary(bool compareSummary) { this->compareSummary = compareSummary; };
void SetUseInFavorites(bool useInFavorites) { this->useInFavorites = useInFavorites; };
//COMMON //COMMON
int GetNumTimers(void); int GetNumTimers(void);
int GetNumRecordings(void); int GetNumRecordings(void);
void GetSearchModes(std::vector<std::string> *searchModes); void GetSearchModes(std::vector<std::string> *searchModes);
void GetSubTitleModes(std::vector<std::string> *subTitleModes);
void GetUseChannelModes(std::vector<std::string> *useChannelModes);
void GetSearchTimerModes(std::vector<std::string> *searchTimerModes);
void GetCompareDateModes(std::vector<std::string> *compareDateModes);
void GetDelModes(std::vector<std::string> *delModes);
void Dump(void); void Dump(void);
}; };

View File

@ -31,8 +31,7 @@ The project's page is at http://winni.vdr-developer.org/epgsearch
#include <vdr/osdbase.h> #include <vdr/osdbase.h>
// Data structure for service "Epgsearch-search-v1.0" // Data structure for service "Epgsearch-search-v1.0"
struct Epgsearch_search_v1_0 struct Epgsearch_search_v1_0 {
{
// in // in
char* query; // search term char* query; // search term
int mode; // search mode (0=phrase, 1=and, 2=or, 3=regular expression) int mode; // search mode (0=phrase, 1=and, 2=or, 3=regular expression)
@ -45,8 +44,7 @@ struct Epgsearch_search_v1_0
}; };
// Data structure for service "Epgsearch-exttimeredit-v1.0" // Data structure for service "Epgsearch-exttimeredit-v1.0"
struct Epgsearch_exttimeredit_v1_0 struct Epgsearch_exttimeredit_v1_0 {
{
// in // in
cTimer* timer; // pointer to the timer to edit cTimer* timer; // pointer to the timer to edit
bool bNew; // flag that indicates, if this is a new timer or an existing one bool bNew; // flag that indicates, if this is a new timer or an existing one
@ -56,38 +54,33 @@ struct Epgsearch_exttimeredit_v1_0
}; };
// Data structure for service "Epgsearch-enablesearchtimers-v1.0" // Data structure for service "Epgsearch-enablesearchtimers-v1.0"
struct Epgsearch_enablesearchtimers_v1_0 struct Epgsearch_enablesearchtimers_v1_0 {
{
// in // in
bool enable; // enable search timer thread? bool enable; // enable search timer thread?
}; };
// Data structure for service "Epgsearch-updatesearchtimers-v1.0" // Data structure for service "Epgsearch-updatesearchtimers-v1.0"
struct Epgsearch_updatesearchtimers_v1_0 struct Epgsearch_updatesearchtimers_v1_0 {
{
// in // in
bool showMessage; // inform via osd when finished? bool showMessage; // inform via osd when finished?
}; };
// Data structure for service "Epgsearch-osdmessage-v1.0" // Data structure for service "Epgsearch-osdmessage-v1.0"
struct Epgsearch_osdmessage_v1_0 struct Epgsearch_osdmessage_v1_0 {
{
// in // in
char* message; // the message to display char* message; // the message to display
eMessageType type; eMessageType type;
}; };
// Data structure for service "EpgsearchMenu-v1.0" // Data structure for service "EpgsearchMenu-v1.0"
struct EpgSearchMenu_v1_0 struct EpgSearchMenu_v1_0 {
{
// in // in
// out // out
cOsdMenu* Menu; // pointer to the menu cOsdMenu* Menu; // pointer to the menu
}; };
// Data structure for service "Epgsearch-lastconflictinfo-v1.0" // Data structure for service "Epgsearch-lastconflictinfo-v1.0"
struct Epgsearch_lastconflictinfo_v1_0 struct Epgsearch_lastconflictinfo_v1_0 {
{
// in // in
// out // out
time_t nextConflict; // next conflict date, 0 if none time_t nextConflict; // next conflict date, 0 if none
@ -96,8 +89,7 @@ struct Epgsearch_lastconflictinfo_v1_0
}; };
// Data structure for service "Epgsearch-searchresults-v1.0" // Data structure for service "Epgsearch-searchresults-v1.0"
struct Epgsearch_searchresults_v1_0 struct Epgsearch_searchresults_v1_0 {
{
// in // in
char* query; // search term char* query; // search term
int mode; // search mode (0=phrase, 1=and, 2=or, 3=regular expression) int mode; // search mode (0=phrase, 1=and, 2=or, 3=regular expression)
@ -118,8 +110,7 @@ struct Epgsearch_searchresults_v1_0
}; };
// Data structure for service "Epgsearch-switchtimer-v1.0" // Data structure for service "Epgsearch-switchtimer-v1.0"
struct Epgsearch_switchtimer_v1_0 struct Epgsearch_switchtimer_v1_0 {
{
// in // in
const cEvent* event; const cEvent* event;
int mode; // mode (0=query existence, 1=add/modify, 2=delete) int mode; // mode (0=query existence, 1=add/modify, 2=delete)
@ -133,7 +124,7 @@ struct Epgsearch_switchtimer_v1_0
// Data structures for service "Epgsearch-services-v1.0" // Data structures for service "Epgsearch-services-v1.0"
class cServiceHandler class cServiceHandler
{ {
public: public:
virtual std::list<std::string> SearchTimerList() = 0; virtual std::list<std::string> SearchTimerList() = 0;
// returns a list of search timer entries in the same format as used in epgsearch.conf // returns a list of search timer entries in the same format as used in epgsearch.conf
virtual int AddSearchTimer(const std::string&) = 0; virtual int AddSearchTimer(const std::string&) = 0;
@ -161,42 +152,51 @@ class cServiceHandler
virtual bool WriteSetupValue(const std::string& entry, const std::string& value) = 0; virtual bool WriteSetupValue(const std::string& entry, const std::string& value) = 0;
}; };
struct Epgsearch_services_v1_0 struct Epgsearch_services_v1_0 {
{
// in/out // in/out
#if __cplusplus < 201103L
std::auto_ptr<cServiceHandler> handler; std::auto_ptr<cServiceHandler> handler;
#else
std::unique_ptr<cServiceHandler> handler;
#endif
}; };
// Data structures for service "Epgsearch-services-v1.1" // Data structures for service "Epgsearch-services-v1.1"
class cServiceHandler_v1_1 : public cServiceHandler class cServiceHandler_v1_1 : public cServiceHandler
{ {
public: public:
// Get timer conflicts // Get timer conflicts
virtual std::list<std::string> TimerConflictList(bool relOnly=false) = 0; virtual std::list<std::string> TimerConflictList(bool relOnly = false) = 0;
// Check if a conflict check is advised // Check if a conflict check is advised
virtual bool IsConflictCheckAdvised() = 0; virtual bool IsConflictCheckAdvised() = 0;
}; };
struct Epgsearch_services_v1_1 struct Epgsearch_services_v1_1 {
{
// in/out // in/out
#if __cplusplus < 201103L
std::auto_ptr<cServiceHandler_v1_1> handler; std::auto_ptr<cServiceHandler_v1_1> handler;
#else
std::unique_ptr<cServiceHandler_v1_1> handler;
#endif
}; };
// Data structures for service "Epgsearch-services-v1.2" // Data structures for service "Epgsearch-services-v1.2"
class cServiceHandler_v1_2 : public cServiceHandler_v1_1 class cServiceHandler_v1_2 : public cServiceHandler_v1_1
{ {
public: public:
// List of all recording directories used in recordings, timers (and optionally search timers or in epgsearchdirs.conf) // List of all recording directories used in recordings, timers (and optionally search timers or in epgsearchdirs.conf)
virtual std::set<std::string> ShortDirectoryList() = 0; virtual std::set<std::string> ShortDirectoryList() = 0;
// Evaluate an expression against an event // Evaluate an expression against an event
virtual std::string Evaluate(const std::string& expr, const cEvent* event) = 0; virtual std::string Evaluate(const std::string& expr, const cEvent* event) = 0;
}; };
struct Epgsearch_services_v1_2 struct Epgsearch_services_v1_2 {
{
// in/out // in/out
#if __cplusplus < 201103L
std::auto_ptr<cServiceHandler_v1_2> handler; std::auto_ptr<cServiceHandler_v1_2> handler;
#else
std::unique_ptr<cServiceHandler_v1_2> handler;
#endif
}; };
#endif #endif

View File

@ -1,33 +1,182 @@
#ifndef REMOTETIMERSERVICES_INC /*
#define REMOTETIMERSERVICES_INC * remotetimers.h: Public interface of the plugin's services
*
* Copyright (C) 2008-2013 Frank Schmirler <vdr@schmirler.de>
*
* This file is part of VDR Plugin remotetimers.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
#ifndef _SERVICE__H
#define _SERVICE__H
#include <vdr/epg.h>
#include <vdr/timers.h> #include <vdr/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.
*
* The service calls are not thread safe and must be called from the VDR main loop.
*/
/*
* RemoteTimers::InstantRecording-v1.0
* Start an instant recording or pause live TV. VDR needs to be patched to support this.
* The service returns false if a local timer should be used. An error occured if true is returned but the out parameters name and fileName are NULL.
* Data points to the following structure where pause indicates if it is an instant recording or an attempt to pause live TV.
*/
struct RemoteTimers_InstantRecording_v1_0 {
//in
const cTimer *timer;
bool pause;
const cEvent *event; const cEvent *event;
//out //out
cTimer *timer; cString name;
cString errorMsg; 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;
}; };
struct RemoteTimers_Timer_v1_0 { /*
//in+out * 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; cTimer *timer;
//out
cString errorMsg; cString errorMsg;
}; };
#endif //REMOTETIMERSERVICES_INC /*
* RemoteTimers::NewTimer-v1.0
* Add a new timer.
* In case of an error, the service call returns false and the structure includes an error message.
* Data points to a RemoteTimers_Timer_v1_0 struct.
*
* RemoteTimers::ModTimer-v1.0
* Change an existing timer.
* In case of an error, the service call returns false and the structure includes an error message.
* Data points to a RemoteTimers_Timer_v1_0 struct.
*
* RemoteTimers::DelTimer-v1.0
* Delete an existing timer.
* In case of an error, the service call returns false and the structure includes an error message.
* Data points to a RemoteTimers_Timer_v1_0 struct.
*/
struct RemoteTimers_Timer_v1_0 {
//in+out
cTimer *timer;
//out
cString errorMsg;
};
/*
* 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

555
setup.c
View File

@ -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,105 +56,113 @@ 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("bigStepHours", tvguideConfig.bigStepHours); SetupStore("displayTime", config.displayTime);
SetupStore("hugeStepHours", tvguideConfig.hugeStepHours); SetupStore("displayHorizontalTime", config.displayHorizontalTime);
SetupStore("channelJumpMode", tvguideConfig.channelJumpMode); SetupStore("bigStepHours", config.bigStepHours);
SetupStore("blueKeyMode", tvguideConfig.blueKeyMode); SetupStore("bigStepHoursHorizontal", config.bigStepHoursHorizontal);
SetupStore("numkeyMode", tvguideConfig.numkeyMode); SetupStore("hugeStepHours", config.hugeStepHours);
SetupStore("useRemoteTimers", tvguideConfig.useRemoteTimers); SetupStore("hugeStepHoursHorizontal", config.hugeStepHoursHorizontal);
SetupStore("closeOnSwitch", tvguideConfig.closeOnSwitch); SetupStore("channelJumpMode", config.channelJumpMode);
SetupStore("hideLastGroup", tvguideConfig.hideLastGroup); SetupStore("blueKeyMode", config.blueKeyMode);
SetupStore("hideChannelLogos", tvguideConfig.hideChannelLogos); SetupStore("numkeyMode", config.numkeyMode);
SetupStore("logoExtension", tvguideConfig.logoExtension); SetupStore("useRemoteTimers", config.useRemoteTimers);
SetupStore("logoWidthRatio", tvguideConfig.logoWidthRatio); SetupStore("closeOnSwitch", config.closeOnSwitch);
SetupStore("logoHeightRatio", tvguideConfig.logoHeightRatio); SetupStore("hideLastGroup", config.hideLastGroup);
SetupStore("hideEpgImages", tvguideConfig.hideEpgImages); SetupStore("hideChannelLogos", config.hideChannelLogos);
SetupStore("epgImageWidth", tvguideConfig.epgImageWidth); SetupStore("logoExtension", config.logoExtension);
SetupStore("epgImageHeight", tvguideConfig.epgImageHeight); SetupStore("logoWidthRatio", config.logoWidthRatio);
SetupStore("numAdditionalEPGPictures", tvguideConfig.numAdditionalEPGPictures); SetupStore("logoHeightRatio", config.logoHeightRatio);
SetupStore("epgImageWidthLarge", tvguideConfig.epgImageWidthLarge); SetupStore("hideEpgImages", config.hideEpgImages);
SetupStore("epgImageHeightLarge", tvguideConfig.epgImageHeightLarge); SetupStore("epgImageWidth", config.epgImageWidth);
SetupStore("detailedViewScrollStep", tvguideConfig.detailedViewScrollStep); SetupStore("epgImageHeight", config.epgImageHeight);
SetupStore("timeLineWidthPercent", tvguideConfig.timeLineWidthPercent); SetupStore("numAdditionalEPGPictures", config.numAdditionalEPGPictures);
SetupStore("timeLineHeightPercent", tvguideConfig.timeLineHeightPercent); SetupStore("epgImageWidthLarge", config.epgImageWidthLarge);
SetupStore("displayChannelName", tvguideConfig.displayChannelName); SetupStore("epgImageHeightLarge", config.epgImageHeightLarge);
SetupStore("channelHeaderWidthPercent", tvguideConfig.channelHeaderWidthPercent); SetupStore("detailedViewScrollStep", config.detailedViewScrollStep);
SetupStore("channelHeaderHeightPercent", tvguideConfig.channelHeaderHeightPercent); SetupStore("timeLineWidthPercent", config.timeLineWidthPercent);
SetupStore("footerHeightPercent", tvguideConfig.footerHeightPercent); SetupStore("timeLineHeightPercent", config.timeLineHeightPercent);
SetupStore("instRecFolderMode", tvguideConfig.instRecFolderMode); SetupStore("displayChannelName", config.displayChannelName);
SetupStore("instRecFixedFolder", tvguideConfig.instRecFixedFolder.c_str()); SetupStore("channelHeaderWidthPercent", config.channelHeaderWidthPercent);
SetupStore("favWhatsOnNow", tvguideConfig.favWhatsOnNow); SetupStore("channelHeaderHeightPercent", config.channelHeaderHeightPercent);
SetupStore("favWhatsOnNext", tvguideConfig.favWhatsOnNext); SetupStore("footerHeightPercent", config.footerHeightPercent);
SetupStore("favUseTime1", tvguideConfig.favUseTime1); SetupStore("instRecFolderMode", config.instRecFolderMode);
SetupStore("favUseTime2", tvguideConfig.favUseTime2); SetupStore("instRecFixedFolder", config.instRecFixedFolder.c_str());
SetupStore("favUseTime3", tvguideConfig.favUseTime3); SetupStore("addSubtitleToTimer", config.addSubtitleToTimer);
SetupStore("favUseTime4", tvguideConfig.favUseTime4); SetupStore("timerMessage", config.timerMessage);
SetupStore("favTime1", tvguideConfig.favTime1); SetupStore("favWhatsOnNow", config.favWhatsOnNow);
SetupStore("favTime2", tvguideConfig.favTime2); SetupStore("favWhatsOnNext", config.favWhatsOnNext);
SetupStore("favTime3", tvguideConfig.favTime3); SetupStore("favUseTime1", config.favUseTime1);
SetupStore("favTime4", tvguideConfig.favTime4); SetupStore("favUseTime2", config.favUseTime2);
SetupStore("descUser1", tvguideConfig.descUser1.c_str()); SetupStore("favUseTime3", config.favUseTime3);
SetupStore("descUser2", tvguideConfig.descUser2.c_str()); SetupStore("favUseTime4", config.favUseTime4);
SetupStore("descUser3", tvguideConfig.descUser3.c_str()); SetupStore("favTime1", config.favTime1);
SetupStore("descUser4", tvguideConfig.descUser4.c_str()); SetupStore("favTime2", config.favTime2);
SetupStore("favLimitChannels", tvguideConfig.favLimitChannels); SetupStore("favTime3", config.favTime3);
SetupStore("favStartChannel", tvguideConfig.favStartChannel); SetupStore("favTime4", config.favTime4);
SetupStore("favStopChannel", tvguideConfig.favStopChannel); SetupStore("descUser1", config.descUser1.c_str());
SetupStore("fontIndex", tvguideConfig.fontIndex); SetupStore("descUser2", config.descUser2.c_str());
SetupStore("FontButtonDelta", tvguideConfig.FontButtonDelta); SetupStore("descUser3", config.descUser3.c_str());
SetupStore("FontDetailViewDelta", tvguideConfig.FontDetailViewDelta); SetupStore("descUser4", config.descUser4.c_str());
SetupStore("FontDetailHeaderDelta", tvguideConfig.FontDetailHeaderDelta); SetupStore("favLimitChannels", config.favLimitChannels);
SetupStore("FontMessageBoxDelta", tvguideConfig.FontMessageBoxDelta); SetupStore("favStartChannel", config.favStartChannel);
SetupStore("FontMessageBoxLargeDelta", tvguideConfig.FontMessageBoxLargeDelta); SetupStore("favStopChannel", config.favStopChannel);
SetupStore("FontStatusHeaderDelta", tvguideConfig.FontStatusHeaderDelta); SetupStore("switchMode", config.switchMode);
SetupStore("FontStatusHeaderLargeDelta", tvguideConfig.FontStatusHeaderLargeDelta); SetupStore("switchMinsBefore", config.switchMinsBefore);
SetupStore("FontChannelHeaderDelta", tvguideConfig.FontChannelHeaderDelta); SetupStore("fontIndex", config.fontIndex);
SetupStore("FontChannelGroupsDelta", tvguideConfig.FontChannelGroupsDelta); SetupStore("FontButtonDelta", config.FontButtonDelta);
SetupStore("FontGridDelta", tvguideConfig.FontGridDelta); SetupStore("FontDetailViewDelta", config.FontDetailViewDelta);
SetupStore("FontGridSmallDelta", tvguideConfig.FontGridSmallDelta); SetupStore("FontDetailHeaderDelta", config.FontDetailHeaderDelta);
SetupStore("FontTimeLineWeekdayDelta", tvguideConfig.FontTimeLineWeekdayDelta); SetupStore("FontMessageBoxDelta", config.FontMessageBoxDelta);
SetupStore("FontTimeLineDateDelta", tvguideConfig.FontTimeLineDateDelta); SetupStore("FontMessageBoxLargeDelta", config.FontMessageBoxLargeDelta);
SetupStore("FontTimeLineTimeDelta", tvguideConfig.FontTimeLineTimeDelta); SetupStore("FontStatusHeaderDelta", config.FontStatusHeaderDelta);
SetupStore("FontChannelHeaderHorizontalDelta", tvguideConfig.FontChannelHeaderHorizontalDelta); SetupStore("FontStatusHeaderLargeDelta", config.FontStatusHeaderLargeDelta);
SetupStore("FontChannelGroupsHorizontalDelta", tvguideConfig.FontChannelGroupsHorizontalDelta); SetupStore("FontChannelHeaderDelta", config.FontChannelHeaderDelta);
SetupStore("FontGridHorizontalDelta", tvguideConfig.FontGridHorizontalDelta); SetupStore("FontChannelGroupsDelta", config.FontChannelGroupsDelta);
SetupStore("FontGridHorizontalSmallDelta", tvguideConfig.FontGridHorizontalSmallDelta); SetupStore("FontGridDelta", config.FontGridDelta);
SetupStore("FontTimeLineDateHorizontalDelta", tvguideConfig.FontTimeLineDateHorizontalDelta); SetupStore("FontGridSmallDelta", config.FontGridSmallDelta);
SetupStore("FontTimeLineTimeHorizontalDelta", tvguideConfig.FontTimeLineTimeHorizontalDelta); SetupStore("FontTimeLineWeekdayDelta", config.FontTimeLineWeekdayDelta);
SetupStore("FontRecMenuItemDelta", tvguideConfig.FontRecMenuItemDelta); SetupStore("FontTimeLineDateDelta", config.FontTimeLineDateDelta);
SetupStore("FontRecMenuItemSmallDelta", tvguideConfig.FontRecMenuItemSmallDelta); SetupStore("FontTimeLineTimeDelta", config.FontTimeLineTimeDelta);
SetupStore("FontRecMenuItemLargeDelta", tvguideConfig.FontRecMenuItemLargeDelta); SetupStore("FontChannelHeaderHorizontalDelta", config.FontChannelHeaderHorizontalDelta);
SetupStore("displayRerunsDetailEPGView", tvguideConfig.displayRerunsDetailEPGView); SetupStore("FontChannelGroupsHorizontalDelta", config.FontChannelGroupsHorizontalDelta);
SetupStore("numReruns", tvguideConfig.numReruns); SetupStore("FontGridHorizontalDelta", config.FontGridHorizontalDelta);
SetupStore("useSubtitleRerun", tvguideConfig.useSubtitleRerun); SetupStore("FontGridHorizontalSmallDelta", config.FontGridHorizontalSmallDelta);
SetupStore("numLogosInitial", tvguideConfig.numLogosInitial); SetupStore("FontTimeLineDateHorizontalDelta", config.FontTimeLineDateHorizontalDelta);
SetupStore("numLogosMax", tvguideConfig.numLogosMax); SetupStore("FontTimeLineTimeHorizontalDelta", config.FontTimeLineTimeHorizontalDelta);
SetupStore("limitLogoCache", tvguideConfig.limitLogoCache); SetupStore("FontRecMenuItemDelta", config.FontRecMenuItemDelta);
SetupStore("FontRecMenuItemSmallDelta", config.FontRecMenuItemSmallDelta);
SetupStore("FontRecMenuItemLargeDelta", config.FontRecMenuItemLargeDelta);
SetupStore("displayRerunsDetailEPGView", config.displayRerunsDetailEPGView);
SetupStore("numReruns", config.numReruns);
SetupStore("useSubtitleRerun", config.useSubtitleRerun);
SetupStore("numLogosInitial", config.numLogosInitial);
SetupStore("numLogosMax", config.numLogosMax);
SetupStore("limitLogoCache", config.limitLogoCache);
} }
cMenuSetupSubMenu::cMenuSetupSubMenu(const char* Title, cTvguideConfig* data) : cOsdMenu(Title, 30) { cMenuSetupSubMenu::cMenuSetupSubMenu(const char* Title, cTVGuideConfig* data) : cOsdMenu(Title, 40) {
tmpTvguideConfig = data; tmpConfig = data;
indent = " "; indent = " ";
} }
@ -180,7 +188,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";
@ -200,47 +208,62 @@ 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()));
} }
Add(new cMenuEditIntItem(tr("Time to display in minutes"), &tmpTvguideConfig->displayTime, 60, 320)); if (tmpConfig->displayMode == eVertical) {
Add(new cMenuEditBoolItem(tr("Rounded Corners"), &tmpTvguideConfig->roundedCorners)); Add(new cMenuEditIntItem(tr("Time to display in minutes"), &tmpConfig->displayTime, 60, 320));
} else if (tmpConfig->displayMode == eHorizontal) {
Add(new cMenuEditIntItem(tr("Time to display in minutes"), &tmpConfig->displayHorizontalTime, 60, 320));
}
Add(new cMenuEditBoolItem(tr("Rounded Corners"), &tmpConfig->roundedCorners));
Add(new cMenuEditStraItem(tr("Channel Jump Mode (Keys Green / Yellow)"), &tmpTvguideConfig->channelJumpMode, 2, jumpMode)); Add(new cMenuEditStraItem(tr("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 = tmpConfig->useNopacityTheme;
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 (tmpConfig->useNopacityTheme != olduseNopacityTheme ||
tmpConfig->displayRerunsDetailEPGView != olddisplayRerunsDetailEPGView) {
Set(); Set();
} }
}
return state; return state;
} }
//----- 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");
@ -254,55 +277,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));
@ -310,20 +333,31 @@ void cMenuSetupScreenLayout::Set(void) {
} }
eOSState cMenuSetupScreenLayout::ProcessKey(eKeys Key) { eOSState cMenuSetupScreenLayout::ProcessKey(eKeys Key) {
int olddisplayMode = tmpConfig->displayMode;
bool olddisplayStatusHeader = tmpConfig->displayStatusHeader;
bool olddisplayChannelGroups = tmpConfig->displayChannelGroups;
int oldhideChannelLogos = tmpConfig->hideChannelLogos;
int oldhideEpgImages = tmpConfig->hideEpgImages;
eOSState state = cOsdMenu::ProcessKey(Key); eOSState state = cOsdMenu::ProcessKey(Key);
if (Key == kOk) { if (Key == kOk) {
state = osBack; state = osBack;
} else if (Key != kNone) { } else if (Key != kNone) {
if (tmpConfig->displayMode != olddisplayMode ||
tmpConfig->displayStatusHeader != olddisplayStatusHeader ||
tmpConfig->displayChannelGroups != olddisplayChannelGroups ||
tmpConfig->hideChannelLogos != oldhideChannelLogos ||
tmpConfig->hideEpgImages != oldhideEpgImages) {
Set(); Set();
} }
}
return state; return state;
} }
//-----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();
} }
@ -331,37 +365,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();
@ -369,7 +403,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));
@ -378,6 +412,12 @@ 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[1] = (tr("announce only"));
switchModeItems[2] = (tr("ask for switch"));
Set(); Set();
} }
@ -385,40 +425,47 @@ 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 cMenuEditBoolItem(tr("Show timer confirmation messages"), &tmpConfig->timerMessage));
Add(new cMenuEditBoolItem(tr("Use \"What's on now\" in favorites"), &tmpTvguideConfig->favWhatsOnNow)); Add(new cOsdItem(tr("Favorites:"), osUnknown, false));
Add(new cMenuEditBoolItem(tr("Use \"What's on next\" in favorites"), &tmpTvguideConfig->favWhatsOnNext)); Add(new cMenuEditBoolItem(tr("Limit channels in favorites"), &tmpConfig->favLimitChannels));
Add(new cMenuEditBoolItem(tr("Use user defined time 1 in favorites"), &tmpTvguideConfig->favUseTime1)); if (tmpConfig->favLimitChannels) {
if (tmpTvguideConfig->favUseTime1) { Add(new cMenuEditChanItem(tr("Start Channel"), &tmpConfig->favStartChannel));
Add(new cMenuEditChanItem(tr("Stop Channel"), &tmpConfig->favStopChannel));
}
Add(new cMenuEditBoolItem(tr("Use \"What's on now\" in favorites"), &tmpConfig->favWhatsOnNow));
Add(new cMenuEditBoolItem(tr("Use \"What's on next\" in favorites"), &tmpConfig->favWhatsOnNext));
Add(new cOsdItem(tr("User defined times in favorites:"), osUnknown, false));
Add(new cMenuEditBoolItem(tr("Use user defined time 1"), &tmpConfig->favUseTime1));
if (tmpConfig->favUseTime1) {
Add(new cMenuEditStrItem(cString::sprintf("%s%s", *indent, tr("Description")), description1, sizeof(description1), trVDR(FileNameChars))); Add(new cMenuEditStrItem(cString::sprintf("%s%s", *indent, tr("Description")), description1, sizeof(description1), trVDR(FileNameChars)));
Add(new cMenuEditTimeItem(cString::sprintf("%s%s", *indent, tr("Time")), &tmpTvguideConfig->favTime1)); Add(new cMenuEditTimeItem(cString::sprintf("%s%s", *indent, tr("Time")), &tmpConfig->favTime1));
} }
Add(new cMenuEditBoolItem(tr("Use user defined time 2 in favorites"), &tmpTvguideConfig->favUseTime2)); 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 in favorites"), &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 in favorites"), &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 cMenuEditBoolItem(tr("Limit channels in favorites"), &tmpTvguideConfig->favLimitChannels));
if (tmpTvguideConfig->favLimitChannels) {
Add(new cMenuEditChanItem(tr("Start Channel"), &tmpTvguideConfig->favStartChannel));
Add(new cMenuEditChanItem(tr("Stop Channel"), &tmpTvguideConfig->favStopChannel));
} }
Add(new cOsdItem(tr("Switchtimer:"), osUnknown, false));
Add(new cMenuEditStraItem(tr("Switch Mode"), &tmpConfig->switchMode, 3, switchModeItems));
Add(new cMenuEditIntItem(tr("Switch (x)min before start of the show"), &tmpConfig->switchMinsBefore, 0, 10));
SetCurrent(Get(currentItem)); SetCurrent(Get(currentItem));
@ -426,53 +473,63 @@ void cMenuSetupFavorites::Set(void) {
} }
eOSState cMenuSetupFavorites::ProcessKey(eKeys Key) { eOSState cMenuSetupFavorites::ProcessKey(eKeys Key) {
int tmpFavUseTime1 = tmpTvguideConfig->favUseTime1;
int tmpFavUseTime2 = tmpTvguideConfig->favUseTime2; int tmpFavUseTime1 = tmpConfig->favUseTime1;
int tmpFavUseTime3 = tmpTvguideConfig->favUseTime3; int tmpFavUseTime2 = tmpConfig->favUseTime2;
int tmpFavUseTime4 = tmpTvguideConfig->favUseTime4; int tmpFavUseTime3 = tmpConfig->favUseTime3;
int tmpFavLimitChannels = tmpTvguideConfig->favLimitChannels; int tmpFavUseTime4 = tmpConfig->favUseTime4;
int tmpFolderMode = tmpTvguideConfig->instRecFolderMode; int tmpFavLimitChannels = tmpConfig->favLimitChannels;
int tmpFolderMode = tmpConfig->instRecFolderMode;
eOSState state = cOsdMenu::ProcessKey(Key); eOSState state = cOsdMenu::ProcessKey(Key);
if (Key == kOk) {
tmpTvguideConfig->descUser1 = description1; if ((tmpFavUseTime1 != tmpConfig->favUseTime1) ||
tmpTvguideConfig->descUser2 = description2; (tmpFavUseTime2 != tmpConfig->favUseTime2) ||
tmpTvguideConfig->descUser3 = description3; (tmpFavUseTime3 != tmpConfig->favUseTime3) ||
tmpTvguideConfig->descUser4 = description4; (tmpFavUseTime4 != tmpConfig->favUseTime4) ||
tmpTvguideConfig->instRecFixedFolder = fixedFolder; (tmpFavLimitChannels != tmpConfig->favLimitChannels) ||
} else if ((Key == kLeft)||(Key == kRight)) { (tmpFolderMode != tmpConfig->instRecFolderMode) ) {
if ((tmpFavUseTime1 != tmpTvguideConfig->favUseTime1) ||
(tmpFavUseTime2 != tmpTvguideConfig->favUseTime2) ||
(tmpFavUseTime3 != tmpTvguideConfig->favUseTime3) ||
(tmpFavUseTime4 != tmpTvguideConfig->favUseTime4) ||
(tmpFavLimitChannels != tmpTvguideConfig->favLimitChannels) ||
(tmpFolderMode != tmpTvguideConfig->instRecFolderMode) )
Set(); Set();
Display();
} }
if (state == osUnknown) {
switch (Key) {
case kOk: {
tmpConfig->descUser1 = cString::sprintf("%s", description1);
tmpConfig->descUser2 = cString::sprintf("%s", description2);
tmpConfig->descUser3 = cString::sprintf("%s", description3);
tmpConfig->descUser4 = cString::sprintf("%s", description4);
return osBack; }
default:
break;
}
}
return state; return state;
} }
//-----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();

20
setup.h
View File

@ -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,18 +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];
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

View File

@ -9,15 +9,15 @@ cStatusHeader::cStatusHeader(void) {
height = geoManager.statusHeaderHeight; height = geoManager.statusHeaderHeight;
width = geoManager.headerContentWidth; width = geoManager.headerContentWidth;
tvFrameWidth = geoManager.tvFrameWidth; tvFrameWidth = geoManager.tvFrameWidth;
pixmap = osdManager.requestPixmap(1, cRect(0, 0, width, height)); pixmap = osdManager.CreatePixmap(1, cRect(0, 0, width, height));
pixmapText = osdManager.requestPixmap(2, cRect(0, 0, width, height)); pixmapText = osdManager.CreatePixmap(2, cRect(0, 0, width, height));
pixmapTVFrame = osdManager.requestPixmap(1, cRect(width, 0, tvFrameWidth, height)); pixmapTVFrame = osdManager.CreatePixmap(1, cRect(width, 0, tvFrameWidth, height));
} }
cStatusHeader::~cStatusHeader(void) { cStatusHeader::~cStatusHeader(void) {
osdManager.releasePixmap(pixmapText); osdManager.DestroyPixmap(pixmapText);
osdManager.releasePixmap(pixmapTVFrame); osdManager.DestroyPixmap(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,14 +55,15 @@ void cStatusHeader::ScaleVideo(void) {
} }
} }
void cStatusHeader::DrawInfoText(cGrid *grid) { void cStatusHeader::DrawInfoText(cGridElement *grid) {
int border = 10; int border = 10;
int textWidth = width - 2 * border - geoManager.clockWidth - 2; int textWidth = 0;
tColor colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent; textWidth = width - 2 * border;
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;
if (!grid->isDummy()) { if (!grid->IsDummy()) {
const cEvent *event = grid->GetEvent(); const cEvent *event = grid->GetEvent();
int newX = DrawPoster(event, x, y, height-2*border, border); int newX = DrawPoster(event, x, y, height-2*border, border);
if (newX > 0) { if (newX > 0) {
@ -82,7 +83,7 @@ void cStatusHeader::DrawInfoText(cGrid *grid) {
int lineHeight = fontManager.FontStatusHeader->Height(); int lineHeight = fontManager.FontStatusHeader->Height();
int textLines = description.Lines(); int textLines = description.Lines();
int maxLines = heightText / lineHeight; int maxLines = heightText / lineHeight;
int lines = min(textLines, maxLines); int lines = std::min(textLines, maxLines);
for (int i = 0; i < lines-1; i++) { for (int i = 0; i < lines-1; i++) {
pixmapText->DrawText(cPoint(x,y), description.GetLine(i), theme.Color(clrFont), colorTextBack, fontManager.FontStatusHeader); pixmapText->DrawText(cPoint(x,y), description.GetLine(i), theme.Color(clrFont), colorTextBack, fontManager.FontStatusHeader);
y += lineHeight; y += lineHeight;
@ -104,11 +105,11 @@ int cStatusHeader::DrawPoster(const cEvent *event, int x, int y, int height, int
ScraperGetPoster posterScraper2Vdr; ScraperGetPoster posterScraper2Vdr;
int posterWidth = 0; int posterWidth = 0;
int posterHeight = 0; int posterHeight = 0;
static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr"); static cPlugin *pScraper = GetScraperPlugin();
if (pScraper2Vdr) { if (pScraper) {
posterScraper2Vdr.event = event; posterScraper2Vdr.event = event;
posterScraper2Vdr.recording = NULL; posterScraper2Vdr.recording = NULL;
if (pScraper2Vdr->Service("GetPoster", &posterScraper2Vdr)) { if (pScraper->Service("GetPoster", &posterScraper2Vdr)) {
hasPoster = true; hasPoster = true;
int posterWidthOrig = posterScraper2Vdr.poster.width; int posterWidthOrig = posterScraper2Vdr.poster.width;
int posterHeightOrig = posterScraper2Vdr.poster.height; int posterHeightOrig = posterScraper2Vdr.poster.height;

View File

@ -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

View File

@ -12,7 +12,7 @@ cStyledPixmap::cStyledPixmap(cPixmap *pixmap) {
cStyledPixmap::~cStyledPixmap(void) { cStyledPixmap::~cStyledPixmap(void) {
if (pixmap) if (pixmap)
osdManager.releasePixmap(pixmap); osdManager.DestroyPixmap(pixmap);
} }
void cStyledPixmap::setPixmap(cPixmap *pixmap) { void cStyledPixmap::setPixmap(cPixmap *pixmap) {
@ -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);
} }

View File

@ -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 {

View File

@ -6,8 +6,8 @@ cSwitchTimers SwitchTimers;
cSwitchTimer::cSwitchTimer(void) { cSwitchTimer::cSwitchTimer(void) {
eventID = 0; eventID = 0;
startTime = 0; startTime = 0;
switchMinsBefore = 2; switchMinsBefore = config.switchMinsBefore;
announceOnly = 0; switchMode = config.switchMode;
} }
cSwitchTimer::cSwitchTimer(const cEvent* Event) { cSwitchTimer::cSwitchTimer(const cEvent* Event) {

View File

@ -2,6 +2,7 @@
#define __TVGUIDE_SWITCHTIMER_H #define __TVGUIDE_SWITCHTIMER_H
#include <vdr/plugin.h> #include <vdr/plugin.h>
#include "config.h"
class cSwitchTimer : public cListObject { class cSwitchTimer : public cListObject {
public: public:
@ -9,7 +10,19 @@ public:
time_t startTime; time_t startTime;
tChannelID channelID; tChannelID channelID;
int switchMinsBefore; int switchMinsBefore;
int announceOnly; int switchMode;
#if VDRVERSNUM >= 20305
cSwitchTimer(const cSwitchTimer &SwitchTimer) { *this = SwitchTimer; };
cSwitchTimer& operator= (const cSwitchTimer &SwitchTimer)
{
this->eventID = SwitchTimer.eventID;
this->startTime = SwitchTimer.startTime;
this->channelID = SwitchTimer.channelID;
this->switchMinsBefore = SwitchTimer.switchMinsBefore;
this->switchMode = SwitchTimer.switchMode;
return *this;
};
#endif
cSwitchTimer(void); cSwitchTimer(void);
cSwitchTimer(const cEvent* Event); cSwitchTimer(const cEvent* Event);
bool Parse(const char *s); bool Parse(const char *s);

View File

@ -1,11 +1,11 @@
Description = IceBlue Description = IceBlue
clrStyle = 00000000 clrStyle = 00000000
clrBackground = DDFFFFFF clrBackground = EEFFFFFF
clrBackgroundOSD = FFFFFFFF clrBackgroundOSD = F0FFFFFF
clrGrid1 = BB555555 clrGrid1 = FFB2B2C
clrGrid2 = BB888888 clrGrid2 = 55B2B2C7
clrGridFontBack = 00000000 clrGridFontBack = 00000000
clrGridActiveFontBack = 00000000 clrGridActiveFontBack = FFFFFFFF
clrHighlight = FF000044 clrHighlight = FF000044
clrFont = FF000000 clrFont = FF000000
clrFontActive = FFFFFFFF clrFontActive = FFFFFFFF
@ -20,14 +20,14 @@ clrTimeline1Blending = 00000000
clrTimeline2 = FF000000 clrTimeline2 = FF000000
clrTimeline2Blending = 00000000 clrTimeline2Blending = 00000000
clrTimeBase = A0FF0000 clrTimeBase = A0FF0000
clrTabInactive = 88B8B8E6 clrTabInactive = 55B2B2C7
clrButtonRed = FFBB0000 clrButtonRed = FFCC00000
clrButtonRedBorder = FF000000 clrButtonRedBorder = FF000000
clrButtonGreen = FF00BB00 clrButtonGreen = FF00BB00
clrButtonGreenBorder = FF000000 clrButtonGreenBorder = FF000000
clrButtonYellow = FFBBBB00 clrButtonYellow = FFF5B800
clrButtonYellowBorder = FF000000 clrButtonYellowBorder = FF000000
clrButtonBlue = FF0000BB clrButtonBlue = FF003DF5
clrButtonBlueBorder = FF000000 clrButtonBlueBorder = FF000000
clrRecMenuBackground = AA000000 clrRecMenuBackground = AA000000
clrRecMenuTimerConflictBackground = FFCCCCCC clrRecMenuTimerConflictBackground = FFCCCCCC
@ -36,16 +36,16 @@ clrRecMenuTimerConflictOverlap = AAFF0000
clrRecMenuDayActive = FF00FF00 clrRecMenuDayActive = FF00FF00
clrRecMenuDayInactive = FFFF0000 clrRecMenuDayInactive = FFFF0000
clrRecMenuDayHighlight = 77000000 clrRecMenuDayHighlight = 77000000
clrRecMenuTextBack = FF3C3C3C clrRecMenuTextBack = 00000000
clrRecMenuTextActiveBack = FF404749 clrRecMenuTextActiveBack = FF404749
clrRecMenuKeyboardBack = FF000044 clrRecMenuKeyboardBack = FF000044
clrRecMenuKeyboardBorder = FF3C3C3C clrRecMenuKeyboardBorder = FF6C6C6C
clrRecMenuKeyboardHigh = 55FFFFFF clrRecMenuKeyboardHigh = 55FFFFFF
clrButtonRedKeyboard = FFBB0000 clrButtonRedKeyboard = FFBB0000
clrButtonGreenKeyboard = FF00BB00 clrButtonGreenKeyboard = FF00BB00
clrButtonYellowKeyboard = FFBBBB00 clrButtonYellowKeyboard = FFBBBB00
clrRecMenuTimelineTimer = B012273f clrRecMenuTimelineTimer = B012273f
clrRecMenuTimelineBack = FF828282 clrRecMenuTimelineBack = 55B2B2C7
clrRecMenuTimelineActive = FF3F3F3F clrRecMenuTimelineActive = 773F3F3F
clrRecMenuTimelineConflict = 30FF0000 clrRecMenuTimelineConflict = 30FF0000
clrRecMenuTimelineConflictOverlap = 90FF0000 clrRecMenuTimelineConflictOverlap = 90FF0000

View File

@ -1,68 +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, 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(0, 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.CreatePixmap(1, cRect(x11, y11, x21, y21)));
int clockY = 10; timeline = osdManager.CreatePixmap(2, cRect(x12, y12, x22, y22));
int clockX; clock = new cStyledPixmap(osdManager.CreatePixmap(3, cRect(0,
if (tvguideConfig.scaleVideo) { geoManager.statusHeaderHeight,
clockX = geoManager.osdWidth - geoManager.tvFrameWidth - geoManager.clockWidth - 4;
} else {
clockX = geoManager.osdWidth - geoManager.clockWidth - 10;
}
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.DestroyPixmap(timeBase);
osdManager.DestroyPixmap(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();
@ -74,25 +57,27 @@ void cTimeLine::drawDateViewer() {
else else
dateViewer->Fill(clrTransparent); dateViewer->Fill(clrTransparent);
} }
tColor colorFont = theme.Color(clrFont); 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 textHeight = fontManager.FontTimeLineWeekday->Height(); int textHeightWeekday = fontManager.FontTimeLineWeekday->Height();
int textHeightDate = fontManager.FontTimeLineDate->Height();
int weekdayWidth = fontManager.FontTimeLineWeekday->Width(*weekDay); int weekdayWidth = fontManager.FontTimeLineWeekday->Width(*weekDay);
int dateWidth = fontManager.FontTimeLineDate->Width(*date); int dateWidth = fontManager.FontTimeLineDate->Width(*date);
dateViewer->DrawText(cPoint((geoManager.timeLineWidth-weekdayWidth)/2, (geoManager.channelHeaderHeight + geoManager.channelGroupsHeight -2*textHeight)/2), *weekDay, colorFont, colorFontBack, fontManager.FontTimeLineWeekday); int y = ((geoManager.dateVieverHeight - textHeightWeekday - textHeightDate) / 2);
dateViewer->DrawText(cPoint((geoManager.timeLineWidth-dateWidth)/2, (geoManager.channelHeaderHeight + geoManager.channelGroupsHeight -2*textHeight)/2 + textHeight + 5), *date, colorFont, colorFontBack, fontManager.FontTimeLineDate); dateViewer->DrawText(cPoint((geoManager.timeLineWidth - weekdayWidth) / 2, y), *weekDay, colorFont, colorFontBack, fontManager.FontTimeLineWeekday);
} else if (tvguideConfig.displayMode == eHorizontal) { dateViewer->DrawText(cPoint((geoManager.timeLineWidth - dateWidth) / 2, y + textHeightWeekday), *date, colorFont, colorFontBack, fontManager.FontTimeLineDate);
} else if (config.displayMode == eHorizontal) {
cString strDate = cString::sprintf("%s %s", *weekDay, *date); 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);
dateViewer->DrawText(cPoint(x, y), *strDate, colorFont, colorFontBack, fontManager.FontTimeLineDateHorizontal); dateViewer->DrawText(cPoint(x, y), *strDate, colorFont, colorFontBack, fontManager.FontTimeLineDateHorizontal);
} }
} }
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;
@ -100,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)
@ -113,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
@ -178,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);
@ -200,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(); return;
if (!nowVisible) if (!timeManager->NowVisible()) {
if (timeBase)
timeBase->Fill(clrTransparent);
return; return;
int deltaTime = (myTime->GetNow() - myTime->GetStart()) / 60 * geoManager.minutePixel;
if (tvguideConfig.displayMode == eVertical) {
timeBase->DrawRectangle(cRect(0, deltaTime - 2, timeBase->ViewPort().Width(), 4), theme.Color(clrTimeBase));
} else {
timeBase->DrawRectangle(cRect(deltaTime-2, 0, 4, timeBase->ViewPort().Height()), theme.Color(clrTimeBase));
} }
int deltaTime = (time(0) - timeManager->GetStart()) / 60 * geoManager.minutePixel;
osdManager.DestroyPixmap(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.CreatePixmap(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;
@ -231,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());
@ -243,34 +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() {
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 = (tvguideConfig.style == eStyleFlat)?theme.Color(clrHeader):clrTransparent; tColor colorFontBack = (config.style == eStyleFlat) ? theme.Color(clrHeader) : clrTransparent;
if (tvguideConfig.style == eStyleGraphical) { if (config.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); clock->DrawText(cPoint((geoManager.clockWidth - clockTextWidth) / 2, (geoManager.clockHeight - textHeight) / 2), *currentTime, theme.Color(clrFont), colorFontBack, font);
lastClock = currentTime;
DrawTimeIndicator();
return true;
}
return false;
} }

View File

@ -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

View File

@ -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(&current); tm *st = localtime(&current);
if (st->tm_hour < 21) { if (st->tm_hour < 21) {
current -= 24 * 60* 60; current -= 24 * 60 * 60;
st = localtime(&current); st = localtime(&current);
} }
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(&current); tm *st = localtime(&current);
if (st->tm_hour > 19) { if (st->tm_hour > 19) {
current += 24 * 60* 60; current += 24 * 60 * 60;
st = localtime(&current); st = localtime(&current);
} }
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));
} }

View File

@ -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

View File

@ -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) {
@ -16,12 +16,11 @@ cTVGuideTimerConflict::cTVGuideTimerConflict(void) {
} }
cTVGuideTimerConflict::~cTVGuideTimerConflict(void) { cTVGuideTimerConflict::~cTVGuideTimerConflict(void) {
} }
bool cTVGuideTimerConflict::timerInvolved(int involvedID) { bool cTVGuideTimerConflict::timerInvolved(int involvedID) {
int numConflicts = timerIDs.size(); int numConflicts = timerIDs.size();
for (int i=0; i<numConflicts; i++) { for (int i = 0; i < numConflicts; i++) {
if (timerIDs[i] == involvedID) if (timerIDs[i] == involvedID)
return true; return true;
} }
@ -49,8 +48,7 @@ void cTVGuideTimerConflicts::AddConflict(std::string epgSearchConflictLine) {
1190232780:152|30|50#152#45:45|10|50#152#45 1190232780:152|30|50#152#45:45|10|50#152#45
'1190232780' is the time of the conflict in seconds since 1970-01-01. '1190232780' is the time of the conflict in seconds since 1970-01-01.
It's followed by list of timers that have a conflict at this time: It's followed by list of timers that have a conflict at this time:
'152|30|50#1 int editTimer(cTimer *timer, bool active, int prio, int start, int stop); '152|30|50#152#45' is the description of the first conflicting timer. Here:
52#45' is the description of the first conflicting timer. Here:
'152' is VDR's timer id of this timer as returned from VDR's LSTT command '152' is VDR's timer id of this timer as returned from VDR's LSTT command
'30' is the percentage of recording that would be done (0...100) '30' is the percentage of recording that would be done (0...100)
'50#152#45' is the list of concurrent timers at this conflict '50#152#45' is the list of concurrent timers at this conflict
@ -71,7 +69,7 @@ void cTVGuideTimerConflicts::AddConflict(std::string epgSearchConflictLine) {
splitstring s3(flds2[2].c_str()); splitstring s3(flds2[2].c_str());
std::vector<std::string> flds3 = s3.split('#'); std::vector<std::string> flds3 = s3.split('#');
std::vector<int> timerIDs; std::vector<int> timerIDs;
for (int k = 0; k < flds3.size(); k++) { for (int k = 0; k < (int)flds3.size(); k++) {
timerIDs.push_back(atoi(flds3[k].c_str()) - 1); timerIDs.push_back(atoi(flds3[k].c_str()) - 1);
} }
conflict->timerIDs = timerIDs; conflict->timerIDs = timerIDs;
@ -80,13 +78,19 @@ void cTVGuideTimerConflicts::AddConflict(std::string epgSearchConflictLine) {
void cTVGuideTimerConflicts::CalculateConflicts(void) { void cTVGuideTimerConflicts::CalculateConflicts(void) {
numConflicts = conflicts.size(); numConflicts = conflicts.size();
time_t startTime = 0;
time_t endTime = 0;
for (int i=0; i < numConflicts; i++) { for (int i=0; i < numConflicts; i++) {
cTimeInterval *unionSet = NULL; cTimeInterval *unionSet = NULL;
int numTimers = conflicts[i]->timerIDs.size(); int numTimers = conflicts[i]->timerIDs.size();
#if VDRVERSNUM >= 20301
LOCK_TIMERS_READ;
const cTimers* timers = Timers;
for (int j=0; j < numTimers; j++) { for (int j=0; j < numTimers; j++) {
const cTimer *timer = Timers.Get(conflicts[i]->timerIDs[j]); const cTimer *timer = timers->GetById(conflicts[i]->timerIDs[j] + 1);
#else
const cTimers* timers = &Timers;
for (int j=0; j < numTimers; j++) {
const cTimer *timer = timers->Get(conflicts[i]->timerIDs[j]);
#endif
if (timer) { if (timer) {
if (!unionSet) { if (!unionSet) {
unionSet = new cTimeInterval(timer->StartTime(), timer->StopTime()); unionSet = new cTimeInterval(timer->StartTime(), timer->StopTime());
@ -105,7 +109,11 @@ void cTVGuideTimerConflicts::CalculateConflicts(void) {
cTimeInterval *intersect = NULL; cTimeInterval *intersect = NULL;
for (int j=0; j < numTimers; j++) { for (int j=0; j < numTimers; j++) {
const cTimer *timer = Timers.Get(conflicts[i]->timerIDs[j]); #if VDRVERSNUM >= 20301
const cTimer *timer = timers->GetById(conflicts[i]->timerIDs[j] + 1);
#else
const cTimer *timer = timers->Get(conflicts[i]->timerIDs[j]);
#endif
if (timer) { if (timer) {
if (!intersect) { if (!intersect) {
intersect = new cTimeInterval(timer->StartTime(), timer->StopTime()); intersect = new cTimeInterval(timer->StartTime(), timer->StopTime());
@ -148,7 +156,7 @@ int cTVGuideTimerConflicts::GetCurrentConflictTimerID(int timerIndex) {
int cTVGuideTimerConflicts::GetCorrespondingConflict(int timerID) { int cTVGuideTimerConflicts::GetCorrespondingConflict(int timerID) {
int conflictIndex = -1; int conflictIndex = -1;
if (numConflicts > 0) { if (numConflicts > 0) {
for (int i=0; i<numConflicts; i++) { for (int i = 0; i < numConflicts; i++) {
if (conflicts[i]->timerInvolved(timerID)) { if (conflicts[i]->timerInvolved(timerID)) {
conflictIndex = i; conflictIndex = i;
break; break;
@ -168,7 +176,7 @@ cTVGuideTimerConflict *cTVGuideTimerConflicts::GetConflict(int conflictIndex) {
std::vector<cTVGuideTimerConflict*> cTVGuideTimerConflicts::GetConflictsBetween(time_t start, time_t stop) { std::vector<cTVGuideTimerConflict*> cTVGuideTimerConflicts::GetConflictsBetween(time_t start, time_t stop) {
std::vector<cTVGuideTimerConflict*> conflictsFound; std::vector<cTVGuideTimerConflict*> conflictsFound;
for (int i=0; i < numConflicts; i++) { for (int i = 0; i < numConflicts; i++) {
if ((conflicts[i]->timeStart > start) && (conflicts[i]->timeStart < stop)|| if ((conflicts[i]->timeStart > start) && (conflicts[i]->timeStart < stop)||
(conflicts[i]->timeStop > start) && (conflicts[i]->timeStop < stop)) (conflicts[i]->timeStop > start) && (conflicts[i]->timeStop < stop))
conflictsFound.push_back(conflicts[i]); conflictsFound.push_back(conflicts[i]);

89
tools.c
View File

@ -8,39 +8,63 @@
#include <stdio.h> #include <stdio.h>
#include <vdr/osd.h> #include <vdr/osd.h>
#include <vdr/plugin.h> #include <vdr/plugin.h>
#include <vdr/skins.h>
#include "services/epgsearch.h" #include "services/epgsearch.h"
#include "tools.h" #include "tools.h"
cPlugin *GetScraperPlugin(void) {
static cPlugin *pScraper = cPluginManager::GetPlugin("scraper2vdr");
if( !pScraper ) // if it doesn't exit, try tvscraper
pScraper = cPluginManager::GetPlugin("tvscraper");
return pScraper;
}
/**************************************************************************************** /****************************************************************************************
* CUTTEXT * CUTTEXT
****************************************************************************************/ ****************************************************************************************/
std::string utf8_substr(const std::string& str, unsigned int start, long unsigned int leng) {
if (leng==0) { return ""; }
unsigned int c, i, ix, q;
long unsigned int min=std::string::npos, max=std::string::npos;
for (q=0, i=0, ix=str.length(); i < ix; i++, q++) {
if (q==start){ min=i; }
if (q<=start+leng || leng==std::string::npos){ max=i; }
c = (unsigned char) str[i];
if (c>=0 && c<=127) i+=0;
else if ((c & 0xE0) == 0xC0) i+=1;
else if ((c & 0xF0) == 0xE0) i+=2;
else if ((c & 0xF8) == 0xF0) i+=3;
//else if (($c & 0xFC) == 0xF8) i+=4; // 111110bb //byte 5, unnecessary in 4 byte UTF-8
//else if (($c & 0xFE) == 0xFC) i+=5; // 1111110b //byte 6, unnecessary in 4 byte UTF-8
else return "";//invalid utf8
}
if (q<=start+leng || leng==std::string::npos){ max=i; }
if (min==std::string::npos || max==std::string::npos) { return ""; }
return str.substr(min,max-min);
}
std::string CutText(std::string text, int width, const cFont *font) { std::string CutText(std::string text, int width, const cFont *font) {
if (width <= font->Size()) int actWidth = font->Width(text.c_str());
if (actWidth <= width) {
return text.c_str(); return text.c_str();
if (font->Width(text.c_str()) < width) } else {
return text.c_str(); int i = std::max(width / font->Size(), 1) - 1;
cTextWrapper twText; std::string cuttext, oldtext;
twText.Set(text.c_str(), font, width); cuttext = utf8_substr(text, 0, i);
std::string cuttedTextNative = twText.GetLine(0); do {
oldtext = cuttext;
i++;
cuttext = utf8_substr(text, 0, i);
std::stringstream sstrText; std::stringstream sstrText;
sstrText << cuttedTextNative << "..."; sstrText << cuttext << "...";
std::string cuttedText = sstrText.str(); actWidth = font->Width(sstrText.str().c_str());
int actWidth = font->Width(cuttedText.c_str()); }
if (actWidth > width) { while (actWidth < width);
int overlap = actWidth - width;
int charWidth = font->Width(".");
if (charWidth == 0)
charWidth = 1;
int cutChars = overlap / charWidth;
if (cutChars > 0) {
cuttedTextNative = cuttedTextNative.substr(0, cuttedTextNative.length() - cutChars);
std::stringstream sstrText2; std::stringstream sstrText2;
sstrText2 << cuttedTextNative << "..."; sstrText2 << oldtext << "...";
cuttedText = sstrText2.str(); return sstrText2.str();
} }
}
return cuttedText;
} }
/**************************************************************************************** /****************************************************************************************
@ -105,7 +129,6 @@ void ReadRecordingDirectories(std::vector<std::string> *folders, cList<cNestedIt
} }
} }
/**************************************************************************************** /****************************************************************************************
* DrawRoundedCorners * DrawRoundedCorners
****************************************************************************************/ ****************************************************************************************/
@ -136,7 +159,7 @@ std::vector<std::string>& splitstring::split(char delim, int rep) {
std::string work = data(); std::string work = data();
std::string buf = ""; std::string buf = "";
int i = 0; int i = 0;
while (i < work.length()) { while (i < (int)work.length()) {
if (work[i] != delim) if (work[i] != delim)
buf += work[i]; buf += work[i];
else if (rep == 1) { else if (rep == 1) {
@ -411,8 +434,8 @@ ALGORITHM
******************************************************************************/ ******************************************************************************/
int afuzzy_checkSUB(const char *t, AFUZZY *fuzzy) int afuzzy_checkSUB(const char *t, AFUZZY *fuzzy)
{ {
register char c; char c;
register int j, d; int j, d;
/* For eficciency this case should be little bit optimized */ /* For eficciency this case should be little bit optimized */
if (!fuzzy->k) if (!fuzzy->k)
@ -426,7 +449,7 @@ int afuzzy_checkSUB(const char *t, AFUZZY *fuzzy)
if (R1 & fuzzy->mask_ok) if (R1 & fuzzy->mask_ok)
return 1; return 1;
} /* end for (register int j = 0 ... */ } /* end for (int j = 0 ... */
return 0; return 0;
} }
@ -450,16 +473,16 @@ int afuzzy_checkSUB(const char *t, AFUZZY *fuzzy)
memcpy(fuzzy->R, fuzzy->R1, fuzzy->r_size); memcpy(fuzzy->R, fuzzy->R1, fuzzy->r_size);
} /* end for (register int j = 0 ... */ } /* end for (int j = 0 ... */
return 0; return 0;
} }
static int afuzzy_checkFLT(const char *t, AFUZZY *fuzzy) int afuzzy_checkFLT(const char *t, AFUZZY *fuzzy)
{ {
register Uint FilterR = 0; Uint FilterR = 0;
register Uint FilterR1; Uint FilterR1;
register int j; int j;
for (j = 0; t[j] != '\0'; j++) for (j = 0; t[j] != '\0'; j++)
{ {
@ -468,7 +491,7 @@ static int afuzzy_checkFLT(const char *t, AFUZZY *fuzzy)
if (FilterR1 & fuzzy->filter_ok) if (FilterR1 & fuzzy->filter_ok)
return 1; return 1;
FilterR = FilterR1; FilterR = FilterR1;
} /* end for (register int j = 0 ... */ } /* end for (int j = 0 ... */
return 0; return 0;
} }

View File

@ -5,7 +5,11 @@
#include <vector> #include <vector>
#include <vdr/font.h> #include <vdr/font.h>
#include <vdr/recording.h> #include <vdr/recording.h>
#include <vdr/plugin.h>
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);
@ -62,7 +66,7 @@ typedef struct
void afuzzy_init(const char *p, int kerr, int UseFilter, AFUZZY *fuzzy); void afuzzy_init(const char *p, int kerr, int UseFilter, AFUZZY *fuzzy);
void afuzzy_free(AFUZZY *fuzzy); void afuzzy_free(AFUZZY *fuzzy);
int afuzzy_checkSUB(const char *t, AFUZZY *fuzzy); int afuzzy_checkSUB(const char *t, AFUZZY *fuzzy);
static int afuzzy_checkFLT(const char *t, AFUZZY *fuzzy); int afuzzy_checkFLT(const char *t, AFUZZY *fuzzy);
#endif #endif
#endif // __TVGUIDETOOLS_H #endif // __TVGUIDETOOLS_H

View File

@ -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,8 +27,8 @@
#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.2"; static const char *VERSION = "1.3.6";
static const char *DESCRIPTION = "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";
class cPluginTvguide : public cPlugin { class cPluginTvguide : public cPlugin {
@ -35,7 +36,7 @@ public:
cPluginTvguide(void); cPluginTvguide(void);
virtual ~cPluginTvguide(); virtual ~cPluginTvguide();
virtual const char *Version(void) { return VERSION; } virtual const char *Version(void) { return VERSION; }
virtual const char *Description(void) { return DESCRIPTION; } virtual const char *Description(void) { return tr(DESCRIPTION); }
virtual const char *CommandLineHelp(void); virtual const char *CommandLineHelp(void);
virtual bool ProcessArgs(int argc, char *argv[]); virtual bool ProcessArgs(int argc, char *argv[]);
virtual bool Initialize(void); virtual bool Initialize(void);
@ -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);
@ -63,8 +64,8 @@ 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;

View File

@ -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,20 +30,18 @@ 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();
} }
void cTvGuideOsd::Show(void) { void cTvGuideOsd::Show(void) {
int start = cTimeMs::Now(); int start = cTimeMs::Now();
bool ok = false; if (osdManager.CreateOsd()) {
ok = osdManager.setOsd(); bool themeChanged = config.LoadTheme();
if (ok) { config.SetStyle();
bool themeChanged = tvguideConfig.LoadTheme(); config.setDynamicValues();
tvguideConfig.SetStyle();
tvguideConfig.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();
@ -51,16 +49,16 @@ void cTvGuideOsd::Show(void) {
imgCache.Clear(); imgCache.Clear();
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,11 +71,22 @@ void cTvGuideOsd::Show(void) {
void cTvGuideOsd::drawOsd() { void cTvGuideOsd::drawOsd() {
cPixmap::Lock(); cPixmap::Lock();
cChannel *startChannel = Channels.GetByNumber(cDevice::CurrentChannel()); int numBack = config.numGrids / 2;
int numBack = tvguideConfig.numGrids / 2;
int offset = 0; int offset = 0;
const cChannel *newStartChannel = startChannel; const cChannel *newStartChannel;
#if VDRVERSNUM >= 20301
{
LOCK_CHANNELS_READ;
const cChannel *startChannel = Channels->GetByNumber(cDevice::CurrentChannel());
#else
cChannel *startChannel = Channels.GetByNumber(cDevice::CurrentChannel());
#endif
newStartChannel = startChannel;
#if VDRVERSNUM >= 20301
for (; newStartChannel ; newStartChannel = Channels->Prev(newStartChannel)) {
#else
for (; newStartChannel ; newStartChannel = Channels.Prev(newStartChannel)) { for (; newStartChannel ; newStartChannel = Channels.Prev(newStartChannel)) {
#endif
if (newStartChannel && !newStartChannel->GroupSep()) { if (newStartChannel && !newStartChannel->GroupSep()) {
offset++; offset++;
} }
@ -85,34 +94,39 @@ void cTvGuideOsd::drawOsd() {
break; break;
} }
if (!newStartChannel) if (!newStartChannel)
#if VDRVERSNUM >= 20301
newStartChannel = Channels->First();
} //LOCK_CHANNELS_READ
#else
newStartChannel = Channels.First(); newStartChannel = Channels.First();
#endif
offset--; offset--;
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->AddFooter(footer);
footer->drawRedButton(); footer->drawRedButton();
if (tvguideConfig.channelJumpMode == eNumJump) { if (config.channelJumpMode == eNumJump) {
footer->drawGreenButton(); footer->drawGreenButton();
footer->drawYellowButton(); footer->drawYellowButton();
} }
footer->drawBlueButton(false); footer->drawBlueButton(false);
osdManager.flush(); osdManager.Flush();
readChannels(newStartChannel); readChannels(newStartChannel);
drawGridsChannelJump(offset); drawGridsChannelJump(offset);
osdManager.flush(); osdManager.Flush();
cPixmap::Unlock(); cPixmap::Unlock();
} }
@ -122,12 +136,21 @@ void cTvGuideOsd::readChannels(const cChannel *channelStart) {
columns.Clear(); columns.Clear();
if (!channelStart) if (!channelStart)
return; return;
for (const cChannel *channel = channelStart; channel; channel = Channels.Next(channel)) { #if VDRVERSNUM >= 20301
const cChannels *channels;
{
LOCK_CHANNELS_READ;
channels = Channels;
}
#else
cChannels *channels = &Channels;
#endif
for (const cChannel *channel = channelStart; channel; channel = channels->Next(channel)) {
if (!channel->GroupSep()) { if (!channel->GroupSep()) {
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++;
@ -135,16 +158,16 @@ 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);
} }
} }
@ -155,46 +178,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;
} }
@ -203,22 +226,31 @@ 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();
while (channelRight = Channels.Next(channelRight)) { const cChannels *channels;
#if VDRVERSNUM >= 20301
{
LOCK_CHANNELS_READ;
channels = Channels;
}
#else
channels = &Channels;
#endif
while (channelRight = channels->Next(channelRight)) {
if (!channelRight->GroupSep()) { if (!channelRight->GroupSep()) {
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 {
@ -229,11 +261,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();
@ -244,28 +276,37 @@ 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();
while (channelLeft = Channels.Prev(channelLeft)) { const cChannels *channels;
#if VDRVERSNUM >= 20301
{
LOCK_CHANNELS_READ;
channels = Channels;
}
#else
channels = &Channels;
#endif
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 {
@ -276,11 +317,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();
@ -292,31 +333,31 @@ 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();
} }
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;
} }
@ -324,31 +365,37 @@ void cTvGuideOsd::timeForward() {
if (!actionDone) { if (!actionDone) {
ScrollForward(); ScrollForward();
} }
osdManager.flush(); osdManager.Flush();
} }
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();
timeLine->DrawTimeline();
} else {
timeLine->DrawDateViewer();
timeLine->DrawTimeline();
for (cChannelEpg *column = columns.First(); column; column = columns.Next(column)) {
column->AddNewGridsAtEnd(); column->AddNewGridsAtEnd();
column->ClearOutdatedStart(); column->ClearOutdatedStart();
column->drawGrids(); 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;
@ -357,30 +404,34 @@ void cTvGuideOsd::timeBack() {
if (!actionDone) { if (!actionDone) {
ScrollBack(); ScrollBack();
} }
osdManager.flush(); osdManager.Flush();
} }
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 {
timeLine->DrawDateViewer();
timeLine->DrawTimeline();
for (cChannelEpg *column = columns.First(); column; column = columns.Next(column)) {
column->AddNewGridsAtStart(); column->AddNewGridsAtStart();
column->ClearOutdatedEnd(); column->ClearOutdatedEnd();
column->drawGrids(); column->drawGrids();
} }
}
} }
void cTvGuideOsd::processKeyUp() { 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();
} }
} }
@ -389,9 +440,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();
} }
} }
@ -399,9 +450,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();
} }
} }
@ -409,17 +460,17 @@ 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();
} }
} }
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() {
@ -431,14 +482,24 @@ 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
LOCK_CHANNELS_READ;
prev = Channels->GetByNumber(prevNum);
#else
prev = Channels.GetByNumber(prevNum); prev = Channels.GetByNumber(prevNum);
#endif
} }
} else if (tvguideConfig.channelJumpMode == eNumJump) { } else if (config.channelJumpMode == eNumJump) {
int i = tvguideConfig.jumpChannels + 1; int i = config.jumpChannels + 1;
#if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ;
for (const cChannel *channel = firstChannel; channel; channel = Channels->Prev(channel)) {
#else
for (const cChannel *channel = firstChannel; channel; channel = Channels.Prev(channel)) { for (const cChannel *channel = firstChannel; channel; channel = Channels.Prev(channel)) {
#endif
if (!channel->GroupSep()) { if (!channel->GroupSep()) {
prev = channel; prev = channel;
i--; i--;
@ -450,12 +511,12 @@ 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);
} }
osdManager.flush(); osdManager.Flush();
} }
} }
@ -467,14 +528,24 @@ 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
LOCK_CHANNELS_READ;
next = Channels->GetByNumber(nextNum);
#else
next = Channels.GetByNumber(nextNum); next = Channels.GetByNumber(nextNum);
#endif
} }
} else if (tvguideConfig.channelJumpMode == eNumJump) { } else if (config.channelJumpMode == eNumJump) {
int i=0; int i=0;
#if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ;
for (const cChannel *channel = firstChannel; channel; channel = Channels->Next(channel)) {
#else
for (const cChannel *channel = firstChannel; channel; channel = Channels.Next(channel)) { for (const cChannel *channel = firstChannel; channel; channel = Channels.Next(channel)) {
#endif
if (channelGroups->IsInLastGroup(channel)) { if (channelGroups->IsInLastGroup(channel)) {
break; break;
} }
@ -482,7 +553,7 @@ void cTvGuideOsd::processKeyYellow() {
next = channel; next = channel;
i++; i++;
} }
if (i == (tvguideConfig.jumpChannels+1)) { if (i == (config.jumpChannels+1)) {
break; break;
} }
} }
@ -490,32 +561,32 @@ 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);
} }
osdManager.flush(); osdManager.Flush();
} }
} }
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;
@ -529,7 +600,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;
@ -542,18 +613,18 @@ eOSState cTvGuideOsd::ChannelSwitch(bool *alreadyUnlocked) {
} }
void cTvGuideOsd::DetailedEPG() { void cTvGuideOsd::DetailedEPG() {
if (!activeGrid->isDummy()) { if (!activeGrid->IsDummy()) {
detailViewActive = true; detailViewActive = true;
detailView = new cDetailView(activeGrid->GetEvent(), footer); detailView = new cDetailView(activeGrid->GetEvent(), footer);
footer->SetDetailedViewMode(); footer->SetDetailedViewMode();
osdManager.flush(); osdManager.Flush();
detailView->Start(); detailView->Start();
osdManager.flush(); osdManager.Flush();
} }
} }
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 {
@ -565,57 +636,58 @@ 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();
osdManager.flush(); osdManager.Flush();
} }
void cTvGuideOsd::CheckTimeout(void) { void cTvGuideOsd::CheckTimeout(void) {
@ -625,19 +697,27 @@ void cTvGuideOsd::CheckTimeout(void) {
int newChannelNum = channelJumper->GetChannel(); int newChannelNum = channelJumper->GetChannel();
delete channelJumper; delete channelJumper;
channelJumper = NULL; channelJumper = NULL;
const cChannel *newChannel = Channels.GetByNumber(newChannelNum); const cChannel *newChannel;
#if VDRVERSNUM >= 20301
{
LOCK_CHANNELS_READ;
newChannel = Channels->GetByNumber(newChannelNum);
}
#else
newChannel = Channels.GetByNumber(newChannelNum);
#endif
if (newChannel) { if (newChannel) {
readChannels(newChannel); readChannels(newChannel);
if (columns.Count() > 0) { if (columns.Count() > 0) {
drawGridsChannelJump(); drawGridsChannelJump();
} }
} }
osdManager.flush(); osdManager.Flush();
} }
} }
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();
} }
} }
@ -646,11 +726,11 @@ 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();
} }
state = osContinue; state = osContinue;
} else if (detailViewActive) { } else if (detailViewActive) {
@ -663,13 +743,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;
@ -680,7 +760,7 @@ eOSState cTvGuideOsd::ProcessKey(eKeys Key) {
delete detailView; delete detailView;
detailView = NULL; detailView = NULL;
detailViewActive = false; detailViewActive = false;
osdManager.flush(); osdManager.Flush();
state = osContinue; state = osContinue;
} }
} }
@ -695,11 +775,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();
@ -710,8 +797,8 @@ eOSState cTvGuideOsd::ProcessKey(eKeys Key) {
void cTvGuideOsd::dump() { 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();
} }
} }

View File

@ -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();

184
view.c
View File

@ -1,10 +1,11 @@
#include "detailview.h" #include "detailview.h"
#include "switchtimer.h"
/******************************************************************************************** /********************************************************************************************
* cView * cView
********************************************************************************************/ ********************************************************************************************/
cView::cView(void) { cView::cView(void) : cThread("View") {
activeView = 0; activeView = 0;
scrollable = false; scrollable = false;
tabbed = false; tabbed = false;
@ -40,19 +41,19 @@ cView::cView(void) {
cView::~cView(void) { cView::~cView(void) {
if (pixmapBackground) if (pixmapBackground)
osdManager.releasePixmap(pixmapBackground); osdManager.DestroyPixmap(pixmapBackground);
if (pixmapHeader) if (pixmapHeader)
delete pixmapHeader; delete pixmapHeader;
if (pixmapHeaderLogo) if (pixmapHeaderLogo)
osdManager.releasePixmap(pixmapHeaderLogo); osdManager.DestroyPixmap(pixmapHeaderLogo);
if (pixmapContent) if (pixmapContent)
osdManager.releasePixmap(pixmapContent); osdManager.DestroyPixmap(pixmapContent);
if (pixmapTabs) if (pixmapTabs)
osdManager.releasePixmap(pixmapTabs); osdManager.DestroyPixmap(pixmapTabs);
if (pixmapScrollbar) if (pixmapScrollbar)
osdManager.releasePixmap(pixmapScrollbar); osdManager.DestroyPixmap(pixmapScrollbar);
if (pixmapScrollbarBack) if (pixmapScrollbarBack)
osdManager.releasePixmap(pixmapScrollbarBack); osdManager.DestroyPixmap(pixmapScrollbarBack);
if (imgScrollBar) if (imgScrollBar)
delete imgScrollBar; delete imgScrollBar;
} }
@ -70,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)
@ -80,16 +81,16 @@ void cView::SetGeometry(void) {
void cView::DrawHeader(void) { void cView::DrawHeader(void) {
if (!pixmapHeader) { if (!pixmapHeader) {
pixmapHeader = new cStyledPixmap(osdManager.requestPixmap(5, cRect(0, 0, headerWidth, headerHeight))); pixmapHeader = new cStyledPixmap(osdManager.CreatePixmap(5, cRect(0, 0, headerWidth, headerHeight)));
pixmapHeader->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending)); pixmapHeader->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending));
} }
if (!pixmapHeaderLogo) { if (!pixmapHeaderLogo) {
pixmapHeaderLogo = osdManager.requestPixmap(6, cRect(0, 0, width, headerHeight)); pixmapHeaderLogo = osdManager.CreatePixmap(6, cRect(0, 0, width, headerHeight));
} }
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);
@ -100,52 +101,74 @@ 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();
pixmapHeaderLogo->DrawImage(cPoint(border/2, (headerHeight - logoHeight)/2), logo); const int logoheight = logo.Height();
const int logowidth = logo.Width();
pixmapHeaderLogo->DrawImage(cPoint(xText + ((logoWidth - logowidth) / 2), ((headerHeight - logoheight) / 2)), logo);
xText += logoWidth + border / 2; xText += logoWidth + border / 2;
} }
} }
//Date and Time, Title, Subtitle //Date and Time, Title, Subtitle
int textWidthMax = headerWidth - xText - border / 2;
wrapper.Set(title.c_str(), fontHeaderLarge, textWidthMax);
int lineHeight = fontHeaderLarge->Height();
int textLines = wrapper.Lines();
int yDateTime = border / 2; int yDateTime = border / 2;
int yTitle = (headerHeight - fontHeaderLarge->Height()) / 2; int yTitle = (headerHeight - textLines * lineHeight) / 2;
int ySubtitle = headerHeight - fontHeader->Height() - border / 3; int ySubtitle = headerHeight - fontHeader->Height() - border / 3;
int textWidthMax = headerWidth - xText;
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); for (int i = 0; i < textLines; i++) {
pixmapHeader->DrawText(cPoint(xText, yTitle + i * lineHeight), wrapper.GetLine(i), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeaderLarge);
}
pixmapHeader->DrawText(cPoint(xText, ySubtitle), CutText(subTitle, textWidthMax, fontHeader).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeader); pixmapHeader->DrawText(cPoint(xText, ySubtitle), CutText(subTitle, textWidthMax, fontHeader).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeader);
//REC Icon //REC Icon
eTimerMatch timerMatch=tmNone; eTimerMatch timerMatch = tmNone;
cTimer *ti;
if (!event) if (!event)
return; return;
if (tvguideConfig.useRemoteTimers && pRemoteTimers) { const cTimer *ti;
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);
timerMatch = (eTimerMatch)rtMatch.timerMatch; timerMatch = (eTimerMatch)rtMatch.timerMatch;
ti = rtMatch.timer; ti = rtMatch.timer;
} else { } else {
ti=Timers.GetMatch(event, &timerMatch); #if VDRVERSNUM >= 20301
LOCK_TIMERS_READ;
ti = Timers->GetMatch(event, &timerMatch);
#else
ti = Timers.GetMatch(event, &timerMatch);
#endif
} }
if (timerMatch == tmFull) { bool hasSwitchTimer = SwitchTimers.EventInSwitchList(event);
cString recIconText(" REC "); if (hasSwitchTimer || (ti && timerMatch == tmFull)) {
int widthIcon = fontManager.FontDetailHeader->Width(*recIconText); tColor iconColor;
int height = fontManager.FontDetailHeader->Height()+10; bool switchOnly = false;
int posX = headerWidth - widthIcon - 20; bool timerActive = ti && ti->HasFlags(tfActive);
int posY = 20; cString recIconText;
pixmapHeader->DrawRectangle( cRect(posX, posY, widthIcon, height), theme.Color(clrButtonRed)); #ifdef SWITCHONLYPATCH
pixmapHeader->DrawText(cPoint(posX, posY+5), *recIconText, theme.Color(clrFont), theme.Color(clrButtonRed), fontManager.FontDetailHeader); switchOnly = ti && ti->HasFlags(tfSwitchOnly);
#endif
(hasSwitchTimer || switchOnly) ? recIconText = "Switch" : recIconText = " REC ";
iconColor = (hasSwitchTimer || switchOnly) ? theme.Color(clrButtonYellow) : timerActive ? theme.Color(clrButtonRed) : theme.Color(clrButtonGreen);
int widthIcon = fontManager.FontDetailHeader->Width(*recIconText) + 10;
int height = fontManager.FontDetailHeader->Height() + 10;
int posX = headerWidth - widthIcon - 25;
int posY = ySubtitle - 5;
pixmapHeader->DrawRectangle( cRect(posX, posY, widthIcon, height), iconColor);
pixmapHeader->DrawText(cPoint(posX + 5, posY + 5), *recIconText, theme.Color(clrFont), iconColor, fontManager.FontDetailHeader);
} }
} }
void cView::DrawTabs(void) { void cView::DrawTabs(void) {
if (!pixmapTabs) { if (!pixmapTabs) {
pixmapTabs = osdManager.requestPixmap(4, cRect(0, y + headerHeight + contentHeight, width + scrollbarWidth, tabHeight)); pixmapTabs = osdManager.CreatePixmap(4, cRect(0, y + headerHeight + contentHeight, width + scrollbarWidth, tabHeight));
} }
tColor bgColor = theme.Color(clrTabInactive); tColor bgColor = theme.Color(clrTabInactive);
pixmapTabs->Fill(clrTransparent); pixmapTabs->Fill(clrTransparent);
@ -172,18 +195,18 @@ void cView::DrawTabs(void) {
void cView::ClearContent(void) { void cView::ClearContent(void) {
if (pixmapContent && Running()) { if (pixmapContent && Running()) {
osdManager.releasePixmap(pixmapContent); osdManager.DestroyPixmap(pixmapContent);
pixmapContent = NULL; pixmapContent = NULL;
} }
if (pixmapBackground && Running()) { if (pixmapBackground && Running()) {
osdManager.releasePixmap(pixmapBackground); osdManager.DestroyPixmap(pixmapBackground);
pixmapBackground = NULL; pixmapBackground = NULL;
} }
} }
void cView::CreateContent(int fullHeight) { void cView::CreateContent(int fullHeight) {
scrollable = false; scrollable = false;
pixmapBackground = osdManager.requestPixmap(3, cRect(x, y + headerHeight, width + scrollbarWidth, contentHeight + tabHeight)); pixmapBackground = osdManager.CreatePixmap(3, cRect(x, y + headerHeight, width + scrollbarWidth, contentHeight + tabHeight));
pixmapBackground->Fill(theme.Color(clrBackground)); pixmapBackground->Fill(theme.Color(clrBackground));
int drawPortHeight = contentHeight; int drawPortHeight = contentHeight;
@ -191,7 +214,7 @@ void cView::CreateContent(int fullHeight) {
drawPortHeight = fullHeight; drawPortHeight = fullHeight;
scrollable = true; scrollable = true;
} }
pixmapContent = osdManager.requestPixmap(4, cRect(x, y + headerHeight, width, contentHeight), cRect(0, 0, width, drawPortHeight)); pixmapContent = osdManager.CreatePixmap(4, cRect(x, y + headerHeight, width, contentHeight), cRect(0, 0, width, drawPortHeight));
pixmapContent->Fill(clrTransparent); pixmapContent->Fill(clrTransparent);
} }
@ -200,7 +223,7 @@ void cView::DrawContent(std::string *text) {
wText.Set(text->c_str(), font, width - 2 * border); wText.Set(text->c_str(), font, width - 2 * border);
int lineHeight = font->Height(); int lineHeight = font->Height();
int textLines = wText.Lines(); int textLines = wText.Lines();
int textHeight = lineHeight * textLines + 2*border; int textHeight = lineHeight * textLines + 2 * border;
int yText = border; int yText = border;
CreateContent(textHeight); CreateContent(textHeight);
for (int i=0; i < textLines; i++) { for (int i=0; i < textLines; i++) {
@ -230,18 +253,18 @@ void cView::DrawFloatingContent(std::string *infoText, cTvMedia *img, cTvMedia *
int lineHeight = font->Height(); int lineHeight = font->Height();
int textLinesTall = wTextTall.Lines(); int textLinesTall = wTextTall.Lines();
int textLinesFull = wTextFull.Lines(); int textLinesFull = wTextFull.Lines();
int textHeight = lineHeight * (textLinesTall + textLinesFull) + 2*border; int textHeight = lineHeight * (textLinesTall + textLinesFull) + 2 * border;
int yText = border; int yText = border;
CreateContent(max(textHeight, imgHeight + 2*border)); CreateContent(std::max(textHeight, imgHeight + 2 * border));
for (int i=0; i < textLinesTall; i++) { for (int i = 0; i < textLinesTall; i++) {
pixmapContent->DrawText(cPoint(border, yText), wTextTall.GetLine(i), theme.Color(clrFont), clrTransparent, font); pixmapContent->DrawText(cPoint(border, yText), wTextTall.GetLine(i), theme.Color(clrFont), clrTransparent, font);
yText += lineHeight; yText += lineHeight;
} }
for (int i=0; i < textLinesFull; i++) { for (int i = 0; i < textLinesFull; i++) {
pixmapContent->DrawText(cPoint(border, yText), wTextFull.GetLine(i), theme.Color(clrFont), clrTransparent, font); pixmapContent->DrawText(cPoint(border, yText), wTextFull.GetLine(i), theme.Color(clrFont), clrTransparent, font);
yText += lineHeight; yText += lineHeight;
} }
osdManager.flush(); osdManager.Flush();
cImageLoader imgLoader; cImageLoader imgLoader;
if (imgLoader.LoadPoster(img->path.c_str(), imgWidth, imgHeight)) { if (imgLoader.LoadPoster(img->path.c_str(), imgWidth, imgHeight)) {
if (Running() && pixmapContent) if (Running() && pixmapContent)
@ -249,16 +272,16 @@ void cView::DrawFloatingContent(std::string *infoText, cTvMedia *img, cTvMedia *
} }
if (!img2) if (!img2)
return; return;
osdManager.flush(); osdManager.Flush();
if (imgLoader.LoadPoster(img2->path.c_str(), imgWidth2, imgHeight2)) { if (imgLoader.LoadPoster(img2->path.c_str(), imgWidth2, imgHeight2)) {
if (Running() && pixmapContent) if (Running() && pixmapContent)
pixmapContent->DrawImage(cPoint(width - imgWidth2 - border, imgHeight + 2*border), imgLoader.GetImage()); pixmapContent->DrawImage(cPoint(width - imgWidth2 - border, imgHeight + 2 * border), imgLoader.GetImage());
} }
} }
void cView::CreateFloatingTextWrapper(cTextWrapper *twNarrow, cTextWrapper *twFull, std::string *text, int widthImg, int heightImg) { void cView::CreateFloatingTextWrapper(cTextWrapper *twNarrow, cTextWrapper *twFull, std::string *text, int widthImg, int heightImg) {
int lineHeight = font->Height(); int lineHeight = font->Height();
int linesNarrow = (heightImg + 2*border)/ lineHeight; int linesNarrow = (heightImg + 2 * border)/ lineHeight;
int linesDrawn = 0; int linesDrawn = 0;
int y = 0; int y = 0;
int widthNarrow = width - 3 * border - widthImg; int widthNarrow = width - 3 * border - widthImg;
@ -273,7 +296,7 @@ void cView::CreateFloatingTextWrapper(cTextWrapper *twNarrow, cTextWrapper *twFu
std::stringstream sstrTextTall; std::stringstream sstrTextTall;
std::stringstream sstrTextFull; std::stringstream sstrTextFull;
for (int i=0; i<flds.size(); i++) { for (int i = 0; i < (int)flds.size(); i++) {
if (!flds[i].size()) { if (!flds[i].size()) {
//empty line //empty line
linesDrawn++; linesDrawn++;
@ -378,7 +401,7 @@ void cView::DrawActors(std::vector<cActor> *actors) {
} }
actor++; actor++;
} }
osdManager.flush(); osdManager.Flush();
x = 0; x = 0;
y += thumbHeight + 2 * fontSmall->Height() + border + border/2; y += thumbHeight + 2 * fontSmall->Height() + border + border/2;
} }
@ -404,11 +427,11 @@ void cView::DrawScrollbar(void) {
return; return;
if (!pixmapScrollbar) { if (!pixmapScrollbar) {
pixmapScrollbar = osdManager.requestPixmap(6, cRect(width, y + headerHeight, scrollbarWidth, contentHeight)); pixmapScrollbar = osdManager.CreatePixmap(6, cRect(width, y + headerHeight, scrollbarWidth, contentHeight));
pixmapScrollbar->Fill(clrTransparent); pixmapScrollbar->Fill(clrTransparent);
} }
if (!pixmapScrollbarBack) { if (!pixmapScrollbarBack) {
pixmapScrollbarBack = osdManager.requestPixmap(5, cRect(width, y + headerHeight, scrollbarWidth, contentHeight)); pixmapScrollbarBack = osdManager.CreatePixmap(5, cRect(width, y + headerHeight, scrollbarWidth, contentHeight));
pixmapScrollbarBack->Fill(clrTransparent); pixmapScrollbarBack->Fill(clrTransparent);
} }
@ -434,7 +457,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)
@ -465,11 +488,10 @@ bool cView::KeyUp(void) {
if (!scrollable) if (!scrollable)
return false; return false;
int aktHeight = pixmapContent->DrawPort().Point().Y(); int aktHeight = pixmapContent->DrawPort().Point().Y();
int lineHeight = font->Height();
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;
@ -487,7 +509,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);
@ -506,7 +528,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);
} }
@ -524,9 +546,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;
@ -544,8 +566,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);
@ -565,7 +587,7 @@ void cEPGView::DrawImages(void) {
if (drawPic) { if (drawPic) {
pixmapContent->DrawImage(cPoint((width - imgWidth) / 2, yPic), imgLoader.GetImage()); pixmapContent->DrawImage(cPoint((width - imgWidth) / 2, yPic), imgLoader.GetImage());
yPic += imgHeight + border; yPic += imgHeight + border;
osdManager.flush(); osdManager.Flush();
} }
} }
} }
@ -590,7 +612,7 @@ void cEPGView::Action(void) {
ClearContent(); ClearContent();
if (!headerDrawn) { if (!headerDrawn) {
DrawHeader(); DrawHeader();
osdManager.flush(); osdManager.Flush();
headerDrawn = true; headerDrawn = true;
} }
if (tabs.size() == 0) { if (tabs.size() == 0) {
@ -610,7 +632,7 @@ void cEPGView::Action(void) {
break; break;
} }
DrawScrollbar(); DrawScrollbar();
osdManager.flush(); osdManager.Flush();
} }
/******************************************************************************************** /********************************************************************************************
@ -625,18 +647,18 @@ 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);
} }
void cSeriesView::LoadMedia(void) { void cSeriesView::LoadMedia(void) {
static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr"); static cPlugin *pScraper = GetScraperPlugin();
if (!pScraper2Vdr || seriesId < 1) if (!pScraper || seriesId < 1)
return; return;
series.seriesId = seriesId; series.seriesId = seriesId;
series.episodeId = episodeId; series.episodeId = episodeId;
pScraper2Vdr->Service("GetSeries", &series); pScraper->Service("GetSeries", &series);
} }
void cSeriesView::SetTabs(void) { void cSeriesView::SetTabs(void) {
@ -733,32 +755,32 @@ void cSeriesView::DrawImages(void) {
if (imgLoader.LoadPoster(series.banners[i].path.c_str(), series.banners[i].width, series.banners[i].height) && Running()) { if (imgLoader.LoadPoster(series.banners[i].path.c_str(), series.banners[i].width, series.banners[i].height) && Running()) {
pixmapContent->DrawImage(cPoint((width - series.banners[i].width) / 2, yPic), imgLoader.GetImage()); pixmapContent->DrawImage(cPoint((width - series.banners[i].width) / 2, yPic), imgLoader.GetImage());
yPic += series.banners[i].height + border; yPic += series.banners[i].height + border;
osdManager.flush(); osdManager.Flush();
} }
} }
if (imgLoader.LoadPoster(series.fanarts[i].path.c_str(), fanartWidth, fanartHeight) && Running()) { if (imgLoader.LoadPoster(series.fanarts[i].path.c_str(), fanartWidth, fanartHeight) && Running()) {
pixmapContent->DrawImage(cPoint((width - fanartWidth)/2, yPic), imgLoader.GetImage()); pixmapContent->DrawImage(cPoint((width - fanartWidth)/2, yPic), imgLoader.GetImage());
yPic += fanartHeight + border; yPic += fanartHeight + border;
osdManager.flush(); osdManager.Flush();
} }
} }
if (numPosters >= 1) { if (numPosters >= 1) {
if (imgLoader.LoadPoster(series.posters[0].path.c_str(), posterWidth, posterHeight) && Running()) { if (imgLoader.LoadPoster(series.posters[0].path.c_str(), posterWidth, posterHeight) && Running()) {
pixmapContent->DrawImage(cPoint(border, yPic), imgLoader.GetImage()); pixmapContent->DrawImage(cPoint(border, yPic), imgLoader.GetImage());
osdManager.flush(); osdManager.Flush();
yPic += posterHeight + border; yPic += posterHeight + border;
} }
} }
if (numPosters >= 2) { if (numPosters >= 2) {
if (imgLoader.LoadPoster(series.posters[1].path.c_str(), posterWidth, posterHeight) && Running()) { if (imgLoader.LoadPoster(series.posters[1].path.c_str(), posterWidth, posterHeight) && Running()) {
pixmapContent->DrawImage(cPoint(2 * border + posterWidth, yPic - posterHeight - border), imgLoader.GetImage()); pixmapContent->DrawImage(cPoint(2 * border + posterWidth, yPic - posterHeight - border), imgLoader.GetImage());
osdManager.flush(); osdManager.Flush();
} }
} }
if (numPosters == 3) { if (numPosters == 3) {
if (imgLoader.LoadPoster(series.posters[2].path.c_str(), posterWidth, posterHeight) && Running()) { if (imgLoader.LoadPoster(series.posters[2].path.c_str(), posterWidth, posterHeight) && Running()) {
pixmapContent->DrawImage(cPoint((width - posterWidth) / 2, yPic), imgLoader.GetImage()); pixmapContent->DrawImage(cPoint((width - posterWidth) / 2, yPic), imgLoader.GetImage());
osdManager.flush(); osdManager.Flush();
} }
} }
} }
@ -792,7 +814,7 @@ void cSeriesView::Action(void) {
ClearContent(); ClearContent();
if (!headerDrawn) { if (!headerDrawn) {
DrawHeader(); DrawHeader();
osdManager.flush(); osdManager.Flush();
headerDrawn = true; headerDrawn = true;
} }
if (tabs.size() == 0) { if (tabs.size() == 0) {
@ -834,7 +856,7 @@ void cSeriesView::Action(void) {
break; break;
} }
DrawScrollbar(); DrawScrollbar();
osdManager.flush(); osdManager.Flush();
} }
/******************************************************************************************** /********************************************************************************************
@ -847,17 +869,17 @@ 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);
} }
void cMovieView::LoadMedia(void) { void cMovieView::LoadMedia(void) {
static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr"); static cPlugin *pScraper = GetScraperPlugin();
if (!pScraper2Vdr || movieId < 1) if (!pScraper || movieId < 1)
return; return;
movie.movieId = movieId; movie.movieId = movieId;
pScraper2Vdr->Service("GetMovie", &movie); pScraper->Service("GetMovie", &movie);
} }
void cMovieView::SetTabs(void) { void cMovieView::SetTabs(void) {
@ -960,28 +982,28 @@ void cMovieView::DrawImages(void) {
if (imgLoader.LoadPoster(movie.fanart.path.c_str(), fanartWidth, fanartHeight) && Running()) { if (imgLoader.LoadPoster(movie.fanart.path.c_str(), fanartWidth, fanartHeight) && Running()) {
pixmapContent->DrawImage(cPoint((width - fanartWidth)/2, yPic), imgLoader.GetImage()); pixmapContent->DrawImage(cPoint((width - fanartWidth)/2, yPic), imgLoader.GetImage());
yPic += fanartHeight + border; yPic += fanartHeight + border;
osdManager.flush(); osdManager.Flush();
} }
} }
if (movie.collectionFanart.width > 0 && movie.collectionFanart.height > 0 && movie.collectionFanart.path.size() > 0) { if (movie.collectionFanart.width > 0 && movie.collectionFanart.height > 0 && movie.collectionFanart.path.size() > 0) {
if (imgLoader.LoadPoster(movie.collectionFanart.path.c_str(), collectionFanartWidth, collectionFanartHeight) && Running()) { if (imgLoader.LoadPoster(movie.collectionFanart.path.c_str(), collectionFanartWidth, collectionFanartHeight) && Running()) {
pixmapContent->DrawImage(cPoint((width - collectionFanartWidth)/2, yPic), imgLoader.GetImage()); pixmapContent->DrawImage(cPoint((width - collectionFanartWidth)/2, yPic), imgLoader.GetImage());
yPic += collectionFanartHeight + border; yPic += collectionFanartHeight + border;
osdManager.flush(); osdManager.Flush();
} }
} }
if (movie.poster.width > 0 && movie.poster.height > 0 && movie.poster.path.size() > 0) { if (movie.poster.width > 0 && movie.poster.height > 0 && movie.poster.path.size() > 0) {
if (imgLoader.LoadPoster(movie.poster.path.c_str(), movie.poster.width, movie.poster.height) && Running()) { if (imgLoader.LoadPoster(movie.poster.path.c_str(), movie.poster.width, movie.poster.height) && Running()) {
pixmapContent->DrawImage(cPoint((width - movie.poster.width) / 2, yPic), imgLoader.GetImage()); pixmapContent->DrawImage(cPoint((width - movie.poster.width) / 2, yPic), imgLoader.GetImage());
yPic += movie.poster.height + border; yPic += movie.poster.height + border;
osdManager.flush(); osdManager.Flush();
} }
} }
if (movie.collectionPoster.width > 0 && movie.collectionPoster.height > 0 && movie.collectionPoster.path.size() > 0) { if (movie.collectionPoster.width > 0 && movie.collectionPoster.height > 0 && movie.collectionPoster.path.size() > 0) {
if (imgLoader.LoadPoster(movie.collectionPoster.path.c_str(), movie.collectionPoster.width, movie.collectionPoster.height) && Running()) { if (imgLoader.LoadPoster(movie.collectionPoster.path.c_str(), movie.collectionPoster.width, movie.collectionPoster.height) && Running()) {
pixmapContent->DrawImage(cPoint((width - movie.collectionPoster.width) / 2, yPic), imgLoader.GetImage()); pixmapContent->DrawImage(cPoint((width - movie.collectionPoster.width) / 2, yPic), imgLoader.GetImage());
yPic += movie.collectionPoster.height + border; yPic += movie.collectionPoster.height + border;
osdManager.flush(); osdManager.Flush();
} }
} }
} }
@ -1006,7 +1028,7 @@ void cMovieView::Action(void) {
ClearContent(); ClearContent();
if (!headerDrawn) { if (!headerDrawn) {
DrawHeader(); DrawHeader();
osdManager.flush(); osdManager.Flush();
headerDrawn = true; headerDrawn = true;
} }
if (tabs.size() == 0) { if (tabs.size() == 0) {
@ -1042,5 +1064,5 @@ void cMovieView::Action(void) {
break; break;
} }
DrawScrollbar(); DrawScrollbar();
osdManager.flush(); osdManager.Flush();
} }

1
view.h
View File

@ -51,6 +51,7 @@ protected:
int contentHeight; int contentHeight;
int tabHeight; int tabHeight;
int scrollbarWidth; int scrollbarWidth;
cTextWrapper wrapper;
std::vector<std::string> tabs; std::vector<std::string> tabs;
std::string title; std::string title;
std::string subTitle; std::string subTitle;