From ac572d9d97c7ff0dd37363106f9fbe78c904c43c Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Fri, 28 Aug 2020 19:49:36 +0200 Subject: [PATCH] hook: add more calls to Hook::parse() --- lib/hooks/cast.cpp | 2 ++ lib/hooks/decimate.cpp | 2 ++ lib/hooks/dp.cpp | 2 ++ lib/hooks/ebm.cpp | 2 ++ lib/hooks/gate.cpp | 2 ++ lib/hooks/limit_rate.cpp | 2 ++ lib/hooks/pps_ts.cpp | 2 ++ lib/hooks/scale.cpp | 2 ++ lib/hooks/shift_seq.cpp | 2 ++ lib/hooks/shift_ts.cpp | 2 ++ lib/hooks/skip_first.cpp | 2 ++ lib/hooks/stats.cpp | 2 ++ 12 files changed, 24 insertions(+) diff --git a/lib/hooks/cast.cpp b/lib/hooks/cast.cpp index 5c3449a4c..e97e7339f 100644 --- a/lib/hooks/cast.cpp +++ b/lib/hooks/cast.cpp @@ -105,6 +105,8 @@ public: assert(state != State::STARTED); + Hook::parse(cfg); + const char *name = nullptr; const char *unit = nullptr; const char *type = nullptr; diff --git a/lib/hooks/decimate.cpp b/lib/hooks/decimate.cpp index fa1747226..2fce59e22 100644 --- a/lib/hooks/decimate.cpp +++ b/lib/hooks/decimate.cpp @@ -45,6 +45,8 @@ void DecimateHook::parse(json_t *cfg) assert(state != State::STARTED); + Hook::parse(cfg); + ret = json_unpack_ex(cfg, &err, 0, "{ s: i }", "ratio", &ratio ); diff --git a/lib/hooks/dp.cpp b/lib/hooks/dp.cpp index 286c8096b..27b19a7e4 100644 --- a/lib/hooks/dp.cpp +++ b/lib/hooks/dp.cpp @@ -156,6 +156,8 @@ public: json_t *json_harmonics, *json_harmonic, *json_signal; size_t i; + Hook::parse(cfg); + double rate = -1, dt = -1; ret = json_unpack_ex(cfg, &err, 0, "{ s: o, s: F, s?: F, s?: F, s: o, s?: b }", diff --git a/lib/hooks/ebm.cpp b/lib/hooks/ebm.cpp index a93e23e87..33d2340b8 100644 --- a/lib/hooks/ebm.cpp +++ b/lib/hooks/ebm.cpp @@ -54,6 +54,8 @@ public: json_error_t err; json_t *json_phases, *json_phase; + Hook::parse(cfg); + ret = json_unpack_ex(cfg, &err, 0, "{ s: o }", "phases", &json_phases ); diff --git a/lib/hooks/gate.cpp b/lib/hooks/gate.cpp index 915ef5a62..ee6078621 100644 --- a/lib/hooks/gate.cpp +++ b/lib/hooks/gate.cpp @@ -79,6 +79,8 @@ public: assert(state != State::STARTED); + Hook::parse(cfg); + ret = json_unpack_ex(cfg, &err, 0, "{ s: o, s?: F, s?: F, s?: i, s?: s }", "signal", &json_signal, "threshold", &threshold, diff --git a/lib/hooks/limit_rate.cpp b/lib/hooks/limit_rate.cpp index 52a4186fa..41bb5c9ca 100644 --- a/lib/hooks/limit_rate.cpp +++ b/lib/hooks/limit_rate.cpp @@ -43,6 +43,8 @@ void LimitRateHook::parse(json_t *cfg) double rate; const char *m = nullptr; + Hook::parse(cfg); + ret = json_unpack_ex(cfg, &err, 0, "{ s: F, s?: s }", "rate", &rate, "mode", &m diff --git a/lib/hooks/pps_ts.cpp b/lib/hooks/pps_ts.cpp index b77443734..48ab721a5 100644 --- a/lib/hooks/pps_ts.cpp +++ b/lib/hooks/pps_ts.cpp @@ -65,6 +65,8 @@ public: assert(state != State::STARTED); + Hook::parse(cfg); + ret = json_unpack_ex(cfg, &err, 0, "{ s: i, s?: f }", "signal_index", &idx, "threshold", &thresh diff --git a/lib/hooks/scale.cpp b/lib/hooks/scale.cpp index 9f3697d86..956136cd6 100644 --- a/lib/hooks/scale.cpp +++ b/lib/hooks/scale.cpp @@ -75,6 +75,8 @@ public: assert(state != State::STARTED); + Hook::parse(cfg); + ret = json_unpack_ex(cfg, &err, 0, "{ s?: F, s?: F, s: o }", "scale", &scale, "offset", &offset, diff --git a/lib/hooks/shift_seq.cpp b/lib/hooks/shift_seq.cpp index ee5af8a5f..390023c5b 100644 --- a/lib/hooks/shift_seq.cpp +++ b/lib/hooks/shift_seq.cpp @@ -46,6 +46,8 @@ public: assert(state != State::STARTED); + Hook::parse(cfg); + ret = json_unpack_ex(cfg, &err, 0, "{ s: i }", "offset", &offset ); diff --git a/lib/hooks/shift_ts.cpp b/lib/hooks/shift_ts.cpp index c2cd37f91..6102cde06 100644 --- a/lib/hooks/shift_ts.cpp +++ b/lib/hooks/shift_ts.cpp @@ -57,6 +57,8 @@ public: assert(state != State::STARTED); + Hook::parse(cfg); + ret = json_unpack_ex(cfg, &err, 0, "{ s?: s, s: F }", "mode", &m, "offset", &o diff --git a/lib/hooks/skip_first.cpp b/lib/hooks/skip_first.cpp index a255de888..555040df9 100644 --- a/lib/hooks/skip_first.cpp +++ b/lib/hooks/skip_first.cpp @@ -69,6 +69,8 @@ public: assert(state != State::STARTED); + Hook::parse(cfg); + ret = json_unpack_ex(cfg, &err, 0, "{ s: F }", "seconds", &s); if (!ret) { seconds.wait = time_from_double(s); diff --git a/lib/hooks/stats.cpp b/lib/hooks/stats.cpp index 215e2f21c..7e6b9f496 100644 --- a/lib/hooks/stats.cpp +++ b/lib/hooks/stats.cpp @@ -190,6 +190,8 @@ public: assert(state != State::STARTED); + Hook::parse(cfg); + const char *f = nullptr; const char *u = nullptr;