<!DOCTYPE template>
<!--
  Description:
    An effect chain widget.
  Variables:
    EffectRack: number of the effect rack (1)
    EffectUnit: number of this effect unit
-->
<Template>
  <SetVariable name="group">[EffectRack<Variable name="EffectRack"/>_EffectUnit<Variable name="EffectUnit"/>]</SetVariable>
  <WidgetGroup>
    <ObjectName>EffectUnitControls</ObjectName>
    <Layout>horizontal</Layout>
    <SizePolicy>max,min</SizePolicy>
    <Children>

      <!-- Super/Mix knobs when parameters are hidden -->
      <WidgetGroup>
        <Layout>horizontal</Layout>
        <SizePolicy>min,min</SizePolicy>
        <Children>

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

          <WidgetGroup>
            <Layout>vertical</Layout>
            <Connection>
              <ConfigKey>[Skin],show_superknobs</ConfigKey>
              <BindProperty>visible</BindProperty>
            </Connection>
            <Children>
              <Template src="skin:knob.xml">
                <SetVariable name="TooltipId">EffectUnit_super1</SetVariable>
                <SetVariable name="control">super1</SetVariable>
                <SetVariable name="color">blue_gapless</SetVariable>
              </Template>

              <!-- Spacer to vertically align with mix knob because of the mix mode button.-->
              <WidgetGroup><Size>-1,20f</Size></WidgetGroup>

            </Children>
          </WidgetGroup>

          <WidgetGroup>
            <Layout>vertical</Layout>
            <Children>
              <Template src="skin:knob.xml">
                <SetVariable name="TooltipId">EffectUnit_mix</SetVariable>
                <SetVariable name="control">mix</SetVariable>
                <SetVariable name="color">purple_gapless</SetVariable>
              </Template>

              <Template src="skin:left_2state_button.xml">
                <SetVariable name="ObjectName">EffectUnitMixModeButton</SetVariable>
                <SetVariable name="TooltipId">EffectUnit_mix_mode</SetVariable>
                <SetVariable name="MinimumSize">40,20</SetVariable>
                <SetVariable name="MaximumSize">40,20</SetVariable>
                <SetVariable name="state_0_unpressed">icon/ic_fx_mixmode_d-w.svg</SetVariable>
                <SetVariable name="state_0_pressed">icon/ic_fx_mixmode_d-w.svg</SetVariable>
                <SetVariable name="state_1_unpressed">icon/ic_fx_mixmode_d+w.svg</SetVariable>
                <SetVariable name="state_1_pressed">icon/ic_fx_mixmode_d+w.svg</SetVariable>
                <SetVariable name="left_connection_control"><Variable name="group"/>,mix_mode</SetVariable>
              </Template>
            </Children>
          </WidgetGroup>

        </Children>
        <Connection>
          <ConfigKey><Variable name="group"/>,show_parameters</ConfigKey>
          <Transform><Not/></Transform>
          <BindProperty>visible</BindProperty>
        </Connection>
      </WidgetGroup>

      <WidgetGroup>
        <Layout>vertical</Layout>
        <SizePolicy>max,min</SizePolicy>
        <Children>

          <PushButton>
            <ObjectName>EffectUnitToggle</ObjectName>
            <TooltipId>EffectUnit_show_parameters</TooltipId>
            <Size>45min,20f</Size>
            <NumberStates>2</NumberStates>
            <State>
              <Number>0</Number>
              <Text>&#8198;&#8198;FX<Variable name="EffectUnit"/></Text>
              <Alignment>left</Alignment>
            </State>
            <State>
              <Number>1</Number>
              <Text>&#8198;&#8198;FX<Variable name="EffectUnit"/></Text>
              <Alignment>left</Alignment>
            </State>
            <Connection>
              <ConfigKey><Variable name="group"/>,show_parameters</ConfigKey>
              <EmitOnPressAndRelease>true</EmitOnPressAndRelease>
              <ButtonState>LeftButton</ButtonState>
            </Connection>
          </PushButton>

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

          <WidgetGroup>
            <Layout>vertical</Layout>
            <SizePolicy>min,me</SizePolicy>
            <Children>

              <WidgetGroup>
                <Layout>vertical</Layout>
                <SizePolicy>min,min</SizePolicy>
                <Children>
                  <Template src="skin:knob.xml">
                    <SetVariable name="TooltipId">EffectUnit_mix</SetVariable>
                    <SetVariable name="control">mix</SetVariable>
                    <SetVariable name="color">purple_gapless</SetVariable>
                  </Template>

                  <Template src="skin:left_2state_button.xml">
                    <SetVariable name="ObjectName">EffectUnitMixModeButton</SetVariable>
                    <SetVariable name="TooltipId">EffectUnit_mix_mode</SetVariable>
                    <SetVariable name="MinimumSize">40,20</SetVariable>
                    <SetVariable name="MaximumSize">40,20</SetVariable>
                    <SetVariable name="state_0_unpressed">icon/ic_fx_mixmode_d-w.svg</SetVariable>
                    <SetVariable name="state_0_pressed">icon/ic_fx_mixmode_d-w.svg</SetVariable>
                    <SetVariable name="state_1_unpressed">icon/ic_fx_mixmode_d+w.svg</SetVariable>
                    <SetVariable name="state_1_pressed">icon/ic_fx_mixmode_d+w.svg</SetVariable>
                    <SetVariable name="left_connection_control"><Variable name="group"/>,mix_mode</SetVariable>
                  </Template>
                </Children>
              </WidgetGroup>

              <WidgetGroup>
                <Layout>vertical</Layout>
                <SizePolicy>min,min</SizePolicy>
                <Connection>
                  <ConfigKey>[Skin],show_superknobs</ConfigKey>
                  <BindProperty>visible</BindProperty>
                </Connection>
                <Children>
                  <WidgetGroup><Size>0min,2f</Size></WidgetGroup>
                  <Template src="skin:knob.xml">
                    <SetVariable name="TooltipId">EffectUnit_super1</SetVariable>
                    <SetVariable name="control">super1</SetVariable>
                    <SetVariable name="color">blue_gapless</SetVariable>
                  </Template>
                  <WidgetGroup><Size>0min,2f</Size></WidgetGroup>
                </Children>
              </WidgetGroup>
            </Children>
            <Connection>
              <ConfigKey><Variable name="group"/>,show_parameters</ConfigKey>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup>

          <WidgetGroup><SizePolicy>min,me</SizePolicy></WidgetGroup>

          <WidgetGroup>
            <ObjectName>EffectUnitHead</ObjectName>
            <Layout>horizontal</Layout>
            <SizePolicy>min,max</SizePolicy>
            <Children>
              <Template src="skin:left_2state_button.xml">
                <SetVariable name="TooltipId">EffectUnit_headphones_enabled</SetVariable>
                <SetVariable name="ObjectName">FxAssignmentButton</SetVariable>
                <SetVariable name="MinimumSize"><Variable name="SquareButtonMinimumSize"/></SetVariable>
                <SetVariable name="MaximumSize"><Variable name="SquareButtonMaximumSize"/></SetVariable>
                <SetVariable name="SizePolicy"><Variable name="SquareButtonSizePolicy"/></SetVariable>
                <SetVariable name="state_0_pressed">icon/ic_headphones_48px.svg</SetVariable>
                <SetVariable name="state_0_unpressed">icon/ic_headphones_48px.svg</SetVariable>
                <SetVariable name="state_1_pressed">icon/ic_headphones_48px.svg</SetVariable>
                <SetVariable name="state_1_unpressed">icon/ic_headphones_48px.svg</SetVariable>
                <SetVariable name="left_connection_control">[EffectRack1_EffectUnit<Variable name="EffectUnit"/>],group_[Headphone]_enable</SetVariable>
              </Template>
            </Children>
          </WidgetGroup>

        </Children>
      </WidgetGroup>

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