From 4dece979c6a4cd65773b5b92223cd359853be488 Mon Sep 17 00:00:00 2001 From: Vesa Date: Wed, 23 Apr 2014 19:12:21 +0300 Subject: [PATCH] Samplebuffer/AFP: coding style, remove redundant inlines --- include/SampleBuffer.h | 16 +++++++-------- .../audio_file_processor.cpp | 20 +++++++++---------- .../audio_file_processor.h | 2 +- src/core/SampleBuffer.cpp | 8 ++++---- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/include/SampleBuffer.h b/include/SampleBuffer.h index dcc4d7499..e0b5fff0f 100644 --- a/include/SampleBuffer.h +++ b/include/SampleBuffer.h @@ -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; diff --git a/plugins/audio_file_processor/audio_file_processor.cpp b/plugins/audio_file_processor/audio_file_processor.cpp index d965d6148..726665811 100644 --- a/plugins/audio_file_processor/audio_file_processor.cpp +++ b/plugins/audio_file_processor/audio_file_processor.cpp @@ -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(); } diff --git a/plugins/audio_file_processor/audio_file_processor.h b/plugins/audio_file_processor/audio_file_processor.h index f795620f6..a29ac51a0 100644 --- a/plugins/audio_file_processor/audio_file_processor.h +++ b/plugins/audio_file_processor/audio_file_processor.h @@ -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; diff --git a/src/core/SampleBuffer.cpp b/src/core/SampleBuffer.cpp index ba86c1443..0ad1dd501 100644 --- a/src/core/SampleBuffer.cpp +++ b/src/core/SampleBuffer.cpp @@ -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" ); }