- /* Return NULL if no input module wanted to touch this. */
- if (!inputs[i]) {
- g_critical("Error: no matching input module found.");
- return NULL;
- }
-
- return inputs[i];
-}
+ try
+ {
+ lock_guard<boost::shared_mutex> lock(signals_mutex_);
+
+ // Create the decoder
+ decoder_stack = shared_ptr<data::DecoderStack>(
+ new data::DecoderStack(*this, dec));
+
+ // Make a list of all the channels
+ std::vector<const srd_channel*> all_channels;
+ for(const GSList *i = dec->channels; i; i = i->next)
+ all_channels.push_back((const srd_channel*)i->data);
+ for(const GSList *i = dec->opt_channels; i; i = i->next)
+ all_channels.push_back((const srd_channel*)i->data);
+
+ // Auto select the initial channels
+ for (const srd_channel *pdch : all_channels)
+ for (shared_ptr<view::Signal> s : signals_)
+ {
+ shared_ptr<view::LogicSignal> l =
+ dynamic_pointer_cast<view::LogicSignal>(s);
+ if (l && QString::fromUtf8(pdch->name).
+ toLower().contains(
+ l->name().toLower()))
+ channels[pdch] = l;
+ }