diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-07-15 09:26:03 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-07-15 09:26:03 +0200 |
commit | 12d6af84fd027bd6a4758ac3ec57d2c320f4b25c (patch) | |
tree | 3c29138e14413416c358ec98cf702edfe9891c38 | |
parent | 7e669371cadfc8ccb57ff8de42503e153ff3971a (diff) | |
download | dabmux-12d6af84fd027bd6a4758ac3ec57d2c320f4b25c.tar.gz dabmux-12d6af84fd027bd6a4758ac3ec57d2c320f4b25c.tar.bz2 dabmux-12d6af84fd027bd6a4758ac3ec57d2c320f4b25c.zip |
Improve print for user-application type at startup
-rw-r--r-- | src/utils.cpp | 73 |
1 files changed, 40 insertions, 33 deletions
diff --git a/src/utils.cpp b/src/utils.cpp index c2916d2..253b703 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -242,6 +242,40 @@ void printServices(const vector<shared_ptr<DabService> >& services) } } +static void write_uatype_to_stringstream(stringstream& ss, uint16_t uaType) +{ + ss << "app type: "; + switch (uaType) { + case FIG0_13_APPTYPE_SLIDESHOW: + ss << "MOT Slideshow"; + break; + case FIG0_13_APPTYPE_WEBSITE: + ss << "MOT Broadcast Website"; + break; + case FIG0_13_APPTYPE_TPEG: + ss << "TPEG"; + break; + case FIG0_13_APPTYPE_DGPS: + ss << "DGPS"; + break; + case FIG0_13_APPTYPE_TMC: + ss << "TMC"; + break; + case FIG0_13_APPTYPE_SPI: + ss << "SPI/EPG"; + break; + case FIG0_13_APPTYPE_DABJAVA: + ss << "DAB Java"; + break; + case FIG0_13_APPTYPE_JOURNALINE: + ss << "Journaline"; + break; + default: + ss << "Unknown: " << uaType; + break; + } +} + void printComponent(const shared_ptr<DabComponent>& component, const std::shared_ptr<dabEnsemble>& ensemble) { etiLog.log(info, " service id: 0x%x (%u)", @@ -265,44 +299,17 @@ void printComponent(const shared_ptr<DabComponent>& component, const std::shared component->packet.datagroup); for (const auto& userapp : component->packet.uaTypes) { - etiLog.log(info, " (packet) app type: %u", - userapp.uaType); + stringstream ss; + ss << " (packet) "; + write_uatype_to_stringstream(ss, userapp.uaType); + etiLog.level(info) << ss.str(); } } else { for (const auto& userapp : component->audio.uaTypes) { stringstream ss; - ss << " (audio) app type: "; - switch (userapp.uaType) { - case FIG0_13_APPTYPE_SLIDESHOW: - ss << "MOT Slideshow"; - break; - case FIG0_13_APPTYPE_WEBSITE: - ss << "MOT Broadcast Website"; - break; - case FIG0_13_APPTYPE_TPEG: - ss << "TPEG"; - break; - case FIG0_13_APPTYPE_DGPS: - ss << "DGPS"; - break; - case FIG0_13_APPTYPE_TMC: - ss << "TMC"; - break; - case FIG0_13_APPTYPE_SPI: - ss << "SPI/EPG"; - break; - case FIG0_13_APPTYPE_DABJAVA: - ss << "DAB Java"; - break; - case FIG0_13_APPTYPE_JOURNALINE: - ss << "Journaline"; - break; - default: - ss << "Unknown: " << userapp.uaType; - break; - } - + ss << " (packet) "; + write_uatype_to_stringstream(ss, userapp.uaType); etiLog.level(info) << ss.str(); } } |