<Template>

  <SingletonDefinition>
    <ObjectName>Samplers_Expander_<Variable name="Count"/>_Singleton</ObjectName>
    <Children>
      <Template src="skins:LateNight/samplers/sampler_expand_button.xml"/>
    </Children>
  </SingletonDefinition>

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

      <!-- Select between big or small samplers -->
      <WidgetGroup>
        <Layout>horizontal</Layout>
        <SizePolicy>me,min</SizePolicy>
        <Children>

          <!-- 8 small Samplers -->
          <WidgetGroup>
            <ObjectName>SamplerRow</ObjectName>
            <Layout>horizontal</Layout>
            <SizePolicy>min,min</SizePolicy>
            <Children>

              <Template src="skins:LateNight/samplers/sampler_mini.xml">
                <SetVariable name="SamplerNum"><Variable name="Sampler1"/></SetVariable>
              </Template>

              <Template src="skins:LateNight/samplers/sampler_mini.xml">
                <SetVariable name="SamplerNum"><Variable name="Sampler2"/></SetVariable>
              </Template>

              <Template src="skins:LateNight/samplers/sampler_mini.xml">
                <SetVariable name="SamplerNum"><Variable name="Sampler3"/></SetVariable>
              </Template>

              <Template src="skins:LateNight/samplers/sampler_mini.xml">
                <SetVariable name="SamplerNum"><Variable name="Sampler4"/></SetVariable>
              </Template>

              <SingletonContainer>
                <ObjectName>Samplers_Expander_<Variable name="Count"/>_Singleton</ObjectName>
              </SingletonContainer>

              <Template src="skins:LateNight/samplers/sampler_mini.xml">
                <SetVariable name="SamplerNum"><Variable name="Sampler5"/></SetVariable>
              </Template>

              <Template src="skins:LateNight/samplers/sampler_mini.xml">
                <SetVariable name="SamplerNum"><Variable name="Sampler6"/></SetVariable>
              </Template>

              <Template src="skins:LateNight/samplers/sampler_mini.xml">
                <SetVariable name="SamplerNum"><Variable name="Sampler7"/></SetVariable>
              </Template>

              <Template src="skins:LateNight/samplers/sampler_mini.xml">
                <SetVariable name="SamplerNum"><Variable name="Sampler8"/></SetVariable>
              </Template>

            </Children>
            <Connection>
              <ConfigKey persist="true">[LateNight],expand_samplers_<Variable name="Count"/></ConfigKey>
              <BindProperty>visible</BindProperty>
              <Transform><Not/></Transform>
            </Connection>
          </WidgetGroup>

          <!-- 8 big Samplers -->
          <!-- <WidgetGroup on_hide_select="0"> -->
          <WidgetGroup>
            <Layout>vertical</Layout>
            <SizePolicy>min,min</SizePolicy>
            <Children>

              <!-- First row 1 2 | 5 6 -->
              <WidgetGroup>
                <ObjectName>SamplerRow</ObjectName>
                <Layout>horizontal</Layout>
                <SizePolicy>min,min</SizePolicy>
                <Children>

                  <Template src="skins:LateNight/samplers/sampler.xml">
                    <SetVariable name="SamplerNum"><Variable name="Sampler1"/></SetVariable>
                  </Template>

                  <Template src="skins:LateNight/samplers/sampler.xml">
                    <SetVariable name="SamplerNum"><Variable name="Sampler2"/></SetVariable>
                  </Template>

                  <SingletonContainer>
                    <ObjectName>Samplers_Expander_<Variable name="Count"/>_Singleton</ObjectName>
                  </SingletonContainer>

                  <Template src="skins:LateNight/samplers/sampler.xml">
                    <SetVariable name="SamplerNum"><Variable name="Sampler5"/></SetVariable>
                  </Template>

                  <Template src="skins:LateNight/samplers/sampler.xml">
                    <SetVariable name="SamplerNum"><Variable name="Sampler6"/></SetVariable>
                  </Template>

                </Children>
              </WidgetGroup><!-- /First row -->

              <!-- Second row 3 4 | 7 8 -->
              <WidgetGroup>
                <ObjectName>SamplerRow</ObjectName>
                <SizePolicy>min,min</SizePolicy>
                <Layout>horizontal</Layout>
                <Children>

                  <Template src="skins:LateNight/samplers/sampler.xml">
                    <SetVariable name="SamplerNum"><Variable name="Sampler3"/></SetVariable>
                  </Template>

                  <Template src="skins:LateNight/samplers/sampler.xml">
                    <SetVariable name="SamplerNum"><Variable name="Sampler4"/></SetVariable>
                  </Template>

                  <WidgetGroup>
                    <ObjectName>MicAuxRackFiller</ObjectName>
                    <Size>20f,1me</Size>
                  </WidgetGroup>

                  <Template src="skins:LateNight/samplers/sampler.xml">
                    <SetVariable name="SamplerNum"><Variable name="Sampler7"/></SetVariable>
                  </Template>

                  <Template src="skins:LateNight/samplers/sampler.xml">
                    <SetVariable name="SamplerNum"><Variable name="Sampler8"/></SetVariable>
                  </Template>

                </Children>
              </WidgetGroup>
              <!-- /Second row -->

            </Children>
            <Connection>
              <ConfigKey persist="true">[LateNight],expand_samplers_<Variable name="Count"/></ConfigKey>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup>

        </Children>
      </WidgetGroup>

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