<Template>
  <!-- This outer widget group makes the PreviewDeck borders work correctly -->
  <WidgetGroup>
    <Layout>vertical</Layout>
    <SizePolicy>me,max</SizePolicy>
    <Children>

      <WidgetGroup>
        <ObjectName>PreviewDeck</ObjectName>
        <Layout>horizontal</Layout>
        <SizePolicy>min,min</SizePolicy>
        <Children>
          <!-- Preview Deck Column 1 Row 1 -->
          <WidgetGroup>
            <ObjectName>PreviewColumnOne</ObjectName>
            <Layout>vertical</Layout>
            <SizePolicy>min,min</SizePolicy>
            <MinimumSize>,40</MinimumSize>
            <Children>
              <!-- Row 1 -->
              <WidgetGroup>
                <ObjectName>PreviewTitleEject</ObjectName>
                <Layout>horizontal</Layout>
                <SizePolicy>min,min</SizePolicy>
                <Children>
                  <Label>
                    <ObjectName>PreviewLabel</ObjectName>
                    <TooltipId>text</TooltipId>
                    <SizePolicy>min,min</SizePolicy>
                    <Text>Preview</Text>
                    <Connection>
                      <ConfigKey>[PreviewDeck1],track_loaded</ConfigKey>
                      <Transform><Not/></Transform>
                      <BindProperty>visible</BindProperty>
                    </Connection>
                  </Label>

                  <WidgetGroup>
                    <ObjectName>PreviewDeckTextRow</ObjectName>
                    <Layout>horizontal</Layout>
                    <SizePolicy>i,min</SizePolicy>
                    <Children>
                      <Text>
                        <TooltipId>text</TooltipId>
                        <SizePolicy>me,min</SizePolicy>
                        <ObjectName>PreviewTitle</ObjectName>
                        <Group>[PreviewDeck1]</Group>
                        <Elide>right</Elide>
                      </Text>
                      <Number>
                        <TooltipId>visual_bpm</TooltipId>
                        <Group>[PreviewDeck1]</Group>
                        <!--CSS alignments not respected see bug lp:605530 , lets call <Alignment>-->
                        <Alignment>left</Alignment>
                        <Connection>
                          <ConfigKey>[PreviewDeck1],visual_bpm</ConfigKey>
                        </Connection>
			<Connection>
			  <ConfigKey>[PreviewDeck1],track_loaded</ConfigKey>
			  <BindProperty>visible</BindProperty>
			</Connection>
                      </Number>
                    </Children>
                  </WidgetGroup>
                  <WidgetGroup>
                    <ObjectName>AlignRightCenter</ObjectName>
                    <Layout>horizontal</Layout>
                    <SizePolicy>min,min</SizePolicy>
                    <Children>
                      <PushButton>
                        <TooltipId>eject</TooltipId>
                        <NumberStates>1</NumberStates>
                        <State>
                          <Number>0</Number>
                          <Pressed>buttons/btn_eject_over.svg</Pressed>
                          <Unpressed>buttons/btn_eject.svg</Unpressed>
                        </State>
                        <Connection>
                          <ConfigKey>[PreviewDeck1],eject</ConfigKey>
                          <ButtonState>LeftButton</ButtonState>
                        </Connection>
                      </PushButton>
                    </Children>
                  </WidgetGroup>
                </Children>
              </WidgetGroup>

              <!-- Row 2 -->
              <WidgetGroup>
                <ObjectName>PreviewPlayOverview</ObjectName>
                <Layout>horizontal</Layout>
                <SizePolicy>me,me</SizePolicy>
                <Children>
                  <WidgetGroup>
                    <ObjectName>PreviewPlay</ObjectName>
                    <Layout>horizontal</Layout>
                    <SizePolicy>min,min</SizePolicy>
                    <Children>
                      <PushButton>
                        <TooltipId>play_start</TooltipId>
                        <NumberStates>2</NumberStates>
                        <State>
                          <Number>0</Number>
                          <Pressed>buttons/btn_play_preview_down.svg</Pressed>
                          <Unpressed>buttons/btn_play_preview.svg</Unpressed>
                        </State>
                        <State>
                          <Number>1</Number>
                          <Pressed>buttons/btn_play_preview_overdown.svg</Pressed>
                          <Unpressed>buttons/btn_play_preview_over.svg</Unpressed>
                        </State>
                        <Connection>
                          <ConfigKey>[PreviewDeck1],play</ConfigKey>
                          <ButtonState>LeftButton</ButtonState>
                        </Connection>
                        <Connection>
                          <ConfigKey>[PreviewDeck1],start</ConfigKey>
                          <ButtonState>RightButton</ButtonState>
                        </Connection>
                      </PushButton>
                    </Children>
                  </WidgetGroup>

                  <Overview>
                    <TooltipId>waveform_overview</TooltipId>
                    <Size>0me,20me</Size>
                    <Group>[PreviewDeck1]</Group>
                    <BgColor></BgColor>
                    <BgColor>#FFFFFF</BgColor>
                    <SignalColor>#FF8000</SignalColor>
                    <SignalHighColor>#F0EBD1</SignalHighColor>
                    <SignalMidColor>#EECE33</SignalMidColor>
                    <SignalLowColor>#E4C739</SignalLowColor>
                    <PlayPosColor>#00FF00</PlayPosColor>
                    <PlayedOverlayColor><Variable name="PlayedOverlayColor"/></PlayedOverlayColor>
                    <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>[PreviewDeck1],playposition</ConfigKey>
                    </Connection>
                  </Overview>
                </Children>
              </WidgetGroup>
            </Children>
          </WidgetGroup>

          <!-- Preview Deck Column 2 -->
          <WidgetGroup>
            <Layout>horizontal</Layout>
            <Children>
              <WidgetGroup>
                <Layout>vertical</Layout>
                <SizePolicy>min,min</SizePolicy>
                <Children>
                  <StatusLight>
                    <TooltipId>preview_PeakIndicator</TooltipId>
                    <PathStatusLight>style/clipping_previewdeck_over.png</PathStatusLight>
                    <PathBack>style/clipping_previewdeck.png</PathBack>
                    <Connection>
                      <ConfigKey>[PreviewDeck1],PeakIndicator</ConfigKey>
                    </Connection>
                  </StatusLight>

                  <VuMeter>
                    <TooltipId>preview_VuMeter</TooltipId>
                    <PathVu>style/volume_display_previewdeck_over.png</PathVu>
                    <PathBack>style/volume_display_previewdeck.png</PathBack>
                    <Horizontal>false</Horizontal>
                    <PeakHoldSize>3</PeakHoldSize>
                    <PeakHoldTime>250</PeakHoldTime>
                    <PeakFallTime>50</PeakFallTime>
                    <PeakFallStep>3</PeakFallStep>
                    <Connection>
                      <ConfigKey>[PreviewDeck1],VuMeter</ConfigKey>
                    </Connection>
                  </VuMeter>
                </Children>
              </WidgetGroup>

              <SliderComposed>
                <TooltipId>pregain</TooltipId>
                <Handle scalemode="STRETCH_ASPECT">knob_volume_previewdeck.svg</Handle>
                <Slider>slider_volume_previewdeck.svg</Slider>
                <Horizontal>false</Horizontal>
                <Connection>
                  <ConfigKey>[PreviewDeck1],pregain</ConfigKey>
                </Connection>
              </SliderComposed>
            </Children>
          </WidgetGroup>
        </Children>
      </WidgetGroup>

    </Children>
    <Connection>
      <ConfigKey>[PreviewDeck],show_previewdeck</ConfigKey>
      <BindProperty>visible</BindProperty>
    </Connection>
  </WidgetGroup>
</Template>
