Skip to content

Commit

Permalink
Merge pull request #3693 from Holzhaus/tempo-range-display
Browse files Browse the repository at this point in the history
Skins: Add range display for tempo slider
  • Loading branch information
ronso0 authored Mar 13, 2021
2 parents 3885379 + a2995dd commit 1a8f8d3
Show file tree
Hide file tree
Showing 23 changed files with 672 additions and 624 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,7 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL
src/widget/wwidget.cpp
src/widget/wwidgetgroup.cpp
src/widget/wwidgetstack.cpp
src/widget/wraterange.cpp
)
set_target_properties(mixxx-lib PROPERTIES AUTOMOC ON AUTOUIC ON CXX_CLANG_TIDY "${CLANG_TIDY}")
target_include_directories(mixxx-lib PUBLIC src "${CMAKE_CURRENT_BINARY_DIR}/src")
Expand Down
87 changes: 75 additions & 12 deletions res/skins/Deere/deck_tempo_column.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,82 @@
</Children>
</WidgetGroup>

<WidgetGroup>
<Layout>horizontal</Layout>
<WidgetGroup><!-- Rate slider + range displays -->
<Layout>stacked</Layout>
<SizePolicy>max,me</SizePolicy>
<Children>
<SliderComposed>
<TooltipId>rate</TooltipId>
<Size>40f,-1me</Size>
<MaximumSize>40,200</MaximumSize>
<Slider scalemode="STRETCH">slider-vertical.svg</Slider>
<Handle scalemode="STRETCH_ASPECT">handle-vertical-blue.svg</Handle>
<Connection>
<ConfigKey><Variable name="group"/>,rate</ConfigKey>
</Connection>
</SliderComposed>
<WidgetGroup>
<Layout>horizontal</Layout>
<Children>
<SliderComposed>
<TooltipId>rate</TooltipId>
<Size>50f,-1me</Size>
<MaximumSize>40,200</MaximumSize>
<Slider scalemode="STRETCH">slider-vertical.svg</Slider>
<Handle scalemode="STRETCH_ASPECT">handle-vertical-blue.svg</Handle>
<Connection>
<ConfigKey><Variable name="group"/>,rate</ConfigKey>
</Connection>
</SliderComposed>
</Children>
</WidgetGroup>

<!-- Pitch range indicators: prefix / spacer / range number -->
<WidgetGroup>
<SizePolicy>me,me</SizePolicy>
<Layout>vertical</Layout>
<Size>50f,-1me</Size>
<Children>
<WidgetGroup>
<SizePolicy>me,me</SizePolicy>
<Layout>horizontal</Layout>
<Children>
<!-- Top range limit + prefix -->
<RateRange>
<TooltipId>rate_range_display</TooltipId>
<ObjectName>RateDisplayTopPrefix</ObjectName>
<Channel><Variable name="i" /></Channel>
<Position>Top</Position>
<Display>prefix</Display>
<SizePolicy>me,me</SizePolicy>
</RateRange>
<RateRange>
<TooltipId>rate_range_display</TooltipId>
<ObjectName>RateDisplayTopRate</ObjectName>
<Channel><Variable name="i" /></Channel>
<Position>Top</Position>
<Display>range</Display>
<SizePolicy>me,me</SizePolicy>
</RateRange>
</Children>
</WidgetGroup><!-- Pitch range indicators -->

<WidgetGroup>
<SizePolicy>me,me</SizePolicy>
<Layout>horizontal</Layout>
<Children>
<!-- Bottom range limit + prefix -->
<RateRange>
<TooltipId>rate_range_display</TooltipId>
<ObjectName>RateDisplayBottomPrefix</ObjectName>
<Channel><Variable name="i" /></Channel>
<Position>Bottom</Position>
<Align>Bottom</Align>
<Display>prefix</Display>
<SizePolicy>me,me</SizePolicy>
</RateRange>
<RateRange>
<TooltipId>rate_range_display</TooltipId>
<ObjectName>RateDisplayBottomRate</ObjectName>
<Channel><Variable name="i" /></Channel>
<Align>Bottom</Align>
<Display>range</Display>
<SizePolicy>me,me</SizePolicy>
</RateRange>
</Children>
</WidgetGroup><!-- Pitch range indicators -->
</Children>
</WidgetGroup>
</Children>
</WidgetGroup>

