Skip to content

Commit 821a01d

Browse files
author
Markus Ehrnsperger
committed
0001-Update-for-VDR-2.6_kamel5
1 parent 22ffee2 commit 821a01d

16 files changed

+149
-56
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ FFMDIR = /usr/include
1616
#WITH_TOUCH = 1
1717

1818
# like the X renderer to display directly on local xorg (grpahtft-fe not needed)
19-
WITH_X = 1
19+
#WITH_X = 1
2020

2121
# compile the graphtft-fe an the therefor tcp communication
2222
WITH_TCPCOM = 1
@@ -112,7 +112,7 @@ endif
112112
DEFINES += -D__STL_CONFIG_H
113113

114114
LIBS += $(shell pkg-config libexif --libs 2>/dev/null)
115-
LIBS += $(shell imlib2-config --libs)
115+
LIBS += $(shell pkg-config imlib2 --libs 2>/dev/null)
116116
LIBS += $(shell pkg-config libgtop-2.0 --libs 2>/dev/null)
117117

118118
ifdef WITH_TCPCOM

common.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ const char* Str::toCase(Case cs, char* str)
517517

518518
for (int ps = 0; ps < lenSrc; ps += csSrc)
519519
{
520-
csSrc = max(mblen(&s[ps], lenSrc-ps), 1);
520+
csSrc = std::max(mblen(&s[ps], lenSrc-ps), 1);
521521

522522
if (csSrc == 1)
523523
s[ps] = cs == cUpper ? toupper(s[ps]) : tolower(s[ps]);
@@ -697,7 +697,7 @@ int clen(const char* s)
697697
int len = 0;
698698

699699
for (int bp = 0; bp < blen; bp += cs, len++)
700-
cs = max(mblen(&s[bp], blen-bp), 1);
700+
cs = std::max(mblen(&s[bp], blen-bp), 1);
701701

702702
return len;
703703
}

common.h

+2-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* common.h - A plugin for the Video Disk Recorder
55
*
66
* (c) 2004 Lars Tegeler, Sascha Volkenandt
7-
* (c) 2006-2014 Jörg Wendel
7+
* (c) 2006-2014 J�rg Wendel
88
*
99
* This code is distributed under the terms and conditions of the
1010
* GNU GENERAL PUBLIC LICENSE. See the file COPYING for details.
@@ -23,17 +23,14 @@
2323
#include <string.h>
2424
#include <iconv.h>
2525
#include <stdint.h>
26+
#include <time.h>
2627

2728
class MemoryStruct;
2829

2930
//***************************************************************************
3031
//
3132
//***************************************************************************
3233

33-
// since we compile with __STL_CONFIG_H
34-
35-
template<class T> inline T min(T a, T b) { return a <= b ? a : b; }
36-
template<class T> inline T max(T a, T b) { return a >= b ? a : b; }
3734

3835
using std::string;
3936

comthread.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ void ComThread::Action()
163163
for (unsigned int i = 0; i < clients.size(); i++)
164164
{
165165
FD_SET(clients[i].channel->getHandle(), &readSet);
166-
maxFD = max(maxFD, clients[i].channel->getHandle());
166+
maxFD = std::max(maxFD, clients[i].channel->getHandle());
167167
}
168168

169169
_mutex.Unlock();

display.c

+5-6
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,7 @@ void cGraphTFTDisplay::updateTimers()
818818
_timers.sort();
819819

820820
triggerTimerUpdate = no;
821+
821822
updateGroup(groupRecording);
822823
broadcast();
823824
}
@@ -861,9 +862,6 @@ void cGraphTFTDisplay::updateChannel()
861862

