Spectrum streaming control, spectrum attributes back in each frame.

TODO: This feels kinda complex, and there's some repeated Processor code that needs to be refactored into a base class.
This commit is contained in:
Jared Boone 2016-01-10 10:42:20 -08:00
parent 0647f26707
commit d821afc60d
10 changed files with 101 additions and 29 deletions

View file

@ -53,6 +53,10 @@ void NarrowbandAMAudio::on_message(const Message* const message) {
configure(*reinterpret_cast<const AMConfigureMessage*>(message));
break;
case Message::ID::SpectrumStreamingConfig:
streaming_config(*reinterpret_cast<const SpectrumStreamingConfigMessage*>(message));
break;
default:
break;
}
@ -82,3 +86,11 @@ void NarrowbandAMAudio::configure(const AMConfigureMessage& message) {
configured = true;
}
void NarrowbandAMAudio::streaming_config(const SpectrumStreamingConfigMessage& message) {
if( message.mode == SpectrumStreamingConfigMessage::Mode::Running ) {
channel_spectrum.start();
} else {
channel_spectrum.stop();
}
}