From: Uwe Hermann Date: Fri, 31 Jan 2014 20:03:03 +0000 (+0100) Subject: pv::data::decode::Annotation: Add row() and set_row(). X-Git-Tag: pulseview-0.2.0~100 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=3f53457656c72dc870f603677843613b708b4ea1;p=pulseview.git pv::data::decode::Annotation: Add row() and set_row(). Keep track of the "annotation row" this annotation is supposed to be displayed on. --- diff --git a/pv/data/decode/annotation.cpp b/pv/data/decode/annotation.cpp index b0517ae6..573fefaf 100644 --- a/pv/data/decode/annotation.cpp +++ b/pv/data/decode/annotation.cpp @@ -40,6 +40,7 @@ Annotation::Annotation(const srd_proto_data *const pdata) : assert(pda); _format = pda->ann_format; + _row = 0; const char *const *annotations = (char**)pda->ann_text; while(*annotations) { @@ -63,11 +64,21 @@ int Annotation::format() const return _format; } +int Annotation::row() const +{ + return _row; +} + const std::vector& Annotation::annotations() const { return _annotations; } +void Annotation::set_row(int row) +{ + _row = row; +} + } // namespace decode } // namespace data } // namespace pv diff --git a/pv/data/decode/annotation.h b/pv/data/decode/annotation.h index 0d7fd5d5..9cacafae 100644 --- a/pv/data/decode/annotation.h +++ b/pv/data/decode/annotation.h @@ -39,12 +39,16 @@ public: uint64_t start_sample() const; uint64_t end_sample() const; int format() const; + int row() const; const std::vector& annotations() const; + void set_row(int row); + private: uint64_t _start_sample; uint64_t _end_sample; int _format; + int _row; std::vector _annotations; };