fixed a bunch warnings and remarks issued by Intel Compiler

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1722 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-10-02 11:48:59 +00:00
parent e679f8c52f
commit fce25dc625
78 changed files with 426 additions and 390 deletions

View File

@@ -121,9 +121,9 @@ public:
protected:
// subclasses can re-implement this for being used in conjunction with
// processNextBuffer()
virtual void writeBuffer( const surroundSampleFrame * _ab,
const fpp_t _frames,
const float _master_gain )
virtual void writeBuffer( const surroundSampleFrame * /* _buf*/,
const fpp_t /*_frames*/,
const float /*_master_gain*/ )
{
}

View File

@@ -38,7 +38,7 @@
public: \
inline type getfunc( void ) const \
{ \
return( (type) modelname->value() ); \
return (type) modelname->value(); \
} \
public slots: \
inline void setfunc( const type _val ) \
@@ -50,12 +50,12 @@
public: \
inline type getfunc( void ) const \
{ \
return( (type) modelname.value() ); \
return (type) modelname.value(); \
} \
public slots: \
inline void setfunc( const type _val ) \
{ \
modelname.setValue( _val ); \
modelname.setValue( (float) _val ); \
}
@@ -79,7 +79,7 @@ public:
const float _max = 0,
const float _step = 0,
::model * _parent = NULL,
const QString & _display_name = QString::null,
const QString & _display_name = QString(),
bool _default_constructed = FALSE );
virtual ~automatableModel();
@@ -87,7 +87,7 @@ public:
static inline float copiedValue( void )
{
return( __copiedValue );
return __copiedValue;
}
bool isAutomated( void ) const;
@@ -101,32 +101,33 @@ public:
void setControllerConnection( controllerConnection * _c );
template<class T>
static inline T minEps( void )
{
return( 1 );
}
template<class T>
static inline T castValue( const float _v )
{
return( static_cast<T>( _v ) );
return (T)( _v );
}
template<bool>
static inline bool castValue( const float _v )
{
return ( qRound( _v ) != 0 );
}
template<class T>
inline T value( int _frameOffset = 0 ) const
{
if( m_controllerConnection != NULL )
if( unlikely( m_controllerConnection != NULL ) )
{
const T v = minValue<T>() +
castValue<T>( m_range *
m_controllerConnection->currentValue(
_frameOffset ) );
if( m_step == 1 )
if( typeInfo<float>::isEqual( m_step, 1 ) )
{
return( castValue<T>( roundf( v ) ) );
return castValue<T>( roundf( (float) v ) );
}
return( v );
return v;
}
return castValue<T>( m_value );
@@ -170,7 +171,7 @@ public:
inline float range( void ) const
{
return( m_range );
return m_range;
}
void setRange( const float _min, const float _max,
@@ -185,14 +186,14 @@ public:
virtual void saveSettings( QDomDocument & _doc,
QDomElement & _this,
const QString & _name = "value" );
const QString & _name = QString( "value" ) );
virtual void loadSettings( const QDomElement & _this,
const QString & _name = "value" );
const QString & _name = QString( "value" ) );
virtual QString nodeName( void ) const
{
return( "automatablemodel" );
return "automatablemodel";
}
void prepareJournalEntryFromOldVal( void );
@@ -204,14 +205,14 @@ public:
{
switch( m_dataType )
{
case Float: return( QString::number(
castValue<float>( _val ) ) );
case Integer: return( QString::number(
castValue<int>( _val ) ) );
case Bool: return( QString::number(
castValue<bool>( _val ) ) );
case Float: return QString::number(
castValue<float>( _val ) );
case Integer: return QString::number(
castValue<int>( _val ) );
case Bool: return QString::number(
castValue<bool>( _val ) );
}
return( "0" );
return "0";
}
@@ -221,6 +222,7 @@ public slots:
virtual void pasteValue( void );
void unlinkControllerConnection( void );
protected:
virtual void redoStep( journalEntry & _je );
virtual void undoStep( journalEntry & _je );
@@ -261,20 +263,23 @@ signals:
} ;
#define defaultTypedMethods(type) \
inline type value( int _frameOffset = 0 ) const \
{ \
return( automatableModel::value<type>( _frameOffset ) );\
return automatableModel::value<type>( _frameOffset ); \
} \
\
inline type minValue( void ) const \
{ \
return( automatableModel::minValue<type>() ); \
return automatableModel::minValue<type>(); \
} \
\
inline type maxValue( void ) const \
{ \
return( automatableModel::maxValue<type>() ); \
return automatableModel::maxValue<type>(); \
} \
@@ -285,7 +290,7 @@ class floatModel : public automatableModel
public:
floatModel( float _val = 0, float _min = 0, float _max = 0,
float _step = 0, ::model * _parent = NULL,
const QString & _display_name = QString::null,
const QString & _display_name = QString(),
bool _default_constructed = FALSE ) :
automatableModel( Float, _val, _min, _max, _step,
_parent, _display_name, _default_constructed )
@@ -302,7 +307,7 @@ class intModel : public automatableModel
public:
intModel( int _val = 0, int _min = 0, int _max = 0,
::model * _parent = NULL,
const QString & _display_name = QString::null,
const QString & _display_name = QString(),
bool _default_constructed = FALSE ) :
automatableModel( Integer, _val, _min, _max, 1,
_parent, _display_name, _default_constructed )
@@ -318,7 +323,7 @@ class boolModel : public automatableModel
{
public:
boolModel( const bool _val = FALSE, ::model * _parent = NULL,
const QString & _display_name = QString::null,
const QString & _display_name = QString(),
bool _default_constructed = FALSE ) :
automatableModel( Bool, _val, FALSE, TRUE, 1,
_parent, _display_name, _default_constructed )

View File

@@ -132,7 +132,7 @@ public: \
{ \
return( castModel<type##Model>() ); \
} \
} ;
}
generateTypedModelView(float);