862863
void cGraphTFTDisplay::finalizeItemList()
863864
{
864-
needLock = yes;
865-
cMutexLock lock(&_mutex);
866-
867865
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
868866
const cChannels* channels = 0;
869867
const cRecordings* recordings = 0;
@@ -891,6 +889,8 @@ void cGraphTFTDisplay::finalizeItemList()
891889
cRecordings* recordings = &Recordings;
892890
#endif
893891

892+
cMutexLock lock(&_mutex);
893+
needLock = yes;
894894
for (string::size_type i = 0; i < _menu.items.size(); i++)
895895
{
896896
if (!_menu.items[i].event.isEmpty())
@@ -1526,10 +1526,9 @@ void cGraphTFTDisplay::updateProgram()
15261526

15271527
if (channel)
15281528
{
1529-
tell(5, "updateProgram for channel '%s'", channel->Name());
1530-
1531-
needLock = yes;
1529+
tell(1, "updateProgram for channel '%s'", channel->Name());
15321530
cMutexLock lock(&_mutex);
1531+
needLock = yes;
15331532

15341533
// const cEvent* present = _presentEvent;
15351534
// const cEvent* following = _followingEvent;

display.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@
2222
#include <vector>
2323
#include <algorithm>
2424

25-
#include <vdr/tools.h>
26-
#include <vdr/thread.h>
27-
#include <vdr/status.h>
28-
#include <vdr/skins.h>
29-
3025
#include <common.h>
3126
#include <comthread.h>
3227
#include <touchthread.h>
@@ -37,6 +32,11 @@
3732
# include "../vdr-plugin-epg2vdr/service.h"
3833
#endif
3934

35+
#include <vdr/tools.h>
36+
#include <vdr/thread.h>
37+
#include <vdr/status.h>
38+
#include <vdr/skins.h>
39+
4040
using std::string;
4141
using std::vector;
4242

@@ -125,7 +125,7 @@ class cEventCopy
125125
initialized = no;
126126
return;
127127
}
128-
128+
129129
setEventID(event->EventID());
130130
setChannelID(event->ChannelID());
131131

dspitems.c

+10-10
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ int cDisplayItem::drawText(const char* text, int y,
626626
int lines = height / lineHeight > 0 ? height / lineHeight : 1;
627627

628628
if (_lines > 0)
629-
lines = min(lines, _lines);
629+
lines = std::min(lines, _lines);
630630

631631
int visibleWidth = width*lines;
632632

@@ -727,7 +727,7 @@ int cDisplayItem::drawText(const char* text, int y,
727727
for (ps = 0; ps < blen; ps += cs)
728728
{
729729
i++;
730-
cs = max(mblen(&text[ps], blen-ps), 1);
730+
cs = std::max(mblen(&text[ps], blen-ps), 1);
731731

732732
if (i >= marquee_idx)
733733
break;
@@ -1160,7 +1160,7 @@ int cDisplayText::draw()
11601160
{
11611161
neededLines = render->lineCount(p.c_str(), _font.c_str(), _size, width);
11621162
lastHeight = neededLines * lineHeight;
1163-
lastHeight = min(lastHeight, Height()); // respect configured max height
1163+
lastHeight = std::min(lastHeight, Height()); // respect configured max height
11641164
}
11651165

11661166
tell(3, "Dimension of '%s' %d/%d now %d/%d; position is %d/%d, need %d lines [%d,%d,%d]",
@@ -1928,7 +1928,7 @@ int cDisplayMenu::draw()
19281928
vdrStatus->_menu.lineHeightSelected = lineHeightSelect;
19291929

19301930
if (vdrStatus->_menu.topRow < 0)
1931-
vdrStatus->_menu.topRow = max(0, vdrStatus->_menu.currentRow - count/2); // initial
1931+
vdrStatus->_menu.topRow = std::max(0, vdrStatus->_menu.currentRow - count/2); // initial
19321932
else if (vdrStatus->_menu.currentRow == vdrStatus->_menu.topRow-1)
19331933
vdrStatus->_menu.topRow = vdrStatus->_menu.currentRow; // up
19341934
else if (vdrStatus->_menu.currentRow == vdrStatus->_menu.topRow+count)
@@ -1962,7 +1962,7 @@ int cDisplayMenu::draw()
19621962

19631963
// loop over visible rows ...
19641964

1965-
for (int i = vdrStatus->_menu.topRow; i < min((int)vdrStatus->_menu.items.size(),
1965+
for (int i = vdrStatus->_menu.topRow; i < std::min((int)vdrStatus->_menu.items.size(),
19661966
vdrStatus->_menu.topRow + count); ++i)
19671967
{
19681968
cDisplayItem* p = i == vdrStatus->_menu.currentRow ? selectedItem : this;
@@ -2103,7 +2103,7 @@ int cDisplayMenuColumn::draw()
21032103
_menu->lineHeightSelected = lineHeightSelect;
21042104

21052105
if (_menu->topRow < 0)
2106-
_menu->topRow = max(0, _menu->currentRow - count/2); // initial
2106+
_menu->topRow = std::max(0, _menu->currentRow - count/2); // initial
21072107
else if (_menu->currentRow == _menu->topRow-1)
21082108
_menu->topRow = _menu->currentRow; // up
21092109
else if (_menu->currentRow == _menu->topRow+count)
@@ -2128,7 +2128,7 @@ int cDisplayMenuColumn::draw()
21282128

21292129
// paint the visible rows for this column
21302130

2131-
for (int i = _menu->topRow; i < min((int)_menu->items.size(), _menu->topRow + count); ++i)
2131+
for (int i = _menu->topRow; i < std::min((int)_menu->items.size(), _menu->topRow + count); ++i)
21322132
{
21332133
cDisplayItem* p = this;
21342134

@@ -2362,7 +2362,7 @@ int cDisplayMenuEventColumn::draw()
23622362
_menu->lineHeightSelected = lineHeightSelect;
23632363

23642364
if (_menu->topRow < 0)
2365-
_menu->topRow = max(0, _menu->currentRow - count/2); // initial
2365+
_menu->topRow = std::max(0, _menu->currentRow - count/2); // initial
23662366
else if (_menu->currentRow == _menu->topRow-1)
23672367
_menu->topRow = _menu->currentRow; // up
23682368
else if (_menu->currentRow == _menu->topRow+count)
@@ -2387,7 +2387,7 @@ int cDisplayMenuEventColumn::draw()
23872387

23882388
// paint the visible rows for this column
23892389

2390-
for (int i = _menu->topRow; vdrStatus->_eventsReady && i < min((int)_menu->items.size(), _menu->topRow + count); ++i)
2390+
for (int i = _menu->topRow; vdrStatus->_eventsReady && i < std::min((int)_menu->items.size(), _menu->topRow + count); ++i)
23912391
{
23922392
if (i == na)
23932393
tell(0, "XXXXXXXXXXXXXXXXXXXXXXXXX");
@@ -2492,7 +2492,7 @@ int cDisplayMenuEventColumn::draw()
24922492
if (evaluate(text, p->Text().c_str()) != success)
24932493
text = "";
24942494

2495-
tell(5, "draw '%s'", text.c_str());
2495+
tell(1, "--> draw '%s'", text.c_str());
24962496

24972497
if (!p->Line())
24982498
p->drawText(text.c_str(),

graphtft-fe/thread.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ cCondWait::~cCondWait()
5757
void cCondWait::SleepMs(int TimeoutMs)
5858
{
5959
cCondWait w;
60-
w.Wait(max(TimeoutMs, 3)); // making sure the time is >2ms to avoid a possible busy wait
60+
w.Wait(std::max(TimeoutMs, 3)); // making sure the time is >2ms to avoid a possible busy wait
6161
}
6262

6363
bool cCondWait::Wait(int TimeoutMs)

graphtftng.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111
*
1212
**/
1313

14-
#include <vdr/config.h>
1514
#include <theme.h>
1615
#include <getopt.h>
1716

1817
#include <service.h>
1918
#include <graphtftng.h>
2019
#include <span.h>
2120

21+
#include <vdr/config.h>
22+
2223
//***************************************************************************
2324
// cGraphTFTMenu
2425
//***************************************************************************
@@ -266,6 +267,7 @@ bool cPluginGraphTFT::Start()
266267
if (display->init(device, port, startDetached) != success)
267268
{
268269
tell(0, "Error: Initializing failed, aborting!");
270+
dsyslog ("GraphTFTNG: Initializing failed, aborting!");
269271

270272
return 0;
271273
}

imlibrenderer/imlibrenderer.c

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
#include <jpeglib.h>
3030

31+
//#include "Imlib2.h"
3132
#include "imlibrenderer.h"
3233
#include "theme.h"
3334
#include "common.h"

imlibrenderer/imlibrenderer.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@
1414
#ifndef __GTFT_IMLIBRENDERER_HPP
1515
#define __GTFT_IMLIBRENDERER_HPP
1616

17+
#include <Imlib2.h>
1718
#include "renderer.h"
1819

1920
#ifndef WITH_X
2021
# define X_DISPLAY_MISSING
2122
#endif
2223

23-
#include <Imlib2.h>
24-
2524
#undef Status
2625

2726
//***************************************************************************

scraper2vdr.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
// Includes
1515
//***************************************************************************
1616

17-
#include <vdr/plugin.h>
18-
1917
#include <common.h>
2018
#include <scraper2vdr.h>
2119

20+
#include <vdr/plugin.h>
21+
2222
//***************************************************************************
2323
// Get Scraper Plugin
2424
//***************************************************************************
@@ -73,7 +73,7 @@ int getScraperMediaPath(const cEventCopy* event, const cRecording* recording,
7373

7474
if (!schedules ||
7575
!(s = (cSchedule*)schedules->GetSchedule(event->ChannelID())) ||
76-
!(evt = s->GetEvent(event->EventID())))
76+
!(evt = s->GetEventById(event->EventID())))
7777
{
7878
tell(0, "Error, can't get lock on schedules or cant find event, aborting!");
7979
return fail;

status.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ void cGraphTFTDisplay::OsdEventItem(const cEvent* Event, const char* Text,
344344
{
345345
tell(3, "OsdEventItem() Force update due to index/count (%d/%d)", Index, Count);
346346

347-
triggerFinalizeItemList = yes;
347+
// triggerFinalizeItemList = yes;
348348
updateGroup(groupMenu);
349349
broadcast();
350350
}

theme.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ int VariableProvider::evaluate(string& buf, const char* var)
162162
// found expression
163163

164164
e--;
165-
len = min((int)(e-s), 1000);
165+
len = std::min((int)(e-s), 1000);
166166

167167
if (len < 1)
168168
{

0 commit comments

Comments
 (0)