Skip to content

Commit

Permalink
fixup! add PlayButton: drop previewing HotcueButton onto it to latch …
Browse files Browse the repository at this point in the history
…`play`
  • Loading branch information
ronso0 committed Jan 30, 2025
1 parent a326def commit a6c44cf
Show file tree
Hide file tree
Showing 7 changed files with 135 additions and 9 deletions.
2 changes: 1 addition & 1 deletion res/skins/Deere/deck_controls_row.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<Layout>stacked</Layout>
<SizePolicy>me,me</SizePolicy>
<Children>
<Template src="skin:left_right_display_2state_button.xml">
<Template src="skin:left_right_display_play_2state_button.xml">
<SetVariable name="TooltipId">play_cue_set</SetVariable>
<SetVariable name="ObjectName">PlayToggle</SetVariable>
<SetVariable name="MinimumSize"><Variable name="HorizontalStretchButtonMinimumSize"/></SetVariable>
Expand Down
65 changes: 65 additions & 0 deletions res/skins/Deere/left_right_display_play_2state_button.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!DOCTYPE template>
<!--
Description:
A button that has a left-click control, a right-click control, and a 2-state
display control.
Left-click control is one of the play controls.
HotcueButtons of the same player (engine, not necessarily same player in skin)
can be dropped onto it in order to latch play when previewing from hotcue.
Make sure to use one of the 'play' ToolTipIDs so the dnd behavior is discoverable.
Variables:
ObjectName: The object name.
Size: the button size.
state_X_text:
state_X_pressed:
state_X_unpressed:
LeftClickIsPushButton: true / false
Defines the button mode.
true = PUSH button
false = TOGGLE or TRIGGER, as automatically set by
the control connected to the respective button.
RightClickIsPushButton: See above. true / false
-->
<Template>
<PlayButton>
<TooltipId><Variable name="TooltipId"/></TooltipId>
<ObjectName><Variable name="ObjectName"/></ObjectName>
<MinimumSize><Variable name="MinimumSize"/></MinimumSize>
<MaximumSize><Variable name="MaximumSize"/></MaximumSize>
<SizePolicy><Variable name="SizePolicy"/></SizePolicy>
<NumberStates>2</NumberStates>
<LeftClickIsPushButton><Variable name="LeftClickIsPushButton"/></LeftClickIsPushButton>
<RightClickIsPushButton><Variable name="RightClickIsPushButton"/></RightClickIsPushButton>
<Group><Variable name="group"/></Group>
<State>
<Number>0</Number>
<Text><Variable name="state_0_text"/></Text>
<Pressed scalemode="STRETCH_ASPECT"><Variable name="state_0_pressed"/></Pressed>
<Unpressed scalemode="STRETCH_ASPECT"><Variable name="state_0_unpressed"/></Unpressed>
</State>
<State>
<Number>1</Number>
<Text><Variable name="state_1_text"/></Text>
<Pressed scalemode="STRETCH_ASPECT"><Variable name="state_1_pressed"/></Pressed>
<Unpressed scalemode="STRETCH_ASPECT"><Variable name="state_1_unpressed"/></Unpressed>
</State>
<Connection>
<ConfigKey><Variable name="left_connection_control"/></ConfigKey>
<EmitOnPressAndRelease>true</EmitOnPressAndRelease>
<ButtonState>LeftButton</ButtonState>
<ConnectValueToWidget>false</ConnectValueToWidget>
</Connection>
<Connection>
<ConfigKey><Variable name="right_connection_control"/></ConfigKey>
<EmitOnPressAndRelease>true</EmitOnPressAndRelease>
<ButtonState>RightButton</ButtonState>
<ConnectValueToWidget>false</ConnectValueToWidget>
</Connection>
<Connection>
<ConfigKey><Variable name="display_connection_control"/></ConfigKey>
<ConnectValueFromWidget>false</ConnectValueFromWidget>
</Connection>
</PlayButton>
</Template>
10 changes: 6 additions & 4 deletions res/skins/Shade/mixer_panel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,10 @@
</Connection>
</PushButton>
<!-- Play -->
<PushButton>
<PlayButton>
<TooltipId>play_cue_set</TooltipId>
<Pos>11,200</Pos>
<Group>[Channel1]</Group>
<NumberStates>2</NumberStates>
<State>
<Number>0</Number>
Expand All @@ -147,7 +148,7 @@
<ConfigKey>[Channel1],play_latched</ConfigKey>
<ConnectValueFromWidget>false</ConnectValueFromWidget>
</Connection>
</PushButton>
</PlayButton>

