+void DecodeSignal::prepare_annotation_segment()
+{
+ // TODO Won't work for multiple segments
+ rows_.emplace_back(map<const decode::Row, decode::RowData>());
+ current_rows_ = &(rows_.back());
+
+ // Add annotation classes
+ for (const shared_ptr<decode::Decoder> &dec : stack_) {
+ assert(dec);
+ const srd_decoder *const decc = dec->decoder();
+ assert(dec->decoder());
+
+ // Add a row for the decoder if it doesn't have a row list
+ if (!decc->annotation_rows)
+ (*current_rows_)[Row(decc)] = decode::RowData();
+
+ // Add the decoder rows
+ for (const GSList *l = decc->annotation_rows; l; l = l->next) {
+ const srd_decoder_annotation_row *const ann_row =
+ (srd_decoder_annotation_row *)l->data;
+ assert(ann_row);
+
+ const Row row(decc, ann_row);
+
+ // Add a new empty row data object
+ (*current_rows_)[row] = decode::RowData();
+ }
+ }
+}
+