<!--
Description:
  The channel mixer containing
  * EQ knobs incl. Kill buttons ] if enabled
  * QuickEffect knob            ]
  * Headphone cue button
  * Volume slider
  * Gain knob
  * VUMeter
Variables:
  group : [ChannelXY]
-->
<Template>
  <WidgetGroup>
    <ObjectName>MixerChannelLeft</ObjectName>
    <Layout>horizontal</Layout>
    <Size>-1min,136f</Size>
    <Children>
      <WidgetGroup><ObjectName>Spacer0f</ObjectName><Size>1f,1min</Size></WidgetGroup>

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

      <WidgetGroup><!-- EQ + QuickEffect knobs/buttons -->
        <Layout>vertical</Layout>
        <SizePolicy>max,min</SizePolicy>
        <Children>
          <WidgetGroup><Size>1min,4f</Size></WidgetGroup>
          <Template src="skin:eq_knob_left.xml"><!-- High EQ -->
            <SetVariable name="FxParameter">3</SetVariable>
          </Template>
          <Template src="skin:eq_knob_left.xml"><!-- Mid EQ -->
            <SetVariable name="FxParameter">2</SetVariable>
          </Template>
          <Template src="skin:eq_knob_left.xml"><!-- Low EQ -->
            <SetVariable name="FxParameter">1</SetVariable>
          </Template>
          <Template src="skin:quick_fx_knob_left.xml"/><!-- Quick Effect -->
        </Children>
        <Connection>
          <ConfigKey persist="true">[Master],show_eqs</ConfigKey>
          <BindProperty>visible</BindProperty>
        </Connection>
      </WidgetGroup><!-- /EQ + QuickEffect knobs/buttons -->

      <WidgetGroup><!-- Spacer when EQ plugin is loaded & Kill buttons are shown -->
        <SizePolicy>min,min</SizePolicy>
        <Layout>vertical</Layout>
        <Children>
          <WidgetGroup>
            <Size>4f,0min</Size>
            <Connection>
              <ConfigKey>[Master],show_eq_kill_buttons</ConfigKey>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup>
        </Children>
        <Connection>
          <ConfigKey><Variable name="FxRack_FxUnit_FxNum"/>,loaded</ConfigKey>
          <BindProperty>visible</BindProperty>
        </Connection>
      </WidgetGroup>

      <WidgetGroup><!--  Volume Slider + Gain knob -->
        <ObjectName>VolumeSliderGain</ObjectName>
        <Layout>vertical</Layout>
        <SizePolicy>f,min</SizePolicy>
        <Children>
          <SliderComposed><!-- Volume slider -->
            <Size>34f,103f</Size>
            <ObjectName>VolumeSlider</ObjectName>
            <TooltipId>channel_volume</TooltipId>
            <Slider scalemode="STRETCH_ASPECT">knobs_sliders/volume_scale.svg</Slider>
            <Handle scalemode="STRETCH_ASPECT">knobs_sliders/volume_handle.svg</Handle>
            <Horizontal>false</Horizontal>
            <Connection>
              <ConfigKey><Variable name="group"/>,volume</ConfigKey>
            </Connection>
          </SliderComposed><!-- /Volume slider -->

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

          <!-- Gain knob, centered below Volume slider -->
          <Template src="skin:knob_textless.xml">
            <SetVariable name="ObjectName">GainKnob</SetVariable>
            <SetVariable name="TooltipId">pregain</SetVariable>
            <SetVariable name="Size">34f,30f</SetVariable>
            <SetVariable name="Color">yellow</SetVariable>
            <SetVariable name="group"><Variable name="group"/></SetVariable>
            <SetVariable name="ConfigKey">pregain</SetVariable>
          </Template>

        </Children>
      </WidgetGroup><!-- /Volume Slider + Gain knob -->

      <WidgetGroup><!-- VU Meter + Pfl button -->
        <ObjectName>AlignCenter</ObjectName>
        <Layout>vertical</Layout>
        <Children>
          <Template src="skin:vumeter_mixer.xml"/>

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

          <WidgetGroup><!-- Pfl button, isolated with a 'gap' -->
            <ObjectName>PflBoxLeft</ObjectName>
            <Size>25f,25f</Size>
            <Layout>stacked</Layout>
            <Children>
              <!-- index 0 due to bug -->
              <WidgetGroup><Size>0f,0f</Size></WidgetGroup>

              <!-- Greyed out if no headphone device is configured -->
              <Template src="skin:pfl_cover.xml"/>

              <Template src="skin:button_2state.xml">
                <SetVariable name="TooltipId">pfl</SetVariable>
                <SetVariable name="ObjectName">PflButton</SetVariable>
                <SetVariable name="Size">24f,24f</SetVariable>
                <SetVariable name="state_0_icon">pfl_off.svg</SetVariable>
                <SetVariable name="state_1_icon">pfl_on.svg</SetVariable>
                <SetVariable name="ConfigKey"><Variable name="group"/>,pfl</SetVariable>
              </Template>
            </Children>
          </WidgetGroup><!-- /Pfl button, isolated with a 'gap' -->
        </Children>
      </WidgetGroup><!-- /VU Meter + Pfl button -->
    </Children>
  </WidgetGroup>
</Template>
