Decoder::Decoder(const srd_decoder *const dec) :
srd_decoder_(dec),
- shown_(true),
+ visible_(true),
decoder_inst_(nullptr)
{
// Query the annotation output classes
ann_classes_.at((size_t)cl->data).row = &(rows_.back());
}
- if (rows_.empty())
+ if (rows_.empty()) {
// Make sure there is a row for PDs without row declarations
- rows_.emplace_back(0, this);
+ rows_.push_back({0, this});
+
+ for (AnnotationClass& c : ann_classes_)
+ c.row = &(rows_.back());
+ }
}
Decoder::~Decoder()
return srd_decoder_->name;
}
-bool Decoder::shown() const
+bool Decoder::visible() const
{
- return shown_;
+ return visible_;
}
-void Decoder::show(bool show)
+void Decoder::set_visible(bool visible)
{
- shown_ = show;
+ visible_ = visible;
}
const vector<DecodeChannel*>& Decoder::channels() const
return result;
}
+vector<AnnotationClass*> Decoder::ann_classes()
+{
+ vector<AnnotationClass*> result;
+
+ for (AnnotationClass& c : ann_classes_)
+ result.push_back(&c);
+
+ return result;
+}
+
AnnotationClass* Decoder::get_ann_class_by_id(size_t id)
{
if (id >= ann_classes_.size())