diff --git a/include/note.h b/include/note.h index 7c1d90f92..5c989bdb0 100644 --- a/include/note.h +++ b/include/note.h @@ -243,7 +243,7 @@ private: } ; -typedef QVector noteVector; +typedef QVector NoteVector; #endif diff --git a/include/pattern.h b/include/pattern.h index 6deeb2dfc..e427e83a0 100644 --- a/include/pattern.h +++ b/include/pattern.h @@ -78,7 +78,7 @@ public: void rearrangeAllNotes( void ); void clearNotes( void ); - inline const noteVector & notes( void ) const + 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 diff --git a/include/piano_roll.h b/include/piano_roll.h index ec60bce11..5cc2e9382 100644 --- a/include/piano_roll.h +++ b/include/piano_roll.h @@ -116,7 +116,7 @@ protected: int _width, note * _n ); void removeSelection( void ); void selectAll( void ); - void getSelectedNotes( noteVector & _selected_notes ); + void getSelectedNotes( NoteVector & _selected_notes ); protected slots: @@ -152,7 +152,7 @@ private: ModeDraw, ModeErase, ModeSelect, - ModeOpen + ModeOpen, }; enum Actions @@ -308,12 +308,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 ); diff --git a/src/gui/classic_style.cpp b/src/gui/classic_style.cpp index bcc49c879..a05d3396b 100644 --- a/src/gui/classic_style.cpp +++ b/src/gui/classic_style.cpp @@ -445,7 +445,7 @@ void ClassicStyle::drawTrackContentObject( QPainter * _painter, // first determine the central tone so that we can // display the area where most of the notes are int total_notes = 0; - for( noteVector::const_iterator it = pat->notes().begin(); + for( NoteVector::ConstIterator it = pat->notes().begin(); it != pat->notes().end(); ++it ) { if( ( *it )->length() > 0 ) @@ -476,7 +476,7 @@ void ClassicStyle::drawTrackContentObject( QPainter * _painter, p->setPen( color( LmmsStyle::PianoRollDefaultNote ) ); } - for( noteVector::const_iterator it = + for( NoteVector::ConstIterator it = pat->notes().begin(); it != pat->notes().end(); ++it ) { @@ -530,7 +530,7 @@ void ClassicStyle::drawTrackContentObject( QPainter * _painter, 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; diff --git a/src/gui/piano_roll.cpp b/src/gui/piano_roll.cpp index 7e8d78592..9424410a9 100644 --- a/src/gui/piano_roll.cpp +++ b/src/gui/piano_roll.cpp @@ -576,13 +576,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 ) @@ -733,7 +733,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() ) @@ -772,10 +772,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 ); @@ -808,8 +808,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 @@ -832,10 +832,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 @@ -866,8 +866,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 )->isSelected() ) @@ -885,8 +885,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 )->isSelected() ) @@ -1355,10 +1355,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() ) @@ -1691,8 +1691,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() ) @@ -1773,9 +1773,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 @@ -1867,9 +1867,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() ) @@ -2000,7 +2000,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( MinVolume + @@ -2027,7 +2027,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 @@ -2088,10 +2088,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() ) @@ -2208,10 +2208,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() ) @@ -2388,10 +2388,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 )->isSelected() ) @@ -2717,7 +2717,7 @@ void pianoRoll::paintEvent( QPaintEvent * _pe ) width() - WhiteKeyWidth, height() - TopMargin ); - const noteVector & notes = m_pattern->notes(); + const NoteVector & notes = m_pattern->notes(); const int visible_keys = ( keyAreaBottom()-keyAreaTop() ) / KeyLineHeight + 2; @@ -2731,7 +2731,7 @@ void pianoRoll::paintEvent( QPaintEvent * _pe ) QPolygon editHandles; - for( noteVector::const_iterator it = notes.begin(); + for( NoteVector::ConstIterator it = notes.begin(); it != notes.end(); ++it ) { Sint32 len_ticks = ( *it )->length(); @@ -3229,12 +3229,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(); @@ -3281,16 +3281,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 )->isSelected() ) @@ -3303,14 +3303,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 ); @@ -3329,7 +3329,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 ) @@ -3348,7 +3348,7 @@ void pianoRoll::cutSelectedNotes( void ) return; } - noteVector selected_notes; + NoteVector selected_notes; getSelectedNotes( selected_notes ); if( selected_notes.empty() == false ) @@ -3357,7 +3357,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 @@ -3430,10 +3430,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 )->isSelected() ) @@ -3595,12 +3595,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() <= WhiteKeyWidth || pos.x() > width() - ScrollBarSize || pos.y() < TopMargin @@ -3614,7 +3614,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() ) diff --git a/src/tracks/instrument_track.cpp b/src/tracks/instrument_track.cpp index 59e7d859d..3a90f350f 100644 --- a/src/tracks/instrument_track.cpp +++ b/src/tracks/instrument_track.cpp @@ -605,7 +605,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( *it ); // everything which is not a pattern or muted won't be played @@ -635,9 +635,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 diff --git a/src/tracks/pattern.cpp b/src/tracks/pattern.cpp index 1c8cbafc8..8e7aa0704 100644 --- a/src/tracks/pattern.cpp +++ b/src/tracks/pattern.cpp @@ -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 ) @@ -1212,7 +1212,7 @@ void patternView::paintEvent( QPaintEvent * ) p.setPen( lStyle->color( LmmsStyle::PianoRollDefaultNote ) ); } - for( noteVector::iterator it = + for( NoteVector::Iterator it = m_pat->m_notes.begin(); it != m_pat->m_notes.end(); ++it ) { @@ -1262,7 +1262,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;