diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-06-17 07:50:31 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-06-17 07:50:31 +0200 |
commit | 27e489a4b40a139ace3c679215e44f109f006127 (patch) | |
tree | 239a8385c059dc9176270fe993276107adaa537e /src/DabMultiplexer.cpp | |
parent | 02bdb2a0eedbb3ffd4870df0c0e69fd5dbcec856 (diff) | |
download | dabmux-27e489a4b40a139ace3c679215e44f109f006127.tar.gz dabmux-27e489a4b40a139ace3c679215e44f109f006127.tar.bz2 dabmux-27e489a4b40a139ace3c679215e44f109f006127.zip |
Use enum for transmission mode
Diffstat (limited to 'src/DabMultiplexer.cpp')
-rw-r--r-- | src/DabMultiplexer.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/DabMultiplexer.cpp b/src/DabMultiplexer.cpp index a86a1c7..3421338 100644 --- a/src/DabMultiplexer.cpp +++ b/src/DabMultiplexer.cpp @@ -374,7 +374,8 @@ void DabMultiplexer::mux_frame(std::vector<std::shared_ptr<DabOutput> >& outputs vector<DabSubchannel*>::iterator subchannel; // FIC Length, DAB Mode I, II, IV -> FICL = 24, DAB Mode III -> FICL = 32 - unsigned FICL = (ensemble->mode == 3 ? 32 : 24); + unsigned FICL = + (ensemble->transmission_mode == TransmissionMode_e::TM_III ? 32 : 24); // For EDI, save ETI(LI) Management data into a TAG Item DETI edi::TagDETI edi_tagDETI; @@ -437,7 +438,20 @@ void DabMultiplexer::mux_frame(std::vector<std::shared_ptr<DabOutput> >& outputs //****** MID ******// //Mode Identity, 2 bits, 01 ModeI, 10 modeII, 11 ModeIII, 00 ModeIV - fc->MID = edi_tagDETI.mid = ensemble->mode; //mode 2 needs 3 FIB, 3*32octets = 96octets + switch (ensemble->transmission_mode) { + case TransmissionMode_e::TM_I: + fc->MID = edi_tagDETI.mid = 1; + break; + case TransmissionMode_e::TM_II: + fc->MID = edi_tagDETI.mid = 2; + break; + case TransmissionMode_e::TM_III: + fc->MID = edi_tagDETI.mid = 3; + break; + case TransmissionMode_e::TM_IV: + fc->MID = edi_tagDETI.mid = 0; + break; + } //****** FL ******// /* Frame Length, 11 bits, nb of words(4 bytes) in STC, EOH and MST @@ -563,7 +577,7 @@ void DabMultiplexer::mux_frame(std::vector<std::shared_ptr<DabOutput> >& outputs // Insert all FIBs fig_carousel.update(currentFrame); - const bool fib3_present = ensemble->mode == 3; + const bool fib3_present = (ensemble->transmission_mode == TransmissionMode_e::TM_III); index += fig_carousel.write_fibs(&etiFrame[index], currentFrame % 4, fib3_present); /********************************************************************** |