Skip to content

Commit

Permalink
prepare for upcoming next wirbelscan version
Browse files Browse the repository at this point in the history
  • Loading branch information
wirbel-at-vdr-portal committed Oct 9, 2021
1 parent c4df0d9 commit 945ccae
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 12 deletions.
2 changes: 2 additions & 0 deletions CmdOpts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,13 @@ bool ParseArguments(int argc, char* argv[]) {
else if (Param == "3") WirbelscanSetup.ATSC_type = 2;
}
else if ((Argument == "-c") or (Argument == "--country")) {
Param = UpperCase(Param);
PARAM("?," + CountryArgs());
if (Param == "?") return PrintCountries();
else WirbelscanSetup.CountryIndex = GetCountryId(Param);
}
else if ((Argument == "-s") or (Argument == "--satellite")) {
Param = UpperCase(Param);
PARAM("?," + SatArgs());
if (Param == "?") return PrintSatellites();
else {
Expand Down
6 changes: 3 additions & 3 deletions Femon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void cData::Receive(const uchar* Data, int Length) {

void cData::Action(void) {
while(Running())
Sleep(100);
milliSleep(100);
};

void cData::Activate(bool On) {
Expand Down Expand Up @@ -126,7 +126,7 @@ int SignalMonitor(cDevice* Device, std::string& Channel) {
for(;;) {
if (not Device->SwitchChannel(&aChannel, false)) {
Message("tuning failed - try again..");
Sleep(1000);
milliSleep(1000);
continue;
}

Expand Down Expand Up @@ -191,7 +191,7 @@ int SignalMonitor(cDevice* Device, std::string& Channel) {
}

Message(s);
Sleep(1000);
milliSleep(1000);
}

delete data;
Expand Down
13 changes: 13 additions & 0 deletions HISTORY
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,16 @@
- add new option --femon <VDR_CHANNEL>
* Makefile
- add version target

20211009:
-------------------------------------------------------------------------------
* main.cpp, Femon.cpp
- rename Sleep to milliSleep
* helpers.{h,cpp}
- rename Sleep to milliSleep
- IntToHex now gets a int64_t
* CmdOpts.cpp
- args -c, --country, -s, --satellite are now case insensitive,
to improve compat to my ancient w_scan syntax.
* Makefile
- prepare for upcoming next wirbelscan version
4 changes: 2 additions & 2 deletions Helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ std::string IntToStr(int64_t n, size_t Zeros) {
return ToString("%lld", (long long) n);
}

std::string IntToHex(uint64_t n, size_t Digits) {
std::string IntToHex(int64_t n, size_t Digits) {
return ToString("0x%.0" + std::to_string(Digits) + "llX", (long long) n);
}

Expand Down Expand Up @@ -101,7 +101,7 @@ std::string VdrSource(std::string s) {
return s + c;
}

void Sleep(size_t msec) {
void milliSleep(size_t msec) {
std::this_thread::sleep_for(std::chrono::milliseconds(msec));
}

Expand Down
4 changes: 2 additions & 2 deletions Helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ std::string UpperCase(std::string s);
std::string FrontFill(std::string s, size_t n);
std::string BackFill(std::string s, size_t n);
std::string IntToStr(int64_t n, size_t Zeros = 0);
std::string IntToHex(uint64_t n, size_t Digits = 0);
std::string IntToHex(int64_t n, size_t Digits = 0);
std::string FloatToStr(double d, int Precision = 1);
std::string ExpToStr(double d);
std::string VdrSource(std::string s);
void Sleep(size_t msec);
void milliSleep(size_t msec);
bool InitCharTables(void);
std::vector<std::string> ReadFile(std::string aFileName);

Expand Down
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ CXX = @g++


CFLAGS = -g -O3 -fPIC -Werror=overloaded-virtual
CXXFLAGS = -g -O3 -fPIC -Wall -Wextra -Werror=overloaded-virtual -Wfatal-errors
CXXFLAGS = -g -O3 -fPIC -Wall -Wextra -Werror=overloaded-virtual -Wno-unused-parameter -Wfatal-errors



Expand Down Expand Up @@ -194,15 +194,15 @@ LDFLAGS ?= -L$(srcdir) -L$(vdrdir) -L$(vdrlibsidir)
SOURCES := $(wildcard $(srcdir)/*.cpp)
VDR_SOURCES := $(shell find $(vdrdir) -maxdepth 1 ! -name "vdr.c" -name "*.c" 2>/dev/null)
LIBSI_SOURCES := $(wildcard $(vdrlibsidir)/*.c)
WIRBELSCAN_SOURCES = $(wildcard $(pluginsrcdir)/wirbelscan/*.c)
WIRBELSCAN_SOURCES = $(wildcard $(pluginsrcdir)/wirbelscan/*.cpp)
SATIP_SOURCES = $(wildcard $(pluginsrcdir)/satip/*.c)



OBJS = $(SOURCES:.cpp=.o)
VDR_OBJS = $(VDR_SOURCES:.c=.o)
LIBSI_OBJS = $(LIBSI_SOURCES:.c=.o)
WIRBELSCAN_OBJS = $(WIRBELSCAN_SOURCES:.c=.o)
WIRBELSCAN_OBJS = $(WIRBELSCAN_SOURCES:.cpp=.o)
SATIP_OBJS = $(SATIP_SOURCES:.c=.o)


Expand Down Expand Up @@ -339,6 +339,8 @@ printvars:
@echo "BINARY = $(BINARY)"
@echo "package_name = $(package_name)"
@echo "WIRBELSCAN_VERSION = $(WIRBELSCAN_VERSION)"
@echo "WIRBELSCAN_SOURCES = $(WIRBELSCAN_SOURCES)"
@echo "WIRBELSCAN_OBJS = $(WIRBELSCAN_OBJS)"
@echo "SATIP_GIT_ADDR = $(SATIP_GIT_ADDR)"
@echo "CC = $(CC)"
@echo "CXX = $(CXX)"
Expand Down
4 changes: 2 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ int main(int argc, char* argv[]) {
for(int i=0; (i < 5) and not SVDRP(satip, "LIST", Reply); i++) {
SVDRP(satip, "SCAN", Reply);
Message(Reply);
Sleep(3000);
milliSleep(3000);
}
for(auto line:split(Reply, '\n')) {
if (not ParseSatipServer(line))
Expand Down Expand Up @@ -143,7 +143,7 @@ int main(int argc, char* argv[]) {
bool Continue = StartScan();

while(Continue) {
Sleep(500);
milliSleep(500);
Continue = Scanning();
}

Expand Down

0 comments on commit 945ccae

Please sign in to comment.