<!--
Description:
  An effect parameter knob with a 5 state button below
  that controls SuperKnob linking type.
Variables:
  FxRack        : rack number
  FxUnitNum     : unit number
  FxGroup_FxNum : EffectRack1_EffectUnitX_EffectY
  FxNum         : effect number
  parameter     : the parameter
-->
<Template>
  <SetVariable name="FxRack_FxUnit_FxNum">[<Variable name="FxRack_FxUnit"/>_Effect<Variable name="FxNum"/>]</SetVariable>
  <WidgetGroup>
    <Layout>vertical</Layout>
    <MinimumSize>43,47</MinimumSize>
    <MaximumSize>52,47</MaximumSize>
    <SizePolicy>me,f</SizePolicy>
    <Children>

      <WidgetGroup><!-- Parameter knob + parameter name -->
        <Layout>vertical</Layout>
        <MinimumSize>42,33</MinimumSize>
        <MaximumSize>51,33</MaximumSize>
        <SizePolicy>me,f</SizePolicy>
        <Children>

          <WidgetGroup><!-- Effect parameter knob -->
            <ObjectName>FxParameterKnob</ObjectName>
            <Layout>vertical</Layout>
            <MinimumSize>42,22</MinimumSize>
            <MaximumSize>51,22</MaximumSize>
            <SizePolicy>me,f</SizePolicy>
            <Children>
              <EffectParameterKnobComposed>
                <Size>26f,22f</Size>
                <Knob>knobs_sliders/knob_fx_yellow.svg</Knob>
                <BackPath>knobs_sliders/knob_bg_fx_parameter.svg</BackPath>
                <MinAngle><Variable name="PotiMinAngle"/></MinAngle>
                <MaxAngle><Variable name="PotiMaxAngle"/></MaxAngle>
                <KnobCenterYOffset>1.500</KnobCenterYOffset>
                <Connection>
                  <ConfigKey><Variable name="FxRack_FxUnit_FxNum"/>,parameter<Variable name="FxParameter"/></ConfigKey>
                </Connection>
              </EffectParameterKnobComposed>
            </Children>
          </WidgetGroup>

          <WidgetGroup><!-- Name of parameter -->
            <MinimumSize>42,11</MinimumSize>
            <MaximumSize>51,11</MaximumSize>
            <SizePolicy>me,f</SizePolicy>
            <Layout>horizontal</Layout>
            <Children>
              <!-- To keep text centered it's in an container with spacers on the left/right -->
              <WidgetGroup><SizePolicy>me,min</SizePolicy></WidgetGroup>
              <EffectParameterName>
                <ObjectName>FxParameterKnobName</ObjectName>
                <Size>-1min,12f</Size>
                <EffectRack><Variable name="FxRack"/></EffectRack>
                <EffectUnit><Variable name="FxUnit"/></EffectUnit>
                <Effect><Variable name="FxNum"/></Effect>
                <EffectParameter><Variable name="FxParameter"/></EffectParameter>
                <Alignment>left</Alignment>
              </EffectParameterName>
              <WidgetGroup><SizePolicy>me,min</SizePolicy></WidgetGroup>
            </Children>
          </WidgetGroup>
        </Children>
      </WidgetGroup><!-- Parameter knob + parameter name -->

      <!-- Meta knob link button -->
      <Template src="skin:button_5state.xml">
        <SetVariable name="TooltipId">EffectSlot_parameter_link_type</SetVariable>
        <SetVariable name="ObjectName">FxSuperLinkButton</SetVariable>
        <SetVariable name="Size">42me,5f</SetVariable>
        <SetVariable name="ConfigKey"><Variable name="FxRack_FxUnit_FxNum"/>,parameter<Variable name="FxParameter"/>_link_type</SetVariable>
      </Template>

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

      <!-- Meta knob link invert button -->
      <Template src="skin:button_2state.xml">
        <SetVariable name="TooltipId">EffectSlot_parameter_inversion</SetVariable>
        <SetVariable name="ObjectName">FxSuperLinkInvertButton</SetVariable>
        <SetVariable name="Size">42me,5f</SetVariable>
        <SetVariable name="ConfigKey"><Variable name="FxRack_FxUnit_FxNum"/>,parameter<Variable name="FxParameter"/>_link_inverse</SetVariable>
      </Template>

      <WidgetGroup><Size>1min,2f</Size></WidgetGroup>

    </Children>
    <!-- show only if parameter is loaded -->
    <Connection>
      <ConfigKey><Variable name="FxRack_FxUnit_FxNum"/>,parameter<Variable name="FxParameter"/>_loaded</ConfigKey>
      <BindProperty>visible</BindProperty>
    </Connection>
  </WidgetGroup>
</Template>
