Skip to content

Commit

Permalink
feat: add UI control for stem
Browse files Browse the repository at this point in the history
  • Loading branch information
acolombier committed Jul 30, 2024
1 parent 9b31059 commit 67b2d61
Show file tree
Hide file tree
Showing 26 changed files with 716 additions and 26 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3457,6 +3457,7 @@ if (STEM)
src/sources/soundsourcestem.cpp
src/track/steminfoimporter.cpp
src/track/steminfo.cpp
src/widget/wstemcontrol.cpp
)
if(QOPENGL)
target_sources(mixxx-lib PRIVATE
Expand Down
4 changes: 2 additions & 2 deletions res/skins/Deere/deck.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<Children>
<Template src="skins:Deere/deck_spinny.xml">
<SetVariable name="cover">true</SetVariable>
<SetVariable name="Size">55f,55f</SetVariable>
<SetVariable name="Size">68f,68f</SetVariable>
</Template>
</Children>
</WidgetGroup>
Expand All @@ -51,7 +51,7 @@
<Children>
<Template src="skins:Deere/deck_spinny.xml">
<SetVariable name="cover">false</SetVariable>
<SetVariable name="Size">55f,55f</SetVariable>
<SetVariable name="Size">68f,68f</SetVariable>
</Template>
</Children>
</WidgetGroup>
Expand Down
35 changes: 35 additions & 0 deletions res/skins/Deere/deck_waveform.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,41 @@
- 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)
-->
<StemControl alignment="left">
<MinimumSize>138,68</MinimumSize>
<MaximumSize>158,1920</MaximumSize>
<SizePolicy>me,me</SizePolicy>
<Stem>
<MinimumSize>130,17</MinimumSize>
<MaximumSize>150,1920</MaximumSize>
<SizePolicy>me,min</SizePolicy>
<Layout>horizontal</Layout>
<Children>
<Label>
<ObjectName>stem_label</ObjectName>
<SizePolicy>e,max</SizePolicy>
</Label>
<KnobComposed>
<Pos>0,0</Pos>
<MinimumSize>20,17</MinimumSize>
<MaximumSize>40,34</MaximumSize>
<SizePolicy>me,me</SizePolicy>
<Knob>knob.svg</Knob>
<BackPath>knob_bg_blue.svg</BackPath>
<MinAngle>-135</MinAngle>
<MaxAngle>135</MaxAngle>
<KnobCenterYOffset>1.602</KnobCenterYOffset>
<Connection>
<ConfigKey><Variable name="StemGroup"/>,volume</ConfigKey>
</Connection>
</KnobComposed>
</Children>
</Stem>
<Connection>
<ConfigKey persist="true">[Skin],show_stem_controls</ConfigKey>
<BindProperty>displayed</BindProperty>
</Connection>
</StemControl>
</Visual>

<WidgetGroup>
Expand Down
5 changes: 5 additions & 0 deletions res/skins/Deere/skin_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@
<SetVariable name="skinsetting">[Skin],show_4decks</SetVariable>
</Template>

<Template src="skins:Deere/skinsettings_button.xml">
<SetVariable name="TooltipId">show_stem_controls</SetVariable>
<SetVariable name="text">Show stem controls</SetVariable>
<SetVariable name="skinsetting">[Skin],show_stem_controls</SetVariable>
</Template>
</Children>
</WidgetGroup>

Expand Down
19 changes: 14 additions & 5 deletions res/skins/Deere/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -1432,11 +1432,6 @@ WWidget, WLabel {
font-size: 12px;
}

/* Track text, etc. should be in the deck color. */
#Deck1 WLabel, #Deck2 WLabel, #Deck3 WLabel, #Deck4 WLabel {
color: #D2D2D2;
}

WNumberRate {
font-size: 13px;
}
Expand Down Expand Up @@ -2456,3 +2451,17 @@ WRateRange {
#RateDisplayBottomRate {
qproperty-alignment: 'AlignRight | AlignBottom';
}

/** Stem control **/
WStemControlBox {
background-color: transparent;
}
WStemControl WLabel {
color: #222222;
padding-left: 5px;
font-weight: 500;
font-size: 14px;
}
WStemControl {
margin: 10px 15px 10px 15px;
}
2 changes: 2 additions & 0 deletions res/skins/LateNight/skin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<attribute config_key="[App],num_samplers">16</attribute>
<attribute persist="true" config_key="[Skin],show_waveforms">1</attribute>
<attribute persist="true" config_key="[Skin],timing_shift_buttons">0</attribute>
<attribute persist="true" config_key="[Skin],show_stem_controls">0</attribute>

<!-- Decks -->
<!-- general -->
Expand All @@ -63,6 +64,7 @@
<attribute persist="true" config_key="[Skin],show_rate_controls">1</attribute>
<attribute persist="true" config_key="[Skin],show_rate_control_buttons">1</attribute>
<attribute persist="true" config_key="[Skin],show_beatgrid_controls">1</attribute>
<attribute persist="true" config_key="[Skin],show_stem_controls">1</attribute>
<!-- Compact deck -->
<attribute persist="true" config_key="[Skin],show_rate_controls_compact">1</attribute>
<attribute persist="true" config_key="[Skin],show_loop_controls_compact">1</attribute>
Expand Down
20 changes: 20 additions & 0 deletions res/skins/LateNight/skin_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,26 @@ Description:

