Renamed type noteVector to NoteVector

Renamed type noteVector to NoteVector as well as ::iterator to
::Iterator and ::const_iterator to ::ConstIterator.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit e12476f79c)
This commit is contained in:
Tobias Doerffel
2009-06-18 23:24:56 +02:00
parent 87e44aa241
commit 7a632277b8
6 changed files with 74 additions and 74 deletions

View File

@@ -243,7 +243,7 @@ private:
} ;
typedef QVector<note *> noteVector;
typedef QVector<note *> NoteVector;
#endif

View File

@@ -78,7 +78,7 @@ public:
void rearrangeAllNotes( void );
void clearNotes( void );
inline const noteVector & notes( void )
inline const NoteVector & notes( void ) const
{
return m_notes;
}
@@ -154,7 +154,7 @@ private:
PatternTypes m_patternType;
// data-stuff
noteVector m_notes;
NoteVector m_notes;
int m_steps;
// pattern freezing

View File

@@ -109,7 +109,7 @@ protected:
int _width, note * _n );
void removeSelection( void );
void selectAll( void );
void getSelectedNotes( noteVector & _selected_notes );
void getSelectedNotes( NoteVector & _selected_notes );
protected slots:
@@ -150,7 +150,7 @@ private:
ModeDraw,
ModeErase,
ModeSelect,
ModeOpen
ModeOpen,
};
enum actions
@@ -306,12 +306,12 @@ private:
timeLine * m_timeLine;
bool m_scrollBack;
void copy_to_clipboard( const noteVector & _notes ) const;
void copy_to_clipboard( const NoteVector & _notes ) const;
void drawDetuningInfo( QPainter & _p, note * _n, int _x, int _y );
bool mouseOverNote( void );
note * noteUnderMouse( void );
noteVector::const_iterator noteIteratorUnderMouse( void );
NoteVector::const_iterator noteIteratorUnderMouse( void );
// turn a selection rectangle into selected notes
void computeSelectedNotes( bool shift );

View File

