+void DecoderStack::remove(int index)
+{
+ assert(index >= 0);
+ assert(index < (int)_stack.size());
+
+ // Find the decoder in the stack
+ auto iter = _stack.begin();
+ for(int i = 0; i < index; i++, iter++)
+ assert(iter != _stack.end());
+
+ // Delete the element
+ _stack.erase(iter);
+}
+
+int64_t DecoderStack::samples_decoded() const
+{
+ lock_guard<mutex> decode_lock(_output_mutex);
+ return _samples_decoded;
+}
+
+std::vector<Row> DecoderStack::get_visible_rows() const
+{
+ lock_guard<mutex> lock(_output_mutex);
+
+ vector<Row> rows;
+
+ for (const shared_ptr<decode::Decoder> &dec : _stack)
+ {
+ assert(dec);
+ if (!dec->shown())
+ continue;
+
+ 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)
+ rows.push_back(Row(decc));
+
+ // 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);
+ rows.push_back(Row(decc, ann_row));
+ }
+ }
+
+ return rows;
+}
+
+void DecoderStack::get_annotation_subset(
+ std::vector<pv::data::decode::Annotation> &dest,
+ const Row &row, uint64_t start_sample,
+ uint64_t end_sample) const