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

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

      <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 -->

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

      <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>

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

      <WidgetGroup><!-- Deck Controls + Star rating -->
        <ObjectName>DeckControlsRight</ObjectName>
        <Layout>horizontal</Layout>
        <SizePolicy>min,me</SizePolicy>
        <Children>
          <!-- 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>
                  <WidgetGroup><Size>1f,1min</Size></WidgetGroup>
                  <StarRating>
                    <ObjectName>DeckStars</ObjectName>
                    <Size>83min,22f</Size>
                    <TooltipId>starrating</TooltipId>
                    <Channel><Variable name="chanNum"/></Channel>
                  </StarRating>
                </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 -->

          <!-- Deck Controls which are always visible -->
          <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>

          <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_attention.svg</SetVariable>
            <SetVariable name="state_1_icon">xfader_center_attention.svg</SetVariable>
            <SetVariable name="state_2_icon">xfader_right.svg</SetVariable>
            <SetVariable name="Control">orientation</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_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_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">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>
          <!-- /Deck Controls which are always visible -->

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

          <WidgetGroup><!-- Expandable Deck controls -->
            <ObjectName>DeckControlsExpandedRight</ObjectName>
            <Layout>horizontal</Layout>
            <SizePolicy>min,min</SizePolicy>
            <Children>
              <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>

              <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_attention.svg</SetVariable>
                <SetVariable name="state_1_icon">xfader_center_attention.svg</SetVariable>
                <SetVariable name="state_2_icon">xfader_right.svg</SetVariable>
                <SetVariable name="Control">orientation</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_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_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">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>
            </Children>
            <Connection>
              <ConfigKey persist="true">[Tango],deck_controls_expanded</ConfigKey>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup><!-- /Expandable Deck controls -->

          <!-- 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_Right</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>

        </Children>
      </WidgetGroup><!-- /Deck Controls + Star rating -->
    </Children>
  </WidgetGroup><!-- /Play + deck controls -->
</Template>
