Skip to content

Commit

Permalink
Merge pull request #12104 from ronso0/tap-rate-button
Browse files Browse the repository at this point in the history
add Rate Tap button
  • Loading branch information
daschuer authored May 20, 2024
2 parents 0b9557a + 0b4950d commit 5286fa2
Show file tree
Hide file tree
Showing 8 changed files with 222 additions and 140 deletions.
8 changes: 5 additions & 3 deletions res/skins/Deere/deck_text_row.xml
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
</Template>

<PushButton>
<TooltipId>bpm_tap</TooltipId>
<TooltipId>tempo_tap_bpm_tap</TooltipId>
<MinimumSize>30,20</MinimumSize>
<MaximumSize>60,30</MaximumSize>
<SizePolicy>me,me</SizePolicy>
Expand All @@ -267,10 +267,12 @@
<Number>0</Number>
<Text>TAP</Text>
</State>
<Connection>
<ConfigKey><Variable name="group"/>,tempo_tap</ConfigKey>
</Connection>
<Connection>
<ConfigKey><Variable name="group"/>,bpm_tap</ConfigKey>
<EmitOnPressAndRelease>true</EmitOnPressAndRelease>
<ButtonState>LeftButton</ButtonState>
<ButtonState>RightButton</ButtonState>
</Connection>
</PushButton>
</Children>
Expand Down
9 changes: 6 additions & 3 deletions res/skins/LateNight/decks/rate_controls.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,18 @@
<Layout>stacked</Layout>
<Size>57f,-1me</Size>
<Children>
<!-- In order to make the bpm display tappable, we use an old-style
widget group and put the bpm pushbutton on top of the display. -->
<!-- invisible Tempo/BPM tap button on top of BPM display -->
<PushButton>
<TooltipId>bpm_tap_visual_bpm</TooltipId>
<TooltipId>tempo_tap_bpm_tap_visual_bpm</TooltipId>
<ObjectName>BpmTap</ObjectName>
<Size>57f,-1me</Size>
<NumberStates>1</NumberStates>
<Connection>
<ConfigKey><Variable name="Group"/>,tempo_tap</ConfigKey>
</Connection>
<Connection>
<ConfigKey><Variable name="Group"/>,bpm_tap</ConfigKey>
<ButtonState>RightButton</ButtonState>
</Connection>
</PushButton>
<WidgetGroup><!-- BPM + rate -->
Expand Down
16 changes: 9 additions & 7 deletions res/skins/LateNight/decks/rate_controls_compact.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,19 @@
<Layout>stacked</Layout>
<Size>60f,40f</Size>
<Children>
<!-- In order to make the bpm display tappable, we use an old-style
widget group and put the bpm pushbutton on top of the display. -->
<!-- invisible Tempo/BPM tap button on top of BPM display -->
<PushButton>
<TooltipId>bpm_tap_visual_bpm</TooltipId>
<TooltipId>tempo_tap_bpm_tap_visual_bpm</TooltipId>
<ObjectName>BpmTap</ObjectName>
<SizePolicy>me,me</SizePolicy>
<NumberStates>1</NumberStates>
<Connection>
<ConfigKey><Variable name="Group"/>,bpm_tap</ConfigKey>
<EmitOnPressAndRelease>true</EmitOnPressAndRelease>
</Connection>
<Connection>
<ConfigKey><Variable name="Group"/>,tempo_tap</ConfigKey>
</Connection>
<Connection>
<ConfigKey><Variable name="Group"/>,bpm_tap</ConfigKey>
<ButtonState>RightButton</ButtonState>
</Connection>
</PushButton>
<WidgetGroup><!-- BPM + rate -->
<ObjectName>AlignCenter</ObjectName>
Expand Down
15 changes: 6 additions & 9 deletions res/skins/Shade/sampler.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
<WidgetGroup>
<Size>35f,24f</Size>
<Children>
<!-- invisible Tempo/BPM tap button on top of BPM display -->
<Number>
<TooltipId>visual_bpm</TooltipId>
<Style>QLabel {
Expand All @@ -77,25 +78,21 @@
<ConfigKey><Variable name="group"/>,visual_bpm</ConfigKey>
</Connection>
</Number>
<!-- Little trickery here:
BPM tap is transparent png directly over BPM display, so it became BPM and TAP at once,
changed tooltip accordingly
-->
<PushButton>
<!-- Original:
<TooltipId>bpm_tap</TooltipId>
-->
<TooltipId>bpm_tap_visual_bpm</TooltipId>
<TooltipId>tempo_tap_bpm_tap_visual_bpm</TooltipId>
<Pos>0,5</Pos>
<NumberStates>1</NumberStates>
<State>
<Number>0</Number>
<Pressed>skin:/btn/btn_tap_sampler_over.png</Pressed>
<Unpressed>skin:/btn/btn_tap_sampler.png</Unpressed>
</State>
<Connection>
<ConfigKey><Variable name="group"/>,tempo_tap</ConfigKey>
</Connection>
<Connection>
<ConfigKey><Variable name="group"/>,bpm_tap</ConfigKey>
<EmitOnPressAndRelease>true</EmitOnPressAndRelease>
<ButtonState>RightButton</ButtonState>
</Connection>
</PushButton>
</Children>
Expand Down
14 changes: 10 additions & 4 deletions src/controllers/controlpickermenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,7 @@ ControlPickerMenu::ControlPickerMenu(QWidget* pParent)
tr("BPM -0.1"),
tr("Decrease BPM by 0.1"),
pBpmMenu);
addDeckAndSamplerControl("bpm_tap",
tr("BPM Tap"),
tr("BPM tap button"),
pBpmMenu);
pBpmMenu->addSeparator();
addDeckAndSamplerControl("beats_set_halve",
tr("Halve BPM"),
tr("Multiply current BPM by 0.5"),
Expand All @@ -287,6 +284,15 @@ ControlPickerMenu::ControlPickerMenu(QWidget* pParent)
tr("Multiply current BPM by 2"),
pBpmMenu);
pBpmMenu->addSeparator();
addDeckAndSamplerControl("bpm_tap",
tr("BPM Tap"),
tr("BPM tap button"),
pBpmMenu);
addDeckAndSamplerControl("tempo_tap",
tr("Tempo Tap"),
tr("Tempo tap button"),
pBpmMenu);
pBpmMenu->addSeparator();
addDeckAndSamplerControl("beats_adjust_faster",
tr("Adjust Beatgrid Faster +.01"),
tr("Increase track's average BPM by 0.01"),
Expand Down
Loading

0 comments on commit 5286fa2

Please sign in to comment.