View File

@@ -65,8 +65,8 @@ public:
inline void setFilterType( const int _idx )
{
m_double_filter = _idx >= SIMPLE_FLT_CNT;
if( !m_double_filter )
m_doubleFilter = _idx >= SIMPLE_FLT_CNT;
if( !m_doubleFilter )
{
m_type = static_cast<filterTypes>( _idx );
return;
@@ -88,8 +88,8 @@ public:
m_b2a0( 0.0f ),
m_a1a0( 0.0f ),
m_a2a0( 0.0f ),
m_double_filter( FALSE ),
m_sampleRate( _sample_rate ),
m_doubleFilter( false ),
m_sampleRate( (float) _sample_rate ),
m_subFilter( NULL )
{
clearHistory();
@@ -151,70 +151,6 @@ public:
m_y4[_chnl] * ( 1.0f / 6.0f );
break;
}
/* case MOOG2:
case DOUBLE_MOOG2:
{
const float x1 = ( _in0 - m_r *
m_oldx[_chnl] ) / MOOG_VOLTAGE;
const float tanh1 = tanhf( x1 );
const float x2 = m_oldy1[_chnl] / MOOG_VOLTAGE;
const float tanh2 = tanhf( x2 );
m_y1[_chnl] = m_oldy1[_chnl] + m_p *
( tanh1 - tanh2 );
m_oldy1[_chnl] = m_y1[_chnl];
m_y2[_chnl] = m_oldy2[_chnl] + m_p *
( tanhf( m_y1[_chnl] /
MOOG_VOLTAGE ) -
tanhf( m_oldy2[_chnl] /
MOOG_VOLTAGE ) );
m_oldy2[_chnl] = m_y2[_chnl];
m_y3[_chnl] = m_oldy3[_chnl] + m_p *
( tanhf( m_y2[_chnl] /
MOOG_VOLTAGE ) -
tanhf( m_oldy3[_chnl] /
MOOG_VOLTAGE ) );
m_oldy3[_chnl] = m_y3[_chnl];
m_y4[_chnl] = m_ou1[_chnl] + m_p *
( tanhf( m_y3[_chnl] /
MOOG_VOLTAGE ) -
tanhf( m_ou1[_chnl] /
MOOG_VOLTAGE ) );
m_ou1[_chnl] = m_y4[_chnl];
m_oldx[_chnl] = ( m_y4[_chnl] +
m_ou2[_chnl] ) * 0.5f;
m_ou2[_chnl] = m_y4[_chnl];
// the same code again...
m_y1[_chnl] = m_oldy1[_chnl] + m_p *
( tanh1 - tanh2 );
m_oldy1[_chnl] = m_y1[_chnl];
m_y2[_chnl] = m_oldy2[_chnl] + m_p *
( tanhf( m_y1[_chnl] /
MOOG_VOLTAGE ) -
tanhf( m_oldy2[_chnl] /
MOOG_VOLTAGE ) );
m_oldy2[_chnl] = m_y2[_chnl];
m_y3[_chnl] = m_oldy3[_chnl] + m_p *
( tanhf( m_y2[_chnl] /
MOOG_VOLTAGE ) -
tanhf( m_oldy3[_chnl] /
MOOG_VOLTAGE ) );
m_oldy3[_chnl] = m_y3[_chnl];
m_y4[_chnl] = m_ou1[_chnl] + m_p *
( tanhf( m_y3[_chnl] /
MOOG_VOLTAGE ) -
tanhf( m_ou1[_chnl] /
MOOG_VOLTAGE ) );
m_ou1[_chnl] = m_y4[_chnl];
m_oldx[_chnl] = ( m_y4[_chnl] +
m_ou2[_chnl] ) * 0.5f;
m_ou2[_chnl] = m_y4[_chnl];
out = m_oldx[_chnl];
break;
}*/
default:
// filter
@@ -233,7 +169,7 @@ public:
break;
}
if( m_double_filter )
if( m_doubleFilter )
{
return( m_subFilter->update( out, _chnl ) );
}
@@ -244,12 +180,12 @@ public:
inline void calcFilterCoeffs( float _freq, float _q
/*, const bool _q_is_bandwidth = FALSE*/ )
/*, const bool _q_is_bandwidth = false*/ )
{
// temp coef vars
_freq = tMax( _freq, 0.01f );// limit freq and q for not getting
_freq = qMax( _freq, 0.01f );// limit freq and q for not getting
// bad noise out of the filter...
_q = tMax( _q, minQ() );
_q = qMax( _q, minQ() );
if( m_type == MOOG )
{
@@ -260,7 +196,7 @@ public:
m_k = 2.0f * m_p - 1;
m_r = _q * powf( M_E, ( 1 - m_p ) * 1.386249f );
if( m_double_filter )
if( m_doubleFilter )
{
m_subFilter->m_r = m_r;
m_subFilter->m_p = m_p;
@@ -349,7 +285,7 @@ public:
break;
}
if( m_double_filter )
if( m_doubleFilter )
{
m_subFilter->m_b0a0 = m_b0a0;
m_subFilter->m_b1a0 = m_b1a0;
@@ -376,7 +312,7 @@ private:
frame m_y1, m_y2, m_y3, m_y4, m_oldx, m_oldy1, m_oldy2, m_oldy3;
filterTypes m_type;
bool m_double_filter;
bool m_doubleFilter;
float m_sampleRate;
basicFilters<CHANNELS> * m_subFilter;

View File

@@ -38,7 +38,7 @@ class comboBox : public QWidget, public intModelView
{
Q_OBJECT
public:
comboBox( QWidget * _parent, const QString & _name = QString::null );
comboBox( QWidget * _parent, const QString & _name = QString() );
virtual ~comboBox();
comboBoxModel * model( void )

View File

@@ -40,8 +40,8 @@ class comboBoxModel : public intModel
Q_OBJECT
public:
comboBoxModel( ::model * _parent = NULL,
const QString & _display_name = QString::null,
bool _default_constructed = FALSE ) :
const QString & _display_name = QString(),
bool _default_constructed = false ) :
intModel( 0, 0, 0, _parent, _display_name,
_default_constructed )
{

View File

@@ -95,12 +95,12 @@ public:
inline virtual effectControls * getControls( void )
{
return( &m_controls );
return &m_controls;
}
bool processAudioBuffer( sampleFrame * _buf, const fpp_t _frames )
bool processAudioBuffer( sampleFrame *, const fpp_t )
{
return( FALSE );
return false;
}

View File

@@ -196,7 +196,7 @@ private:
void resample( int _i, const sampleFrame * _src_buf,
sample_rate_t _src_sr,
sampleFrame * _dst_buf, sample_rate_t _dst_sr,
const fpp_t _frames );
const f_cnt_t _frames );
descriptor::subPluginFeatures::key m_key;

View File

@@ -215,7 +215,7 @@ namespace effectLib
template<typename SAMPLE>
inline SAMPLE saturate( const SAMPLE _x )
{
return( tMin<SAMPLE>( tMax<SAMPLE>( -1.0f, _x ), 1.0f ) );
return( qMin<SAMPLE>( qMax<SAMPLE>( -1.0f, _x ), 1.0f ) );
}
@@ -228,7 +228,7 @@ namespace effectLib
const SAMPLE _ratio,
const fastBassBoost<SAMPLE> & _orig =
fastBassBoost<SAMPLE>() ) :
m_frequency( tMax<SAMPLE>( _frequency, 10.0 ) ),
m_frequency( qMax<SAMPLE>( _frequency, 10.0 ) ),
m_gain1( 1.0 / ( m_frequency + 1.0 ) ),
m_gain2( _gain ),
m_ratio( _ratio ),

View File

@@ -80,7 +80,7 @@ protected:
return( m_file.read( _data, _len ) );
}
inline void ungetChar( int _ch )
inline void ungetChar( char _ch )
{
m_file.ungetChar( _ch );
}

View File

@@ -52,8 +52,10 @@ public:
inline bool hasAutomation( void ) const
{
return( m_autoPattern != NULL &&
m_autoPattern->getTimeMap()[0] != defaultValue() );
return m_autoPattern != NULL &&
!typeInfo<float>::isEqual(
m_autoPattern->getTimeMap()[0],
defaultValue() );
}
automationPattern * getAutomationPattern( void )

View File

@@ -59,8 +59,8 @@ public:
virtual void play( sampleFrame * _working_buffer );
// to be implemented by actual plugin
virtual void playNote( notePlayHandle * _note_to_play,
sampleFrame * _working_buf )
virtual void playNote( notePlayHandle * /* _note_to_play */,
sampleFrame * /* _working_buf */ )
{
}
@@ -82,28 +82,28 @@ public:
// release
virtual f_cnt_t desiredReleaseFrames( void ) const
{
return( 0 );
return 0;
}
// return false if instrument is not bendable
inline virtual bool isBendable( void ) const
{
return( true );
return true;
}
// return true if instruments reacts to MIDI events passed to
// handleMidiEvent() rather than playNote() & Co
inline virtual bool isMidiBased( void ) const
{
return( false );
return false;
}
// sub-classes can re-implement this for receiving all incoming
// MIDI-events
inline virtual bool handleMidiEvent( const midiEvent & _me,
const midiTime & _time )
inline virtual bool handleMidiEvent( const midiEvent &,
const midiTime & )
{
return( false );
return false;
}
virtual QString fullDisplayName( void ) const;
@@ -123,7 +123,7 @@ public:
protected:
inline instrumentTrack * getInstrumentTrack( void ) const
{
return( m_instrumentTrack );
return m_instrumentTrack;
}
// instruments may use this to apply a soft fade out at the end of
@@ -131,6 +131,7 @@ protected:
// desiredReleaseFrames() frames are left
void applyRelease( sampleFrame * buf, const notePlayHandle * _n );
private:
instrumentTrack * m_instrumentTrack;

View File

@@ -54,7 +54,7 @@ public:
} ;
f_cnt_t envFrames( const bool _only_vol = FALSE ) const;
f_cnt_t releaseFrames( const bool _only_vol = FALSE ) const;
f_cnt_t releaseFrames( void ) const;
float volumeLevel( notePlayHandle * _n, const f_cnt_t _frame );

