From e0cf82871fe24348101a0b565ea309e074e3663b Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 1 Oct 2019 15:16:59 +0200 Subject: Pull code from common f2a36aa --- lib/edi/STIWriter.hpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lib/edi/STIWriter.hpp') diff --git a/lib/edi/STIWriter.hpp b/lib/edi/STIWriter.hpp index 16cbfe8..fc08e97 100644 --- a/lib/edi/STIWriter.hpp +++ b/lib/edi/STIWriter.hpp @@ -23,6 +23,7 @@ #include "common.hpp" #include "STIDecoder.hpp" #include +#include #include #include #include @@ -38,6 +39,9 @@ struct sti_frame_t { class STIWriter : public STIDataCollector { public: + // The callback gets called for every STI frame that gets assembled + STIWriter(std::function&& frame_callback); + // Tell the ETIWriter what EDI protocol we receive in *ptr. // This is not part of the ETI data, but is used as check virtual void update_protocol( @@ -59,12 +63,8 @@ class STIWriter : public STIDataCollector { virtual void update_odr_version(const odr_version_data& data); virtual void assemble(void); - - // Return the assembled frame or an empty frame if not ready - sti_frame_t getFrame(); - private: - void reinit(void); + std::function m_frame_callback; bool m_proto_valid = false; @@ -84,7 +84,6 @@ class STIWriter : public STIDataCollector { audio_level_data m_audio_levels; odr_version_data m_version_data; - sti_frame_t m_stiFrame; }; } -- cgit v1.2.3