+ // Query the annotation output classes
+ uint32_t i = 0;
+ for (GSList *l = dec->annotations; l; l = l->next) {
+ char **ann_class = (char**)l->data;
+ char *name = ann_class[0];
+ char *desc = ann_class[1];
+ ann_classes_.push_back({i++, name, desc, nullptr, true}); // Visible by default
+ }
+
+ // Query the binary output classes
+ i = 0;
+ for (GSList *l = dec->binary; l; l = l->next) {
+ char **bin_class = (char**)l->data;
+ char *name = bin_class[0];
+ char *desc = bin_class[1];
+ bin_classes_.push_back({i++, name, desc});
+ }
+
+ // Query the annotation rows and reference them by the classes that use them
+ uint32_t row_count = 0;
+ for (const GSList *rl = srd_decoder_->annotation_rows; rl; rl = rl->next)
+ row_count++;
+ rows_.reserve(row_count);
+
+ i = 0;
+ for (const GSList *rl = srd_decoder_->annotation_rows; rl; rl = rl->next) {
+ const srd_decoder_annotation_row *const srd_row = (srd_decoder_annotation_row *)rl->data;
+ assert(srd_row);
+ rows_.push_back({i++, this, srd_row});
+
+ // FIXME PV can crash from .at() if a PD's ann classes are defined incorrectly
+ for (const GSList *cl = srd_row->ann_classes; cl; cl = cl->next)
+ ann_classes_.at((size_t)cl->data).row = &(rows_.back());
+ }
+
+ if (rows_.empty())
+ // Make sure there is a row for PDs without row declarations
+ rows_.emplace_back(0, this);