aboutsummaryrefslogtreecommitdiffstats
path: root/src/ensembledatabase.hpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-01-16 15:44:45 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-01-16 15:44:45 +0100
commit9d3d404a46dd79ed2b7a6c39719c76839787127e (patch)
tree9f67996d2f72b0f93302d695299b173e50698244 /src/ensembledatabase.hpp
parent1df947bae7346948e08edb75616d34fcf8802dae (diff)
downloadetisnoop-9d3d404a46dd79ed2b7a6c39719c76839787127e.tar.gz
etisnoop-9d3d404a46dd79ed2b7a6c39719c76839787127e.tar.bz2
etisnoop-9d3d404a46dd79ed2b7a6c39719c76839787127e.zip
Add charset decoder for FIG1 labels
Diffstat (limited to 'src/ensembledatabase.hpp')
-rw-r--r--src/ensembledatabase.hpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/ensembledatabase.hpp b/src/ensembledatabase.hpp
index cc080ec..dee434d 100644
--- a/src/ensembledatabase.hpp
+++ b/src/ensembledatabase.hpp
@@ -41,20 +41,27 @@
namespace ensemble_database {
-enum class extended_label_charset {
- UTF8, // encoding flag = 0
- UCS2, // encoding flag = 1
+enum class charset_e {
+ COMPLETE_EBU_LATIN = 0,
+ UTF8 = 15, // encoding flag = 0
+ UCS2 = 6, // encoding flag = 1
+ UNDEFINED,
};
struct label_t {
- // FIG 1 Label and shortlabel
- std::string label;
+ // FIG 1 Label and shortlabel, in raw form
+ std::vector<uint8_t> label_bytes;
uint16_t shortlabel_flag;
+ charset_e charset = charset_e::COMPLETE_EBU_LATIN;
+
+ // Returns a utf-8 encoded shortlabel
+ std::string shortlabel() const;
+ std::string label() const;
// Extended Label from FIG 2
std::map<int, std::vector<uint8_t> > segments;
size_t segment_count = 0; // number if actual segments (not segment count as in spec)
- extended_label_charset charset;
+ charset_e extended_label_charset = charset_e::UNDEFINED;
uint8_t toggle_flag = 0;
// Assemble all segments into a UTF-8 string. Returns an
@@ -92,8 +99,6 @@ struct component_t {
bool primary;
- label_t label;
-
/* TODO
uint8_t type;