<Template>
  <SetVariable name="Group">[Channel<Variable name="ChanNum"/>]</SetVariable>
  <SetVariable name="BtnType">embedded</SetVariable>
  <SetVariable name="BtnSize">library</SetVariable>

  <WidgetGroup>
    <ObjectName>Waveform</ObjectName>
    <Layout>horizontal</Layout>
    <SizePolicy>me,me</SizePolicy>
    <Children>
      <WidgetGroup>
        <ObjectName>WaveformBox<Variable name="ChanNum"/></ObjectName>
        <Layout>horizontal</Layout>
        <SizePolicy>me,me</SizePolicy>
        <Children>
          <Visual>
            <TooltipId>waveform_display</TooltipId>
            <Channel><Variable name="ChanNum"/></Channel>
            <BgColor><Variable name="BgColorWaveform"/></BgColor>
            <SignalColor><Variable name="SignalColor"/></SignalColor>
            <SignalHighColor><Variable name="SignalHighColor"/></SignalHighColor>
            <SignalMidColor><Variable name="SignalMidColor"/></SignalMidColor>
            <SignalLowColor><Variable name="SignalLowColor"/></SignalLowColor>
            <SignalRGBHighColor><Variable name="SignalHighColor"/></SignalRGBHighColor>
            <SignalRGBMidColor><Variable name="SignalMidColor"/></SignalRGBMidColor>
            <SignalRGBLowColor><Variable name="SignalLowColor"/></SignalRGBLowColor>
            <BeatColor><Variable name="BeatColor"/></BeatColor>
            <AxesColor><Variable name="AxesColor"/></AxesColor>
            <BeatHighlightColor></BeatHighlightColor>
            <PlayPosColor><Variable name="PlayPosColor"/></PlayPosColor>
            <EndOfTrackColor><Variable name="EndOfTrackColor"/></EndOfTrackColor>
            <DimBrightThreshold><Variable name="DimBrightThresholdWaveform"/></DimBrightThreshold>
            <!--
            The hotcues not represented by a button in the current skin show only in the waveform under two circumstances:
              - if a MIDI device which supports more hotcues than buttons are in the current skin has them activated
              - if you change from a skin which supports more hotcues than buttons are in the current skin (and has them activated)
            -->
            <DefaultMark>
              <Align>bottom|right</Align>
              <Color>#FF0000</Color>
              <TextColor>#FFFFFF</TextColor>
              <Text> %1 </Text>
            </DefaultMark>
            <!-- Cue -->
            <Mark>
              <Control>cue_point</Control>
              <Text>CUE</Text>
              <Align>top|right</Align>
              <Color><Variable name="CueColor"/></Color>
              <TextColor>#FFFFFF</TextColor>
            </Mark>
            <!-- Loop -->
            <MarkRange>
              <StartControl>loop_start_position</StartControl>
              <EndControl>loop_end_position</EndControl>
              <EnabledControl>loop_enabled</EnabledControl>
              <Color><Variable name="LoopColor"/></Color>
              <Opacity>0.8</Opacity>
              <DisabledColor>#FFFFFF</DisabledColor>
              <DisabledOpacity>0.5</DisabledOpacity>
            </MarkRange>
            <Mark>
              <Control>loop_start_position</Control>
              <Text>&#8635;</Text>
              <Align>top|left</Align>
              <Color><Variable name="LoopColor"/></Color>
              <TextColor>#FFFFFF</TextColor>
            </Mark>
            <Mark>
              <Control>loop_end_position</Control>
              <!-- <Text>&#8635;</Text> -->
              <Align>top|right</Align>
              <Color><Variable name="LoopColor"/></Color>
              <TextColor>#FFFFFF</TextColor>
            </Mark>
            <!-- Intro -->
            <MarkRange>
              <StartControl>intro_start_position</StartControl>
              <EndControl>intro_end_position</EndControl>
              <VisibilityControl>[Skin],show_intro_outro_cues</VisibilityControl>
              <Color><Variable name="IntroOutroColor"/></Color>
              <Opacity>0.1</Opacity>
              <DurationTextColor>#ffffff</DurationTextColor>
              <DurationTextLocation>after</DurationTextLocation>
            </MarkRange>
            <Mark>
              <Control>intro_start_position</Control>
              <Text>&#9698;</Text>
              <VisibilityControl>[Skin],show_intro_outro_cues</VisibilityControl>
              <Align>top|right</Align>
              <Color><Variable name="IntroOutroColor"/></Color>
              <TextColor>#FFFFFF</TextColor>
            </Mark>
            <Mark>
              <Control>intro_end_position</Control>
              <VisibilityControl>[Skin],show_intro_outro_cues</VisibilityControl>
              <Text>&#9698;</Text>
              <Align>top|left</Align>
              <Color><Variable name="IntroOutroColor"/></Color>
              <TextColor>#FFFFFF</TextColor>
            </Mark>
            <!-- Outro -->
            <MarkRange>
              <StartControl>outro_start_position</StartControl>
              <EndControl>outro_end_position</EndControl>
              <VisibilityControl>[Skin],show_intro_outro_cues</VisibilityControl>
              <Color><Variable name="IntroOutroColor"/></Color>
              <Opacity>0.1</Opacity>
              <DurationTextColor>#ffffff</DurationTextColor>
              <DurationTextLocation>before</DurationTextLocation>
            </MarkRange>
            <Mark>
              <Control>outro_start_position</Control>
              <VisibilityControl>[Skin],show_intro_outro_cues</VisibilityControl>
              <Text>&#9699;</Text>
              <Align>top|right</Align>
              <Color><Variable name="IntroOutroColor"/></Color>
              <TextColor>#FFFFFF</TextColor>
            </Mark>
            <Mark>
              <Control>outro_end_position</Control>
              <Text>&#9699;</Text>
              <VisibilityControl>[Skin],show_intro_outro_cues</VisibilityControl>
              <Align>top|left</Align>
              <Color><Variable name="IntroOutroColor"/></Color>
              <TextColor>#FFFFFF</TextColor>
            </Mark>
          </Visual>
        </Children>
        <Connection>
          <ConfigKey persist="true"><Variable name="Highlight"/></ConfigKey>
          <BindProperty>highlight</BindProperty>
        </Connection>
      </WidgetGroup>

      <WidgetGroup>
        <ObjectName>BeatgridControls</ObjectName>
        <Layout>vertical</Layout>
        <SizePolicy>max,me</SizePolicy>
        <Children>
          <WidgetGroup><Size>0me,1me</Size></WidgetGroup>

          <WidgetGroup><!-- beat grid & hotcue shift buttons row -->
            <Layout>horizontal</Layout>
            <SizePolicy>f,f</SizePolicy>
            <Children>

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

              <!-- CurPos -->
              <Template src="skin:/controls/button_1state_right.xml">
                <SetVariable name="TooltipId">beats_translate_curpos</SetVariable>
                <SetVariable name="ObjectName">BeatCurposLarge</SetVariable>
                <SetVariable name="Size">26f,52f</SetVariable>
                <SetVariable name="BtnSize">library_tall</SetVariable>
                <SetVariable name="ConfigKey"><Variable name="Group"/>,beats_translate_curpos</SetVariable>
                <SetVariable name="ConfigKeyRight"><Variable name="Group"/>,beats_translate_match_alignment</SetVariable>
              </Template>

              <WidgetGroup><!-- beats earlier & faster -->
                <Layout>vertical</Layout>
                <Size>26f,52f</Size>
                <Children>
                  <Template src="skin:/controls/button_1state.xml">
                    <SetVariable name="TooltipId">beats_translate_earlier</SetVariable>
                    <SetVariable name="ObjectName">BeatsEarlier</SetVariable>
                    <SetVariable name="Size">26f,26f</SetVariable>
                    <SetVariable name="ConfigKey"><Variable name="Group"/>,beats_translate_earlier</SetVariable>
                  </Template>
                  <Template src="skin:/controls/button_1state.xml">
                    <SetVariable name="TooltipId">beats_adjust_faster</SetVariable>
                    <SetVariable name="ObjectName">BeatsFaster</SetVariable>
                    <SetVariable name="Size">26f,26f</SetVariable>
                    <SetVariable name="ConfigKey"><Variable name="Group"/>,beats_adjust_faster</SetVariable>
                  </Template>
                </Children>
              </WidgetGroup><!-- /beats earlier & faster -->

              <WidgetGroup><!-- beats later & slower -->
                <Layout>vertical</Layout>
                <Size>26f,52f</Size>
                <Children>
                  <Template src="skin:/controls/button_1state.xml">
                    <SetVariable name="TooltipId">beats_translate_later</SetVariable>
                    <SetVariable name="ObjectName">BeatsLater</SetVariable>
                    <SetVariable name="Size">26f,26f</SetVariable>
                    <SetVariable name="BtnSize">grid</SetVariable>
                    <SetVariable name="ConfigKey"><Variable name="Group"/>,beats_translate_later</SetVariable>
                  </Template>
                  <Template src="skin:/controls/button_1state.xml">
                    <SetVariable name="TooltipId">beats_adjust_slower</SetVariable>
                    <SetVariable name="ObjectName">BeatsSlower</SetVariable>
                    <SetVariable name="Icon">beats_slower</SetVariable>
                    <SetVariable name="Size">26f,26f</SetVariable>
                    <SetVariable name="BtnSize">grid</SetVariable>
                    <SetVariable name="ConfigKey"><Variable name="Group"/>,beats_adjust_slower</SetVariable>
                  </Template>
                </Children>
              </WidgetGroup><!-- /beats later & slower -->

              <WidgetGroup><!-- Hotcue shift -->
                <Layout>vertical</Layout>
                  <Size>26f,52f</Size>
                  <Children>
                    <Template src="skin:/controls/button_1state_right.xml">
                      <SetVariable name="TooltipId">shift_cues_earlier</SetVariable>
                      <SetVariable name="ObjectName">HotcuesEarlier</SetVariable>
                      <SetVariable name="Size">26f,26f</SetVariable>
                      <SetVariable name="ConfigKey"><Variable name="Group"/>,shift_cues_earlier</SetVariable>
                      <SetVariable name="ConfigKeyRight"><Variable name="Group"/>,shift_cues_earlier_small</SetVariable>
                    </Template>
                    <Template src="skin:/controls/button_1state_right.xml">
                      <SetVariable name="TooltipId">shift_cues_later</SetVariable>
                      <SetVariable name="ObjectName">HotcuesLater</SetVariable>
                      <SetVariable name="Size">26f,26f</SetVariable>
                      <SetVariable name="ConfigKey"><Variable name="Group"/>,shift_cues_later</SetVariable>
                      <SetVariable name="ConfigKeyRight"><Variable name="Group"/>,shift_cues_later_small</SetVariable>
                    </Template>
                  </Children>
                <Connection>
                  <ConfigKey persist="true">[Skin],timing_shift_buttons</ConfigKey>
                  <BindProperty>visible</BindProperty>
                </Connection>
              </WidgetGroup><!-- Hotcue shift -->
            </Children>
          </WidgetGroup><!-- /beat grid & hotcue shift buttons row -->

          <WidgetGroup><Size>1me,1me</Size></WidgetGroup>
        </Children>
        <Connection>
          <ConfigKey persist="true">[Skin],show_beatgrid_controls</ConfigKey>
          <BindProperty>visible</BindProperty>
        </Connection>
      </WidgetGroup><!-- BeatgridControls -->
    </Children>
  </WidgetGroup>
</Template>
