+QComboBox* DecodeTrace::create_channel_selector_initial_pin(QWidget *parent,
+ const shared_ptr<data::decode::Decoder> &dec, const srd_channel *const pdch)
+{
+ QComboBox *selector = new QComboBox(parent);
+
+ selector->addItem("0", qVariantFromValue((int)SRD_INITIAL_PIN_LOW));
+ selector->addItem("1", qVariantFromValue((int)SRD_INITIAL_PIN_HIGH));
+ selector->addItem("X", qVariantFromValue((int)SRD_INITIAL_PIN_SAME_AS_SAMPLE0));
+
+ // Default to index 2 (SRD_INITIAL_PIN_SAME_AS_SAMPLE0).
+ const int idx = (!dec->initial_pins()) ? 2 : dec->initial_pins()->data[pdch->order];
+ selector->setCurrentIndex(idx);
+
+ selector->setToolTip("Initial (assumed) pin value before the first sample");
+
+ return selector;
+}
+