Expand Down
18 changes: 18 additions & 0 deletions res/skins/Deere/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -2221,3 +2221,21 @@ WEffectSelector {
#CueDeleteButton:hover {
background-color: #4B4B4B;
}

WRateRange {
font-size: 10px;
}

#RateDisplayTopPrefix {
qproperty-alignment: 'AlignLeft | AlignTop';
}
#RateDisplayTopRate {
qproperty-alignment: 'AlignRight | AlignTop';
}

#RateDisplayBottomPrefix {
qproperty-alignment: 'AlignLeft | AlignBottom';
}
#RateDisplayBottomRate {
qproperty-alignment: 'AlignRight | AlignBottom';
}
63 changes: 59 additions & 4 deletions res/skins/LateNight/decks/deck_singletons.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
</Children>
</SingletonDefinition>

<!-- ...used in full & compact deck, minimal deck has its own instance
with smaller labels. -->
<!-- ...used in full & compact deck -->
<SingletonDefinition>
<ObjectName>DeckOverview<Variable name="ChanNum"/></ObjectName>
<Children>
Expand All @@ -20,22 +19,78 @@
</Children>
</SingletonDefinition>

<!-- ...used in full & compact deck. -->
<SingletonDefinition>
<ObjectName>DeckSettings<Variable name="ChanNum"/></ObjectName>
<Children>
<Template src="skin:/decks/deck_settings.xml"/>
</Children>
</SingletonDefinition>

<!-- ...used in full & compact deck -->
<SingletonDefinition>
<ObjectName>KeyControls<Variable name="ChanNum"/></ObjectName>
<Children>
<Template src="skin:/decks/key_controls.xml"/>
</Children>
</SingletonDefinition>

<!-- Rate range displays, top & bottom -->
<SingletonDefinition>
<ObjectName>RateRangeDisplayTop<Variable name="ChanNum"/></ObjectName>
<Children>
<WidgetGroup>
<Size>53f,17f</Size>
<Children>
<RateRange>
<TooltipId>rate_range_display</TooltipId>
<ObjectName>RateRangePrefix</ObjectName>
<Channel><Variable name="ChanNum"/></Channel>
<Position>Top</Position>
<Display>prefix</Display>
<Size>7f,16f</Size>
<Pos>3,0</Pos>
</RateRange>
<RateRange>
<TooltipId>rate_range_display</TooltipId>
<ObjectName>RateRangeText</ObjectName>
<Channel><Variable name="ChanNum"/></Channel>
<Position>Top</Position>
<Display>range</Display>
<Size>18f,16f</Size>
<Pos>35,1</Pos>
</RateRange>
</Children>
</WidgetGroup>
</Children>
</SingletonDefinition>
<SingletonDefinition>
<ObjectName>RateRangeDisplayBottom<Variable name="ChanNum"/></ObjectName>
<Children>
<WidgetGroup>
<Size>53f,16f</Size>
<Children>
<RateRange>
<TooltipId>rate_range_display</TooltipId>
<ObjectName>RateRangePrefix</ObjectName>
<Channel><Variable name="ChanNum" /></Channel>
<Position>Bottom</Position>
<Display>prefix</Display>
<Size>7f,16f</Size>
<Pos>3,0</Pos>
</RateRange>
<RateRange>
<TooltipId>rate_range_display</TooltipId>
<ObjectName>RateRangeText</ObjectName>
<Channel><Variable name="ChanNum" /></Channel>
<Position>Bottom</Position>
<Display>range</Display>
<Size>18f,16f</Size>
<Pos>35,0</Pos>
</RateRange>
</Children>
</WidgetGroup>
</Children>
</SingletonDefinition>

<!-- Decks -->
<!-- minimal deck. used in deck stack and above library -->
<SingletonDefinition>
Expand Down
89 changes: 56 additions & 33 deletions res/skins/LateNight/decks/rate_controls.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,43 +90,66 @@

<WidgetGroup>
<ObjectName>RateControls</ObjectName>
<SizePolicy>min,min</SizePolicy>
<Layout>horizontal</Layout>
<SizePolicy>min,min</SizePolicy>
<Children>
<WidgetGroup>
<ObjectName></ObjectName>
<Size>45f,119f</Size>

