aboutsummaryrefslogtreecommitdiffstats
path: root/src/dls.cpp
diff options
context:
space:
mode:
authorStefan Pöschel <spoeschel@irt.de>2019-07-23 11:21:10 +0200
committerStefan Pöschel <github@basicmaster.de>2019-07-23 11:32:19 +0200
commitc5d5653d26816204fb39485accce08f21737c707 (patch)
treece3d648f4a2adf7cac3f308a52c276871cbdf1af /src/dls.cpp
parent1c2f96f13e6e5abbf114af0192dbdd53de3c9a25 (diff)
downloadODR-PadEnc-c5d5653d26816204fb39485accce08f21737c707.tar.gz
ODR-PadEnc-c5d5653d26816204fb39485accce08f21737c707.tar.bz2
ODR-PadEnc-c5d5653d26816204fb39485accce08f21737c707.zip
DLS: allow to use separate DL Plus item state file
Diffstat (limited to 'src/dls.cpp')
-rw-r--r--src/dls.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/dls.cpp b/src/dls.cpp
index 4e106e0..5d334b1 100644
--- a/src/dls.cpp
+++ b/src/dls.cpp
@@ -3,7 +3,7 @@
Copyright (C) 2014, 2015 Matthias P. Braendli (http://opendigitalradio.org)
- Copyright (C) 2015, 2016, 2017 Stefan Pöschel (http://opendigitalradio.org)
+ Copyright (C) 2015-2019 Stefan Pöschel (http://opendigitalradio.org)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -244,11 +244,22 @@ bool DLSEncoder::parseLabel(const std::string& dls_file, const DL_PARAMS& dl_par
}
-void DLSEncoder::encodeLabel(const std::string& dls_file, const DL_PARAMS& dl_params) {
+void DLSEncoder::encodeLabel(const std::string& dls_file, const char* item_state_file, const DL_PARAMS& dl_params) {
DL_STATE dl_state;
if (!parseLabel(dls_file, dl_params, dl_state))
return;
+ // if enabled, derive DL Plus Item Toggle/Running bits from separate file
+ if (item_state_file) {
+ DL_STATE item_state;
+ if (!parseLabel(item_state_file, DL_PARAMS(), item_state))
+ return;
+
+ dl_state.dl_plus_enabled = true;
+ dl_state.dl_plus_item_toggle = item_state.dl_plus_item_toggle;
+ dl_state.dl_plus_item_running = item_state.dl_plus_item_running;
+ }
+
// if DL Plus enabled, but no DL Plus tags were added, add the required DUMMY tag
if (dl_state.dl_plus_enabled && dl_state.dl_plus_tags.empty())
dl_state.dl_plus_tags.emplace_back();