</Children>
</WidgetGroup>

<!-- Stem control over the waveform -->
<WidgetGroup>
<ObjectName>SkinSettingsCategory</ObjectName>
<SizePolicy>me,f</SizePolicy>
<Layout>stacked</Layout>
<Children>
<!-- translucent cover when waveforms are hidden -->
<Template src="skins:LateNight/helpers/skin_settings_cover_inverted.xml">
<SetVariable name="Setting">[Skin],show_waveforms</SetVariable>
</Template>

<Template src="skins:LateNight/helpers/skin_settings_button_2state.xml">
<SetVariable name="TooltipId">show_stem_controls</SetVariable>
<SetVariable name="Text">Stem control</SetVariable>
<SetVariable name="Setting">[Skin],show_stem_controls</SetVariable>
</Template>

</Children>
</WidgetGroup>
</Children>
</WidgetGroup>
</Children>
Expand Down
15 changes: 15 additions & 0 deletions res/skins/LateNight/style_palemoon.qss
Original file line number Diff line number Diff line change
Expand Up @@ -3208,3 +3208,18 @@ WSearchLineEdit::indicator:unchecked:selected {
}
/************** common styles for WEffectSelector ******************************
*************** QSpinBox, QMenu, QToolTip *************************************/

/** Stem control **/
WStemControlBox {
padding-left: 8px;
background-color: transparent;
}
WStemControl WLabel {
padding-left: 5px;
font-weight: 500;
font-size: 14px;
}
WStemControl {
border-radius: 7px;
opacity: 0.2;
}
39 changes: 39 additions & 0 deletions res/skins/LateNight/waveform.xml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,45 @@
<Color><Variable name="IntroOutroColor"/></Color>
<TextColor>#FFFFFF</TextColor>
</Mark>
<StemControl alignment="left">
<MinimumSize>138,68</MinimumSize>
<MaximumSize>158,1920</MaximumSize>
<SizePolicy>me,me</SizePolicy>
<Stem>
<MinimumSize>130,17</MinimumSize>
<MaximumSize>150,34</MaximumSize>
<SizePolicy>me,min</SizePolicy>
<Layout>horizontal</Layout>
<Children>
<Label>
<ObjectName>stem_label</ObjectName>
<SizePolicy>e,max</SizePolicy>
</Label>
<KnobComposed>
<Pos>0,0</Pos>
<MinimumSize>20,17</MinimumSize>
<MaximumSize>40,34</MaximumSize>
<SizePolicy>me,me</SizePolicy>
<Knob>skins:LateNight/<Variable name="KnobScheme"/>/knobs/knob_indicator_regular_<Variable name="KnobColorEq"/>.svg</Knob>
<BackPath>skins:LateNight/<Variable name="KnobScheme"/>/knobs/knob_bg_regular.svg</BackPath>
<MinAngle><Variable name="PotiMinAngle"/></MinAngle>
<MaxAngle><Variable name="PotiMaxAngle"/></MaxAngle>
<ArcRadius><Variable name="ArcRadius"/></ArcRadius>
<ArcThickness><Variable name="ArcThickness"/></ArcThickness>
<ArcColor><Variable name="ArcColorEq"/></ArcColor>
<ArcRoundCaps><Variable name="ArcRoundCaps"/></ArcRoundCaps>
<KnobCenterYOffset>1.998</KnobCenterYOffset>
<Connection>
<ConfigKey><Variable name="StemGroup"/>,volume</ConfigKey>
</Connection>
</KnobComposed>
</Children>
</Stem>
<Connection>
<ConfigKey persist="true">[Skin],show_stem_controls</ConfigKey>
<BindProperty>displayed</BindProperty>
</Connection>
</StemControl>
</Visual>
</Children>
<Connection>
Expand Down
12 changes: 6 additions & 6 deletions res/skins/Shade/deck.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,19 @@
</WidgetGroup><!-- Cover art / Artist/title / Playposition -->
<WidgetGroup><!-- Scrolling waveform / Spinny / Vinyl controls -->
<ObjectName>DeckUpperLeftMidPart</ObjectName>
<Size>0e,81f</Size>
<Size>0e,91f</Size>
<Layout>horizontal</Layout>
<Children>
<WidgetGroup>
<ObjectName>DeckUpperMidPart</ObjectName>
<Size>0e,81f</Size>
<Size>0e,91f</Size>
<BackPath>style/style_bg_deck_pane.png</BackPath>
<Layout>horizontal</Layout>
<Children>
<!-- Collapsing Waveform, VinylControl & spinning Vinyl widget-->
<WidgetGroup>
<ObjectName>DeckWaveformVinylControlSpinny</ObjectName>
<Size>0e,81f</Size>
<Size>0e,91f</Size>
<Layout>horizontal</Layout>
<Children>
<!--If you want the waveforms center to adjust when resizing in a collapsing widget
Expand All @@ -179,7 +179,7 @@
-->
<WidgetGroup>
<Layout>horizontal</Layout>
<Size>0e,81f</Size>
<Size>0e,91f</Size>
<Children>
<Template src="skin:waveform.xml"/>
</Children>
Expand All @@ -191,7 +191,7 @@
<Children>
<!-- Spinning Vinyl sub-widget -->
<WidgetGroup>
<Size>81f,81f</Size>
<Size>91f,91f</Size>
<Layout>horizontal</Layout>
<Children>
<!--
Expand All @@ -201,7 +201,7 @@
-->
<Spinny>
<TooltipId>spinny</TooltipId>
<Size>81f,81f</Size>
<Size>91f,91f</Size>
<Channel><Variable name="channum"/></Channel>
<PathBackground scalemode="STRETCH_ASPECT">vinyl_spinny_background.png</PathBackground>
<PathForeground scalemode="STRETCH_ASPECT">vinyl_spinny_foreground.png</PathForeground>
Expand Down
16 changes: 16 additions & 0 deletions res/skins/Shade/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -1047,3 +1047,19 @@ WRateRange {
font-size: 10px;
qproperty-alignment: 'AlignCenter';
}

