<!DOCTYPE template>
<!--
  Description:
    Microphones container widget.
-->
<Template>
  <WidgetGroup>
    <Layout>vertical</Layout>
    <!-- I don't now why this works but a WidgetGroup wrapper around a
         WidgetStack with a 'fixed' size policy makes the group track the
         minimum size of the current stack widget. -->
    <SizePolicy>me,f</SizePolicy>

    <Children>

      <WidgetGroup>
        <ObjectName>MicAuxRack</ObjectName>
        <SizePolicy>me,min</SizePolicy>
        <Layout>horizontal</Layout>
        <Children>

          <!-- Microphone input controls -->
          <!-- Hide all mic controls but for Mic 1, if not enabled in
            the sound hardware preferences. Clicking the Mic 1 TALK
            button opens a modal window which allows to go straight
            to the preferences pane for easy set up. Once Mic 1 is
            set up, this widget hides itself. -->

          <Template src="skin:microphone.xml">
            <SetVariable name="i"></SetVariable>
          </Template>

          <WidgetGroup>
            <Layout>horizontal</Layout>
            <SizePolicy>max,me</SizePolicy>
            <Children>
              <Template src="skin:microphone.xml">
                <SetVariable name="i">2</SetVariable>
              </Template>
            </Children>
            <Connection>
              <ConfigKey>[Microphone2],enabled</ConfigKey>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup>

          <WidgetGroup>
            <Layout>horizontal</Layout>
            <SizePolicy>max,me</SizePolicy>
            <Children>
              <Template src="skin:microphone.xml">
                <SetVariable name="i">3</SetVariable>
              </Template>
            </Children>
            <Connection>
              <ConfigKey>[Microphone3],enabled</ConfigKey>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup>

          <WidgetGroup>
            <Layout>horizontal</Layout>
            <SizePolicy>max,me</SizePolicy>
            <Children>
              <Template src="skin:microphone.xml">
                <SetVariable name="i">4</SetVariable>
              </Template>
            </Children>
            <Connection>
              <ConfigKey>[Microphone4],enabled</ConfigKey>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup>

          <WidgetGroup>
            <ObjectName>MicDuckingContainer</ObjectName>
            <Layout>horizontal</Layout>
            <SizePolicy>max,me</SizePolicy>
            <Children>

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

                  <WidgetGroup>
                    <Layout>horizontal</Layout>
                    <SizePolicy>min,min</SizePolicy>
                    <Children>
                      <Label>
                        <ObjectName>DuckingLabel</ObjectName>
                        <Text>DUCKING</Text>
                      </Label>
                    </Children>
                  </WidgetGroup>

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

                  <PushButton>
                    <TooltipId>talkover_duck_mode</TooltipId>
                    <Size>66f,20f</Size>
                    <NumberStates>3</NumberStates>
                    <State>
                      <Number>0</Number>
                      <Text>OFF</Text>
                    </State>
                    <State>
                      <Number>1</Number>
                      <Text>AUTO</Text>
                    </State>
                    <State>
                      <Number>2</Number>
                      <Text>MANUAL</Text>
                    </State>
                    <Connection>
                      <ConfigKey>[Master],talkoverDucking</ConfigKey>
                      <EmitOnPressAndRelease>true</EmitOnPressAndRelease>
                    </Connection>
                  </PushButton>

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

              <!-- knob_with_label.xml template will not work here because
              "Strength" label exceeds width of knob. -->
              <WidgetGroup>
                <ObjectName>MicDuckingControls</ObjectName>
                <Layout>vertical</Layout>
                <SizePolicy>min,me</SizePolicy>
                <Children>

                  <WidgetGroup>
                    <Layout>horizontal</Layout>
                    <Children>
                      <Template src="skin:knob.xml">
                        <SetVariable name="group">[Master]</SetVariable>
                        <SetVariable name="control">duckStrength</SetVariable>
                        <SetVariable name="TooltipId">talkover_duck_strength</SetVariable>
                        <SetVariable name="color">blue</SetVariable>
                      </Template>
                    </Children>
                  </WidgetGroup>

                  <Label>
                    <ObjectName>KnobLabel</ObjectName>
                    <Text>Strength</Text>
                  </Label>
                </Children>
              </WidgetGroup>

            </Children>
          </WidgetGroup>

          <Template src="skin:spacer_h.xml"/>

          <!-- Auxiliary input controls -->

          <Template src="skin:auxiliary.xml">
            <SetVariable name="i">1</SetVariable>
          </Template>

          <WidgetGroup>
            <Layout>horizontal</Layout>
            <Children>
              <Template src="skin:auxiliary.xml">
                <SetVariable name="i">2</SetVariable>
              </Template>
            </Children>
            <Connection>
              <ConfigKey>[Auxiliary2],enabled</ConfigKey>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup>

          <WidgetGroup>
            <Layout>horizontal</Layout>
            <Children>
              <Template src="skin:auxiliary.xml">
                <SetVariable name="i">3</SetVariable>
              </Template>
            </Children>
            <Connection>
              <ConfigKey>[Auxiliary3],enabled</ConfigKey>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup>

          <WidgetGroup>
            <Layout>horizontal</Layout>
            <Children>
              <Template src="skin:auxiliary.xml">
                <SetVariable name="i">4</SetVariable>
              </Template>
            </Children>
            <Connection>
              <ConfigKey>[Auxiliary4],enabled</ConfigKey>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup>

        </Children>
      </WidgetGroup>

    </Children>
    <Connection>
      <ConfigKey>[Microphone],show_microphone</ConfigKey>
      <BindProperty>visible</BindProperty>
    </Connection>
  </WidgetGroup>
</Template>
