+
+ // Create a new data snapshot
+ _cur_logic_snapshot = shared_ptr<data::LogicSnapshot>(
+ new data::LogicSnapshot(logic, sample_limit));
+ _logic_data->push_snapshot(_cur_logic_snapshot);
+
+ // @todo Putting this here means that only listeners querying
+ // for logic will be notified. Currently the only user of
+ // frame_began is DecoderStack, but in future we need to signal
+ // this after both analog and logic sweeps have begun.
+ frame_began();
+ }
+ else
+ {
+ // Append to the existing data snapshot
+ _cur_logic_snapshot->append_payload(logic);
+ }
+
+ data_received();
+}
+
+void SigSession::feed_in_analog(shared_ptr<Analog> analog)
+{
+ lock_guard<mutex> lock(_data_mutex);
+
+ const vector<shared_ptr<Channel>> channels = analog->channels();
+ const unsigned int channel_count = channels.size();
+ const size_t sample_count = analog->num_samples() / channel_count;
+ const float *data = analog->data_pointer();
+ bool sweep_beginning = false;
+
+ for (auto channel : channels)
+ {
+ shared_ptr<data::AnalogSnapshot> snapshot;
+
+ // Try to get the snapshot of the channel
+ const map< shared_ptr<Channel>, shared_ptr<data::AnalogSnapshot> >::
+ iterator iter = _cur_analog_snapshots.find(channel);
+ if (iter != _cur_analog_snapshots.end())
+ snapshot = (*iter).second;