<!-- Play deck 2 -->
<!-- Play indicator, blinks depending on Cue mode -->
Expand Down Expand Up @@ -185,9 +186,10 @@
</Connection>
</PushButton>
<!-- Play -->
<PushButton>
<PlayButton>
<TooltipId>play_cue_set</TooltipId>
<Pos>203,200</Pos>
<Group>[Channel2]</Group>
<NumberStates>2</NumberStates>
<State>
<Number>0</Number>
Expand All @@ -211,7 +213,7 @@
<ConfigKey>[Channel2],play_latched</ConfigKey>
<ConnectValueFromWidget>false</ConnectValueFromWidget>
</Connection>
</PushButton>
</PlayButton>

<!--
**********************************************
Expand Down
5 changes: 3 additions & 2 deletions res/skins/Shade/sampler.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@
</Connection>
</PushButton>
<!-- Play -->
<PushButton>
<PlayButton>
<TooltipId>cue_gotoandplay_cue_default</TooltipId>
<Group><Variable name="group"/></Group>
<Pos>3,7</Pos>
<NumberStates>2</NumberStates>
<RightClickIsPushButton>true</RightClickIsPushButton>
Expand All @@ -156,7 +157,7 @@
<Connection>
<ConfigKey><Variable name="group"/>,play_latched</ConfigKey>
</Connection>
</PushButton>
</PlayButton>
</Children>
</WidgetGroup>

Expand Down
58 changes: 58 additions & 0 deletions res/skins/Tango/controls/button_play_2state_right_display.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!--
Description:
A button that has click or display controls.
Left-click control is one of the play controls.
HotcueButtons of the same player (engine, not necessarily same player in skin)
can be dropped onto it in order to latch play when previewing from hotcue.
Make sure to use one of the 'play' ToolTipIDs so the dnd behavior is discoverable.
Variables:
ObjectName : object name
ToolTipID : standard Tooltip from mixxx db
see: https://github.com/mixxxdj/mixxx/blob/main/src/skin/legacy/tooltips.cpp
Size : button size
state_X_text : label text for state X
state_X_pressed : background graphic for pressed state X
state_X_unpressed : background graphic for unpressed state X
Align : alignment of text
ConfigKey : left-click control
ConfigKeyRight : right-click control
ConfigKeyDisp : display control
-->
<Template>
<PlayButton>
<TooltipId><Variable name="TooltipId"/></TooltipId>
<ObjectName><Variable name="ObjectName"/></ObjectName>
<Size><Variable name="Size"/></Size>
<NumberStates>2</NumberStates>
<RightClickIsPushButton>true</RightClickIsPushButton>
<Group><Variable name="group"/></Group>
<State>
<Number>0</Number>
<Text><Variable name="state_0_text"/></Text>
<Alignment><Variable name="Align"/></Alignment>
<Pressed scalemode="STRETCH_ASPECT">skins:Tango/buttons/btn_<Variable name="state_0_icon"/></Pressed>
<Unpressed scalemode="STRETCH_ASPECT">skins:Tango/buttons/btn_<Variable name="state_0_icon"/></Unpressed>
</State>
<State>
<Number>1</Number>
<Text><Variable name="state_1_text"/></Text>
<Alignment><Variable name="Align"/></Alignment>
<Pressed scalemode="STRETCH_ASPECT">skins:Tango/buttons/btn_<Variable name="state_1_icon"/></Pressed>
<Unpressed scalemode="STRETCH_ASPECT">skins:Tango/buttons/btn_<Variable name="state_1_icon"/></Unpressed>
</State>
<Connection>
<ConfigKey><Variable name="ConfigKey"/></ConfigKey>
<ButtonState>LeftButton</ButtonState>
</Connection>
<Connection>
<ConfigKey><Variable name="ConfigKeyRight"/></ConfigKey>
<ButtonState>RightButton</ButtonState>
</Connection>
<Connection>
<ConfigKey><Variable name="ConfigKeyDisp"/></ConfigKey>
<ConnectValueFromWidget>false</ConnectValueFromWidget>
</Connection>
</PlayButton>
</Template>
2 changes: 1 addition & 1 deletion res/skins/Tango/decks/row_transport_left.xml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ Variables:
<Size>50f,24f</Size>
<Children>
<!-- Play -->
<Template src="skins:Tango/controls/button_2state_right_display.xml">
<Template src="skins:Tango/controls/button_play_2state_right_display.xml">
<SetVariable name="ObjectName">PlayCue</SetVariable>
<SetVariable name="TooltipId">play_cue_set</SetVariable>
<SetVariable name="Size">50f,24f</SetVariable>
Expand Down
2 changes: 1 addition & 1 deletion res/skins/Tango/decks/row_transport_right.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Variables:
<Size>50f,24f</Size>
<Children>
<!-- Play -->
<Template src="skins:Tango/controls/button_2state_right_display.xml">
<Template src="skins:Tango/controls/button_play_2state_right_display.xml">
<SetVariable name="ObjectName">PlayCue</SetVariable>
<SetVariable name="TooltipId">play_cue_set</SetVariable>
<SetVariable name="Size">50f,24f</SetVariable>
Expand Down

0 comments on commit a6c44cf

Please sign in to comment.