<!--
Description:
  Container for deck buttons:
  * deck controls
  * Star rating
  * indicators for assigned effect unit(s)
  * HotCues
  * Play/Cue

  There's also a SizeAwareStack in size_detector_stars.xml that detects if star rating
  can be displayed. This is 'outsourced' to background because there were too many
  interferences with expanding HotCue buttons and filling spacers.

Variables:
  group   : [ChannelN]
  chanNum : channel number
-->
<Template>
  <WidgetGroup>
    <ObjectName>DeckButtonsPlay</ObjectName>
    <ObjectName>DeckRowTransport</ObjectName>
    <Size>0me,24f</Size>
    <Layout>stacked</Layout>
    <Children>
      <WidgetGroup><!-- Play + deck controls -->
        <ObjectName>Spacer33</ObjectName>
        <Size>1me,24f</Size>
        <Layout>horizontal</Layout>
        <Children>

          <WidgetGroup><!-- Deck Controls + Star rating -->
            <ObjectName>DeckControlsLeft</ObjectName>
            <Layout>horizontal</Layout>
            <SizePolicy>min,me</SizePolicy>
            <Children>

              <!-- Toggle Deck controls -->
              <!-- Visible only if at least one control is NOT shown permanently -->
              <WidgetGroup>
                <Layout>vertical</Layout>
                <SizePolicy>min,min</SizePolicy>
                <Children>
                  <Template src="skins:Tango/controls/button_2state_persist.xml">
                    <SetVariable name="ObjectName">DeckControlsToggle_Left</SetVariable>
                    <!-- Size needs to be changed in size_detector_stars.xml, too -->
                    <SetVariable name="Size">15f,22f</SetVariable>
                    <SetVariable name="ConfigKey">[Tango],deck_controls_expanded</SetVariable>
                  </Template>
                </Children>
                <Connection>
                  <ConfigKey>[Tango],show_deck_controls_toggle</ConfigKey>
                  <BindProperty>visible</BindProperty>
                </Connection>
              </WidgetGroup>

              <WidgetGroup><!-- Expandable Deck controls -->
                <ObjectName>DeckControlsExpandedLeft</ObjectName>
                <Layout>horizontal</Layout>
                <SizePolicy>min,min</SizePolicy>
                <Children>
                  <Template src="skins:Tango/controls/button_deck_control_2state_opt.xml">
                    <SetVariable name="Width">18f</SetVariable>
                    <SetVariable name="TooltipId">keylock</SetVariable>
                    <SetVariable name="state_0_icon">keylock_off.svg</SetVariable>
                    <SetVariable name="state_1_icon">keylock_on.svg</SetVariable>
                    <SetVariable name="Control">keylock</SetVariable>
                  </Template>

                  <Template src="skins:Tango/controls/button_deck_control_1state_opt.xml">
                    <SetVariable name="Width">18f</SetVariable>
                    <SetVariable name="TooltipId">eject</SetVariable>
                    <SetVariable name="state_0_pressed">eject_pressed.svg</SetVariable>
                    <SetVariable name="state_0_unpressed">eject.svg</SetVariable>
                    <SetVariable name="Control">eject</SetVariable>
                  </Template>

                  <Template src="skins:Tango/controls/button_deck_control_2state_opt.xml">
                    <SetVariable name="Width">22f</SetVariable>
                    <SetVariable name="TooltipId">slip_mode</SetVariable>
                    <SetVariable name="state_0_icon">slipmode_off.svg</SetVariable>
                    <SetVariable name="state_1_icon">slipmode_on.svg</SetVariable>
                    <SetVariable name="Control">slip_enabled</SetVariable>
                  </Template>

                  <Template src="skins:Tango/controls/button_deck_control_2state_opt.xml">
                    <SetVariable name="Width">22f</SetVariable>
                    <SetVariable name="TooltipId">repeat</SetVariable>
                    <SetVariable name="state_0_icon">repeat_off.svg</SetVariable>
                    <SetVariable name="state_1_icon">repeat_on.svg</SetVariable>
                    <SetVariable name="Control">repeat</SetVariable>
                  </Template>

                  <Template src="skins:Tango/controls/button_deck_control_3state_opt.xml">
                    <SetVariable name="Width">20f</SetVariable>
                    <SetVariable name="TooltipId">orientation</SetVariable>
                    <SetVariable name="state_0_icon">xfader_left.svg</SetVariable>
                    <SetVariable name="state_1_icon">xfader_center_attention.svg</SetVariable>
                    <SetVariable name="state_2_icon">xfader_right_attention.svg</SetVariable>
                    <SetVariable name="Control">orientation</SetVariable>
                  </Template>

                  <Template src="skins:Tango/controls/button_deck_control_2state_opt.xml">
                    <SetVariable name="Width">20f</SetVariable>
                    <SetVariable name="TooltipId">quantize</SetVariable>
                    <SetVariable name="state_0_icon">quantize_off.svg</SetVariable>
                    <SetVariable name="state_1_icon">quantize_on.svg</SetVariable>
                    <SetVariable name="Control">quantize</SetVariable>
                  </Template>
                </Children>
                <Connection>
                  <ConfigKey persist="true">[Tango],deck_controls_expanded</ConfigKey>
                  <BindProperty>visible</BindProperty>
                </Connection>
              </WidgetGroup><!-- /Expandable Deck controls -->

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

              <!-- Deck Controls which are always visible -->
              <Template src="skins:Tango/controls/button_deck_control_2state_perm.xml">
                <SetVariable name="Width">18max</SetVariable>
                <SetVariable name="TooltipId">keylock</SetVariable>
                <SetVariable name="state_0_icon">keylock_off.svg</SetVariable>
                <SetVariable name="state_1_icon">keylock_on.svg</SetVariable>
                <SetVariable name="Control">keylock</SetVariable>
              </Template>

              <Template src="skins:Tango/controls/button_deck_control_1state_perm.xml">
                <SetVariable name="Width">18max</SetVariable>
                <SetVariable name="TooltipId">eject</SetVariable>
                <SetVariable name="state_0_pressed">eject_pressed.svg</SetVariable>
                <SetVariable name="state_0_unpressed">eject.svg</SetVariable>
                <SetVariable name="Control">eject</SetVariable>
              </Template>

              <Template src="skins:Tango/controls/button_deck_control_2state_perm.xml">
                <SetVariable name="Width">22max</SetVariable>
                <SetVariable name="TooltipId">slip_mode</SetVariable>
                <SetVariable name="state_0_icon">slipmode_off.svg</SetVariable>
                <SetVariable name="state_1_icon">slipmode_on.svg</SetVariable>
                <SetVariable name="Control">slip_enabled</SetVariable>
              </Template>

              <Template src="skins:Tango/controls/button_deck_control_2state_perm.xml">
                <SetVariable name="Width">22max</SetVariable>
                <SetVariable name="TooltipId">repeat</SetVariable>
                <SetVariable name="state_0_icon">repeat_off.svg</SetVariable>
                <SetVariable name="state_1_icon">repeat_on.svg</SetVariable>
                <SetVariable name="Control">repeat</SetVariable>
              </Template>

              <Template src="skins:Tango/controls/button_deck_control_3state_perm.xml">
                <SetVariable name="Width">20max</SetVariable>
                <SetVariable name="TooltipId">orientation</SetVariable>
                <SetVariable name="state_0_icon">xfader_left.svg</SetVariable>
                <SetVariable name="state_1_icon">xfader_center_attention.svg</SetVariable>
                <SetVariable name="state_2_icon">xfader_right_attention.svg</SetVariable>
                <SetVariable name="Control">orientation</SetVariable>
              </Template>

              <Template src="skins:Tango/controls/button_deck_control_2state_perm.xml">
                <SetVariable name="Width">20max</SetVariable>
                <SetVariable name="TooltipId">quantize</SetVariable>
                <SetVariable name="state_0_icon">quantize_off.svg</SetVariable>
                <SetVariable name="state_1_icon">quantize_on.svg</SetVariable>
                <SetVariable name="Control">quantize</SetVariable>
              </Template>
              <!-- /Deck Controls which are always visible -->

              <!-- Stars -->
              <!-- visibility controlled by SizeAwareStack in size_detector_stars.xml -->
              <WidgetGroup>
                <Layout>horizontal</Layout>
                <SizePolicy>min,min</SizePolicy>
                <Children>
                  <WidgetGroup>
                    <Size>84f,22f</Size>
                    <Layout>horizontal</Layout>
                    <Children>
                      <StarRating>
                        <ObjectName>DeckStars</ObjectName>
                        <Size>83min,22f</Size>
                        <TooltipId>starrating</TooltipId>
                        <Channel><Variable name="chanNum"/></Channel>
                      </StarRating>
                      <WidgetGroup><Size>1f,1min</Size></WidgetGroup>
                    </Children>
                    <Connection>
                      <ConfigKey persist="true">[Skin],show_starrating</ConfigKey>
                      <BindProperty>visible</BindProperty>
                    </Connection>
                  </WidgetGroup>
                </Children>
                <Connection>
                  <ConfigKey>[Tango],starrating_fits</ConfigKey>
                  <BindProperty>visible</BindProperty>
                </Connection>
              </WidgetGroup><!-- /Stars -->
            </Children>
          </WidgetGroup><!-- /Deck Controls + Star rating -->

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

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

          <!--	Cue button -->
          <Template src="skins:Tango/controls/button_2state_right_display.xml">
            <SetVariable name="TooltipId">cue_default_cue_gotoandstop</SetVariable>
            <SetVariable name="ObjectName">CueButton</SetVariable>
            <SetVariable name="Size">24f,24f</SetVariable>
            <SetVariable name="state_0_text">Q</SetVariable>
            <SetVariable name="state_1_text">Q</SetVariable>
            <SetVariable name="ConfigKey"><Variable name="group"/>,cue_default</SetVariable>
            <SetVariable name="ConfigKeyRight"><Variable name="group"/>,cue_gotoandstop</SetVariable>
            <SetVariable name="ConfigKeyDisp"><Variable name="group"/>,cue_indicator</SetVariable>
          </Template>

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

          <WidgetGroup>
            <ObjectName>Spacer0f</ObjectName>
            <Layout>stacked</Layout>
            <Size>50f,24f</Size>
            <Children>
              <!-- Play -->
              <Template src="skins:Tango/controls/button_2state_right_display.xml">
                <SetVariable name="ObjectName">PlayCue</SetVariable>
                <SetVariable name="TooltipId">play_cue_set</SetVariable>
                <SetVariable name="Size">50f,24f</SetVariable>
                <SetVariable name="state_0_icon">play_deck.svg</SetVariable>
                <SetVariable name="state_1_icon">pause_deck.svg</SetVariable>
                <SetVariable name="ConfigKey"><Variable name="group"/>,play</SetVariable>
                <SetVariable name="ConfigKeyRight"><Variable name="group"/>,cue_set</SetVariable>
                <SetVariable name="ConfigKeyDisp"><Variable name="group"/>,play_latched</SetVariable>
              </Template>
              <!-- Preview indicator, indicates previewing from Cue or Hotcue -->
              <Template src="skins:Tango/controls/button_2state.xml">
                <SetVariable name="ObjectName">PreviewIndicator</SetVariable>
                <SetVariable name="Size">50f,24f</SetVariable>
                <SetVariable name="ConfigKey"><Variable name="group"/>,play</SetVariable>
              </Template>
              <!-- Play indicator, blinks depending on Cue mode -->
              <Template src="skins:Tango/controls/button_2state.xml">
                <SetVariable name="ObjectName">PlayIndicator</SetVariable>
                <SetVariable name="Size">50f,24f</SetVariable>
                <SetVariable name="ConfigKey"><Variable name="group"/>,play_indicator</SetVariable>
              </Template>
            </Children>
          </WidgetGroup><!-- Play -->

        </Children>
      </WidgetGroup><!-- /Play + deck controls -->

      <!-- Detect if Star rating fits into deck buttons row
      <Template src="skins:Tango/helpers/size_detector_stars.xml"/> -->

      <!-- hidden detector to show deck controls toggle if necessary -->
      <Template src="skins:Tango/helpers/size_detector_deck_controls_toggle.xml"/>

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