summaryrefslogtreecommitdiff
path: root/PLUGINS/src
diff options
context:
space:
mode:
Diffstat (limited to 'PLUGINS/src')
-rw-r--r--PLUGINS/src/dvbhddevice/HISTORY4
-rw-r--r--PLUGINS/src/dvbhddevice/Makefile4
-rw-r--r--PLUGINS/src/dvbhddevice/dvbhddevice.c4
-rw-r--r--PLUGINS/src/dvbhddevice/dvbhdffdevice.c4
-rw-r--r--PLUGINS/src/dvbhddevice/setup.c46
-rw-r--r--PLUGINS/src/dvbsddevice/dvbsdffdevice.c4
-rw-r--r--PLUGINS/src/dvbsddevice/dvbsdffdevice.h4
-rw-r--r--PLUGINS/src/osddemo/HISTORY5
-rw-r--r--PLUGINS/src/osddemo/README5
-rw-r--r--PLUGINS/src/osddemo/osddemo.c144
-rwxr-xr-xPLUGINS/src/pictures/pic2mpg8
-rwxr-xr-xPLUGINS/src/pictures/pic2mpg-sd2
-rw-r--r--PLUGINS/src/servicedemo/svccli.c4
-rw-r--r--PLUGINS/src/servicedemo/svcsvr.c4
14 files changed, 183 insertions, 59 deletions
diff --git a/PLUGINS/src/dvbhddevice/HISTORY b/PLUGINS/src/dvbhddevice/HISTORY
index ceee7da..99d23bb 100644
--- a/PLUGINS/src/dvbhddevice/HISTORY
+++ b/PLUGINS/src/dvbhddevice/HISTORY
@@ -55,3 +55,7 @@ VDR Plugin 'dvbhddevice' Revision History
2013-01-24: Version 0.0.7
- Fixed cHdffOsd::SetAreas() (didn't clear the OSD).
+
+2013-02-16: Version 0.0.8
+
+- Added missing $(LDFLAGS) to the Makefile (thanks to Ville Skyttä).
diff --git a/PLUGINS/src/dvbhddevice/Makefile b/PLUGINS/src/dvbhddevice/Makefile
index a24a55a..99d05a6 100644
--- a/PLUGINS/src/dvbhddevice/Makefile
+++ b/PLUGINS/src/dvbhddevice/Makefile
@@ -1,7 +1,7 @@
#
# Makefile for a Video Disk Recorder plugin
#
-# $Id: Makefile 1.22 2013/01/12 13:45:01 kls Exp $
+# $Id: Makefile 1.23 2013/02/16 10:34:53 kls Exp $
# The official name of this plugin.
# This name will be used in the '-P...' option of VDR to load the plugin.
@@ -103,7 +103,7 @@ install-i18n: $(I18Nmsgs)
$(SOFILE): $(OBJS) libhdffcmd
@$(MAKE) --no-print-directory -C libhdffcmd all
- $(CXX) $(CXXFLAGS) -shared $(OBJS) libhdffcmd/libhdffcmd.a -o $@
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) libhdffcmd/libhdffcmd.a -o $@
install-lib: $(SOFILE)
install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION)
diff --git a/PLUGINS/src/dvbhddevice/dvbhddevice.c b/PLUGINS/src/dvbhddevice/dvbhddevice.c
index 4d755f6..004bb1f 100644
--- a/PLUGINS/src/dvbhddevice/dvbhddevice.c
+++ b/PLUGINS/src/dvbhddevice/dvbhddevice.c
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: dvbhddevice.c 1.21 2013/01/29 08:59:36 kls Exp $
+ * $Id: dvbhddevice.c 1.22 2013/02/16 10:35:42 kls Exp $
*/
#include <vdr/plugin.h>
@@ -12,7 +12,7 @@
#include "menu.h"
#include "setup.h"
-static const char *VERSION = "0.0.7";
+static const char *VERSION = "0.0.8";
static const char *DESCRIPTION = trNOOP("HD Full Featured DVB device");
static const char *MAINMENUENTRY = "dvbhddevice";
diff --git a/PLUGINS/src/dvbhddevice/dvbhdffdevice.c b/PLUGINS/src/dvbhddevice/dvbhdffdevice.c
index f25d0b7..e91d77f 100644
--- a/PLUGINS/src/dvbhddevice/dvbhdffdevice.c
+++ b/PLUGINS/src/dvbhddevice/dvbhdffdevice.c
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: dvbhdffdevice.c 1.48 2013/01/29 08:59:36 kls Exp $
+ * $Id: dvbhdffdevice.c 1.49 2013/02/17 14:10:06 kls Exp $
*/
#include <stdint.h>
@@ -27,7 +27,7 @@
static uchar *YuvToJpeg(uchar *Mem, int Width, int Height, int &Size, int Quality);
-// --- cDvbHdFfDevice ----------------------------------------------------------
+// --- cDvbHdFfDevice --------------------------------------------------------
int cDvbHdFfDevice::devHdffOffset = -1;
diff --git a/PLUGINS/src/dvbhddevice/setup.c b/PLUGINS/src/dvbhddevice/setup.c
index fcc1648..45783a3 100644
--- a/PLUGINS/src/dvbhddevice/setup.c
+++ b/PLUGINS/src/dvbhddevice/setup.c
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: setup.c 1.18 2012/11/15 09:20:50 kls Exp $
+ * $Id: setup.c 1.19 2013/02/17 13:25:17 kls Exp $
*/
#include "setup.h"
@@ -436,26 +436,26 @@ void cHdffSetupPage::Store(void)
eOSState cHdffSetupPage::ProcessKey(eKeys key)
{
- eOSState state = cMenuSetupPage::ProcessKey(key);
-
- if (state == osContinue)
- {
- cOsdItem * item;
- switch (key)
- {
- case kLeft:
- case kRight:
- item = Get(Current());
- if (item == mTvFormatItem)
- {
- mVideoConversion = 0;
- BuildVideoConversionItem();
- Display();
- }
- break;
- default:
- break;
- }
- }
- return state;
+ eOSState state = cMenuSetupPage::ProcessKey(key);
+
+ if (state == osContinue)
+ {
+ cOsdItem * item;
+ switch (key)
+ {
+ case kLeft:
+ case kRight:
+ item = Get(Current());
+ if (item == mTvFormatItem)
+ {
+ mVideoConversion = 0;
+ BuildVideoConversionItem();
+ Display();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ return state;
}
diff --git a/PLUGINS/src/dvbsddevice/dvbsdffdevice.c b/PLUGINS/src/dvbsddevice/dvbsdffdevice.c
index f9ff5b3..4e98cdd 100644
--- a/PLUGINS/src/dvbsddevice/dvbsdffdevice.c
+++ b/PLUGINS/src/dvbsddevice/dvbsdffdevice.c
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: dvbsdffdevice.c 2.34 2013/01/25 10:48:29 kls Exp $
+ * $Id: dvbsdffdevice.c 2.35 2013/02/17 13:16:18 kls Exp $
*/
#include "dvbsdffdevice.h"
@@ -795,5 +795,5 @@ bool cDvbSdFfDeviceProbe::Probe(int Adapter, int Frontend)
return true;
}
}
- return false;
+ return false;
}
diff --git a/PLUGINS/src/dvbsddevice/dvbsdffdevice.h b/PLUGINS/src/dvbsddevice/dvbsdffdevice.h
index dc55148..bbf2ec2 100644
--- a/PLUGINS/src/dvbsddevice/dvbsdffdevice.h
+++ b/PLUGINS/src/dvbsddevice/dvbsdffdevice.h
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: dvbsdffdevice.h 2.15 2013/01/25 10:43:14 kls Exp $
+ * $Id: dvbsdffdevice.h 2.16 2013/02/17 13:16:29 kls Exp $
*/
#ifndef __DVBSDFFDEVICE_H
@@ -112,5 +112,5 @@ public:
void SetOutputOnly(bool On) { outputOnly = On; }
virtual bool Probe(int Adapter, int Frontend);
};
-
+
#endif //__DVBSDFFDEVICE_H
diff --git a/PLUGINS/src/osddemo/HISTORY b/PLUGINS/src/osddemo/HISTORY
index e8afa4b..4f4ace3 100644
--- a/PLUGINS/src/osddemo/HISTORY
+++ b/PLUGINS/src/osddemo/HISTORY
@@ -46,3 +46,8 @@ VDR Plugin 'osddemo' Revision History
2013-01-12: Version 0.2.5
- Adapted Makefile to changes introduced in recent VDR versions.
+
+2013-02-13: Version 0.3.0
+
+- Added demos of the DrawEllipse() and DrawSlope() function (press '1' or '2',
+ respectively).
diff --git a/PLUGINS/src/osddemo/README b/PLUGINS/src/osddemo/README
index 90ae295..bd9aa8b 100644
--- a/PLUGINS/src/osddemo/README
+++ b/PLUGINS/src/osddemo/README
@@ -26,4 +26,9 @@ pixmap is displayed, it can be moved around with the Up, Down, Left
and Right buttons. The Red button turns off the "Tiled Pixmaps"
display, and the Green button toggles the color display.
+In both variants of the demo, pressing the '1' key displays all
+possible ellipses that can be drawn with the DrawEllipse() function,
+while pressing the '2' key shows all possible slopes the DrawSlope()
+function can draw.
+
Press Ok to close the window.
diff --git a/PLUGINS/src/osddemo/osddemo.c b/PLUGINS/src/osddemo/osddemo.c
index 2fbbb07..0d289e8 100644
--- a/PLUGINS/src/osddemo/osddemo.c
+++ b/PLUGINS/src/osddemo/osddemo.c
@@ -3,16 +3,93 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: osddemo.c 2.8 2013/01/12 14:12:23 kls Exp $
+ * $Id: osddemo.c 2.10 2013/02/17 13:16:34 kls Exp $
*/
#include <vdr/osd.h>
#include <vdr/plugin.h>
-static const char *VERSION = "0.2.5";
+static const char *VERSION = "0.3.0";
static const char *DESCRIPTION = "Demo of arbitrary OSD setup";
static const char *MAINMENUENTRY = "Osd Demo";
+// --- DrawEllipses ----------------------------------------------------------
+
+void DrawEllipse(cOsd *Osd, int x1, int y1, int x2, int y2, int Quadrants)
+{
+ Osd->DrawRectangle(x1 + 2, y1 + 2, x2 - 2, y2 - 2, clrGreen);
+ Osd->DrawEllipse(x1 + 3, y1 + 3, x2 - 3, y2 - 3, clrRed, Quadrants);
+}
+
+void DrawEllipses(cOsd *Osd)
+{
+ int xa = 0;
+ int ya = 0;
+ int xb = Osd->Width() - 1;
+ int yb = Osd->Height() - 1;
+ int x0 = xa;
+ int x5 = xb;
+ int x1 = x0 + (xb - xa) / 5;
+ int x2 = x0 + (xb - xa) * 2 / 5;
+ int x3 = x0 + (xb - xa) * 3 / 5;
+ int x4 = x0 + (xb - xa) * 4 / 5;
+ int y0 = ya;
+ int y4 = yb;
+ int y2 = (y0 + y4) / 2;
+ int y1 = (y0 + y2) / 2;
+ int y3 = (y2 + y4) / 2;
+ Osd->DrawRectangle(xa, ya, xb, yb, clrGray50);
+ DrawEllipse(Osd, x4, y0, x5, y4, 0);
+ DrawEllipse(Osd, x2, y1, x3, y2, 1);
+ DrawEllipse(Osd, x1, y1, x2, y2, 2);
+ DrawEllipse(Osd, x1, y2, x2, y3, 3);
+ DrawEllipse(Osd, x2, y2, x3, y3, 4);
+ DrawEllipse(Osd, x3, y1, x4, y3, 5);
+ DrawEllipse(Osd, x1, y0, x3, y1, 6);
+ DrawEllipse(Osd, x0, y1, x1, y3, 7);
+ DrawEllipse(Osd, x1, y3, x3, y4, 8);
+ DrawEllipse(Osd, x3, y0, x4, y1, -1);
+ DrawEllipse(Osd, x0, y0, x1, y1, -2);
+ DrawEllipse(Osd, x0, y3, x1, y4, -3);
+ DrawEllipse(Osd, x3, y3, x4, y4, -4);
+ Osd->Flush();
+}
+
+// --- DrawSlopes ------------------------------------------------------------
+
+void DrawSlope(cOsd *Osd, int x1, int y1, int x2, int y2, int Type)
+{
+ Osd->DrawRectangle(x1 + 2, y1 + 2, x2 - 2, y2 - 2, clrGreen);
+ Osd->DrawSlope(x1 + 3, y1 + 3, x2 - 3, y2 - 3, clrRed, Type);
+}
+
+void DrawSlopes(cOsd *Osd)
+{
+ int xa = 0;
+ int ya = 0;
+ int xb = Osd->Width() - 1;
+ int yb = Osd->Height() - 1;
+ int x0 = xa;
+ int x4 = xb;
+ int x2 = (x0 + x4) / 2;
+ int x1 = (x0 + x2) / 2;
+ int x3 = (x2 + x4) / 2;
+ int y0 = ya;
+ int y3 = yb;
+ int y2 = (y0 + y3) / 2;
+ int y1 = (y0 + y2) / 2;
+ Osd->DrawRectangle(xa, ya, xb, yb, clrGray50);
+ DrawSlope(Osd, x0, y0, x2, y1, 0);
+ DrawSlope(Osd, x2, y0, x4, y1, 1);
+ DrawSlope(Osd, x0, y1, x2, y2, 2);
+ DrawSlope(Osd, x2, y1, x4, y2, 3);
+ DrawSlope(Osd, x0, y2, x1, y3, 4);
+ DrawSlope(Osd, x1, y2, x2, y3, 5);
+ DrawSlope(Osd, x2, y2, x3, y3, 6);
+ DrawSlope(Osd, x3, y2, x4, y3, 7);
+ Osd->Flush();
+}
+
// --- cLineGame -------------------------------------------------------------
class cLineGame : public cOsdObject {
@@ -31,7 +108,7 @@ public:
cLineGame::cLineGame(void)
{
osd = NULL;
- x = y = 50;
+ x = y = 0;
color = clrRed;
}
@@ -42,12 +119,23 @@ cLineGame::~cLineGame()
void cLineGame::Show(void)
{
- osd = cOsdProvider::NewOsd(100, 50, 50);
+ osd = cOsdProvider::NewOsd(cOsd::OsdLeft(), cOsd::OsdTop(), 50);
if (osd) {
- tArea Area = { 0, 0, 99, 199, 4 };
- osd->SetAreas(&Area, 1);
- osd->DrawRectangle(0, 0, 99, 199, clrGray50);
- osd->Flush();
+ int x1 = cOsd::OsdWidth() - 1;
+ int y1 = cOsd::OsdHeight() - 1;
+ while (x1 > 0 && y1 > 0) {
+ tArea Area = { 0, 0, x1, y1, 4 };
+ if (osd->CanHandleAreas(&Area, 1) == oeOk) {
+ osd->SetAreas(&Area, 1);
+ osd->DrawRectangle(0, 0, osd->Width() - 1, osd->Height() - 1, clrGray50);
+ osd->Flush();
+ x = osd->Width() / 2;
+ y = osd->Height() / 2;
+ break;
+ }
+ x1 = x1 * 9 / 10;
+ y1 = y1 * 9 / 10;
+ }
}
}
@@ -55,19 +143,24 @@ eOSState cLineGame::ProcessKey(eKeys Key)
{
eOSState state = cOsdObject::ProcessKey(Key);
if (state == osUnknown) {
+ const int d = 4;
switch (Key & ~k_Repeat) {
- case kUp: if (y > 0) y--; break;
- case kDown: if (y < 196) y++; break;
- case kLeft: if (x > 0) x--; break;
- case kRight: if (x < 96) x++; break;
+ case kUp: y = max(0, y - d); break;
+ case kDown: y = min(osd->Height() - d, y + d); break;
+ case kLeft: x = max(0, x - d); break;
+ case kRight: x = min(osd->Width() - d, x + d); break;
case kRed: color = clrRed; break;
case kGreen: color = clrGreen; break;
case kYellow: color = clrYellow; break;
case kBlue: color = clrBlue; break;
+ case k1: DrawEllipses(osd);
+ return osContinue;
+ case k2: DrawSlopes(osd);
+ return osContinue;
case kOk: return osEnd;
default: return state;
}
- osd->DrawRectangle(x, y, x + 3, y + 3, color);
+ osd->DrawRectangle(x, y, x + d - 1, y + d - 1, color);
osd->Flush();
state = osContinue;
}
@@ -84,6 +177,7 @@ private:
bool clockwise;
cPixmap *destroyablePixmap;
cPixmap *toggleablePixmap;
+ bool SetArea(void);
virtual void Action(void);
cPixmap *CreateTextPixmap(const char *s, int Line, int Layer, tColor ColorFg, tColor ColorBg, const cFont *Font);
public:
@@ -241,7 +335,7 @@ void cTrueColorDemo::Action(void)
State++;
}
break;
- case 1: {
+ case 1: {
FadeInPixmap = CreateTextPixmap("Video Disk Recorder", Line, 3, clrYellow, clrTransparent, OsdFont);
if (FadeInPixmap)
Line += FadeInPixmap->DrawPort().Height();
@@ -390,13 +484,21 @@ void cTrueColorDemo::Action(void)
delete LrgFont;
}
+bool cTrueColorDemo::SetArea(void)
+{
+ if (osd) {
+ tArea Area = { 0, 0, cOsd::OsdWidth() - 1, cOsd::OsdHeight() - 1, 32 };
+ return osd->SetAreas(&Area, 1) == oeOk;
+ }
+ return false;
+}
+
void cTrueColorDemo::Show(void)
{
osd = cOsdProvider::NewOsd(cOsd::OsdLeft(), cOsd::OsdTop(), 50);
if (osd) {
- tArea Area = { 0, 0, cOsd::OsdWidth() - 1, cOsd::OsdHeight() - 1, 32 };
- if (osd->SetAreas(&Area, 1) == oeOk) {
- osd->DrawRectangle(0, 0, osd->Width() -1 , osd->Height() - 1, clrGray50);
+ if (SetArea()) {
+ osd->DrawRectangle(0, 0, osd->Width() - 1, osd->Height() - 1, clrGray50);
osd->Flush();
Start();
}
@@ -423,6 +525,14 @@ eOSState cTrueColorDemo::ProcessKey(eKeys Key)
case kGreen: if (toggleablePixmap)
toggleablePixmap->SetLayer(-toggleablePixmap->Layer());
break;
+ case k1: Cancel(3);
+ SetArea();
+ DrawEllipses(osd);
+ break;
+ case k2: Cancel(3);
+ SetArea();
+ DrawSlopes(osd);
+ break;
case kOk: return osEnd;
default: return state;
}
diff --git a/PLUGINS/src/pictures/pic2mpg b/PLUGINS/src/pictures/pic2mpg
index 2895ca8..2ba8de7 100755
--- a/PLUGINS/src/pictures/pic2mpg
+++ b/PLUGINS/src/pictures/pic2mpg
@@ -7,7 +7,7 @@
#
# See the README file for copyright information and how to reach the author.
#
-# $Id: pic2mpg 2.4 2012/01/08 13:27:17 kls Exp $
+# $Id: pic2mpg 2.5 2013/02/17 13:17:13 kls Exp $
use File::Path;
use File::Spec;
@@ -37,9 +37,9 @@ $Verbose = $opt_v;
$ListFiles = $Verbose >= 1;
$Detailed = $Verbose >= 2;
-# Supported picture types:
+# Supported picture types:
-%PICTYPES = (
+%PICTYPES = (
bmp => 1,
gif => 1,
jpeg => 1,
@@ -135,7 +135,7 @@ sub ConvertFile
return if (!defined $PICTYPES{$Type});
my $Exif = ImageInfo($Pict);
my $Orientation = $$Exif{"Orientation"};
- my ($Degrees) = $Orientation =~ /Rotate ([0-9]+)/;
+ my ($Degrees) = $Orientation =~ /Rotate ([0-9]+)/;
my $Rotate = $Degrees ? "-rotate $Degrees" : "";
print "orientation = '$Orientation' -> rotation = $Rotate\n" if ($Detailed);
$Pict = EscapeMeta($Pict);
diff --git a/PLUGINS/src/pictures/pic2mpg-sd b/PLUGINS/src/pictures/pic2mpg-sd
index 6213091..01312af 100755
--- a/PLUGINS/src/pictures/pic2mpg-sd
+++ b/PLUGINS/src/pictures/pic2mpg-sd
@@ -154,7 +154,7 @@ sub ConvertFile
print "image size is $w x $h\n" if ($Detailed);
my $Exif = ImageInfo($Pict);
my $Orientation = $$Exif{"Orientation"};
- my ($Degrees) = $Orientation =~ /Rotate ([0-9]+) /;
+ my ($Degrees) = $Orientation =~ /Rotate ([0-9]+) /;
my $Rotate = "-null";
$Rotate = "-cw" if $Degrees eq "90";
$Rotate = "-ccw" if $Degrees eq "270";
diff --git a/PLUGINS/src/servicedemo/svccli.c b/PLUGINS/src/servicedemo/svccli.c
index c74155c..d8b8e16 100644
--- a/PLUGINS/src/servicedemo/svccli.c
+++ b/PLUGINS/src/servicedemo/svccli.c
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: svccli.c 2.2 2013/01/12 14:13:00 kls Exp $
+ * $Id: svccli.c 2.3 2013/02/17 14:10:26 kls Exp $
*/
#include <stdlib.h>
@@ -32,7 +32,7 @@ struct AddService_v1_0 {
int sum;
};
-// --- cPluginSvcCli ----------------------------------------------------------
+// --- cPluginSvcCli ---------------------------------------------------------
cOsdObject *cPluginSvcCli::MainMenuAction(void)
{
diff --git a/PLUGINS/src/servicedemo/svcsvr.c b/PLUGINS/src/servicedemo/svcsvr.c
index ed2afff..55d1bc0 100644
--- a/PLUGINS/src/servicedemo/svcsvr.c
+++ b/PLUGINS/src/servicedemo/svcsvr.c
@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
- * $Id: svcsvr.c 2.2 2013/01/12 14:13:05 kls Exp $
+ * $Id: svcsvr.c 2.3 2013/02/17 14:10:38 kls Exp $
*/
#include <stdlib.h>
@@ -29,7 +29,7 @@ struct AddService_v1_0 {
int sum;
};
-// --- cPluginSvcSvr ----------------------------------------------------------
+// --- cPluginSvcSvr ---------------------------------------------------------
bool cPluginSvcSvr::Service(const char *Id, void *Data)
{