23 #ifndef PROCESSOR20170816H
24 #define PROCESSOR20170816H
26 #include "goby/middleware/marshalling/protobuf.h"
28 #include "goby/zeromq/application/multi_thread.h"
31 #include "netsim/messages/core_config.pb.h"
33 #include <jack/types.h>
35 using ThreadBase = goby::middleware::SimpleThread<netsim::protobuf::NetSimCoreConfig>;
45 boost::units::quantity<boost::units::si::frequency> loop_freq)
49 interthread().template subscribe<netsim::groups::buffer_size_change, jack_nframes_t>(
53 for (
int i = 0, n = cfg().number_of_modems(); i < n; ++i)
55 audio_out_groups_.push_back(goby::middleware::DynamicGroup(
"aout", i + to_index));
60 auto detector_audio_callback =
61 [
this, i](std::shared_ptr<const netsim::TaggedAudioBuffer> buffer) {
66 #define NETSIM_PROCESSOR_SUBSCRIBE_DETECTOR_AUDIO(z, n, _) \
69 .template subscribe<netsim::groups::DetectorAudio<n>::group, \
70 netsim::TaggedAudioBuffer>(detector_audio_callback); \
80 virtual void detector_audio(std::shared_ptr<const netsim::TaggedAudioBuffer> buffer,
90 #define NETSIM_PROCESSOR_PUBLISH_AUDIO_BUFFER(z, n, _) \
92 this->interthread().template publish<netsim::groups::AudioOut<n, to_index>::group>( \
101 std::vector<goby::middleware::DynamicGroup> audio_out_groups_;