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:
91
ChangeLog
91
ChangeLog
@@ -1,3 +1,94 @@
|
||||
2008-10-02 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* buildtools/bin2res.cpp:
|
||||
* include/mmp.h:
|
||||
* include/knob.h:
|
||||
* include/effect.h:
|
||||
* include/templates.h:
|
||||
* include/track.h:
|
||||
* include/note.h:
|
||||
* include/automatable_model.h:
|
||||
* include/import_filter.h:
|
||||
* include/mixer.h:
|
||||
* include/combobox_model.h:
|
||||
* include/ladspa_manager.h:
|
||||
* include/instrument.h:
|
||||
* include/sample_buffer.h:
|
||||
* include/midi.h:
|
||||
* include/effect_lib.h:
|
||||
* include/sample_record_handle.h:
|
||||
* include/shared_object.h:
|
||||
* include/plugin.h:
|
||||
* include/note_play_handle.h:
|
||||
* include/instrument_sound_shaping.h:
|
||||
* include/oscillator.h:
|
||||
* include/tempo_sync_knob.h:
|
||||
* include/midi_time.h:
|
||||
* include/remote_plugin.h:
|
||||
* include/basic_filters.h:
|
||||
* include/journalling_object.h:
|
||||
* include/types.h:
|
||||
* include/dummy_effect.h:
|
||||
* include/automatable_model_view.h:
|
||||
* include/inline_automation.h:
|
||||
* include/audio_device.h:
|
||||
* include/panning.h:
|
||||
* include/combobox.h:
|
||||
* include/ladspa_2_lmms.h:
|
||||
* src/core/preset_preview_play_handle.cpp:
|
||||
* src/core/note_play_handle.cpp:
|
||||
* src/core/song.cpp:
|
||||
* src/core/serializing_object.cpp:
|
||||
* src/core/bb_track_container.cpp:
|
||||
* src/core/remote_plugin.cpp:
|
||||
* src/core/journalling_object.cpp:
|
||||
* src/core/automatable_model.cpp:
|
||||
* src/core/audio/audio_alsa.cpp:
|
||||
* src/core/audio/audio_sdl.cpp:
|
||||
* src/core/audio/audio_portaudio.cpp:
|
||||
* src/core/audio/audio_jack.cpp:
|
||||
* src/core/main.cpp:
|
||||
* src/core/instrument_sound_shaping.cpp:
|
||||
* src/core/effect.cpp:
|
||||
* src/core/instrument_functions.cpp:
|
||||
* src/core/controller_connection.cpp:
|
||||
* src/core/track.cpp:
|
||||
* src/core/engine.cpp:
|
||||
* src/core/piano.cpp:
|
||||
* src/core/timeline.cpp:
|
||||
* src/core/instrument.cpp:
|
||||
* src/core/surround_area.cpp:
|
||||
* src/core/sample_buffer.cpp:
|
||||
* src/core/oscillator.cpp:
|
||||
* src/core/automation_pattern.cpp:
|
||||
* src/core/lfo_controller.cpp:
|
||||
* src/core/sample_record_handle.cpp:
|
||||
* src/gui/piano_roll.cpp:
|
||||
* src/gui/plugin_browser.cpp:
|
||||
* src/gui/main_window.cpp:
|
||||
* src/gui/song_editor.cpp:
|
||||
* src/gui/widgets/kmultitabbar.cpp:
|
||||
* src/gui/widgets/knob.cpp:
|
||||
* src/gui/widgets/lcd_spinbox.cpp:
|
||||
* src/gui/automation_editor.cpp:
|
||||
* src/tracks/sample_track.cpp:
|
||||
* src/tracks/bb_track.cpp:
|
||||
* src/tracks/instrument_track.cpp:
|
||||
* src/tracks/pattern.cpp:
|
||||
* plugins/ladspa_effect/tap/CMakeLists.txt:
|
||||
* plugins/audio_file_processor/audio_file_processor.cpp:
|
||||
fixed a bunch warnings and remarks issued by Intel Compiler
|
||||
|
||||
* include/fx_mixer.h:
|
||||
* src/core/fx_mixer.cpp:
|
||||
* src/core/mixer.cpp:
|
||||
- use one static jobqueue for not getting problems with cached pointers
|
||||
- check for job being NULL
|
||||
- improved performance of master mix
|
||||
|
||||
* CMakeLists.txt:
|
||||
allow overriding compiler flags
|
||||
|
||||
2008-09-30 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* plugins/sid/sid_instrument.h:
|
||||
|
||||
@@ -61,7 +61,7 @@ int main( int argc, char * * argv )
|
||||
stringlist files;
|
||||
for( int i = 1; i < argc; ++i )
|
||||
{
|
||||
files.push_back( argv[i] );
|
||||
files.push_back( std::string( argv[i] ) );
|
||||
}
|
||||
for( stringlist::iterator it = files.begin(); it != files.end(); ++it )
|
||||
{
|
||||
@@ -111,7 +111,8 @@ int main( int argc, char * * argv )
|
||||
embed * dummy = new embed;
|
||||
dummy->size = 1;
|
||||
dummy->name = "dummy";
|
||||
dummy->cname = convertFileNameToCIdentifier( "dummy" );
|
||||
dummy->cname = convertFileNameToCIdentifier(
|
||||
std::string( "dummy" ) );
|
||||
embedded_data.push_back( dummy );
|
||||
|
||||
std::cout << "#include <string.h>" << std::endl << std::endl;
|
||||
@@ -134,7 +135,7 @@ int main( int argc, char * * argv )
|
||||
}
|
||||
std::cout << " { 0, 0, 0 }" << std::endl << "};" << std::endl
|
||||
<< std::endl
|
||||
<< "const embed::descriptor & "
|
||||
<< "static const embed::descriptor & "
|
||||
"findEmbeddedData( const char * _name )"
|
||||
<< std::endl << "{" << std::endl
|
||||
<< " for( int i = 0; embed_vec[i].data; "
|
||||
|
||||
@@ -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*/ )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -132,7 +132,7 @@ public: \
|
||||
{ \
|
||||
return( castModel<type##Model>() ); \
|
||||
} \
|
||||
} ;
|
||||
}
|
||||
|
||||
|
||||
generateTypedModelView(float);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 ),
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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 & )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -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>() ) );
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
|
||||
private:
|
||||
ladspa2LMMS( void );
|
||||
~ladspa2LMMS();
|
||||
virtual ~ladspa2LMMS();
|
||||
|
||||
l_sortable_plugin_t m_instruments;
|
||||
l_sortable_plugin_t m_validEffects;
|
||||
|
||||
@@ -85,7 +85,7 @@ class EXPORT ladspaManager
|
||||
public:
|
||||
|
||||
ladspaManager( void );
|
||||
~ladspaManager();
|
||||
virtual ~ladspaManager();
|
||||
|
||||
l_sortable_plugin_t getSortedPlugins();
|
||||
ladspaManagerDescription * getDescription( const ladspa_key_t &
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
SignalMix,
|
||||
SynchronizedBySubOsc,
|
||||
FrequencyModulation,
|
||||
NumModulationAlgos,
|
||||
NumModulationAlgos
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -40,6 +40,10 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~sharedObject()
|
||||
{
|
||||
}
|
||||
|
||||
template<class T>
|
||||
static T * ref( T * _object )
|
||||
{
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -255,8 +255,8 @@ void audioFileProcessor::loopPointChanged( void )
|
||||
( m_sampleBuffer.frames()-1 ) );
|
||||
const f_cnt_t f2 = static_cast<f_cnt_t>( m_endPointModel.value() *
|
||||
( m_sampleBuffer.frames()-1 ) );
|
||||
m_sampleBuffer.setStartFrame( tMin<f_cnt_t>( f1, f2 ) );
|
||||
m_sampleBuffer.setEndFrame( tMax<f_cnt_t>( f1, f2 ) );
|
||||
m_sampleBuffer.setStartFrame( qMin<f_cnt_t>( f1, f2 ) );
|
||||
m_sampleBuffer.setEndFrame( qMax<f_cnt_t>( f1, f2 ) );
|
||||
emit dataChanged();
|
||||
}
|
||||
|
||||
@@ -473,7 +473,7 @@ void audioFileProcessorView::paintEvent( QPaintEvent * )
|
||||
|
||||
p.setPen( QColor( 0xFF, 0xAA, 0x00 ) );
|
||||
const QRect graph_rect( 4, 174, 241, 70 );
|
||||
const f_cnt_t frames = tMax( a->m_sampleBuffer.frames(),
|
||||
const f_cnt_t frames = qMax( a->m_sampleBuffer.frames(),
|
||||
static_cast<f_cnt_t>( 1 ) );
|
||||
const int start_frame_x = a->m_sampleBuffer.startFrame() *
|
||||
graph_rect.width() / frames;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/include")
|
||||
FILE(GLOB PLUGIN_SOURCES *.c)
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -Wno-write-strings -Wall -fomit-frame-pointer -fno-strict-aliasing -fstrength-reduce -funroll-loops -ffast-math")
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -Wno-write-strings -fomit-frame-pointer -fno-strict-aliasing -fstrength-reduce -funroll-loops -ffast-math")
|
||||
FOREACH(_item ${PLUGIN_SOURCES})
|
||||
GET_FILENAME_COMPONENT(_plugin "${_item}" NAME_WE)
|
||||
ADD_LIBRARY(${_plugin} MODULE ${_item})
|
||||
|
||||
@@ -264,7 +264,7 @@ void audioALSA::run( void )
|
||||
outbuf,
|
||||
m_convertEndian );
|
||||
}
|
||||
int min_len = tMin( len, outbuf_size - outbuf_pos );
|
||||
int min_len = qMin( len, outbuf_size - outbuf_pos );
|
||||
memcpy( ptr, outbuf + outbuf_pos,
|
||||
min_len * sizeof( int_sample_t ) );
|
||||
ptr += min_len;
|
||||
|
||||
@@ -334,7 +334,7 @@ int audioJACK::processCallback( jack_nframes_t _nframes, void * _udata )
|
||||
}
|
||||
|
||||
#ifdef AUDIO_PORT_SUPPORT
|
||||
const Uint32 frames = tMin<Uint32>( _nframes,
|
||||
const Uint32 frames = qMin<Uint32>( _nframes,
|
||||
_this->getMixer()->framesPerPeriod() );
|
||||
for( jackPortMap::iterator it = _this->m_portMap.begin();
|
||||
it != _this->m_portMap.end(); ++it )
|
||||
@@ -360,7 +360,7 @@ int audioJACK::processCallback( jack_nframes_t _nframes, void * _udata )
|
||||
jack_nframes_t done = 0;
|
||||
while( done < _nframes && _this->m_stopped == FALSE )
|
||||
{
|
||||
jack_nframes_t todo = tMin<jack_nframes_t>(
|
||||
jack_nframes_t todo = qMin<jack_nframes_t>(
|
||||
_nframes,
|
||||
_this->m_framesToDoInCurBuf -
|
||||
_this->m_framesDoneInCurBuf );
|
||||
|
||||
@@ -321,7 +321,7 @@ int audioPortAudio::process_callback(
|
||||
}
|
||||
m_outBufSize = frames;
|
||||
}
|
||||
const int min_len = tMin( (int)_framesPerBuffer,
|
||||
const int min_len = qMin( (int)_framesPerBuffer,
|
||||
m_outBufSize - m_outBufPos );
|
||||
|
||||
float master_gain = getMixer()->masterGain();
|
||||
@@ -487,12 +487,12 @@ audioPortAudio::setupWidget::setupWidget( QWidget * _parent ) :
|
||||
const QString& device = configManager::inst()->value( "audioportaudio",
|
||||
"device" );
|
||||
|
||||
int i = tMax( 0, m_setupUtil.m_backendModel.findText( backend ) );
|
||||
int i = qMax( 0, m_setupUtil.m_backendModel.findText( backend ) );
|
||||
m_setupUtil.m_backendModel.setValue( i );
|
||||
|
||||
m_setupUtil.updateDevices();
|
||||
|
||||
i = tMax( 0, m_setupUtil.m_deviceModel.findText( device ) );
|
||||
i = qMax( 0, m_setupUtil.m_deviceModel.findText( device ) );
|
||||
m_setupUtil.m_deviceModel.setValue( i );
|
||||
|
||||
connect( &m_setupUtil.m_backendModel, SIGNAL( dataChanged() ),
|
||||
|
||||
@@ -198,7 +198,7 @@ void audioSDL::sdlAudioCallback( Uint8 * _buf, int _len )
|
||||
(int_sample_t *)m_convertedBuf,
|
||||
m_convertEndian );
|
||||
}
|
||||
const int min_len = tMin( _len, m_convertedBufSize
|
||||
const int min_len = qMin( _len, m_convertedBufSize
|
||||
- m_convertedBufPos );
|
||||
memcpy( _buf, m_convertedBuf + m_convertedBufPos, min_len );
|
||||
_buf += min_len;
|
||||
|
||||
@@ -35,14 +35,6 @@ float automatableModel::__copiedValue = 0;
|
||||
|
||||
|
||||
|
||||
template<>
|
||||
inline float automatableModel::minEps<float>( void )
|
||||
{
|
||||
return( 1.0e-10 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
automatableModel::automatableModel( DataType _type,
|
||||
const float _val,
|
||||
@@ -292,19 +284,20 @@ float automatableModel::fittedValue( float _value ) const
|
||||
}
|
||||
|
||||
// correct rounding error at the border
|
||||
if( tAbs<float>( _value - m_maxValue ) <
|
||||
minEps<float>() * tAbs<float>( m_step ) )
|
||||
if( qAbs<float>( _value - m_maxValue ) <
|
||||
typeInfo<float>::minEps() * qAbs<float>( m_step ) )
|
||||
{
|
||||
_value = m_maxValue;
|
||||
}
|
||||
|
||||
// correct rounding error if value = 0
|
||||
if( tAbs<float>( _value ) < minEps<float>() * tAbs<float>( m_step ) )
|
||||
if( qAbs<float>( _value ) < typeInfo<float>::minEps() *
|
||||
qAbs<float>( m_step ) )
|
||||
{
|
||||
_value = 0;
|
||||
}
|
||||
|
||||
return( _value );
|
||||
return _value;
|
||||
}
|
||||
|
||||
|
||||
@@ -314,7 +307,7 @@ float automatableModel::fittedValue( float _value ) const
|
||||
void automatableModel::redoStep( journalEntry & _je )
|
||||
{
|
||||
bool journalling = testAndSetJournalling( FALSE );
|
||||
setValue( value<float>() + _je.data().toDouble() );
|
||||
setValue( value<float>() + (float) _je.data().toDouble() );
|
||||
setJournalling( journalling );
|
||||
}
|
||||
|
||||
|
||||
@@ -146,9 +146,9 @@ midiTime automationPattern::length( void ) const
|
||||
for( timeMap::const_iterator it = m_timeMap.begin();
|
||||
it != m_timeMap.end(); ++it )
|
||||
{
|
||||
max_length = tMax<tick>( max_length, it.key() );
|
||||
max_length = qMax<tick>( max_length, it.key() );
|
||||
}
|
||||
return( midiTime( tMax( midiTime( max_length ).getTact() + 1, 1 ),
|
||||
return( midiTime( qMax( midiTime( max_length ).getTact() + 1, 1 ),
|
||||
0 ) );
|
||||
}
|
||||
|
||||
@@ -718,7 +718,7 @@ void automationPatternView::paintEvent( QPaintEvent * )
|
||||
}
|
||||
else
|
||||
{
|
||||
x2 = width() - TCO_BORDER_WIDTH;
|
||||
x2 = (float)( width() - TCO_BORDER_WIDTH );
|
||||
}
|
||||
p.fillRect( QRectF( x1, 0.0f, x2-x1, it.value() ),
|
||||
lin2grad );
|
||||
|
||||
@@ -84,7 +84,7 @@ bool bbTrackContainer::play( midiTime _start, fpp_t _frames,
|
||||
void bbTrackContainer::updateAfterTrackAdd( void )
|
||||
{
|
||||
// make sure, new track(s) have TCOs for every beat/bassline
|
||||
for( int i = 0; i < tMax<int>( 1, numOfBBs() ); ++i )
|
||||
for( int i = 0; i < qMax<int>( 1, numOfBBs() ); ++i )
|
||||
{
|
||||
createTCOsForBB( i );
|
||||
}
|
||||
@@ -100,7 +100,7 @@ tact bbTrackContainer::lengthOfBB( int _bb )
|
||||
const trackList & tl = tracks();
|
||||
for( trackList::const_iterator it = tl.begin(); it != tl.end(); ++it )
|
||||
{
|
||||
max_length = tMax( max_length,
|
||||
max_length = qMax( max_length,
|
||||
( *it )->getTCO( _bb )->length() );
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ void bbTrackContainer::removeBB( int _bb )
|
||||
}
|
||||
if( _bb <= currentBB() )
|
||||
{
|
||||
setCurrentBB( tMax( currentBB() - 1, 0 ) );
|
||||
setCurrentBB( qMax( currentBB() - 1, 0 ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ controllerConnection::~controllerConnection()
|
||||
|
||||
|
||||
|
||||
void controllerConnection::setController( int _controllerId )
|
||||
void controllerConnection::setController( int /*_controllerId*/ )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ void effect::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
|
||||
void effect::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
m_enabledModel.setValue( _this.attribute( "on" ).toInt() );
|
||||
m_enabledModel.setValue( (float) _this.attribute( "on" ).toInt() );
|
||||
m_wetDryModel.setValue( _this.attribute( "wet" ).toFloat() );
|
||||
m_autoQuitModel.setValue( _this.attribute( "autoquit" ).toFloat() );
|
||||
m_gateModel.setValue( _this.attribute( "gate" ).toFloat() );
|
||||
@@ -183,7 +183,7 @@ void effect::reinitSRC( void )
|
||||
void effect::resample( int _i, const sampleFrame * _src_buf,
|
||||
sample_rate_t _src_sr,
|
||||
sampleFrame * _dst_buf, sample_rate_t _dst_sr,
|
||||
fpp_t _frames )
|
||||
f_cnt_t _frames )
|
||||
{
|
||||
if( m_srcState[_i] == NULL )
|
||||
{
|
||||
|
||||
@@ -177,7 +177,8 @@ void engine::initPluginFileHandling( void )
|
||||
if( it->type == plugin::Instrument )
|
||||
{
|
||||
const QStringList & ext =
|
||||
QString( it->supportedFileTypes ).split( ',' );
|
||||
QString( it->supportedFileTypes ).
|
||||
split( QChar( ',' ) );
|
||||
for( QStringList::const_iterator itExt = ext.begin();
|
||||
itExt != ext.end(); ++itExt )
|
||||
{
|
||||
|
||||
@@ -106,9 +106,9 @@ void instrument::applyRelease( sampleFrame * buf, const notePlayHandle * _n )
|
||||
const f_cnt_t fl = _n->framesLeft();
|
||||
if( fl <= desiredReleaseFrames()+fpp )
|
||||
{
|
||||
for( fpp_t f = fl > desiredReleaseFrames() ?
|
||||
( tMax( fpp - desiredReleaseFrames(), 0 ) +
|
||||
fl % fpp ) : 0; f < frames; ++f )
|
||||
for( fpp_t f = (fpp_t)( ( fl > desiredReleaseFrames() ) ?
|
||||
( qMax( fpp - desiredReleaseFrames(), 0 ) +
|
||||
fl % fpp ) : 0 ); f < frames; ++f )
|
||||
{
|
||||
const float fac = (float)( fl-f-1 ) /
|
||||
desiredReleaseFrames();
|
||||
|
||||
@@ -443,8 +443,7 @@ void arpeggiator::processNote( notePlayHandle * _n )
|
||||
// create new arp-note
|
||||
note new_note( midiTime( 0 ), midiTime( 0 ),
|
||||
sub_note_key,
|
||||
static_cast<volume>( _n->getVolume() *
|
||||
vol_level ),
|
||||
(volume) qRound( _n->getVolume() * vol_level ),
|
||||
_n->getPanning(), _n->detuning() );
|
||||
|
||||
// create sub-note-play-handle, only ptr to note is different
|
||||
|
||||
@@ -63,7 +63,7 @@ instrumentSoundShaping::instrumentSoundShaping(
|
||||
instrumentTrack * _instrument_track ) :
|
||||
model( _instrument_track, tr( "Envelopes/LFOs" ) ),
|
||||
m_instrumentTrack( _instrument_track ),
|
||||
m_filterEnabledModel( FALSE, this ),
|
||||
m_filterEnabledModel( false, this ),
|
||||
m_filterModel( this, tr( "Filter type" ) ),
|
||||
m_filterCutModel( 14000.0, 1.0, 14000.0, 1.0, this,
|
||||
tr( "Cutoff frequency" ) ),
|
||||
@@ -118,7 +118,7 @@ float instrumentSoundShaping::volumeLevel( notePlayHandle * _n,
|
||||
f_cnt_t release_begin = _frame - _n->releaseFramesDone() +
|
||||
_n->framesBeforeRelease();
|
||||
|
||||
if( _n->released() == FALSE )
|
||||
if( _n->released() == false )
|
||||
{
|
||||
release_begin += engine::getMixer()->framesPerPeriod();
|
||||
}
|
||||
@@ -141,7 +141,7 @@ void instrumentSoundShaping::processAudioBuffer( sampleFrame * _ab,
|
||||
f_cnt_t release_begin = total_frames - _n->releaseFramesDone() +
|
||||
_n->framesBeforeRelease();
|
||||
|
||||
if( _n->released() == FALSE )
|
||||
if( _n->released() == false )
|
||||
{
|
||||
release_begin += engine::getMixer()->framesPerPeriod();
|
||||
}
|
||||
@@ -282,7 +282,7 @@ void instrumentSoundShaping::processAudioBuffer( sampleFrame * _ab,
|
||||
delete[] vol_buf;
|
||||
}
|
||||
|
||||
/* else if( m_envLFOParameters[Volume]->used() == FALSE && m_envLFOParameters[PANNING]->used() )
|
||||
/* else if( m_envLFOParameters[Volume]->used() == false && m_envLFOParameters[PANNING]->used() )
|
||||
{
|
||||
// only use panning-envelope...
|
||||
for( fpp_t frame = 0; frame < _frames; ++frame )
|
||||
@@ -304,7 +304,7 @@ f_cnt_t instrumentSoundShaping::envFrames( const bool _only_vol ) const
|
||||
{
|
||||
f_cnt_t ret_val = m_envLFOParameters[Volume]->PAHD_Frames();
|
||||
|
||||
if( _only_vol == FALSE )
|
||||
if( _only_vol == false )
|
||||
{
|
||||
for( int i = Volume+1; i < NumTargets; ++i )
|
||||
{
|
||||
@@ -321,7 +321,7 @@ f_cnt_t instrumentSoundShaping::envFrames( const bool _only_vol ) const
|
||||
|
||||
|
||||
|
||||
f_cnt_t instrumentSoundShaping::releaseFrames( const bool _only_vol ) const
|
||||
f_cnt_t instrumentSoundShaping::releaseFrames(void ) const
|
||||
{
|
||||
f_cnt_t ret_val = m_envLFOParameters[Volume]->used() ?
|
||||
m_envLFOParameters[Volume]->releaseFrames() : 0;
|
||||
@@ -332,7 +332,7 @@ f_cnt_t instrumentSoundShaping::releaseFrames( const bool _only_vol ) const
|
||||
desiredReleaseFrames();
|
||||
}
|
||||
|
||||
if( m_envLFOParameters[Volume]->used() == FALSE )
|
||||
if( m_envLFOParameters[Volume]->used() == false )
|
||||
{
|
||||
for( int i = Volume+1; i < NumTargets; ++i )
|
||||
{
|
||||
|
||||
@@ -155,7 +155,7 @@ void journallingObject::changeID( jo_id_t _id )
|
||||
dynamic_cast<automatableModel *>( jo )->
|
||||
displayName();
|
||||
}
|
||||
printf( "JO-ID %d already in use by %s!\n", _id,
|
||||
printf( "JO-ID %d already in use by %s!\n", (int) _id,
|
||||
used_by.toAscii().constData() );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "lfo_controller.h"
|
||||
#include "controller_dialog.h"
|
||||
|
||||
const float TWO_PI = 6.28318531f;
|
||||
//const float TWO_PI = 6.28318531f;
|
||||
|
||||
lfoController::lfoController( model * _parent ) :
|
||||
controller( LfoController, _parent, tr( "LFO Controller" ) ),
|
||||
@@ -108,14 +108,14 @@ float lfoController::value( int _offset )
|
||||
break;
|
||||
}
|
||||
|
||||
m_phaseOffset = static_cast<int>(
|
||||
m_phaseOffset = qRound(
|
||||
m_phaseModel.value() * newDurationF / 360.0 );
|
||||
int newDuration = static_cast<int>( newDurationF );
|
||||
|
||||
if (newDuration != m_duration) {
|
||||
// frame offset
|
||||
// (Samples - Samples) = Samples
|
||||
float oldFramePhase = (frame % m_duration);
|
||||
float oldFramePhase = float(frame % m_duration);
|
||||
|
||||
// Phase between 0 and 1
|
||||
// (Samples/Samples) = factor
|
||||
|
||||
@@ -278,8 +278,8 @@ int main( int argc, char * * argv )
|
||||
( QString( argv[i] ) == "--oversampling" ||
|
||||
QString( argv[i] ) == "-x" ) )
|
||||
{
|
||||
int os = QString( argv[i + 1] ).toUInt();
|
||||
switch( os )
|
||||
int o = QString( argv[i + 1] ).toUInt();
|
||||
switch( o )
|
||||
{
|
||||
case 1:
|
||||
qs.oversampling = mixer::qualitySettings::Oversampling_None;
|
||||
|
||||
@@ -70,7 +70,7 @@ notePlayHandle::notePlayHandle( instrumentTrack * _it,
|
||||
m_partOfArpeggio( _part_of_arp ),
|
||||
m_muted( FALSE ),
|
||||
m_bbTrack( NULL ),
|
||||
#if LMMS_SINGERBOT_SUPPORT
|
||||
#ifdef LMMS_SINGERBOT_SUPPORT
|
||||
m_patternIndex( 0 ),
|
||||
#endif
|
||||
m_origTempo( engine::getSong()->getTempo() )
|
||||
@@ -92,7 +92,7 @@ notePlayHandle::notePlayHandle( instrumentTrack * _it,
|
||||
_parent->isBaseNote();
|
||||
|
||||
m_bbTrack = _parent->m_bbTrack;
|
||||
#if LMMS_SINGERBOT_SUPPORT
|
||||
#ifdef LMMS_SINGERBOT_SUPPORT
|
||||
m_patternIndex = _parent->m_patternIndex;
|
||||
#endif
|
||||
}
|
||||
@@ -324,7 +324,7 @@ void notePlayHandle::noteOff( const f_cnt_t _s )
|
||||
|
||||
// then set some variables indicating release-state
|
||||
m_framesBeforeRelease = _s;
|
||||
m_releaseFramesToDo = tMax<f_cnt_t>( 0, // 10,
|
||||
m_releaseFramesToDo = qMax<f_cnt_t>( 0, // 10,
|
||||
m_instrumentTrack->m_soundShaping.releaseFrames() );
|
||||
|
||||
if( !isBaseNote() || !getInstrumentTrack()->arpeggiatorEnabled() )
|
||||
@@ -345,8 +345,8 @@ void notePlayHandle::noteOff( const f_cnt_t _s )
|
||||
|
||||
f_cnt_t notePlayHandle::actualReleaseFramesToDo( void ) const
|
||||
{
|
||||
return( m_instrumentTrack->m_soundShaping.releaseFrames(
|
||||
isArpeggioBaseNote() ) );
|
||||
return( m_instrumentTrack->m_soundShaping.releaseFrames(/*
|
||||
isArpeggioBaseNote()*/ ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -463,7 +463,7 @@ void notePlayHandle::updateFrequency( void )
|
||||
( key() - m_instrumentTrack->baseNoteModel()->value() +
|
||||
engine::getSong()->masterPitch() ) / 12.0f;
|
||||
m_frequency = BaseFreq * powf( 2.0f, pitch +
|
||||
m_instrumentTrack->m_pitchModel.value() / ( 100 * 12.0 ) );
|
||||
m_instrumentTrack->m_pitchModel.value() / ( 100 * 12.0f ) );
|
||||
m_unpitchedFrequency = BaseFreq * powf( 2.0f, pitch );
|
||||
|
||||
for( notePlayHandleVector::iterator it = m_subNotes.begin();
|
||||
@@ -480,9 +480,9 @@ void notePlayHandle::processMidiTime( const midiTime & _time )
|
||||
{
|
||||
if( _time >= pos() )
|
||||
{
|
||||
float v = detuning()->getAutomationPattern()->valueAt( _time -
|
||||
pos() );
|
||||
if( v != m_baseDetuning->value() )
|
||||
const float v = detuning()->getAutomationPattern()->
|
||||
valueAt( _time - pos() );
|
||||
if( !typeInfo<float>::isEqual( v, m_baseDetuning->value() ) )
|
||||
{
|
||||
m_baseDetuning->setValue( v );
|
||||
updateFrequency();
|
||||
|
||||
@@ -311,7 +311,7 @@ void oscillator::updateFM( sampleFrame * _ab, const fpp_t _frames,
|
||||
// should be called every time phase-offset is changed...
|
||||
inline void oscillator::recalcPhase( void )
|
||||
{
|
||||
if( m_phaseOffset != m_ext_phaseOffset )
|
||||
if( !typeInfo<float>::isEqual( m_phaseOffset, m_ext_phaseOffset ) )
|
||||
{
|
||||
m_phase -= m_phaseOffset;
|
||||
m_phaseOffset = m_ext_phaseOffset;
|
||||
|
||||
@@ -515,8 +515,9 @@ void pianoView::mousePressEvent( QMouseEvent * _me )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_piano->m_instrumentTrack->baseNoteModel()->
|
||||
setInitValue( key_num );
|
||||
m_piano->m_instrumentTrack->
|
||||
baseNoteModel()->
|
||||
setInitValue( (float) key_num );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -536,7 +537,7 @@ void pianoView::mousePressEvent( QMouseEvent * _me )
|
||||
*
|
||||
* \param _me the mousePressEvent to handle.
|
||||
*/
|
||||
void pianoView::mouseReleaseEvent( QMouseEvent * _me )
|
||||
void pianoView::mouseReleaseEvent( QMouseEvent * )
|
||||
{
|
||||
if( m_lastKey != -1 )
|
||||
{
|
||||
@@ -624,8 +625,9 @@ void pianoView::mouseMoveEvent( QMouseEvent * _me )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_piano->m_instrumentTrack->baseNoteModel()->
|
||||
setInitValue( key_num );
|
||||
m_piano->m_instrumentTrack->
|
||||
baseNoteModel()->
|
||||
setInitValue( (float) key_num );
|
||||
}
|
||||
}
|
||||
// and let the user see that he pressed a key... :)
|
||||
|
||||
@@ -157,7 +157,7 @@ presetPreviewPlayHandle::presetPreviewPlayHandle( const QString & _preset_file,
|
||||
// create note-play-handle for it
|
||||
m_previewNote = new notePlayHandle(
|
||||
s_previewTC->previewInstrumentTrack(), 0,
|
||||
valueRanges<f_cnt_t>::max() / 2,
|
||||
typeInfo<f_cnt_t>::max() / 2,
|
||||
note( 0, 0, DefaultKey, 100 ) );
|
||||
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ bool remotePlugin::process( const sampleFrame * _in_buf,
|
||||
|
||||
memset( m_shm, 0, m_shmSize );
|
||||
|
||||
ch_cnt_t inputs = tMin<ch_cnt_t>( m_inputCount, DEFAULT_CHANNELS );
|
||||
ch_cnt_t inputs = qMin<ch_cnt_t>( m_inputCount, DEFAULT_CHANNELS );
|
||||
|
||||
if( _in_buf != NULL && inputs > 0 )
|
||||
{
|
||||
@@ -182,7 +182,7 @@ bool remotePlugin::process( const sampleFrame * _in_buf,
|
||||
waitForMessage( IdProcessingDone );
|
||||
unlock();
|
||||
|
||||
const ch_cnt_t outputs = tMin<ch_cnt_t>( m_outputCount,
|
||||
const ch_cnt_t outputs = qMin<ch_cnt_t>( m_outputCount,
|
||||
DEFAULT_CHANNELS );
|
||||
if( m_splitChannels )
|
||||
{
|
||||
|
||||
@@ -652,7 +652,7 @@ sampleFrame * sampleBuffer::getSampleFragment( f_cnt_t _start,
|
||||
f_cnt_t loop_frames = m_loopEndFrame - m_loopStartFrame;
|
||||
while( _frames - copied > 0 )
|
||||
{
|
||||
f_cnt_t todo = tMin( _frames - copied, loop_frames );
|
||||
f_cnt_t todo = qMin( _frames - copied, loop_frames );
|
||||
memcpy( *_tmp + copied, m_data + m_loopStartFrame,
|
||||
todo * BYTES_PER_FRAME );
|
||||
copied += todo;
|
||||
@@ -850,7 +850,7 @@ QString & sampleBuffer::toBase64( QString & _dst ) const
|
||||
f_cnt_t frame_cnt = 0;
|
||||
while( frame_cnt < m_frames )
|
||||
{
|
||||
f_cnt_t remaining = tMin<f_cnt_t>( FRAMES_PER_BUF,
|
||||
f_cnt_t remaining = qMin<f_cnt_t>( FRAMES_PER_BUF,
|
||||
m_frames - frame_cnt );
|
||||
FLAC__int32 buf[FRAMES_PER_BUF * DEFAULT_CHANNELS];
|
||||
for( f_cnt_t f = 0; f < remaining; ++f )
|
||||
@@ -911,7 +911,6 @@ sampleBuffer * sampleBuffer::resample( sampleFrame * _data,
|
||||
src_data.input_frames = _frames;
|
||||
src_data.output_frames = dst_frames;
|
||||
src_data.src_ratio = (double) _dst_sr / _src_sr;
|
||||
int error;
|
||||
if( ( error = src_process( state, &src_data ) ) )
|
||||
{
|
||||
printf( "sampleBuffer: error while resampling: %s\n",
|
||||
|
||||
@@ -68,10 +68,10 @@ sampleRecordHandle::~sampleRecordHandle()
|
||||
|
||||
|
||||
|
||||
void sampleRecordHandle::play( sampleFrame * _working_buffer )
|
||||
void sampleRecordHandle::play( sampleFrame * /*_working_buffer*/ )
|
||||
{
|
||||
const sampleFrame * recbuf = engine::getMixer()->inputBuffer();
|
||||
const fpp_t frames = engine::getMixer()->inputBufferFrames();
|
||||
const f_cnt_t frames = engine::getMixer()->inputBufferFrames();
|
||||
writeBuffer( recbuf, frames );
|
||||
m_framesRecorded += frames;
|
||||
|
||||
@@ -88,7 +88,7 @@ void sampleRecordHandle::play( sampleFrame * _working_buffer )
|
||||
|
||||
bool sampleRecordHandle::done( void ) const
|
||||
{
|
||||
return( FALSE );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -139,10 +139,10 @@ void sampleRecordHandle::createSampleBuffer( sampleBuffer * * _sample_buf )
|
||||
|
||||
|
||||
void sampleRecordHandle::writeBuffer( const sampleFrame * _ab,
|
||||
const fpp_t _frames )
|
||||
const f_cnt_t _frames )
|
||||
{
|
||||
sampleFrame * buf = new sampleFrame[_frames];
|
||||
for( fpp_t frame = 0; frame < _frames; ++frame )
|
||||
for( f_cnt_t frame = 0; frame < _frames; ++frame )
|
||||
{
|
||||
for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
{
|
||||
|
||||
@@ -92,14 +92,15 @@ void serializingObject::setHook( serializingObjectHook * _hook )
|
||||
|
||||
|
||||
|
||||
void serializingObject::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
void serializingObject::saveSettings( QDomDocument &/* _doc*/,
|
||||
QDomElement &/* _this*/ )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void serializingObject::loadSettings( const QDomElement & _this )
|
||||
void serializingObject::loadSettings( const QDomElement & /* _this*/ )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ void song::masterVolumeChanged( void )
|
||||
|
||||
void song::setTempo( void )
|
||||
{
|
||||
const bpm_t tempo = m_tempoModel.value();
|
||||
const bpm_t tempo = (bpm_t) m_tempoModel.value();
|
||||
playHandleVector & phv = engine::getMixer()->playHandles();
|
||||
for( playHandleVector::iterator it = phv.begin(); it != phv.end();
|
||||
++it )
|
||||
@@ -291,7 +291,7 @@ void song::processNextBuffer( void )
|
||||
}
|
||||
|
||||
trackList track_list;
|
||||
Sint16 tco_num = -1;
|
||||
int tco_num = -1;
|
||||
|
||||
switch( m_playMode )
|
||||
{
|
||||
@@ -700,7 +700,7 @@ void song::addAutomationTrack( void )
|
||||
|
||||
bpm_t song::getTempo( void )
|
||||
{
|
||||
return( m_tempoModel.value() );
|
||||
return (bpm_t) m_tempoModel.value();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -202,7 +202,7 @@ surroundAreaModel::surroundAreaModel( ::model * _parent,
|
||||
surroundVolumeVector surroundAreaModel::getVolumeVector( float _v_scale ) const
|
||||
{
|
||||
surroundVolumeVector v = { { _v_scale, _v_scale
|
||||
#ifndef DISABLE_SURROUND
|
||||
#ifndef LMMS_DISABLE_SURROUND
|
||||
, _v_scale, _v_scale
|
||||
#endif
|
||||
} } ;
|
||||
@@ -210,14 +210,14 @@ surroundVolumeVector surroundAreaModel::getVolumeVector( float _v_scale ) const
|
||||
if( x() >= 0 )
|
||||
{
|
||||
v.vol[0] *= 1.0f - x() / (float)SURROUND_AREA_SIZE;
|
||||
#ifndef DISABLE_SURROUND
|
||||
#ifndef LMMS_DISABLE_SURROUND
|
||||
v.vol[2] *= 1.0f - x() / (float)SURROUND_AREA_SIZE;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
v.vol[1] *= 1.0f + x() / (float)SURROUND_AREA_SIZE;
|
||||
#ifndef DISABLE_SURROUND
|
||||
#ifndef LMMS_DISABLE_SURROUND
|
||||
v.vol[3] *= 1.0f + x() / (float)SURROUND_AREA_SIZE;
|
||||
#endif
|
||||
}
|
||||
@@ -227,7 +227,7 @@ surroundVolumeVector surroundAreaModel::getVolumeVector( float _v_scale ) const
|
||||
v.vol[0] *= 1.0f - y() / (float)SURROUND_AREA_SIZE;
|
||||
v.vol[1] *= 1.0f - y() / (float)SURROUND_AREA_SIZE;
|
||||
}
|
||||
#ifndef DISABLE_SURROUND
|
||||
#ifndef LMMS_DISABLE_SURROUND
|
||||
else
|
||||
{
|
||||
v.vol[2] *= 1.0f + y() / (float)SURROUND_AREA_SIZE;
|
||||
@@ -257,8 +257,8 @@ void surroundAreaModel::loadSettings( const QDomElement & _this,
|
||||
if( _this.hasAttribute( _name ) )
|
||||
{
|
||||
const int i = _this.attribute( _name ).toInt();
|
||||
m_posX.setValue( ( i & 0xFFFF ) - 2 * SURROUND_AREA_SIZE );
|
||||
m_posY.setValue( ( i >> 16 ) - 2 * SURROUND_AREA_SIZE );
|
||||
m_posX.setValue( (float)( ( i & 0xFFFF ) - 2 * SURROUND_AREA_SIZE ) );
|
||||
m_posY.setValue( (float)( ( i >> 16 ) - 2 * SURROUND_AREA_SIZE ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -253,7 +253,7 @@ void timeLine::paintEvent( QPaintEvent * )
|
||||
p.drawLine( cx, 5, cx, height() - 6 );
|
||||
++tact_num;
|
||||
if( ( tact_num - 1 ) %
|
||||
tMax( 1, qRound( 1.0f / 3.0f *
|
||||
qMax( 1, qRound( 1.0f / 3.0f *
|
||||
midiTime::ticksPerTact() / m_ppt ) ) == 0 )
|
||||
{
|
||||
const QString s = QString::number( tact_num );
|
||||
@@ -321,7 +321,7 @@ void timeLine::mousePressEvent( QMouseEvent * _me )
|
||||
|
||||
void timeLine::mouseMoveEvent( QMouseEvent * _me )
|
||||
{
|
||||
const midiTime t = m_begin + static_cast<Sint32>( tMax( _me->x() -
|
||||
const midiTime t = m_begin + static_cast<Sint32>( qMax( _me->x() -
|
||||
m_xOffset - m_moveXOff, 0 ) *
|
||||
midiTime::ticksPerTact() / m_ppt );
|
||||
switch( m_action )
|
||||
|
||||
@@ -658,7 +658,7 @@ void trackContentObjectView::mouseMoveEvent( QMouseEvent * _me )
|
||||
if( m_action == Move )
|
||||
{
|
||||
const int x = mapToParent( _me->pos() ).x() - m_initialMouseX;
|
||||
midiTime t = tMax( 0, (int)
|
||||
midiTime t = qMax( 0, (int)
|
||||
m_trackView->getTrackContainerView()->currentPosition()+
|
||||
static_cast<int>( x * midiTime::ticksPerTact() /
|
||||
ppt ) );
|
||||
@@ -696,7 +696,7 @@ void trackContentObjectView::mouseMoveEvent( QMouseEvent * _me )
|
||||
}
|
||||
trackContentObject * tco = tcov->m_tco;
|
||||
tcos.push_back( tco );
|
||||
smallest_pos = tMin<int>( smallest_pos,
|
||||
smallest_pos = qMin<int>( smallest_pos,
|
||||
(int)tco->startPosition() +
|
||||
static_cast<int>( dx *
|
||||
midiTime::ticksPerTact() / ppt ) );
|
||||
@@ -712,7 +712,7 @@ void trackContentObjectView::mouseMoveEvent( QMouseEvent * _me )
|
||||
}
|
||||
else if( m_action == Resize )
|
||||
{
|
||||
midiTime t = tMax( midiTime::ticksPerTact(),
|
||||
midiTime t = qMax( midiTime::ticksPerTact(),
|
||||
static_cast<int>( _me->x() *
|
||||
midiTime::ticksPerTact() / ppt ) );
|
||||
if( engine::getMainWindow()->isCtrlPressed() ==
|
||||
@@ -1987,7 +1987,7 @@ void track::removeTact( const midiTime & _pos )
|
||||
{
|
||||
if( ( *it )->startPosition() >= _pos )
|
||||
{
|
||||
( *it )->movePosition( tMax( ( *it )->startPosition() -
|
||||
( *it )->movePosition( qMax( ( *it )->startPosition() -
|
||||
midiTime::ticksPerTact(), 0 ) );
|
||||
}
|
||||
}
|
||||
@@ -2235,7 +2235,7 @@ void trackView::undoStep( journalEntry & _je )
|
||||
}
|
||||
break;
|
||||
case ResizeTrack:
|
||||
setFixedHeight( tMax<int>( height() +
|
||||
setFixedHeight( qMax<int>( height() +
|
||||
_je.data().toInt(),
|
||||
MINIMAL_TRACK_HEIGHT ) );
|
||||
m_trackContainerView->realignTracks();
|
||||
@@ -2397,7 +2397,7 @@ void trackView::mouseMoveEvent( QMouseEvent * _me )
|
||||
}
|
||||
else if( m_action == ResizeTrack )
|
||||
{
|
||||
setFixedHeight( tMax<int>( _me->y(), MINIMAL_TRACK_HEIGHT ) );
|
||||
setFixedHeight( qMax<int>( _me->y(), MINIMAL_TRACK_HEIGHT ) );
|
||||
m_trackContainerView->realignTracks();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -641,8 +641,8 @@ void automationEditor::leaveEvent( QEvent * _e )
|
||||
|
||||
void automationEditor::drawLine( int _x0, float _y0, int _x1, float _y1 )
|
||||
{
|
||||
int deltax = static_cast<int>( tAbs<float>( _x1 - _x0 ) );
|
||||
float deltay = tAbs<float>( _y1 - _y0 );
|
||||
int deltax = qRound( qAbs<float>( _x1 - _x0 ) );
|
||||
float deltay = qAbs<float>( _y1 - _y0 );
|
||||
int x = _x0;
|
||||
float y = _y0;
|
||||
int xstep;
|
||||
@@ -1006,8 +1006,7 @@ void automationEditor::mouseMoveEvent( QMouseEvent * _me )
|
||||
m_selectedTick = pos_ticks - m_selectStartTick;
|
||||
if( (int) m_selectStartTick + m_selectedTick < 0 )
|
||||
{
|
||||
m_selectedTick = -static_cast<int>(
|
||||
m_selectStartTick );
|
||||
m_selectedTick = -qRound( m_selectStartTick );
|
||||
}
|
||||
m_selectedLevels = level - m_selectStartLevel;
|
||||
if( level <= m_selectStartLevel )
|
||||
@@ -1169,8 +1168,7 @@ void automationEditor::mouseMoveEvent( QMouseEvent * _me )
|
||||
if( (int) m_selectStartTick + m_selectedTick <
|
||||
0 )
|
||||
{
|
||||
m_selectedTick = -static_cast<int>(
|
||||
m_selectStartTick );
|
||||
m_selectedTick = -qRound( m_selectStartTick );
|
||||
}
|
||||
|
||||
float level = getLevel( _me->y() );
|
||||
@@ -1274,7 +1272,7 @@ void automationEditor::paintEvent( QPaintEvent * _pe )
|
||||
{
|
||||
int y = grid_bottom;
|
||||
int level = (int) m_bottomLevel;
|
||||
int printable = tMax( 1, 5 * DEFAULT_Y_DELTA
|
||||
int printable = qMax( 1, 5 * DEFAULT_Y_DELTA
|
||||
/ m_y_delta );
|
||||
int module = level % printable;
|
||||
if( module )
|
||||
@@ -1614,7 +1612,7 @@ void automationEditor::wheelEvent( QWheelEvent * _we )
|
||||
{
|
||||
if( _we->delta() > 0 )
|
||||
{
|
||||
m_ppt = tMin( m_ppt * 2, m_y_delta *
|
||||
m_ppt = qMin( m_ppt * 2, m_y_delta *
|
||||
DEFAULT_STEPS_PER_TACT * 8 );
|
||||
}
|
||||
else if( m_ppt >= 72 )
|
||||
@@ -1624,7 +1622,7 @@ void automationEditor::wheelEvent( QWheelEvent * _we )
|
||||
// update combobox with zooming-factor
|
||||
m_zoomingXComboBox->model()->setValue(
|
||||
m_zoomingXComboBox->model()->findText( QString::number(
|
||||
static_cast<int>( m_ppt * 100 /
|
||||
qRound( m_ppt * 100 /
|
||||
DEFAULT_PPT ) ) +"%" ) );
|
||||
// update timeline
|
||||
m_timeLine->setPixelsPerTact( m_ppt );
|
||||
@@ -2043,7 +2041,7 @@ void automationEditor::updatePosition( const midiTime & _t )
|
||||
}
|
||||
else if( _t < m_currentPosition )
|
||||
{
|
||||
midiTime t = tMax( _t - w * DefaultTicksPerTact *
|
||||
midiTime t = qMax( _t - w * DefaultTicksPerTact *
|
||||
DefaultTicksPerTact / m_ppt, 0 );
|
||||
m_leftRightScroll->setValue( t.getTact() *
|
||||
DefaultTicksPerTact );
|
||||
|
||||
@@ -600,10 +600,10 @@ void mainWindow::saveWidgetState( QWidget * _w, QDomElement & _de )
|
||||
|
||||
void mainWindow::restoreWidgetState( QWidget * _w, const QDomElement & _de )
|
||||
{
|
||||
QRect r( tMax( 0, _de.attribute( "x" ).toInt() ),
|
||||
tMax( 0, _de.attribute( "y" ).toInt() ),
|
||||
tMax( 100, _de.attribute( "width" ).toInt() ),
|
||||
tMax( 100, _de.attribute( "height" ).toInt() ) );
|
||||
QRect r( qMax( 0, _de.attribute( "x" ).toInt() ),
|
||||
qMax( 0, _de.attribute( "y" ).toInt() ),
|
||||
qMax( 100, _de.attribute( "width" ).toInt() ),
|
||||
qMax( 100, _de.attribute( "height" ).toInt() ) );
|
||||
if( _de.hasAttribute( "visible" ) && !r.isNull() )
|
||||
{
|
||||
if ( _w->parentWidget() != NULL &&
|
||||
|
||||
@@ -2060,7 +2060,7 @@ void pianoRoll::paintEvent( QPaintEvent * _pe )
|
||||
}
|
||||
// draw volume-line of note
|
||||
QColor color = QColor::fromHsv( 120, 221,
|
||||
tMin(255, 60 + ( *it )->getVolume() ) );
|
||||
qMin(255, 60 + ( *it )->getVolume() ) );
|
||||
p.setPen( QPen( color,
|
||||
NE_LINE_WIDTH ) );
|
||||
p.drawLine( x + WHITE_KEY_WIDTH,
|
||||
@@ -2191,7 +2191,7 @@ void pianoRoll::wheelEvent( QWheelEvent * _we )
|
||||
{
|
||||
if( _we->delta() > 0 )
|
||||
{
|
||||
m_ppt = tMin( m_ppt * 2, KEY_LINE_HEIGHT *
|
||||
m_ppt = qMin( m_ppt * 2, KEY_LINE_HEIGHT *
|
||||
DefaultStepsPerTact * 8 );
|
||||
}
|
||||
else if( m_ppt >= 72 )
|
||||
@@ -2682,7 +2682,7 @@ void pianoRoll::updatePosition( const midiTime & _t )
|
||||
}
|
||||
else if( _t < m_currentPosition )
|
||||
{
|
||||
midiTime t = tMax( _t - w * midiTime::ticksPerTact() *
|
||||
midiTime t = qMax( _t - w * midiTime::ticksPerTact() *
|
||||
midiTime::ticksPerTact() / m_ppt, 0 );
|
||||
m_leftRightScroll->setValue( t.getTact() *
|
||||
midiTime::ticksPerTact() );
|
||||
|
||||
@@ -154,7 +154,7 @@ void pluginDescWidget::paintEvent( QPaintEvent * )
|
||||
&br );
|
||||
if( m_mouseOver )
|
||||
{
|
||||
m_targetHeight = tMax( 60, 25 + br.height() );
|
||||
m_targetHeight = qMax( 60, 25 + br.height() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -521,7 +521,7 @@ void songEditor::wheelEvent( QWheelEvent * _we )
|
||||
{
|
||||
if( _we->delta() > 0 )
|
||||
{
|
||||
setPixelsPerTact( (int) tMin( pixelsPerTact() * 2,
|
||||
setPixelsPerTact( (int) qMin( pixelsPerTact() * 2,
|
||||
256.0f ) );
|
||||
}
|
||||
else if( pixelsPerTact() >= 8 )
|
||||
@@ -657,7 +657,7 @@ void songEditor::updatePosition( const midiTime & _t )
|
||||
}
|
||||
else if( _t < m_currentPosition )
|
||||
{
|
||||
midiTime t = tMax(
|
||||
midiTime t = qMax(
|
||||
(int)( _t - w * midiTime::ticksPerTact() /
|
||||
pixelsPerTact() ),
|
||||
0 );
|
||||
|
||||
@@ -394,7 +394,7 @@ QSize KMultiTabBarButton::sizeHint() const
|
||||
iw = 20;
|
||||
ih = 16;
|
||||
w += iw;
|
||||
h = tMax( h, ih );
|
||||
h = qMax( h, ih );
|
||||
}
|
||||
QStyleOptionButton sob;
|
||||
if ( menu() != 0 )
|
||||
|
||||
@@ -108,7 +108,7 @@ void knob::setLabel( const QString & _txt )
|
||||
m_label = _txt;
|
||||
if( m_knobPixmap )
|
||||
{
|
||||
setFixedSize( tMax<int>( m_knobPixmap->width(),
|
||||
setFixedSize( qMax<int>( m_knobPixmap->width(),
|
||||
QFontMetrics( pointSizeF( font(), 6
|
||||
) ).width( m_label ) ),
|
||||
m_knobPixmap->height() + 10 );
|
||||
@@ -265,7 +265,7 @@ bool knob::updateAngle( void )
|
||||
m_totalAngle;
|
||||
angle = static_cast<int>( a ) % 360;
|
||||
}
|
||||
if( tAbs( angle - m_angle ) > 3 )
|
||||
if( qAbs( angle - m_angle ) > 3 )
|
||||
{
|
||||
m_angle = angle;
|
||||
return( TRUE );
|
||||
@@ -346,9 +346,9 @@ void knob::drawKnob( QPainter * _p )
|
||||
}
|
||||
case knobDark_28:
|
||||
{
|
||||
const float rb = tMax<float>( ( radius - 10 ) / 3.0,
|
||||
const float rb = qMax<float>( ( radius - 10 ) / 3.0,
|
||||
0.0 );
|
||||
const float re = tMax<float>( ( radius - 4 ), 0.0 );
|
||||
const float re = qMax<float>( ( radius - 4 ), 0.0 );
|
||||
QLineF ln = calculateLine( mid, re, rb );
|
||||
ln.translate( 1, 1 );
|
||||
p.drawLine( ln );
|
||||
|
||||
@@ -250,7 +250,7 @@ void lcdSpinBox::updateSize()
|
||||
m_cellHeight + (2*margin) );
|
||||
}
|
||||
else {
|
||||
setFixedSize( tMax<int>(
|
||||
setFixedSize( qMax<int>(
|
||||
m_cellWidth * m_numDigits + 2*(margin+m_marginWidth),
|
||||
QFontMetrics( pointSize<6>( font() ) ).width( m_label ) ),
|
||||
m_cellHeight + (2*margin) + 10 );
|
||||
|
||||
@@ -183,8 +183,8 @@ void bbTCOView::paintEvent( QPaintEvent * )
|
||||
}
|
||||
if( isSelected() == TRUE )
|
||||
{
|
||||
col = QColor( tMax( col.red() - 128, 0 ),
|
||||
tMax( col.green() - 128, 0 ), 255 );
|
||||
col = QColor( qMax( col.red() - 128, 0 ),
|
||||
qMax( col.green() - 128, 0 ), 255 );
|
||||
}
|
||||
QPainter p( this );
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@ void instrumentTrack::processAudioBuffer( sampleFrame * _buf,
|
||||
|
||||
m_audioPort.setNextFxChannel( m_effectChannelModel.value() );
|
||||
engine::getMixer()->bufferToPort( _buf,
|
||||
( _n != NULL ) ? tMin<f_cnt_t>(
|
||||
( _n != NULL ) ? qMin<f_cnt_t>(
|
||||
_n->framesLeftForCurrentPeriod(), _frames ) :
|
||||
_frames,
|
||||
( _n != NULL ) ? _n->offset() : 0,
|
||||
@@ -237,7 +237,7 @@ void instrumentTrack::processInEvent( const midiEvent & _me,
|
||||
notePlayHandle( this,
|
||||
_time.frames(
|
||||
engine::framesPerTick() ),
|
||||
valueRanges<f_cnt_t>::max() / 2,
|
||||
typeInfo<f_cnt_t>::max() / 2,
|
||||
n );
|
||||
if( engine::getMixer()->addPlayHandle(
|
||||
nph ) )
|
||||
|
||||
@@ -146,7 +146,7 @@ midiTime pattern::length( void ) const
|
||||
{
|
||||
if( ( *it )->length() > 0 )
|
||||
{
|
||||
max_length = tMax<tick>( max_length,
|
||||
max_length = qMax<tick>( max_length,
|
||||
( *it )->endPos() );
|
||||
}
|
||||
}
|
||||
@@ -166,7 +166,7 @@ midiTime pattern::beatPatternLength( void ) const
|
||||
{
|
||||
if( ( *it )->length() < 0 )
|
||||
{
|
||||
max_length = tMax<tick>( max_length, ( *it )->pos() +
|
||||
max_length = qMax<tick>( max_length, ( *it )->pos() +
|
||||
midiTime::ticksPerTact() /
|
||||
midiTime::stepsPerTact() );
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ sampleTCO::~sampleTCO()
|
||||
|
||||
void sampleTCO::changeLength( const midiTime & _length )
|
||||
{
|
||||
trackContentObject::changeLength( tMax( static_cast<Sint32>( _length ),
|
||||
trackContentObject::changeLength( qMax( static_cast<Sint32>( _length ),
|
||||
DefaultTicksPerTact ) );
|
||||
}
|
||||
|
||||
@@ -352,7 +352,7 @@ void sampleTCOView::paintEvent( QPaintEvent * _pe )
|
||||
p.setPen( QColor( 64, 224, 160 ) );
|
||||
}
|
||||
QRect r = QRect( 1, 1,
|
||||
tMax( static_cast<int>( m_tco->sampleLength() *
|
||||
qMax( static_cast<int>( m_tco->sampleLength() *
|
||||
pixelsPerTact() / DefaultTicksPerTact ), 1 ),
|
||||
height() - 4 );
|
||||
p.setClipRect( QRect( 1, 1, width() - 2, height() - 2 ) );
|
||||
|
||||
Reference in New Issue
Block a user