Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add halve/double controls for beatjump size #4269

Merged
merged 1 commit into from
Sep 20, 2021

Conversation

ronso0
Copy link
Member

@ronso0 ronso0 commented Sep 7, 2021

Allows to change the beatjump size with keyboards.
beatjump_size_halve
beatjump_size_double

quick fix for a forum request.
https://mixxx.discourse.group/t/maintening-a-key-pressed-doesnt-have-any-effect/22977

@ronso0 ronso0 added the engine label Sep 7, 2021
@ronso0 ronso0 added this to In progress in 2.4 release via automation Sep 7, 2021
@ronso0 ronso0 moved this from In progress to Needs review in 2.4 release Sep 7, 2021
@ronso0
Copy link
Member Author

ronso0 commented Sep 7, 2021

If we consider the missing controls a bug (I tend to say yes) I would rebase onto 2.3

@ronso0
Copy link
Member Author

ronso0 commented Sep 8, 2021

Also, controller mappings now can use the controls directly and don't need to implement the halve/double logic themselves anymore.

@Holzhaus
Copy link
Member

Holzhaus commented Sep 8, 2021

If we consider the missing controls a bug (I tend to say yes) I would rebase onto 2.3

IMHO this really streches the definition of a bug. It's a feature.

@ronso0
Copy link
Member Author

ronso0 commented Sep 8, 2021

Alright, any comments on the code?

@@ -166,6 +166,18 @@ LoopingControl::LoopingControl(const QString& group,
this, &LoopingControl::slotBeatJump, Qt::DirectConnection);
m_pCOBeatJumpSize = new ControlObject(ConfigKey(group, "beatjump_size"),
true, false, false, 4.0);

m_pCOBeatJumpSizeHalve = new ControlPushButton(ConfigKey(group, "beatjump_size_halve"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The delete call is missing if you wish to match the existing code.
A better solution would be using a unique_ptr to manage the live-time

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for now, I added the delete call and a TODO for unique_ptr.

I could change all controls here to unique_ptr, though, how would I deal with the controls in lists like QList<BeatLoopingControl*> m_beatLoops;? They'd remain regular pointers, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QList does not support unique_ptr we may change to std::vector to work around this.

Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR. I have left some comments.

src/engine/controls/loopingcontrol.cpp Outdated Show resolved Hide resolved
Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you.

@daschuer daschuer merged commit 4ef9b6c into mixxxdj:main Sep 20, 2021
2.4 release automation moved this from Needs review to Done Sep 20, 2021
@ronso0 ronso0 deleted the beatjump-size-halvedouble branch September 20, 2021 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
2.4 release
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants