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. |
grejppi
left a comment
There was a problem hiding this comment.
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.
I have to look into it. Thank you for the hint!
There was a problem hiding this comment.
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.
|
|
||
| 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.
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.
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.
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.
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.