coding style fixes

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1739 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-10-04 23:21:02 +00:00
parent 97971332de
commit 7c99e38056
3 changed files with 47 additions and 51 deletions

View File

@@ -1,5 +1,3 @@
#ifndef SINGLE_SOURCE_COMPILE
/*
* audio_port.cpp - base-class for objects providing sound at a port
*
@@ -35,7 +33,7 @@ audioPort::audioPort( const QString & _name, bool _has_effect_chain ) :
m_firstBuffer( new sampleFrame[engine::getMixer()->framesPerPeriod()] ),
m_secondBuffer( new sampleFrame[
engine::getMixer()->framesPerPeriod()] ),
m_extOutputEnabled( FALSE ),
m_extOutputEnabled( false ),
m_nextFxChannel( 0 ),
m_name( "unnamed port" ),
m_effects( _has_effect_chain ? new effectChain( NULL ) : NULL )
@@ -45,7 +43,7 @@ audioPort::audioPort( const QString & _name, bool _has_effect_chain ) :
engine::getMixer()->clearAudioBuffer( m_secondBuffer,
engine::getMixer()->framesPerPeriod() );
engine::getMixer()->addAudioPort( this );
setExtOutputEnabled( TRUE );
setExtOutputEnabled( true );
}
@@ -53,7 +51,7 @@ audioPort::audioPort( const QString & _name, bool _has_effect_chain ) :
audioPort::~audioPort()
{
setExtOutputEnabled( FALSE );
setExtOutputEnabled( false );
engine::getMixer()->removeAudioPort( this );
delete[] m_firstBuffer;
delete[] m_secondBuffer;
@@ -117,11 +115,9 @@ bool audioPort::processEffects( void )
bool more = m_effects->processAudioBuffer( m_firstBuffer,
engine::getMixer()->framesPerPeriod() );
unlockFirstBuffer();
return( more );
return more;
}
return false;
}
#endif

View File

@@ -65,10 +65,10 @@ notePlayHandle::notePlayHandle( instrumentTrack * _it,
m_framesBeforeRelease( 0 ),
m_releaseFramesToDo( 0 ),
m_releaseFramesDone( 0 ),
m_released( FALSE ),
m_released( false ),
m_baseNote( _parent == NULL ),
m_partOfArpeggio( _part_of_arp ),
m_muted( FALSE ),
m_muted( false ),
m_bbTrack( NULL ),
#ifdef LMMS_SINGERBOT_SUPPORT
m_patternIndex( 0 ),
@@ -168,7 +168,7 @@ int notePlayHandle::getMidiVelocity( void ) const
{
vel = ( vel * m_instrumentTrack->getVolume() ) / DefaultVolume;
}
return( qMin( MidiMaxVelocity, vel * MidiMaxVelocity / DefaultVolume ) );
return qMin( MidiMaxVelocity, vel * MidiMaxVelocity / DefaultVolume );
}
@@ -181,7 +181,7 @@ void notePlayHandle::play( sampleFrame * _working_buffer )
return;
}
if( m_released == FALSE &&
if( m_released == false &&
m_totalFramesPlayed + engine::getMixer()->framesPerPeriod()
>= m_frames )
{
@@ -287,14 +287,14 @@ f_cnt_t notePlayHandle::framesLeft( void ) const
{
if( m_released && actualReleaseFramesToDo() == 0 )
{
return( m_framesBeforeRelease );
return m_framesBeforeRelease;
}
else if( m_released && actualReleaseFramesToDo() >= m_releaseFramesDone )
{
return( m_framesBeforeRelease + actualReleaseFramesToDo() -
m_releaseFramesDone );
return m_framesBeforeRelease + actualReleaseFramesToDo() -
m_releaseFramesDone;
}
return( m_frames+actualReleaseFramesToDo()-m_totalFramesPlayed );
return m_frames+actualReleaseFramesToDo()-m_totalFramesPlayed;
}
@@ -302,7 +302,7 @@ f_cnt_t notePlayHandle::framesLeft( void ) const
bool notePlayHandle::isFromTrack( const track * _track ) const
{
return( m_instrumentTrack == _track || m_bbTrack == _track );
return m_instrumentTrack == _track || m_bbTrack == _track;
}
@@ -337,7 +337,7 @@ void notePlayHandle::noteOff( const f_cnt_t _s )
engine::framesPerTick() ) );
}
m_released = TRUE;
m_released = true;
}
@@ -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()*/ );
}
@@ -367,7 +367,7 @@ void notePlayHandle::setFrames( const f_cnt_t _frames )
float notePlayHandle::volumeLevel( const f_cnt_t _frame )
{
return( m_instrumentTrack->m_soundShaping.volumeLevel( this, _frame ) );
return m_instrumentTrack->m_soundShaping.volumeLevel( this, _frame );
}
@@ -381,7 +381,7 @@ void notePlayHandle::mute( void )
{
( *it )->mute();
}
m_muted = TRUE;
m_muted = true;
}
@@ -398,7 +398,7 @@ int notePlayHandle::index( void ) const
dynamic_cast<const notePlayHandle *>( *it );
if( nph == NULL ||
nph->m_instrumentTrack != m_instrumentTrack ||
nph->released() == TRUE )
nph->released() == true )
{
continue;
}
@@ -408,7 +408,7 @@ int notePlayHandle::index( void ) const
}
++idx;
}
return( idx );
return idx;
}
@@ -426,12 +426,12 @@ constNotePlayHandleVector notePlayHandle::nphsOfInstrumentTrack(
const notePlayHandle * nph =
dynamic_cast<const notePlayHandle *>( *it );
if( nph != NULL && nph->m_instrumentTrack == _it &&
( nph->released() == FALSE || _all_ph == TRUE ) )
( nph->released() == false || _all_ph == true ) )
{
cnphv.push_back( nph );
}
}
return( cnphv );
return cnphv;
}
@@ -439,7 +439,7 @@ constNotePlayHandleVector notePlayHandle::nphsOfInstrumentTrack(
bool notePlayHandle::operator==( const notePlayHandle & _nph ) const
{
return( length() == _nph.length() &&
return length() == _nph.length() &&
pos() == _nph.pos() &&
key() == _nph.key() &&
getVolume() == _nph.getVolume() &&
@@ -451,7 +451,7 @@ bool notePlayHandle::operator==( const notePlayHandle & _nph ) const
m_released == _nph.m_released &&
m_baseNote == _nph.m_baseNote &&
m_partOfArpeggio == _nph.m_partOfArpeggio &&
m_muted == _nph.m_muted );
m_muted == _nph.m_muted;
}

View File

@@ -101,7 +101,7 @@ void fileBrowser::addItems( const QString & _path )
QString cur_file = *it;
if( cur_file[0] != '.' )
{
bool orphan = TRUE;
bool orphan = true;
for( int i = 0; i < m_l->topLevelItemCount(); ++i )
{
directory * d = dynamic_cast<directory *>(
@@ -111,13 +111,13 @@ void fileBrowser::addItems( const QString & _path )
m_l->insertTopLevelItem( i,
new directory( cur_file, _path,
m_filter ) );
orphan = FALSE;
orphan = false;
break;
}
else if( cur_file == d->text( 0 ) )
{
d->addDirectory( _path );
orphan = FALSE;
orphan = false;
break;
}
}
@@ -173,7 +173,7 @@ void fileBrowser::keyPressEvent( QKeyEvent * _ke )
listView::listView( QWidget * _parent ) :
QTreeWidget( _parent ),
m_mousePressed( FALSE ),
m_mousePressed( false ),
m_pressPos(),
m_previewPlayHandle( NULL ),
m_pphMutex( QMutex::Recursive ),
@@ -181,7 +181,7 @@ listView::listView( QWidget * _parent ) :
{
setColumnCount( 1 );
setHeaderLabel( tr( "Files" ) );
setSortingEnabled( FALSE );
setSortingEnabled( false );
setFont( pointSizeF( font(), 7.5f ) );
@@ -249,7 +249,7 @@ void listView::mousePressEvent( QMouseEvent * _me )
// header()->mapToActual( 0 ) ) )
// {
m_pressPos = _me->pos();
m_mousePressed = TRUE;
m_mousePressed = true;
// }
}
@@ -278,7 +278,7 @@ void listView::mousePressEvent( QMouseEvent * _me )
QEventLoop::ExcludeUserInputEvents );
samplePlayHandle * s = new samplePlayHandle(
f->fullName() );
s->setDoneMayReturnTrue( FALSE );
s->setDoneMayReturnTrue( false );
m_previewPlayHandle = s;
delete tf;
}
@@ -307,7 +307,7 @@ void listView::mousePressEvent( QMouseEvent * _me )
void listView::mouseMoveEvent( QMouseEvent * _me )
{
if( m_mousePressed == TRUE &&
if( m_mousePressed == true &&
( m_pressPos - _me->pos() ).manhattanLength() >
QApplication::startDragDistance() )
{
@@ -355,7 +355,7 @@ void listView::mouseMoveEvent( QMouseEvent * _me )
void listView::mouseReleaseEvent( QMouseEvent * _me )
{
m_mousePressed = FALSE;
m_mousePressed = false;
m_pphMutex.lock();
if( m_previewPlayHandle != NULL )
@@ -371,7 +371,7 @@ void listView::mouseReleaseEvent( QMouseEvent * _me )
static_cast<f_cnt_t>( engine::getMixer()->
processingSampleRate() * 3 ) )
{
s->setDoneMayReturnTrue( TRUE );
s->setDoneMayReturnTrue( true );
m_previewPlayHandle = NULL;
m_pphMutex.unlock();
return;
@@ -504,7 +504,7 @@ void listView::sendToActiveInstrumentTrack( void )
instrumentTrackWindow * itw =
dynamic_cast<instrumentTrackWindow *>(
w.previous()->widget() );
if( itw != NULL && itw->isHidden() == FALSE )
if( itw != NULL && itw->isHidden() == false )
{
handleFile( m_contextMenuItem, itw->model() );
break;
@@ -619,12 +619,12 @@ bool directory::addItems( const QString & _path )
QDir thisDir( _path );
if( !thisDir.isReadable() )
{
return( FALSE );
return false;
}
treeWidget()->setUpdatesEnabled( FALSE );
treeWidget()->setUpdatesEnabled( false );
bool added_something = FALSE;
bool added_something = false;
QStringList files = thisDir.entryList( QDir::Dirs, QDir::Name );
for( QStringList::const_iterator it = files.constBegin();
@@ -633,7 +633,7 @@ bool directory::addItems( const QString & _path )
QString cur_file = *it;
if( cur_file[0] != '.' )
{
bool orphan = TRUE;
bool orphan = true;
for( int i = 0; i < childCount(); ++i )
{
directory * d = dynamic_cast<directory *>(
@@ -642,13 +642,13 @@ bool directory::addItems( const QString & _path )
{
insertChild( i, new directory( cur_file,
_path, m_filter ) );
orphan = FALSE;
orphan = false;
break;
}
else if( cur_file == d->text( 0 ) )
{
d->addDirectory( _path );
orphan = FALSE;
orphan = false;
break;
}
}
@@ -658,7 +658,7 @@ bool directory::addItems( const QString & _path )
m_filter ) );
}
added_something = TRUE;
added_something = true;
}
}
@@ -672,13 +672,13 @@ bool directory::addItems( const QString & _path )
/*QDir::match( FILE_FILTER, cur_file )*/ )
{
(void) new fileItem( this, cur_file, _path );
added_something = TRUE;
added_something = true;
}
}
treeWidget()->setUpdatesEnabled( TRUE );
treeWidget()->setUpdatesEnabled( true );
return( added_something );
return added_something;
}
@@ -838,7 +838,7 @@ void fileItem::determineFileType( void )
QString fileItem::extension( void )
{
return( extension( fullName() ) );
return extension( fullName() );
}
@@ -846,7 +846,7 @@ QString fileItem::extension( void )
QString fileItem::extension( const QString & _file )
{
return( QFileInfo( _file ).suffix().toLower() );
return QFileInfo( _file ).suffix().toLower();
}