<?xml version="1.0"?>
<!--
###################################################
## DVB Baseband Scrambler
###################################################
 -->
<block>
  <name>BBscrambler</name>
  <key>dtv_dvb_bbscrambler_bb</key>
  <import>from gnuradio import dtv</import>
  <make>dtv.dvb_bbscrambler_bb($standard.val, #slurp
#if str($standard) == 'STANDARD_DVBT2'
$framesize1.val, #slurp
#else
$framesize2.val, #slurp
#end if
#if str($standard) == 'STANDARD_DVBT2'
#if str($framesize1) == 'FECFRAME_NORMAL'
$rate1.val#slurp
#else
$rate2.val#slurp
#end if
#else
#if str($framesize2) == 'FECFRAME_NORMAL'
$rate3.val#slurp
#else if str($framesize2) == 'FECFRAME_MEDIUM'
$rate4.val#slurp
#else
$rate5.val#slurp
#end if
#end if
)</make>
  <param>
    <name>Standard</name>
    <key>standard</key>
    <type>enum</type>
    <option>
      <name>DVB-S2</name>
      <key>STANDARD_DVBS2</key>
      <opt>val:dtv.STANDARD_DVBS2</opt>
      <opt>hide_dvbs2:</opt>
      <opt>hide_dvbt2:all</opt>
    </option>
    <option>
      <name>DVB-T2</name>
      <key>STANDARD_DVBT2</key>
      <opt>val:dtv.STANDARD_DVBT2</opt>
      <opt>hide_dvbs2:all</opt>
      <opt>hide_dvbt2:</opt>
    </option>
  </param>
  <param>
    <name>FECFRAME size</name>
    <key>framesize1</key>
    <type>enum</type>
    <hide>$standard.hide_dvbt2</hide>
    <option>
      <name>Normal</name>
      <key>FECFRAME_NORMAL</key>
      <opt>val:dtv.FECFRAME_NORMAL</opt>
      <opt>hide_normal:</opt>
      <opt>hide_medium:all</opt>
      <opt>hide_short:all</opt>
    </option>
    <option>
      <name>Short</name>
      <key>FECFRAME_SHORT</key>
      <opt>val:dtv.FECFRAME_SHORT</opt>
      <opt>hide_normal:all</opt>
      <opt>hide_medium:all</opt>
      <opt>hide_short:</opt>
    </option>
  </param>
  <param>
    <name>FECFRAME size</name>
    <key>framesize2</key>
    <type>enum</type>
    <hide>$standard.hide_dvbs2</hide>
    <option>
      <name>Normal</name>
      <key>FECFRAME_NORMAL</key>
      <opt>val:dtv.FECFRAME_NORMAL</opt>
      <opt>hide_normal:</opt>
      <opt>hide_medium:all</opt>
      <opt>hide_short:all</opt>
    </option>
    <option>
      <name>Medium</name>
      <key>FECFRAME_MEDIUM</key>
      <opt>val:dtv.FECFRAME_MEDIUM</opt>
      <opt>hide_normal:all</opt>
      <opt>hide_medium:</opt>
      <opt>hide_short:all</opt>
    </option>
    <option>
      <name>Short</name>
      <key>FECFRAME_SHORT</key>
      <opt>val:dtv.FECFRAME_SHORT</opt>
      <opt>hide_normal:all</opt>
      <opt>hide_medium:all</opt>
      <opt>hide_short:</opt>
    </option>
  </param>
  <param>
    <name>Code rate</name>
    <key>rate1</key>
    <type>enum</type>
    <hide>#if str($standard) == 'STANDARD_DVBT2' then $framesize1.hide_normal else 'all'</hide>
    <option>
      <name>1/2</name>
      <key>C1_2</key>
      <opt>val:dtv.C1_2</opt>
    </option>
    <option>
      <name>3/5</name>
      <key>C3_5</key>
      <opt>val:dtv.C3_5</opt>
    </option>
    <option>
      <name>2/3</name>
      <key>C2_3</key>
      <opt>val:dtv.C2_3</opt>
    </option>
    <option>
      <name>3/4</name>
      <key>C3_4</key>
      <opt>val:dtv.C3_4</opt>
    </option>
    <option>
      <name>4/5</name>
      <key>C4_5</key>
      <opt>val:dtv.C4_5</opt>
    </option>
    <option>
      <name>5/6</name>
      <key>C5_6</key>
      <opt>val:dtv.C5_6</opt>
    </option>
  </param>
  <param>
    <name>Code rate</name>
    <key>rate2</key>
    <type>enum</type>
    <hide>#if str($standard) == 'STANDARD_DVBT2' then $framesize1.hide_short else 'all'</hide>
    <option>
      <name>1/3</name>
      <key>C1_3</key>
      <opt>val:dtv.C1_3</opt>
    </option>
    <option>
      <name>2/5</name>
      <key>C2_5</key>
      <opt>val:dtv.C2_5</opt>
    </option>
    <option>
      <name>1/2</name>
      <key>C1_2</key>
      <opt>val:dtv.C1_2</opt>
    </option>
    <option>
      <name>3/5</name>
      <key>C3_5</key>
      <opt>val:dtv.C3_5</opt>
    </option>
    <option>
      <name>2/3</name>
      <key>C2_3</key>
      <opt>val:dtv.C2_3</opt>
    </option>
    <option>
      <name>3/4</name>
      <key>C3_4</key>
      <opt>val:dtv.C3_4</opt>
    </option>
    <option>
      <name>4/5</name>
      <key>C4_5</key>
      <opt>val:dtv.C4_5</opt>
    </option>
    <option>
      <name>5/6</name>
      <key>C5_6</key>
      <opt>val:dtv.C5_6</opt>
    </option>
  </param>
  <param>
    <name>Code rate</name>
    <key>rate3</key>
    <type>enum</type>
    <hide>#if str($standard) == 'STANDARD_DVBS2' then $framesize2.hide_normal else 'all'</hide>
    <option>
      <name>1/4</name>
      <key>C1_4</key>
      <opt>val:dtv.C1_4</opt>
    </option>
    <option>
      <name>1/3</name>
      <key>C1_3</key>
      <opt>val:dtv.C1_3</opt>
    </option>
    <option>
      <name>2/5</name>
      <key>C2_5</key>
      <opt>val:dtv.C2_5</opt>
    </option>
    <option>
      <name>1/2</name>
      <key>C1_2</key>
      <opt>val:dtv.C1_2</opt>
    </option>
    <option>
      <name>3/5</name>
      <key>C3_5</key>
      <opt>val:dtv.C3_5</opt>
    </option>
    <option>
      <name>2/3</name>
      <key>C2_3</key>
      <opt>val:dtv.C2_3</opt>
    </option>
    <option>
      <name>3/4</name>
      <key>C3_4</key>
      <opt>val:dtv.C3_4</opt>
    </option>
    <option>
      <name>4/5</name>
      <key>C4_5</key>
      <opt>val:dtv.C4_5</opt>
    </option>
    <option>
      <name>5/6</name>
      <key>C5_6</key>
      <opt>val:dtv.C5_6</opt>
    </option>
    <option>
      <name>8/9</name>
      <key>C8_9</key>
      <opt>val:dtv.C8_9</opt>
    </option>
    <option>
      <name>9/10</name>
      <key>C9_10</key>
      <opt>val:dtv.C9_10</opt>
    </option>
    <option>
      <name>2/9 VL-SNR</name>
      <key>C2_9_VLSNR</key>
      <opt>val:dtv.C2_9_VLSNR</opt>
    </option>
    <option>
      <name>13/45</name>
      <key>C13_45</key>
      <opt>val:dtv.C13_45</opt>
    </option>
    <option>
      <name>9/20</name>
      <key>C9_20</key>
      <opt>val:dtv.C9_20</opt>
    </option>
    <option>
      <name>90/180</name>
      <key>C90_180</key>
      <opt>val:dtv.C90_180</opt>
    </option>
    <option>
      <name>96/180</name>
      <key>C96_180</key>
      <opt>val:dtv.C96_180</opt>
    </option>
    <option>
      <name>11/20</name>
      <key>C11_20</key>
      <opt>val:dtv.C11_20</opt>
    </option>
    <option>
      <name>100/180</name>
      <key>C100_180</key>
      <opt>val:dtv.C100_180</opt>
    </option>
    <option>
      <name>104/180</name>
      <key>C104_180</key>
      <opt>val:dtv.C104_180</opt>
    </option>
    <option>
      <name>26/45</name>
      <key>C26_45</key>
      <opt>val:dtv.C26_45</opt>
    </option>
    <option>
      <name>18/30</name>
      <key>C18_30</key>
      <opt>val:dtv.C18_30</opt>
    </option>
    <option>
      <name>28/45</name>
      <key>C28_45</key>
      <opt>val:dtv.C28_45</opt>
    </option>
    <option>
      <name>23/36</name>
      <key>C23_36</key>
      <opt>val:dtv.C23_36</opt>
    </option>
    <option>
      <name>116/180</name>
      <key>C116_180</key>
      <opt>val:dtv.C116_180</opt>
    </option>
    <option>
      <name>20/30</name>
      <key>C20_30</key>
      <opt>val:dtv.C20_30</opt>
    </option>
    <option>
      <name>124/180</name>
      <key>C124_180</key>
      <opt>val:dtv.C124_180</opt>
    </option>
    <option>
      <name>25/36</name>
      <key>C25_36</key>
      <opt>val:dtv.C25_36</opt>
    </option>
    <option>
      <name>128/180</name>
      <key>C128_180</key>
      <opt>val:dtv.C128_180</opt>
    </option>
    <option>
      <name>13/18</name>
      <key>C13_18</key>
      <opt>val:dtv.C13_18</opt>
    </option>
    <option>
      <name>132/180</name>
      <key>C132_180</key>
      <opt>val:dtv.C132_180</opt>
    </option>
    <option>
      <name>22/30</name>
      <key>C22_30</key>
      <opt>val:dtv.C22_30</opt>
    </option>
    <option>
      <name>135/180</name>
      <key>C135_180</key>
      <opt>val:dtv.C135_180</opt>
    </option>
    <option>
      <name>140/180</name>
      <key>C140_180</key>
      <opt>val:dtv.C140_180</opt>
    </option>
    <option>
      <name>7/9</name>
      <key>C7_9</key>
      <opt>val:dtv.C7_9</opt>
    </option>
    <option>
      <name>154/180</name>
      <key>C154_180</key>
      <opt>val:dtv.C154_180</opt>
    </option>
  </param>
  <param>
    <name>Code rate</name>
    <key>rate4</key>
    <type>enum</type>
    <hide>#if str($standard) == 'STANDARD_DVBS2' then $framesize2.hide_medium else 'all'</hide>
    <option>
      <name>1/5</name>
      <key>C1_5_MEDIUM</key>
      <opt>val:dtv.C1_5_MEDIUM</opt>
    </option>
    <option>
      <name>11/45</name>
      <key>C11_45_MEDIUM</key>
      <opt>val:dtv.C11_45_MEDIUM</opt>
    </option>
    <option>
      <name>1/3</name>
      <key>C1_3_MEDIUM</key>
      <opt>val:dtv.C1_3_MEDIUM</opt>
    </option>
  </param>
  <param>
    <name>Code rate</name>
    <key>rate5</key>
    <type>enum</type>
    <hide>#if str($standard) == 'STANDARD_DVBS2' then $framesize2.hide_short else 'all'</hide>
    <option>
      <name>1/4</name>
      <key>C1_4</key>
      <opt>val:dtv.C1_4</opt>
    </option>
    <option>
      <name>1/3</name>
      <key>C1_3</key>
      <opt>val:dtv.C1_3</opt>
    </option>
    <option>
      <name>2/5</name>
      <key>C2_5</key>
      <opt>val:dtv.C2_5</opt>
    </option>
    <option>
      <name>1/2</name>
      <key>C1_2</key>
      <opt>val:dtv.C1_2</opt>
    </option>
    <option>
      <name>3/5</name>
      <key>C3_5</key>
      <opt>val:dtv.C3_5</opt>
    </option>
    <option>
      <name>2/3</name>
      <key>C2_3</key>
      <opt>val:dtv.C2_3</opt>
    </option>
    <option>
      <name>3/4</name>
      <key>C3_4</key>
      <opt>val:dtv.C3_4</opt>
    </option>
    <option>
      <name>4/5</name>
      <key>C4_5</key>
      <opt>val:dtv.C4_5</opt>
    </option>
    <option>
      <name>5/6</name>
      <key>C5_6</key>
      <opt>val:dtv.C5_6</opt>
    </option>
    <option>
      <name>8/9</name>
      <key>C8_9</key>
      <opt>val:dtv.C8_9</opt>
    </option>
    <option>
      <name>11/45</name>
      <key>C11_45</key>
      <opt>val:dtv.C11_45</opt>
    </option>
    <option>
      <name>4/15</name>
      <key>C4_15</key>
      <opt>val:dtv.C4_15</opt>
    </option>
    <option>
      <name>14/45</name>
      <key>C14_45</key>
      <opt>val:dtv.C14_45</opt>
    </option>
    <option>
      <name>7/15</name>
      <key>C7_15</key>
      <opt>val:dtv.C7_15</opt>
    </option>
    <option>
      <name>8/15</name>
      <key>C8_15</key>
      <opt>val:dtv.C8_15</opt>
    </option>
    <option>
      <name>26/45</name>
      <key>C26_45</key>
      <opt>val:dtv.C26_45</opt>
    </option>
    <option>
      <name>32/45</name>
      <key>C32_45</key>
      <opt>val:dtv.C32_45</opt>
    </option>
    <option>
      <name>1/5 VL-SNR SF2</name>
      <key>C1_5_VLSNR_SF2</key>
      <opt>val:dtv.C1_5_VLSNR_SF2</opt>
    </option>
    <option>
      <name>11/45 VL-SNR SF2</name>
      <key>C11_45_VLSNR_SF2</key>
      <opt>val:dtv.C11_45_VLSNR_SF2</opt>
    </option>
    <option>
      <name>1/5 VL-SNR</name>
      <key>C1_5_VLSNR</key>
      <opt>val:dtv.C1_5_VLSNR</opt>
    </option>
    <option>
      <name>4/15 VL-SNR</name>
      <key>C4_15_VLSNR</key>
      <opt>val:dtv.C4_15_VLSNR</opt>
    </option>
    <option>
      <name>1/3 VL-SNR</name>
      <key>C1_3_VLSNR</key>
      <opt>val:dtv.C1_3_VLSNR</opt>
    </option>
  </param>
  <sink>
    <name>in</name>
    <type>byte</type>
  </sink>
  <source>
    <name>out</name>
    <type>byte</type>
  </source>
</block>
