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

@@ -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;

View File

@@ -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 );

View File

@@ -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() ),

View File

@@ -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;

View File

@@ -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 );
}

View File

@@ -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 );

View File

@@ -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 ) );
}
}

View File

@@ -81,7 +81,7 @@ controllerConnection::~controllerConnection()
void controllerConnection::setController( int _controllerId )
void controllerConnection::setController( int /*_controllerId*/ )
{
}

View File

@@ -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 )
{

View File

@@ -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 )
{

View File

@@ -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();

View File

@@ -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

View File

@@ -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 )
{

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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;

View File

@@ -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();

View File

@@ -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;

View File

@@ -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... :)

View File

@@ -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 ) );

View File

@@ -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 )
{

View File

@@ -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",

View File

@@ -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 )
{

View File

@@ -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*/ )
{
}

View File

@@ -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();
}

View File

@@ -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
{

View File

@@ -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 )

View File

@@ -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();
}
}

View File

@@ -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 );

View File

@@ -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 &&

View File

@@ -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() );

View File

@@ -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() );
}
}

View File

@@ -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 );

View File

@@ -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 )

View File

@@ -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 );

View File

@@ -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 );

View File

@@ -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 );

View File

@@ -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 ) )

View File

@@ -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() );
}

View File

@@ -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 ) );