<!--
Description:
  An effect chain widget.
  * EffectSlots, with or without highlight/focus option
  * mixer with Wet/Dry knob and Super knob (optional)
  * assignment buttons for master & headphone
Variables:
  FxUnit: number of effect unit for FX label
-->
<Template>
  <SetVariable name="FxRack_FxUnit">EffectRack<Variable name="FxRack"/>_EffectUnit<Variable name="FxUnit"/></SetVariable>

  <WidgetGroup><!-- EffectUnit -->
    <ObjectName>FxUnitLeft</ObjectName>
    <Layout>horizontal</Layout>
    <SizePolicy>me,min</SizePolicy>
    <Children>

      <WidgetGroup><!-- FxUnitControls -->
        <ObjectName>FxUnitControls</ObjectName>
        <Layout>vertical</Layout>
        <Size>-1min,131f</Size>
        <Children>

          <WidgetGroup><!-- FX label + FX expand button -->
            <ObjectName>AlignTopCenter</ObjectName>
            <Layout>stacked</Layout>
            <Size>34f,30f</Size>
            <Children>
              <Template src="skin:../Tango/controls/button_2state_persist.xml">
                <SetVariable name="ObjectName">FxMiniMaxi</SetVariable>
                <SetVariable name="TooltipId">EffectUnit_show_parameters</SetVariable>
                <SetVariable name="Size">34f,30f</SetVariable>
                <SetVariable name="ConfigKey">[<Variable name="FxRack_FxUnit"/>],show_parameters</SetVariable>
              </Template>
              <Label>
                <ObjectName>FxUnitLabel</ObjectName>
                <Size>34f,15f</Size>
                <Text>&#8201;FX&#8202;<Variable name="FxUnit"/>&#8202;</Text>
              </Label>
            </Children>
          </WidgetGroup>

          <!-- FxUnitMixer -->
          <WidgetGroup>
            <ObjectName>FxUnitMixerRight</ObjectName>
            <Layout>vertical</Layout>
            <SizePolicy>min,me</SizePolicy>
            <Children>

              <Template src="skin:../Tango/controls/knob_textless.xml">
                <SetVariable name="TooltipId">EffectUnit_mix</SetVariable>
                <SetVariable name="ObjectName">SuperWetDryKnob</SetVariable>
                <SetVariable name="Size">30min,26f</SetVariable>
                <SetVariable name="group">[<Variable name="FxRack_FxUnit"/>]</SetVariable>
                <SetVariable name="ConfigKey">mix</SetVariable>
                <SetVariable name="Color">red</SetVariable>
              </Template>

              <Template src="skin:../Tango/controls/button_2state_persist.xml">
                <SetVariable name="ObjectName">MixModeButton</SetVariable>
                <SetVariable name="TooltipId">EffectUnit_mix_mode</SetVariable>
                <SetVariable name="Size">30f,18f</SetVariable>
                <SetVariable name="state_0_icon">fx_mixmode_d-w.svg</SetVariable>
                <SetVariable name="state_1_icon">fx_mixmode_d+w.svg</SetVariable>
                <SetVariable name="ConfigKey">[EffectRack1_EffectUnit<Variable name="FxUnit"/>],mix_mode</SetVariable>
              </Template>

              <WidgetGroup><Size>1min,0me</Size></WidgetGroup>

              <WidgetGroup><!-- Super Knob, if enabled -->
                <SizePolicy>min,min</SizePolicy>
                <Layout>vertical</Layout>
                <Children>
                  <Template src="skin:../Tango/controls/knob_textless.xml">
                    <SetVariable name="TooltipId">EffectUnit_super1</SetVariable>
                    <SetVariable name="ObjectName">SuperWetDryKnob</SetVariable>
                    <SetVariable name="Size">30f,30f</SetVariable>
                    <SetVariable name="group">[<Variable name="FxRack_FxUnit"/>]</SetVariable>
                    <SetVariable name="ConfigKey">super1</SetVariable>
                    <SetVariable name="Color">blue</SetVariable>
                  </Template>
                </Children>
                <Connection>
                  <ConfigKey persist="true">[Skin],show_superknobs</ConfigKey>
                  <BindProperty>visible</BindProperty>
                </Connection>
              </WidgetGroup>

              <WidgetGroup><!-- additional spacer for Super Knob, if enabled -->
                <SizePolicy>min,me</SizePolicy>
                <Connection>
                  <ConfigKey persist="true">[Skin],show_superknobs</ConfigKey>
                  <BindProperty>visible</BindProperty>
                </Connection>
              </WidgetGroup>

              <WidgetGroup><!-- Pfl button -->
                <ObjectName>AlignCenter</ObjectName>
                <SizePolicy>min,max</SizePolicy>
                <Layout>vertical</Layout>
                <Children>
                  <WidgetGroup>
                    <SizePolicy>max,max</SizePolicy>
                    <Layout>stacked</Layout>
                    <Children>
                      <!-- Greyed out if no headphone device is configured -->
                      <Template src="skin:../Tango/helpers/pfl_cover.xml"/>
                      <Template src="skin:../Tango/controls/button_2state.xml">
                        <SetVariable name="ObjectName">PflButton</SetVariable>
                        <SetVariable name="TooltipId">EffectUnit_headphones_enabled</SetVariable>
                        <SetVariable name="Size">24f,24f</SetVariable>
                        <SetVariable name="state_0_icon">pfl_off.svg</SetVariable>
                        <SetVariable name="state_1_icon">pfl_on.svg</SetVariable>
                        <SetVariable name="ConfigKey">[<Variable name="FxRack_FxUnit"/>],group_[Headphone]_enable</SetVariable>
                      </Template>
                    </Children>
                  </WidgetGroup>
                </Children>
              </WidgetGroup><!-- /Pfl button -->

            </Children>
          </WidgetGroup><!-- /FxUnitMixer -->

        </Children>
      </WidgetGroup><!-- /FxUnitControls -->

      <WidgetGroup><!-- EffectSlots + Underlays, with focus button -->
        <ObjectName>Spacer0f</ObjectName>
        <Layout>stacked</Layout>
        <SizePolicy>me,min</SizePolicy>
        <Children>
          <WidgetGroup><!-- EffectSlots -->
            <Layout>vertical</Layout>
            <SizePolicy>min,min</SizePolicy>
            <Children>
              <WidgetGroup><!-- EffectSlot 1 -->
                <ObjectName>AlignLeft</ObjectName>
                <SizePolicy>min,me</SizePolicy>
                <Layout>horizontal</Layout>
                <Children>
                  <WidgetGroup><Size>4f,1min</Size></WidgetGroup>
                  <Template src="skin:../Tango/fx/focus_button.xml"><SetVariable name="FxNum">1</SetVariable></Template>
                  <Template src="skin:../Tango/fx/metaknob.xml"><SetVariable name="FxNum">1</SetVariable></Template>
                  <WidgetGroup><Size>2f,1min</Size></WidgetGroup>
                  <Template src="skin:../Tango/fx/toggle_selector.xml"><SetVariable name="FxNum">1</SetVariable></Template>
                  <WidgetGroup><Size>5f,1min</Size></WidgetGroup>
                  <Template src="skin:../Tango/fx/parameter_row.xml">
                    <SetVariable name="FxNum">1</SetVariable>
                    <SetVariable name="Side">Right</SetVariable>
                  </Template>
                  <WidgetGroup><Size>0min,1min</Size></WidgetGroup>
                </Children>
              </WidgetGroup>

              <WidgetGroup><Size>1me,1f</Size></WidgetGroup>

              <WidgetGroup><!-- EffectSlot 2 -->
                <ObjectName>AlignLeft</ObjectName>
                <SizePolicy>min,me</SizePolicy>
                <Layout>horizontal</Layout>
                <Children>
                  <WidgetGroup><Size>4f,1min</Size></WidgetGroup>
                  <Template src="skin:../Tango/fx/focus_button.xml"><SetVariable name="FxNum">2</SetVariable></Template>
                  <Template src="skin:../Tango/fx/metaknob.xml"><SetVariable name="FxNum">2</SetVariable></Template>
                  <WidgetGroup><Size>2f,1min</Size></WidgetGroup>
                  <Template src="skin:../Tango/fx/toggle_selector.xml"><SetVariable name="FxNum">2</SetVariable></Template>
                  <WidgetGroup><Size>5f,1min</Size></WidgetGroup>
                  <Template src="skin:../Tango/fx/parameter_row.xml">
                    <SetVariable name="FxNum">2</SetVariable>
                    <SetVariable name="Side">Right</SetVariable>
                  </Template>
                  <WidgetGroup><Size>0min,1min</Size></WidgetGroup>
                </Children>
              </WidgetGroup>

              <WidgetGroup><Size>1me,1f</Size></WidgetGroup>

              <WidgetGroup><!-- EffectSlot 3 -->
                <ObjectName>AlignLeft</ObjectName>
                <SizePolicy>min,me</SizePolicy>
                <Layout>horizontal</Layout>
                <Children>
                  <WidgetGroup><Size>4f,1min</Size></WidgetGroup>
                  <Template src="skin:../Tango/fx/focus_button.xml"><SetVariable name="FxNum">3</SetVariable></Template>
                  <Template src="skin:../Tango/fx/metaknob.xml"><SetVariable name="FxNum">3</SetVariable></Template>
                  <WidgetGroup><Size>2f,1min</Size></WidgetGroup>
                  <Template src="skin:../Tango/fx/toggle_selector.xml"><SetVariable name="FxNum">3</SetVariable></Template>
                  <WidgetGroup><Size>5f,1min</Size></WidgetGroup>
                  <Template src="skin:../Tango/fx/parameter_row.xml">
                    <SetVariable name="FxNum">3</SetVariable>
                    <SetVariable name="Side">Right</SetVariable>
                  </Template>
                </Children>
              </WidgetGroup>
            </Children>
          </WidgetGroup><!-- /EffectSlots -->

          <WidgetGroup><!-- Underlays, no focus -->
            <Layout>vertical</Layout>
            <SizePolicy>me,min</SizePolicy>
            <Children>
              <WidgetGroup><!-- EffectSlot 1 -->
                <ObjectName>FxFlow_focus_background</ObjectName>
                <Size>-1me,8f</Size>
              </WidgetGroup>
              <WidgetGroup>
                <ObjectName>FxFlow_focus_background</ObjectName>
                <SizePolicy>me,me</SizePolicy>
              </WidgetGroup>

              <Template src="skin:../Tango/fx/flow_noFocus_separator.xml">
                <SetVariable name="widthLeft">57f</SetVariable>
                <SetVariable name="widthRight">-1me</SetVariable>
              </Template>

              <WidgetGroup><!-- EffectSlot 2 -->
                <ObjectName>FxFlow_focus_background</ObjectName>
                <SizePolicy>me,me</SizePolicy>
              </WidgetGroup>

              <Template src="skin:../Tango/fx/flow_noFocus_separator.xml">
                <SetVariable name="widthLeft">57f</SetVariable>
                <SetVariable name="widthRight">-1me</SetVariable>
              </Template>

              <WidgetGroup><!-- EffectSlot 3 -->
                <ObjectName>FxFlow_focus_background</ObjectName>
                <SizePolicy>me,me</SizePolicy>
              </WidgetGroup>
              <WidgetGroup>
                <ObjectName>FxFlow_focus_background</ObjectName>
                <Size>-1me,8f</Size>
              </WidgetGroup>
            </Children>
            <Connection>
              <ConfigKey>[<Variable name="FxRack_FxUnit"/>],show_focus</ConfigKey>
              <Transform><Not/></Transform>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup><!-- /Underlays, no focus -->

          <WidgetGroup><!-- Underlays with focus -->
            <Layout>vertical</Layout>
            <SizePolicy>me,min</SizePolicy>
            <Children>
              <Template src="skin:../Tango/fx/flow_focus_background.xml">
                <SetVariable name="Size">-1me,8f</SetVariable>
                <SetVariable name="FxNum">1</SetVariable>
              </Template>
              <Template src="skin:../Tango/fx/flow_focus_background.xml">
                <SetVariable name="Size">-1me,-1me</SetVariable>
                <SetVariable name="FxNum">1</SetVariable>
              </Template>

              <Template src="skin:../Tango/fx/flow_focus_separator.xml">
                <SetVariable name="widthLeft">71f</SetVariable>
                <SetVariable name="widthRight">-1me</SetVariable>
                <SetVariable name="FxTop">1</SetVariable>
                <SetVariable name="FxBottom">2</SetVariable>
              </Template>

              <Template src="skin:../Tango/fx/flow_focus_background.xml">
                <SetVariable name="Size">-1me,-1me</SetVariable>
                <SetVariable name="FxNum">2</SetVariable>
              </Template>

              <Template src="skin:../Tango/fx/flow_focus_separator.xml">
                <SetVariable name="widthLeft">71f</SetVariable>
                <SetVariable name="widthRight">-1me</SetVariable>
                <SetVariable name="FxTop">2</SetVariable>
                <SetVariable name="FxBottom">3</SetVariable>
              </Template>

              <Template src="skin:../Tango/fx/flow_focus_background.xml">
                <SetVariable name="Size">-1me,-1me</SetVariable>
                <SetVariable name="FxNum">3</SetVariable>
              </Template>
              <Template src="skin:../Tango/fx/flow_focus_background.xml">
                <SetVariable name="Size">-1me,8f</SetVariable>
                <SetVariable name="FxNum">3</SetVariable>
              </Template>
            </Children>
            <Connection>
              <ConfigKey>[<Variable name="FxRack_FxUnit"/>],show_focus</ConfigKey>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup><!-- /Underlays with focus -->

        </Children>
      </WidgetGroup><!-- /EffectSlots + Underlays, no focus -->

    </Children>
  </WidgetGroup><!-- /EffectUnit -->
</Template>
