<!--
Description:
  Size-aware container that checks if the any microphone is configured.
  If so, the Ducking controls container is shown.

Controls:
  [LateNight],show_ducking_controls

-->
<Template>
  <WidgetGroup>
    <Layout>horizontal</Layout>
    <Size>5f,0f</Size>
    <Children>

      <WidgetGroup>
        <Size>1f,0f</Size>
        <Connection>
          <ConfigKey>[Microphone],enabled</ConfigKey>
          <Transform><Not/></Transform>
          <BindProperty>visible</BindProperty>
        </Connection>
      </WidgetGroup>

      <WidgetGroup>
        <Size>1f,0f</Size>
        <Connection>
          <ConfigKey>[Microphone2],enabled</ConfigKey>
          <Transform><Not/></Transform>
          <BindProperty>visible</BindProperty>
        </Connection>
      </WidgetGroup>

      <WidgetGroup>
        <Size>1f,0f</Size>
        <Connection>
          <ConfigKey>[Microphone3],enabled</ConfigKey>
          <Transform><Not/></Transform>
          <BindProperty>visible</BindProperty>
        </Connection>
      </WidgetGroup>

      <WidgetGroup>
        <Size>1f,0f</Size>
        <Connection>
          <ConfigKey>[Microphone4],enabled</ConfigKey>
          <Transform><Not/></Transform>
          <BindProperty>visible</BindProperty>
        </Connection>
      </WidgetGroup>

      <SizeAwareStack><!-- Size detector -->
        <Children>
          <WidgetStack><!-- Not enough space for stars -->
            <SizePolicy>me,f</SizePolicy>
            <MinimumSize>0,0</MinimumSize>
            <MaximumSize>1,0</MaximumSize>
            <Children>
              <WidgetGroup><Size>1f,0f</Size></WidgetGroup>
              <WidgetGroup trigger="[LateNight],show_ducking_controls"><Size>1f,0f</Size></WidgetGroup>
            </Children>
          </WidgetStack>

          <WidgetStack><!-- when there is enough space for stars (min 83px) show them. -->
            <SizePolicy>me,f</SizePolicy>
            <MinimumSize>2,0</MinimumSize>
            <MaximumSize>-1,0</MaximumSize>
            <Children>
              <WidgetGroup trigger="[LateNight],show_ducking_controls"><Size>1f,0f</Size></WidgetGroup>
              <WidgetGroup><Size>1f,0f</Size></WidgetGroup>
            </Children>
          </WidgetStack>

        </Children>
      </SizeAwareStack><!-- /Size detector -->

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