<!--  This layout is only used for channel 1.  It can switch between a standard
vertical layout and a side-by-side layout for two-deck mode -->

<Template>
  <SetVariable name="group">[Channel<Variable name="channum"/>]</SetVariable>
  <WidgetGroup>
    <SizePolicy>max,min</SizePolicy>
    <Layout>horizontal</Layout>
    <Children>

      <WidgetGroup><!--  Channel1 controls side-by-side-->
        <ObjectName>MixerChannel_2Decks</ObjectName>
        <Layout>horizontal</Layout>
        <SizePolicy>min,min</SizePolicy>
        <Children>

          <WidgetGroup><!-- EQs -->
            <Layout>vertical</Layout>
            <ObjectName>MixerChannel_2Decks_Left</ObjectName>
            <SizePolicy>min,min</SizePolicy>
            <Children>

              <!-- Spacer when there's no 4th EQ AND no QuickEffect loaded -->
              <WidgetGroup>
                <Layout>horizontal</Layout>
                <SizePolicy>min,min</SizePolicy>
                <Children>
                  <WidgetGroup>
                    <Layout>horizontal</Layout>
                    <Size>0min,34f</Size>
                    <Children/>
                    <Connection>
                      <ConfigKey>[QuickEffectRack1_<Variable name="group"/>_Effect1],loaded</ConfigKey>
                      <Transform><Not/></Transform>
                      <BindProperty>visible</BindProperty>
                    </Connection>
                  </WidgetGroup>
                </Children>
                <Connection>
                  <ConfigKey>[EqualizerRack1_<Variable name="group"/>_Effect1],parameter4_loaded</ConfigKey>
                  <Transform><Not/></Transform>
                  <BindProperty>visible</BindProperty>
                </Connection>
              </WidgetGroup>

              <Template src="skin:eq_knob_left.xml">
                <SetVariable name="FxParameter">4</SetVariable>
              </Template>

              <Template src="skin:eq_knob_left.xml">
                <SetVariable name="FxParameter">3</SetVariable>
              </Template>

              <Template src="skin:eq_knob_left.xml">
                <SetVariable name="FxParameter">2</SetVariable>
              </Template>

              <Template src="skin:eq_knob_left.xml">
                <SetVariable name="FxParameter">1</SetVariable>
              </Template>

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

              <!-- Spacer -->
              <WidgetGroup><Size>1min,0me</Size></WidgetGroup>
            </Children>
          </WidgetGroup><!-- /EQs -->

          <WidgetGroup><!-- Gain knob + Vol fader -->
            <ObjectName>VolumeGain2Decks</ObjectName>
            <Layout>vertical</Layout>
            <SizePolicy>min,min</SizePolicy>
            <Children>
              <Template src="skin:knob_textless.xml">
                <SetVariable name="Size">40f,34f</SetVariable>
                <SetVariable name="group"><Variable name="group"/></SetVariable>
                <SetVariable name="control">pregain</SetVariable>
                <SetVariable name="TooltipId">pregain</SetVariable>
              </Template>

              <!-- Spacer -->
              <WidgetGroup><Size>1min,4me</Size></WidgetGroup>

              <SliderComposed>   <!-- Volume -->
                <TooltipId>channel_volume</TooltipId>
                <Handle scalemode="STRETCH_ASPECT">knob_volume_deck.svg</Handle>
                <Slider>slider_volume_deck.svg</Slider>
                <Horizontal>false</Horizontal>
                <Connection>
                  <ConfigKey><Variable name="group"/>,volume</ConfigKey>
                </Connection>
              </SliderComposed>
            </Children>
          </WidgetGroup><!-- /Gain knob + Vol fader -->

          <WidgetGroup><!-- Pfl button + VU Meter -->
            <ObjectName>PFLVUMeterBox</ObjectName>
            <Layout>vertical</Layout>
            <SizePolicy>min,me</SizePolicy>
            <Children>
              <Template src="skin:button_2state.xml">
                <SetVariable name="TooltipId">pfl</SetVariable>
                <SetVariable name="icon">pfl</SetVariable>
                <SetVariable name="ConfigKey"><Variable name="group"/>,pfl</SetVariable>
                <SetVariable name="Size">26,26</SetVariable>
              </Template>

              <!-- Spacer -->
              <WidgetGroup>
                <Layout>vertical</Layout>
                <Size>1min,0me</Size>
                <Children/>
              </WidgetGroup>

              <WidgetGroup>
                <ObjectName>VUMeterBox</ObjectName>
                <Layout>horizontal</Layout>
                <Children>
                  <StatusLight>
                    <TooltipId>channel_PeakIndicator</TooltipId>
                    <PathStatusLight>style/clipping_deck_over.png</PathStatusLight>
                    <PathBack>style/clipping_deck.png</PathBack>
                    <Connection>
                      <ConfigKey><Variable name="group"/>,PeakIndicator</ConfigKey>
                    </Connection>
                  </StatusLight>
                </Children>
              </WidgetGroup>

              <WidgetGroup>
                <ObjectName>VUMeterBox</ObjectName>
                <Layout>horizontal</Layout>
                <Children>
                  <VuMeter>
                    <TooltipId>channel_VuMeter</TooltipId>
                    <PathVu>style/volume_display_deck_over.png</PathVu>
                    <PathBack>style/volume_display_deck.png</PathBack>
                    <Horizontal>false</Horizontal>
                    <PeakHoldSize>5</PeakHoldSize>
                    <PeakHoldTime>500</PeakHoldTime>
                    <PeakFallTime>50</PeakFallTime>
                    <PeakFallStep>2</PeakFallStep>
                    <Connection>
                      <ConfigKey><Variable name="group"/>,VuMeter</ConfigKey>
                    </Connection>
                  </VuMeter>
                </Children>
              </WidgetGroup>
            </Children>
          </WidgetGroup><!-- /Pfl button + VU Meter -->
        </Children>
        <Connection>
          <ConfigKey>[Master],show_4decks</ConfigKey>
          <BindProperty>visible</BindProperty>
          <Transform><Not/></Transform>
        </Connection>
      </WidgetGroup><!-- /Channel1 mixer side-by-side -->

      <WidgetGroup>
        <Layout>horizontal</Layout>
        <SizePolicy>min,min</SizePolicy>
        <Children>
          <Template src="skin:mixer_channel_4decks.xml"/>
        </Children>
        <Connection>
          <ConfigKey>[Master],show_4decks</ConfigKey>
          <BindProperty>visible</BindProperty>
        </Connection>
      </WidgetGroup>

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