Use CaptureConfig to share state between cores.

Remove awful FIFO_HACK.
TODO: Lots of repeated code...
TODO: Capture thread is signalled too frequently.
This commit is contained in:
Jared Boone 2016-04-23 15:07:44 -07:00
parent 67eb62ec12
commit d5e21ce972
12 changed files with 82 additions and 29 deletions

View file

@ -63,6 +63,10 @@ void NarrowbandAMAudio::on_message(const Message* const message) {
configure(*reinterpret_cast<const AMConfigureMessage*>(message));
break;
case Message::ID::CaptureConfig:
capture_config(*reinterpret_cast<const CaptureConfigMessage*>(message));
break;
default:
break;
}
@ -93,3 +97,11 @@ void NarrowbandAMAudio::configure(const AMConfigureMessage& message) {
configured = true;
}
void NarrowbandAMAudio::capture_config(const CaptureConfigMessage& message) {
if( message.config ) {
audio_output.set_stream(std::make_unique<StreamInput>(14, *message.config));
} else {
audio_output.set_stream(nullptr);
}
}