-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
AutoDJ: handle "enabled" CO change requests like clicks on the GUI button #11495
Conversation
I experience a stack overflow during due a recursive loop during testing:
|
The loop can be broken by m_pEnabledAutoDJ->setAndConfirm() inside AutoDJProcessor::toggleAutoDJ() maybe we also need to adjust the checks of the m_pEnabledAutoDJ->get(), because it returns now the confirmed value and not like before unconfirmed value. |
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.
.
Yep, I agree. I simply forgot to change |
7827453
to
c2e715c
Compare
The previous fix / hack with the signal sent to DlgAutoDJ and back to AutoDJPrcessor felt too much like a ahck so I tried to fix the root cause by emitting an error code signal (instead of return values). |
m_pEnabledAutoDJ->set(0.0); | ||
} | ||
qDebug() << "Queue is empty now, disable Auto DJ"; | ||
m_pEnabledAutoDJ->setAndConfirm(0.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.
I think we don't need these in the enable
anymore.
Didn't look close enough, yet, to be sure.
|
||
// TODO If there's a way to migrate the translations move this | ||
// to AutoDJProcessor in order to keep this class minimal | ||
void DlgAutoDJ::autoDJError(AutoDJProcessor::AutoDJError error) { |
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.
I have no experience with Transifex: is it smart enough to keep the existing translations?
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.
Yes, as long as the original string and the name of the surrounding QObject is not changed.
c2e715c
to
d717db0
Compare
switch (error) { | ||
case AutoDJProcessor::ADJ_NOT_TWO_DECKS: | ||
QMessageBox::warning(nullptr, | ||
tr("Auto DJ"), | ||
tr("Auto DJ requires two decks assigned to opposite sides of the crossfader."), | ||
QMessageBox::Ok); | ||
// Make sure the button becomes unpushed. | ||
pushButtonAutoDJ->setChecked(false); |
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.
here and below: obsolete, since AutoDJProcessor::autoDJStateChanged
signal >> DlgAutoDJ::autoDJStateChanged
updates the GUI
d717db0
to
7f50877
Compare
In the first run I didn't build the tests and didn't notice they require the return value. This is now unchanged and the error codes are emitted additionally after the new/unchanged AutoDJ state is emitted to update the GUI. The separate error handling also allows to show error messages in some yet uncovered situations. |
This allows to handle both clicks on the Enable GUI button and 'enabled' CO's change requests in the same place. Also, there's now a separate slot in DlgAutoDJ that receive error codes and pop up respective messages, which means any AutoDJProcessor method can warn the user.
7f50877
to
d9f9f68
Compare
@@ -625,7 +629,11 @@ void AutoDJProcessor::crossfaderChanged(double value) { | |||
} | |||
pToDeck->play(); | |||
} else { | |||
// TODO Is this also only possible if the user changed the | |||
// deck orientation? |
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.
This happens if the track in the To Deck has been ejected or shorter than 200 ms.
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.
Okay, I understood the above condition, and it seems 'eject' and a manually loaded, very short track could be the only cause, since IIUC tracks shorter than kMinimumTrackDurationSec
are skipped
mixxx/src/library/autodj/autodjprocessor.cpp
Lines 1223 to 1228 in 0d5b4a7
VERIFY_OR_DEBUG_ASSERT(toDeckDuration >= kMinimumTrackDurationSec) { | |
// Track has no duration or too short. This should not happen, because short | |
// tracks are skipped after load. | |
loadNextTrackFromQueue(*pToDeck, false); | |
return; | |
} |
If AutoDJ stops unexpectedly a popup would be helpful to notify users.
But if that happens after user interaction (eject) we don't need it IMO
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 and works good.
Can you please remove the question in the comment, once it is clarified?
d9f9f68
to
216a080
Compare
otherwise, if AutoDJ refuses to start because of unmet conditions, no error messages are shown and the CO remains in 'enabled' state.
Fixes #11494