BasebandProcessor: Streamline construction of some messages.

This commit is contained in:
Jared Boone 2015-12-10 12:25:11 -08:00
parent 77aceaaf56
commit 3ed77af0c1
2 changed files with 7 additions and 6 deletions

View File

@ -63,8 +63,7 @@ void BasebandProcessor::feed_channel_stats(const buffer_c16_t& channel) {
channel_stats.feed(
channel,
[](const ChannelStatistics& statistics) {
ChannelStatisticsMessage channel_stats_message;
channel_stats_message.statistics = statistics;
ChannelStatisticsMessage channel_stats_message { statistics };
shared_memory.application_queue.push(channel_stats_message);
}
);
@ -108,8 +107,7 @@ void BasebandProcessor::feed_audio_stats(const buffer_s16_t& audio) {
audio_stats.feed(
audio,
[this](const AudioStatistics& statistics) {
AudioStatisticsMessage audio_stats_message;
audio_stats_message.statistics = statistics;
AudioStatisticsMessage audio_stats_message { statistics };
shared_memory.application_queue.push(audio_stats_message);
}
);

View File

@ -117,7 +117,9 @@ struct ChannelStatistics {
class ChannelStatisticsMessage : public Message {
public:
constexpr ChannelStatisticsMessage(
) : Message { ID::ChannelStatistics }
const ChannelStatistics& statistics
) : Message { ID::ChannelStatistics },
statistics { statistics }
{
}
@ -150,8 +152,9 @@ struct AudioStatistics {
class AudioStatisticsMessage : public Message {
public:
constexpr AudioStatisticsMessage(
const AudioStatistics& statistics
) : Message { ID::AudioStatistics },
statistics { }
statistics { statistics }
{
}