<!--
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>DeckButtonsPlay</ObjectName>
    <Size>1me,24f</Size>
    <Layout>horizontal</Layout>
    <Children>
      <WidgetGroup><!-- Play button incl. Cue (right click) -->
        <ObjectName>Spacer0f</ObjectName>
        <Layout>stacked</Layout>
        <Size>50f,24f</Size>
        <Children>
          <!-- index 0 due to bug -->
          <WidgetGroup><Size>0f,0f</Size></WidgetGroup>
          <!-- Block Play button if passthrough is active,
              show speaker icon instead -->
          <WidgetGroup>
            <ObjectName>PassthroughPlayCover</ObjectName>
            <Layout>vertical</Layout>
            <SizePolicy>me,me</SizePolicy>
            <Connection>
              <ConfigKey><Variable name="group"/>,passthrough</ConfigKey>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup>
          <WidgetGroup>
            <ObjectName>Spacer33</ObjectName>
            <Layout>vertical</Layout>
            <SizePolicy>me,me</SizePolicy>
            <Connection>
              <ConfigKey><Variable name="group"/>,passthrough</ConfigKey>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup>
          <!-- Play -->
          <Template src="skin: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_default</SetVariable>
            <SetVariable name="ConfigKeyDisp"><Variable name="group"/>,play_indicator</SetVariable>
          </Template>
          <!--	Play indicator: turns Orange when playing from Cue/HotCue position.
          Only visible when play_indicator above is zero0, otherwise it's covered. -->
          <Template src="skin:button_2state.xml">
            <SetVariable name="ObjectName">PlayUnderlay</SetVariable>
            <SetVariable name="Size">50f,24f</SetVariable>
            <SetVariable name="ConfigKey"><Variable name="group"/>,play</SetVariable>
          </Template>
          <!--	Cue indicator: shows coloured border i.e. if play position is at cue point.
          See Cue settings in Preferences > Interface > Deck Options -->
          <Template src="skin:button_2state.xml">
            <SetVariable name="ObjectName">CueUnderlay</SetVariable>
            <SetVariable name="Size">50f,24f</SetVariable>
            <SetVariable name="ConfigKey"><Variable name="group"/>,cue_indicator</SetVariable>
          </Template>
        </Children>
        <Connection>
          <ConfigKey persist="true">[Tango],separate_cue_button</ConfigKey>
          <Transform><Not/></Transform>
          <BindProperty>visible</BindProperty>
        </Connection>
      </WidgetGroup><!-- /Play button incl. Cue (right click) -->

      <WidgetGroup><!-- Play button, separate Cue button -->
        <ObjectName>Spacer0f</ObjectName>
        <Layout>horizontal</Layout>
        <Size>75f,24f</Size>
        <Children>
          <WidgetGroup><!-- Play button with playFromCue underlay -->
            <ObjectName>Spacer0f</ObjectName>
            <Layout>stacked</Layout>
            <Size>50f,24f</Size>
            <Children>
              <!-- index 0 due to bug -->
              <WidgetGroup><Size>0f,0f</Size></WidgetGroup>
              <!-- Block Play button if passthrough is active,
                  show speaker icon instead -->
              <WidgetGroup>
                <ObjectName>PassthroughPlayCover</ObjectName>
                <Layout>vertical</Layout>
                <SizePolicy>me,me</SizePolicy>
                <Connection>
                  <ConfigKey><Variable name="group"/>,passthrough</ConfigKey>
                  <BindProperty>visible</BindProperty>
                </Connection>
              </WidgetGroup>
              <!-- Play -->
              <Template src="skin: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"/>,play</SetVariable>
                <SetVariable name="ConfigKeyDisp"><Variable name="group"/>,play_indicator</SetVariable>
              </Template>
              <!--	Play indicator: turns Orange when playing from Cue/HotCue position.
              Only visible when play_indicator above is zero0, otherwise it's covered. -->
              <Template src="skin:button_2state.xml">
                <SetVariable name="ObjectName">PlayUnderlay</SetVariable>
                <SetVariable name="Size">50f,24f</SetVariable>
                <SetVariable name="ConfigKey"><Variable name="group"/>,play</SetVariable>
              </Template>
              <Template src="skin:button_2state.xml">
                <SetVariable name="ObjectName">CueButton</SetVariable>
                <SetVariable name="Size">50f,24f</SetVariable>
              </Template>
            </Children>
          </WidgetGroup><!-- Play button with playFromCue underlay -->
            <WidgetGroup><ObjectName>Spacer0f</ObjectName><Size>1f,1min</Size></WidgetGroup>
          <!--	Cue button -->
          <Template src="skin: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>
        </Children>
        <Connection>
          <ConfigKey persist="true">[Tango],separate_cue_button</ConfigKey>
          <BindProperty>visible</BindProperty>
        </Connection>
      </WidgetGroup><!-- /Play button, separate Cue button -->

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

      <Template src="skin: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">[Tango],stars</ConfigKey>
                  <BindProperty>visible</BindProperty>
                </Connection>
              </WidgetGroup>
            </Children>
            <Connection>
              <ConfigKey>[Tango],stars_fit</ConfigKey>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup><!-- /Stars -->

          <!-- Deck Controls which are always visible -->
          <Template src="skin: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="skin: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="skin: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="skin: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="skin: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="skin: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="skin: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="skin: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="skin: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="skin: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="skin: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="skin: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 -->

          <WidgetGroup><!-- Toggle Deck controls -->
            <Layout>vertical</Layout>
            <SizePolicy>min,min</SizePolicy>
            <Children>
              <Template src="skin:button_2state_persist.xml">
                <SetVariable name="ObjectName">DeckControlsToggler_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>
