summaryrefslogtreecommitdiffstats
path: root/src/MuxElements.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-09-01 21:58:32 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-09-01 21:58:32 +0200
commit1c68dced7ee77ed9065135d54c069a673e16291e (patch)
tree2612b572d219d2c0a16b1d5962f89594b9486056 /src/MuxElements.h
parent2b99cb3f3d43c48d9292707725b6618b18944d42 (diff)
downloaddabmux-1c68dced7ee77ed9065135d54c069a673e16291e.tar.gz
dabmux-1c68dced7ee77ed9065135d54c069a673e16291e.tar.bz2
dabmux-1c68dced7ee77ed9065135d54c069a673e16291e.zip
Add RC parameters for deferred start/stop of announcements
This is helpful to compensate for audio encoding delays.
Diffstat (limited to 'src/MuxElements.h')
-rw-r--r--src/MuxElements.h30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/MuxElements.h b/src/MuxElements.h
index 289c35a..7056121 100644
--- a/src/MuxElements.h
+++ b/src/MuxElements.h
@@ -3,9 +3,11 @@
2011, 2012 Her Majesty the Queen in Right of Canada (Communications
Research Center Canada)
- Copyright (C) 2014, 2015
+ Copyright (C) 2016
Matthias P. Braendli, matthias.braendli@mpb.li
+ http://www.opendigitalradio.org
+
This file defines all data structures used in DabMux to represent
and save ensemble data.
*/
@@ -34,6 +36,8 @@
#include <functional>
#include <exception>
#include <algorithm>
+#include <chrono>
+#include <boost/optional.hpp>
#include <stdint.h>
#include "dabOutput/dabOutput.h"
#include "dabInput.h"
@@ -85,7 +89,15 @@ class AnnouncementCluster : public RemoteControllable {
RemoteControllable(name),
m_active(false)
{
- RC_ADD_PARAMETER(active, "Signal this announcement");
+ RC_ADD_PARAMETER(active, "Signal this announcement [0 or 1]");
+
+ /* This supports deferred start/stop to allow the user
+ * to compensate for audio encoding delay
+ */
+ RC_ADD_PARAMETER(start_in,
+ "Start signalling this announcement after a delay [ms]");
+ RC_ADD_PARAMETER(stop_in,
+ "Stop signalling this announcement after a delay [ms]");
}
uint8_t cluster_id;
@@ -94,11 +106,23 @@ class AnnouncementCluster : public RemoteControllable {
std::string tostring(void) const;
- bool is_active(void) const { return m_active; };
+ /* Check if the activation/deactivation timeout occurred,
+ * and return of if the Announcement is active
+ */
+ bool is_active(void);
private:
bool m_active;
+ boost::optional<
+ std::chrono::time_point<
+ std::chrono::steady_clock> > m_deferred_start_time;
+
+ boost::optional<
+ std::chrono::time_point<
+ std::chrono::steady_clock> > m_deferred_stop_time;
+
+
/* Remote control */
virtual void set_parameter(const std::string& parameter,
const std::string& value);