-
-
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
Effect parameter: briefly show value in parameter name widget #11032
Conversation
Nice idea. |
@@ -9,12 +9,17 @@ | |||
|
|||
namespace { | |||
const QString kMimeTextDelimiter = QStringLiteral("\n"); | |||
// for rounding the value display to N decimals | |||
const int kValDecimals = pow(10, 2); |
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.
Can this become a constexpr? If not use the result as constexpr to avoid runtime overload.
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.
meeh, pow() is not constexpr.
Instead of elaborate workarounds like
constexpr double kValDecimals() {
return pow(10, 2);
}
I'll go with constexpr int kValDecimals = 100;
} // anonymous namespace | ||
|
||
WEffectParameterNameBase::WEffectParameterNameBase( | ||
QWidget* pParent, EffectsManager* pEffectsManager) | ||
: WLabel(pParent), m_pEffectsManager(pEffectsManager) { | ||
setAcceptDrops(true); | ||
m_valDisplayTimer.setSingleShot(true); | ||
m_valDisplayTimer.setInterval(800); | ||
m_valDisplayTimer.callOnTimeout(this, &WEffectParameterNameBase::parameterUpdated); |
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 it is required to split parameterUpdated() to
parameterSlotUpdated() an showParameterName() or such.
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.
Maybe the connect part needs to be moved to setEffectParameterSlot() ... ?
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.
oh, I totally overlooked that when reviving this old branch.
callOnTimeout(this, [this]() {setText(m_text);})
is sufficient.
Additionally it would be nice to show the actual snapped value for quantized parameters like Echo time and Tremolo rate, but that's rather elaborate... |
0b9276e
to
53cb324
Compare
53cb324
to
d360922
Compare
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. It works good.
The only issue is that the number allow looks naked and gives in many cases not more info than the knob position on on its own. I think to unleash the power of this feature we need to make use of the units feature. We have already an unused unitsHint() function we may use and adjust.
I will file an issue and merge this now.
Here is the issue #11033 |
Ups, the duplicate connection issue was still there. Here is a fix: #11034 |
Use the parameter name label to show the parameter value for .8 seconds after it changed.
Rounded to two decimals fo now. Maybe rounding can be made dependent on the actual range.
closes #9022