diff -Nru vdr-plugin-graphtftng-0.6.15/debian/changelog vdr-plugin-graphtftng-0.6.16/debian/changelog --- vdr-plugin-graphtftng-0.6.15/debian/changelog 2017-04-27 07:02:23.000000000 +0000 +++ vdr-plugin-graphtftng-0.6.16/debian/changelog 2017-04-27 07:11:03.000000000 +0000 @@ -1,16 +1,50 @@ -vdr-plugin-graphtftng (0.6.15-1yavdr0~trusty) trusty; urgency=medium +vdr-plugin-graphtftng (0.6.16-1yavdr0~trusty) trusty; urgency=medium + + * rebuild for trusty + + -- Alexander Grothe Thu, 27 Apr 2017 09:10:48 +0200 + +vdr-plugin-graphtftng (0.6.16-0yavdr1~xenial) xenial; urgency=medium + + * automatic rebuild + + -- Alexander Grothe Fri, 14 Apr 2017 11:05:18 +0200 + +vdr-plugin-graphtftng (0.6.16-0yavdr0~xenial) xenial; urgency=medium + + * new upstream version + + -- Alexander Grothe Sat, 01 Apr 2017 10:48:44 +0200 + +vdr-plugin-graphtftng (0.6.15-2yavdr1~xenial) xenial; urgency=medium * rebuild - -- Alexander Grothe Thu, 27 Apr 2017 09:01:40 +0200 + -- Alexander Grothe Sat, 01 Apr 2017 10:11:36 +0200 + +vdr-plugin-graphtftng (0.6.15-2yavdr0~xenial) xenial; urgency=medium + + * install themes + + -- Alexander Grothe Sat, 21 Jan 2017 18:48:50 +0100 + +vdr-plugin-graphtftng (0.6.15-1yavdr0~xenial) xenial; urgency=medium + + * remove dependency to old vdr-tft-standard skin + + -- Alexander Grothe Mon, 12 Dec 2016 12:39:39 +0100 -vdr-plugin-graphtftng (0.6.15-0yavdr0~trusty) trusty; urgency=medium +vdr-plugin-graphtftng (0.6.15-0yavdr0~xenial) xenial; urgency=medium * new upstream version + - Version 0.6.15, horchi 24.11.2016 - change: Changed default host of graphtft-fe to localhost + - Version 0.6.14, horchi 11.05.2016 - bugfix: Fixed timer state handling for epg2vdr timer + - Version 0.6.13, horchi - 03.05.2016 - added: Trigger to update timerlist + - Version 0.6.12, horchi - 02.05.2016 - added: support timer list even for remote timers via epg2vdr -> enable WITH_EPG2VDR in Makefile - -- Alexander Grothe Fri, 25 Nov 2016 12:00:14 +0100 + -- Alexander Grothe Sun, 27 Nov 2016 11:45:45 +0100 -vdr-plugin-graphtftng (0.6.10-2yavdr0~trusty) trusty; urgency=medium +vdr-plugin-graphtftng (0.6.10-2yavdr0~xenial) xenial; urgency=medium * do not install themes, they are missing the theme files diff -Nru vdr-plugin-graphtftng-0.6.15/debian/control vdr-plugin-graphtftng-0.6.16/debian/control --- vdr-plugin-graphtftng-0.6.15/debian/control 2017-04-27 07:01:33.000000000 +0000 +++ vdr-plugin-graphtftng-0.6.16/debian/control 2017-04-27 07:11:22.000000000 +0000 @@ -6,8 +6,8 @@ Origin: ctvdr Build-Depends: debhelper (>= 8), vdr-dev (>= 2.2.0-1), pkg-config, libtool, gettext, libexif-dev, libgtop2-dev, - libimlib2-dev, libavcodec-ffmpeg3-dev (>= 0.cvs20060329-4), libgtop2-dev, - libmagick++-dev|libmagick++5-dev, libswscale-ffmpeg3-dev, libswresample-ffmpeg3-dev + libimlib2-dev, libavcodec-ffmpeg3-dev, + libmagick++-dev, libswscale-dev, libswresample-ffmpeg3-dev Standards-Version: 3.8.4 Homepage: http://www.jwendel.de/vdr/ @@ -15,7 +15,7 @@ Architecture: any Replaces: vdr-plugin-graphtft (<< 0.4.1) Breaks: vdr-plugin-graphtft (<< 0.4.1) -Depends: ${shlibs:Depends}, ${misc:Depends}, ${vdr:Depends}, ttf-bitstream-vera, vdr-tftng-standard +Depends: ${shlibs:Depends}, ${misc:Depends}, ${vdr:Depends}, ttf-bitstream-vera Description: GraphTFT Plugin for VDR This Plugin uses a Framebuffer or VDR device to show Status Informations. So you can use a cheap mini-TFT to show infos about your VDR. diff -Nru vdr-plugin-graphtftng-0.6.15/debian/install vdr-plugin-graphtftng-0.6.16/debian/install --- vdr-plugin-graphtftng-0.6.15/debian/install 2016-11-25 11:00:11.000000000 +0000 +++ vdr-plugin-graphtftng-0.6.16/debian/install 2017-04-01 08:48:38.000000000 +0000 @@ -0,0 +1 @@ +themes/* var/lib/vdr/plugins/graphtftng/themes/ diff -Nru vdr-plugin-graphtftng-0.6.15/debian/patches/enable_EPG2VDR_Support.patch vdr-plugin-graphtftng-0.6.16/debian/patches/enable_EPG2VDR_Support.patch --- vdr-plugin-graphtftng-0.6.15/debian/patches/enable_EPG2VDR_Support.patch 1970-01-01 00:00:00.000000000 +0000 +++ vdr-plugin-graphtftng-0.6.16/debian/patches/enable_EPG2VDR_Support.patch 2017-04-01 08:48:38.000000000 +0000 @@ -0,0 +1,11 @@ +--- a/Makefile ++++ b/Makefile +@@ -25,7 +25,7 @@ + #WITH_OLD_PATCH = 1 + + # compile with epg2vdr timer support +-#WITH_EPG2VDR = 1 ++WITH_EPG2VDR = 1 + + # Name of the plugin + diff -Nru vdr-plugin-graphtftng-0.6.15/display.c vdr-plugin-graphtftng-0.6.16/display.c --- vdr-plugin-graphtftng-0.6.15/display.c 2016-11-24 14:31:23.000000000 +0000 +++ vdr-plugin-graphtftng-0.6.16/display.c 2017-03-05 15:47:41.000000000 +0000 @@ -1,13 +1,13 @@ /** - * GraphTFTng plugin for the Video Disk Recorder - * + * GraphTFTng plugin for the Video Disk Recorder + * * display.c * * (c) 2006-2013 Jörg Wendel * * This code is distributed under the terms and conditions of the * GNU GENERAL PUBLIC LICENSE. See the file COPYING for details. - * + * **/ //*************************************************************************** @@ -42,7 +42,7 @@ // init renderer renderer = 0; - + // init thread stuff _active = no; @@ -57,8 +57,8 @@ currentSection = 0; lastSection = 0; _eventsReady = no; - _menu.charInTabs[0] = _menu.charInTabs[1] = _menu.charInTabs[2] = - _menu.charInTabs[3] = _menu.charInTabs[4] = + _menu.charInTabs[0] = _menu.charInTabs[1] = _menu.charInTabs[2] = + _menu.charInTabs[3] = _menu.charInTabs[4] = _menu.charInTabs[5] = _menu.charInTabs[6] = 0; _mode = NormalView; _sectionName = ""; @@ -141,14 +141,14 @@ } } -cGraphTFTDisplay::~cGraphTFTDisplay() +cGraphTFTDisplay::~cGraphTFTDisplay() { Stop(); if (touchThread) delete touchThread; if (comThread) delete comThread; if (renderer) delete renderer; - + if (fdInotify != na) close(fdInotify); } @@ -181,7 +181,7 @@ renderer = new XRenderer(GraphTFTSetup.xOffset, GraphTFTSetup.yOffset, GraphTFTSetup.width, GraphTFTSetup.height, GraphTFTSetup.configPath, GraphTFTSetup.Iso2Utf, - Thms::theTheme->getDir()); + Thms::theTheme->getDir()); } #endif @@ -195,7 +195,7 @@ Thms::theTheme->getDir()); } - // apply renderer settings + // apply renderer settings renderer->setBorder(GraphTFTSetup.xBorder, GraphTFTSetup.yBorder); renderer->setProperties(GraphTFTSetup.xOffset, GraphTFTSetup.yOffset, @@ -215,13 +215,13 @@ { tell(0, "Starting detached!"); } - + #ifdef WITH_TCPCOM // for comthread use theme width/height instead of display width/height - + comThread = new ComThread(this, Thms::theTheme->getWidth(), Thms::theTheme->getHeight()); - + if (comThread->init(renderer, port) != success) { tell(0, "Can't establish tcp listener at port %d, aborting", port); @@ -280,7 +280,7 @@ //*************************************************************************** int cGraphTFTDisplay::setMode(DisplayMode mode, const char* menuName, int force) -{ +{ if (_mode == ModeCalibration && !force) return done; @@ -289,7 +289,7 @@ _mode = mode; _sectionName = menuName ? menuName : "Menu"; - tell(0, "Mode is set to (0x%X), menu section to '%s'", + tell(0, "Mode is set to (0x%X), menu section to '%s'", _mode, _sectionName.c_str()); broadcast(); @@ -325,7 +325,7 @@ // for X renderer set display size too, ignored by FB renderer! - renderer->setDisplaySize(w ? w : GraphTFTSetup.width, + renderer->setDisplaySize(w ? w : GraphTFTSetup.width, h ? h : GraphTFTSetup.height); } } @@ -347,7 +347,7 @@ static int lastActive = no; static cGraphTFTService::DisplayMode lastMode = cGraphTFTDisplay::NormalView; static string lastSection = ""; - + if (active != lastActive) { lastActive = active; @@ -446,7 +446,7 @@ void cGraphTFTDisplay::Stop() { - if (_active) + if (_active) { _active = no; broadcast(); @@ -464,7 +464,7 @@ const char* a = str; const char* b = strchrnul(a, '\t'); - while (*b && index-- > 0) + while (*b && index-- > 0) { a = b + 1; b = strchrnul(a, '\t'); @@ -520,7 +520,7 @@ while (_active) { tell(3, "action loop"); - + if (touchMenu) { if (touchMenuHideAt && msNow() > touchMenuHideAt-100) @@ -566,14 +566,14 @@ updateIn = touchMenuHideAt - msNow(); tell(3, "Autohide scheduled in %ldms", updateIn); - } + } } - + if (updateIn < 10) // 10ms -> the minimum updateIn = 10; // can't calc this inline, due to a format string problem ... ? - + int s = updateIn/1000; int us = updateIn%1000; tell(2, "Displayed %d Items, schedule next " @@ -585,7 +585,7 @@ if (triggerTimerUpdate) updateTimers(); - + if (triggerChannelUpdate) updateChannel(); @@ -593,7 +593,7 @@ finalizeItemList(); // snapshot - + if (snapshotPending) takeSnapshot(); } @@ -611,17 +611,17 @@ uint64_t waitUntil = updateIn + msNow(); wakeup = no; - + while (msNow() < waitUntil && !wakeup) { _doUpdate.TimedWait(_mutex, waitStep); if (waitUntil-msNow() < waitStep) waitStep = waitUntil-msNow(); - + meanwhile(); } - + return success; } @@ -657,7 +657,7 @@ { const int sizeNameMax = 255; const int sizeBuf = 10 * (sizeof(inotify_event) + sizeNameMax); - + char buffer[sizeBuf]; inotify_event* event = 0; @@ -667,7 +667,7 @@ { event = (inotify_event*)&buffer[pos]; - tell(0, "got %d bytes fron inotify, mask %d, len %d, name '%s'", + tell(0, "got %d bytes fron inotify, mask %d, len %d, name '%s'", bytes, event->mask, event->len, event->name ? event->name : ""); if (event->mask & IN_CREATE || event->mask & IN_MODIFY) @@ -679,7 +679,7 @@ if (p) { p->scheduleDrawIn(10); - + tell(0, "Got notification for '%s'", p->Path().c_str()); } } @@ -703,7 +703,7 @@ char* file = 0; snapshotPending = no; - + // it's better to wait half a second, give the menu a chance to close .. _doUpdate.TimedWait(_mutex, 500); @@ -715,6 +715,7 @@ const cRecording* replay; #if defined (APIVERSNUM) && (APIVERSNUM >= 20301) + tell(0, "lock for takeSnapshot()"); LOCK_RECORDINGS_READ; const cRecordings* recordings = Recordings; #else @@ -738,10 +739,10 @@ strreplace(file, '/', ' '); asprintf(&path, "%s/%s.jpg", GraphTFTSetup.snapshotPath, file); - - if (cDevice::PrimaryDevice()->GrabImageFile(path, yes, - GraphTFTSetup.snapshotQuality, - GraphTFTSetup.snapshotWidth, + + if (cDevice::PrimaryDevice()->GrabImageFile(path, yes, + GraphTFTSetup.snapshotQuality, + GraphTFTSetup.snapshotWidth, GraphTFTSetup.snapshotHeight)) Skins.Message(mtInfo, tr("Snapshot saved")); else @@ -750,7 +751,7 @@ renderer->flushCache(); free(path); free(file); -} +} //*************************************************************************** // update Timers @@ -773,14 +774,14 @@ std::list::iterator it; cPlugin* pEpg2Vdr = cPluginManager::GetPlugin("epg2vdr"); cEpgTimer_Service_V1 data; - + if (!pEpg2Vdr) return; if (pEpg2Vdr->Service(EPG2VDR_TIMER_SERVICE, &data)) { tell(0, "Got list with %ld timers from epg2vdr", data.epgTimers.size()); - + for (it = data.epgTimers.begin(); it != data.epgTimers.end(); ++it) { tell(0, "Adding '%s' timer '%s' to list %s", @@ -794,18 +795,19 @@ } } -#else // WITH_EPG2VDR - +#else // WITH_EPG2VDR + #if defined (APIVERSNUM) && (APIVERSNUM >= 20301) + tell(0, "lock for updateTimers()"); LOCK_TIMERS_READ; const cTimers* timers = Timers; #else const cTimers* timers = &Timers; #endif - for (const cTimer* timer = timers->First(); timer; timer = timers->Next(timer)) - { - tell(3, "Adding timer '%s' to list %s", + for (const cTimer* timer = timers->First(); timer; timer = timers->Next(timer)) + { + tell(3, "Adding timer '%s' to list %s", timer->File(), timer->Recording() ? "timer is regording" : ""); _timers.append(timer); @@ -827,24 +829,25 @@ void cGraphTFTDisplay::updateChannel() { #if defined (APIVERSNUM) && (APIVERSNUM >= 20301) + tell(0, "lock for updateChannel()"); LOCK_CHANNELS_READ; _presentChannel = Channels->GetByNumber(_channel); #else _presentChannel = Channels.GetByNumber(_channel); #endif - + if (_presentChannel) { - if (!isModeMenu(_mode)) + if (!isModeMenu(_mode)) { - switch (_presentChannel->Vpid()) + switch (_presentChannel->Vpid()) { case 0: case 1: case 0x1fff: channelType = ctRadio; break; default: channelType = ctTv; break; } - + setMode(NormalView); } } @@ -862,28 +865,46 @@ cMutexLock lock(&_mutex); #if defined (APIVERSNUM) && (APIVERSNUM >= 20301) - LOCK_CHANNELS_READ; - const cChannels* channels = Channels; + const cChannels* channels = 0; + const cRecordings* recordings = 0; + cStateKey stateKeyChannels; + cStateKey stateKeyRecordings; + + tell(0, "trylock for finalizeItemList(CHANNELS)"); + + if (!(channels = cChannels::GetChannelsRead(stateKeyChannels, 500))) + { + tell(0, "can't get lock for finalizeItemList(CHANNELS), retrying later"); + return ; + } + + tell(0, "trylock for finalizeItemList(REGORDINGS)"); + + if (!(recordings = cRecordings::GetRecordingsRead(stateKeyRecordings, 500))) + { + stateKeyChannels.Remove(); + tell(0, "can't get lock for finalizeItemList(CHANNELS), retrying later"); + return ; + } #else cChannels* channels = &Channels; -#endif - -#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) - LOCK_RECORDINGS_READ; - const cRecordings* recordings = Recordings; -#else cRecordings* recordings = &Recordings; #endif - + for (string::size_type i = 0; i < _menu.items.size(); i++) { if (!_menu.items[i].event.isEmpty()) _menu.items[i].channel = channels->GetByChannelID(_menu.items[i].event.ChannelID()); - + if (!_menu.items[i].recording && _menu.items[i].recordingName.size()) _menu.items[i].recording = recordings->GetByName(_menu.items[i].recordingName.c_str()); } +#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) + stateKeyChannels.Remove(); + stateKeyRecordings.Remove(); +#endif + _eventsReady = yes; triggerFinalizeItemList = no; } @@ -896,7 +917,7 @@ { // first check foreground items .. - for (cDisplayItem* p = currentSection->getItems()->First(); p; + for (cDisplayItem* p = currentSection->getItems()->First(); p; p = currentSection->getItems()->Next(p)) { if (!p->Foreground() || !p->evaluateCondition()) @@ -914,7 +935,7 @@ // now the other .. - for (cDisplayItem* p = currentSection->getItems()->First(); p; + for (cDisplayItem* p = currentSection->getItems()->First(); p; p = currentSection->getItems()->Next(p)) { if (p->Foreground() || !p->evaluateCondition()) @@ -955,7 +976,7 @@ if (p) tell(4, "Mouse action on item %d [%s] at (%d/%d)", p->Item(), p->Text().c_str(), x, y); - + if (isMode(ModeCalibration)) { calibrateTouch(x, y); @@ -1017,28 +1038,28 @@ whipeDiff = whipeDiff % p->WhipeRes(); } - + return ; } whipeDiff = 0; // menue navigation area ? - + if (p->Item() == itemMenuNavigationArea && !touchMenu && _menu.lineHeight > 0) { int clickRow; int yOff = y - p->Y(); int currentRowY = (_menu.currentRow - _menu.topRow) * _menu.lineHeight; - + if (yOff < currentRowY) clickRow = yOff / _menu.lineHeight + _menu.topRow; else if (yOff < currentRowY + _menu.lineHeightSelected) clickRow = _menu.currentRow; else clickRow = (yOff-_menu.lineHeightSelected) / _menu.lineHeight + _menu.topRow+1; - + if (_menu.currentRow < clickRow) // down for (int i = _menu.currentRow; i < clickRow; i++) cRemote::Put(cKey::FromString("Down")); @@ -1046,9 +1067,9 @@ for (int i = _menu.currentRow; i > clickRow; i--) cRemote::Put(cKey::FromString("Up")); } - + // check if item with defined action - + if (p->OnClick() != "" && flag == cGraphTftComService::efNone) { if (p->OnClick().find("touchMenu") == 1) @@ -1063,7 +1084,7 @@ if ((val = strchr(click, ':')) && *(val++)) { - if ((val2 = strchr(val, ':')) && *(val2++) + if ((val2 = strchr(val, ':')) && *(val2++) && atoi(val) == touchMenu) touchMenu = atoi(val2); else @@ -1071,14 +1092,14 @@ } else touchMenu = !touchMenu; - + if (p->Delay()) touchMenuHideTime = p->Delay(); if (touchMenuHideTime) touchMenuHideAt = msNow() + touchMenuHideTime; - tell(4, "touch menu switched to (%d) hide in (%ld) seconds", + tell(4, "touch menu switched to (%d) hide in (%ld) seconds", touchMenu, touchMenuHideTime); free(click); @@ -1121,7 +1142,7 @@ // first check if 'normal' key actions if (key != kNone) - { + { for (int i = 0; i < abs(step); i++) { scan.reset(); @@ -1144,9 +1165,9 @@ scan.lastIdent(), scan.all()); return fail; } - + name = scan.lastIdent(); - + if (scan.eat() != success || !scan.isOperator()) { tell(0, "Error: Invalid operator '%s' in '%s'", @@ -1154,7 +1175,7 @@ return fail; } - // get the actual value of the variable + // get the actual value of the variable value = atoi(v.c_str()); @@ -1214,7 +1235,7 @@ static double upperLeftY; string s; - int offset = 20; + int offset = 20; if (Thms::theTheme->lookupVar("calibrationFrameOffset", s) == success) offset = atoi(s.c_str()); @@ -1236,7 +1257,7 @@ { upperLeftX = x; upperLeftY = y; - + calibration.instruction = "Click upper right corner"; calibration.cursorX = Thms::theTheme->getWidth() - offset; calibration.cursorY = offset; @@ -1354,7 +1375,7 @@ else if (isModeMenu(_mode) && !Thms::theTheme->getSection(sectionName)) { - tell(0, "Info: Section faked to '%s' due to section '%s' not defined!", + tell(0, "Info: Section faked to '%s' due to section '%s' not defined!", "Menu", sectionName.c_str()); sectionName = "Menu"; @@ -1370,20 +1391,20 @@ if (cDisplayItem::getForce()) tell(1, "Force draw of all items now"); - + // section changed if (currentSection != lastSection) { - tell(0, "Section changed from '%s' to '%s'", - lastSection ? lastSection->getName().c_str() : "", + tell(0, "Section changed from '%s' to '%s'", + lastSection ? lastSection->getName().c_str() : "", currentSection->getName().c_str()); lastSection = currentSection; _menu.topRow = na; _menu.lineHeight = na; - cDisplayItem::clearSelectedItem(); + cDisplayItem::clearSelectedItem(); clear(); cDisplayItem::setForce(yes); @@ -1398,7 +1419,7 @@ // reset x of menu items - for (string::size_type i = 0; i < _menu.items.size(); i++) + for (string::size_type i = 0; i < _menu.items.size(); i++) _menu.items[i].nextX = 0; } @@ -1467,7 +1488,7 @@ // dump to file ... - if (GraphTFTSetup.DumpImage) + if (GraphTFTSetup.DumpImage) { static int lastDumpAt = msNow(); int lastDumpDiff = lastDumpAt ? msNow() - lastDumpAt : 0; @@ -1475,7 +1496,7 @@ if (lastDumpDiff > (GraphTFTSetup.DumpRefresh * 1000)) { // dump - + lastDumpAt = msNow(); renderer->dumpImage2File("/graphtftng.png", GraphTFTSetup.width, GraphTFTSetup.height); } @@ -1496,6 +1517,7 @@ void cGraphTFTDisplay::updateProgram() { #if defined (APIVERSNUM) && (APIVERSNUM >= 20301) + tell(0, "lock for updateProgram(CHANNELS)"); LOCK_CHANNELS_READ; const cChannel* channel = Channels->GetByNumber(_channel); #else @@ -1518,18 +1540,19 @@ _followingEvent.reset(); #if defined (APIVERSNUM) && (APIVERSNUM >= 20301) + tell(0, "lock for updateProgram(SCHEDULES)"); LOCK_SCHEDULES_READ; const cSchedules* schedules = Schedules; #else cSchedulesLock schedulesLock; const cSchedules* schedules = (cSchedules*)cSchedules::Schedules(schedulesLock); #endif - - if (schedules) + + if (schedules) { const cSchedule *schedule = schedules->GetSchedule(channel->GetChannelID()); - if (schedule) + if (schedule) { _presentEvent.set(schedule->GetPresentEvent()); _followingEvent.set(schedule->GetFollowingEvent()); diff -Nru vdr-plugin-graphtftng-0.6.15/dspitems.c vdr-plugin-graphtftng-0.6.16/dspitems.c --- vdr-plugin-graphtftng-0.6.15/dspitems.c 2016-11-24 14:31:23.000000000 +0000 +++ vdr-plugin-graphtftng-0.6.16/dspitems.c 2017-03-05 15:47:41.000000000 +0000 @@ -1,5 +1,5 @@ /* - * GraphTFT plugin for the Video Disk Recorder + * GraphTFT plugin for the Video Disk Recorder * * dspitems.c * @@ -46,7 +46,7 @@ { nextForce = aTime; - tell(1, "schedule force in (%ldms)", + tell(1, "schedule force in (%ldms)", nextForce - msNow()); } } @@ -57,7 +57,7 @@ { nextDraw = aTime; - tell(2, "schedule next draw of '%s'[%s] in (%ldms)", + tell(2, "schedule next draw of '%s'[%s] in (%ldms)", nameOf(), Debug().c_str(), nextDraw - msNow()); } @@ -66,10 +66,10 @@ void cDisplayItem::scheduleDrawIn(int aTime) { uint64_t at = aTime + msNow(); - + // the maximal redraw granularity is 500ms (maxGranularity), due to this // adjust to next full step - + at = round((double)((double)at / maxGranularity)) * maxGranularity; scheduleDrawAt(at); @@ -157,11 +157,11 @@ if (p[0] != '/') { - p = string(GraphTFTSetup.themesPath) - + string(Thms::theTheme->getDir()) + p = string(GraphTFTSetup.themesPath) + + string(Thms::theTheme->getDir()) + "/" + p; - tell(4, "%d path [%s] converted to '%s'", i, + tell(4, "%d path [%s] converted to '%s'", i, pathList[i].configured.c_str(), p.c_str()); } @@ -175,7 +175,7 @@ return pathList[i].last; // check for range - + unsigned int s = p.find_last_of('('); unsigned int e = p.find_last_of(')'); int rangeSize = e-s-1; @@ -188,23 +188,23 @@ string path = ""; scan.eat(); - + if (!scan.isNum()) continue; // range parsing error - + minNum = scan.lastInt(); scan.eat(); - + if (!scan.isOperator() || *scan.lastIdent() != '-') continue; // range parsing error - + scan.eat(); - + if (!scan.isNum()) continue; // range parsing error - + maxNum = scan.lastInt(); - + if (scan.eat() == success) continue; // range parsing error (waste behind second int) @@ -224,7 +224,7 @@ { if (++cur > maxNum) cur = minNum; - + path = p.substr(0, s) + Str::toStr(cur) + p.substr(e+1); tell(2, "Checking for '%s'", path.c_str()); @@ -303,7 +303,7 @@ if (evaluate(expression, _condition.c_str()) != success) return no; - tell(3, "evaluating condition '%s' with expression '%s'", + tell(3, "evaluating condition '%s' with expression '%s'", _condition.c_str(), expression.c_str()); // ... @@ -338,11 +338,11 @@ if ((state = scan->eat()) == success && scan->isOperator() && !scan->isLogical()) { strcpy(op, scan->lastIdent()); - + // right expression - + scan->eat(); - + if (scan->isNum()) { rightInt = scan->lastInt(); @@ -358,8 +358,8 @@ tell(0, "Error: Invalid right '%s' expression in '%s'", scan->lastIdent(), expression.c_str()); return no; - } - + } + // check the condition if (leftType != rightType) @@ -368,9 +368,9 @@ "agrument don't match in (%d/%d) '%s'", leftType, rightType, expression.c_str()); return no; - } + } - if (leftType == catInteger) + if (leftType == catInteger) result = condition(leftInt, rightInt, op); else result = condition(&leftStr, &rightStr, op); @@ -411,14 +411,14 @@ result = result || evaluateCondition(yes); } - tell(3, "condition is '%s'; evaluated condition is '%s'; result is '%s'", + tell(3, "condition is '%s'; evaluated condition is '%s'; result is '%s'", _condition.c_str(), expression.c_str(), result ? "match" : "don't match"); return result; } //*************************************************************************** -// evaluate the condition +// evaluate the condition //*************************************************************************** int cDisplayItem::condition(int left, int right, const char* op) @@ -427,19 +427,19 @@ if (strcmp(op, ">") == 0) return left > right; - + if (strcmp(op, "<") == 0) return left < right; - + if (strcmp(op, ">=") == 0) return left >= right; - + if (strcmp(op, "<=") == 0) return left <= right; - + if (strcmp(op, "=") == 0 || strcmp(op, "==") == 0) return left == right; - + if (strcmp(op, "!=") == 0 || strcmp(op, "<>") == 0) return left != right; @@ -450,24 +450,24 @@ int cDisplayItem::condition(string* left, string* right, const char* op) { - tell(4, "evaluate condition '%s' '%s' '%s'", + tell(4, "evaluate condition '%s' '%s' '%s'", left->c_str(), op, right->c_str()); if (strcmp(op, ">") == 0) return *left > *right; - + if (strcmp(op, "<") == 0) return *left < *right; - + if (strcmp(op, ">=") == 0) return *left >= *right; - + if (strcmp(op, "<=") == 0) return *left <= *right; - + if (strcmp(op, "=") == 0 || strcmp(op, "==") == 0) return *left == *right; - + if (strcmp(op, "!=") == 0 || strcmp(op, "<>") == 0) return *left != *right; @@ -513,13 +513,13 @@ { tell(4, "Ignore drawing of '%s' due to condition '%s'", nameOf(), _condition.c_str()); - + status = ignore; } } // schedule due to the configured delay .. - + if (cond && _delay > 0 && visible && msNow() > nextDraw && !_scroll) scheduleDrawIn(_delay); @@ -527,9 +527,9 @@ if (lastConditionState != cond) { - tell(4, "Condition '%s' of '%s' [%s] changed from (%d) to (%d), force draw", - _condition.c_str(), nameOf(), - Text() != "" ? Text().c_str() : Path().c_str(), + tell(4, "Condition '%s' of '%s' [%s] changed from (%d) to (%d), force draw", + _condition.c_str(), nameOf(), + Text() != "" ? Text().c_str() : Path().c_str(), lastConditionState, cond); lastConditionState = cond; @@ -543,7 +543,7 @@ { tell(6, "timeMs::Now() (%ldms);", msNow()); tell(6, "nextForce at (%ldms)", nextForce); - tell(6, "forceDraw '%s', nextDraw (%ldms), isForegroundItem(%d), Foreground(%d)", + tell(6, "forceDraw '%s', nextDraw (%ldms), isForegroundItem(%d), Foreground(%d)", forceDraw ? "yes" : "no", nextDraw, isForegroundItem(), Foreground()); changed = no; @@ -571,12 +571,12 @@ tell(2, "draw '%s', %s", nameOf(), res ? "done" : "skipped due to condition"); if (res > 0 && logLevel >= 3) - { + { if (isForegroundItem() || forceDraw || Foreground()) { - tell(3, "forceDraw(%d), isForegroundItem(%d), Foreground(%d)", + tell(3, "forceDraw(%d), isForegroundItem(%d), Foreground(%d)", forceDraw, isForegroundItem(), Foreground()); - tell(3, "'%s' - '%s'", nameOf(), + tell(3, "'%s' - '%s'", nameOf(), Text().size() ? Text().c_str() : Path().c_str()); } } @@ -612,7 +612,7 @@ if (clear) drawBackRect(y, _bg_height ? _bg_height : height); - + if (!textLen || Str::isEmpty(text)) return done; @@ -634,7 +634,7 @@ { textWidth = 22 * textLen; - tell(1, "Info: Can't detect text with of '%s'[%s](%d) witch font %s/%d. Assuming %dpx", + tell(1, "Info: Can't detect text with of '%s'[%s](%d) witch font %s/%d. Assuming %dpx", text, _debug.c_str(), textLen, _font.c_str(), _size, textWidth); } @@ -647,7 +647,7 @@ tell(3, "[%s] textLen %d, viewLength = %d, textWidth = %dpx, visibleWidth = %dpx, lines = %d, font %s/%d", _debug.c_str(), textLen, viewLength, textWidth, visibleWidth, lines, _font.c_str(), _size); - tell(5, "[%s] scroll is (%d) and marquee_active is (%d) for text '%s'", + tell(5, "[%s] scroll is (%d) and marquee_active is (%d) for text '%s'", _debug.c_str(), _scroll, marquee_active, text); // get line count of the actual text @@ -684,27 +684,27 @@ { if (_scroll == 1 && marquee_idx + viewLength > textLen) marquee_left = yes; - + else if (_scroll == 2 && marquee_idx + viewLength > textLen) marquee_idx = na; - + if (marquee_left) marquee_idx--; else marquee_idx++; - + if (marquee_idx == 0) { marquee_left = no; marquee_count++; } - + if (_scroll_count && marquee_count > _scroll_count) { marquee_active = no; marquee_idx = 0; } - + if (marquee_active) { if (_delay < 200) @@ -717,7 +717,7 @@ nextAnimationAt = nextDraw; } - } + } int blen = strlen(text); int cs, ps; @@ -728,22 +728,22 @@ { i++; cs = max(mblen(&text[ps], blen-ps), 1); - + if (i >= marquee_idx) break; } - tell(3, "drawing text in scroll mode '%s' (%d/%d), nextDraw is %ld; idx is %d/%d", + tell(3, "drawing text in scroll mode '%s' (%d/%d), nextDraw is %ld; idx is %d/%d", text, textLen, viewLength, nextDraw/1000, marquee_idx, ps); render->text(text + ps, _font.c_str(), _size, _align, - X(), y, + X(), y, evaluateColor(_color.c_str(), rgba), - width, height, + width, height, lines, marquee_active ? no : _dots); } - + return done; } @@ -763,7 +763,7 @@ int width = _bg_width > 0 ? _bg_width : Width(); y = y ? y : _bg_y != na ? _bg_y : Y(); - + if (!height) height = _bg_height > 0 ? _bg_height : Height(); @@ -781,9 +781,9 @@ evaluate(p, backgroundItem->Path().c_str()); - tell(3, "Drawing backround area of '%s' for '%s'", + tell(3, "Drawing backround area of '%s' for '%s'", p.c_str(), _text.c_str()); - + render->imagePart(p.c_str(), x, y, width, height); } @@ -807,14 +807,14 @@ int orientation = 1; // 1 => 'normal' ExifData* exifData = exif_data_new_from_file(file); - if (exifData) + if (exifData) { ExifByteOrder byteOrder = exif_data_get_byte_order(exifData); ExifEntry* exifEntry = exif_data_get_entry(exifData, EXIF_TAG_ORIENTATION); if (exifEntry) orientation = exif_get_short(exifEntry->data, byteOrder); - + exif_data_free(exifData); } @@ -831,10 +831,10 @@ tell(3, "drawing image '%s' at %d/%d (%d/%d); fit = %d; aspectRatio = %d)", path, X(), Y(), Width(), Height(), _fit, aspectRatio); - + if (BgWidth() && !noBack) drawBackRect(); - + if (strcasestr(path, "JPEG") || strcasestr(path, "JPG")) orientation = getJpegOrientation(path); @@ -850,7 +850,7 @@ // Format String //*************************************************************************** -const char* cDisplayItem::formatString(const char* str, const char* fmt, +const char* cDisplayItem::formatString(const char* str, const char* fmt, char* buffer, int len) { if (Str::isEmpty(fmt) || Str::isEmpty(str)) @@ -861,7 +861,7 @@ if (strcasecmp(fmt, "upper") == 0) Str::toCase(Str::cUpper, buffer); if (strcasecmp(fmt, "lower") == 0) - Str::toCase(Str::cLower, buffer); + Str::toCase(Str::cLower, buffer); return buffer; } @@ -870,7 +870,7 @@ // Format Date Time //*************************************************************************** -const char* cDisplayItem::formatDateTime(time_t theTime, const char* fmt, +const char* cDisplayItem::formatDateTime(time_t theTime, const char* fmt, char* date, int len, int absolut) { struct tm tim = {0}; @@ -879,7 +879,7 @@ *date = 0; - string format = fmt && *fmt ? fmt : + string format = fmt && *fmt ? fmt : (_format.length() ? _format : "%a %d.%m %H:%M"); // %s seems to be absolut as default ... @@ -908,8 +908,8 @@ return 0; } - if (format.find("%s") != string::npos - || format.find("%S") != string::npos + if (format.find("%s") != string::npos + || format.find("%S") != string::npos || format.find("%T") != string::npos) { // refresh in 1 second @@ -939,7 +939,7 @@ int x = _bg_x != na ? _bg_x : X(); int width = _bg_width > 0 ? _bg_width : Width(); int y = _bg_y != na ? _bg_y : Y(); - + if (height == na) height = _bg_height > 0 ? _bg_height : Height(); @@ -1026,7 +1026,7 @@ green = (int)(255.0f * (1-percent) * 2.0f); } - render->rectangle(X(), y, xDone, height, + render->rectangle(X(), y, xDone, height, int2rgba(red, green, blue, alpha, rgba)); } @@ -1040,26 +1040,26 @@ render->text(tmp, _font.c_str(), _size, _align, - X(), + X(), y + (height-textHeight)/2, - int2rgba(255-red, 255-green, 255-blue, 0, rgba), - bgWidth, height, 1, no); + int2rgba(255-red, 255-green, 255-blue, 0, rgba), + bgWidth, height, 1, no); } else if (_text == "value") { int textHeight = _size * 5/3; t_rgba rgba; - sprintf(tmp, "%d%s / %d%s", + sprintf(tmp, "%d%s / %d%s", (int)current, _unit.c_str(), (int)total, _unit.c_str()); render->text(tmp, _font.c_str(), _size, _align, - X(), + X(), y + (height-textHeight)/2, int2rgba(255-red, 255-green, 255-blue, 0, rgba), - bgWidth, height, 1, no); + bgWidth, height, 1, no); } return success; @@ -1069,7 +1069,7 @@ { string p; int barHeight = BarHeight(); - + if (BarHeightUnit() == iuPercent) // BarHeight in % of row barHeight = (int)(((double)height/100) * (double)BarHeight()); @@ -1080,7 +1080,7 @@ if (_path != "" && text != "") { - evaluate(p, _path.c_str()); + evaluate(p, _path.c_str()); render->image(p.c_str(), X(), y+offset, Width(), barHeight, @@ -1089,7 +1089,7 @@ if (_path2 != "" && text == "") { - evaluate(p, _path2.c_str()); + evaluate(p, _path2.c_str()); render->image(p.c_str(), X(), y+offset, Width(), barHeight, @@ -1135,17 +1135,17 @@ p = trim(p); - // user scrolling + // user scrolling if (p != lastText || StartLine() < 0) { lastText = p; setStartLine(0); } - + if (StartLine() >= lineCount() - vLines) setStartLine(lineCount() - vLines); - + // first ... calc text width and real needed height int lineHeight = 0; @@ -1163,19 +1163,19 @@ lastHeight = min(lastHeight, Height()); // respect configured max height } - tell(3, "Dimension of '%s' %d/%d now %d/%d; position is %d/%d, need %d lines [%d,%d,%d]", + tell(3, "Dimension of '%s' %d/%d now %d/%d; position is %d/%d, need %d lines [%d,%d,%d]", _id.c_str(), Width(), Height(), - lastWidth, lastHeight, + lastWidth, lastHeight, X(), Y(), neededLines, lastWidth, width, lineHeight); // second ... check condition - + if (cDisplayItem::draw() != success) return fail; - + // third ... draw text - + return drawText(p.c_str(), lastY, lastHeight); } @@ -1235,7 +1235,7 @@ } if (!_fit || _aspect_ratio) - drawBackRect(); + drawBackRect(); // info @@ -1247,7 +1247,7 @@ } else { - tell(4, "Info: Image '%s' not found, falling back to '%s'", + tell(4, "Info: Image '%s' not found, falling back to '%s'", line, _path2.c_str()); drawImage(_path2.c_str()); @@ -1298,7 +1298,7 @@ } entry = (struct dirent*)malloc(direntSize); - + // iterate .. tell(0, "Info: Scanning %sdirectory '%s' for images", level ? "sub-" : "", path); @@ -1307,19 +1307,19 @@ { ImageFile f; - if (entry->d_type == DT_DIR) + if (entry->d_type == DT_DIR) { char* subPath; - + if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) continue; - + asprintf(&subPath, "%s/%s", path, entry->d_name); scanDir(subPath, level+1); - + free(subPath); } - + // check extension if ((ext = strrchr(res->d_name, '.'))) @@ -1330,7 +1330,7 @@ tell(0, "skipping file '%s' without extension", res->d_name); continue; } - + if (!strcasestr(extensions, ext)) { tell(0, "skipping file '%s' with extension '%s'", res->d_name, ext); @@ -1374,7 +1374,7 @@ { file->orientation = getJpegOrientation(file->path.c_str()); jpegDimensions(file->path.c_str(), file->width, file->height); - + file->landscape = (file->orientation < 5 && file->width < file->height) || (file->orientation >= 5 && file->width > file->height) ? no : yes; } @@ -1393,7 +1393,7 @@ if (getNext(current, file) != success) return done; - + if (!file->landscape) { static int n = 0; @@ -1418,7 +1418,7 @@ if (!file->landscape) { // one 'hochkant' image at the right side of the screen - + render->image(file->path.c_str(), width, Y(), width, Height(), yes, yes, _rotate ? file->orientation : 1); } else @@ -1427,15 +1427,15 @@ unsigned int height = (Height()-30) / 2; // two 'quer' images on the right side of the screen - + render->image(file->path.c_str(), width, 10, width, height, yes, yes, _rotate ? file->orientation : 1); do { getNext(next, file); - + } while (!file->landscape); - + render->image(file->path.c_str(), width+offset, height+20, width-offset, height, yes, yes, _rotate ? file->orientation : 1); } @@ -1443,13 +1443,13 @@ } else { - // quer -> show one image on screen + // quer -> show one image on screen drawImage(file->path.c_str()); } - + current++; - + return success; } @@ -1638,7 +1638,7 @@ string path = evaluatePath().c_str(); drawProgressBar(time(0) - vdrStatus->_presentEvent.StartTime(), - vdrStatus->_followingEvent.StartTime() + vdrStatus->_followingEvent.StartTime() - vdrStatus->_presentEvent.StartTime(), path); } @@ -1662,7 +1662,7 @@ if (evaluate(cur, _value.c_str()) == success && evaluate(tot, _total.c_str()) == success) { - tell(3, "Progress: '%s'/'%s' %d/%d", + tell(3, "Progress: '%s'/'%s' %d/%d", cur.c_str(), tot.c_str(), atoi(cur.c_str()), atoi(tot.c_str())); @@ -1701,7 +1701,7 @@ else if (_type.find("mem") == 0) { unsigned long total, used, free, cached; - + Sysinfo::memInfoMb(total, used, free, cached); if (forceDraw || used != lastUsedMem) @@ -1711,11 +1711,11 @@ lastUsedMem = used; // scale to given factor - + total /= f; used /= f; free /= f; - + if (_type == "memused") status = drawProgressBar(used, total, path); else if (_type == "memfree") @@ -1762,14 +1762,14 @@ if (forceDraw || usedM != lastUsedDisk) { int f = _factor / (1024*1024); // due to FreeDiskSpaceMB return MB - + lastUsedDisk = usedM; // scale to given factor - + usedM /= f; freeM /= f; - + status = drawProgressBar(usedM, freeM + usedM, path); } } @@ -1777,7 +1777,7 @@ { // return without scheduling next draw ! - tell(0, "Ignoring sysinfo item of unexpected type '%s'", + tell(0, "Ignoring sysinfo item of unexpected type '%s'", _type.c_str()); return fail; @@ -1792,7 +1792,7 @@ return fail; // #TODO - implement a force of all other items? - + if (_path != "") return cDisplayImage::draw(); @@ -1803,7 +1803,7 @@ { cGraphTFTDisplay::cTextList* list = 0; - if (!_lines) + if (!_lines) _lines = 1; string p; @@ -1813,7 +1813,7 @@ int maxRows = Height() / (lineHeight * _lines); cDisplayItem::draw(); - + // music or timer list ? if (strstr(_text.c_str(), "actTimers") || strstr(_text.c_str(), "actRunning") || strstr(_text.c_str(), "actPending")) @@ -1861,9 +1861,9 @@ y = Y() + lineHeight * r * _lines; - tell(4, "TextList, row %d '%s' at (%d/%d) with (%d) lines [%s]", + tell(4, "TextList, row %d '%s' at (%d/%d) with (%d) lines [%s]", r, p.c_str(), X(), y, _lines, _text.c_str()); - + drawText(p.c_str(), y, lineHeight * _lines, no); lastHeight += lineHeight * _lines; @@ -1955,7 +1955,7 @@ for (int i = 0; vdrStatus->_menu.charInTabs[i] != 0; i++) tabPercent[i] = (int)((100L / (double)total) * (double)vdrStatus->_menu.charInTabs[i]); - + tell(4, "Debug: tabs set to - %d:%d:%d:%d:%d", tabPercent[0], tabPercent[1], tabPercent[2], tabPercent[3], tabPercent[4]); @@ -1999,7 +1999,7 @@ selectedItem->Font().c_str(), selectedItem->Size(), selectedItem->Align(), x, Y() + ((i - vdrStatus->_menu.topRow) * lineHeight), - evaluateColor(selectedItem->Color().c_str(), rgba), + evaluateColor(selectedItem->Color().c_str(), rgba), width, lineHeightSelect, 1); @@ -2025,8 +2025,8 @@ render->image(path.c_str(), p->StaticX(), p->StaticY(), p->StaticWidth(), p->StaticHeight(), yes, yes); else if (p->StaticX()) - render->image(path.c_str(), - p->StaticX(), + render->image(path.c_str(), + p->StaticX(), Y() + (i - vdrStatus->_menu.topRow) * lineHeight - ((p->StaticHeight() - lineHeightSelect) /2), p->StaticWidth(), p->StaticHeight(), yes, yes); @@ -2094,8 +2094,8 @@ count = ((_menu_height-lineHeightSelect) / lineHeight) + 1; - // tell(0, "_menu->items.size(%d), _menu->topRow(%d), _menu->currentRow(%d)," - // "_menu->currentRowLast(%d), count(%d)", + // tell(0, "_menu->items.size(%d), _menu->topRow(%d), _menu->currentRow(%d)," + // "_menu->currentRowLast(%d), count(%d)", // _menu->items.size(), _menu->topRow, _menu->currentRow, _menu->currentRowLast, count); _menu->visibleRows = count; @@ -2111,10 +2111,10 @@ else if (_menu->currentRow < _menu->topRow || _menu->currentRow > _menu->topRow+count) _menu->topRow += step; // page up / page down - + if (_menu->topRow > (int)_menu->items.size()-count) _menu->topRow = _menu->items.size()-count; - + if (_menu->topRow < _menu->currentRow-count) _menu->topRow = _menu->currentRow-count; @@ -2149,12 +2149,12 @@ if (p->Number() > vdrStatus->_menu.items[i].tabCount) { - tell(0, "Warning: Skipping column number %d, only (%d) columns for row (%d) send by vdr", + tell(0, "Warning: Skipping column number %d, only (%d) columns for row (%d) send by vdr", Number(), vdrStatus->_menu.items[vdrStatus->_menu.drawingRow].tabCount, vdrStatus->_menu.drawingRow); - + continue; } - + if (!p->evaluateCondition()) continue; @@ -2163,7 +2163,7 @@ if (p->X() == na) p->setX(_menu->items[i].nextX); - if (!p->Width()) + if (!p->Width()) p->setWidth(Thms::theTheme->getWidth()-p->X()); _menu->items[i].nextX = p->X() + p->Width() + p->Spacing(); @@ -2178,8 +2178,8 @@ string path = Thms::theTheme->getPathFromImageMap(_menu->items[i].tabs[p->Number()-1].c_str()); if (path != "" && p->StaticX()) - render->image(path.c_str(), p->StaticX(), - p->StaticY() ? p->StaticY() : y - ((p->StaticHeight() - lineHeightSelect) /2), + render->image(path.c_str(), p->StaticX(), + p->StaticY() ? p->StaticY() : y - ((p->StaticHeight() - lineHeightSelect) /2), p->StaticWidth(), p->StaticHeight(), yes, yes); } @@ -2281,18 +2281,18 @@ path = p->channelLogoPath(_menu->items[i].tabs[p->Number()-1].c_str(), Format().c_str()); // draw column's image - + if (path.length()) { int barHeight = p->BarHeight(); - + if (p->BarHeightUnit() == iuPercent) // BarHeight in % of row barHeight = (int)(((double)lineHeight/100) * (double)p->BarHeight()); int offset = (lineHeight - barHeight) / 2; render->image(path.c_str(), p->X(), y+offset, - p->Width(), barHeight, + p->Width(), barHeight, p->Fit(), p->AspectRatio()); } } @@ -2310,7 +2310,7 @@ } else text = _menu->items[i].tabs[p->Number()-1].c_str(); - + tell(5, "draw '%s'", text.c_str()); p->drawText(text.c_str(), y, lineHeight, no); @@ -2323,7 +2323,7 @@ } //*************************************************************************** -// Menu Event Column +// Menu Event Column //*************************************************************************** int cDisplayMenuEventColumn::draw() @@ -2354,7 +2354,7 @@ lineHeightSelect = selectedItem->Height() ? selectedItem->Height() : selectedItem->Size() * 5/3; else lineHeightSelect = lineHeight; // assume normal height this time - + count = ((_menu_height-lineHeightSelect) / lineHeight) + 1; _menu->visibleRows = count; @@ -2370,10 +2370,10 @@ else if (_menu->currentRow < _menu->topRow || _menu->currentRow > _menu->topRow+count) _menu->topRow += step; // page up / page down - + if (_menu->topRow > (int)_menu->items.size()-count) _menu->topRow = _menu->items.size()-count; - + if (_menu->topRow < _menu->currentRow-count) _menu->topRow = _menu->currentRow-count; @@ -2398,7 +2398,7 @@ if (!p) continue; - + int y = p->MenuY() + ((i - _menu->topRow) * lineHeight) + afterSelect; tell(4, "colcount of row (%d) is (%d)", i, _menu->items[i].tabCount); @@ -2410,7 +2410,7 @@ { cDisplayItem* partingLine = section->getItemByKind(itemPartingLine); - // nur für die erste Spalte zeichnen, partingLine + // nur für die erste Spalte zeichnen, partingLine // soll alle Spalten abdecken! if (partingLine && Number() == 0) @@ -2419,7 +2419,7 @@ continue; } - // don't check condition for itPartingLine + // don't check condition for itPartingLine if (!p->evaluateCondition()) continue; @@ -2452,7 +2452,7 @@ // draw column's progress-bar tell(5, "progress [%d] of (%d%%)", i, current); - + if (current && p->Path() != "") { string path = evaluatePath().c_str(); @@ -2465,18 +2465,18 @@ path = p->evaluatePath(); // draw column's image - + if (path.length()) { int barHeight = p->BarHeight(); - + if (p->BarHeightUnit() == iuPercent) // BarHeight in % of row barHeight = (int)(((double)lineHeight/100) * (double)p->BarHeight()); int offset = (lineHeight - barHeight) / 2; render->image(path.c_str(), p->X(), y+offset, - p->Width(), barHeight, + p->Width(), barHeight, p->Fit(), p->AspectRatio()); } } @@ -2491,16 +2491,16 @@ if (evaluate(text, p->Text().c_str()) != success) text = ""; - + tell(5, "draw '%s'", text.c_str()); if (!p->Line()) - p->drawText(text.c_str(), + p->drawText(text.c_str(), y + (p->AlignV() ? (lineHeight-textHeight)/2 : 0), lineHeight, no); else - p->drawText(text.c_str(), - y + ((p->Line()-1)*textHeight), + p->drawText(text.c_str(), + y + ((p->Line()-1)*textHeight), textHeight, no); } } @@ -2577,7 +2577,7 @@ Y(), barWidth, Height() - (barHeightsLeftChannel[i] * Height() / 100), - rgba); + rgba); render->rectangle(X() + 2 * barWidth * i + barWidth, diff -Nru vdr-plugin-graphtftng-0.6.15/HISTORY.h vdr-plugin-graphtftng-0.6.16/HISTORY.h --- vdr-plugin-graphtftng-0.6.15/HISTORY.h 2016-11-24 14:31:23.000000000 +0000 +++ vdr-plugin-graphtftng-0.6.16/HISTORY.h 2017-03-05 15:47:41.000000000 +0000 @@ -6,8 +6,8 @@ * */ -#define _VERSION "0.6.15" -#define VERSION_DATE "24.11.2016" +#define _VERSION "0.6.16" +#define VERSION_DATE "13.02.2017" #define THEMEVERSION "0.4.1" #ifdef GIT_REV @@ -19,6 +19,9 @@ /* * ------------------------------------ +#109 Version 0.6.16, horchi 13.02.2017 + - change: porting to newer libavutil and g++ 6.2 + #108 Version 0.6.15, horchi 24.11.2016 - change: Changed default host of graphtft-fe to localhost diff -Nru vdr-plugin-graphtftng-0.6.15/imlibrenderer/fbrenderer/fbrenderer.c vdr-plugin-graphtftng-0.6.16/imlibrenderer/fbrenderer/fbrenderer.c --- vdr-plugin-graphtftng-0.6.15/imlibrenderer/fbrenderer/fbrenderer.c 2016-11-24 14:31:23.000000000 +0000 +++ vdr-plugin-graphtftng-0.6.16/imlibrenderer/fbrenderer/fbrenderer.c 2017-03-05 15:47:41.000000000 +0000 @@ -1,9 +1,9 @@ /** - * GraphTFT plugin for the Video Disk Recorder - * + * GraphTFT plugin for the Video Disk Recorder + * * fbrenderer.c - A plugin for the Video Disk Recorder * - * (c) 2004 Lars Tegeler, Sascha Volkenandt + * (c) 2004 Lars Tegeler, Sascha Volkenandt * * This code is distributed under the terms and conditions of the * GNU GENERAL PUBLIC LICENSE. See the file COPYING for details. @@ -31,7 +31,7 @@ // Object //*************************************************************************** -FbRenderer::FbRenderer(int x, int y, int width, int height, +FbRenderer::FbRenderer(int x, int y, int width, int height, string cfgPath, int utf, string thmPath) : ImlibRenderer(x, y, width, height, cfgPath, utf, thmPath) { @@ -45,7 +45,7 @@ } //*************************************************************************** -// +// //*************************************************************************** void FbRenderer::deinit() @@ -58,19 +58,25 @@ if (ioctl(fb_dev_fd, FBIOPUT_VSCREENINFO, &fb_orig_vinfo)) tell(4, "Can't reset original fb_var_screeninfo: %s", strerror(errno)); - + ::close(fb_dev_fd); - if (frame_buffer) + if (frame_buffer) munmap(frame_buffer, fb_size); initialized = no; } //*************************************************************************** -// +// //*************************************************************************** +#ifndef AV_PIX_FMT_RGB32 +# define AV_PIX_FMT_RGB32 PIX_FMT_RGB32 +# define AV_PIX_FMT_RGB24 PIX_FMT_RGB24 +# define AV_PIX_FMT_RGB565 PIX_FMT_RGB565 +#endif + int FbRenderer::init(int lazy) { asprintf(&fb_dev_name, "%s", devname); @@ -79,16 +85,16 @@ tell(4 , "Using framebuffer device '%s'", fb_dev_name); - if ((fb_dev_fd = open(fb_dev_name, O_RDWR)) == -1) + if ((fb_dev_fd = open(fb_dev_name, O_RDWR)) == -1) { - tell(0, "Opening framebuffer device '%s' faild, error was '%s'", + tell(0, "Opening framebuffer device '%s' faild, error was '%s'", fb_dev_name, strerror(errno)); return fail; } // read VScreen info from fb - if (ioctl(fb_dev_fd, FBIOGET_VSCREENINFO, &fb_vinfo)) + if (ioctl(fb_dev_fd, FBIOGET_VSCREENINFO, &fb_vinfo)) { tell(0, "Can't get VSCREENINFO, %s", strerror(errno)); return fail; @@ -107,12 +113,12 @@ // write VScreen info - if (ioctl(fb_dev_fd, FBIOPUT_VSCREENINFO, &fb_vinfo)) + if (ioctl(fb_dev_fd, FBIOPUT_VSCREENINFO, &fb_vinfo)) tell(0, "Can't put VSCREENINFO, %s", strerror(errno)); // read VScreen info from fb (again) this will be the 'accepted' resolutions from the fb - if (ioctl(fb_dev_fd, FBIOGET_VSCREENINFO, &fb_vinfo)) + if (ioctl(fb_dev_fd, FBIOGET_VSCREENINFO, &fb_vinfo)) { tell(0, "Can't get VSCREENINFO, %s", strerror(errno)); return fail; @@ -120,13 +126,13 @@ // read VScreen info from fb - if (ioctl(fb_dev_fd, FBIOGET_FSCREENINFO, &fb_finfo)) + if (ioctl(fb_dev_fd, FBIOGET_FSCREENINFO, &fb_finfo)) { tell(0, "Can't get FSCREENINFO, %s", strerror(errno)); return fail; } - tell(0, "fb settings are (%d/%d) with a color depth of (%d)", + tell(0, "fb settings are (%d/%d) with a color depth of (%d)", fb_vinfo.xres, fb_vinfo.yres, fb_vinfo.bits_per_pixel); dspWidth = fb_vinfo.xres; @@ -137,11 +143,11 @@ fb_size = fb_finfo.smem_len; frame_buffer = 0; - switch (fb_vinfo.bits_per_pixel) - { - case 32: tell(4, "FB using 32 bit depth"); fb_type = PIX_FMT_RGB32; break; - case 24: tell(4, "FB using 24 bit depth"); fb_type = PIX_FMT_RGB24; break; - case 16: tell(4, "FB using 16 bit depth"); fb_type = PIX_FMT_RGB565; break; + switch (fb_vinfo.bits_per_pixel) + { + case 32: tell(4, "FB using 32 bit depth"); fb_type = AV_PIX_FMT_RGB32; break; + case 24: tell(4, "FB using 24 bit depth"); fb_type = AV_PIX_FMT_RGB24; break; + case 16: tell(4, "FB using 16 bit depth"); fb_type = AV_PIX_FMT_RGB565; break; default: tell(4, "FB color depth not supported -> %i bits per pixel", fb_vinfo.bits_per_pixel); } @@ -160,7 +166,7 @@ } //*************************************************************************** -// +// //*************************************************************************** #ifndef use_asm @@ -186,7 +192,7 @@ " movl fb_vinfo,%%eax \n\t" // Height " movl fb_vinfo+4,%%ecx \n\t" // width " imul %%eax,%%ecx \n\t" // mul - " movl frame_buffer,%%edi \n\t" // fbdev mmap'd buffer + " movl frame_buffer,%%edi \n\t" // fbdev mmap'd buffer " movl 8(%%ebp), %%esi \n\t" // Imlib2 buffer (frame) " rep movsl \n\t" // move all longs at a time (4 bytes) @@ -206,7 +212,7 @@ #endif //*************************************************************************** -// +// //*************************************************************************** #ifndef use_asm @@ -217,9 +223,9 @@ x = fb_vinfo.xres*4; - for (i = 0; i < fb_vinfo.yres; ++i) + for (i = 0; i < fb_vinfo.yres; ++i) { - for (a=0, b=0, c=0; a < fb_vinfo.xres; ++a, b+=3, c+=4) + for (a=0, b=0, c=0; a < fb_vinfo.xres; ++a, b+=3, c+=4) { frame_buffer[out_offset + b +0] = frame[in_offset + c +0]; frame_buffer[out_offset + b +1] = frame[in_offset + c +1]; @@ -246,18 +252,18 @@ " pushl %%ecx \n\t" " pushl %%edx \n\t" - " movl fb_vinfo,%%eax \n\t" // fbdev mmap'd buffer - " movl fb_vinfo+4,%%edx \n\t" // fbdev mmap'd buffer - " imul %%eax,%%edx \n\t" // fbdev mmap'd buffer + " movl fb_vinfo,%%eax \n\t" // fbdev mmap'd buffer + " movl fb_vinfo+4,%%edx \n\t" // fbdev mmap'd buffer + " imul %%eax,%%edx \n\t" // fbdev mmap'd buffer " movl 8(%%ebp), %%esi \n\t" // Imlib2 buffer (frame) - " movl frame_buffer,%%edi \n\t" // fbdev mmap'd buffer + " movl frame_buffer,%%edi \n\t" // fbdev mmap'd buffer " .lop: \n\t" - " leal 3,%%ecx \n\t" // fbdev mmap'd buffer - " rep movsb \n\t" // move 3 bytes at a time + " leal 3,%%ecx \n\t" // fbdev mmap'd buffer + " rep movsb \n\t" // move 3 bytes at a time " inc %%esi \n\t" // increment one byte, bypass Alpha - " dec %%edx \n\t" // dec counter - " jnz .lop \n\t" // loop :) + " dec %%edx \n\t" // dec counter + " jnz .lop \n\t" // loop :) " popl %%edx \n\t" " popl %%ecx \n\t" @@ -285,7 +291,7 @@ static unsigned short* tmp = 0; static unsigned int size = fb_vinfo.yres * fb_vinfo.xres; static unsigned short* fb = (unsigned short*)frame_buffer; - + if (!tmp) tmp = (unsigned short*)calloc(sizeof(unsigned short), size); @@ -296,9 +302,9 @@ unsigned short v; unsigned int out_offset = 0, in_offset = 0; - for (y = 0; y < fb_vinfo.yres; y++) + for (y = 0; y < fb_vinfo.yres; y++) { - for (x = 0; x < fb_vinfo.xres; x++, out_offset++, in_offset+=4) + for (x = 0; x < fb_vinfo.xres; x++, out_offset++, in_offset+=4) { R = (frame[in_offset + 2] >> 3) & 0x1f; G = (frame[in_offset + 1] >> 2) & 0x3f; @@ -338,8 +344,8 @@ } UINT8* dataptr = (UINT8*)imlib_image_get_data_for_reading_only(); - - tell(4, "copy image with a depth of (%d) to framebuffer", + + tell(4, "copy image with a depth of (%d) to framebuffer", fb_vinfo.bits_per_pixel); switch (fb_vinfo.bits_per_pixel) @@ -347,7 +353,7 @@ case 16 : fbdev_draw_16(dataptr, force); break; case 24 : fbdev_draw_24(dataptr, force); break; case 32 : fbdev_draw_32(dataptr, force); break; - + default : tell(0, "fbdevout.c: color depth not supported " "-> %i bits per pixel", fb_vinfo.bits_per_pixel); }