Skip to content

Commit

Permalink
Using announcement names in english for building ensemble information…
Browse files Browse the repository at this point in the history
… string (Issue #70)
  • Loading branch information
KejPi committed Mar 15, 2023
1 parent 32f5752 commit b317524
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
21 changes: 21 additions & 0 deletions gui/dabtables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,27 @@ QString DabTables::getAnnouncementName(DabAnnouncement announcement)
}
}

QString DabTables::getAnnouncementNameEnglish(DabAnnouncement announcement)
{
// ETSI TS 101 756 V2.4.1 [Table 15]
switch (announcement)
{
case DabAnnouncement::Alarm: return QString("Alarm");
case DabAnnouncement::Traffic: return QString("Traffic News");
case DabAnnouncement::Transport: return QString("Transport News");
case DabAnnouncement::Warning: return QString("Warning");
case DabAnnouncement::News: return QString("News");
case DabAnnouncement::Weather: return QString("Weather");
case DabAnnouncement::Event: return QString("Event");
case DabAnnouncement::Special: return QString("Special event");
case DabAnnouncement::Programme: return QString("Radio Info");
case DabAnnouncement::Sport: return QString("Sport news");
case DabAnnouncement::Financial: return QString("Financial news");
case DabAnnouncement::AlarmTest: return QString("Alarm Test");
default: return QString("Unknown");
}
}

const QList<uint16_t> DabTables::ASwValues =
{
(1 << static_cast<int>(DabAnnouncement::Alarm)),
Expand Down
3 changes: 2 additions & 1 deletion gui/dabtables.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ class DabTables
static QString getPtyName(const uint8_t pty);
static QString getLangName(int lang);
static QString getCountryName(uint32_t SId);
static QString getAnnouncementName(DabAnnouncement announcement);
static QString getAnnouncementName(DabAnnouncement announcement);
static QString getAnnouncementNameEnglish(DabAnnouncement announcement);
};

#endif // DABTABLES_H
4 changes: 2 additions & 2 deletions gui/radiocontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ QString RadioControl::ensembleConfigurationString() const
{
if ((1 << b) & s.ASu)
{
strOut << DabTables::getAnnouncementName(static_cast<DabAnnouncement>(b)) << ", ";
strOut << DabTables::getAnnouncementNameEnglish(static_cast<DabAnnouncement>(b)) << ", ";
}
}
strOut << QString("Cluster IDs [");
Expand Down Expand Up @@ -1639,7 +1639,7 @@ void RadioControl::announcementHandler(dabsdrAsw_t *pAnnouncement)
if ((announcementId >= 0) && (pAnnouncement->ASwFlags & m_currentService.announcement.enaFlags))
{ // valid ASw
#if RADIO_CONTROL_VERBOSE > 0
qDebug() << DabTables::getAnnouncementName(static_cast<DabAnnouncement>(announcementId))
qDebug() << DabTables::getAnnouncementNameEnglish(static_cast<DabAnnouncement>(announcementId))
<< "announcement in subchannel" << pAnnouncement->subChId
<< "cluster ID" << pAnnouncement->clusterId;
#endif
Expand Down

0 comments on commit b317524

Please sign in to comment.