Skip to content

Commit 0668612

Browse files
committed
TEMP
1 parent 4dfd9eb commit 0668612

10 files changed

+1089
-325
lines changed

src/dabstream.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,9 @@ void dabstream::onNewAudio(std::vector<int16_t>&& audioData,
689689
//
690690
// label - The new dynamic label (UTF-8)
691691

692-
void dabstream::onNewDynamicLabel(std::string const& /*label*/)
692+
void dabstream::onNewDynamicLabel(std::string const& label)
693693
{
694+
fprintf(stderr, "dabstream::onNewDynamicLabel: %s\n", label.c_str());
694695
// TODO
695696
}
696697

src/dsp_dab/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ set(SOURCES fft.cpp
1616
ofdm-decoder.cpp
1717
ofdm-processor.cpp
1818
pad_decoder.cpp
19+
pad_decoder_datagroup.cpp
20+
pad_decoder_dynamiclabelsegment.cpp
1921
phasereference.cpp
2022
phasetable.cpp
2123
profiling.cpp
@@ -48,6 +50,8 @@ set(HEADERS MathHelper.h
4850
ofdm-decoder.h
4951
ofdm-processor.h
5052
pad_decoder.h
53+
pad_decoder_datagroup.h
54+
pad_decoder_dynamiclabelsegment.h
5155
phasereference.h
5256
phasetable.h
5357
profiling.h

src/dsp_dab/decoder_adapter.cpp

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ DecoderAdapter::DecoderAdapter(ProgrammeHandlerInterface &mr, int16_t bitRate, A
4949
}
5050

5151
// MOT, start of X-PAD data group, see EN 301 234
52-
padDecoder.SetMOTAppType(12);
52+
padDecoder.SetMOTAppType(X_PADAppType_MOT_StartOfX);
5353
}
5454

5555
void DecoderAdapter::addtoFrame(uint8_t *v)
@@ -140,19 +140,64 @@ void DecoderAdapter::FECInfo(int total_corr_count, bool uncorr_errors)
140140
myInterface.onRsErrors(uncorr_errors, total_corr_count);
141141
}
142142

143-
void DecoderAdapter::PADChangeDynamicLabel(const DL_STATE &dl)
143+
void DecoderAdapter::PADChangeDynamicLabel(const CDynamicLabel &dl)
144144
{
145145
using charsets::CharacterSet;
146146

147+
#if 1
148+
fprintf(stderr, "_____________________________________________________\n");
149+
fprintf(stderr, "Dynamic Label: %s\n", dl.m_dynamicLabel.c_str());
150+
if (!dl.m_playItems.empty())
151+
{
152+
fprintf(stderr, "Playback:\n");
153+
for (const auto& item : dl.m_playItems)
154+
{
155+
fprintf(stderr, " - %s: '%s'\n", CDynamicLabel::DLPlusContentTypes[item.first].name, item.second.c_str());
156+
}
157+
}
158+
159+
if (!dl.m_infoItems.empty())
160+
{
161+
fprintf(stderr, "Infos:\n");
162+
for (const auto& item : dl.m_infoItems)
163+
{
164+
fprintf(stderr, " - %s: '%s'\n", CDynamicLabel::DLPlusContentTypes[item.first].name, item.second.c_str());
165+
}
166+
}
167+
168+
if (!dl.m_programmeItems.empty())
169+
{
170+
fprintf(stderr, "Programm:\n");
171+
for (const auto& item : dl.m_programmeItems)
172+
{
173+
fprintf(stderr, " - %s: '%s'\n", CDynamicLabel::DLPlusContentTypes[item.first].name, item.second.c_str());
174+
}
175+
}
176+
177+
if (!dl.m_interactivityItems.empty())
178+
{
179+
fprintf(stderr, "Interactivity:\n");
180+
for (const auto& item : dl.m_interactivityItems)
181+
{
182+
fprintf(stderr, " - %s: '%s'\n", CDynamicLabel::DLPlusContentTypes[item.first].name, item.second.c_str());
183+
}
184+
}
185+
186+
if (!dl.m_descriptorItems.empty())
187+
{
188+
fprintf(stderr, "Descriptor:\n");
189+
for (const auto& item : dl.m_descriptorItems)
190+
{
191+
fprintf(stderr, " - %s: '%s'\n", CDynamicLabel::DLPlusContentTypes[item.first].name, item.second.c_str());
192+
}
193+
}
194+
#endif
195+
147196
if (dl.raw.empty()) {
148197
myInterface.onNewDynamicLabel("");
149198
}
150199
else {
151-
myInterface.onNewDynamicLabel(
152-
charsets::toUtf8(
153-
dl.raw.data(),
154-
(CharacterSet)dl.charset,
155-
dl.raw.size()));
200+
myInterface.onNewDynamicLabel(dl.m_dynamicLabel);
156201
}
157202
}
158203

src/dsp_dab/decoder_adapter.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class DecoderAdapter: public DabProcessor, public SubchannelSinkObserver, public
5858
virtual void FECInfo(int /*total_corr_count*/, bool /*uncorr_errors*/);
5959

6060
// IPADDecoderObserver impl
61-
virtual void PADChangeDynamicLabel(const DL_STATE& dl);
61+
virtual void PADChangeDynamicLabel(const CDynamicLabel& dl);
6262
virtual void PADChangeSlide(const MOT_FILE& slide);
6363
virtual void PADLengthError(size_t announced_xpad_len, size_t xpad_len);
6464

@@ -76,5 +76,6 @@ class DecoderAdapter: public DabProcessor, public SubchannelSinkObserver, public
7676
int audioChannels = 0;
7777
std::string audioFormat;
7878
};
79+
7980
#endif // DECODER_ADAPTER_H
8081

0 commit comments

Comments
 (0)