-
-
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
ControlDoublePrivate: log warning before assert fails. #4236
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -148,11 +148,12 @@ QSharedPointer<ControlDoublePrivate> ControlDoublePrivate::getControl( | |
auto pControl = it.value().lock(); | ||
if (pControl) { | ||
// Control object already exists | ||
VERIFY_OR_DEBUG_ASSERT(!pCreatorCO) { | ||
if (pCreatorCO) { | ||
qWarning() | ||
<< "ControlObject" | ||
<< key.group << key.item | ||
<< "already created"; | ||
DEBUG_ASSERT(false); | ||
return nullptr; | ||
} | ||
return pControl; | ||
|
@@ -311,26 +312,29 @@ double ControlDoublePrivate::getParameterForValue(double value) const { | |
|
||
double ControlDoublePrivate::getParameterForMidi(double midiParam) const { | ||
QSharedPointer<ControlNumericBehavior> pBehavior = m_pBehavior; | ||
VERIFY_OR_DEBUG_ASSERT(pBehavior) { | ||
if (!pBehavior) { | ||
qWarning() << "Cannot set" << m_key << "by Midi"; | ||
DEBUG_ASSERT(false); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
return 0; | ||
} | ||
return pBehavior->midiToParameter(midiParam); | ||
} | ||
|
||
void ControlDoublePrivate::setValueFromMidi(MidiOpCode opcode, double midiParam) { | ||
QSharedPointer<ControlNumericBehavior> pBehavior = m_pBehavior; | ||
VERIFY_OR_DEBUG_ASSERT(pBehavior) { | ||
if (!pBehavior) { | ||
qWarning() << "Cannot set" << m_key << "by Midi"; | ||
DEBUG_ASSERT(false); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And here |
||
return; | ||
} | ||
pBehavior->setValueFromMidi(opcode, midiParam, this); | ||
} | ||
|
||
double ControlDoublePrivate::getMidiParameter() const { | ||
QSharedPointer<ControlNumericBehavior> pBehavior = m_pBehavior; | ||
VERIFY_OR_DEBUG_ASSERT(pBehavior) { | ||
if (!pBehavior) { | ||
qWarning() << "Cannot get" << m_key << "by Midi"; | ||
DEBUG_ASSERT(false); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And here |
||
return 0; | ||
} | ||
return pBehavior->valueToMidiParameter(get()); | ||
|
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.
The condition is out of sight here. Please use something like