<!DOCTYPE template>
<!--
  Description:
    An effect unit widget hosting all parameter controls for an effect
  Variables:
    FxRack_FxUnit
    FxUnit
    FxNum
    ArcRadiusSmall
    TopRegion_BtnType
-->
<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>
  <SetVariable name="BtnType"><Variable name="TopRegion_BtnType"/></SetVariable>
  <SetVariable name="ArcRadius"><Variable name="ArcRadiusSmall"/></SetVariable>

<!-- Wrapper that allows to set an indirect top/bottom padding within the Fx unit
    so the Fx unit controls layout is independent. -->
  <WidgetGroup>
    <ObjectName>FxSlotContainer</ObjectName>
    <SizePolicy>me,min</SizePolicy>
    <Layout>stacked</Layout>
    <Children>

    <!-- transparent container. 3D border (or focus highlight border)
      are set in FxSlotBorder* widgets underneath -->
      <WidgetGroup>
        <ObjectName>FxParametersContainer</ObjectName>
        <Layout>horizontal</Layout>
        <SizePolicy>min,min</SizePolicy>
        <Children>
          <WidgetGroup>
            <ObjectName>FxSlotParameters</ObjectName>
            <Layout>horizontal</Layout>
            <SizePolicy>min,min</SizePolicy>
            <Children>
              <WidgetGroup><Size>0min,0min</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><!-- FxSlotParameters -->

        </Children>
      </WidgetGroup><!-- FxParametersContainer -->

      <!-- Layer to style the Fx slot when it's focused (see fx mapping of midi-components.js) -->
      <WidgetGroup>
        <SizePolicy>me,min</SizePolicy>
        <Layout>stacked</Layout>
        <Children>
          <WidgetGroup>
            <ObjectName>FxParametersFocusBg</ObjectName>
            <SizePolicy>me,me</SizePolicy>
            <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>[<Variable name="FxRack_FxUnit"/>],show_focus</ConfigKey>
          <BindProperty>visible</BindProperty>
        </Connection>
      </WidgetGroup>

      <!-- Regular background, draws the background tile in Classic them -->
      <WidgetGroup>
        <ObjectName>FxParametersBg</ObjectName>
        <SizePolicy>me,min</SizePolicy>
      </WidgetGroup>

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