<!--
Description:
  A deck container
  * VU meter
  * mixer / [CoverArt/Spinny]
  * main deck
    * artist/title
    * overview
    * track comment (if enabled)
    * deck buttons
Variables:
  chanNum : [ChannelN]
-->
<Template>
  <SetVariable name="group">[Channel<Variable name="chanNum"/>]</SetVariable>

  <SingletonDefinition>
    <ObjectName>DeckOverviewRow<Variable name="chanNum"/></ObjectName>
    <Children>
      <Template src="skins:Tango/decks/row_overview_right.xml"/>
    </Children>
  </SingletonDefinition>

  <SingletonDefinition>
    <ObjectName>DeckTextRow<Variable name="chanNum"/></ObjectName>
    <Children>
      <WidgetGroup>
        <Layout>horizontal</Layout>
        <Children>
          <WidgetGroup><!-- Symmetric Artist + Time -->
            <Layout>horizontal</Layout>
            <Children>
              <Template src="skins:Tango/decks/loop_indicator.xml"/>
              <Template src="skins:Tango/decks/row_text_right.xml"/>
            </Children>
            <Connection>
              <ConfigKey persist="true">[Tango],symmetric_time</ConfigKey>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup>

          <WidgetGroup><!-- Parallel Artist + Time -->
            <Layout>horizontal</Layout>
            <Children>
              <Template src="skins:Tango/decks/loop_indicator.xml"/>
              <Template src="skins:Tango/decks/row_text_left.xml"/>
            </Children>
            <Connection>
              <ConfigKey persist="true">[Tango],symmetric_time</ConfigKey>
              <Transform><Not/></Transform>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup>
        </Children>
      </WidgetGroup>
    </Children>
  </SingletonDefinition>

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

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

      <WidgetGroup><!-- VUMeter -->
        <Layout>horizontal</Layout>
        <SizePolicy>min,min</SizePolicy>
        <Children>

          <WidgetGroup>
            <SizePolicy>min,min</SizePolicy>
            <Layout>horizontal</Layout>
            <Children>
              <Template src="skins:Tango/mixer/vumeter_floating.xml">
                <SetVariable name="Label">Deck<Variable name="chanNum"/></SetVariable>
              </Template>
              <WidgetGroup><Size>3f,1min</Size></WidgetGroup>
            </Children>
            <Connection>
              <ConfigKey persist="true">[Tango],vumeter</ConfigKey>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup>

        </Children>
        <Connection>
          <ConfigKey persist="true">[Skin],show_mixer</ConfigKey>
          <Transform><Not/></Transform>
          <BindProperty>visible</BindProperty>
        </Connection>
      </WidgetGroup><!-- /VUMeter -->

      <!-- Pitch slider & Key controls -->
      <Template src="skins:Tango/decks/rate_pitch_key.xml"/>

      <WidgetGroup>
        <Size>3f,1min</Size>
        <Connection>
          <ConfigKey persist="true">[Skin],show_rate_controls</ConfigKey>
          <BindProperty>visible</BindProperty>
        </Connection>
      </WidgetGroup>
      <!-- /Pitch slider & Key controls -->

      <WidgetGroup><!-- Spinny/Cover -->
        <Layout>horizontal</Layout>
        <SizePolicy>min,min</SizePolicy>
        <Children>

          <!-- Spinny/Cover if BIG spinny is enabled -->
          <WidgetGroup>
            <SizePolicy>max,min</SizePolicy>
            <Layout>horizontal</Layout>
            <Children>

              <Template src="skins:Tango/decks/spinny_cover_maxi.xml"/>

              <!-- 3px margin to main deck -->
              <WidgetGroup>
                <Size>3f,1min</Size>
                <Connection>
                  <ConfigKey persist="true">[Tango],show_spinny_cover</ConfigKey>
                  <BindProperty>visible</BindProperty>
                </Connection>
              </WidgetGroup>

            </Children>
            <Connection>
              <ConfigKey persist="true">[Skin],show_big_spinny_coverart</ConfigKey>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup><!-- /Spinny/Cover if BIG spinny is enabled -->

        </Children>
        <Connection>
          <ConfigKey persist="true">[Skin],show_mixer</ConfigKey>
          <Transform><Not/></Transform>
          <BindProperty>visible</BindProperty>
        </Connection>
      </WidgetGroup><!-- /Spinny/Cover -->

      <WidgetGroup><!-- Mixer -->
        <Layout>vertical</Layout>
        <SizePolicy>f,min</SizePolicy>
        <Children>
          <Template src="skins:Tango/mixer/mixer_channel_right.xml"/>
          <WidgetGroup><ObjectName>Spacer1e</ObjectName><Size>0min,0me</Size></WidgetGroup>
        </Children>
        <Connection>
          <ConfigKey persist="true">[Skin],show_mixer</ConfigKey>
          <BindProperty>visible</BindProperty>
        </Connection>
      </WidgetGroup><!-- /Mixer -->

      <WidgetGroup><!-- [Overview, Comment, ArtistTitle] + [Loop/Beatjump, DeckButtons] -->
        <ObjectName>Deck<Variable name="chanNum"/></ObjectName>
        <SizePolicy>me,min</SizePolicy>
        <Layout>vertical</Layout>
        <Children>

          <!-- Packed Overview & ArtistTitle into a fixed-size container,
          so Deck stays steady while Comment and LoopBeatjump controls can be toggled.
          Symmetrical decks [Waveforn/Artist/Deckbuttons] can be enabled in skin settings.
          1 Waveform
          2 Comment (optional)
          3 Title / Play position
          4 Artist / track length -->
          <WidgetGroup><!-- Overview, Comment, ArtistTitle -->
            <Layout>vertical</Layout>
            <Size>250me,111f</Size>
            <Children>

              <SingletonContainer>
                <ObjectName>DeckOverviewRow<Variable name="chanNum"/></ObjectName>
              </SingletonContainer>

              <Template src="skins:Tango/decks/row_comment_fx_right.xml"/>

              <SingletonContainer>
                <ObjectName>DeckTextRow<Variable name="chanNum"/></ObjectName>
              </SingletonContainer>

            </Children>
            <Connection>
              <ConfigKey persist="true">[Tango],symmetric_overviews</ConfigKey>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup><!-- /Symmetric Overviews, ArtistTitle, Comment -->

          <WidgetGroup><!-- Stacked Overviews, ArtistTitle, Comment -->
            <Layout>vertical</Layout>
            <Size>250me,111f</Size>
            <Children>

              <SingletonContainer>
                <ObjectName>DeckTextRow<Variable name="chanNum"/></ObjectName>
              </SingletonContainer>

              <Template src="skins:Tango/decks/row_comment_fx_right.xml"/>

              <WidgetGroup><!--
                <ObjectName>DeckOverviewBox<Variable name="chanNum"/></ObjectName> -->
                <Layout>horizontal</Layout>
                <Size>0me,50f</Size>
                <Children>
                  <SingletonContainer>
                    <ObjectName>DeckOverviewRow<Variable name="chanNum"/></ObjectName>
                  </SingletonContainer>
                </Children>
              </WidgetGroup>

            </Children>
            <Connection>
              <ConfigKey persist="true">[Tango],symmetric_overviews</ConfigKey>
              <Transform><Not/></Transform>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup><!-- /Stacked Overviews, ArtistTitle, Comment -->

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

          <Template src="skins:Tango/decks/row_transport_right.xml" />

          <Template src="skins:Tango/decks/row_loop_jump.xml">
            <SetVariable name="SpaceLeft">70</SetVariable>
            <SetVariable name="SpaceRight">-1</SetVariable>
          </Template>

        </Children>
      </WidgetGroup><!-- / [Overview, Comment, ArtistTitle] + [Loop/Beatjump, DeckButtons] -->
    </Children>
  </WidgetGroup>
</Template>
