34 prev_ann_start_sample_(0)
57 deque<const pv::data::decode::Annotation*> &dest,
58 uint64_t start_sample, uint64_t end_sample)
const 61 bool all_ann_classes_enabled =
true;
62 bool all_ann_classes_disabled =
true;
64 uint32_t max_ann_class_id = 0;
67 all_ann_classes_enabled =
false;
69 all_ann_classes_disabled =
false;
70 if (c->id > max_ann_class_id)
71 max_ann_class_id = c->id;
74 if (all_ann_classes_enabled) {
77 if ((annotation.end_sample() > start_sample) &&
78 (annotation.start_sample() <= end_sample))
79 dest.push_back(&annotation);
81 if (!all_ann_classes_disabled) {
83 vector<size_t> class_visible;
84 class_visible.resize(max_ann_class_id + 1, 0);
87 class_visible[c->id] = 1;
90 if ((class_visible[annotation.ann_class_id()]) &&
91 (annotation.end_sample() > start_sample) &&
92 (annotation.start_sample() <= end_sample))
93 dest.push_back(&annotation);
105 const srd_proto_data_annotation *
const pda = (
const srd_proto_data_annotation*)pdata->data;
107 uint32_t ann_class_id = pda->ann_class;
113 const char*
const* ann_texts = (
char**)pda->ann_text;
114 const QString ann0 = QString::fromUtf8(ann_texts[0]);
115 vector<QString>* storage_entry = &(
ann_texts_[ann0]);
117 if (storage_entry->empty()) {
119 storage_entry->emplace_back(QString::fromUtf8(*ann_texts));
122 storage_entry->shrink_to_fit();
138 }
while ((it->start_sample() > pdata->start_sample) && (it !=
annotations_.begin()));
144 it =
annotations_.emplace(it, pdata->start_sample, pdata->end_sample,
145 storage_entry, ann_class_id,
this);
148 annotations_.emplace_back(pdata->start_sample, pdata->end_sample,
149 storage_entry, ann_class_id,
this);
uint64_t get_max_sample() const
uint64_t get_annotation_count() const
void get_annotation_subset(deque< const pv::data::decode::Annotation * > &dest, uint64_t start_sample, uint64_t end_sample) const
const Annotation * emplace_annotation(srd_proto_data *pdata)
vector< AnnotationClass * > ann_classes() const
uint64_t prev_ann_start_sample_
deque< Annotation > annotations_
unordered_map< QString, vector< QString > > ann_texts_
const deque< Annotation > & annotations() const