<?xml version="1.0"?>
<!--
###################################################
## DVB-S2 Bit Interleaver
###################################################
 -->
<block>
  <name>Interleaver</name>
  <key>dtv_dvbs2_interleaver_bb</key>
  <import>from gnuradio import dtv</import>
  <make>dtv.dvbs2_interleaver_bb($framesize.val, #slurp
#if str($framesize) == 'FECFRAME_NORMAL'
$rate1.val, #slurp
#else if str($framesize) == 'FECFRAME_MEDIUM'
$rate2.val, #slurp
#else
$rate3.val, #slurp
#end if
$constellation.val)</make>
  <param>
    <name>FECFRAME size</name>
    <key>framesize</key>
    <type>enum</type>
    <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>$framesize.hide_normal</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>rate2</key>
    <type>enum</type>
    <hide>$framesize.hide_medium</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>rate3</key>
    <type>enum</type>
    <hide>$framesize.hide_short</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>
  <param>
    <name>Constellation</name>
    <key>constellation</key>
    <type>enum</type>
    <option>
      <name>QPSK</name>
      <key>MOD_QPSK</key>
      <opt>val:dtv.MOD_QPSK</opt>
    </option>
    <option>
      <name>8PSK</name>
      <key>MOD_8PSK</key>
      <opt>val:dtv.MOD_8PSK</opt>
    </option>
    <option>
      <name>8APSK</name>
      <key>MOD_8APSK</key>
      <opt>val:dtv.MOD_8APSK</opt>
    </option>
    <option>
      <name>16APSK</name>
      <key>MOD_16APSK</key>
      <opt>val:dtv.MOD_16APSK</opt>
    </option>
    <option>
      <name>8+8APSK</name>
      <key>MOD_8_8APSK</key>
      <opt>val:dtv.MOD_8_8APSK</opt>
    </option>
    <option>
      <name>32APSK</name>
      <key>MOD_32APSK</key>
      <opt>val:dtv.MOD_32APSK</opt>
    </option>
    <option>
      <name>4+12+16rbAPSK</name>
      <key>MOD_4_12_16APSK</key>
      <opt>val:dtv.MOD_4_12_16APSK</opt>
    </option>
    <option>
      <name>4+8+4+16APSK</name>
      <key>MOD_4_8_4_16APSK</key>
      <opt>val:dtv.MOD_4_8_4_16APSK</opt>
    </option>
    <option>
      <name>64APSK</name>
      <key>MOD_64APSK</key>
      <opt>val:dtv.MOD_64APSK</opt>
    </option>
    <option>
      <name>8+16+20+20APSK</name>
      <key>MOD_8_16_20_20APSK</key>
      <opt>val:dtv.MOD_8_16_20_20APSK</opt>
    </option>
    <option>
      <name>4+12+20+28APSK</name>
      <key>MOD_4_12_20_28APSK</key>
      <opt>val:dtv.MOD_4_12_20_28APSK</opt>
    </option>
    <option>
      <name>128APSK</name>
      <key>MOD_128APSK</key>
      <opt>val:dtv.MOD_128APSK</opt>
    </option>
    <option>
      <name>256APSK</name>
      <key>MOD_256APSK</key>
      <opt>val:dtv.MOD_256APSK</opt>
    </option>
    <option>
      <name>PI/2 BPSK</name>
      <key>MOD_BPSK</key>
      <opt>val:dtv.MOD_BPSK</opt>
    </option>
    <option>
      <name>PI/2 BPSK-SF2</name>
      <key>MOD_BPSK_SF2</key>
      <opt>val:dtv.MOD_BPSK_SF2</opt>
    </option>
  </param>
  <sink>
    <name>in</name>
    <type>byte</type>
  </sink>
  <source>
    <name>out</name>
    <type>byte</type>
  </source>
</block>
