summaryrefslogtreecommitdiffstats
path: root/src/MuxElements.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-01-29 15:55:17 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-01-29 15:55:17 +0100
commit4acf7a34c202293884739b40af699943d7e8e9d9 (patch)
tree1f6b2d0a8c3646723c7785aa1f3fad25b7aadc1f /src/MuxElements.h
parent2346b17f650e56f70046e95a54f356a8e3e29107 (diff)
downloaddabmux-4acf7a34c202293884739b40af699943d7e8e9d9.tar.gz
dabmux-4acf7a34c202293884739b40af699943d7e8e9d9.tar.bz2
dabmux-4acf7a34c202293884739b40af699943d7e8e9d9.zip
Add partial FIG2 label support
Add support for Ensemble label, programme services and components, although the implementation for the component label is not properly tested. (data services still to be done) Neither short labels nor UCS-2 are not yet implemented. Also, support for draftETSI TS 103 176 which redefines the meaning of Rfa is still pending.
Diffstat (limited to 'src/MuxElements.h')
-rw-r--r--src/MuxElements.h33
1 files changed, 28 insertions, 5 deletions
diff --git a/src/MuxElements.h b/src/MuxElements.h
index d116a4e..635f55f 100644
--- a/src/MuxElements.h
+++ b/src/MuxElements.h
@@ -166,27 +166,50 @@ class DabLabel
*/
int setLabel(const std::string& label);
+ /* Set the FIG2 label. label must be UTF-8.
+ *
+ * returns: 0 on success
+ */
+ int setFIG2Label(const std::string& label);
+
/* Write the label to the 16-byte buffer given in buf
* In the DAB standard, the label is 16 bytes long, and is
* padded using spaces.
*/
void writeLabel(uint8_t* buf) const;
- uint16_t flag() const { return m_flag; }
+ // For FIG 1
+ bool has_fig1_label() const { return not m_fig1_label.empty(); };
+ uint16_t flag() const { return m_fig1_flag; }
const std::string long_label() const;
const std::string short_label() const;
+ // For FIG 2
+ bool has_fig2_label() const { return not m_fig2_label.empty(); };
+ const std::string fig2_label() const;
+
+ /* FIG 2 labels are either in UCS-2 or in UTF-8. Because there are upcoming
+ * changes in the spec regarding the encoding of FIG2 (currently in draft
+ * ETSI TS 103 176 v2.2.1), the character flag is not implemented yet.
+ *
+ * Both FIG 1 and FIG 2 labels can be sent, and receiver will show the one
+ * they support.
+ */
+
private:
+ /* The m_fig1_label is not padded in any way. Stored in EBU Latin Charset */
+ std::string m_fig1_label;
+
/* The flag field selects which label characters make
* up the short label
*/
- uint16_t m_flag = 0xFFFF;
+ uint16_t m_fig1_flag = 0xFFFF;
- /* The m_label is not padded in any way */
- std::string m_label;
+ /* FIG2 label, stored in UTF-8. TODO: support UCS-2 */
+ std::string m_fig2_label;
/* Checks and calculates the flag. slabel must be EBU Latin Charset */
- int setShortLabel(const std::string& slabel);
+ int setFIG1ShortLabel(const std::string& slabel);
};