-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
suggest a fix for precision on knob dragging #3075
Conversation
Okay, this should work. Can someone look at this? |
If no one is against this, I'll merge this within the next hours. |
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 PR has introduced a bug where Reset
and Paste value
show the current value instead of what they should
switch( m_dataType ) | ||
{ | ||
case Float: return QString::number( castValue<float>( scaledValue( val ) ) ); | ||
case Float: return QString::number( castValue<float>( scaledValue( floatmodel->getRoundedValue() ) ) ); |
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.
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 to look into it. Thank you for the hint!
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, this is stupid. My intention was to fix the mixer bug ( 1.2345 % means 123,45 % ). I guess I revert this and search an other solution for this.
@@ -713,6 +714,23 @@ float AutomatableModel::globalAutomationValueAt( const MidiTime& time ) | |||
} | |||
} | |||
|
|||
float FloatModel::getRoundedValue() const | |||
{ | |||
return static_cast<float>( static_cast<int>( value() / step<float>() + 0.5 ) ) * step<float>(); |
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.
So this is causing a problem in the tripleoscillator coarse detune knobs:
The negative values are off by one.
And when you set it to zero
The actual value is -1 as you fixed this to use the true value in #3437
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, got a fix for that. Is there an issue filed for? @Umcaruje
Nope I just made this comment, never got around making an issue
On 1 Jun 2017 13:56, "Steffen Baranowsky" <notifications@github.com> wrote:
*@BaraMGB* commented on this pull request.
------------------------------
In src/core/AutomatableModel.cpp
<#3075 (comment)>:
@@ -713,6 +714,23 @@ float AutomatableModel::globalAutomationValueAt( const MidiTime& time )
}
}
+float FloatModel::getRoundedValue() const
+{
+ return static_cast<float>( static_cast<int>( value() / step<float>()
+ 0.5 ) ) * step<float>();
okay, got a fix for that. Is there an issue filed for? @Umcaruje
<https://github.com/umcaruje>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3075 (comment)>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AF_bPZhTJEuGCEy1bOB-p99m9gsrWDKgks5r_qbYgaJpZM4KVsk7>
.
|
int digits = 0; | ||
while ( steptemp < 1 ) | ||
{ | ||
steptemp = steptemp / 0.1f; |
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.
steptemp = steptemp * 10.0f; // easier to figure, and probably faster (but I guess the compiler already optimise it...)
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, I added this in this PR #3597.
* fixes precision on knob dragging * fixes precision on fader dragging * diaplay a rounded float on knobs * enter rounded value on fader * add getRoundedValue() and getDigitCount() to floatmodel * whitespace
fixes #3074 closed because it's a duplicate of:
fixes #3024
only for knobs at first.