-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[PreviewDeckN],LoadSelectedTrackAndPlay toggles play/pause if the track is already loaded #12920
Conversation
Good idea. |
src/mixer/playermanager.cpp
Outdated
} else if (isPreviewDeckGroup(group) && play) { | ||
// This extends/overrides the behaviour of [PreviewDeckN],LoadSelectedTrackAndPlay: | ||
// if the track is already loaded, toggle play/pause. | ||
auto pPlayer = getPlayer(group); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have pPlayer and the null check already above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
src/mixer/playermanager.cpp
Outdated
bool isPlaying = | ||
ControlObject::get(ConfigKey(group, QStringLiteral("play"))) > 0.0; | ||
ControlObject::set(ConfigKey(group, QStringLiteral("play")), | ||
isPlaying ? 0.0 : 1.0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid to look up the control object twice.
d81652e
to
7e557b9
Compare
The corresponding manual PR is mixxxdj/manual#625 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one minor.
Why is this still in n draft?
src/mixer/playermanager.cpp
Outdated
if (pTrack == pPlayer->getLoadedTrack()) { | ||
auto* pPlay = | ||
ControlObject::getControl(ConfigKey(group, QStringLiteral("play"))); | ||
double newPlay = pPlay->get() > 0.0 ? 0.0 : 1.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double newPlay = pPlay->get() > 0.0 ? 0.0 : 1.0; | |
double newPlay = pPlay->toBool() ? 0.0 : 1.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
I noticed a glitch in the keyboard sheet preview ( ✔️ seemst to be an issue with the GH preview) and I didn't check if this affects the Preview delegate ( ✔️ ). So this is ready to roll. |
I noticed an incosistency:
I think we should map the Play button right-click and Not going to fix this here, let's discuss it in #12925 |
… track is already loaded
2dbadd1
to
fcf43be
Compare
FWIW, with 2.4 I managed to get a mismatch of the preview deck's play button (not lit) and Preview delegate (lit). I continued clicking the delegate so I can't tell whether the deck was actually playing (shouldn't since the Play button CO is reliable IMO). |
The manual PR has been merged already, let's merge this, too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Thank you.
Fixes #9819
Due to limited unused hotkeys (in the default mapping) and to allow controlling the preview deck with a few hotkeys only I propose to extend/override the behaviour of
[PreviewDeckN], LoadSelectedTrackAndPlay
:if the track is already loaded, toggle play/pause.
This is mapped to
P
Shift
+P
doesstart_stop
(stop and seek to start) (could as well becue_gotoandstop
?)TODO