Merge pull request #635 from diizy/master

Samplebuffer/AFP: coding style, remove redundant inlines
This commit is contained in:
Tobias Doerffel
2014-04-23 21:24:49 +02:00
4 changed files with 23 additions and 23 deletions

View File

@@ -60,32 +60,32 @@ public:
class EXPORT handleState
{
public:
handleState( bool _varying_pitch = false, int interp_mode = SRC_LINEAR );
handleState( bool _varying_pitch = false, int interpolation_mode = SRC_LINEAR );
virtual ~handleState();
inline const f_cnt_t frameIndex() const
const f_cnt_t frameIndex() const
{
return m_frameIndex;
}
inline void setFrameIndex( f_cnt_t _index )
void setFrameIndex( f_cnt_t _index )
{
m_frameIndex = _index;
}
inline bool isBackwards() const
bool isBackwards() const
{
return m_isBackwards;
}
inline void setBackwards( bool _backwards )
void setBackwards( bool _backwards )
{
m_isBackwards = _backwards;
}
inline int interpMode() const
int interpolationMode() const
{
return m_interpMode;
return m_interpolationMode;
}
@@ -94,7 +94,7 @@ public:
const bool m_varyingPitch;
bool m_isBackwards;
SRC_STATE * m_resamplingData;
int m_interpMode;
int m_interpolationMode;
friend class SampleBuffer;

View File

@@ -79,7 +79,7 @@ audioFileProcessor::audioFileProcessor( InstrumentTrack * _instrument_track ) :
m_reverseModel( false, this, tr( "Reverse sample" ) ),
m_loopModel( 0, 0, 2, this, tr( "Loop mode" ) ),
m_stutterModel( false, this, tr( "Stutter" ) ),
m_interpModel( this, tr( "Interpolation mode" ) ),
m_interpolationModel( this, tr( "Interpolation mode" ) ),
m_nextPlayStartPoint( 0 ),
m_nextPlayBackwards( false )
{
@@ -97,10 +97,10 @@ audioFileProcessor::audioFileProcessor( InstrumentTrack * _instrument_track ) :
this, SLOT( stutterModelChanged() ) );
//interpolation modes
m_interpModel.addItem( tr( "None" ) );
m_interpModel.addItem( tr( "Linear" ) );
m_interpModel.addItem( tr( "Sinc" ) );
m_interpModel.setValue( 1 );
m_interpolationModel.addItem( tr( "None" ) );
m_interpolationModel.addItem( tr( "Linear" ) );
m_interpolationModel.addItem( tr( "Sinc" ) );
m_interpolationModel.setValue( 1 );
loopPointChanged();
}
@@ -141,7 +141,7 @@ void audioFileProcessor::playNote( NotePlayHandle * _n,
}
// set interpolation mode for libsamplerate
int srcmode = SRC_LINEAR;
switch( m_interpModel.value() )
switch( m_interpolationModel.value() )
{
case 0:
srcmode = SRC_ZERO_ORDER_HOLD;
@@ -220,7 +220,7 @@ void audioFileProcessor::saveSettings( QDomDocument & _doc,
m_endPointModel.saveSettings( _doc, _this, "eframe" );
m_loopPointModel.saveSettings( _doc, _this, "lframe" );
m_stutterModel.saveSettings( _doc, _this, "stutter" );
m_interpModel.saveSettings( _doc, _this, "interp" );
m_interpolationModel.saveSettings( _doc, _this, "interp" );
}
@@ -259,11 +259,11 @@ void audioFileProcessor::loadSettings( const QDomElement & _this )
m_stutterModel.loadSettings( _this, "stutter" );
if( _this.hasAttribute( "interp" ) )
{
m_interpModel.loadSettings( _this, "interp" );
m_interpolationModel.loadSettings( _this, "interp" );
}
else
{
m_interpModel.setValue( 1 ); //linear by default
m_interpolationModel.setValue( 1 ); //linear by default
}
loopPointChanged();
@@ -692,7 +692,7 @@ void AudioFileProcessorView::modelChanged( void )
m_reverseButton->setModel( &a->m_reverseModel );
m_loopGroup->setModel( &a->m_loopModel );
m_stutterButton->setModel( &a->m_stutterModel );
m_interpBox->setModel( &a->m_interpModel );
m_interpBox->setModel( &a->m_interpolationModel );
sampleUpdated();
}

View File

@@ -94,7 +94,7 @@ private:
BoolModel m_reverseModel;
IntModel m_loopModel;
BoolModel m_stutterModel;
ComboBoxModel m_interpModel;
ComboBoxModel m_interpolationModel;
f_cnt_t m_nextPlayStartPoint;
bool m_nextPlayBackwards;

View File

@@ -663,7 +663,7 @@ bool SampleBuffer::play( sampleFrame * _ab, handleState * _state,
{
SRC_DATA src_data;
// Generate output
f_cnt_t fragment_size = (f_cnt_t)( _frames * freq_factor ) + MARGIN[ _state->interpMode() ];
f_cnt_t fragment_size = (f_cnt_t)( _frames * freq_factor ) + MARGIN[ _state->interpolationMode() ];
src_data.data_in =
getSampleFragment( play_frame, fragment_size, _loopmode, &tmp, &is_backwards,
loopStartFrame, loopEndFrame, endFrame )[0];
@@ -1438,15 +1438,15 @@ QString SampleBuffer::tryToMakeAbsolute( const QString & _file )
SampleBuffer::handleState::handleState( bool _varying_pitch, int interp_mode ) :
SampleBuffer::handleState::handleState( bool _varying_pitch, int interpolation_mode ) :
m_frameIndex( 0 ),
m_varyingPitch( _varying_pitch ),
m_isBackwards( false )
{
int error;
m_interpMode = interp_mode;
m_interpolationMode = interpolation_mode;
if( ( m_resamplingData = src_new( interp_mode, DEFAULT_CHANNELS, &error ) ) == NULL )
if( ( m_resamplingData = src_new( interpolation_mode, DEFAULT_CHANNELS, &error ) ) == NULL )
{
qDebug( "Error: src_new() failed in sample_buffer.cpp!\n" );
}