id: dtv_dvbt_viterbi_decoder
label: Viterbi Decoder
flags: [ python, cpp ]

parameters:
-   id: constellation
    label: Constellation Type
    dtype: enum
    options: [qpsk, 16qam, 64qam]
    option_labels: [QPSK, 16QAM, 64QAM]
    option_attributes:
        val: [dtv.MOD_QPSK, dtv.MOD_16QAM, dtv.MOD_64QAM]
-   id: hierarchy
    label: Hierarchy Type
    dtype: enum
    options: [nh, alpha1, alpha2, alpha4]
    option_labels: [Non Hierarchical, Alpha 1, Alpha 2, Alpha 4]
    option_attributes:
        val: [dtv.NH, dtv.ALPHA1, dtv.ALPHA2, dtv.ALPHA4]
-   id: code_rate
    label: Code rate
    dtype: enum
    options: [C1_2, C2_3, C3_4, C5_6, C7_8]
    option_labels: [1/2, 2/3, 3/4, 5/6, 7/8]
    option_attributes:
        val: [dtv.C1_2, dtv.C2_3, dtv.C3_4, dtv.C5_6, dtv.C7_8]
-   id: type
    label: Type
    dtype: enum
    options: [i, s, b]
    option_labels: [Int, Short, Byte]
    option_attributes:
        io: [int, short, byte]
    hide: part
-   id: block_size
    label: Block Size
    dtype: int

inputs:
-   domain: stream
    dtype: byte

outputs:
-   domain: stream
    dtype: ${ type.io }

templates:
    imports: from gnuradio import dtv
    make: dtv.dvbt_viterbi_decoder(${constellation.val}, ${hierarchy.val}, ${code_rate.val},
        ${block_size})

cpp_templates:
    includes: ['#include <gnuradio/dtv/dvbt_viterbi_decoder.h>']
    declarations: 'dtv::dvbt_viterbi_decoder::sptr ${id};'
    make: |-
        this->${id} = dtv::dvbt_viterbi_decoder::make(
            ${constellation.val},
            ${hierarchy.val},
            ${code_rate.val},
            ${block_size});
    link: ['gnuradio::gnuradio-dtv']
    translations:
        dtv\.: 'dtv::'

file_format: 1
