id: dtv_dvbt_map
label: DVB-T Map
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: transmission_mode
    label: Transmission Mode
    dtype: enum
    options: [T2k, T8k]
    option_labels: [2K, 8K]
    option_attributes:
        payload_length: [1512, 6048]
        val: [dtv.T2k, dtv.T8k]
-   id: gain
    label: Gain
    dtype: complex
    default: '1'

inputs:
-   domain: stream
    dtype: byte
    vlen: ${ transmission_mode.payload_length }

outputs:
-   domain: stream
    dtype: complex
    vlen: ${ transmission_mode.payload_length }

templates:
    imports: from gnuradio import dtv
    make: dtv.dvbt_map(${transmission_mode.payload_length}, ${constellation.val},
        ${hierarchy.val}, ${transmission_mode.val}, ${gain})

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

file_format: 1
