<!DOCTYPE template>
<!--
  Description:
    An effect unit widget hosting all effect controls for both collapsed
    and expanded state ([FxUnitN],show_parameters)
  Variables:
    group: The group for the controls.
    FxRack
    FxUnit
    FxNum
-->
<Template>
  <SetVariable name="FxRack_FxUnit_FxNum">[EffectRack1_EffectUnit<Variable name="FxUnit"/>_Effect<Variable name="FxNum"/>]</SetVariable>
  <SetVariable name="FxRack_FxUnit">[EffectRack1_EffectUnit<Variable name="FxUnit"/>]</SetVariable>

  <WidgetGroup>
    <Size>-1me,52me</Size>
    <Layout>stacked</Layout>
    <Children>

      <WidgetGroup>
        <ObjectName>EffectSlot<Variable name="FxNum"/></ObjectName>
        <Layout>horizontal</Layout>
        <SizePolicy>min,me</SizePolicy>
        <Children>
          <WidgetGroup>
            <Layout>horizontal</Layout>
            <SizePolicy>min,min</SizePolicy>
            <Children>
              <WidgetGroup><Size>0min,-1min</Size></WidgetGroup>
              <Template src="skin:fx_parameter_button.xml">
                <SetVariable name="FxParameter">1</SetVariable>
              </Template>
              <Template src="skin:fx_parameter_button.xml">
                <SetVariable name="FxParameter">2</SetVariable>
              </Template>
              <Template src="skin:fx_parameter_button.xml">
                <SetVariable name="FxParameter">3</SetVariable>
              </Template>
              <Template src="skin:fx_parameter_button.xml">
                <SetVariable name="FxParameter">4</SetVariable>
              </Template>
              <Template src="skin:fx_parameter_button.xml">
                <SetVariable name="FxParameter">5</SetVariable>
              </Template>
              <Template src="skin:fx_parameter_button.xml">
                <SetVariable name="FxParameter">6</SetVariable>
              </Template>
              <Template src="skin:fx_parameter_button.xml">
                <SetVariable name="FxParameter">7</SetVariable>
              </Template>
              <Template src="skin:fx_parameter_button.xml">
                <SetVariable name="FxParameter">8</SetVariable>
              </Template>
              <Template src="skin:fx_parameter_knob.xml">
                <SetVariable name="FxParameter">1</SetVariable>
              </Template>
              <Template src="skin:fx_parameter_knob.xml">
                <SetVariable name="FxParameter">2</SetVariable>
              </Template>
              <Template src="skin:fx_parameter_knob.xml">
                <SetVariable name="FxParameter">3</SetVariable>
              </Template>
              <Template src="skin:fx_parameter_knob.xml">
                <SetVariable name="FxParameter">4</SetVariable>
              </Template>
              <Template src="skin:fx_parameter_knob.xml">
                <SetVariable name="FxParameter">5</SetVariable>
              </Template>
              <Template src="skin:fx_parameter_knob.xml">
                <SetVariable name="FxParameter">6</SetVariable>
              </Template>
              <Template src="skin:fx_parameter_knob.xml">
                <SetVariable name="FxParameter">7</SetVariable>
              </Template>
              <Template src="skin:fx_parameter_knob.xml">
                <SetVariable name="FxParameter">8</SetVariable>
              </Template>
            </Children>
            <Connection>
              <ConfigKey persist="true"><Variable name="FxRack_FxUnit"/>,show_parameters</ConfigKey>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup>

          <WidgetGroup>
            <Layout>horizontal</Layout>
            <MinimumSize>85,26</MinimumSize>
            <MaximumSize>150,26</MaximumSize>
            <SizePolicy>me,f</SizePolicy>
            <Children>
              <EffectSelector>
                <MinimumSize>85,26</MinimumSize>
                <MaximumSize>150,26</MaximumSize>
                <SizePolicy>me,f</SizePolicy>
                <EffectRack><Variable name="FxRack"/></EffectRack>
                <EffectUnit><Variable name="FxUnit"/></EffectUnit>
                <Effect><Variable name="FxNum"/></Effect>
              </EffectSelector>
            </Children>
          </WidgetGroup>

          <Template src="skin:fx_meta_knob.xml">
            <SetVariable name="group"><Variable name="FxRack_FxUnit_FxNum"/></SetVariable>
            <SetVariable name="TooltipId">EffectUnit_mix</SetVariable>
            <SetVariable name="control">meta</SetVariable>
          </Template>

          <WidgetGroup>
            <ObjectName>AlignCenter</ObjectName>
            <Layout>vertical</Layout>
            <Size>30f,-1me</Size>
            <Children>
              <Template src="skin:button_2state.xml">
                <SetVariable name="TooltipId">EffectSlot_enabled</SetVariable>
                <SetVariable name="ObjectName">FxToggleButton</SetVariable>
                <SetVariable name="icon">fxToggle</SetVariable>
                <SetVariable name="Size">30f,30f</SetVariable>
                <SetVariable name="ConfigKey"><Variable name="FxRack_FxUnit_FxNum"/>,enabled</SetVariable>
              </Template>

              <Template src="skin:fx_focus_button.xml"/>

            </Children>
          </WidgetGroup>

        </Children>
      </WidgetGroup>

      <WidgetGroup>
        <Layout>horizontal</Layout>
        <SizePolicy>me,me</SizePolicy>
        <Children>
          <WidgetGroup>
            <ObjectName>EffectSlot_focused</ObjectName>
            <Layout>horizontal</Layout>
            <SizePolicy>me,me</SizePolicy>
            <Children>
            </Children>
            <Connection>
              <ConfigKey persist="true"><Variable name="FxRack_FxUnit"/>,focused_effect</ConfigKey>
              <Transform><IsEqual><Variable name="FxNum"/></IsEqual></Transform>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup>
        </Children>
        <Connection>
          <ConfigKey persist="true"><Variable name="FxRack_FxUnit"/>,show_focus</ConfigKey>
          <BindProperty>visible</BindProperty>
        </Connection>
      </WidgetGroup>

    </Children>
  </WidgetGroup>
</Template>