@@ -568,13 +568,13 @@ void pianoRoll::setCurrentPattern( pattern * _new_pattern )
m_leftRightScroll->setValue( 0 );
const noteVector & notes = m_pattern->notes();
const NoteVector & notes = m_pattern->notes();
int central_key = 0;
if( notes.empty() == false )
{
// determine the central key so that we can scroll to it
int total_notes = 0;
for( noteVector::const_iterator it = notes.begin();
for( NoteVector::ConstIterator it = notes.begin();
it != notes.end(); ++it )
{
if( ( *it )->length() > 0 )
@@ -725,7 +725,7 @@ inline void pianoRoll::drawDetuningInfo( QPainter & _p, note * _n, int _x,
_p.setPen( QColor( 0xFF, 0xDF, 0x20 ) );
timeMap & map = _n->detuning()->getAutomationPattern()->getTimeMap();
for( timeMap::const_iterator it = map.begin(); it != map.end(); ++it )
for( timeMap::ConstIterator it = map.begin(); it != map.end(); ++it )
{
Sint32 pos_ticks = it.key();
if( pos_ticks > _n->length() )
@@ -764,10 +764,10 @@ void pianoRoll::clearSelectedNotes( void )
if( m_pattern != NULL )
{
// get note-vector of current pattern
const noteVector & notes = m_pattern->notes();
const NoteVector & notes = m_pattern->notes();
// will be our iterator in the following loop
noteVector::const_iterator it = notes.begin();
NoteVector::ConstIterator it = notes.begin();
while( it != notes.end() )
{
( *it )->setSelected( false );
@@ -800,8 +800,8 @@ void pianoRoll::closeEvent( QCloseEvent * _ce )
void pianoRoll::shiftSemiTone( int amount ) // shift notes by amount semitones
{
bool useAllNotes = ! isSelection();
const noteVector & notes = m_pattern->notes();
for( noteVector::const_iterator it = notes.begin(); it != notes.end();
const NoteVector & notes = m_pattern->notes();
for( NoteVector::ConstIterator it = notes.begin(); it != notes.end();
++it )
{
// if none are selected, move all notes, otherwise
@@ -824,10 +824,10 @@ void pianoRoll::shiftSemiTone( int amount ) // shift notes by amount semitones
void pianoRoll::shiftPos( int amount ) //shift notes pos by amount
{
bool useAllNotes = ! isSelection();
const noteVector & notes = m_pattern->notes();
const NoteVector & notes = m_pattern->notes();
bool first = true;
for( noteVector::const_iterator it = notes.begin(); it != notes.end();
for( NoteVector::ConstIterator it = notes.begin(); it != notes.end();
++it )
{
// if none are selected, move all notes, otherwise
@@ -858,8 +858,8 @@ void pianoRoll::shiftPos( int amount ) //shift notes pos by amount
bool pianoRoll::isSelection( void ) const // are any notes selected?
{
const noteVector & notes = m_pattern->notes();
for( noteVector::const_iterator it = notes.begin(); it != notes.end();
const NoteVector & notes = m_pattern->notes();
for( NoteVector::ConstIterator it = notes.begin(); it != notes.end();
++it )
{
if( ( *it )->selected() )
@@ -877,8 +877,8 @@ int pianoRoll::selectionCount( void ) const // how many notes are selected?
{
int sum = 0;
const noteVector & notes = m_pattern->notes();
for( noteVector::const_iterator it = notes.begin(); it != notes.end();
const NoteVector & notes = m_pattern->notes();
for( NoteVector::ConstIterator it = notes.begin(); it != notes.end();
++it )
{
if( ( *it )->selected() )
@@ -1347,10 +1347,10 @@ void pianoRoll::mousePressEvent( QMouseEvent * _me )
// get note-vector of current pattern
const noteVector & notes = m_pattern->notes();
const NoteVector & notes = m_pattern->notes();
// will be our iterator in the following loop
noteVector::const_iterator it = notes.begin();
NoteVector::ConstIterator it = notes.begin();
// loop through whole note-vector...
while( it != notes.end() )
@@ -1683,8 +1683,8 @@ void pianoRoll::testPlayNote( note * n )
void pianoRoll::pauseTestNotes( bool _pause )
{
const noteVector & notes = m_pattern->notes();
noteVector::const_iterator it = notes.begin();
const NoteVector & notes = m_pattern->notes();
NoteVector::ConstIterator it = notes.begin();
while( it != notes.end() )
{
if( ( *it )->isPlaying() )
@@ -1765,9 +1765,9 @@ void pianoRoll::computeSelectedNotes(bool shift)
//int y_base = noteEditTop() - 1;
if( validPattern() == true )
{
const noteVector & notes = m_pattern->notes();
const NoteVector & notes = m_pattern->notes();
for( noteVector::const_iterator it = notes.begin();
for( NoteVector::ConstIterator it = notes.begin();
it != notes.end(); ++it )
{
// make a new selection unless they're holding shift
@@ -1859,9 +1859,9 @@ void pianoRoll::mouseReleaseEvent( QMouseEvent * _me )
if( validPattern() == true )
{
// turn off all notes that are playing
const noteVector & notes = m_pattern->notes();
const NoteVector & notes = m_pattern->notes();
noteVector::const_iterator it = notes.begin();
NoteVector::ConstIterator it = notes.begin();
while( it != notes.end() )
{
if( ( *it )->isPlaying() )
@@ -1992,7 +1992,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me )
midiTime::ticksPerTact() / m_ppt + m_currentPosition;
// get note-vector of current pattern
const noteVector & notes = m_pattern->notes();
const NoteVector & notes = m_pattern->notes();
// determine what volume/panning to set note to
volume_t vol = tLimit<int>( MinVolume +
@@ -2019,7 +2019,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me )
// loop through vector
bool use_selection = isSelection();
noteVector::const_iterator it = notes.begin();
NoteVector::ConstIterator it = notes.begin();
while( it != notes.end() )
{
if( ( *it )->pos().getTicks() >= ticks_start
@@ -2080,10 +2080,10 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me )
m_ppt + m_currentPosition;
// get note-vector of current pattern
const noteVector & notes = m_pattern->notes();
const NoteVector & notes = m_pattern->notes();
// will be our iterator in the following loop
noteVector::const_iterator it = notes.begin();
NoteVector::ConstIterator it = notes.begin();
// loop through whole note-vector...
while( it != notes.end() )
@@ -2200,10 +2200,10 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me )
// get note-vector of current pattern
const noteVector & notes = m_pattern->notes();
const NoteVector & notes = m_pattern->notes();
// will be our iterator in the following loop
noteVector::const_iterator it = notes.begin();
NoteVector::ConstIterator it = notes.begin();
// loop through whole note-vector...
while( it != notes.end() )
@@ -2380,10 +2380,10 @@ void pianoRoll::dragNotes( int x, int y, bool alt )
}
// get note-vector of current pattern
const noteVector & notes = m_pattern->notes();
const NoteVector & notes = m_pattern->notes();
// will be our iterator in the following loop
noteVector::const_iterator it = notes.begin();
NoteVector::ConstIterator it = notes.begin();
while( it != notes.end() )
{
if( ( *it )->selected() )
@@ -2709,14 +2709,14 @@ void pianoRoll::paintEvent( QPaintEvent * _pe )
width() - WHITE_KEY_WIDTH,
height() - PR_TOP_MARGIN );
const noteVector & notes = m_pattern->notes();
const NoteVector & notes = m_pattern->notes();
const int visible_keys = ( keyAreaBottom()-keyAreaTop() ) /
KEY_LINE_HEIGHT + 2;
QPolygon editHandles;
for( noteVector::const_iterator it = notes.begin();
for( NoteVector::ConstIterator it = notes.begin();
it != notes.end(); ++it )
{
Sint32 len_ticks = ( *it )->length();
@@ -3219,12 +3219,12 @@ void pianoRoll::selectAll( void )
return;
}
const noteVector & notes = m_pattern->notes();
const NoteVector & notes = m_pattern->notes();
// if first_time = true, we HAVE to set the vars for select
bool first_time = true;
for( noteVector::const_iterator it = notes.begin(); it != notes.end();
for( NoteVector::ConstIterator it = notes.begin(); it != notes.end();
++it )
{
Uint32 len_ticks = ( *it )->length();
@@ -3271,16 +3271,16 @@ void pianoRoll::selectAll( void )
// returns vector with pointers to all selected notes
void pianoRoll::getSelectedNotes( noteVector & _selected_notes )
void pianoRoll::getSelectedNotes( NoteVector & _selected_notes )
{
if( validPattern() == false )
{
return;
}
const noteVector & notes = m_pattern->notes();
const NoteVector & notes = m_pattern->notes();
for( noteVector::const_iterator it = notes.begin(); it != notes.end();
for( NoteVector::ConstIterator it = notes.begin(); it != notes.end();
++it )
{
if( ( *it )->selected() )
@@ -3293,14 +3293,14 @@ void pianoRoll::getSelectedNotes( noteVector & _selected_notes )
void pianoRoll::copy_to_clipboard( const noteVector & _notes ) const
void pianoRoll::copy_to_clipboard( const NoteVector & _notes ) const
{
multimediaProject mmp( multimediaProject::ClipboardData );
QDomElement note_list = mmp.createElement( "note-list" );
mmp.content().appendChild( note_list );
midiTime start_pos( _notes.front()->pos().getTact(), 0 );
for( noteVector::const_iterator it = _notes.begin(); it != _notes.end();
for( NoteVector::ConstIterator it = _notes.begin(); it != _notes.end();
++it )
{
note clip_note( **it );
@@ -3319,7 +3319,7 @@ void pianoRoll::copy_to_clipboard( const noteVector & _notes ) const
void pianoRoll::copySelectedNotes( void )
{
noteVector selected_notes;
NoteVector selected_notes;
getSelectedNotes( selected_notes );
if( selected_notes.empty() == false )
@@ -3338,7 +3338,7 @@ void pianoRoll::cutSelectedNotes( void )
return;
}
noteVector selected_notes;
NoteVector selected_notes;
getSelectedNotes( selected_notes );
if( selected_notes.empty() == false )
@@ -3347,7 +3347,7 @@ void pianoRoll::cutSelectedNotes( void )
engine::getSong()->setModified();
for( noteVector::iterator it = selected_notes.begin();
for( NoteVector::Iterator it = selected_notes.begin();
it != selected_notes.end(); ++it )
{
// note (the memory of it) is also deleted by
@@ -3420,10 +3420,10 @@ void pianoRoll::deleteSelectedNotes( void )
// get note-vector of current pattern
const noteVector & notes = m_pattern->notes();
const NoteVector & notes = m_pattern->notes();
// will be our iterator in the following loop
noteVector::const_iterator it = notes.begin();
NoteVector::ConstIterator it = notes.begin();
while( it != notes.end() )
{
if( ( *it )->selected() )
@@ -3585,12 +3585,12 @@ note * pianoRoll::noteUnderMouse( void )
noteVector::const_iterator pianoRoll::noteIteratorUnderMouse( void )
NoteVector::ConstIterator pianoRoll::noteIteratorUnderMouse( void )
{
QPoint pos = mapFromGlobal( QCursor::pos() );
// get note-vector of current pattern
const noteVector & notes = m_pattern->notes();
const NoteVector & notes = m_pattern->notes();
if( pos.x() <= WHITE_KEY_WIDTH || pos.x() > width() - SCROLLBAR_SIZE
|| pos.y() < PR_TOP_MARGIN
@@ -3604,7 +3604,7 @@ noteVector::const_iterator pianoRoll::noteIteratorUnderMouse( void )
midiTime::ticksPerTact() / m_ppt + m_currentPosition;
// will be our iterator in the following loop
noteVector::const_iterator it = notes.begin();
NoteVector::ConstIterator it = notes.begin();
// loop through whole note-vector...
while( it != notes.end() )

View File

@@ -597,7 +597,7 @@ bool instrumentTrack::play( const midiTime & _start,
bool played_a_note = false; // will be return variable
for( tcoVector::iterator it = tcos.begin(); it != tcos.end(); ++it )
for( tcoVector::Iterator it = tcos.begin(); it != tcos.end(); ++it )
{
pattern * p = dynamic_cast<pattern *>( *it );
// everything which is not a pattern or muted won't be played
@@ -627,9 +627,9 @@ bool instrumentTrack::play( const midiTime & _start,
}
// get all notes from the given pattern...
const noteVector & notes = p->notes();
const NoteVector & notes = p->notes();
// ...and set our index to zero
noteVector::const_iterator it = notes.begin();
NoteVector::ConstIterator it = notes.begin();
#if LMMS_SINGERBOT_SUPPORT
int note_idx = 0;
#endif

View File

@@ -88,7 +88,7 @@ pattern::pattern( const pattern & _pat_to_copy ) :
m_frozenPattern( NULL ),
m_freezeAborted( false )
{
for( noteVector::const_iterator it = _pat_to_copy.m_notes.begin();
for( NoteVector::ConstIterator it = _pat_to_copy.m_notes.begin();
it != _pat_to_copy.m_notes.end(); ++it )
{
m_notes.push_back( new note( **it ) );
@@ -100,7 +100,7 @@ pattern::pattern( const pattern & _pat_to_copy ) :
pattern::~pattern()
{
for( noteVector::iterator it = m_notes.begin();
for( NoteVector::Iterator it = m_notes.begin();
it != m_notes.end(); ++it )
{
delete *it;
@@ -141,7 +141,7 @@ midiTime pattern::length( void ) const
tick_t max_length = midiTime::ticksPerTact();
for( noteVector::const_iterator it = m_notes.begin();
for( NoteVector::ConstIterator it = m_notes.begin();
it != m_notes.end(); ++it )
{
if( ( *it )->length() > 0 )
@@ -161,7 +161,7 @@ midiTime pattern::beatPatternLength( void ) const
{
tick_t max_length = midiTime::ticksPerTact();
for( noteVector::const_iterator it = m_notes.begin();
for( NoteVector::ConstIterator it = m_notes.begin();
it != m_notes.end(); ++it )
{
if( ( *it )->length() < 0 )
@@ -206,7 +206,7 @@ note * pattern::addNote( const note & _new_note, const bool _quant_pos )
// going forward or backward but note-inserting isn't that
// time-critical since it is usually not done while playing...
long new_note_abs_time = new_note->pos();
noteVector::iterator it = m_notes.begin();
NoteVector::Iterator it = m_notes.begin();
while( it != m_notes.end() &&
( *it )->pos() < new_note_abs_time )
@@ -234,7 +234,7 @@ note * pattern::addNote( const note & _new_note, const bool _quant_pos )
void pattern::removeNote( const note * _note_to_del )
{
engine::getMixer()->lock();
noteVector::iterator it = m_notes.begin();
NoteVector::Iterator it = m_notes.begin();
while( it != m_notes.end() )
{
if( *it == _note_to_del )
@@ -282,7 +282,7 @@ void pattern::rearrangeAllNotes( void )
void pattern::clearNotes( void )
{
engine::getMixer()->lock();
for( noteVector::iterator it = m_notes.begin(); it != m_notes.end();
for( NoteVector::Iterator it = m_notes.begin(); it != m_notes.end();
++it )
{
delete *it;
@@ -299,7 +299,7 @@ void pattern::clearNotes( void )
void pattern::setStep( int _step, bool _enabled )
{
for( noteVector::iterator it = m_notes.begin(); it != m_notes.end();
for( NoteVector::Iterator it = m_notes.begin(); it != m_notes.end();
++it )
{
if( ( *it )->pos() == _step*DefaultTicksPerTact/16 &&
@@ -328,7 +328,7 @@ void pattern::setType( PatternTypes _new_pattern_type )
void pattern::checkType( void )
{
noteVector::iterator it = m_notes.begin();
NoteVector::Iterator it = m_notes.begin();
while( it != m_notes.end() )
{
if( ( *it )->length() > 0 )
@@ -366,7 +366,7 @@ void pattern::saveSettings( QDomDocument & _doc, QDomElement & _this )
_this.setAttribute( "frozen", m_frozenPattern != NULL );
// now save settings of all notes
for( noteVector::iterator it = m_notes.begin();
for( NoteVector::Iterator it = m_notes.begin();
it != m_notes.end(); ++it )
{
if( ( *it )->length() )
@@ -506,7 +506,7 @@ void pattern::removeSteps( int _n )
{
for( int i = m_steps - _n; i < m_steps; ++i )
{
for( noteVector::iterator it = m_notes.begin();
for( NoteVector::Iterator it = m_notes.begin();
it != m_notes.end(); ++it )
{
if( ( *it )->pos() ==
@@ -542,7 +542,7 @@ void pattern::ensureBeatNotes( void )
for( int i = 0; i < m_steps; ++i )
{
bool found = false;
for( noteVector::iterator it = m_notes.begin();
for( NoteVector::Iterator it = m_notes.begin();
it != m_notes.end(); ++it )
{
if( ( *it )->pos() ==
@@ -579,7 +579,7 @@ void pattern::updateBBTrack( void )
bool pattern::empty( void )
{
for( noteVector::const_iterator it = m_notes.begin();
for( NoteVector::ConstIterator it = m_notes.begin();
it != m_notes.end(); ++it )
{
if( ( *it )->length() != 0 )
@@ -596,7 +596,7 @@ bool pattern::empty( void )
void pattern::changeTimeSignature( void )
{
midiTime last_pos = midiTime::ticksPerTact();
for( noteVector::const_iterator cit = m_notes.begin();
for( NoteVector::ConstIterator cit = m_notes.begin();
cit != m_notes.end(); ++cit )
{
if( ( *cit )->length() < 0 && ( *cit )->pos() > last_pos )
@@ -606,7 +606,7 @@ void pattern::changeTimeSignature( void )
}
}
last_pos = last_pos.nextFullTact() * midiTime::ticksPerTact();
for( noteVector::iterator it = m_notes.begin(); it != m_notes.end(); )
for( NoteVector::Iterator it = m_notes.begin(); it != m_notes.end(); )
{
if( ( *it )->length() == 0 && ( *it )->pos() >= last_pos )
{
@@ -1180,7 +1180,7 @@ void patternView::paintEvent( QPaintEvent * )
// first determine the central tone so that we can
// display the area where most of the m_notes are
int total_notes = 0;
for( noteVector::iterator it = m_pat->m_notes.begin();
for( NoteVector::Iterator it = m_pat->m_notes.begin();
it != m_pat->m_notes.end(); ++it )
{
if( ( *it )->length() > 0 )
@@ -1211,7 +1211,7 @@ void patternView::paintEvent( QPaintEvent * )
p.setPen( QColor( 0xFF, 0xB0, 0x00 ) );
}
for( noteVector::iterator it =
for( NoteVector::Iterator it =
m_pat->m_notes.begin();
it != m_pat->m_notes.end(); ++it )
{
@@ -1261,7 +1261,7 @@ void patternView::paintEvent( QPaintEvent * )
s_stepBtnOffLight->height(),
Qt::IgnoreAspectRatio,
Qt::SmoothTransformation );
for( noteVector::iterator it = m_pat->m_notes.begin();
for( NoteVector::Iterator it = m_pat->m_notes.begin();
it != m_pat->m_notes.end(); ++it )
{
const int no = ( *it )->pos() / DefaultBeatsPerTact;