<!--
Description:
  Container for microphone controls in mixerbar
  * talkover/mute button
  * level meter
  * Pregain knob
  We need different variables for Mic label and for group name
  since Mic 1 is just named 'Microphone'
Variables:
  micLabel     : text shown on talkover button
  micNum : internal microphone number (empty for Mic1)
-->
<Template>
  <SetVariable name="sourceType">microphone</SetVariable>
  <SetVariable name="group">[Microphone<Variable name="micNum"/>]</SetVariable>
  <SetVariable name="FxRack">1</SetVariable>
  <WidgetGroup>
    <ObjectName>AlignCenter</ObjectName>
    <Layout>horizontal</Layout>
    <SizePolicy>min,min</SizePolicy>
    <Children>
      <WidgetGroup>
        <ObjectName>MicUnit</ObjectName>
        <Layout>horizontal</Layout>
        <SizePolicy>min,min</SizePolicy>
        <Children>

          <Label>
            <ObjectName>MicUnitIcon</ObjectName>
            <Size>18f,32f</Size>
          </Label>

          <Label>
            <ObjectName>MicUnitLabel</ObjectName>
            <Size>13f,32f</Size>
            <Text><Variable name="micLabel"/></Text>
            <Alignment>right</Alignment>
          </Label>

          <Template src="skin:../Tango/controls/button_2state.xml">
            <SetVariable name="TooltipId">microphone_talkover</SetVariable>
            <SetVariable name="ObjectName">MicTalkover</SetVariable>
            <SetVariable name="Size">20f,29f</SetVariable>
            <SetVariable name="ConfigKey"><Variable name="group"/>,talkover</SetVariable>
          </Template>

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

          <Template src="skin:../Tango/mixer/vumeter_mini.xml">
            <SetVariable name="TooltipId">microphone_VuMeter</SetVariable>
            <SetVariable name="Size">5f,29f</SetVariable>
          </Template>

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

          <Template src="skin:../Tango/controls/knob_textless.xml">
            <SetVariable name="TooltipId">microphone_pregain</SetVariable>
            <SetVariable name="ObjectName">MicAuxKnob</SetVariable>
            <SetVariable name="Size">30f,30f</SetVariable>
            <SetVariable name="group"><Variable name="group"/></SetVariable>
            <SetVariable name="ConfigKey">pregain</SetVariable>
            <SetVariable name="Color">yellow</SetVariable>
          </Template>

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

          <WidgetGroup><!-- Pfl button + cover -->
            <Size>20f,20f</Size>
            <Layout>stacked</Layout>
            <Children>
              <!-- Greyed out if no headphone device is configured -->
              <Template src="skin:../Tango/helpers/pfl_cover.xml"/>
              <Template src="skin:../Tango/controls/button_2state.xml">
                <SetVariable name="TooltipId">pfl</SetVariable>
                <SetVariable name="ObjectName">PflButton</SetVariable>
                <SetVariable name="Size">20f,20f</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 + cover -->

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

          <WidgetGroup><!-- FX assignment buttons -->
            <ObjectName>Spacer0f</ObjectName>
            <Layout>horizontal</Layout>
            <SizePolicy>min,min</SizePolicy>
            <Children>

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

              <WidgetGroup>
                <Layout>vertical</Layout>
                <SizePolicy>min,min</SizePolicy>
                <Children>
                  <Template src="skin:../Tango/fx/assign_button.xml">
                    <SetVariable name="Size">26f,16f</SetVariable>
                    <SetVariable name="FxUnit">1</SetVariable>
                  </Template>
                    <WidgetGroup><Size>1min,1f</Size></WidgetGroup>
                  <Template src="skin:../Tango/fx/assign_button.xml">
                    <SetVariable name="Size">26f,16f</SetVariable>
                    <SetVariable name="FxUnit">3</SetVariable>
                  </Template>
                </Children>
              </WidgetGroup>

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

              <WidgetGroup>
                <Layout>vertical</Layout>
                <SizePolicy>min,min</SizePolicy>
                <Children>
                  <Template src="skin:../Tango/fx/assign_button.xml">
                    <SetVariable name="Size">26f,16f</SetVariable>
                    <SetVariable name="FxUnit">2</SetVariable>
                  </Template>
                    <WidgetGroup><Size>1min,1f</Size></WidgetGroup>
                  <Template src="skin:../Tango/fx/assign_button.xml">
                    <SetVariable name="Size">26f,16f</SetVariable>
                    <SetVariable name="FxUnit">4</SetVariable>
                  </Template>
                </Children>
              </WidgetGroup>

            </Children>
          </WidgetGroup><!-- /FX assignment buttons -->

        </Children>
      </WidgetGroup>
    </Children>
    <Connection>
      <ConfigKey><Variable name="group"/>,enabled</ConfigKey>
      <BindProperty>visible</BindProperty>
    </Connection>
  </WidgetGroup>
</Template>
