diff options
author | Stefan Pöschel <github@basicmaster.de> | 2015-05-24 23:42:35 +0200 |
---|---|---|
committer | Stefan Pöschel <github@basicmaster.de> | 2015-05-24 23:42:35 +0200 |
commit | f470de09c4215c39387fbe6d85330c90fecea10d (patch) | |
tree | 31dbb58ab8864cbb3029e92e0ae029565f2cbee2 /src/MuxElements.h | |
parent | 2391d2a38ff9d85f802f2453ffe20fb58915c097 (diff) | |
download | dabmux-f470de09c4215c39387fbe6d85330c90fecea10d.tar.gz dabmux-f470de09c4215c39387fbe6d85330c90fecea10d.tar.bz2 dabmux-f470de09c4215c39387fbe6d85330c90fecea10d.zip |
Labels: use spaces instead of NULs for trailing padding
The NULs ATM used for trailing label padding are not defined in the EBU Latin
based charset we use. As all 16 label bytes must be used, use spaces instead,
like real-world broadcasters do.
Diffstat (limited to 'src/MuxElements.h')
-rw-r--r-- | src/MuxElements.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/MuxElements.h b/src/MuxElements.h index 3653ea4..22112db 100644 --- a/src/MuxElements.h +++ b/src/MuxElements.h @@ -61,7 +61,7 @@ class DabLabel * -2 if the short_label is too long * -3 if the text is too long */ - int setLabel(const std::string& text, const std::string& short_label); + int setLabel(const std::string& label, const std::string& short_label); /* Same as above, but sets the flag to 0xff00, truncating at 8 * characters. @@ -69,17 +69,20 @@ class DabLabel * returns: 0 on success * -3 if the text is too long */ - int setLabel(const std::string& text); + int setLabel(const std::string& label); const char* text() const { return m_text; } uint16_t flag() const { return m_flag; } + const std::string long_label() const { return m_label; } const std::string short_label() const; private: - // In the DAB standard, the label is 16 chars. - // We keep it here zero-terminated - char m_text[17]; + // In the DAB standard, the label is 16 bytes long. + // We use spaces for padding at the end if needed. + char m_text[16]; uint16_t m_flag; + std::string m_label; + int setShortLabel(const std::string& slabel); }; |