<WidgetGroup><!-- Rate slider + range displays -->
<Layout>stacked</Layout>
<SizePolicy>max,me</SizePolicy>
<Children>
<Label>
<ObjectName>RateCenter</ObjectName>
<Size>5f,5f</Size>
<Pos>2,58</Pos>
<Connection>
<ConfigKey><Variable name="Group"/>,rate</ConfigKey>
<Transform><IsEqual>0.5</IsEqual></Transform>
<BindProperty>highlight</BindProperty>
</Connection>
</Label>
<SliderComposed>
<ObjectName>RateSlider</ObjectName>
<Size>40f,119f</Size>
<Pos>5,0</Pos>
<TooltipId>rate</TooltipId>
<Handle scalemode="STRETCH_ASPECT">skin:/<Variable name="SliderScheme"/>/sliders/knob_pitch_deck.svg</Handle>
<Slider scalemode="STRETCH_ASPECT">skin:/<Variable name="SliderScheme"/>/sliders/slider_pitch_deck.svg</Slider>
<Horizontal>false</Horizontal>
<BarWidth><Variable name="BarWidth"/></BarWidth>
<BarMargins><Variable name="BarMarginPitch"/></BarMargins>
<BarColor><Variable name="BarColorPitch"/>
</BarColor><BarRoundCaps>true</BarRoundCaps>
<BarAxisPos>20.0</BarAxisPos>
<BarUnipolar>false</BarUnipolar>
<Connection>
<ConfigKey><Variable name="Group"/>,rate</ConfigKey>
</Connection>
</SliderComposed>

<!-- Rate slider + center indicator -->
<WidgetGroup>
<ObjectName>RateSliderBox</ObjectName>
<Size>54f,121f</Size>
<Children>
<Label>
<ObjectName>RateCenter</ObjectName>
<Size>5f,5f</Size>
<Pos>2,59</Pos>
<Connection>
<ConfigKey><Variable name="Group"/>,rate</ConfigKey>
<Transform><IsEqual>0.5</IsEqual></Transform>
<BindProperty>highlight</BindProperty>
</Connection>
</Label>
<SliderComposed>
<ObjectName>RateSlider</ObjectName>
<Size>40f,119f</Size>
<Pos>5,2</Pos>
<TooltipId>rate</TooltipId>
<Handle scalemode="STRETCH_ASPECT">skin:/<Variable name="SliderScheme"/>/sliders/knob_pitch_deck.svg</Handle>
<Slider scalemode="STRETCH_ASPECT">skin:/<Variable name="SliderScheme"/>/sliders/slider_pitch_deck.svg</Slider>
<Horizontal>false</Horizontal>
<BarWidth><Variable name="BarWidth"/></BarWidth>
<BarMargins><Variable name="BarMarginPitch"/></BarMargins>
<BarColor><Variable name="BarColorPitch"/></BarColor>
<BarRoundCaps>true</BarRoundCaps>
<BarAxisPos>20.0</BarAxisPos>
<BarUnipolar>false</BarUnipolar>
<Connection>
<ConfigKey><Variable name="Group"/>,rate</ConfigKey>
</Connection>
</SliderComposed>
</Children>
</WidgetGroup><!-- Rate slider + center indicator -->

<WidgetGroup><!-- Rate range indicators -->
<SizePolicy>min,me</SizePolicy>
<Layout>vertical</Layout>
<Children>
<SingletonContainer>
<ObjectName>RateRangeDisplayTop<Variable name="ChanNum"/></ObjectName>
</SingletonContainer>
<WidgetGroup><Size>0min,0me</Size></WidgetGroup>
<SingletonContainer>
<ObjectName>RateRangeDisplayBottom<Variable name="ChanNum"/></ObjectName>
</SingletonContainer>
</Children>
</WidgetGroup><!-- Rate range indicators -->
</Children>
</WidgetGroup>
</WidgetGroup><!-- Rate slider + range displays -->

<WidgetGroup><!-- RateButtons for different rate directions -->
<ObjectName>RateButtons</ObjectName>
Expand Down
Loading

0 comments on commit 1a8f8d3

Please sign in to comment.