Watsyn: use fast sinc instead of medium quality (not much diff in this case), increase oversampling to 32 because why not

Graph: optimize graph widget codepaths so that we don't send redundant samplesChanged signals, which in watsyn cause recalculation of the wavetable
This commit is contained in:
Vesa
2014-04-14 14:15:08 +03:00
parent 79120eb0b1
commit 49d05f466d
4 changed files with 38 additions and 29 deletions

View File

@@ -221,8 +221,11 @@ void graph::drawLineAt( int _x, int _y, int _lastx )
for ( int i = 0; i < linelen; i++ )
{
int x = (_x + (i * xstep)); // get x value
model()->setSampleAt( (int)( x * xscale ), val + (i * ystep));
model()->drawSampleAt( (int)( x * xscale ), val + (i * ystep));
}
int start = qMin( _x, _x + ( ( linelen - 1 ) * xstep ) );
int end = qMax( _x, _x + ( ( linelen - 1 ) * xstep ) );
model()->samplesChanged( start, end );
}
void graph::changeSampleAt( int _x, int _y )
@@ -488,18 +491,10 @@ void graphModel::setLength( int _length )
void graphModel::setSampleAt( int _x, float _val )
void graphModel::setSampleAt( int x, float val )
{
//snap to the grid
_val -= ( m_step != 0.0 ) ? fmod( _val, m_step ) * m_step : 0;
// boundary crop
_x = qMax( 0, qMin( length()-1, _x ) );
_val = qMax( minValue(), qMin( maxValue(), _val ) );
// change sample shape
m_samples[_x] = _val;
emit samplesChanged( _x, _x );
drawSampleAt( x, val );
emit samplesChanged( x, x );
}
@@ -690,4 +685,20 @@ void graphModel::shiftPhase( int _deg )
void graphModel::drawSampleAt( int x, float val )
{
//snap to the grid
val -= ( m_step != 0.0 ) ? fmod( val, m_step ) * m_step : 0;
// boundary crop
x = qMax( 0, qMin( length()-1, x ) );
val = qMax( minValue(), qMin( maxValue(), val ) );
// change sample shape
m_samples[x] = val;
}
#include "moc_graph.cxx"