<!--
Description:
  Scrolling waveform on top edge of skin with beat grid buttons at the right-hand side.
  Minimum size is 22px.
  Expanded beat grid buttons make the waveform grow to 50px.
Variables:
  group   : [ChannelN]
  chanNum : channel number
  SignalBgColor       : defined in skin.xml
  SignalColor         :
  SignalRGBLowColor   :
  SignalRGBMidColor   :
  SignalRGBHighColor  :
-->
<Template>
  <SetVariable name="group">[Channel<Variable name="chanNum"/>]</SetVariable>
  <WidgetGroup>
    <ObjectName>WaveformContainer<Variable name="chanNum"/></ObjectName>
    <Layout>horizontal</Layout>
    <Children>
      <Visual>
        <TooltipId>waveform_display</TooltipId>
        <ObjectName>Waveform</ObjectName>
        <Size>0me,22me</Size>
        <Channel><Variable name="chanNum"/></Channel>
        <BgColor><Variable name="SignalBgColor"/></BgColor>
        <SignalColor><Variable name="SignalColor"/></SignalColor>
        <SignalRGBLowColor><Variable name="SignalRGBLowColor"/></SignalRGBLowColor>
        <SignalRGBMidColor><Variable name="SignalRGBMidColor"/></SignalRGBMidColor>
        <SignalRGBHighColor><Variable name="SignalRGBHighColor"/></SignalRGBHighColor>
        <BeatColor>#ffffff</BeatColor>
        <PlayPosColor>#FF4300</PlayPosColor>
        <EndOfTrackColor><Variable name="EndOfTrackColor"/></EndOfTrackColor>
        <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>
        <!-- Loop -->
        <MarkRange>
          <StartControl>loop_start_position</StartControl>
          <EndControl>loop_end_position</EndControl>
          <EnabledControl>loop_enabled</EnabledControl>
          <Color>#00FF00</Color>
          <DisabledColor>#FFFFFF</DisabledColor>
        </MarkRange>
        <Mark>
          <Control>loop_start_position</Control>
          <Text>IN</Text>
          <Align>top|left</Align>
          <Color>#00FF00</Color>
          <TextColor>#FFFFFF</TextColor>
        </Mark>
        <Mark>
          <Control>loop_end_position</Control>
          <Text>OUT</Text>
          <Align>top|right</Align>
          <Color>#00FF00</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>#0000FF</Color>
        </MarkRange>
        <Mark>
          <Control>intro_start_position</Control>
          <VisibilityControl>[Skin],show_intro_outro_cues</VisibilityControl>
          <Text>&#9698;</Text>
          <Align>bottom|right</Align>
          <Color>#0000FF</Color>
          <TextColor>#FFFFFF</TextColor>
        </Mark>
        <Mark>
          <Control>intro_end_position</Control>
          <VisibilityControl>[Skin],show_intro_outro_cues</VisibilityControl>
          <Text>&#9698;</Text>
          <Align>bottom|left</Align>
          <Color>#0000FF</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>#0000FF</Color>
        </MarkRange>
        <Mark>
          <Control>outro_start_position</Control>
          <VisibilityControl>[Skin],show_intro_outro_cues</VisibilityControl>
          <Text>&#9699;</Text>
          <Align>bottom|right</Align>
          <Color>#0000FF</Color>
          <TextColor>#FFFFFF</TextColor>
        </Mark>
        <Mark>
          <Control>outro_end_position</Control>
          <VisibilityControl>[Skin],show_intro_outro_cues</VisibilityControl>
          <Text>&#9699;</Text>
          <Align>bottom|left</Align>
          <Color>#0000FF</Color>
          <TextColor>#FFFFFF</TextColor>
        </Mark>
        <!--
        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)
        -->
      </Visual>

      <WidgetGroup><!-- Transparent container for beatgrid buttons -->
        <ObjectName>BeatgridButtons</ObjectName>
        <Layout>vertical</Layout>
        <!-- Horizontal size is 82px and we'll add the WaveformContainer's negative margin
            (shifts waveform center mark) so that all buttons are visible -->
        <SizePolicy>max,me</SizePolicy>
        <Children>
          <WidgetGroup><Size>1min,0me</Size></WidgetGroup>
          <WidgetGroup><Size>1min,1f</Size></WidgetGroup>

          <WidgetGroup><!-- beat grid buttons row -->
            <ObjectName>Spacer0f</ObjectName>
            <Layout>horizontal</Layout>
            <SizePolicy>f,f</SizePolicy>
            <Children>

              <WidgetGroup>
                <Layout>vertical</Layout>
                <Size>f,f</Size>
                <Children>
                  <Template src="skins:Tango/controls/button_1state_right.xml">
                    <SetVariable name="TooltipId">beats_translate_curpos</SetVariable>
                    <SetVariable name="ObjectName">BeatgridCurpos</SetVariable>
                    <SetVariable name="Size">24f,49f</SetVariable>
                    <SetVariable name="ConfigKey"><Variable name="group"/>,beats_translate_curpos</SetVariable>
                    <SetVariable name="ConfigKeyRight"><Variable name="group"/>,beats_translate_match_alignment</SetVariable>
                  </Template>
                </Children>
              </WidgetGroup>

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

              <WidgetGroup><!-- beats earlier & faster -->
                <Layout>vertical</Layout>
                <SizePolicy>f,f</SizePolicy>
                <Children>
                  <Template src="skins:Tango/controls/button_1state.xml">
                    <SetVariable name="TooltipId">beats_translate_earlier</SetVariable>
                    <SetVariable name="ObjectName">BeatgridEarlier</SetVariable>
                    <SetVariable name="Size">28f,24f</SetVariable>
                    <SetVariable name="ConfigKey"><Variable name="group"/>,beats_translate_earlier</SetVariable>
                  </Template>

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

                  <Template src="skins:Tango/controls/button_1state.xml">
                    <SetVariable name="TooltipId">beats_adjust_faster</SetVariable>
                    <SetVariable name="ObjectName">BeatgridFaster</SetVariable>
                    <SetVariable name="Size">28f,24f</SetVariable>
                    <SetVariable name="ConfigKey"><Variable name="group"/>,beats_adjust_faster</SetVariable>
                  </Template>
                </Children>
              </WidgetGroup><!-- /beats earlier & faster -->

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

              <WidgetGroup><!-- beats later & slower -->
                <Layout>vertical</Layout>
                <SizePolicy>f,f</SizePolicy>
                <Children>
                  <Template src="skins:Tango/controls/button_1state.xml">
                    <SetVariable name="TooltipId">beats_translate_later</SetVariable>
                    <SetVariable name="ObjectName">BeatgridLater</SetVariable>
                    <SetVariable name="Size">28f,24f</SetVariable>
                    <SetVariable name="ConfigKey"><Variable name="group"/>,beats_translate_later</SetVariable>
                  </Template>

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

                  <Template src="skins:Tango/controls/button_1state.xml">
                    <SetVariable name="TooltipId">beats_adjust_slower</SetVariable>
                    <SetVariable name="ObjectName">BeatgridSlower</SetVariable>
                    <SetVariable name="Size">28f,24f</SetVariable>
                    <SetVariable name="ConfigKey"><Variable name="group"/>,beats_adjust_slower</SetVariable>
                  </Template>

                </Children>
              </WidgetGroup><!-- /beats later & slower -->

              <WidgetGroup><!-- hotcue sgift buttons, optional -->
                <Layout>horizontal</Layout>
                <SizePolicy>f,f</SizePolicy>
                <Children>
                  <WidgetGroup><Size>1min,1f</Size></WidgetGroup>
                  <WidgetGroup>
                    <Layout>vertical</Layout>
                    <SizePolicy>f,f</SizePolicy>
                    <Children>
                      <Template src="skins:Tango/controls/button_1state_right.xml">
                        <SetVariable name="TooltipId">shift_cues_earlier</SetVariable>
                        <SetVariable name="ObjectName">HotcuesEarlier</SetVariable>
                        <SetVariable name="Size">24f,24f</SetVariable>
                        <SetVariable name="ConfigKey"><Variable name="group"/>,shift_cues_earlier</SetVariable>
                        <SetVariable name="ConfigKeyRight"><Variable name="group"/>,shift_cues_earlier_small</SetVariable>
                      </Template>
                      <WidgetGroup><Size>1min,1f</Size></WidgetGroup>
                      <Template src="skins:Tango/controls/button_1state_right.xml">
                        <SetVariable name="TooltipId">shift_cues_later</SetVariable>
                        <SetVariable name="ObjectName">HotcuesLater</SetVariable>
                        <SetVariable name="Size">24f,24f</SetVariable>
                        <SetVariable name="ConfigKey"><Variable name="group"/>,shift_cues_later</SetVariable>
                        <SetVariable name="ConfigKeyRight"><Variable name="group"/>,shift_cues_later_small</SetVariable>
                      </Template>
                    </Children>
                  </WidgetGroup>
                </Children>
                <Connection>
                  <ConfigKey persist="true">[Skin],timing_shift_buttons</ConfigKey>
                  <BindProperty>visible</BindProperty>
                </Connection>
              </WidgetGroup><!-- hotcue sgift buttons, optional -->
            </Children>
          </WidgetGroup><!-- /beat grid buttons row -->

          <WidgetGroup><Size>1me,0me</Size></WidgetGroup>
          <WidgetGroup><Size>1me,1f</Size></WidgetGroup>
        </Children>
        <Connection>
          <ConfigKey persist="true">[Tango],beatgrid_buttons</ConfigKey>
          <BindProperty>visible</BindProperty>
        </Connection>
      </WidgetGroup><!-- /Transparent container for beatgrid buttons -->
    </Children>
  </WidgetGroup>
</Template>
