vdr-plugin-wirbelscan: update to 2018.11.04

This commit is contained in:
CvH 2018-11-20 08:52:35 +01:00
parent df1d28e19d
commit 86c6f43edf
5 changed files with 140 additions and 62 deletions

View File

@ -3,11 +3,11 @@
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="vdr-plugin-wirbelscan"
PKG_VERSION="2017.06.04"
PKG_SHA256="c7a792c794fb98dd7f665e1be2271f4a1a957a26c017043fcd4dd8d8b7fd582b"
PKG_VERSION="2018.11.04"
PKG_SHA256="62c2848aefdb768c165310f70b3746665f57b96a95ebae96761febbb07e942e3"
PKG_LICENSE="GPL"
PKG_SITE="http://wirbel.htpc-forum.de/wirbelscan/index2.html"
PKG_URL="http://wirbel.htpc-forum.de/wirbelscan/${PKG_NAME/-plugin/}-dev-$PKG_VERSION.tgz"
PKG_URL="http://wirbel.htpc-forum.de/wirbelscan/vdr-wirbelscan-$PKG_VERSION.tgz"
PKG_DEPENDS_TARGET="toolchain vdr"
PKG_NEED_UNPACK="$(get_pkg_directory vdr)"
PKG_LONGDESC="Performs a channel scans for DVB-T, DVB-C and DVB-S"
@ -16,7 +16,6 @@ PKG_BUILD_FLAGS="+pic"
make_target() {
VDR_DIR=$(get_build_dir vdr)
cp backup/Makefile.old Makefile
make VDRDIR=$VDR_DIR \
LIBDIR="." \
LOCALEDIR="./locale"

View File

@ -1,12 +0,0 @@
--- a/statemachine.c
+++ b/statemachine.c
@@ -309,7 +309,8 @@ void cStateMachine::Action(void) {
else
newState = eAddChannels;
if (time(0) != tm) {
- MenuScanning->SetProgress(lProgress);
+ if (MenuScanning)
+ MenuScanning->SetProgress(lProgress);
tm = time(0);
}
}

View File

@ -1,22 +0,0 @@
--- a/wirbelscan.c
+++ b/wirbelscan.c
@@ -13,6 +13,8 @@
#include "countries.h"
#include "satellites.h"
+extern TChannels NewChannels;
+
static const char *VERSION = "2017.06.04";
static const char *DESCRIPTION = "DVB channel scan for VDR";
static const char *MAINMENUENTRY = NULL; /* main menu -> use wirbelscancontrol plugin */
@@ -201,8 +203,8 @@ bool cPluginWirbelscan::Service(const ch
strcpy(s->transponder, lTransponder.length()? lTransponder.c_str():"none");
s->progress = s->status == StatusScanning?lProgress:0;
s->strength = s->status == StatusScanning?lStrength:0;
- s->numChannels = 0; // Channels.Count(); // not possible any longer.
- s->newChannels = channelcount; // ((Channels.Count() - channelcount) > 0) && channelcount?Channels.Count() - channelcount:0;
+ s->numChannels = cChannels::MaxNumber();
+ s->newChannels = (NewChannels.Count() > cChannels::MaxNumber()) ? NewChannels.Count() - cChannels::MaxNumber():0;
s->nextTransponders = nextTransponders;
return true;
}

View File

@ -1,27 +1,56 @@
Subject: [PATCH 1/2] interface channel count
diff --git a/wirbelscan.c b/wirbelscan.c
index 602e659..aafbec3 100644
--- a/wirbelscan.c
+++ b/wirbelscan.c
@@ -12,6 +12,7 @@
#include "menusetup.h"
#include "countries.h"
#include "satellites.h"
+extern TChannels NewChannels;
static const char *VERSION = "2018.11.04";
static const char *DESCRIPTION = "DVB channel scan for VDR";
@@ -201,8 +202,8 @@ bool cPluginWirbelscan::Service(const char* id, void* Data) {
strcpy(s->transponder, lTransponder.length()? lTransponder.c_str():"none");
s->progress = s->status == StatusScanning?lProgress:0;
s->strength = s->status == StatusScanning?lStrength:0;
- s->numChannels = 0; // Channels.Count(); // not possible any longer.
- s->newChannels = channelcount; // ((Channels.Count() - channelcount) > 0) && channelcount?Channels.Count() - channelcount:0;
+ s->numChannels = cChannels::MaxNumber();
+ s->newChannels = (NewChannels.Count() > cChannels::MaxNumber()) ? NewChannels.Count() - cChannels::MaxNumber():0;
s->nextTransponders = nextTransponders;
return true;
}
Subject: [PATCH 2/2] device detection
diff --git a/common.c b/common.c
index 0ba4656..1ea8e51 100644
--- a/common.c
+++ b/common.c
@@ -46,20 +46,10 @@ void cMySetup::InitSystems(void) {
for(int i = 0; i < cDevice::NumDevices(); i++) {
cDevice* device = cDevice::GetDevice(i);
if (device == NULL) continue;
- std::string t = *device->DeviceType();
- if (t == "DVB-C" ) systems[SCAN_CABLE ] = 1;
- if (t == "DVB-T" ) systems[SCAN_TERRESTRIAL ] = 1;
- if (t == "DSS" ) systems[SCAN_SATELLITE ] = 1;
- if (t == "DVB-S" ) systems[SCAN_SATELLITE ] = 1;
- if (t == "DVB-S2") systems[SCAN_SATELLITE ] = 1;
- if (t == "ATSC" ) systems[SCAN_TERRCABLE_ATSC] = 1;
- if (t == "DVB-T2") systems[SCAN_TERRESTRIAL ] = 1;
- if (t == "TURBO" ) systems[SCAN_SATELLITE ] = 1;
- if (t == "SAT>IP") {
- if (device->ProvidesSource(cSource::FromString("S"))) systems[SCAN_SATELLITE ] = 1;
- if (device->ProvidesSource(cSource::FromString("T"))) systems[SCAN_TERRESTRIAL ] = 1;
- if (device->ProvidesSource(cSource::FromString("C"))) systems[SCAN_CABLE ] = 1;
- }
+ if (device->ProvidesSource(cSource::stSat)) systems[SCAN_SATELLITE] = 1;
+ if (device->ProvidesSource(cSource::stTerr)) systems[SCAN_TERRESTRIAL] = 1;
+ if (device->ProvidesSource(cSource::stCable)) systems[SCAN_CABLE] = 1;
+ if (device->ProvidesSource(cSource::stAtsc)) systems[SCAN_TERRCABLE_ATSC] = 1;
}
if (DVB_Type >= SCAN_NO_DEVICE || ! systems[DVB_Type]) {
for(int i = 0; i < cDevice::NumDevices(); i++) {
cDevice* device = cDevice::GetDevice(i);
if (device == NULL) continue;
- std::string t = *device->DeviceType();
- if (t == "DVB-C" ) systems[SCAN_CABLE ] = 1;
- if (t == "DVB-T" ) systems[SCAN_TERRESTRIAL ] = 1;
- if (t == "DSS" ) systems[SCAN_SATELLITE ] = 1;
- if (t == "DVB-S" ) systems[SCAN_SATELLITE ] = 1;
- if (t == "DVB-S2") systems[SCAN_SATELLITE ] = 1;
- if (t == "ATSC" ) systems[SCAN_TERRCABLE_ATSC] = 1;
- if (t == "DVB-T2") systems[SCAN_TERRESTRIAL ] = 1;
- if (t == "TURBO" ) systems[SCAN_SATELLITE ] = 1;
- if (t == "SAT>IP") {
- if (device->ProvidesSource(cSource::FromString("S"))) systems[SCAN_SATELLITE ] = 1;
- if (device->ProvidesSource(cSource::FromString("T"))) systems[SCAN_TERRESTRIAL ] = 1;
- if (device->ProvidesSource(cSource::FromString("C"))) systems[SCAN_CABLE ] = 1;
- }
+ if (device->ProvidesSource(cSource::stSat)) systems[SCAN_SATELLITE] = 1;
+ if (device->ProvidesSource(cSource::stTerr)) systems[SCAN_TERRESTRIAL] = 1;
+ if (device->ProvidesSource(cSource::stCable)) systems[SCAN_CABLE] = 1;
+ if (device->ProvidesSource(cSource::stAtsc)) systems[SCAN_TERRCABLE_ATSC] = 1;
}
if (DVB_Type >= SCAN_NO_DEVICE || ! systems[DVB_Type]) {

View File

@ -0,0 +1,84 @@
# taken from wirbelscan-2017.06.04 backup/Makefile.old
# -- v20120526, Winfried Koehler --
PLUGIN = wirbelscan
VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g')
CXX ?= g++
CXXFLAGS ?= -g -O3 -Wall -Wextra -Werror=overloaded-virtual -Wformat=2 -Wswitch-default -fstack-protector-all -D_FORTIFY_SOURCE=2
VDRDIR ?= ../../..
LIBDIR ?= ../../lib
TMPDIR ?= /tmp
include $(VDRDIR)/Make.global
-include $(VDRDIR)/Make.config
APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
ARCHIVE = $(PLUGIN)-$(VERSION)
PACKAGE = vdr-$(ARCHIVE)
INCLUDES += -I$(VDRDIR)/include
DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
UNCRUSTIFY_FILES = scanner.c scanner.h scanfilter.c scanfilter.h statemachine.h statemachine.c
OBJS = $(PLUGIN).o common.o menusetup.o satellites.o scanner.o dvb_wrapper.o
OBJS += scanfilter.o statemachine.o countries.o
all: libvdr-$(PLUGIN).so i18n
%.o: %.c
$(CXX) -std=c++11 $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<
MAKEDEP = $(CXX) -MM -MG
DEPFILE = .dependencies
$(DEPFILE): Makefile
@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
-include $(DEPFILE)
PODIR = po
LOCALEDIR = $(VDRDIR)/locale
I18Npo = $(wildcard $(PODIR)/*.po)
I18Nmsgs = $(addprefix $(LOCALEDIR)/, $(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 $@ $^
%.po: $(I18Npot)
@msgmerge -U --no-wrap --no-location --backup=none -q $@ $<
@touch $@
$(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
@mkdir -p $(dir $@)
@cp $< $@
.PHONY: i18n
i18n: $(I18Nmsgs) $(I18Npot)
libvdr-$(PLUGIN).so: $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) -o $@
@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
perm:
@chmod 644 *.{c,h,html} COPYING HISTORY README TODO Makefile
@chmod 755 po/
dist: $(I18Npo) clean perm
@-rm -rf $(TMPDIR)/$(ARCHIVE)
@mkdir $(TMPDIR)/$(ARCHIVE)
@cp -a * $(TMPDIR)/$(ARCHIVE)
@tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE)
@-rm -rf $(TMPDIR)/$(ARCHIVE)
@echo Distribution package created as $(PACKAGE).tgz