+ signals_changed();
+
+ // Do an initial decode
+ decoder_stack->begin_decode();
+
+ return true;
+}
+
+vector< shared_ptr<view::DecodeTrace> > Session::get_decode_signals() const
+{
+ shared_lock<shared_mutex> lock(signals_mutex_);
+ return decode_traces_;
+}
+
+void Session::remove_decode_signal(view::DecodeTrace *signal)
+{
+ for (auto i = decode_traces_.begin(); i != decode_traces_.end(); i++)
+ if ((*i).get() == signal)
+ {
+ decode_traces_.erase(i);
+ signals_changed();
+ return;
+ }
+}
+#endif
+
+void Session::set_capture_state(capture_state state)
+{
+ lock_guard<mutex> lock(sampling_mutex_);
+ const bool changed = capture_state_ != state;
+ capture_state_ = state;
+ if(changed)
+ capture_state_changed(state);
+}
+
+void Session::update_signals(shared_ptr<Device> device)
+{
+ assert(device);
+ assert(capture_state_ == Stopped);
+
+ // Clear the decode traces
+ decode_traces_.clear();
+
+ // Detect what data types we will receive
+ auto channels = device->channels();
+ unsigned int logic_channel_count = std::count_if(
+ channels.begin(), channels.end(),
+ [] (shared_ptr<Channel> channel) {
+ return channel->type() == ChannelType::LOGIC; });
+
+ // Create data containers for the logic data snapshots
+ {
+ lock_guard<mutex> data_lock(data_mutex_);
+
+ logic_data_.reset();
+ if (logic_channel_count != 0) {
+ logic_data_.reset(new data::Logic(
+ logic_channel_count));
+ assert(logic_data_);
+ }