<!--
Description:
  The Preview deck with
  * title
  * overview
  * Play/Cue button
  * HotCue buttons (if enabled, else row is hidden to save space)
  * Gain knob
  * Eject button
Variables:
  PlayedOverlayColor  : defined in skin.xml
-->
<Template>
  <SetVariable name="group">[PreviewDeck1]</SetVariable>
  <WidgetGroup>
    <Layout>stacked</Layout>
    <SizePolicy>me,max</SizePolicy>
    <Children>
      <!-- Greyed out if no headphone device is configured -->
      <WidgetGroup>
        <ObjectName>GuiCover</ObjectName>
        <Layout>vertical</Layout>
        <SizePolicy>min,min</SizePolicy>
        <Children>
          <WidgetGroup><Size>0f,19f</Size></WidgetGroup>
          <Label>
            <ObjectName>UnconfiguredHeadphonePrevDeck</ObjectName>
            <SizePolicy>me,min</SizePolicy>
            <Text>No Headphone</Text>
          </Label>
          <Label>
            <ObjectName>UnconfiguredHeadphonePrevDeck</ObjectName>
            <SizePolicy>me,min</SizePolicy>
            <Text>device configured</Text>
          </Label>
          <WidgetGroup><Size>0f,0me</Size></WidgetGroup>
        </Children>
        <Connection>
          <ConfigKey>[Master],headEnabled</ConfigKey>
          <BindProperty>visible</BindProperty>
          <Transform><Not/></Transform>
        </Connection>
      </WidgetGroup>

      <WidgetGroup>
        <ObjectName>PreviewDeck</ObjectName>
        <Layout>vertical</Layout>
        <SizePolicy>me,min</SizePolicy>
        <Children>
          <WidgetGroup>
            <ObjectName>PreviewTitleEject</ObjectName>
            <Layout>horizontal</Layout>
            <Size>1me,19f</Size>
            <Children>
              <WidgetGroup>
                <Layout>horizontal</Layout>
                <Size>1me,18f</Size>
                <ObjectName>PreviewTitle</ObjectName>
                <Children>
                  <TrackProperty>
                    <TooltipId>text</TooltipId>
                    <Size>1me,17f</Size>
                    <Group><Variable name="group"/></Group>
                    <Property>info</Property>
                    <Elide>right</Elide>
                  </TrackProperty>
                </Children>
              </WidgetGroup>

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

              <Template src="skins:Tango/controls/button_1state.xml">
                <SetVariable name="TooltipId">eject</SetVariable>
                <SetVariable name="ObjectName">PreviewEject</SetVariable>
                <SetVariable name="Size">18f,18f</SetVariable>
                <SetVariable name="state_0_pressed">eject_pressed.svg</SetVariable>
                <SetVariable name="state_0_unpressed">eject.svg</SetVariable>
                <SetVariable name="ConfigKey"><Variable name="group"/>,eject</SetVariable>
              </Template>
            </Children>
          </WidgetGroup>

          <WidgetGroup><!-- Play-Overview-Gain -->
            <ObjectName>PreviewPlayOverview</ObjectName>
            <Layout>horizontal</Layout>
            <Size>80me,34f</Size>
            <Children>
              <WidgetGroup>
                <ObjectName>PreviewPlay</ObjectName>
                <Layout>stacked</Layout>
                <Size>25f,34f</Size>
                <Children>
                  <Template src="skins:Tango/controls/button_2state_right_display.xml">
                    <SetVariable name="ObjectName">PlayCue</SetVariable>
                    <SetVariable name="TooltipId">play_start</SetVariable>
                    <SetVariable name="Size">24f,34f</SetVariable>
                    <SetVariable name="state_0_icon">play_previewdeck.svg</SetVariable>
                    <SetVariable name="state_1_icon">pause_previewdeck.svg</SetVariable>
                    <SetVariable name="ConfigKey"><Variable name="group"/>,play</SetVariable>
                    <SetVariable name="ConfigKeyRight"><Variable name="group"/>,start</SetVariable>
                    <SetVariable name="ConfigKeyDisp"><Variable name="group"/>,play_indicator</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">24f,34f</SetVariable>
                    <SetVariable name="ConfigKey"><Variable name="group"/>,play</SetVariable>
                  </Template>
                </Children>
              </WidgetGroup>

              <Overview>
                <TooltipId>waveform_overview</TooltipId>
                <Size>1me,34f</Size>
                <Group><Variable name="group"/></Group>
                <BgColor>#151515</BgColor>
                <SignalColor>#bababa</SignalColor>
                <PlayPosColor>#FF4300</PlayPosColor>
                <PlayedOverlayColor><Variable name="PlayedOverlayColor"/></PlayedOverlayColor>
                <MarkerColor>#00FF00</MarkerColor>
                <LabelTextColor>#ffffff</LabelTextColor>
                <LabelBackgroundColor>#85000000</LabelBackgroundColor>
                <ShowCueTimes>false</ShowCueTimes>
                <DefaultMark>
                  <Align>bottom|right</Align>
                  <Color>#666666</Color>
                  <TextColor>#FFFFFF</TextColor>
                  <Text> %1 </Text>
                </DefaultMark>
                <Mark>
                  <Control>cue_point</Control>
                  <Text>Q</Text>
                  <Align>top|right</Align>
                  <Color>#FF0080</Color>
                  <TextColor>#FFFFFF</TextColor>
                </Mark>
                <Connection>
                  <ConfigKey><Variable name="group"/>,playposition</ConfigKey>
                </Connection>
              </Overview>

              <Template src="skins:Tango/mixer/vumeter_mini.xml">
                <SetVariable name="Size">5f,1me</SetVariable>
                <SetVariable name="sourceType">preview</SetVariable>
              </Template>

              <WidgetGroup>
                <ObjectName>PreviewGainKnob</ObjectName>
                <Layout>vertical</Layout>
                <Children>
                  <KnobComposed>
                    <TooltipId>pregain</TooltipId>
                    <Size>24f,20f</Size>
                    <Knob>skins:Tango/knobs_sliders/knob_tiny_red.svg</Knob>
                    <BackPath>skins:Tango/knobs_sliders/knob_bg.svg</BackPath>
                    <MinAngle><Variable name="PotiMinAngle"/></MinAngle>
                    <MaxAngle><Variable name="PotiMaxAngle"/></MaxAngle>
                    <Connection>
                      <ConfigKey><Variable name="group"/>,pregain</ConfigKey>
                    </Connection>
                  </KnobComposed>
                </Children>
              </WidgetGroup>

            </Children>
          </WidgetGroup><!-- /Play-Overview-Gain -->

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

        </Children>
      </WidgetGroup>
    </Children>
    <Connection>
      <ConfigKey persist="true">[Skin],show_preview_decks</ConfigKey>
      <BindProperty>visible</BindProperty>
    </Connection>
  </WidgetGroup>
</Template>