/** Stem control **/
WStemControlBox {
background-color: transparent;
}
WStemControl WLabel {
padding-left: 5px;
font-weight: bold;
font-size: 14px;
}
WStemControl WKnob {
background-color: #717171;
}
WStemControl {
margin: 10px 15px 10px 15px;
}
16 changes: 16 additions & 0 deletions res/skins/Shade/style_dark.qss
Original file line number Diff line number Diff line change
Expand Up @@ -288,3 +288,19 @@ WTrackTableViewHeader::down-arrow {
WRateRange {
color: #181319;
}

/** Stem control **/
WStemControlBox {
background-color: transparent;
}
WStemControl WLabel {
padding-left: 5px;
font-weight: bold;
font-size: 14px;
}
WStemControl WKnob {
background-color: #aab2b7;
}
WStemControl {
margin: 10px 15px 10px 15px;
}
16 changes: 16 additions & 0 deletions res/skins/Shade/style_summer_sunset.qss
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,19 @@ QPushButton#pushButtonAnalyze:hover {
WRateRange {
color: #4B515F;
}

/** Stem control **/
WStemControlBox {
background-color: transparent;
}
WStemControl WLabel {
padding-left: 5px;
font-weight: bold;
font-size: 14px;
}
WStemControl WKnob {
background-color: #d9c663;
}
WStemControl {
margin: 10px 15px 10px 15px;
}
30 changes: 30 additions & 0 deletions res/skins/Shade/waveform.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,35 @@
- if you change from a skin which supports more hotcues
than buttons are in the current skin (and has them activated)
-->
<StemControl alignment="right">
<MinimumSize>138,68</MinimumSize>
<MaximumSize>158,1920</MaximumSize>
<SizePolicy>me,me</SizePolicy>
<Stem>
<MinimumSize>130,17</MinimumSize>
<MaximumSize>150,1920</MaximumSize>
<SizePolicy>me,min</SizePolicy>
<Layout>horizontal</Layout>
<Children>
<Label>
<ObjectName>stem_label</ObjectName>
<SizePolicy>e,max</SizePolicy>
</Label>
<Knob>
<TooltipId>main_gain</TooltipId>
<NumberStates>64</NumberStates>
<Path>knobs_no_center/knob_rotary_s%1.png</Path>
<Pos>151,15</Pos>
<Connection>
<ConfigKey><Variable name="StemGroup"/>,volume</ConfigKey>
</Connection>
</Knob>
</Children>
</Stem>
<Connection>
<ConfigKey persist="true">[Skin],show_stem_controls</ConfigKey>
<BindProperty>displayed</BindProperty>
</Connection>
</StemControl>
</Visual>
</Template>
5 changes: 5 additions & 0 deletions res/skins/Tango/skin_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ Description:
<SetVariable name="Setting">[Tango],symmetric_overviews</SetVariable>
</Template>

<Template src="skins:Tango/controls/skin_settings_button_2state.xml">
<SetVariable name="text">Show stem control</SetVariable>
<SetVariable name="Setting">[Skin],show_stem_controls</SetVariable>
</Template>

<Template src="skins:Tango/controls/skin_settings_button_2state.xml">
<SetVariable name="text">Symmetric Time/Duration</SetVariable>
<SetVariable name="Setting">[Tango],symmetric_time</SetVariable>
Expand Down
14 changes: 14 additions & 0 deletions res/skins/Tango/style.qss
Original file line number Diff line number Diff line change
Expand Up @@ -3223,3 +3223,17 @@ WRateRange {
#RateDisplayBottomRate {
qproperty-alignment: 'AlignHCenter';
}

/** Stem control **/
WStemControlBox {
padding-left: 8px;
background-color: transparent;
}
WStemControl WLabel {
padding-left: 5px;
font-weight: bold;
font-size: 14px;
}
WStemControl {
margin: 10px 15px 10px 15px;
}
Loading

0 comments on commit 67b2d61

Please sign in to comment.