View File

@@ -157,10 +157,10 @@ protected:
void addJournalEntry( const journalEntry & _je );
// to be implemented by sub-objects
virtual void undoStep( journalEntry & _je )
virtual void undoStep( journalEntry & )
{
}
virtual void redoStep( journalEntry & _je )
virtual void redoStep( journalEntry & )
{
}

View File

@@ -60,7 +60,7 @@ class EXPORT knob : public QWidget, public floatModelView
Q_PROPERTY(QColor outerColor READ outerColor WRITE setOuterColor)
mapPropertyFromModel(bool,isVolumeKnob,setVolumeKnob,m_volumeKnob);
public:
knob( int _knob_num, QWidget * _parent, const QString & _name = QString::null );
knob( int _knob_num, QWidget * _parent, const QString & _name = QString() );
virtual ~knob();
// TODO: remove
@@ -132,7 +132,7 @@ private:
inline float pageSize( void ) const
{
return( tMax<float>( ( model()->maxValue() -
return( qMax<float>( ( model()->maxValue() -
model()->minValue() ) / 100.0f,
modelUntyped()->step<float>() ) );
}

View File

@@ -63,7 +63,7 @@ public:
private:
ladspa2LMMS( void );
~ladspa2LMMS();
virtual ~ladspa2LMMS();
l_sortable_plugin_t m_instruments;
l_sortable_plugin_t m_validEffects;

View File

@@ -85,7 +85,7 @@ class EXPORT ladspaManager
public:
ladspaManager( void );
~ladspaManager();
virtual ~ladspaManager();
l_sortable_plugin_t getSortedPlugins();
ladspaManagerDescription * getDescription( const ladspa_key_t &

View File

@@ -122,27 +122,27 @@ struct midiEvent
inline Sint16 key( void ) const
{
return( m_data.m_param[0] );
return m_data.m_param[0];
}
inline Sint16 & key( void )
{
return( m_data.m_param[0] );
return m_data.m_param[0];
}
inline Sint16 velocity( void ) const
{
return( m_data.m_param[1] );
return m_data.m_param[1];
}
inline Sint16 & velocity( void )
{
return( m_data.m_param[1] );
return m_data.m_param[1];
}
inline volume getVolume( void ) const
{
return( velocity() * 100 / MidiMaxVelocity );
return (volume)( velocity() * 100 / MidiMaxVelocity );
}

View File

@@ -70,14 +70,14 @@ public:
inline midiTime & operator+=( const midiTime & _t )
{
return( *this = static_cast<int>( *this ) +
static_cast<int>( _t ) );
m_ticks += _t.m_ticks;
return *this;
}
inline midiTime & operator-=( const midiTime & _t )
{
return( *this = static_cast<int>( *this ) -
static_cast<int>( _t ) );
m_ticks -= _t.m_ticks;
return *this;
}
inline tact getTact( void ) const

View File

@@ -57,10 +57,10 @@ class audioPort;
const fpp_t DEFAULT_BUFFER_SIZE = 256;
const Uint8 BYTES_PER_SAMPLE = sizeof( sample_t );
const Uint8 BYTES_PER_INT_SAMPLE = sizeof( int_sample_t );
const Uint8 BYTES_PER_FRAME = sizeof( sampleFrame );
const Uint8 BYTES_PER_SURROUND_FRAME = sizeof( surroundSampleFrame );
const int BYTES_PER_SAMPLE = sizeof( sample_t );
const int BYTES_PER_INT_SAMPLE = sizeof( int_sample_t );
const int BYTES_PER_FRAME = sizeof( sampleFrame );
const int BYTES_PER_SURROUND_FRAME = sizeof( surroundSampleFrame );
const float OUTPUT_SAMPLE_MULTIPLIER = 32767.0f;
@@ -270,9 +270,9 @@ public:
}
inline Uint8 cpuLoad( void ) const
inline int cpuLoad( void ) const
{
return( m_cpuLoad );
return m_cpuLoad;
}
const qualitySettings & currentQualitySettings( void ) const
@@ -387,7 +387,7 @@ public:
return m_inputBuffer[ m_inputBufferRead ];
}
inline const f_cnt_t inputBufferFrames( void )
inline f_cnt_t inputBufferFrames( void ) const
{
return m_inputBufferFrames[ m_inputBufferRead ];
}
@@ -458,10 +458,10 @@ private:
surroundSampleFrame * m_writeBuf;
QVector<surroundSampleFrame *> m_bufferPool;
Uint8 m_readBuffer;
Uint8 m_writeBuffer;
Uint8 m_analBuffer;
Uint8 m_poolDepth;
int m_readBuffer;
int m_writeBuffer;
int m_analBuffer;
int m_poolDepth;
surroundSampleFrame m_maxClip;
surroundSampleFrame m_previousSample;
@@ -469,7 +469,7 @@ private:
bool m_oldBuffer[SURROUND_CHANNELS];
bool m_newBuffer[SURROUND_CHANNELS];
Uint8 m_cpuLoad;
int m_cpuLoad;
bool m_multiThreaded;
QVector<mixerWorkerThread *> m_workers;
int m_numWorkers;

View File

@@ -56,7 +56,7 @@ public:
bool _is_filename = TRUE,
bool _upgrade = TRUE );
multimediaProject( ProjectTypes _project_type );
~multimediaProject();
virtual ~multimediaProject();
QString nameWithExtension( const QString & _fn ) const;

View File

@@ -82,8 +82,8 @@ const float MaxDetuning = 4 * 12.0f;
class EXPORT note : public serializingObject
{
public:
note( const midiTime & _length = 0,
const midiTime & _pos = 0,
note( const midiTime & _length = midiTime( 0 ),
const midiTime & _pos = midiTime( 0 ),
int key = DefaultKey,
volume _volume = DefaultVolume,
panning _panning = DefaultPanning,
@@ -101,7 +101,8 @@ public:
inline midiTime endPos( void ) const
{
return( m_pos + m_length);
const int l = length();
return pos() + l;
}
inline const midiTime & length( void ) const
@@ -116,7 +117,8 @@ public:
inline midiTime pos( midiTime _base_pos ) const
{
return( m_pos - _base_pos );
const int bp = _base_pos;
return m_pos - bp;
}
inline int key( void ) const

View File

@@ -130,9 +130,9 @@ public:
f_cnt_t framesLeft( void ) const;
inline f_cnt_t framesLeftForCurrentPeriod( void ) const
inline fpp_t framesLeftForCurrentPeriod( void ) const
{
return( tMin<f_cnt_t>( framesLeft(),
return( (fpp_t) qMin<f_cnt_t>( framesLeft(),
engine::getMixer()->framesPerPeriod() ) );
}
@@ -239,7 +239,7 @@ public:
void processMidiTime( const midiTime & _time );
void resize( const bpm_t _new_tempo );
#if LMMS_SINGERBOT_SUPPORT
#ifdef LMMS_SINGERBOT_SUPPORT
int patternIndex( void )
{
return( m_patternIndex );
@@ -297,7 +297,7 @@ private:
// sub-note)
bool m_muted; // indicates whether note is muted
track * m_bbTrack; // related BB track
#if LMMS_SINGERBOT_SUPPORT
#ifdef LMMS_SINGERBOT_SUPPORT
int m_patternIndex; // position among relevant notes
#endif

View File

@@ -65,7 +65,7 @@ public:
SignalMix,
SynchronizedBySubOsc,
FrequencyModulation,
NumModulationAlgos,
NumModulationAlgos
} ;

View File

@@ -39,8 +39,9 @@ inline stereoVolumeVector panningToVolumeVector( panning _p,
float _scale = 1.0f )
{
stereoVolumeVector v = { { _scale, _scale } };
v.vol[_p >= PanningCenter ? 0 : 1] *= 1.0f - tAbs<float>( _p / 100.0f );
return( v );
const float pf = _p / 100.0f;
v.vol[_p >= PanningCenter ? 0 : 1] *= 1.0f - qAbs<float>( pf );
return v;
}
#endif

View File

@@ -77,7 +77,8 @@ public:
inline bool supportsFileType( const QString & _ext ) const
{
return( QString( supportedFileTypes ).
split( ',' ).contains( _ext ) );
split( QChar( ',' ) ).
contains( _ext ) );
}
class EXPORT subPluginFeatures
{
@@ -87,7 +88,7 @@ public:
typedef QMap<QString, QString> attributeMap;
inline key( plugin::descriptor * _desc = NULL,
const QString & _name = QString::null,
const QString & _name = QString(),
const attributeMap & _am =
attributeMap() )
:
@@ -151,9 +152,9 @@ public:
// returns display-name out of descriptor
virtual QString displayName( void ) const
{
return( model::displayName() != QString::null ?
model::displayName() :
m_descriptor->displayName );
return( model::displayName().isNull() ?
m_descriptor->displayName :
model::displayName() );
}
// return plugin-type

View File

@@ -237,7 +237,7 @@ public:
// do we act as master (i.e. not as remote-process?)
inline bool isMaster( void ) const
{
return( m_master );
return m_master;
}
// recursive lock
@@ -294,7 +294,7 @@ public:
{
int32_t i;
read( &i, sizeof( i ) );
return( i );
return i;
}
inline void writeInt( const int32_t & _i )
@@ -312,7 +312,7 @@ public:
sc[len] = 0;
std::string s( sc );
delete[] sc;
return( s );
return s;
}
return std::string();
}
@@ -332,18 +332,18 @@ public:
lock();
const bool empty = ( m_data->startPtr == m_data->endPtr );
unlock();
return( !empty );
return !empty;
#else
int v;
sem_getvalue( m_messageSem, &v );
return( v > 0 );
return v > 0;
#endif
}
inline int shmKey( void ) const
{
return( m_shmKey );
return m_shmKey;
}
@@ -484,7 +484,7 @@ public:
inline message & addString( const std::string & _s )
{
data.push_back( _s );
return( *this );
return *this;
}
message & addInt( int _i )
@@ -493,7 +493,7 @@ public:
buf[0] = 0;
sprintf( buf, "%d", _i );
data.push_back( std::string( buf ) );
return( *this );
return *this;
}
message & addFloat( float _f )
@@ -502,29 +502,29 @@ public:
buf[0] = 0;
sprintf( buf, "%f", _f );
data.push_back( std::string( buf ) );
return( *this );
return *this;
}
inline std::string getString( int _p = 0 ) const
{
return( data[_p] );
return data[_p];
}
#ifndef BUILD_REMOTE_PLUGIN_CLIENT
inline QString getQString( int _p = 0 ) const
{
return( QString::fromStdString( getString( _p ) ) );
return QString::fromStdString( getString( _p ) );
}
#endif
inline int getInt( int _p = 0 ) const
{
return( atoi( data[_p].c_str() ) );
return atoi( data[_p].c_str() );
}
inline float getFloat( int _p ) const
{
return( atof( data[_p].c_str() ) );
return (float) atof( data[_p].c_str() );
}
inline bool operator==( const message & _m ) const
@@ -549,7 +549,7 @@ public:
inline bool messagesLeft( void )
{
return( m_in->messagesLeft() );
return m_in->messagesLeft();
}
@@ -577,12 +577,12 @@ public:
protected:
const shmFifo * in( void ) const
{
return( m_in );
return m_in;
}
const shmFifo * out( void ) const
{
return( m_out );
return m_out;
}
@@ -637,7 +637,7 @@ public:
inline bool failed( void ) const
{
return( m_failed );
return m_failed;
}
@@ -705,7 +705,7 @@ public:
inline float * sharedMemory( void )
{
return( m_shm );
return m_shm;
}
virtual void updateSampleRate( void )
@@ -718,12 +718,12 @@ public:
inline sample_rate_t sampleRate( void ) const
{
return( m_sampleRate );
return m_sampleRate;
}
inline fpp_t bufferSize( void ) const
{
return( m_bufferSize );
return m_bufferSize;
}
void setInputCount( int _i )
@@ -740,12 +740,12 @@ public:
virtual int inputCount( void ) const
{
return( m_inputCount );
return m_inputCount;
}
virtual int outputCount( void ) const
{
return( m_outputCount );
return m_outputCount;
}
@@ -832,7 +832,7 @@ remotePluginBase::message remotePluginBase::receiveMessage( void )
m.data.push_back( m_in->readString() );
}
m_in->unlock();
return( m );
return m;
}
@@ -856,11 +856,11 @@ remotePluginBase::message remotePluginBase::waitForMessage(
processMessage( m );
if( m.id == _wm.id )
{
return( m );
return m;
}
else if( m.id == IdGeneralFailure )
{
return( m );
return m;
}
}
}
@@ -913,7 +913,7 @@ bool remotePluginClient::processMessage( const message & _m )
switch( _m.id )
{
case IdGeneralFailure:
return( false );
return false;
case IdSampleRateInformation:
m_sampleRate = _m.getInt();
@@ -926,7 +926,7 @@ bool remotePluginClient::processMessage( const message & _m )
break;
case IdQuit:
return( false );
return false;
case IdMidiEvent:
processMidiEvent(
@@ -962,7 +962,7 @@ bool remotePluginClient::processMessage( const message & _m )
sendMessage( reply_message );
}
return( true );
return true;
}

