diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-10-02 15:36:21 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-10-02 15:36:21 +0200 |
commit | c97b43fc819e1e0e963183579d1b50f26f8c6f7f (patch) | |
tree | b0e1570b07d83be9b1c34addc74d708dfce0e888 /src/MuxElements.cpp | |
parent | c21a6828183cdcc08533a83530156e5758aca534 (diff) | |
download | dabmux-c97b43fc819e1e0e963183579d1b50f26f8c6f7f.tar.gz dabmux-c97b43fc819e1e0e963183579d1b50f26f8c6f7f.tar.bz2 dabmux-c97b43fc819e1e0e963183579d1b50f26f8c6f7f.zip |
Regroup linkagesets into subsets of same type
Diffstat (limited to 'src/MuxElements.cpp')
-rw-r--r-- | src/MuxElements.cpp | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/src/MuxElements.cpp b/src/MuxElements.cpp index 656e294..510775e 100644 --- a/src/MuxElements.cpp +++ b/src/MuxElements.cpp @@ -663,12 +663,12 @@ unsigned short DabSubchannel::getSizeDWord(void) const } LinkageSet::LinkageSet(string name, uint16_t lsn, bool hard, bool international) : - RemoteControllable(name), - lsn(lsn), - active(false), - hard(hard), - international(international) + RemoteControllable(name) { + data.lsn = lsn; + data.active = false; + data.hard = hard; + data.international = international; RC_ADD_PARAMETER(active, "Activate this linkage set [0 or 1]"); } @@ -677,7 +677,7 @@ void LinkageSet::set_parameter(const string& parameter, const string& value) if (parameter == "active") { stringstream ss; ss << value; - ss >> active; + ss >> data.active; } else { stringstream ss; @@ -691,7 +691,7 @@ const string LinkageSet::get_parameter(const string& parameter) const { stringstream ss; if (parameter == "active") { - ss << active; + ss << data.active; } else { ss << "Parameter '" << parameter << @@ -700,3 +700,22 @@ const string LinkageSet::get_parameter(const string& parameter) const } return ss.str(); } + +LinkageSetData LinkageSetData::filter_type(ServiceLinkType type) +{ + LinkageSetData lsd; + + lsd.lsn = lsn; + lsd.active = active; + lsd.hard = hard; + lsd.international = international; + lsd.keyservice = keyservice; + + for (const auto& link : id_list) { + if (link.type == type) { + lsd.id_list.push_back(link); + } + } + + return lsd; +} |