<Template>
  <SetVariable name="group">[Sampler<Variable name="samplernum"/>]</SetVariable>
  <WidgetGroup>
    <ObjectName>SamplerDeck</ObjectName>
    <Layout>horizontal</Layout>
    <SizePolicy>me,min</SizePolicy>
    <Children>
      <!-- SamplerMainControls -->
      <WidgetGroup>
        <ObjectName>SamplerMainControls</ObjectName>
        <Layout>vertical</Layout>
        <SizePolicy>me,min</SizePolicy>
        <Children>
          <WidgetGroup>
            <ObjectName>SamplerText</ObjectName>
            <Layout>horizontal</Layout>
            <SizePolicy>i,min</SizePolicy>
            <Children>
              <TrackProperty>
                <TooltipId>track_title</TooltipId>
                <ObjectName>SamplerTitle</ObjectName>
                <SizePolicy>me,min</SizePolicy>
                <Property>title</Property>
                <Group><Variable name="group"/></Group>
                <Elide>right</Elide>
              </TrackProperty>

              <Number>
                <TooltipId>visual_bpm</TooltipId>
                <Group>[Sampler<Variable name="samplernum"/>]</Group>
                <!--CSS alignments not respected see bug lp:605530 , lets call <Alignment>-->
                <Alignment>left</Alignment>
                <Connection>
                  <ConfigKey>[Sampler<Variable name="samplernum"/>],visual_bpm</ConfigKey>
                </Connection>
                <Connection>
                  <ConfigKey>[Sampler<Variable name="samplernum"/>],track_loaded</ConfigKey>
                  <BindProperty>visible</BindProperty>
                </Connection>
              </Number>

            </Children>
          </WidgetGroup>

          <!-- Second Row: Play, Overview, Controls, Gain -->
          <WidgetGroup>
            <ObjectName>SamplerRowTwo</ObjectName>
            <Layout>horizontal</Layout>
            <SizePolicy>me,me</SizePolicy>
            <Children>
              <WidgetGroup>
                <ObjectName>SamplerPlay</ObjectName>
                <Layout>horizontal</Layout>
                <SizePolicy>min,min</SizePolicy>
                <Children>
                  <Template src="skin:button_2state_right_display.xml">
                    <SetVariable name="TooltipId">cue_gotoandplay_cue_default</SetVariable>
                    <SetVariable name="Size">34f,34f</SetVariable>
                    <SetVariable name="state_0_pressed">play_sampler_down.svg</SetVariable>
                    <SetVariable name="state_0_unpressed">play_sampler.svg</SetVariable>
                    <SetVariable name="state_1_pressed">play_sampler_overdown.svg</SetVariable>
                    <SetVariable name="state_1_unpressed">play_sampler_over.svg</SetVariable>
                    <SetVariable name="ConfigKey"><Variable name="group"/>,cue_gotoandplay</SetVariable>
                    <SetVariable name="ConfigKeyRight"><Variable name="group"/>,cue_default</SetVariable>
                    <SetVariable name="ConfigKeyDisp"><Variable name="group"/>,play_indicator</SetVariable>
                  </Template>
                </Children>
              </WidgetGroup>

              <Overview>
                <TooltipId>waveform_overview</TooltipId>
                <SizePolicy>me,min</SizePolicy>
                <Group><Variable name="group"/></Group>
                <BgColor></BgColor>
                <SignalHighColor></SignalHighColor>
                <SignalMidColor></SignalMidColor>
                <SignalLowColor></SignalLowColor>
                <PlayedOverlayColor><Variable name="PlayedOverlayColor"/></PlayedOverlayColor>
                <SignalColor>#EECE33</SignalColor>
                <MarkerColor>#00FF00</MarkerColor>
                <DefaultMark>
                  <Align>bottom|right</Align>
                  <Color>#00FF00</Color>
                  <TextColor>#FFFFFF</TextColor>
                  <Text> %1 </Text>
                </DefaultMark>
                <Mark>
                  <Control>cue_point</Control>
                  <Text> C </Text>
                  <Align>top|right</Align>
                  <Color>#FF001C</Color>
                  <TextColor>#FFFFFF</TextColor>
                </Mark>
                <Connection>
                  <ConfigKey><Variable name="group"/>,playposition</ConfigKey>
                </Connection>
              </Overview>

              <!-- Sampler controls -->
              <WidgetGroup>
                <ObjectName>SamplerButtonGrid</ObjectName>
                <Layout>vertical</Layout>
                <SizePolicy>max,min</SizePolicy>
                <Children>
                  <WidgetGroup>
                    <Layout>horizontal</Layout>
                    <SizePolicy>min,min</SizePolicy>
                    <Children>
                      <Template src="skin:button_2state_nohover.xml">
                        <SetVariable name="TooltipId">repeat</SetVariable>
                        <SetVariable name="icon">repeat</SetVariable>
                        <SetVariable name="ConfigKey"><Variable name="group"/>,repeat</SetVariable>
                        <SetVariable name="Size">25,18</SetVariable>
                      </Template>
                      <Template src="skin:button_2state_nohover.xml">
                        <SetVariable name="TooltipId">eject</SetVariable>
                        <SetVariable name="icon">eject</SetVariable>
                        <SetVariable name="ConfigKey"><Variable name="group"/>,eject</SetVariable>
                        <SetVariable name="Size">25,18</SetVariable>
                      </Template>
                    </Children>
                  </WidgetGroup>

                  <WidgetGroup>
                    <Layout>horizontal</Layout>
                    <SizePolicy>min,min</SizePolicy>
                    <Children>
                      <PushButton>
                        <TooltipId>orientation</TooltipId>
                        <NumberStates>3</NumberStates>
                        <State>
                          <Number>0</Number>
                          <Pressed scalemode="STRETCH_ASPECT">buttons/btn_orientation_sampler_left.svg</Pressed>
                          <Unpressed>buttons/btn_orientation_sampler_left.svg</Unpressed>
                        </State>
                        <State>
                          <Number>1</Number>
                          <Pressed scalemode="STRETCH_ASPECT">buttons/btn_orientation_sampler_master.svg</Pressed>
                          <Unpressed>buttons/btn_orientation_sampler_master.svg</Unpressed>
                        </State>
                        <State>
                          <Number>2</Number>
                          <Pressed scalemode="STRETCH_ASPECT">buttons/btn_orientation_sampler_right.svg</Pressed>
                          <Unpressed>buttons/btn_orientation_sampler_right.svg</Unpressed>
                        </State>
                        <Connection>
                          <ConfigKey><Variable name="group"/>,orientation</ConfigKey>
                          <ButtonState>LeftButton</ButtonState>
                        </Connection>
                      </PushButton>
                      <Template src="skin:button_2state_nohover.xml">
                        <SetVariable name="TooltipId">keylock</SetVariable>
                        <SetVariable name="icon">keylock</SetVariable>
                        <SetVariable name="ConfigKey"><Variable name="group"/>,keylock</SetVariable>
                        <SetVariable name="Size">25,18</SetVariable>
                      </Template>
                    </Children>
                  </WidgetGroup>
                </Children>
              </WidgetGroup><!-- /Sampler controls -->

              <WidgetGroup>
                <ObjectName>SamplerGain</ObjectName>
                <Layout>horizontal</Layout>
                <SizePolicy>min,min</SizePolicy>
                <Children>
                  <Template src="skin:knob_textless.xml">
                    <SetVariable name="TooltipId">pregain</SetVariable>
                    <SetVariable name="Size">35f,30f</SetVariable>
                    <SetVariable name="group"><Variable name="group"/></SetVariable>
                    <SetVariable name="control">pregain</SetVariable>
                  </Template>
                </Children>
              </WidgetGroup>

            </Children>
          </WidgetGroup><!-- Second Row: Play, Overview, Controls, Gain -->

          <!-- Third Row: SamplerButtons -->
          <WidgetGroup>
            <ObjectName>SamplerButtons</ObjectName>
            <BackPath>style/background_tile.png</BackPath>
            <Layout>horizontal</Layout>
            <SizePolicy>me,min</SizePolicy>
            <Children>

              <WidgetGroup>
                <ObjectName>SamplerHotcues</ObjectName>
                <Layout>horizontal</Layout>
                <SizePolicy>min,min</SizePolicy>
                <Children>
                  <Template src="skin:button_hotcue.xml">
                    <SetVariable name="number">1</SetVariable>
                  </Template>

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

                  <Template src="skin:button_hotcue.xml">
                    <SetVariable name="number">3</SetVariable>
                  </Template>

                  <Template src="skin:button_hotcue.xml">
                    <SetVariable name="number">4</SetVariable>
                  </Template>

                  <WidgetGroup><!-- /Hotcues 5-8 -->
                    <Layout>horizontal</Layout>
                    <SizePolicy>min,min</SizePolicy>
                    <Children>
                      <Template src="skin:button_hotcue.xml">
                        <SetVariable name="number">5</SetVariable>
                      </Template>

                      <Template src="skin:button_hotcue.xml">
                        <SetVariable name="number">6</SetVariable>
                      </Template>

                      <Template src="skin:button_hotcue.xml">
                        <SetVariable name="number">7</SetVariable>
                      </Template>

                      <Template src="skin:button_hotcue.xml">
                        <SetVariable name="number">8</SetVariable>
                      </Template>
                    </Children>
                    <Connection>
                      <ConfigKey persist="true">[Skin],8_hotcues</ConfigKey>
                      <BindProperty>visible</BindProperty>
                    </Connection>
                  </WidgetGroup><!-- /Hotcues 5-8 -->
                </Children>
              </WidgetGroup>

              <WidgetGroup>
                <SizePolicy>me,min</SizePolicy>
              </WidgetGroup>

              <WidgetGroup>
                <ObjectName>SamplerPfl</ObjectName>
                <Layout>horizontal</Layout>
                <SizePolicy>min,min</SizePolicy>
                <Children>
                  <Template src="skin:button_2state.xml">
                    <SetVariable name="TooltipId">pfl</SetVariable>
                    <SetVariable name="icon">pfl</SetVariable>
                    <SetVariable name="ConfigKey"><Variable name="group"/>,pfl</SetVariable>
                    <SetVariable name="Size">26,26</SetVariable>
                  </Template>
                </Children>
              </WidgetGroup><!-- /SamplerPfl -->

              <!-- fixed spacer since right border won't show up
                  if BackPath is defined in xml -->
              <WidgetGroup>
                <ObjectName>Spacer58</ObjectName>
                <Size>1f,1me</Size>
              </WidgetGroup>

            </Children>
          </WidgetGroup><!-- /SamplerButtons -->
        </Children>
      </WidgetGroup><!-- /SamplerMainControls -->

      <!-- VU Meter -->
      <WidgetGroup>
        <ObjectName>SamplerVU</ObjectName>
        <Layout>vertical</Layout>
        <SizePolicy>f,min</SizePolicy>
        <Children>
          <StatusLight>
            <TooltipId>sampler_PeakIndicator</TooltipId>
            <PathStatusLight>style/clipping_deck_over.png</PathStatusLight>
            <PathBack>style/clipping_deck.png</PathBack>
            <Connection>
              <ConfigKey><Variable name="group"/>,PeakIndicator</ConfigKey>
            </Connection>
          </StatusLight>
          <VuMeter>
            <TooltipId>sampler_VuMeter</TooltipId>
            <PathVu>style/volume_display_sampler_over.png</PathVu>
            <PathBack>style/volume_display_sampler.png</PathBack>
            <Horizontal>false</Horizontal>
            <PeakHoldSize>5</PeakHoldSize>
            <PeakHoldTime>500</PeakHoldTime>
            <PeakFallTime>50</PeakFallTime>
            <PeakFallStep>2</PeakFallStep>
            <Connection>
              <ConfigKey><Variable name="group"/>,VuMeter</ConfigKey>
            </Connection>
          </VuMeter>
        </Children>
      </WidgetGroup><!-- /VU Meter -->

      <!-- Pitch Control -->
      <WidgetGroup>
        <Layout>vertical</Layout>
        <SizePolicy>min,min</SizePolicy>
        <Children>
          <WidgetGroup>
            <ObjectName>SamplerPitch</ObjectName>
            <Layout>horizontal</Layout>
            <SizePolicy>min,min</SizePolicy>
            <Children>
              <SliderComposed>
                <TooltipId>rate</TooltipId>
                <Handle scalemode="STRETCH_ASPECT">knob_pitch_sampler.svg</Handle>
                <Slider>slider_pitch_sampler.svg</Slider>
                <Horizontal>false</Horizontal>
                <Connection>
                  <ConfigKey><Variable name="group"/>,rate</ConfigKey>
                </Connection>
              </SliderComposed>
            </Children>
          </WidgetGroup>

          <WidgetGroup>
            <ObjectName>SamplerSyncButton</ObjectName>
            <Layout>horizontal</Layout>
            <SizePolicy>min,min</SizePolicy>
            <Children>
              <Template src="skin:button_1state_right.xml">
                <SetVariable name="TooltipId">beatsync_beatsync_tempo</SetVariable>
                <SetVariable name="Size">28f,26f</SetVariable>
                <SetVariable name="state_0_pressed">sync_sampler_overdown.svg</SetVariable>
                <SetVariable name="state_0_unpressed">sync_sampler.svg</SetVariable>
                <SetVariable name="ConfigKey"><Variable name="group"/>,beatsync</SetVariable>
                <SetVariable name="ConfigKeyRight"><Variable name="group"/>,beatsync_tempo</SetVariable>
              </Template>
            </Children>
          </WidgetGroup>
        </Children>
      </WidgetGroup>

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