View File

@@ -66,7 +66,7 @@ public:
// constructor which either loads sample _audio_file or decodes
// base64-data out of string
sampleBuffer( const QString & _audio_file = "",
sampleBuffer( const QString & _audio_file = QString(),
bool _is_base64_data = FALSE );
sampleBuffer( const sampleFrame * _data, const f_cnt_t _frames );
sampleBuffer( const f_cnt_t _frames );

View File

@@ -56,9 +56,9 @@ public:
private:
virtual void writeBuffer( const sampleFrame * _ab,
const fpp_t _frames );
const f_cnt_t _frames );
typedef QList<QPair<sampleFrame *, fpp_t> > bufferList;
typedef QList<QPair<sampleFrame *, f_cnt_t> > bufferList;
bufferList m_buffers;
f_cnt_t m_framesRecorded;
midiTime m_minLength;

View File

@@ -40,6 +40,10 @@ public:
{
}
virtual ~sharedObject()
{
}
template<class T>
static T * ref( T * _object )
{

View File

@@ -1,7 +1,7 @@
/*
* templates.h - miscellanous templates and algorithms
*
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -30,46 +30,9 @@
template<class T>
inline T tAbs( const T & x )
inline T tLimit( const T x, const T x1, const T x2 )
{
return( x < static_cast<T>( 0 ) ? -x : x );
}
template<class T>
inline T tMin( const T & x1, const T & x2 )
{
if( x1 < x2 )
{
return( x1 );
}
return( x2 );
}
template<class T>
inline T tMax( const T & x1, const T & x2 )
{
if( x1 > x2 )
{
return( x1 );
}
return( x2 );
}
template<class T>
inline T tLimit( const T & x, const T & x1, const T & x2 )
{
return( tMin<T>( tMax<T>( x, tMin<T>( x1, x2 ) ),
tMax<T>( x1, x2 ) ) );
return qBound( x1, x, x2 );
}

View File

@@ -59,7 +59,7 @@ public:
tempoSyncKnobModel( const float _val, const float _min,
const float _max, const float _step,
const float _scale, ::model * _parent,
const QString & _display_name = QString::null );
const QString & _display_name = QString() );
virtual ~tempoSyncKnobModel();
virtual void saveSettings( QDomDocument & _doc,
@@ -112,7 +112,7 @@ class EXPORT tempoSyncKnob : public knob
Q_OBJECT
public:
tempoSyncKnob( int _knob_num, QWidget * _parent,
const QString & _name = QString::null );
const QString & _name = QString() );
virtual ~tempoSyncKnob();
const QString & getSyncDescription( void );

View File

@@ -97,7 +97,8 @@ public:
inline midiTime endPosition( void ) const
{
return( m_startPosition + m_length );
const int sp = m_startPosition;
return sp + m_length;
}
inline const midiTime & length( void ) const
@@ -247,7 +248,7 @@ public:
public slots:
void update( void );
void changePosition( const midiTime & _new_pos = -1 );
void changePosition( const midiTime & _new_pos = midiTime( -1 ) );
protected:

View File

@@ -27,6 +27,7 @@
#define _TYPES_H
#include <limits>
#include "lmmsconfig.h"
typedef unsigned char Uint8;
@@ -61,23 +62,53 @@ typedef Uint32 jo_id_t; // (unique) ID of a journalling object
template<typename T>
struct valueRanges
struct typeInfo
{
static inline T min( void )
{
return( std::numeric_limits<T>::min() );
return std::numeric_limits<T>::min();
}
static inline T max( void )
{
return( std::numeric_limits<T>::max() );
return std::numeric_limits<T>::max();
}
static inline T minEps( void )
{
return 1;
}
static inline bool isEqual( T _x, T _y )
{
return _x == _y;
}
static inline T absVal( T t )
{
return t >= 0 ? t : -t;
}
} ;
template<>
inline float typeInfo<float>::minEps( void )
{
return 1.0e-10;
}
template<>
inline bool typeInfo<float>::isEqual( float _x, float _y )
{
return absVal( _x - _y ) < minEps();
}
const ch_cnt_t DEFAULT_CHANNELS = 2;
const ch_cnt_t SURROUND_CHANNELS =
#define LMMS_DISABLE_SURROUND
#ifndef LMMS_DISABLE_SURROUND
4;
#else
@@ -90,4 +121,8 @@ typedef sample_t sampleFrame[DEFAULT_CHANNELS];
typedef sample_t surroundSampleFrame[SURROUND_CHANNELS];
// use for improved branch prediction
#define likely(x) __builtin_expect((x),1)
#define unlikely(x) __builtin_expect((x),0)
#endif