X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fsession.cpp;h=fa5f95bb2ca7832cb6ba478524a70a564ba06ed3;hp=516e1acd5ad6ff1e6b52a277f97c042e28e37872;hb=ad908057e13224eee9f983685e0ccc7db1ded0e9;hpb=724f29f311db4f8b47169e58f3f3b50e6a50ed08 diff --git a/pv/session.cpp b/pv/session.cpp index 516e1acd..fa5f95bb 100644 --- a/pv/session.cpp +++ b/pv/session.cpp @@ -53,6 +53,7 @@ #ifdef ENABLE_DECODE #include +#include "data/decodesignal.hpp" #endif using std::bad_alloc; @@ -437,10 +438,10 @@ void Session::set_default_device() /** * Convert generic options to data types that are specific to InputFormat. * - * @param[in] user_spec vector of tokenized words, string format - * @param[in] fmt_opts input format's options, result of InputFormat::options() + * @param[in] user_spec Vector of tokenized words, string format. + * @param[in] fmt_opts Input format's options, result of InputFormat::options(). * - * @return map of options suitable for InputFormat::create_input() + * @return Map of options suitable for InputFormat::create_input(). */ map Session::input_format_options(vector user_spec, @@ -687,14 +688,13 @@ bool Session::add_decoder(srd_decoder *const dec) decoder_stack->stack().front()->set_channels(channels); // Create the decode signal - shared_ptr signalbase = - make_shared(nullptr, data::SignalBase::DecodeChannel); + shared_ptr signal = + make_shared(decoder_stack); - signalbase->set_decoder_stack(decoder_stack); - signalbases_.insert(signalbase); + signalbases_.insert(signal); for (shared_ptr view : views_) - view->add_decode_signal(signalbase); + view->add_decode_signal(signal); } catch (runtime_error e) { return false; } @@ -707,12 +707,12 @@ bool Session::add_decoder(srd_decoder *const dec) return true; } -void Session::remove_decode_signal(shared_ptr signalbase) +void Session::remove_decode_signal(shared_ptr signal) { - signalbases_.erase(signalbase); + signalbases_.erase(signal); for (shared_ptr view : views_) - view->remove_decode_signal(signalbase); + view->remove_decode_signal(signal); signals_changed(); }