<?xml version="1.0"?>
<!--
###################################################
## DVB-T2 P1 Symbol Insertion
###################################################
 -->
<block>
  <name>P1 Symbol Insertion</name>
  <key>dtv_dvbt2_p1insertion_cc</key>
  <import>from gnuradio import dtv</import>
  <make>dtv.dvbt2_p1insertion_cc($carriermode.val, #slurp
#if str($version) == 'VERSION_111'
$fftsize1.val, #slurp
#else
#if str($preamble2) == 'PREAMBLE_T2_SISO' or str($preamble2) == 'PREAMBLE_T2_MISO'
$fftsize1.val, #slurp
#else
$fftsize2.val, #slurp
#end if
#end if
$guardinterval.val, $numdatasyms, #slurp
#if str($version) == 'VERSION_111'
$preamble1.val, #slurp
#else
$preamble2.val, #slurp
#end if
$showlevels.val, $vclip)</make>
  <param>
    <name>Extended Carrier Mode</name>
    <key>carriermode</key>
    <type>enum</type>
    <option>
      <name>Normal</name>
      <key>CARRIERS_NORMAL</key>
      <opt>val:dtv.CARRIERS_NORMAL</opt>
    </option>
    <option>
      <name>Extended</name>
      <key>CARRIERS_EXTENDED</key>
      <opt>val:dtv.CARRIERS_EXTENDED</opt>
    </option>
  </param>
  <param>
    <name>FFT Size</name>
    <key>fftsize1</key>
    <type>enum</type>
    <hide>#if str($version) == 'VERSION_111' then $preamble1.hide_base else $preamble2.hide_base</hide>
    <option>
      <name>1K</name>
      <key>FFTSIZE_1K</key>
      <opt>val:dtv.FFTSIZE_1K</opt>
    </option>
    <option>
      <name>2K</name>
      <key>FFTSIZE_2K</key>
      <opt>val:dtv.FFTSIZE_2K</opt>
    </option>
    <option>
      <name>4K</name>
      <key>FFTSIZE_4K</key>
      <opt>val:dtv.FFTSIZE_4K</opt>
    </option>
    <option>
      <name>8K</name>
      <key>FFTSIZE_8K</key>
      <opt>val:dtv.FFTSIZE_8K</opt>
    </option>
    <option>
      <name>8K DVB-T2 GI</name>
      <key>FFTSIZE_8K_T2GI</key>
      <opt>val:dtv.FFTSIZE_8K_T2GI</opt>
    </option>
    <option>
      <name>16K</name>
      <key>FFTSIZE_16K</key>
      <opt>val:dtv.FFTSIZE_16K</opt>
    </option>
    <option>
      <name>32K</name>
      <key>FFTSIZE_32K</key>
      <opt>val:dtv.FFTSIZE_32K</opt>
    </option>
    <option>
      <name>32K DVB-T2 GI</name>
      <key>FFTSIZE_32K_T2GI</key>
      <opt>val:dtv.FFTSIZE_32K_T2GI</opt>
    </option>
  </param>
  <param>
    <name>FFT Size</name>
    <key>fftsize2</key>
    <type>enum</type>
    <hide>#if str($version) == 'VERSION_111' then $preamble1.hide_lite else $preamble2.hide_lite</hide>
    <option>
      <name>2K</name>
      <key>FFTSIZE_2K</key>
      <opt>val:dtv.FFTSIZE_2K</opt>
    </option>
    <option>
      <name>4K</name>
      <key>FFTSIZE_4K</key>
      <opt>val:dtv.FFTSIZE_4K</opt>
    </option>
    <option>
      <name>8K</name>
      <key>FFTSIZE_8K</key>
      <opt>val:dtv.FFTSIZE_8K</opt>
    </option>
    <option>
      <name>8K DVB-T2 GI</name>
      <key>FFTSIZE_8K_T2GI</key>
      <opt>val:dtv.FFTSIZE_8K_T2GI</opt>
    </option>
    <option>
      <name>16K</name>
      <key>FFTSIZE_16K</key>
      <opt>val:dtv.FFTSIZE_16K</opt>
    </option>
    <option>
      <name>16K DVB-T2 GI</name>
      <key>FFTSIZE_16K_T2GI</key>
      <opt>val:dtv.FFTSIZE_16K_T2GI</opt>
    </option>
  </param>
  <param>
    <name>Guard Interval</name>
    <key>guardinterval</key>
    <type>enum</type>
    <option>
      <name>1/32</name>
      <key>GI_1_32</key>
      <opt>val:dtv.GI_1_32</opt>
    </option>
    <option>
      <name>1/16</name>
      <key>GI_1_16</key>
      <opt>val:dtv.GI_1_16</opt>
    </option>
    <option>
      <name>1/8</name>
      <key>GI_1_8</key>
      <opt>val:dtv.GI_1_8</opt>
    </option>
    <option>
      <name>1/4</name>
      <key>GI_1_4</key>
      <opt>val:dtv.GI_1_4</opt>
    </option>
    <option>
      <name>1/128</name>
      <key>GI_1_128</key>
      <opt>val:dtv.GI_1_128</opt>
    </option>
    <option>
      <name>19/128</name>
      <key>GI_19_128</key>
      <opt>val:dtv.GI_19_128</opt>
    </option>
    <option>
      <name>19/256</name>
      <key>GI_19_256</key>
      <opt>val:dtv.GI_19_256</opt>
    </option>
  </param>
  <param>
    <name>Number of Data Symbols</name>
    <key>numdatasyms</key>
    <value>100</value>
    <type>int</type>
  </param>
  <param>
    <name>Specification Version</name>
    <key>version</key>
    <type>enum</type>
    <option>
      <name>1.1.1</name>
      <key>VERSION_111</key>
      <opt>val:dtv.VERSION_111</opt>
      <opt>hide_111:</opt>
      <opt>hide_131:all</opt>
    </option>
    <option>
      <name>1.3.1</name>
      <key>VERSION_131</key>
      <opt>val:dtv.VERSION_131</opt>
      <opt>hide_111:all</opt>
      <opt>hide_131:</opt>
    </option>
  </param>
  <param>
    <name>Preamble</name>
    <key>preamble1</key>
    <type>enum</type>
    <hide>$version.hide_111</hide>
    <option>
      <name>T2 SISO</name>
      <key>PREAMBLE_T2_SISO</key>
      <opt>val:dtv.PREAMBLE_T2_SISO</opt>
      <opt>hide_lite:all</opt>
      <opt>hide_base:</opt>
    </option>
    <option>
      <name>T2 MISO</name>
      <key>PREAMBLE_T2_MISO</key>
      <opt>val:dtv.PREAMBLE_T2_MISO</opt>
      <opt>hide_lite:all</opt>
      <opt>hide_base:</opt>
    </option>
  </param>
  <param>
    <name>Preamble</name>
    <key>preamble2</key>
    <type>enum</type>
    <hide>$version.hide_131</hide>
    <option>
      <name>T2 SISO</name>
      <key>PREAMBLE_T2_SISO</key>
      <opt>val:dtv.PREAMBLE_T2_SISO</opt>
      <opt>hide_lite:all</opt>
      <opt>hide_base:</opt>
    </option>
    <option>
      <name>T2 MISO</name>
      <key>PREAMBLE_T2_MISO</key>
      <opt>val:dtv.PREAMBLE_T2_MISO</opt>
      <opt>hide_lite:all</opt>
      <opt>hide_base:</opt>
    </option>
    <option>
      <name>T2-Lite SISO</name>
      <key>PREAMBLE_T2_LITE_SISO</key>
      <opt>val:dtv.PREAMBLE_T2_LITE_SISO</opt>
      <opt>hide_lite:</opt>
      <opt>hide_base:all</opt>
    </option>
    <option>
      <name>T2-Lite MISO</name>
      <key>PREAMBLE_T2_LITE_MISO</key>
      <opt>val:dtv.PREAMBLE_T2_LITE_MISO</opt>
      <opt>hide_lite:</opt>
      <opt>hide_base:all</opt>
    </option>
  </param>
  <param>
    <name>Show Peak IQ Levels</name>
    <key>showlevels</key>
    <type>enum</type>
    <option>
      <name>Off</name>
      <key>SHOWLEVELS_OFF</key>
      <opt>val:dtv.SHOWLEVELS_OFF</opt>
      <opt>hide_vclip:all</opt>
    </option>
    <option>
      <name>On</name>
      <key>SHOWLEVELS_ON</key>
      <opt>val:dtv.SHOWLEVELS_ON</opt>
      <opt>hide_vclip:</opt>
    </option>
  </param>
  <param>
    <name>Vclip</name>
    <key>vclip</key>
    <value>3.3</value>
    <type>float</type>
    <hide>$showlevels.hide_vclip</hide>
  </param>
  <sink>
    <name>in</name>
    <type>complex</type>
  </sink>
  <source>
    <name>out</name>
    <type>complex</type>
  </source>
</block>
