summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Maass <mase@mase1.setho.org>2013-11-04 16:01:08 +0100
committerThomas Maass <mase@mase1.setho.org>2013-11-04 16:01:08 +0100
commit6c68cba02f5b00198ebdc00547aaab4ce62011cd (patch)
treec90b42ceb1523a81100cdb33c710910feee337e8
parentf4430a81fa5eea12317e6de8a50448e04dfeda77 (diff)
downloadvdr-plugin-smtled-master.tar.gz
vdr-plugin-smtled-master.tar.bz2
Release 0.0.5.HEADmaster
Fixed for VDR 2.0.x.
-rw-r--r--HISTORY4
-rw-r--r--Makefile89
-rw-r--r--README5
-rw-r--r--smtled.c6
4 files changed, 75 insertions, 29 deletions
diff --git a/HISTORY b/HISTORY
index ca5a925..0866e30 100644
--- a/HISTORY
+++ b/HISTORY
@@ -17,3 +17,7 @@ VDR Plugin 'smtled' Revision History
2008-04-21: Version 0.0.4
- Integrated Hack by AndreasH, the display will now show the last tuned channel while running epg-scan -> http://zenvdr.lame-delegation.de/mediawiki/index.php?title=ZenVDR_changes#smtled_fix
+
+2013-11-03: Version 0.0.5
+
+- Fixed for VDR 2.0.x \ No newline at end of file
diff --git a/Makefile b/Makefile
index 5fa2f84..f7f4006 100644
--- a/Makefile
+++ b/Makefile
@@ -1,75 +1,115 @@
#
# Makefile for a Video Disk Recorder plugin
#
-# $Id: Makefile 1.13 2006/09/09 12:38:35 kls Exp $
+# $Id$
# The official name of this plugin.
# This name will be used in the '-P...' option of VDR to load the plugin.
# By default the main source file also carries this name.
-#
+
PLUGIN = smtled
### The version number of this plugin (taken from the main source file):
VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g')
-### The C++ compiler and options:
+### The directory environment:
-CXX ?= g++
-CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual
+# Use package data if installed...otherwise assume we're under the VDR source directory:
+PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell pkg-config --variable=$(1) vdr || pkg-config --variable=$(1) ../../../vdr.pc))
+LIBDIR = $(call PKGCFG,libdir)
+LOCDIR = $(call PKGCFG,locdir)
+PLGCFG = $(call PKGCFG,plgcfg)
+#
+TMPDIR ?= /tmp
-### The directory environment:
+### The compiler options:
-VDRDIR = ../../..
-LIBDIR = ../../lib
-TMPDIR = /tmp
+export CFLAGS = $(call PKGCFG,cflags)
+export CXXFLAGS = $(call PKGCFG,cxxflags)
-### Allow user defined options to overwrite defaults:
+### The version number of VDR's plugin API:
--include $(VDRDIR)/Make.config
+APIVERSION = $(call PKGCFG,apiversion)
-### The version number of VDR's plugin API (taken from VDR's "config.h"):
+### Allow user defined options to overwrite defaults:
-APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
+-include $(PLGCFG)
### The name of the distribution archive:
ARCHIVE = $(PLUGIN)-$(VERSION)
PACKAGE = vdr-$(ARCHIVE)
+### The name of the shared object file:
+
+SOFILE = libvdr-$(PLUGIN).so
+
### Includes and Defines (add further entries here):
-INCLUDES += -I$(VDRDIR)/include
+INCLUDES +=
-DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
+DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
### The object files (add further files here):
OBJS = $(PLUGIN).o
+### The main target:
+
+all: $(SOFILE) i18n
+
### Implicit rules:
%.o: %.c
- $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<
+ $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
-# Dependencies:
+### Dependencies:
-MAKEDEP = g++ -MM -MG
+MAKEDEP = $(CXX) -MM -MG
DEPFILE = .dependencies
$(DEPFILE): Makefile
- @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
+ @$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
-include $(DEPFILE)
+### Internationalization (I18N):
+
+PODIR = po
+I18Npo = $(wildcard $(PODIR)/*.po)
+I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file))))
+I18Nmsgs = $(addprefix $(DESTDIR)$(LOCDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file))))))
+I18Npot = $(PODIR)/$(PLUGIN).pot
+
+%.mo: %.po
+ msgfmt -c -o $@ $<
+
+$(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 $^`
+
+%.po: $(I18Npot)
+ msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $<
+ @touch $@
+
+$(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
+ install -D -m644 $< $@
+
+.PHONY: i18n
+i18n: $(I18Nmo) $(I18Npot)
+
+install-i18n: $(I18Nmsgs)
+
### Targets:
-all: libvdr-$(PLUGIN).so
+$(SOFILE): $(OBJS)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) -o $@
+
+install-lib: $(SOFILE)
+ install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION)
-libvdr-$(PLUGIN).so: $(OBJS)
- $(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@
- @cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
+install: install-lib install-i18n
-dist: clean
+dist: $(I18Npo) clean
@-rm -rf $(TMPDIR)/$(ARCHIVE)
@mkdir $(TMPDIR)/$(ARCHIVE)
@cp -a * $(TMPDIR)/$(ARCHIVE)
@@ -78,4 +118,5 @@ dist: clean
@echo Distribution package created as $(PACKAGE).tgz
clean:
+ @-rm -f $(PODIR)/*.mo $(PODIR)/*.pot
@-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~
diff --git a/README b/README
index ea05544..ae5d530 100644
--- a/README
+++ b/README
@@ -1,8 +1,9 @@
This is a "plugin" for the Video Disk Recorder (VDR).
-Written by: Mario Hildebrandt
+Written by: Mario Hildebrandt
+Further development: Thomas Maass
-Project's homepage: none
+Project's homepage: http://projects.vdr-developer.org/projects/plg-smtled
See the file COPYING for license information.
diff --git a/smtled.c b/smtled.c
index 74d5901..d162449 100644
--- a/smtled.c
+++ b/smtled.c
@@ -21,7 +21,7 @@
#include <vdr/status.h>
-static const char *VERSION = "0.0.4";
+static const char *VERSION = "0.0.5";
static const char *DESCRIPTION = "Samsung LED display plugin";
static const char *MAINMENUENTRY = NULL;
@@ -34,7 +34,7 @@ private:
int reccount;
protected:
virtual void SetLED(char * cr);
- virtual void ChannelSwitch(const cDevice *Device, int ChannelNumber);
+ virtual void ChannelSwitch(const cDevice *Device, int ChannelNumber, bool LiveView = true);
virtual void Recording(const cDevice *Device, const char *Name, const char *FileName, bool On);
public:
cSmtledTest(void);
@@ -62,7 +62,7 @@ void cSmtledTest::SetLED(char* cw)
}
-void cSmtledTest::ChannelSwitch(const cDevice *Device, int ChannelNumber)
+void cSmtledTest::ChannelSwitch(const cDevice *Device, int ChannelNumber, bool LiveView)
{
if ( !Device->IsPrimaryDevice() || (ChannelNumber == 0) ) {
dsyslog("status: cSmtledTest::ChannelSwitch ignore device %d channel %d",