- assert(dec);
-
- map<const srd_channel*, shared_ptr<data::SignalBase> > channel_map;
-
- const unordered_set< shared_ptr<data::SignalBase> >
- sigs(session_.signalbases());
-
- GArray *const initial_pins = g_array_sized_new(FALSE, TRUE,
- sizeof(uint8_t), channel_selectors_.size());
- g_array_set_size(initial_pins, channel_selectors_.size());
-
- for (const ChannelSelector &s : channel_selectors_) {
- if (s.decoder_ != dec)
- break;
-
- const data::SignalBase *const selection =
- (data::SignalBase*)s.combo_->itemData(
- s.combo_->currentIndex()).value<void*>();
-
- for (shared_ptr<data::SignalBase> sig : sigs)
- if (sig.get() == selection) {
- channel_map[s.pdch_] = sig;
- break;
- }
-
- int selection_initial_pin = s.combo_initial_pin_->itemData(
- s.combo_initial_pin_->currentIndex()).value<int>();
-
- initial_pins->data[s.pdch_->order] = selection_initial_pin;
- }
-
- dec->set_channels(channel_map);
- dec->set_initial_pins(initial_pins);