Skip to content

Commit

Permalink
feat: add beatloop anchor to set and adjust loop from either start or…
Browse files Browse the repository at this point in the history
… end
  • Loading branch information
acolombier committed Feb 7, 2024
1 parent 7b3e485 commit f08b0f7
Show file tree
Hide file tree
Showing 10 changed files with 340 additions and 29 deletions.
65 changes: 65 additions & 0 deletions res/skins/LateNight/classic/buttons/btn__beatloop_anchor_end.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions res/skins/LateNight/classic/buttons/btn__beatloop_anchor_start.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions res/skins/LateNight/controls/button_2state_display.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!--
Description:
A button that has click or display controls.
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
ConfigKeyDisp : display control
-->
<Template>
<PushButton>
<TooltipId><Variable name="TooltipId"/></TooltipId>
<ObjectName><Variable name="ObjectName"/></ObjectName>
<Size><Variable name="Size"/></Size>
<NumberStates>2</NumberStates>
<RightClickIsPushButton>false</RightClickIsPushButton>
<State>
<Number>0</Number>
<Text><Variable name="state_0_text"/></Text>
<Alignment><Variable name="Align"/></Alignment>
<Unpressed scalemode="STRETCH">skins:LateNight/<Variable name="BtnScheme"/>/buttons/btn_<Variable name="BtnType"/>_<Variable name="BtnSize"/>.svg</Unpressed>
<Pressed scalemode="STRETCH">skins:LateNight/<Variable name="BtnScheme"/>/buttons/btn_<Variable name="BtnType"/>_<Variable name="BtnSize"/>_active.svg</Pressed>
</State>
<State>
<Number>1</Number>
<Text><Variable name="state_1_text"/></Text>
<Alignment><Variable name="Align"/></Alignment>
<Unpressed scalemode="STRETCH">skins:LateNight/<Variable name="BtnScheme"/>/buttons/btn_<Variable name="BtnType"/>_<Variable name="BtnSize"/>_active.svg</Unpressed>
<Pressed scalemode="STRETCH">skins:LateNight/<Variable name="BtnScheme"/>/buttons/btn_<Variable name="BtnType"/>_<Variable name="BtnSize"/>_active.svg</Pressed>
</State>
<Connection>
<ConfigKey><Variable name="ConfigKey"/></ConfigKey>
<ButtonState>LeftButton</ButtonState>
</Connection>
<Connection>
<ConfigKey><Variable name="ConfigKeyDisp"/></ConfigKey>
<ConnectValueFromWidget>false</ConnectValueFromWidget>
</Connection>
</PushButton>
</Template>
10 changes: 9 additions & 1 deletion res/skins/LateNight/decks/row_5_transportLoopJump.xml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
<Layout>vertical</Layout>
<SizePolicy>min,min</SizePolicy>
<MinimumSize>78,52</MinimumSize>
<MaximumSize>86,52</MaximumSize>
<MaximumSize>104,52</MaximumSize>
<Children>
<WidgetGroup><!-- loop enable + beatloop size -->
<ObjectName>AlignLeftTop</ObjectName>
Expand Down Expand Up @@ -290,6 +290,14 @@
<SetVariable name="ConfigKey"><Variable name="Group"/>,loop_out</SetVariable>
<SetVariable name="ConfigKeyRight"><Variable name="Group"/>,loop_out_goto</SetVariable>
</Template>

<Template src="skins:LateNight/controls/button_2state_display.xml">
<SetVariable name="TooltipId">beatloop_anchor</SetVariable>
<SetVariable name="ObjectName">BeatLoopAnchor</SetVariable>
<SetVariable name="Size">26f,26f</SetVariable>
<SetVariable name="ConfigKey"><Variable name="Group"/>,beatloop_anchor_toggle</SetVariable>
<SetVariable name="ConfigKeyDisp"><Variable name="Group"/>,beatloop_anchor</SetVariable>
</Template>
</Children>
</WidgetGroup>
</Children>
Expand Down
7 changes: 7 additions & 0 deletions res/skins/LateNight/style_palemoon.qss
Original file line number Diff line number Diff line change
Expand Up @@ -1669,6 +1669,7 @@ QPushButton#pushButtonAnalyze:checked {
#SyncLeader[value="1"],
WPushButton#LoopIn[pressed="true"],
WPushButton#LoopOut[pressed="true"],
WPushButton#BeatLoopAnchor[pressed="true"],
#BeatjumpControls WPushButton[value="1"],
#RateControls WPushButton[value="1"],
#BeatgridControls WPushButton[pressed="true"]/*,
Expand Down Expand Up @@ -2076,6 +2077,12 @@ WPushButton#PlayDeck[value="0"] {
#LoopOut[pressed="true"] {
image: url(skins:LateNight/palemoon/buttons/btn__loop_out_active.svg) no-repeat center center;
}
#BeatLoopAnchor[displayValue="0"] {
image: url(skins:LateNight/classic/buttons/btn__beatloop_anchor_start.svg) no-repeat center center;
}
#BeatLoopAnchor[displayValue="1"] {
image: url(skins:LateNight/classic/buttons/btn__beatloop_anchor_end.svg) no-repeat center center;
}

#JumpForward {
image: url(skins:LateNight/palemoon/buttons/btn__beatjump_right.svg) no-repeat center center;
Expand Down
9 changes: 9 additions & 0 deletions src/controllers/controlpickermenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,15 @@ ControlPickerMenu::ControlPickerMenu(QWidget* pParent)
QString beatJumpBackwardDescription = tr("Jump backward by %1 beats, or if a loop is enabled, move the loop backward %1 beats");
addDeckControl("beatjump_forward", tr("Beat Jump / Loop Move Forward Selected Beats"), tr("Jump forward by the selected number of beats, or if a loop is enabled, move the loop forward by the selected number of beats"), beatJumpMenu);
addDeckControl("beatjump_backward", tr("Beat Jump / Loop Move Backward Selected Beats"), tr("Jump backward by the selected number of beats, or if a loop is enabled, move the loop backward by the selected number of beats"), beatJumpMenu);
addDeckControl("beatjump_anchor",
tr("Beat Jump"),
tr("Indicate which loop marker remain static when adjusting the "
"size or is inherited from the current position"),
beatJumpMenu);
addDeckControl("beatjump_anchor_toggle",
tr("Beat Jump"),
tr("Toggle the loop marker anchor"),
beatJumpMenu);
beatJumpMenu->addSeparator();

QMenu* beatjumpFwdSubmenu = addSubmenu(tr("Beat Jump / Loop Move Forward"), beatJumpMenu);
Expand Down
Loading

0 comments on commit f08b0f7

Please sign in to comment.