<!DOCTYPE template>
<!--
  Description:
    An effect widget hosting all main controls for an effect slot
  Variables:
    FxRack_FxUnit
    FxUnit
    FxNum
    ArcRadiusSmall
    TopRegion_BtnType
-->
<Template>
  <SetVariable name="FxRack_FxUnit_FxNum"><Variable name="FxRack_FxUnit"/>_Effect<Variable name="FxNum"/></SetVariable>
  <SetVariable name="BtnType"><Variable name="TopRegion_BtnType"/></SetVariable>
  <SetVariable name="ArcRadius"><Variable name="ArcRadiusCompact"/></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>min,min</SizePolicy>
    <Layout>horizontal</Layout>
    <Children>

      <WidgetGroup>
        <ObjectName>FxSlotControls</ObjectName>
        <Layout>horizontal</Layout>
        <SizePolicy>p,min</SizePolicy>
        <MaximumSize>190,</MaximumSize>
        <Children>

          <Template src="skins:LateNight/fx/focus_button.xml"/>

          <Template src="skins:LateNight/controls/button_2state.xml">
            <SetVariable name="TooltipId">EffectSlot_enabled</SetVariable>
            <SetVariable name="ObjectName">FxToggleButton</SetVariable>
            <SetVariable name="BtnSize">square</SetVariable>
            <SetVariable name="Size">26f,26f</SetVariable>
            <SetVariable name="ConfigKey">[<Variable name="FxRack_FxUnit_FxNum"/>],enabled</SetVariable>
          </Template>

          <Template src="skins:LateNight/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>

          <EffectSelector>
            <MinimumSize>60,24</MinimumSize>
            <MaximumSize>,24</MaximumSize>
            <SizePolicy>me,f</SizePolicy>
            <EffectRack>1</EffectRack>
            <EffectUnit><Variable name="FxUnit"/></EffectUnit>
            <Effect><Variable name="FxNum"/></Effect>
            <!-- TODO Style the effect selector when the effect is enabled? -->
            <!-- add 'highlight' property to WEffectSelector to avoid skin warnings-->
            <!-- <Connection>
              <ConfigKey>[<Variable name="FxRack_FxUnit_FxNum"/>],enabled</ConfigKey>
              <BindProperty>highlight</BindProperty>
            </Connection> -->
          </EffectSelector>

        </Children>
      </WidgetGroup><!-- FxSlotControls -->

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