<Template>
  <SetVariable name="BtnType"><Variable name="SubRegion_BtnType"/></SetVariable>
  <SetVariable name="BtnSize">square</SetVariable>

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

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

          <WidgetGroup><!-- Play, Cue, Reverse -->
            <Layout>vertical</Layout>
            <SizePolicy>max,min</SizePolicy>
            <Children>
              <WidgetGroup><!-- Reverse | Cue -->
                <Layout>horizontal</Layout>
                <Children>

                  <PushButton>
                    <TooltipId>cue_default_cue_gotoandstop</TooltipId>
                    <ObjectName>CueDeck</ObjectName>
                    <Size>42f,26f</Size>
                    <NumberStates>2</NumberStates>
                    <RightClickIsPushButton>true</RightClickIsPushButton>
                    <State>
                      <Number>0</Number>
                      <Text><Variable name="state_0_text"/></Text>
                      <Alignment><Variable name="Align"/></Alignment>
                      <Unpressed scalemode="STRETCH">skin:/<Variable name="BtnScheme"/>/buttons/btn_<Variable name="BtnType"/>_medium.svg</Unpressed>
                      <Pressed scalemode="STRETCH">skin:/<Variable name="BtnScheme"/>/buttons/btn_<Variable name="BtnType"/>_medium_active.svg</Pressed>
                    </State>
                    <State>
                      <Number>1</Number>
                      <Text><Variable name="state_1_text"/></Text>
                      <Alignment><Variable name="Align"/></Alignment>
                      <Unpressed scalemode="STRETCH">skin:/<Variable name="BtnScheme"/>/buttons/btn_<Variable name="BtnType"/>_medium_set.svg</Unpressed>
                      <Pressed scalemode="STRETCH">skin:/<Variable name="BtnScheme"/>/buttons/btn_<Variable name="BtnType"/>_medium_active.svg</Pressed>
                    </State>
                    <Connection>
                      <ConfigKey><Variable name="Group"/>,cue_default</ConfigKey>
                      <ButtonState>LeftButton</ButtonState>
                    </Connection>
                    <Connection>
                      <ConfigKey><Variable name="Group"/>,cue_gotoandstop</ConfigKey>
                      <ButtonState>RightButton</ButtonState>
                    </Connection>
                    <Connection>
                      <ConfigKey><Variable name="Group"/>,cue_indicator</ConfigKey>
                      <ConnectValueFromWidget>false</ConnectValueFromWidget>
                    </Connection>
                  </PushButton>

                  <Template src="skin:/controls/button_1state_right.xml">
                    <SetVariable name="TooltipId">reverse</SetVariable>
                    <SetVariable name="ObjectName">Reverse</SetVariable>
                    <SetVariable name="Size">26f,26f</SetVariable>
                    <SetVariable name="BtnSize">square</SetVariable>
                    <SetVariable name="ConfigKey"><Variable name="Group"/>,reverse</SetVariable>
                    <SetVariable name="ConfigKeyRight"><Variable name="Group"/>,reverseroll</SetVariable>
                  </Template>

                </Children>
              </WidgetGroup><!-- Reverse | Cue -->

              <WidgetGroup><!-- Play + PlayBlink + default dark background -->
                <Layout>stacked</Layout>
                <Size>68f,26f</Size>
                <Children>
                  <Template src="skin:/controls/button_2state_right_display.xml">
                    <SetVariable name="TooltipId">play_cue_set</SetVariable>
                    <SetVariable name="ObjectName">PlayDeck</SetVariable>
                    <SetVariable name="Size">68f,26f</SetVariable>
                    <SetVariable name="BtnSize">play</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>
                  <PushButton>
                    <ObjectName>PreviewIndicator</ObjectName>
                    <Size>68f,26f</Size>
                    <NumberStates>2</NumberStates>
                    <Connection>
                      <ConfigKey><Variable name="Group"/>,play</ConfigKey>
                    </Connection>
                  </PushButton>
                  <PushButton>
                    <ObjectName>PlayIndicator</ObjectName>
                    <Size>68f,26f</Size>
                    <NumberStates>2</NumberStates>
                    <Connection>
                      <ConfigKey><Variable name="Group"/>,play_indicator</ConfigKey>
                    </Connection>
                  </PushButton>
                </Children>
              </WidgetGroup><!-- Play + PlayBlink + default dark background -->

            </Children>
          </WidgetGroup>

          <WidgetGroup><Size>2f,0min</Size></WidgetGroup><!--  = 2-10px wide -->
          <WidgetGroup><SizePolicy>i,min</SizePolicy><MaximumSize>8,</MaximumSize></WidgetGroup>

          <WidgetGroup><!-- HotCues -->
            <Layout>vertical</Layout>
            <SizePolicy>max,min</SizePolicy>
            <Children>
              <WidgetGroup><!-- HotCues 1-2 / 1-4 -->
                <Layout>horizontal</Layout>
                <Children>

                  <Template src="skin:/controls/button_hotcue.xml">
                    <SetVariable name="number">1</SetVariable>
                  </Template>
                  <Template src="skin:/controls/button_hotcue.xml">
                    <SetVariable name="number">2</SetVariable>
                  </Template>

                  <WidgetGroup>
                    <Layout>horizontal</Layout>
                    <Children>
                      <Template src="skin:/controls/button_hotcue.xml">
                        <SetVariable name="number">3</SetVariable>
                      </Template>
                      <Template src="skin:/controls/button_hotcue.xml">
                        <SetVariable name="number">4</SetVariable>
                      </Template>
                    </Children>
                    <Connection>
                      <ConfigKey>[Skin],show_8_hotcues</ConfigKey>
                      <BindProperty>visible</BindProperty>
                    </Connection>
                  </WidgetGroup>
                </Children>
              </WidgetGroup><!-- HotCues 1-2 / 1-4 -->

              <!-- HotCues (3-4 / 5-8) -->
              <WidgetStack currentpage="[Skin],show_8_hotcues" persist="true">
                <Children>
                  <WidgetGroup>
                    <Layout>horizontal</Layout>
                    <Children>
                      <Template src="skin:/controls/button_hotcue.xml">
                        <SetVariable name="number">3</SetVariable>
                      </Template>
                      <Template src="skin:/controls/button_hotcue.xml">
                        <SetVariable name="number">4</SetVariable>
                      </Template>
                    </Children>
                  </WidgetGroup>

                  <WidgetGroup  trigger="[Skin],show_8_hotcues">
                    <Layout>horizontal</Layout>
                    <Children>
                      <Template src="skin:/controls/button_hotcue.xml">
                        <SetVariable name="number">5</SetVariable>
                      </Template>
                      <Template src="skin:/controls/button_hotcue.xml">
                        <SetVariable name="number">6</SetVariable>
                      </Template>
                      <Template src="skin:/controls/button_hotcue.xml">
                        <SetVariable name="number">7</SetVariable>
                      </Template>
                      <Template src="skin:/controls/button_hotcue.xml">
                        <SetVariable name="number">8</SetVariable>
                      </Template>
                    </Children>
                  </WidgetGroup>
                </Children>
              </WidgetStack><!-- HotCues (3-4 / 5-8) -->
            </Children>
            <Connection>
              <ConfigKey>[Skin],show_hotcues</ConfigKey>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup><!-- HotCues -->

          <WidgetGroup><Size>2f,0min</Size></WidgetGroup><!--  = 2-8px wide -->
          <WidgetGroup><SizePolicy>i,min</SizePolicy><MaximumSize>8,</MaximumSize></WidgetGroup>

          <WidgetGroup><!-- Intro + Outro -->
            <Layout>vertical</Layout>
            <SizePolicy>me,min</SizePolicy>
            <MaximumSize>52,52</MaximumSize>
            <Children>
              <WidgetGroup><!-- Intro -->
                <ObjectName>AlignLeftTop</ObjectName>
                <SizePolicy>me,min</SizePolicy>
                <Layout>horizontal</Layout>
                <Children>
                  <Template src="skin:/controls/button_special_cue.xml">
                    <SetVariable name="CueType">intro_start</SetVariable>
                  </Template>

                  <Template src="skin:/controls/button_special_cue.xml">
                    <SetVariable name="CueType">intro_end</SetVariable>
                  </Template>
                </Children>
              </WidgetGroup>
              <WidgetGroup><!-- Outro -->
                <ObjectName>AlignLeftTop</ObjectName>
                <SizePolicy>me,min</SizePolicy>
                <Layout>horizontal</Layout>
                <Children>
                  <Template src="skin:/controls/button_special_cue.xml">
                    <SetVariable name="CueType">outro_start</SetVariable>
                  </Template>

                  <Template src="skin:/controls/button_special_cue.xml">
                    <SetVariable name="CueType">outro_end</SetVariable>
                  </Template>
                </Children>
              </WidgetGroup>
            </Children>
            <Connection>
              <ConfigKey>[Skin],show_intro_outro_cues</ConfigKey>
              <BindProperty>visible</BindProperty>
            </Connection>
          </WidgetGroup><!-- / Intro + Outro -->

          <WidgetGroup><Size>2f,0min</Size></WidgetGroup><!--  = 2-8px wide -->
          <WidgetGroup><SizePolicy>i,min</SizePolicy><MaximumSize>80,</MaximumSize></WidgetGroup>

          <WidgetGroup><!-- Loop buttons + beatloop size spinbox -->
            <ObjectName>LoopControls</ObjectName>
            <Layout>vertical</Layout>
            <SizePolicy>min,min</SizePolicy>
            <MinimumSize>78,52</MinimumSize>
            <MaximumSize>86,52</MaximumSize>
            <Children>
              <WidgetGroup><!-- loop enable + beatloop size -->
                <ObjectName>AlignLeftTop</ObjectName>
                <Layout>horizontal</Layout>
                <SizePolicy>min,max</SizePolicy>
                <Children>
                  <Template src="skin:/controls/button_2state_right.xml">
                    <SetVariable name="TooltipId">beatloop_activate</SetVariable>
                    <SetVariable name="ObjectName">LoopActivate</SetVariable>
                    <SetVariable name="Size">26f,26f</SetVariable>
                    <SetVariable name="ConfigKey"><Variable name="Group"/>,beatloop_activate</SetVariable>
                    <SetVariable name="ConfigKeyRight"><Variable name="Group"/>,beatlooproll_activate</SetVariable>
                  </Template>

                  <BeatSpinBox>
                    <TooltipId>beatloop_size</TooltipId>
                    <ObjectName>Spinbox_<Variable name="BtnType"/></ObjectName>
                    <SizePolicy>me,min</SizePolicy>
                    <MinimumSize>46,26</MinimumSize>
                    <MaximumSize>72,26</MaximumSize>
                    <Value><Variable name="Group"/>,beatloop_size</Value>
                    <!-- disabled until 'highlight' property has been added to WBeatSpinBox / wbasewidget.
                    <Connection>
                      <ConfigKey><Variable name="Group"/>,track_loaded</ConfigKey>
                      <BindProperty>highlight</BindProperty>
                    </Connection> -->
                  </BeatSpinBox>
                </Children>
              </WidgetGroup>

              <WidgetGroup>
                <ObjectName>AlignLeftTop</ObjectName>
                <Layout>horizontal</Layout>
                <SizePolicy>min,max</SizePolicy>
                <Children>
                  <Template src="skin:/controls/button_2state_right_display.xml">
                    <SetVariable name="TooltipId">reloop_toggle</SetVariable>
                    <SetVariable name="ObjectName">Reloop</SetVariable>
                    <SetVariable name="Size">26f,26f</SetVariable>
                    <SetVariable name="ConfigKey"><Variable name="Group"/>,reloop_toggle</SetVariable>
                    <SetVariable name="ConfigKeyRight"><Variable name="Group"/>,reloop_andstop</SetVariable>
                    <SetVariable name="ConfigKeyDisp"><Variable name="Group"/>,loop_enabled</SetVariable>
                  </Template>

                  <Template src="skin:/controls/button_1state_right.xml">
                    <SetVariable name="TooltipId">loop_in</SetVariable>
                    <SetVariable name="ObjectName">LoopIn</SetVariable>
                    <SetVariable name="Size">26f,26f</SetVariable>
                    <SetVariable name="ConfigKey"><Variable name="Group"/>,loop_in</SetVariable>
                    <SetVariable name="ConfigKeyRight"><Variable name="Group"/>,loop_in_goto</SetVariable>
                  </Template>

                  <Template src="skin:/controls/button_1state_right.xml">
                    <SetVariable name="TooltipId">loop_out</SetVariable>
                    <SetVariable name="ObjectName">LoopOut</SetVariable>
                    <SetVariable name="Size">26f,26f</SetVariable>
                    <SetVariable name="ConfigKey"><Variable name="Group"/>,loop_out</SetVariable>
                    <SetVariable name="ConfigKeyRight"><Variable name="Group"/>,loop_out_goto</SetVariable>
                  </Template>
                </Children>
              </WidgetGroup>
            </Children>
          </WidgetGroup><!-- /Loop buttons + beatloop size spinbox -->

          <WidgetGroup><Size>2f,0min</Size></WidgetGroup><!--  = 2-80px wide -->
          <WidgetGroup><SizePolicy>i,min</SizePolicy><MaximumSize>80,</MaximumSize></WidgetGroup>

          <WidgetGroup><!-- Jump buttons + beatjump size spinbox -->
            <ObjectName>BeatjumpControls</ObjectName>
            <Layout>vertical</Layout>
            <SizePolicy>min,min</SizePolicy>
            <MinimumSize>52,52</MinimumSize>
            <MaximumSize>60,52</MaximumSize>
            <Children>
              <WidgetGroup><!-- beatjump size -->
                <ObjectName>AlignLeftTop</ObjectName>
                <Layout>horizontal</Layout>
                <SizePolicy>0min,26f</SizePolicy>
                <Children>
                  <!-- put this spacer here so BeatSpinBox expands with HiDPI scaling
                  <WidgetGroup><Size>0f,26f</Size></WidgetGroup> -->
                  <BeatSpinBox>
                    <TooltipId>beatjump_size</TooltipId>
                    <ObjectName>Spinbox_<Variable name="BtnType"/></ObjectName>
                    <SizePolicy>me,min</SizePolicy>
                    <MinimumSize>46,26</MinimumSize>
                    <MaximumSize>72,26</MaximumSize>
                    <Value><Variable name="Group"/>,beatjump_size</Value>
                    <!-- disabled until 'highlight' property has been added to WBeatSpinBox / wbasewidget.
                    <Connection>
                      <ConfigKey><Variable name="Group"/>,track_loaded</ConfigKey>
                      <BindProperty>highlight</BindProperty>
                    </Connection> -->
                  </BeatSpinBox>
                </Children>
              </WidgetGroup>
              <WidgetGroup>
                <ObjectName>AlignLeftTop</ObjectName>
                <Layout>horizontal</Layout>
                <SizePolicy>min,max</SizePolicy>
                <Children>

                  <Template src="skin:/controls/button_1state_right.xml">
                    <SetVariable name="TooltipId">beatjump_backward</SetVariable>
                    <SetVariable name="ObjectName">JumpBack</SetVariable>
                    <SetVariable name="Size">26f,26f</SetVariable>
                    <SetVariable name="ConfigKey"><Variable name="Group"/>,beatjump_backward</SetVariable>
                    <SetVariable name="ConfigKeyRight"><Variable name="Group"/>,beatjump_1_backward</SetVariable>
                  </Template>

                  <Template src="skin:/controls/button_1state_right.xml">
                    <SetVariable name="TooltipId">beatjump_forward</SetVariable>
                    <SetVariable name="ObjectName">JumpForward</SetVariable>
                    <SetVariable name="Size">26f,26f</SetVariable>
                    <SetVariable name="ConfigKey"><Variable name="Group"/>,beatjump_forward</SetVariable>
                    <SetVariable name="ConfigKeyRight"><Variable name="Group"/>,beatjump_1_forward</SetVariable>
                  </Template>
                </Children>
              </WidgetGroup>
            </Children>
          </WidgetGroup><!-- /Jump buttons + beatjump size spinbox -->

          <WidgetGroup><Size>2f,0min</Size></WidgetGroup>
          <WidgetGroup><SizePolicy>i,min</SizePolicy></WidgetGroup>
        </Children>
      </WidgetGroup><!-- DeckRow_5_LoopCuesTransport -->
    </Children>
  </WidgetGroup>
</Template>
