From ce972c5e5074ca5964468eeb99e4e4b0da88e797 Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Mon, 5 Jan 2015 20:45:07 -0200 Subject: [PATCH 001/133] Update coding conventions on Note.cpp --- src/core/Note.cpp | 107 +++++++++++++++++++++++----------------------- 1 file changed, 53 insertions(+), 54 deletions(-) diff --git a/src/core/Note.cpp b/src/core/Note.cpp index fca078587..8e6791b5c 100644 --- a/src/core/Note.cpp +++ b/src/core/Note.cpp @@ -35,24 +35,24 @@ -Note::Note( const MidiTime & _length, const MidiTime & _pos, - int _key, volume_t _volume, panning_t _panning, - DetuningHelper * _detuning ) : +Note::Note( const MidiTime & length, const MidiTime & pos, + int key, volume_t volume, panning_t panning, + DetuningHelper * detuning ) : m_selected( false ), - m_oldKey( qBound( 0, _key, NumKeys ) ), - m_oldPos( _pos ), - m_oldLength( _length ), + m_oldKey( qBound( 0, key, NumKeys ) ), + m_oldPos( pos ), + m_oldLength( length ), m_isPlaying( false ), - m_key( qBound( 0, _key, NumKeys ) ), - m_volume( qBound( MinVolume, _volume, MaxVolume ) ), - m_panning( qBound( PanningLeft, _panning, PanningRight ) ), - m_length( _length ), - m_pos( _pos ), + m_key( qBound( 0, key, NumKeys ) ), + m_volume( qBound( MinVolume, volume, MaxVolume ) ), + m_panning( qBound( PanningLeft, panning, PanningRight ) ), + m_length( length ), + m_pos( pos ), m_detuning( NULL ) { - if( _detuning ) + if( detuning ) { - m_detuning = sharedObject::ref( _detuning ); + m_detuning = sharedObject::ref( detuning ); } else { @@ -63,23 +63,23 @@ Note::Note( const MidiTime & _length, const MidiTime & _pos, -Note::Note( const Note & _note ) : - SerializingObject( _note ), - m_selected( _note.m_selected ), - m_oldKey( _note.m_oldKey ), - m_oldPos( _note.m_oldPos ), - m_oldLength( _note.m_oldLength ), - m_isPlaying( _note.m_isPlaying ), - m_key( _note.m_key), - m_volume( _note.m_volume ), - m_panning( _note.m_panning ), - m_length( _note.m_length ), - m_pos( _note.m_pos ), +Note::Note( const Note & note ) : + SerializingObject( note ), + m_selected( note.m_selected ), + m_oldKey( note.m_oldKey ), + m_oldPos( note.m_oldPos ), + m_oldLength( note.m_oldLength ), + m_isPlaying( note.m_isPlaying ), + m_key( note.m_key), + m_volume( note.m_volume ), + m_panning( note.m_panning ), + m_length( note.m_length ), + m_pos( note.m_pos ), m_detuning( NULL ) { - if( _note.m_detuning ) + if( note.m_detuning ) { - m_detuning = sharedObject::ref( _note.m_detuning ); + m_detuning = sharedObject::ref( note.m_detuning ); } } @@ -97,93 +97,93 @@ Note::~Note() -void Note::setLength( const MidiTime & _length ) +void Note::setLength( const MidiTime & length ) { - m_length = _length; + m_length = length; } -void Note::setPos( const MidiTime & _pos ) +void Note::setPos( const MidiTime & pos ) { - m_pos = _pos; + m_pos = pos; } -void Note::setKey( const int _key ) +void Note::setKey( const int key ) { - const int k = qBound( 0, _key, NumKeys ); + const int k = qBound( 0, key, NumKeys ); m_key = k; } -void Note::setVolume( volume_t _volume ) +void Note::setVolume( volume_t volume ) { - const volume_t v = qBound( MinVolume, _volume, MaxVolume ); + const volume_t v = qBound( MinVolume, volume, MaxVolume ); m_volume = v; } -void Note::setPanning( panning_t _panning ) +void Note::setPanning( panning_t panning ) { - const panning_t p = qBound( PanningLeft, _panning, PanningRight ); + const panning_t p = qBound( PanningLeft, panning, PanningRight ); m_panning = p; } -MidiTime Note::quantized( const MidiTime & _m, const int _q_grid ) +MidiTime Note::quantized( const MidiTime & m, const int qGrid ) { - float p = ( (float) _m / _q_grid ); + float p = ( (float) m / qGrid ); if( p - floorf( p ) < 0.5f ) { - return( static_cast( p ) * _q_grid ); + return static_cast( p ) * qGrid; } - return( static_cast( p + 1 ) * _q_grid ); + return static_cast( p + 1 ) * qGrid; } -void Note::quantizeLength( const int _q_grid ) +void Note::quantizeLength( const int qGrid ) { - setLength( quantized( length(), _q_grid ) ); + setLength( quantized( length(), qGrid ) ); if( length() == 0 ) { - setLength( _q_grid ); + setLength( qGrid ); } } -void Note::quantizePos( const int _q_grid ) +void Note::quantizePos( const int qGrid ) { - setPos( quantized( pos(), _q_grid ) ); + setPos( quantized( pos(), qGrid ) ); } -void Note::saveSettings( QDomDocument & _doc, QDomElement & _this ) +void Note::saveSettings( QDomDocument & doc, QDomElement & parent ) { - _this.setAttribute( "key", m_key ); - _this.setAttribute( "vol", m_volume ); - _this.setAttribute( "pan", m_panning ); - _this.setAttribute( "len", m_length ); - _this.setAttribute( "pos", m_pos ); + parent.setAttribute( "key", m_key ); + parent.setAttribute( "vol", m_volume ); + parent.setAttribute( "pan", m_panning ); + parent.setAttribute( "len", m_length ); + parent.setAttribute( "pos", m_pos ); if( m_detuning && m_length ) { - m_detuning->saveSettings( _doc, _this ); + m_detuning->saveSettings( doc, parent ); } } @@ -239,4 +239,3 @@ bool Note::hasDetuningInfo() const - From 87f6dd0a035ee9add2093f94470fdc4e9672b899 Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Mon, 5 Jan 2015 20:45:46 -0200 Subject: [PATCH 002/133] Update coding conventions on Note.h --- include/Note.h | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/include/Note.h b/include/Note.h index eb36462a6..13f91b182 100644 --- a/include/Note.h +++ b/include/Note.h @@ -81,36 +81,36 @@ const float MaxDetuning = 4 * 12.0f; class EXPORT Note : public SerializingObject { public: - Note( const MidiTime & _length = MidiTime( 0 ), - const MidiTime & _pos = MidiTime( 0 ), + Note( const MidiTime & length = MidiTime( 0 ), + const MidiTime & pos = MidiTime( 0 ), int key = DefaultKey, - volume_t _volume = DefaultVolume, - panning_t _panning = DefaultPanning, - DetuningHelper * _detuning = NULL ); - Note( const Note & _note ); + volume_t volume = DefaultVolume, + panning_t panning = DefaultPanning, + DetuningHelper * detuning = NULL ); + Note( const Note & note ); virtual ~Note(); // used by GUI - inline void setSelected( const bool _selected ){ m_selected = _selected; } - inline void setOldKey( const int _oldKey ){ m_oldKey = _oldKey; } - inline void setOldPos( const MidiTime & _oldPos ){ m_oldPos = _oldPos; } - inline void setOldLength( const MidiTime & _oldLength ) + inline void setSelected( const bool selected ){ m_selected = selected; } + inline void setOldKey( const int oldKey ){ m_oldKey = oldKey; } + inline void setOldPos( const MidiTime & oldPos ){ m_oldPos = oldPos; } + inline void setOldLength( const MidiTime & oldLength ) { - m_oldLength = _oldLength; + m_oldLength = oldLength; } - inline void setIsPlaying( const bool _isPlaying ) + inline void setIsPlaying( const bool isPlaying ) { - m_isPlaying = _isPlaying; + m_isPlaying = isPlaying; } - void setLength( const MidiTime & _length ); - void setPos( const MidiTime & _pos ); - void setKey( const int _key ); + void setLength( const MidiTime & length ); + void setPos( const MidiTime & pos ); + void setKey( const int key ); virtual void setVolume( volume_t volume ); virtual void setPanning( panning_t panning ); - void quantizeLength( const int _q_grid ); - void quantizePos( const int _q_grid ); + void quantizeLength( const int qGrid ); + void quantizePos( const int qGrid ); static inline bool lessThan( Note * &lhs, Note * &rhs ) { @@ -160,9 +160,9 @@ public: return m_pos; } - inline MidiTime pos( MidiTime _base_pos ) const + inline MidiTime pos( MidiTime basePos ) const { - const int bp = _base_pos; + const int bp = basePos; return m_pos - bp; } @@ -196,7 +196,7 @@ public: return classNodeName(); } - static MidiTime quantized( const MidiTime & _m, const int _q_grid ); + static MidiTime quantized( const MidiTime & m, const int qGrid ); DetuningHelper * detuning() const { @@ -209,8 +209,7 @@ public: protected: - virtual void saveSettings( QDomDocument & _doc, - QDomElement & _parent ); + virtual void saveSettings( QDomDocument & doc, QDomElement & parent ); virtual void loadSettings( const QDomElement & _this ); @@ -238,4 +237,3 @@ typedef QVector NoteVector; #endif - From ba20c99a51f1f2d6817898a5f29164e6a74e2fbf Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Mon, 5 Jan 2015 22:10:09 -0200 Subject: [PATCH 003/133] Update coding conventions --- src/core/Track.cpp | 605 ++++++++++++++++++++++----------------------- 1 file changed, 300 insertions(+), 305 deletions(-) diff --git a/src/core/Track.cpp b/src/core/Track.cpp index 5acbb6477..5a9dd2caf 100644 --- a/src/core/Track.cpp +++ b/src/core/Track.cpp @@ -99,9 +99,9 @@ TextFloat * TrackContentObjectView::s_textFloat = NULL; * * \param _track The track that will contain the new object */ -TrackContentObject::TrackContentObject( Track * _track ) : - Model( _track ), - m_track( _track ), +TrackContentObject::TrackContentObject( Track * track ) : + Model( track ), + m_track( track ), m_name( QString::null ), m_startPosition(), m_length(), @@ -146,11 +146,11 @@ TrackContentObject::~TrackContentObject() * * \param _pos The new position of the track content object. */ -void TrackContentObject::movePosition( const MidiTime & _pos ) +void TrackContentObject::movePosition( const MidiTime & pos ) { - if( m_startPosition != _pos ) + if( m_startPosition != pos ) { - m_startPosition = _pos; + m_startPosition = pos; Engine::getSong()->updateLength(); } emit positionChanged(); @@ -166,11 +166,11 @@ void TrackContentObject::movePosition( const MidiTime & _pos ) * * \param _length The new length of the track content object. */ -void TrackContentObject::changeLength( const MidiTime & _length ) +void TrackContentObject::changeLength( const MidiTime & length ) { - if( m_length != _length ) + if( m_length != length ) { - m_length = _length; + m_length = length; Engine::getSong()->updateLength(); } emit lengthChanged(); @@ -241,12 +241,12 @@ void TrackContentObject::toggleMute() * \param _tco The track content object to be displayed * \param _tv The track view that will contain the new object */ -TrackContentObjectView::TrackContentObjectView( TrackContentObject * _tco, - TrackView * _tv ) : - selectableObject( _tv->getTrackContentWidget() ), +TrackContentObjectView::TrackContentObjectView( TrackContentObject * tco, + TrackView * tv ) : + selectableObject( tv->getTrackContentWidget() ), ModelView( NULL, this ), - m_tco( _tco ), - m_trackView( _tv ), + m_tco( tco ), + m_trackView( tv ), m_action( NoAction ), m_autoResize( false ), m_initialMousePos( QPoint( 0, 0 ) ), @@ -268,7 +268,7 @@ TrackContentObjectView::TrackContentObjectView( TrackContentObject * _tco, move( 0, 1 ); show(); - setFixedHeight( _tv->getTrackContentWidget()->height() - 2 ); + setFixedHeight( tv->getTrackContentWidget()->height() - 2 ); setAcceptDrops( true ); setMouseTracking( true ); @@ -328,12 +328,12 @@ QColor TrackContentObjectView::textColor() const { return m_textColor; } //! \brief CSS theming qproperty access method -void TrackContentObjectView::setFgColor( const QColor & _c ) -{ m_fgColor = QColor( _c ); } +void TrackContentObjectView::setFgColor( const QColor & c ) +{ m_fgColor = QColor( c ); } //! \brief CSS theming qproperty access method -void TrackContentObjectView::setTextColor( const QColor & _c ) -{ m_textColor = QColor( _c ); } +void TrackContentObjectView::setTextColor( const QColor & c ) +{ m_textColor = QColor( c ); } /*! \brief Close a trackContentObjectView @@ -434,19 +434,19 @@ void TrackContentObjectView::updatePosition() * We need to notify Qt to change our display if something being * dragged has entered our 'airspace'. * - * \param _dee The QDragEnterEvent to watch. + * \param dee The QDragEnterEvent to watch. */ -void TrackContentObjectView::dragEnterEvent( QDragEnterEvent * _dee ) +void TrackContentObjectView::dragEnterEvent( QDragEnterEvent * dee ) { TrackContentWidget * tcw = getTrackView()->getTrackContentWidget(); MidiTime tcoPos = MidiTime( m_tco->startPosition().getTact(), 0 ); - if( tcw->canPasteSelection( tcoPos, _dee->mimeData() ) == false ) + if( tcw->canPasteSelection( tcoPos, dee->mimeData() ) == false ) { - _dee->ignore(); + dee->ignore(); } else { - StringPairDrag::processDragEnterEvent( _dee, "tco_" + + StringPairDrag::processDragEnterEvent( dee, "tco_" + QString::number( m_tco->getTrack()->type() ) ); } } @@ -461,12 +461,12 @@ void TrackContentObjectView::dragEnterEvent( QDragEnterEvent * _dee ) * to take the xml of the track content object and turn it into something * we can write over our current state. * - * \param _de The QDropEvent to handle. + * \param de The QDropEvent to handle. */ -void TrackContentObjectView::dropEvent( QDropEvent * _de ) +void TrackContentObjectView::dropEvent( QDropEvent * de ) { - QString type = StringPairDrag::decodeKey( _de ); - QString value = StringPairDrag::decodeValue( _de ); + QString type = StringPairDrag::decodeKey( de ); + QString value = StringPairDrag::decodeValue( de ); // Track must be the same type to paste into if( type != ( "tco_" + QString::number( m_tco->getTrack()->type() ) ) ) @@ -479,15 +479,15 @@ void TrackContentObjectView::dropEvent( QDropEvent * _de ) { TrackContentWidget * tcw = getTrackView()->getTrackContentWidget(); MidiTime tcoPos = MidiTime( m_tco->startPosition().getTact(), 0 ); - if( tcw->pasteSelection( tcoPos, _de ) == true ) + if( tcw->pasteSelection( tcoPos, de ) == true ) { - _de->accept(); + de->accept(); } return; } // Don't allow pasting a tco into itself. - QObject* qwSource = _de->source(); + QObject* qwSource = de->source(); if( qwSource != NULL && dynamic_cast( qwSource ) == this ) { @@ -501,7 +501,7 @@ void TrackContentObjectView::dropEvent( QDropEvent * _de ) m_tco->restoreState( tcos.firstChildElement().firstChildElement() ); m_tco->movePosition( pos ); AutomationPattern::resolveAllIDs(); - _de->accept(); + de->accept(); } @@ -509,17 +509,17 @@ void TrackContentObjectView::dropEvent( QDropEvent * _de ) /*! \brief Handle a dragged selection leaving our 'airspace'. * - * \param _e The QEvent to watch. + * \param e The QEvent to watch. */ -void TrackContentObjectView::leaveEvent( QEvent * _e ) +void TrackContentObjectView::leaveEvent( QEvent * e ) { while( QApplication::overrideCursor() != NULL ) { QApplication::restoreOverrideCursor(); } - if( _e != NULL ) + if( e != NULL ) { - QWidget::leaveEvent( _e ); + QWidget::leaveEvent( e ); } } @@ -585,20 +585,20 @@ DataFile TrackContentObjectView::createTCODataFiles( * * or if ctrl-middle button, mute the track content object * * or if middle button, maybe delete the track content object. * - * \param _me The QMouseEvent to handle. + * \param me The QMouseEvent to handle. */ -void TrackContentObjectView::mousePressEvent( QMouseEvent * _me ) +void TrackContentObjectView::mousePressEvent( QMouseEvent * me ) { - setInitialMousePos( _me->pos() ); + setInitialMousePos( me->pos() ); if( m_trackView->trackContainerView()->allowRubberband() == true && - _me->button() == Qt::LeftButton ) + me->button() == Qt::LeftButton ) { if( m_trackView->trackContainerView()->rubberBandActive() == true ) { // Propagate to trackView for rubberbanding - selectableObject::mousePressEvent( _me ); + selectableObject::mousePressEvent( me ); } - else if ( _me->modifiers() & Qt::ControlModifier ) + else if ( me->modifiers() & Qt::ControlModifier ) { if( isSelected() == true ) { @@ -609,7 +609,7 @@ void TrackContentObjectView::mousePressEvent( QMouseEvent * _me ) m_action = ToggleSelected; } } - else if( !_me->modifiers() ) + else if( !me->modifiers() ) { if( isSelected() == true ) { @@ -617,8 +617,8 @@ void TrackContentObjectView::mousePressEvent( QMouseEvent * _me ) } } } - else if( _me->button() == Qt::LeftButton && - _me->modifiers() & Qt::ControlModifier ) + else if( me->button() == Qt::LeftButton && + me->modifiers() & Qt::ControlModifier ) { // start drag-action QVector tcoViews; @@ -632,7 +632,7 @@ void TrackContentObjectView::mousePressEvent( QMouseEvent * _me ) m_tco->getTrack()->type() ), dataFile.toString(), thumbnail, this ); } - else if( _me->button() == Qt::LeftButton && + else if( me->button() == Qt::LeftButton && /* engine::mainWindow()->isShiftPressed() == false &&*/ fixedTCOs() == false ) { @@ -641,9 +641,9 @@ void TrackContentObjectView::mousePressEvent( QMouseEvent * _me ) // move or resize m_tco->setJournalling( false ); - setInitialMousePos( _me->pos() ); + setInitialMousePos( me->pos() ); - if( _me->x() < width() - RESIZE_GRIP_WIDTH ) + if( me->x() < width() - RESIZE_GRIP_WIDTH ) { m_action = Move; m_oldTime = m_tco->startPosition(); @@ -671,23 +671,23 @@ void TrackContentObjectView::mousePressEvent( QMouseEvent * _me ) } // s_textFloat->reparent( this ); // setup text-float as if TCO was already moved/resized - mouseMoveEvent( _me ); + mouseMoveEvent( me ); s_textFloat->show(); } - else if( _me->button() == Qt::RightButton ) + else if( me->button() == Qt::RightButton ) { - if( _me->modifiers() & Qt::ControlModifier ) + if( me->modifiers() & Qt::ControlModifier ) { m_tco->toggleMute(); } - else if( _me->modifiers() & Qt::ShiftModifier && fixedTCOs() == false ) + else if( me->modifiers() & Qt::ShiftModifier && fixedTCOs() == false ) { remove(); } } - else if( _me->button() == Qt::MidButton ) + else if( me->button() == Qt::MidButton ) { - if( _me->modifiers() & Qt::ControlModifier ) + if( me->modifiers() & Qt::ControlModifier ) { m_tco->toggleMute(); } @@ -711,17 +711,17 @@ void TrackContentObjectView::mousePressEvent( QMouseEvent * _me ) * * or if in resize mode, resize ourselves, * * otherwise ??? * - * \param _me The QMouseEvent to handle. + * \param me The QMouseEvent to handle. * \todo what does the final else case do here? */ -void TrackContentObjectView::mouseMoveEvent( QMouseEvent * _me ) +void TrackContentObjectView::mouseMoveEvent( QMouseEvent * me ) { if( m_action == CopySelection ) { - if( mouseMovedDistance( _me, 2 ) == true && + if( mouseMovedDistance( me, 2 ) == true && m_trackView->trackContainerView()->allowRubberband() == true && m_trackView->trackContainerView()->rubberBandActive() == false && - ( _me->modifiers() & Qt::ControlModifier ) ) + ( me->modifiers() & Qt::ControlModifier ) ) { // Clear the action here because mouseReleaseEvent will not get // triggered once we go into drag. @@ -756,7 +756,7 @@ void TrackContentObjectView::mouseMoveEvent( QMouseEvent * _me ) } } - if( _me->modifiers() & Qt::ControlModifier ) + if( me->modifiers() & Qt::ControlModifier ) { delete m_hint; m_hint = NULL; @@ -765,13 +765,13 @@ void TrackContentObjectView::mouseMoveEvent( QMouseEvent * _me ) const float ppt = m_trackView->trackContainerView()->pixelsPerTact(); if( m_action == Move ) { - const int x = mapToParent( _me->pos() ).x() - m_initialMousePos.x(); + const int x = mapToParent( me->pos() ).x() - m_initialMousePos.x(); MidiTime t = qMax( 0, (int) m_trackView->trackContainerView()->currentPosition()+ static_cast( x * MidiTime::ticksPerTact() / ppt ) ); - if( ! ( _me->modifiers() & Qt::ControlModifier ) - && _me->button() == Qt::NoButton ) + if( ! ( me->modifiers() & Qt::ControlModifier ) + && me->button() == Qt::NoButton ) { t = t.toNearestTact(); } @@ -786,7 +786,7 @@ void TrackContentObjectView::mouseMoveEvent( QMouseEvent * _me ) } else if( m_action == MoveSelection ) { - const int dx = _me->x() - m_initialMousePos.x(); + const int dx = me->x() - m_initialMousePos.x(); QVector so = m_trackView->trackContainerView()->selectedObjects(); QVector tcos; @@ -815,8 +815,8 @@ void TrackContentObjectView::mouseMoveEvent( QMouseEvent * _me ) t = ( *it )->startPosition() + static_cast( dx *MidiTime::ticksPerTact() / ppt )-smallest_pos; - if( ! ( _me->modifiers() & Qt::AltModifier ) - && _me->button() == Qt::NoButton ) + if( ! ( me->modifiers() & Qt::AltModifier ) + && me->button() == Qt::NoButton ) { t = t.toNearestTact(); } @@ -825,8 +825,8 @@ void TrackContentObjectView::mouseMoveEvent( QMouseEvent * _me ) } else if( m_action == Resize ) { - MidiTime t = qMax( MidiTime::ticksPerTact() / 16, static_cast( _me->x() * MidiTime::ticksPerTact() / ppt ) ); - if( ! ( _me->modifiers() & Qt::ControlModifier ) && _me->button() == Qt::NoButton ) + MidiTime t = qMax( MidiTime::ticksPerTact() / 16, static_cast( me->x() * MidiTime::ticksPerTact() / ppt ) ); + if( ! ( me->modifiers() & Qt::ControlModifier ) && me->button() == Qt::NoButton ) { t = qMax( MidiTime::ticksPerTact(), t.toNearestTact() ); } @@ -846,7 +846,7 @@ void TrackContentObjectView::mouseMoveEvent( QMouseEvent * _me ) } else { - if( _me->x() > width() - RESIZE_GRIP_WIDTH && !_me->buttons() ) + if( me->x() > width() - RESIZE_GRIP_WIDTH && !me->buttons() ) { if( QApplication::overrideCursor() != NULL && QApplication::overrideCursor()->shape() != @@ -875,16 +875,16 @@ void TrackContentObjectView::mouseMoveEvent( QMouseEvent * _me ) * If we're in move or resize mode, journal the change as appropriate. * Then tidy up. * - * \param _me The QMouseEvent to handle. + * \param me The QMouseEvent to handle. */ -void TrackContentObjectView::mouseReleaseEvent( QMouseEvent * _me ) +void TrackContentObjectView::mouseReleaseEvent( QMouseEvent * me ) { // If the CopySelection was chosen as the action due to mouse movement, // it will have been cleared. At this point Toggle is the desired action. // An active StringPairDrag will prevent this method from being called, // so a real CopySelection would not have occurred. if( m_action == CopySelection || - ( m_action == ToggleSelected && mouseMovedDistance( _me, 2 ) == false ) ) + ( m_action == ToggleSelected && mouseMovedDistance( me, 2 ) == false ) ) { setSelected( !isSelected() ); } @@ -898,7 +898,7 @@ void TrackContentObjectView::mouseReleaseEvent( QMouseEvent * _me ) m_hint = NULL; s_textFloat->hide(); leaveEvent( NULL ); - selectableObject::mouseReleaseEvent( _me ); + selectableObject::mouseReleaseEvent( me ); } @@ -909,11 +909,11 @@ void TrackContentObjectView::mouseReleaseEvent( QMouseEvent * _me ) * Set up the various context menu events that can apply to a * track content object view. * - * \param _cme The QContextMenuEvent to add the actions to. + * \param cme The QContextMenuEvent to add the actions to. */ -void TrackContentObjectView::contextMenuEvent( QContextMenuEvent * _cme ) +void TrackContentObjectView::contextMenuEvent( QContextMenuEvent * cme ) { - if( _cme->modifiers() ) + if( cme->modifiers() ) { return; } @@ -959,12 +959,12 @@ float TrackContentObjectView::pixelsPerTact() /*! \brief Set whether this trackContentObjectView can resize. * - * \param _e The boolean state of whether this track content object view + * \param e The boolean state of whether this track content object view * is allowed to resize. */ -void TrackContentObjectView::setAutoResizeEnabled( bool _e ) +void TrackContentObjectView::setAutoResizeEnabled( bool e ) { - m_autoResize = _e; + m_autoResize = e; } @@ -975,9 +975,9 @@ void TrackContentObjectView::setAutoResizeEnabled( bool _e ) * \param _me The QMouseEvent. * \param distance The threshold distance that the mouse has moved to return true. */ -bool TrackContentObjectView::mouseMovedDistance( QMouseEvent * _me, int distance ) +bool TrackContentObjectView::mouseMovedDistance( QMouseEvent * me, int distance ) { - QPoint dPos = mapToGlobal( _me->pos() ) - m_initialMouseGlobalPos; + QPoint dPos = mapToGlobal( me->pos() ) - m_initialMouseGlobalPos; const int pixelsMoved = dPos.manhattanLength(); return ( pixelsMoved > distance || pixelsMoved < -distance ); } @@ -994,17 +994,17 @@ bool TrackContentObjectView::mouseMovedDistance( QMouseEvent * _me, int distance * The content widget comprises the 'grip bar' and the 'tools' button * for the track's context menu. * - * \param _track The parent track. + * \param parent The parent track. */ -TrackContentWidget::TrackContentWidget( TrackView * _parent ) : - QWidget( _parent ), - m_trackView( _parent ), +TrackContentWidget::TrackContentWidget( TrackView * parent ) : + QWidget( parent ), + m_trackView( parent ), m_darkerColor( Qt::SolidPattern ), m_lighterColor( Qt::SolidPattern ) { setAcceptDrops( true ); - connect( _parent->trackContainerView(), + connect( parent->trackContainerView(), SIGNAL( positionChanged( const MidiTime & ) ), this, SLOT( changePosition( const MidiTime & ) ) ); @@ -1074,13 +1074,13 @@ void TrackContentWidget::updateBackground() * Adds a(nother) trackContentObjectView to our list of views. We also * check that our position is up-to-date. * - * \param _tcov The trackContentObjectView to add. + * \param tcov The trackContentObjectView to add. */ -void TrackContentWidget::addTCOView( TrackContentObjectView * _tcov ) +void TrackContentWidget::addTCOView( TrackContentObjectView * tcov ) { - TrackContentObject * tco = _tcov->getTrackContentObject(); + TrackContentObject * tco = tcov->getTrackContentObject(); - m_tcoViews.push_back( _tcov ); + m_tcoViews.push_back( tcov ); tco->saveJournallingState( false ); changePosition(); @@ -1094,13 +1094,13 @@ void TrackContentWidget::addTCOView( TrackContentObjectView * _tcov ) * * Removes the given trackContentObjectView from our list of views. * - * \param _tcov The trackContentObjectView to add. + * \param tcov The trackContentObjectView to add. */ -void TrackContentWidget::removeTCOView( TrackContentObjectView * _tcov ) +void TrackContentWidget::removeTCOView( TrackContentObjectView * tcov ) { tcoViewVector::iterator it = qFind( m_tcoViews.begin(), m_tcoViews.end(), - _tcov ); + tcov ); if( it != m_tcoViews.end() ) { m_tcoViews.erase( it ); @@ -1132,13 +1132,13 @@ void TrackContentWidget::update() // change of visible viewport /*! \brief Move the trackContentWidget to a new place in time * - * \param _new_pos The MIDI time to move to. + * \param newPos The MIDI time to move to. */ -void TrackContentWidget::changePosition( const MidiTime & _new_pos ) +void TrackContentWidget::changePosition( const MidiTime & newPos ) { if( m_trackView->trackContainerView() == Engine::getBBEditor() ) { - const int cur_bb = Engine::getBBTrackContainer()->currentBB(); + const int curBB = Engine::getBBTrackContainer()->currentBB(); setUpdatesEnabled( false ); // first show TCO for current BB... @@ -1146,7 +1146,7 @@ void TrackContentWidget::changePosition( const MidiTime & _new_pos ) it != m_tcoViews.end(); ++it ) { if( ( *it )->getTrackContentObject()-> - startPosition().getTact() == cur_bb ) + startPosition().getTact() == curBB ) { ( *it )->move( 0, ( *it )->y() ); ( *it )->raise(); @@ -1162,7 +1162,7 @@ void TrackContentWidget::changePosition( const MidiTime & _new_pos ) it != m_tcoViews.end(); ++it ) { if( ( *it )->getTrackContentObject()-> - startPosition().getTact() != cur_bb ) + startPosition().getTact() != curBB ) { ( *it )->hide(); } @@ -1171,7 +1171,7 @@ void TrackContentWidget::changePosition( const MidiTime & _new_pos ) return; } - MidiTime pos = _new_pos; + MidiTime pos = newPos; if( pos < 0 ) { pos = m_trackView->trackContainerView()->currentPosition(); @@ -1220,13 +1220,13 @@ void TrackContentWidget::changePosition( const MidiTime & _new_pos ) /*! \brief Return the position of the trackContentWidget in Tacts. * - * \param _mouse_x the mouse's current X position in pixels. + * \param mouseX the mouse's current X position in pixels. */ -MidiTime TrackContentWidget::getPosition( int _mouse_x ) +MidiTime TrackContentWidget::getPosition( int mouseX ) { TrackContainerView * tv = m_trackView->trackContainerView(); return MidiTime( tv->currentPosition() + - _mouse_x * + mouseX * MidiTime::ticksPerTact() / static_cast( tv->pixelsPerTact() ) ); } @@ -1236,18 +1236,18 @@ MidiTime TrackContentWidget::getPosition( int _mouse_x ) /*! \brief Respond to a drag enter event on the trackContentWidget * - * \param _dee the Drag Enter Event to respond to + * \param dee the Drag Enter Event to respond to */ -void TrackContentWidget::dragEnterEvent( QDragEnterEvent * _dee ) +void TrackContentWidget::dragEnterEvent( QDragEnterEvent * dee ) { - MidiTime tcoPos = MidiTime( getPosition( _dee->pos().x() ).getTact(), 0 ); - if( canPasteSelection( tcoPos, _dee->mimeData() ) == false ) + MidiTime tcoPos = MidiTime( getPosition( dee->pos().x() ).getTact(), 0 ); + if( canPasteSelection( tcoPos, dee->mimeData() ) == false ) { - _dee->ignore(); + dee->ignore(); } else { - StringPairDrag::processDragEnterEvent( _dee, "tco_" + + StringPairDrag::processDragEnterEvent( dee, "tco_" + QString::number( getTrack()->type() ) ); } } @@ -1258,7 +1258,7 @@ void TrackContentWidget::dragEnterEvent( QDragEnterEvent * _dee ) /*! \brief Returns whether a selection of TCOs can be pasted into this * * \param tcoPos the position of the TCO slot being pasted on - * \param _de the DropEvent generated + * \param de the DropEvent generated */ bool TrackContentWidget::canPasteSelection( MidiTime tcoPos, const QMimeData * mimeData ) { @@ -1301,7 +1301,7 @@ bool TrackContentWidget::canPasteSelection( MidiTime tcoPos, const QMimeData * m QDomNodeList tcoNodes = tcoParent.childNodes(); // Determine if all the TCOs will land on a valid track - for( int i = 0; imimeData() ) == false ) + if( canPasteSelection( tcoPos, de->mimeData() ) == false ) { return false; } - QString type = StringPairDrag::decodeKey( _de ); - QString value = StringPairDrag::decodeValue( _de ); + QString type = StringPairDrag::decodeKey( de ); + QString value = StringPairDrag::decodeValue( de ); getTrack()->addJournalCheckPoint(); @@ -1412,14 +1412,14 @@ bool TrackContentWidget::pasteSelection( MidiTime tcoPos, QDropEvent * _de ) /*! \brief Respond to a drop event on the trackContentWidget * - * \param _de the Drop Event to respond to + * \param de the Drop Event to respond to */ -void TrackContentWidget::dropEvent( QDropEvent * _de ) +void TrackContentWidget::dropEvent( QDropEvent * de ) { - MidiTime tcoPos = MidiTime( getPosition( _de->pos().x() ).getTact(), 0 ); - if( pasteSelection( tcoPos, _de ) == true ) + MidiTime tcoPos = MidiTime( getPosition( de->pos().x() ).getTact(), 0 ); + if( pasteSelection( tcoPos, de ) == true ) { - _de->accept(); + de->accept(); } } @@ -1428,29 +1428,28 @@ void TrackContentWidget::dropEvent( QDropEvent * _de ) /*! \brief Respond to a mouse press on the trackContentWidget * - * \param _me the mouse press event to respond to + * \param me the mouse press event to respond to */ -void TrackContentWidget::mousePressEvent( QMouseEvent * _me ) +void TrackContentWidget::mousePressEvent( QMouseEvent * me ) { if( m_trackView->trackContainerView()->allowRubberband() == true ) { - QWidget::mousePressEvent( _me ); + QWidget::mousePressEvent( me ); } - else if( _me->modifiers() & Qt::ShiftModifier ) + else if( me->modifiers() & Qt::ShiftModifier ) { - QWidget::mousePressEvent( _me ); + QWidget::mousePressEvent( me ); } - else if( _me->button() == Qt::LeftButton && + else if( me->button() == Qt::LeftButton && !m_trackView->trackContainerView()->fixedTCOs() ) { - const MidiTime pos = getPosition( _me->x() ).getTact() * + const MidiTime pos = getPosition( me->x() ).getTact() * MidiTime::ticksPerTact(); TrackContentObject * tco = getTrack()->createTCO( pos ); tco->saveJournallingState( false ); tco->movePosition( pos ); tco->restoreJournallingState(); - } } @@ -1459,9 +1458,9 @@ void TrackContentWidget::mousePressEvent( QMouseEvent * _me ) /*! \brief Repaint the trackContentWidget on command * - * \param _pe the Paint Event to respond to + * \param pe the Paint Event to respond to */ -void TrackContentWidget::paintEvent( QPaintEvent * _pe ) +void TrackContentWidget::paintEvent( QPaintEvent * pe ) { // Assume even-pixels-per-tact. Makes sense, should be like this anyways const TrackContainerView * tcv = m_trackView->trackContainerView(); @@ -1506,13 +1505,13 @@ Track * TrackContentWidget::getTrack() /*! \brief Return the end position of the trackContentWidget in Tacts. * - * \param _pos_start the starting position of the Widget (from getPosition()) + * \param posStart the starting position of the Widget (from getPosition()) */ -MidiTime TrackContentWidget::endPosition( const MidiTime & _pos_start ) +MidiTime TrackContentWidget::endPosition( const MidiTime & posStart ) { const float ppt = m_trackView->trackContainerView()->pixelsPerTact(); const int w = width(); - return _pos_start + static_cast( w * MidiTime::ticksPerTact() / ppt ); + return posStart + static_cast( w * MidiTime::ticksPerTact() / ppt ); } @@ -1549,11 +1548,11 @@ QPixmap * TrackOperationsWidget::s_grip = NULL; /*!< grip pixmap */ * * The trackOperationsWidget is the grip and the mute button of a track. * - * \param _parent the trackView to contain this widget + * \param parent the trackView to contain this widget */ -TrackOperationsWidget::TrackOperationsWidget( TrackView * _parent ) : - QWidget( _parent ), /*!< The parent widget */ - m_trackView( _parent ) /*!< The parent track view */ +TrackOperationsWidget::TrackOperationsWidget( TrackView * parent ) : + QWidget( parent ), /*!< The parent widget */ + m_trackView( parent ) /*!< The parent track view */ { if( s_grip == NULL ) { @@ -1564,9 +1563,9 @@ TrackOperationsWidget::TrackOperationsWidget( TrackView * _parent ) : ToolTip::add( this, tr( "Press while clicking on move-grip " "to begin a new drag'n'drop-action." ) ); - QMenu * to_menu = new QMenu( this ); - to_menu->setFont( pointSize<9>( to_menu->font() ) ); - connect( to_menu, SIGNAL( aboutToShow() ), this, SLOT( updateMenu() ) ); + QMenu * toMenu = new QMenu( this ); + toMenu->setFont( pointSize<9>( toMenu->font() ) ); + connect( toMenu, SIGNAL( aboutToShow() ), this, SLOT( updateMenu() ) ); setObjectName( "automationEnabled" ); @@ -1575,7 +1574,7 @@ TrackOperationsWidget::TrackOperationsWidget( TrackView * _parent ) : m_trackOps = new QPushButton( this ); m_trackOps->move( 12, 1 ); m_trackOps->setFocusPolicy( Qt::NoFocus ); - m_trackOps->setMenu( to_menu ); + m_trackOps->setMenu( toMenu ); ToolTip::add( m_trackOps, tr( "Actions for this track" ) ); @@ -1634,12 +1633,12 @@ TrackOperationsWidget::~TrackOperationsWidget() * * Otherwise, ignore all other events. * - * \param _me The mouse event to respond to. + * \param me The mouse event to respond to. */ -void TrackOperationsWidget::mousePressEvent( QMouseEvent * _me ) +void TrackOperationsWidget::mousePressEvent( QMouseEvent * me ) { - if( _me->button() == Qt::LeftButton && - _me->modifiers() & Qt::ControlModifier && + if( me->button() == Qt::LeftButton && + me->modifiers() & Qt::ControlModifier && m_trackView->getTrack()->type() != Track::BBTrack ) { DataFile dataFile( DataFile::DragNDropData ); @@ -1650,17 +1649,16 @@ void TrackOperationsWidget::mousePressEvent( QMouseEvent * _me ) m_trackView->getTrackSettingsWidget() ), this ); } - else if( _me->button() == Qt::LeftButton ) + else if( me->button() == Qt::LeftButton ) { // track-widget (parent-widget) initiates track-move - _me->ignore(); + me->ignore(); } } - /*! \brief Repaint the trackOperationsWidget * * If we're not moving, and in the Beat+Bassline Editor, then turn @@ -1670,9 +1668,9 @@ void TrackOperationsWidget::mousePressEvent( QMouseEvent * _me ) * Otherwise, hide ourselves. * * \todo Flesh this out a bit - is it correct? - * \param _pe The paint event to respond to + * \param pe The paint event to respond to */ -void TrackOperationsWidget::paintEvent( QPaintEvent * _pe ) +void TrackOperationsWidget::paintEvent( QPaintEvent * pe ) { QPainter p( this ); p.fillRect( rect(), palette().brush(QPalette::Background) ); @@ -1735,30 +1733,30 @@ void TrackOperationsWidget::removeTrack() */ void TrackOperationsWidget::updateMenu() { - QMenu * to_menu = m_trackOps->menu(); - to_menu->clear(); - to_menu->addAction( embed::getIconPixmap( "edit_copy", 16, 16 ), + QMenu * toMenu = m_trackOps->menu(); + toMenu->clear(); + toMenu->addAction( embed::getIconPixmap( "edit_copy", 16, 16 ), tr( "Clone this track" ), this, SLOT( cloneTrack() ) ); - to_menu->addAction( embed::getIconPixmap( "cancel", 16, 16 ), + toMenu->addAction( embed::getIconPixmap( "cancel", 16, 16 ), tr( "Remove this track" ), this, SLOT( removeTrack() ) ); if( ! m_trackView->trackContainerView()->fixedTCOs() ) { - to_menu->addAction( tr( "Clear this track" ), this, SLOT( clearTrack() ) ); + toMenu->addAction( tr( "Clear this track" ), this, SLOT( clearTrack() ) ); } if( dynamic_cast( m_trackView ) ) { - to_menu->addSeparator(); - to_menu->addMenu( dynamic_cast( + toMenu->addSeparator(); + toMenu->addMenu( dynamic_cast( m_trackView )->midiMenu() ); } if( dynamic_cast( m_trackView ) ) { - to_menu->addAction( tr( "Turn all recording on" ), this, SLOT( recordingOn() ) ); - to_menu->addAction( tr( "Turn all recording off" ), this, SLOT( recordingOff() ) ); + toMenu->addAction( tr( "Turn all recording on" ), this, SLOT( recordingOn() ) ); + toMenu->addAction( tr( "Turn all recording off" ), this, SLOT( recordingOff() ) ); } } @@ -1804,15 +1802,15 @@ void TrackOperationsWidget::recordingOff() * The track object is the whole track, linking its contents, its * automation, name, type, and so forth. * - * \param _type The type of track (Song Editor or Beat+Bassline Editor) - * \param _tc The track Container object to encapsulate in this track. + * \param type The type of track (Song Editor or Beat+Bassline Editor) + * \param tc The track Container object to encapsulate in this track. * * \todo check the definitions of all the properties - are they OK? */ -Track::Track( TrackTypes _type, TrackContainer * _tc ) : - Model( _tc ), /*!< The track Model */ - m_trackContainer( _tc ), /*!< The track container object */ - m_type( _type ), /*!< The track type */ +Track::Track( TrackTypes type, TrackContainer * tc ) : + Model( tc ), /*!< The track Model */ + m_trackContainer( tc ), /*!< The track container object */ + m_type( type ), /*!< The track type */ m_name(), /*!< The track's name */ m_mutedModel( false, this, tr( "Muted" ) ), /*!< For controlling track muting */ @@ -1857,27 +1855,27 @@ Track::~Track() /*! \brief Create a track based on the given track type and container. * - * \param _tt The type of track to create - * \param _tc The track container to attach to + * \param tt The type of track to create + * \param tc The track container to attach to */ -Track * Track::create( TrackTypes _tt, TrackContainer * _tc ) +Track * Track::create( TrackTypes tt, TrackContainer * tc ) { Track * t = NULL; - switch( _tt ) + switch( tt ) { - case InstrumentTrack: t = new ::InstrumentTrack( _tc ); break; - case BBTrack: t = new ::BBTrack( _tc ); break; - case SampleTrack: t = new ::SampleTrack( _tc ); break; + case InstrumentTrack: t = new ::InstrumentTrack( tc ); break; + case BBTrack: t = new ::BBTrack( tc ); break; + case SampleTrack: t = new ::SampleTrack( tc ); break; // case EVENT_TRACK: // case VIDEO_TRACK: - case AutomationTrack: t = new ::AutomationTrack( _tc ); break; + case AutomationTrack: t = new ::AutomationTrack( tc ); break; case HiddenAutomationTrack: - t = new ::AutomationTrack( _tc, true ); break; + t = new ::AutomationTrack( tc, true ); break; default: break; } - _tc->updateAfterTrackAdd(); + tc->updateAfterTrackAdd(); return t; } @@ -1887,17 +1885,17 @@ Track * Track::create( TrackTypes _tt, TrackContainer * _tc ) /*! \brief Create a track inside TrackContainer from track type in a QDomElement and restore state from XML * - * \param _this The QDomElement containing the type of track to create - * \param _tc The track container to attach to + * \param element The QDomElement containing the type of track to create + * \param tc The track container to attach to */ -Track * Track::create( const QDomElement & _this, TrackContainer * _tc ) +Track * Track::create( const QDomElement & element, TrackContainer * tc ) { Track * t = create( - static_cast( _this.attribute( "type" ).toInt() ), - _tc ); + static_cast( element.attribute( "type" ).toInt() ), + tc ); if( t != NULL ) { - t->restoreState( _this ); + t->restoreState( element ); } return t; } @@ -1927,31 +1925,31 @@ void Track::clone() * specific settings. Then we iterate through the trackContentObjects * and save all their states in turn. * - * \param _doc The QDomDocument to use to save - * \param _this The The QDomElement to save into + * \param doc The QDomDocument to use to save + * \param element The The QDomElement to save into * \todo Does this accurately describe the parameters? I think not!? * \todo Save the track height */ -void Track::saveSettings( QDomDocument & _doc, QDomElement & _this ) +void Track::saveSettings( QDomDocument & doc, QDomElement & element ) { if( !m_simpleSerializingMode ) { - _this.setTagName( "track" ); + element.setTagName( "track" ); } - _this.setAttribute( "type", type() ); - _this.setAttribute( "name", name() ); - _this.setAttribute( "muted", isMuted() ); - _this.setAttribute( "solo", isSolo() ); + element.setAttribute( "type", type() ); + element.setAttribute( "name", name() ); + element.setAttribute( "muted", isMuted() ); + element.setAttribute( "solo", isSolo() ); if( m_height >= MINIMAL_TRACK_HEIGHT ) { - _this.setAttribute( "height", m_height ); + element.setAttribute( "height", m_height ); } - QDomElement ts_de = _doc.createElement( nodeName() ); + QDomElement tsDe = doc.createElement( nodeName() ); // let actual track (InstrumentTrack, bbTrack, sampleTrack etc.) save // its settings - _this.appendChild( ts_de ); - saveTrackSpecificSettings( _doc, ts_de ); + element.appendChild( tsDe ); + saveTrackSpecificSettings( doc, tsDe ); if( m_simpleSerializingMode ) { @@ -1963,7 +1961,7 @@ void Track::saveSettings( QDomDocument & _doc, QDomElement & _this ) for( tcoVector::const_iterator it = m_trackContentObjects.begin(); it != m_trackContentObjects.end(); ++it ) { - ( *it )->saveState( _doc, _this ); + ( *it )->saveState( doc, element ); } } @@ -1979,26 +1977,26 @@ void Track::saveSettings( QDomDocument & _doc, QDomElement & _this ) * track-specific settings and trackContentObjects states from it * one at a time. * - * \param _this the QDomElement to load track settings from + * \param element the QDomElement to load track settings from * \todo Load the track height. */ -void Track::loadSettings( const QDomElement & _this ) +void Track::loadSettings( const QDomElement & element ) { - if( _this.attribute( "type" ).toInt() != type() ) + if( element.attribute( "type" ).toInt() != type() ) { qWarning( "Current track-type does not match track-type of " "settings-node!\n" ); } - setName( _this.hasAttribute( "name" ) ? _this.attribute( "name" ) : - _this.firstChild().toElement().attribute( "name" ) ); + setName( element.hasAttribute( "name" ) ? element.attribute( "name" ) : + element.firstChild().toElement().attribute( "name" ) ); - setMuted( _this.attribute( "muted" ).toInt() ); - setSolo( _this.attribute( "solo" ).toInt() ); + setMuted( element.attribute( "muted" ).toInt() ); + setSolo( element.attribute( "solo" ).toInt() ); if( m_simpleSerializingMode ) { - QDomNode node = _this.firstChild(); + QDomNode node = element.firstChild(); while( !node.isNull() ) { if( node.isElement() && node.nodeName() == nodeName() ) @@ -2018,7 +2016,7 @@ void Track::loadSettings( const QDomElement & _this ) // m_trackContentObjects.erase( m_trackContentObjects.begin() ); } - QDomNode node = _this.firstChild(); + QDomNode node = element.firstChild(); while( !node.isNull() ) { if( node.isElement() ) @@ -2040,10 +2038,10 @@ void Track::loadSettings( const QDomElement & _this ) node = node.nextSibling(); } - if( _this.attribute( "height" ).toInt() >= MINIMAL_TRACK_HEIGHT && - _this.attribute( "height" ).toInt() <= DEFAULT_TRACK_HEIGHT ) // workaround for #3585927, tobydox/2012-11-11 + if( element.attribute( "height" ).toInt() >= MINIMAL_TRACK_HEIGHT && + element.attribute( "height" ).toInt() <= DEFAULT_TRACK_HEIGHT ) // workaround for #3585927, tobydox/2012-11-11 { - m_height = _this.attribute( "height" ).toInt(); + m_height = element.attribute( "height" ).toInt(); } } @@ -2052,15 +2050,15 @@ void Track::loadSettings( const QDomElement & _this ) /*! \brief Add another TrackContentObject into this track * - * \param _tco The TrackContentObject to attach to this track. + * \param tco The TrackContentObject to attach to this track. */ -TrackContentObject * Track::addTCO( TrackContentObject * _tco ) +TrackContentObject * Track::addTCO( TrackContentObject * tco ) { - m_trackContentObjects.push_back( _tco ); + m_trackContentObjects.push_back( tco ); - emit trackContentObjectAdded( _tco ); + emit trackContentObjectAdded( tco ); - return _tco; // just for convenience + return tco; // just for convenience } @@ -2068,13 +2066,13 @@ TrackContentObject * Track::addTCO( TrackContentObject * _tco ) /*! \brief Remove a given TrackContentObject from this track * - * \param _tco The TrackContentObject to remove from this track. + * \param tco The TrackContentObject to remove from this track. */ -void Track::removeTCO( TrackContentObject * _tco ) +void Track::removeTCO( TrackContentObject * tco ) { tcoVector::iterator it = qFind( m_trackContentObjects.begin(), m_trackContentObjects.end(), - _tco ); + tco ); if( it != m_trackContentObjects.end() ) { m_trackContentObjects.erase( it ); @@ -2115,21 +2113,21 @@ int Track::numOfTCOs() * numbered object from the array. Otherwise we warn the user that * we've somehow requested a TCO that is too large, and create a new * TCO for them. - * \param _tco_number The number of the TrackContentObject to fetch. + * \param tcoNum The number of the TrackContentObject to fetch. * \return the given TrackContentObject or a new one if out of range. * \todo reject TCO numbers less than zero. * \todo if we create a TCO here, should we somehow attach it to the * track? */ -TrackContentObject * Track::getTCO( int _tco_num ) +TrackContentObject * Track::getTCO( int tcoNum ) { - if( _tco_num < m_trackContentObjects.size() ) + if( tcoNum < m_trackContentObjects.size() ) { - return m_trackContentObjects[_tco_num]; + return m_trackContentObjects[tcoNum]; } printf( "called Track::getTCO( %d ), " - "but TCO %d doesn't exist\n", _tco_num, _tco_num ); - return createTCO( _tco_num * MidiTime::ticksPerTact() ); + "but TCO %d doesn't exist\n", tcoNum, tcoNum ); + return createTCO( tcoNum * MidiTime::ticksPerTact() ); } @@ -2138,15 +2136,15 @@ TrackContentObject * Track::getTCO( int _tco_num ) /*! \brief Determine the given TrackContentObject's number in our array. * - * \param _tco The TrackContentObject to search for. + * \param tco The TrackContentObject to search for. * \return its number in our array. */ -int Track::getTCONum( const TrackContentObject * _tco ) +int Track::getTCONum( const TrackContentObject * tco ) { // for( int i = 0; i < getTrackContentWidget()->numOfTCOs(); ++i ) tcoVector::iterator it = qFind( m_trackContentObjects.begin(), m_trackContentObjects.end(), - _tco ); + tco ); if( it != m_trackContentObjects.end() ) { /* if( getTCO( i ) == _tco ) @@ -2171,31 +2169,31 @@ int Track::getTCONum( const TrackContentObject * _tco ) * * We return the TCOs we find in order by time, earliest TCOs first. * - * \param _tco_c The list to contain the found trackContentObjects. - * \param _start The MIDI start time of the range. - * \param _end The MIDI endi time of the range. + * \param tcoV The list to contain the found trackContentObjects. + * \param start The MIDI start time of the range. + * \param end The MIDI endi time of the range. */ -void Track::getTCOsInRange( tcoVector & _tco_v, const MidiTime & _start, - const MidiTime & _end ) +void Track::getTCOsInRange( tcoVector & tcoV, const MidiTime & start, + const MidiTime & end ) { - for( tcoVector::iterator it_o = m_trackContentObjects.begin(); - it_o != m_trackContentObjects.end(); ++it_o ) + for( tcoVector::iterator itO = m_trackContentObjects.begin(); + itO != m_trackContentObjects.end(); ++itO ) { - TrackContentObject * tco = ( *it_o ); + TrackContentObject * tco = ( *itO ); int s = tco->startPosition(); int e = tco->endPosition(); - if( ( s <= _end ) && ( e >= _start ) ) + if( ( s <= end ) && ( e >= start ) ) { // ok, TCO is posated within given range // now let's search according position for TCO in list // -> list is ordered by TCO's position afterwards bool inserted = false; - for( tcoVector::iterator it = _tco_v.begin(); - it != _tco_v.end(); ++it ) + for( tcoVector::iterator it = tcoV.begin(); + it != tcoV.end(); ++it ) { if( ( *it )->startPosition() >= s ) { - _tco_v.insert( it, tco ); + tcoV.insert( it, tco ); inserted = true; break; } @@ -2203,7 +2201,7 @@ void Track::getTCOsInRange( tcoVector & _tco_v, const MidiTime & _start, if( inserted == false ) { // no TCOs found posated behind current TCO... - _tco_v.push_back( tco ); + tcoV.push_back( tco ); } } } @@ -2217,19 +2215,19 @@ void Track::getTCOsInRange( tcoVector & _tco_v, const MidiTime & _start, * First, we arrange to swap the positions of the two TCOs in the * trackContentObjects list. Then we swap their start times as well. * - * \param _tco_num1 The first TrackContentObject to swap. - * \param _tco_num2 The second TrackContentObject to swap. + * \param tcoNum1 The first TrackContentObject to swap. + * \param tcoNum2 The second TrackContentObject to swap. */ -void Track::swapPositionOfTCOs( int _tco_num1, int _tco_num2 ) +void Track::swapPositionOfTCOs( int tcoNum1, int tcoNum2 ) { - qSwap( m_trackContentObjects[_tco_num1], - m_trackContentObjects[_tco_num2] ); + qSwap( m_trackContentObjects[tcoNum1], + m_trackContentObjects[tcoNum2] ); - const MidiTime pos = m_trackContentObjects[_tco_num1]->startPosition(); + const MidiTime pos = m_trackContentObjects[tcoNum1]->startPosition(); - m_trackContentObjects[_tco_num1]->movePosition( - m_trackContentObjects[_tco_num2]->startPosition() ); - m_trackContentObjects[_tco_num2]->movePosition( pos ); + m_trackContentObjects[tcoNum1]->movePosition( + m_trackContentObjects[tcoNum2]->startPosition() ); + m_trackContentObjects[tcoNum2]->movePosition( pos ); } @@ -2237,19 +2235,19 @@ void Track::swapPositionOfTCOs( int _tco_num1, int _tco_num2 ) /*! \brief Move all the trackContentObjects after a certain time later by one bar. * - * \param _pos The time at which we want to insert the bar. + * \param pos The time at which we want to insert the bar. * \todo if we stepped through this list last to first, and the list was * in ascending order by TCO time, once we hit a TCO that was earlier * than the insert time, we could fall out of the loop early. */ -void Track::insertTact( const MidiTime & _pos ) +void Track::insertTact( const MidiTime & pos ) { - // we'll increase the position of every TCO, positioned behind _pos, by + // we'll increase the position of every TCO, positioned behind pos, by // one tact for( tcoVector::iterator it = m_trackContentObjects.begin(); it != m_trackContentObjects.end(); ++it ) { - if( ( *it )->startPosition() >= _pos ) + if( ( *it )->startPosition() >= pos ) { ( *it )->movePosition( (*it)->startPosition() + MidiTime::ticksPerTact() ); @@ -2262,16 +2260,16 @@ void Track::insertTact( const MidiTime & _pos ) /*! \brief Move all the trackContentObjects after a certain time earlier by one bar. * - * \param _pos The time at which we want to remove the bar. + * \param pos The time at which we want to remove the bar. */ -void Track::removeTact( const MidiTime & _pos ) +void Track::removeTact( const MidiTime & pos ) { - // we'll decrease the position of every TCO, positioned behind _pos, by + // we'll decrease the position of every TCO, positioned behind pos, by // one tact for( tcoVector::iterator it = m_trackContentObjects.begin(); it != m_trackContentObjects.end(); ++it ) { - if( ( *it )->startPosition() >= _pos ) + if( ( *it )->startPosition() >= pos ) { ( *it )->movePosition( qMax( ( *it )->startPosition() - MidiTime::ticksPerTact(), 0 ) ); @@ -2317,7 +2315,7 @@ void Track::toggleSolo() { const TrackContainer::TrackList & tl = m_trackContainer->tracks(); - bool solo_before = false; + bool soloBefore = false; for( TrackContainer::TrackList::const_iterator it = tl.begin(); it != tl.end(); ++it ) { @@ -2325,7 +2323,7 @@ void Track::toggleSolo() { if( ( *it )->m_soloModel.value() ) { - solo_before = true; + soloBefore = true; break; } } @@ -2338,7 +2336,7 @@ void Track::toggleSolo() if( solo ) { // save mute-state in case no track was solo before - if( !solo_before ) + if( !soloBefore ) { ( *it )->m_mutedBeforeSolo = ( *it )->isMuted(); } @@ -2348,7 +2346,7 @@ void Track::toggleSolo() ( *it )->m_soloModel.setValue( false ); } } - else if( !solo_before ) + else if( !soloBefore ) { ( *it )->setMuted( ( *it )->m_mutedBeforeSolo ); } @@ -2369,15 +2367,15 @@ void Track::toggleSolo() * The track View is handles the actual display of the track, including * displaying its various widgets and the track segments. * - * \param _track The track to display. - * \param _tcv The track Container View for us to be displayed in. + * \param track The track to display. + * \param tcv The track Container View for us to be displayed in. * \todo Is my description of these properties correct? */ -TrackView::TrackView( Track * _track, TrackContainerView * _tcv ) : - QWidget( _tcv->contentWidget() ), /*!< The Track Container View's content widget. */ +TrackView::TrackView( Track * track, TrackContainerView * tcv ) : + QWidget( tcv->contentWidget() ), /*!< The Track Container View's content widget. */ ModelView( NULL, this ), /*!< The model view of this track */ - m_track( _track ), /*!< The track we're displaying */ - m_trackContainerView( _tcv ), /*!< The track Container View we're displayed in */ + m_track( track ), /*!< The track we're displaying */ + m_trackContainerView( tcv ), /*!< The track Container View we're displayed in */ m_trackOperationsWidget( this ), /*!< Our trackOperationsWidget */ m_trackSettingsWidget( this ), /*!< Our trackSettingsWidget */ m_trackContentWidget( this ), /*!< Our trackContentWidget */ @@ -2441,9 +2439,9 @@ TrackView::~TrackView() /*! \brief Resize this track View. * - * \param _re the Resize Event to handle. + * \param re the Resize Event to handle. */ -void TrackView::resizeEvent( QResizeEvent * _re ) +void TrackView::resizeEvent( QResizeEvent * re ) { if( ConfigManager::inst()->value( "ui", "compacttrackbuttons" ).toInt() ) @@ -2509,11 +2507,11 @@ void TrackView::modelChanged() /*! \brief Start a drag event on this track View. * - * \param _dee the DragEnterEvent to start. + * \param dee the DragEnterEvent to start. */ -void TrackView::dragEnterEvent( QDragEnterEvent * _dee ) +void TrackView::dragEnterEvent( QDragEnterEvent * dee ) { - StringPairDrag::processDragEnterEvent( _dee, "track_" + + StringPairDrag::processDragEnterEvent( dee, "track_" + QString::number( m_track->type() ) ); } @@ -2526,12 +2524,12 @@ void TrackView::dragEnterEvent( QDragEnterEvent * _dee ) * If so, we decode the data from the drop event by just feeding it * back into the engine as a state. * - * \param _de the DropEvent to handle. + * \param de the DropEvent to handle. */ -void TrackView::dropEvent( QDropEvent * _de ) +void TrackView::dropEvent( QDropEvent * de ) { - QString type = StringPairDrag::decodeKey( _de ); - QString value = StringPairDrag::decodeValue( _de ); + QString type = StringPairDrag::decodeKey( de ); + QString value = StringPairDrag::decodeValue( de ); if( type == ( "track_" + QString::number( m_track->type() ) ) ) { // value contains our XML-data so simply create a @@ -2540,7 +2538,7 @@ void TrackView::dropEvent( QDropEvent * _de ) m_track->lock(); m_track->restoreState( dataFile.content().firstChild().toElement() ); m_track->unlock(); - _de->accept(); + de->accept(); } } @@ -2558,14 +2556,14 @@ void TrackView::dropEvent( QDropEvent * _de ) * * Otherwise we let the widget handle the mouse event as normal. * - * \param _me the MouseEvent to handle. + * \param me the MouseEvent to handle. */ -void TrackView::mousePressEvent( QMouseEvent * _me ) +void TrackView::mousePressEvent( QMouseEvent * me ) { // If previously dragged too small, restore on shift-leftclick if( height() < DEFAULT_TRACK_HEIGHT && - _me->modifiers() & Qt::ShiftModifier && - _me->button() == Qt::LeftButton ) + me->modifiers() & Qt::ShiftModifier && + me->button() == Qt::LeftButton ) { setFixedHeight( DEFAULT_TRACK_HEIGHT ); m_track->setHeight( DEFAULT_TRACK_HEIGHT ); @@ -2574,14 +2572,14 @@ void TrackView::mousePressEvent( QMouseEvent * _me ) if( m_trackContainerView->allowRubberband() == true ) { - QWidget::mousePressEvent( _me ); + QWidget::mousePressEvent( me ); } - else if( _me->button() == Qt::LeftButton ) + else if( me->button() == Qt::LeftButton ) { - if( _me->modifiers() & Qt::ShiftModifier ) + if( me->modifiers() & Qt::ShiftModifier ) { m_action = ResizeTrack; - QCursor::setPos( mapToGlobal( QPoint( _me->x(), + QCursor::setPos( mapToGlobal( QPoint( me->x(), height() ) ) ); QCursor c( Qt::SizeVerCursor); QApplication::setOverrideCursor( c ); @@ -2597,11 +2595,11 @@ void TrackView::mousePressEvent( QMouseEvent * _me ) m_trackOperationsWidget.update(); } - _me->accept(); + me->accept(); } else { - QWidget::mousePressEvent( _me ); + QWidget::mousePressEvent( me ); } } @@ -2622,29 +2620,30 @@ void TrackView::mousePressEvent( QMouseEvent * _me ) * Likewise if we've started a resize process, handle this too, making * sure that we never go below the minimum track height. * - * \param _me the MouseEvent to handle. + * \param me the MouseEvent to handle. */ -void TrackView::mouseMoveEvent( QMouseEvent * _me ) +void TrackView::mouseMoveEvent( QMouseEvent * me ) { if( m_trackContainerView->allowRubberband() == true ) { - QWidget::mouseMoveEvent( _me ); + QWidget::mouseMoveEvent( me ); } else if( m_action == MoveTrack ) { // look which track-widget the mouse-cursor is over - const int y_pos = m_trackContainerView->contentWidget()->mapFromGlobal( _me->globalPos() ).y(); - const TrackView * track_at_y = m_trackContainerView->trackViewAt( y_pos ); + const int yPos = + m_trackContainerView->contentWidget()->mapFromGlobal( me->globalPos() ).y(); + const TrackView * trackAtY = m_trackContainerView->trackViewAt( yPos ); // debug code -// qDebug( "y position %d", y_pos ); +// qDebug( "y position %d", yPos ); // a track-widget not equal to ourself? - if( track_at_y != NULL && track_at_y != this ) + if( trackAtY != NULL && trackAtY != this ) { // then move us up/down there! - if( _me->y() < 0 ) + if( me->y() < 0 ) { m_trackContainerView->moveTrackViewUp( this ); } @@ -2656,7 +2655,7 @@ void TrackView::mouseMoveEvent( QMouseEvent * _me ) } else if( m_action == ResizeTrack ) { - setFixedHeight( qMax( _me->y(), MINIMAL_TRACK_HEIGHT ) ); + setFixedHeight( qMax( me->y(), MINIMAL_TRACK_HEIGHT ) ); m_trackContainerView->realignTracks(); m_track->setHeight( height() ); } @@ -2671,9 +2670,9 @@ void TrackView::mouseMoveEvent( QMouseEvent * _me ) /*! \brief Handle a mouse release event on this track View. * - * \param _me the MouseEvent to handle. + * \param me the MouseEvent to handle. */ -void TrackView::mouseReleaseEvent( QMouseEvent * _me ) +void TrackView::mouseReleaseEvent( QMouseEvent * me ) { m_action = NoAction; while( QApplication::overrideCursor() != NULL ) @@ -2682,7 +2681,7 @@ void TrackView::mouseReleaseEvent( QMouseEvent * _me ) } m_trackOperationsWidget.update(); - QWidget::mouseReleaseEvent( _me ); + QWidget::mouseReleaseEvent( me ); } @@ -2690,9 +2689,9 @@ void TrackView::mouseReleaseEvent( QMouseEvent * _me ) /*! \brief Repaint this track View. * - * \param _pe the PaintEvent to start. + * \param pe the PaintEvent to start. */ -void TrackView::paintEvent( QPaintEvent * _pe ) +void TrackView::paintEvent( QPaintEvent * pe ) { QStyleOption opt; opt.initFrom( this ); @@ -2705,22 +2704,18 @@ void TrackView::paintEvent( QPaintEvent * _pe ) /*! \brief Create a TrackContentObject View in this track View. * - * \param _tco the TrackContentObject to create the view for. + * \param tco the TrackContentObject to create the view for. * \todo is this a good description for what this method does? */ -void TrackView::createTCOView( TrackContentObject * _tco ) +void TrackView::createTCOView( TrackContentObject * tco ) { - TrackContentObjectView * tv = _tco->createView( this ); - if( _tco->getSelectViewOnCreate() == true ) + TrackContentObjectView * tv = tco->createView( this ); + if( tco->getSelectViewOnCreate() == true ) { tv->setSelected( true ); } - _tco->selectViewOnCreate( false ); + tco->selectViewOnCreate( false ); } - - - - From 65ff9171de39fe8f100e5cbdc28e7bd0eb50c5e1 Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Mon, 5 Jan 2015 22:11:23 -0200 Subject: [PATCH 004/133] Update coding conventions --- include/Track.h | 172 +++++++++++++++++++++++++----------------------- 1 file changed, 88 insertions(+), 84 deletions(-) diff --git a/include/Track.h b/include/Track.h index f6218c53d..71dadfa21 100644 --- a/include/Track.h +++ b/include/Track.h @@ -80,7 +80,7 @@ class TrackContentObject : public Model, public JournallingObject mapPropertyFromModel(bool,isMuted,setMuted,m_mutedModel); mapPropertyFromModel(bool,isSolo,setSolo,m_soloModel); public: - TrackContentObject( Track * _track ); + TrackContentObject( Track * track ); virtual ~TrackContentObject(); inline Track * getTrack() const @@ -93,9 +93,9 @@ public: return m_name; } - inline void setName( const QString & _name ) + inline void setName( const QString & name ) { - m_name = _name; + m_name = name; emit dataChanged(); } @@ -121,10 +121,10 @@ public: return m_length; } - virtual void movePosition( const MidiTime & _pos ); - virtual void changeLength( const MidiTime & _length ); + virtual void movePosition( const MidiTime & pos ); + virtual void changeLength( const MidiTime & length ); - virtual TrackContentObjectView * createView( TrackView * _tv ) = 0; + virtual TrackContentObjectView * createView( TrackView * tv ) = 0; inline void selectViewOnCreate( bool select ) { @@ -183,7 +183,7 @@ class TrackContentObjectView : public selectableObject, public ModelView Q_PROPERTY( QColor textColor READ textColor WRITE setTextColor ) public: - TrackContentObjectView( TrackContentObject * _tco, TrackView * _tv ); + TrackContentObjectView( TrackContentObject * tco, TrackView * tv ); virtual ~TrackContentObjectView(); bool fixedTCOs(); @@ -195,8 +195,8 @@ public: // qproperty access func QColor fgColor() const; QColor textColor() const; - void setFgColor( const QColor & _c ); - void setTextColor( const QColor & _c ); + void setFgColor( const QColor & c ); + void setTextColor( const QColor & c ); public slots: virtual bool close(); @@ -208,15 +208,15 @@ protected: { } - virtual void contextMenuEvent( QContextMenuEvent * _cme ); - virtual void dragEnterEvent( QDragEnterEvent * _dee ); - virtual void dropEvent( QDropEvent * _de ); - virtual void leaveEvent( QEvent * _e ); - virtual void mousePressEvent( QMouseEvent * _me ); - virtual void mouseMoveEvent( QMouseEvent * _me ); - virtual void mouseReleaseEvent( QMouseEvent * _me ); + virtual void contextMenuEvent( QContextMenuEvent * cme ); + virtual void dragEnterEvent( QDragEnterEvent * dee ); + virtual void dropEvent( QDropEvent * de ); + virtual void leaveEvent( QEvent * e ); + virtual void mousePressEvent( QMouseEvent * me ); + virtual void mouseMoveEvent( QMouseEvent * me ); + virtual void mouseReleaseEvent( QMouseEvent * me ); - void setAutoResizeEnabled( bool _e = false ); + void setAutoResizeEnabled( bool e = false ); float pixelsPerTact(); inline TrackView * getTrackView() @@ -266,7 +266,7 @@ private: m_initialMouseGlobalPos = mapToGlobal( pos ); } - bool mouseMovedDistance( QMouseEvent * _me, int distance ); + bool mouseMovedDistance( QMouseEvent * me, int distance ); } ; @@ -283,46 +283,46 @@ class TrackContentWidget : public QWidget, public JournallingObject Q_PROPERTY( QBrush lighterColor READ lighterColor WRITE setLighterColor ) public: - TrackContentWidget( TrackView * _parent ); + TrackContentWidget( TrackView * parent ); virtual ~TrackContentWidget(); /*! \brief Updates the background tile pixmap. */ void updateBackground(); - void addTCOView( TrackContentObjectView * _tcov ); - void removeTCOView( TrackContentObjectView * _tcov ); - void removeTCOView( int _tco_num ) + void addTCOView( TrackContentObjectView * tcov ); + void removeTCOView( TrackContentObjectView * tcov ); + void removeTCOView( int tcoNum ) { - if( _tco_num >= 0 && _tco_num < m_tcoViews.size() ) + if( tcoNum >= 0 && tcoNum < m_tcoViews.size() ) { - removeTCOView( m_tcoViews[_tco_num] ); + removeTCOView( m_tcoViews[tcoNum] ); } } bool canPasteSelection( MidiTime tcoPos, const QMimeData * mimeData ); - bool pasteSelection( MidiTime tcoPos, QDropEvent * _de ); + bool pasteSelection( MidiTime tcoPos, QDropEvent * de ); - MidiTime endPosition( const MidiTime & _pos_start ); + MidiTime endPosition( const MidiTime & posStart ); // qproperty access methods QBrush darkerColor() const; QBrush lighterColor() const; - void setDarkerColor( const QBrush & _c ); - void setLighterColor( const QBrush & _c ); + void setDarkerColor( const QBrush & c ); + void setLighterColor( const QBrush & c ); public slots: void update(); - void changePosition( const MidiTime & _new_pos = MidiTime( -1 ) ); + void changePosition( const MidiTime & newPos = MidiTime( -1 ) ); protected: - virtual void dragEnterEvent( QDragEnterEvent * _dee ); - virtual void dropEvent( QDropEvent * _de ); - virtual void mousePressEvent( QMouseEvent * _me ); - virtual void paintEvent( QPaintEvent * _pe ); - virtual void resizeEvent( QResizeEvent * _re ); + virtual void dragEnterEvent( QDragEnterEvent * dee ); + virtual void dropEvent( QDropEvent * de ); + virtual void mousePressEvent( QMouseEvent * me ); + virtual void paintEvent( QPaintEvent * pe ); + virtual void resizeEvent( QResizeEvent * re ); virtual QString nodeName() const { @@ -343,7 +343,7 @@ protected: private: Track * getTrack(); - MidiTime getPosition( int _mouse_x ); + MidiTime getPosition( int mouseX ); TrackView * m_trackView; @@ -365,13 +365,13 @@ class TrackOperationsWidget : public QWidget { Q_OBJECT public: - TrackOperationsWidget( TrackView * _parent ); + TrackOperationsWidget( TrackView * parent ); ~TrackOperationsWidget(); protected: - virtual void mousePressEvent( QMouseEvent * _me ); - virtual void paintEvent( QPaintEvent * _pe ); + virtual void mousePressEvent( QMouseEvent * me ); + virtual void paintEvent( QPaintEvent * pe ); private slots: @@ -395,7 +395,7 @@ private: friend class TrackView; signals: - void trackRemovalScheduled( TrackView * _t ); + void trackRemovalScheduled( TrackView * t ); } ; @@ -425,12 +425,12 @@ public: NumTrackTypes } ; - Track( TrackTypes _type, TrackContainer * _tc ); + Track( TrackTypes type, TrackContainer * tc ); virtual ~Track(); - static Track * create( TrackTypes _tt, TrackContainer * _tc ); - static Track * create( const QDomElement & _this, - TrackContainer * _tc ); + static Track * create( TrackTypes tt, TrackContainer * tc ); + static Track * create( const QDomElement & element, + TrackContainer * tc ); void clone(); @@ -440,20 +440,20 @@ public: return m_type; } - virtual bool play( const MidiTime & _start, const fpp_t _frames, - const f_cnt_t _frame_base, int _tco_num = -1 ) = 0; + virtual bool play( const MidiTime & start, const fpp_t frames, + const f_cnt_t frameBase, int tcoNum = -1 ) = 0; - virtual TrackView * createView( TrackContainerView * _view ) = 0; - virtual TrackContentObject * createTCO( const MidiTime & _pos ) = 0; + virtual TrackView * createView( TrackContainerView * view ) = 0; + virtual TrackContentObject * createTCO( const MidiTime & pos ) = 0; - virtual void saveTrackSpecificSettings( QDomDocument & _doc, - QDomElement & _parent ) = 0; - virtual void loadTrackSpecificSettings( const QDomElement & _this ) = 0; + virtual void saveTrackSpecificSettings( QDomDocument & doc, + QDomElement & parent ) = 0; + virtual void loadTrackSpecificSettings( const QDomElement & element ) = 0; - virtual void saveSettings( QDomDocument & _doc, QDomElement & _this ); - virtual void loadSettings( const QDomElement & _this ); + virtual void saveSettings( QDomDocument & doc, QDomElement & element ); + virtual void loadSettings( const QDomElement & element ); void setSimpleSerializing() { @@ -461,26 +461,26 @@ public: } // -- for usage by TrackContentObject only --------------- - TrackContentObject * addTCO( TrackContentObject * _tco ); - void removeTCO( TrackContentObject * _tco ); + TrackContentObject * addTCO( TrackContentObject * tco ); + void removeTCO( TrackContentObject * tco ); // ------------------------------------------------------- void deleteTCOs(); int numOfTCOs(); - TrackContentObject * getTCO( int _tco_num ); - int getTCONum(const TrackContentObject* _tco ); + TrackContentObject * getTCO( int tcoNum ); + int getTCONum(const TrackContentObject* tco ); const tcoVector & getTCOs() const { - return( m_trackContentObjects ); + return m_trackContentObjects; } - void getTCOsInRange( tcoVector & _tco_v, const MidiTime & _start, - const MidiTime & _end ); - void swapPositionOfTCOs( int _tco_num1, int _tco_num2 ); + void getTCOsInRange( tcoVector & tcoV, const MidiTime & start, + const MidiTime & end ); + void swapPositionOfTCOs( int tcoNum1, int tcoNum2 ); - void insertTact( const MidiTime & _pos ); - void removeTact( const MidiTime & _pos ); + void insertTact( const MidiTime & pos ); + void removeTact( const MidiTime & pos ); tact_t length() const; @@ -493,21 +493,25 @@ public: // name-stuff virtual const QString & name() const { - return( m_name ); + return m_name; } virtual QString displayName() const { - return( name() ); + return name(); } using Model::dataChanged; - inline int getHeight() { - return ( m_height >= MINIMAL_TRACK_HEIGHT ? m_height : DEFAULT_TRACK_HEIGHT ); + inline int getHeight() + { + return m_height >= MINIMAL_TRACK_HEIGHT + ? m_height + : DEFAULT_TRACK_HEIGHT; } - inline void setHeight( int _height ) { - m_height = _height; + inline void setHeight( int height ) + { + m_height = height; } void lock() @@ -524,9 +528,9 @@ public: } public slots: - virtual void setName( const QString & _new_name ) + virtual void setName( const QString & newName ) { - m_name = _new_name; + m_name = newName; emit nameChanged(); } @@ -573,12 +577,12 @@ public: inline const Track * getTrack() const { - return( m_track ); + return m_track; } inline Track * getTrack() { - return( m_track ); + return m_track; } inline TrackContainerView* trackContainerView() @@ -588,22 +592,22 @@ public: inline TrackOperationsWidget * getTrackOperationsWidget() { - return( &m_trackOperationsWidget ); + return &m_trackOperationsWidget; } inline trackSettingsWidget * getTrackSettingsWidget() { - return( &m_trackSettingsWidget ); + return &m_trackSettingsWidget; } inline TrackContentWidget * getTrackContentWidget() { - return( &m_trackContentWidget ); + return &m_trackContentWidget; } bool isMovingTrack() const { - return( m_action == MoveTrack ); + return m_action == MoveTrack; } virtual void update(); @@ -633,13 +637,13 @@ protected: } - virtual void dragEnterEvent( QDragEnterEvent * _dee ); - virtual void dropEvent( QDropEvent * _de ); - virtual void mousePressEvent( QMouseEvent * _me ); - virtual void mouseMoveEvent( QMouseEvent * _me ); - virtual void mouseReleaseEvent( QMouseEvent * _me ); - virtual void paintEvent( QPaintEvent * _pe ); - virtual void resizeEvent( QResizeEvent * _re ); + virtual void dragEnterEvent( QDragEnterEvent * dee ); + virtual void dropEvent( QDropEvent * de ); + virtual void mousePressEvent( QMouseEvent * me ); + virtual void mouseMoveEvent( QMouseEvent * me ); + virtual void mouseReleaseEvent( QMouseEvent * me ); + virtual void paintEvent( QPaintEvent * pe ); + virtual void resizeEvent( QResizeEvent * re ); private: @@ -664,7 +668,7 @@ private: private slots: - void createTCOView( TrackContentObject * _tco ); + void createTCOView( TrackContentObject * tco ); } ; From ffb16b80c966256db3de34a9c4218bf7126bc17f Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Wed, 7 Jan 2015 21:11:42 -0200 Subject: [PATCH 005/133] Update Song.cpp --- src/core/Song.cpp | 227 ++++++++++++++++++++++++---------------------- 1 file changed, 121 insertions(+), 106 deletions(-) diff --git a/src/core/Song.cpp b/src/core/Song.cpp index e15533cdf..a4bdae60c 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -140,7 +140,7 @@ void Song::masterVolumeChanged() void Song::setTempo() { Engine::mixer()->lockPlayHandleRemoval(); - const bpm_t tempo = (bpm_t) m_tempoModel.value(); + const bpm_t tempo = ( bpm_t ) m_tempoModel.value(); PlayHandleList & playHandles = Engine::mixer()->playHandles(); for( PlayHandleList::Iterator it = playHandles.begin(); it != playHandles.end(); ++it ) @@ -172,7 +172,8 @@ void Song::setTimeSignature() emit dataChanged(); m_oldTicksPerTact = ticksPerTact(); - m_vstSyncController.setTimeSignature( getTimeSigModel().getNumerator(), getTimeSigModel().getDenominator() ); + m_vstSyncController.setTimeSignature( + getTimeSigModel().getNumerator(), getTimeSigModel().getDenominator() ); } @@ -198,13 +199,13 @@ void Song::processNextBuffer() return; } - TrackList track_list; - int tco_num = -1; + TrackList trackList; + int tcoNum = -1; switch( m_playMode ) { case Mode_PlaySong: - track_list = tracks(); + trackList = tracks(); // at song-start we have to reset the LFOs if( m_playPos[Mode_PlaySong] == 0 ) { @@ -213,25 +214,25 @@ void Song::processNextBuffer() break; case Mode_PlayTrack: - track_list.push_back( m_trackToPlay ); + trackList.push_back( m_trackToPlay ); break; case Mode_PlayBB: if( Engine::getBBTrackContainer()->numOfBBs() > 0 ) { - tco_num = Engine::getBBTrackContainer()-> + tcoNum = Engine::getBBTrackContainer()-> currentBB(); - track_list.push_back( BBTrack::findBBTrack( - tco_num ) ); + trackList.push_back( BBTrack::findBBTrack( + tcoNum ) ); } break; case Mode_PlayPattern: if( m_patternToPlay != NULL ) { - tco_num = m_patternToPlay->getTrack()-> + tcoNum = m_patternToPlay->getTrack()-> getTCONum( m_patternToPlay ); - track_list.push_back( + trackList.push_back( m_patternToPlay->getTrack() ); } break; @@ -241,41 +242,43 @@ void Song::processNextBuffer() } - if( track_list.empty() == true ) + if( trackList.empty() == true ) { return; } // check for looping-mode and act if necessary Timeline * tl = m_playPos[m_playMode].m_timeLine; - bool check_loop = tl != NULL && m_exporting == false && + bool checkLoop = tl != NULL && m_exporting == false && tl->loopPointsEnabled(); - if( check_loop ) + if( checkLoop ) { if( m_playPos[m_playMode] < tl->loopBegin() || m_playPos[m_playMode] >= tl->loopEnd() ) { - m_elapsedMilliSeconds = (tl->loopBegin().getTicks()*60*1000/48)/getTempo(); + m_elapsedMilliSeconds = + ( tl->loopBegin().getTicks() * 60 * 1000 / 48 ) / getTempo(); m_playPos[m_playMode].setTicks( tl->loopBegin().getTicks() ); } } - f_cnt_t total_frames_played = 0; - const float frames_per_tick = Engine::framesPerTick(); + f_cnt_t totalFramesPlayed = 0; + const float framesPerTick = Engine::framesPerTick(); - while( total_frames_played - < Engine::mixer()->framesPerPeriod() ) + while( totalFramesPlayed < Engine::mixer()->framesPerPeriod() ) { m_vstSyncController.update(); - f_cnt_t played_frames = Engine::mixer()->framesPerPeriod() - total_frames_played; + f_cnt_t playedFrames = Engine::mixer()->framesPerPeriod() - + totalFramesPlayed; - float current_frame = m_playPos[m_playMode].currentFrame(); + float currentFrame = m_playPos[m_playMode].currentFrame(); // did we play a tick? - if( current_frame >= frames_per_tick ) + if( currentFrame >= framesPerTick ) { - int ticks = m_playPos[m_playMode].getTicks() + (int)( current_frame / frames_per_tick ); + int ticks = m_playPos[m_playMode].getTicks() + + ( int )( currentFrame / framesPerTick ); m_vstSyncController.setAbsolutePosition( ticks ); @@ -285,14 +288,14 @@ void Song::processNextBuffer() // per default we just continue playing even if // there's no more stuff to play // (song-play-mode) - int max_tact = m_playPos[m_playMode].getTact() + int maxTact = m_playPos[m_playMode].getTact() + 2; // then decide whether to go over to next tact // or to loop back to first tact if( m_playMode == Mode_PlayBB ) { - max_tact = Engine::getBBTrackContainer() + maxTact = Engine::getBBTrackContainer() ->lengthOfCurrentBB(); } else if( m_playMode == Mode_PlayPattern && @@ -300,34 +303,39 @@ void Song::processNextBuffer() tl != NULL && tl->loopPointsEnabled() == false ) { - max_tact = m_patternToPlay->length() + maxTact = m_patternToPlay->length() .getTact(); } // end of played object reached? if( m_playPos[m_playMode].getTact() + 1 - >= max_tact ) + >= maxTact ) { // then start from beginning and keep // offset - ticks = ticks % ( max_tact * MidiTime::ticksPerTact() ); + ticks %= ( maxTact * MidiTime::ticksPerTact() ); // wrap milli second counter - m_elapsedMilliSeconds = ( ticks * 60 * 1000 / 48 ) / getTempo(); + m_elapsedMilliSeconds = + ( ticks * 60 * 1000 / 48 ) / getTempo(); m_vstSyncController.setAbsolutePosition( ticks ); } } m_playPos[m_playMode].setTicks( ticks ); - if( check_loop ) + if( checkLoop ) { - m_vstSyncController.startCycle( tl->loopBegin().getTicks(), tl->loopEnd().getTicks() ); + m_vstSyncController.startCycle( + tl->loopBegin().getTicks(), tl->loopEnd().getTicks() ); if( m_playPos[m_playMode] >= tl->loopEnd() ) { m_playPos[m_playMode].setTicks( tl->loopBegin().getTicks() ); - m_elapsedMilliSeconds = ((tl->loopBegin().getTicks())*60*1000/48)/getTempo(); + + m_elapsedMilliSeconds = + ( ( tl->loopBegin().getTicks() ) * 60 * 1000 / 48 ) / + getTempo(); } } else @@ -335,55 +343,57 @@ void Song::processNextBuffer() m_vstSyncController.stopCycle(); } - current_frame = fmodf( current_frame, frames_per_tick ); - m_playPos[m_playMode].setCurrentFrame( current_frame ); + currentFrame = fmodf( currentFrame, framesPerTick ); + m_playPos[m_playMode].setCurrentFrame( currentFrame ); } - f_cnt_t last_frames = (f_cnt_t)frames_per_tick - - (f_cnt_t) current_frame; + f_cnt_t lastFrames = ( f_cnt_t )framesPerTick - + ( f_cnt_t )currentFrame; // skip last frame fraction - if( last_frames == 0 ) + if( lastFrames == 0 ) { - ++total_frames_played; - m_playPos[m_playMode].setCurrentFrame( current_frame + ++totalFramesPlayed; + m_playPos[m_playMode].setCurrentFrame( currentFrame + 1.0f ); continue; } // do we have some samples left in this tick but these are // less then samples we have to play? - if( last_frames < played_frames ) + if( lastFrames < playedFrames ) { // then set played_samples to remaining samples, the // rest will be played in next loop - played_frames = last_frames; + playedFrames = lastFrames; } - if( (f_cnt_t) current_frame == 0 ) + if( ( f_cnt_t ) currentFrame == 0 ) { if( m_playMode == Mode_PlaySong ) { m_globalAutomationTrack->play( m_playPos[m_playMode], - played_frames, - total_frames_played, tco_num ); + playedFrames, + totalFramesPlayed, tcoNum ); } // loop through all tracks and play them - for( int i = 0; i < track_list.size(); ++i ) + for( int i = 0; i < trackList.size(); ++i ) { - track_list[i]->play( m_playPos[m_playMode], - played_frames, - total_frames_played, tco_num ); + trackList[i]->play( m_playPos[m_playMode], + playedFrames, + totalFramesPlayed, tcoNum ); } } // update frame-counters - total_frames_played += played_frames; - m_playPos[m_playMode].setCurrentFrame( played_frames + - current_frame ); - m_elapsedMilliSeconds += (((played_frames/frames_per_tick)*60*1000/48)/getTempo()); + totalFramesPlayed += playedFrames; + m_playPos[m_playMode].setCurrentFrame( playedFrames + + currentFrame ); + m_elapsedMilliSeconds += + ( ( playedFrames / framesPerTick ) * 60 * 1000 / 48 ) + / getTempo(); m_elapsedTacts = m_playPos[Mode_PlaySong].getTact(); - m_elapsedTicks = (m_playPos[Mode_PlaySong].getTicks()%ticksPerTact())/48; + m_elapsedTicks = ( m_playPos[Mode_PlaySong].getTicks() % ticksPerTact() ) / 48; } } @@ -392,17 +402,21 @@ bool Song::isExportDone() const if ( m_renderBetweenMarkers ) { return m_exporting == true && - m_playPos[Mode_PlaySong].getTicks() >= m_playPos[Mode_PlaySong].m_timeLine->loopEnd().getTicks(); + m_playPos[Mode_PlaySong].getTicks() >= + m_playPos[Mode_PlaySong].m_timeLine->loopEnd().getTicks(); } + if( m_exportLoop) { return m_exporting == true && - m_playPos[Mode_PlaySong].getTicks() >= length() * ticksPerTact(); + m_playPos[Mode_PlaySong].getTicks() >= + length() * ticksPerTact(); } else { return m_exporting == true && - m_playPos[Mode_PlaySong].getTicks() >= ( length() + 1 ) * ticksPerTact(); + m_playPos[Mode_PlaySong].getTicks() >= + ( length() + 1 ) * ticksPerTact(); } } @@ -450,13 +464,13 @@ void Song::playAndRecord() -void Song::playTrack( Track * _trackToPlay ) +void Song::playTrack( Track * trackToPlay ) { if( isStopped() == false ) { stop(); } - m_trackToPlay = _trackToPlay; + m_trackToPlay = trackToPlay; m_playMode = Mode_PlayTrack; m_playing = true; @@ -493,7 +507,7 @@ void Song::playBB() -void Song::playPattern( const Pattern* patternToPlay, bool _loop ) +void Song::playPattern( const Pattern* patternToPlay, bool loop ) { if( isStopped() == false ) { @@ -501,7 +515,7 @@ void Song::playPattern( const Pattern* patternToPlay, bool _loop ) } m_patternToPlay = patternToPlay; - m_loopPattern = _loop; + m_loopPattern = loop; if( m_patternToPlay != NULL ) { @@ -539,12 +553,14 @@ void Song::updateLength() -void Song::setPlayPos( tick_t _ticks, PlayModes _play_mode ) +void Song::setPlayPos( tick_t ticks, PlayModes playMode ) { - m_elapsedTicks += m_playPos[_play_mode].getTicks() - _ticks; - m_elapsedMilliSeconds += (((( _ticks - m_playPos[_play_mode].getTicks()))*60*1000/48)/getTempo()); - m_playPos[_play_mode].setTicks( _ticks ); - m_playPos[_play_mode].setCurrentFrame( 0.0f ); + m_elapsedTicks += m_playPos[playMode].getTicks() - ticks; + m_elapsedMilliSeconds += + ( ( ( ( ticks - m_playPos[playMode].getTicks() ) ) * 60 * 1000 / 48) / + getTempo() ); + m_playPos[playMode].setTicks( ticks ); + m_playPos[playMode].setCurrentFrame( 0.0f ); // send a signal if playposition changes during playback if( isPlaying() ) @@ -604,7 +620,9 @@ void Song::stop() if( tl->savedPos() >= 0 ) { m_playPos[m_playMode].setTicks( tl->savedPos().getTicks() ); - m_elapsedMilliSeconds = (((tl->savedPos().getTicks())*60*1000/48)/getTempo()); + m_elapsedMilliSeconds = + ( ( ( tl->savedPos().getTicks() ) * 60 * 1000 / 48 ) / + getTempo() ); tl->savePos( -1 ); } break; @@ -709,7 +727,7 @@ void Song::addBBTrack() void Song::addSampleTrack() { - (void) Track::create( Track::SampleTrack, this ); + ( void )Track::create( Track::SampleTrack, this ); } @@ -717,7 +735,7 @@ void Song::addSampleTrack() void Song::addAutomationTrack() { - (void) Track::create( Track::AutomationTrack, this ); + ( void )Track::create( Track::AutomationTrack, this ); } @@ -725,7 +743,7 @@ void Song::addAutomationTrack() bpm_t Song::getTempo() { - return (bpm_t) m_tempoModel.value(); + return ( bpm_t )m_tempoModel.value(); } @@ -819,24 +837,23 @@ void Song::clearProject() - // create new file void Song::createNewProject() { - QString default_template = ConfigManager::inst()->userProjectsDir() + QString defaultTemplate = ConfigManager::inst()->userProjectsDir() + "templates/default.mpt"; - if( QFile::exists( default_template ) ) + if( QFile::exists( defaultTemplate ) ) { - createNewProjectFromTemplate( default_template ); + createNewProjectFromTemplate( defaultTemplate ); return; } - default_template = ConfigManager::inst()->factoryProjectsDir() + defaultTemplate = ConfigManager::inst()->factoryProjectsDir() + "templates/default.mpt"; - if( QFile::exists( default_template ) ) + if( QFile::exists( defaultTemplate ) ) { - createNewProjectFromTemplate( default_template ); + createNewProjectFromTemplate( defaultTemplate ); return; } @@ -886,9 +903,9 @@ void Song::createNewProject() -void Song::createNewProjectFromTemplate( const QString & _template ) +void Song::createNewProjectFromTemplate( const QString & templ ) { - loadProject( _template ); + loadProject( templ ); // clear file-name so that user doesn't overwrite template when // saving... m_fileName = m_oldFileName = ""; @@ -904,7 +921,7 @@ void Song::createNewProjectFromTemplate( const QString & _template ) // load given song -void Song::loadProject( const QString & _file_name ) +void Song::loadProject( const QString & fileName ) { QDomNode node; @@ -916,8 +933,8 @@ void Song::loadProject( const QString & _file_name ) Engine::mainWindow()->clearErrors(); } - m_fileName = _file_name; - m_oldFileName = _file_name; + m_fileName = fileName; + m_oldFileName = fileName; DataFile dataFile( m_fileName ); // if file could not be opened, head-node is null and we create @@ -1020,7 +1037,7 @@ void Song::loadProject( const QString & _file_name ) Engine::mixer()->unlock(); - ConfigManager::inst()->addRecentlyOpenedProject( _file_name ); + ConfigManager::inst()->addRecentlyOpenedProject( fileName ); Engine::projectJournal()->setJournalling( true ); @@ -1042,7 +1059,7 @@ void Song::loadProject( const QString & _file_name ) // only save current song as _filename and do nothing else -bool Song::saveProjectFile( const QString & _filename ) +bool Song::saveProjectFile( const QString & filename ) { DataFile::LocaleHelper localeHelper( DataFile::LocaleHelper::ModeSave ); @@ -1068,7 +1085,7 @@ bool Song::saveProjectFile( const QString & _filename ) saveControllerStates( dataFile, dataFile.content() ); - return dataFile.writeFile( _filename ); + return dataFile.writeFile( filename ); } @@ -1146,23 +1163,23 @@ void Song::importProject() -void Song::saveControllerStates( QDomDocument & _doc, QDomElement & _this ) +void Song::saveControllerStates( QDomDocument & doc, QDomElement & element ) { // save settings of controllers - QDomElement controllersNode =_doc.createElement( "controllers" ); - _this.appendChild( controllersNode ); + QDomElement controllersNode = doc.createElement( "controllers" ); + element.appendChild( controllersNode ); for( int i = 0; i < m_controllers.size(); ++i ) { - m_controllers[i]->saveState( _doc, controllersNode ); + m_controllers[i]->saveState( doc, controllersNode ); } } -void Song::restoreControllerStates( const QDomElement & _this ) +void Song::restoreControllerStates( const QDomElement & element ) { - QDomNode node = _this.firstChild(); + QDomNode node = element.firstChild(); while( !node.isNull() ) { Controller * c = Controller::create( node.toElement(), this ); @@ -1183,10 +1200,10 @@ void Song::restoreControllerStates( const QDomElement & _this ) void Song::exportProjectTracks() { - exportProject(true); + exportProject( true ); } -void Song::exportProject(bool multiExport) +void Song::exportProject( bool multiExport ) { if( isEmpty() ) { @@ -1199,7 +1216,7 @@ void Song::exportProject(bool multiExport) } FileDialog efd( Engine::mainWindow() ); - if (multiExport) + if ( multiExport ) { efd.setFileMode( FileDialog::Directory); efd.setWindowTitle( tr( "Select directory for writing exported tracks..." ) ); @@ -1219,18 +1236,18 @@ void Song::exportProject(bool multiExport) ++idx; } efd.setNameFilters( types ); - QString base_filename; + QString baseFilename; if( !m_fileName.isEmpty() ) { efd.setDirectory( QFileInfo( m_fileName ).absolutePath() ); - base_filename = QFileInfo( m_fileName ).completeBaseName(); + baseFilename = QFileInfo( m_fileName ).completeBaseName(); } else { efd.setDirectory( ConfigManager::inst()->userProjectsDir() ); - base_filename = tr( "untitled" ); + baseFilename = tr( "untitled" ); } - efd.selectFile( base_filename + __fileEncodeDevices[0].m_extension ); + efd.selectFile( baseFilename + __fileEncodeDevices[0].m_extension ); efd.setWindowTitle( tr( "Select file for project-export..." ) ); } @@ -1257,8 +1274,8 @@ void Song::exportProject(bool multiExport) } } - const QString export_file_name = efd.selectedFiles()[0] + suffix; - ExportProjectDialog epd( export_file_name, Engine::mainWindow(), multiExport ); + const QString exportFileName = efd.selectedFiles()[0] + suffix; + ExportProjectDialog epd( exportFileName, Engine::mainWindow(), multiExport ); epd.exec(); } } @@ -1290,11 +1307,11 @@ void Song::setModified() -void Song::addController( Controller * _c ) +void Song::addController( Controller * c ) { - if( _c != NULL && !m_controllers.contains( _c ) ) + if( c != NULL && m_controllers.contains( c ) == false ) { - m_controllers.append( _c ); + m_controllers.append( c ); emit dataChanged(); } } @@ -1302,9 +1319,9 @@ void Song::addController( Controller * _c ) -void Song::removeController( Controller * _controller ) +void Song::removeController( Controller * controller ) { - int index = m_controllers.indexOf( _controller ); + int index = m_controllers.indexOf( controller ); if( index != -1 ) { m_controllers.remove( index ); @@ -1319,5 +1336,3 @@ void Song::removeController( Controller * _controller ) - - From 6c49c88bfd0a5d756b09d7efb36e0ce797c58995 Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Wed, 7 Jan 2015 21:12:17 -0200 Subject: [PATCH 006/133] Update Mixer.cpp --- src/core/Mixer.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/core/Mixer.cpp b/src/core/Mixer.cpp index 0630b8e47..68b1522dc 100644 --- a/src/core/Mixer.cpp +++ b/src/core/Mixer.cpp @@ -318,9 +318,9 @@ const surroundSampleFrame * Mixer::renderNextBuffer() { m_profiler.startPeriod(); - static Song::playPos last_metro_pos = -1; + static Song::PlayPos last_metro_pos = -1; - Song::playPos p = Engine::getSong()->getPlayPos( + Song::PlayPos p = Engine::getSong()->getPlayPos( Song::Mode_PlayPattern ); if( Engine::getSong()->playMode() == Song::Mode_PlayPattern && Engine::pianoRoll()->isRecording() == true && @@ -968,6 +968,3 @@ void Mixer::fifoWriter::run() - - - From 06518054b2489b0440254c9403c8a9a7abface47 Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Wed, 7 Jan 2015 21:12:50 -0200 Subject: [PATCH 007/133] Update Timeline.cpp --- src/core/Timeline.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/core/Timeline.cpp b/src/core/Timeline.cpp index d30682d79..c5636dbd8 100644 --- a/src/core/Timeline.cpp +++ b/src/core/Timeline.cpp @@ -51,7 +51,7 @@ QPixmap * Timeline::s_loopPointBeginPixmap = NULL; QPixmap * Timeline::s_loopPointEndPixmap = NULL; Timeline::Timeline( const int _xoff, const int _yoff, const float _ppt, - Song::playPos & _pos, const MidiTime & _begin, + Song::PlayPos & _pos, const MidiTime & _begin, QWidget * _parent ) : QWidget( _parent ), m_autoScroll( AutoScrollEnabled ), @@ -391,7 +391,3 @@ void Timeline::mouseReleaseEvent( QMouseEvent* event ) - - - - From 4ae194cd8b4696341803f0da3bee753e3b973777 Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Wed, 7 Jan 2015 21:13:27 -0200 Subject: [PATCH 008/133] Update ProjectRenderer.cpp --- src/core/ProjectRenderer.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/core/ProjectRenderer.cpp b/src/core/ProjectRenderer.cpp index 727cb630c..e8a91c77d 100644 --- a/src/core/ProjectRenderer.cpp +++ b/src/core/ProjectRenderer.cpp @@ -163,7 +163,7 @@ void ProjectRenderer::run() //skip first empty buffer Engine::mixer()->nextBuffer(); - Song::playPos & pp = Engine::getSong()->getPlayPos( + Song::PlayPos & pp = Engine::getSong()->getPlayPos( Song::Mode_PlaySong ); m_progress = 0; const int sl = ( Engine::getSong()->length() + 1 ) * 192; @@ -230,5 +230,3 @@ void ProjectRenderer::updateConsoleProgress() - - From 35b954741b043e2b282e3e26b4c7109d73e50da0 Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Wed, 7 Jan 2015 21:14:29 -0200 Subject: [PATCH 009/133] Update Song.h --- include/Song.h | 71 +++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 36 deletions(-) diff --git a/include/Song.h b/include/Song.h index ee5f594d9..4cb343a6c 100644 --- a/include/Song.h +++ b/include/Song.h @@ -49,10 +49,9 @@ const tick_t MaxSongLength = 9999 * DefaultTicksPerTact; class EXPORT Song : public TrackContainer { Q_OBJECT - mapPropertyFromModel(int,getTempo,setTempo,m_tempoModel); - mapPropertyFromModel(int,masterPitch,setMasterPitch,m_masterPitchModel); - mapPropertyFromModel(int,masterVolume,setMasterVolume, - m_masterVolumeModel); + mapPropertyFromModel( int,getTempo,setTempo,m_tempoModel ); + mapPropertyFromModel( int,masterPitch,setMasterPitch,m_masterPitchModel ); + mapPropertyFromModel( int,masterVolume,setMasterVolume, m_masterVolumeModel ); public: enum PlayModes { @@ -66,19 +65,19 @@ public: } ; - class playPos : public MidiTime + class PlayPos : public MidiTime { public: - playPos( const int _abs = 0 ) : - MidiTime( _abs ), + PlayPos( const int abs = 0 ) : + MidiTime( abs ), m_timeLine( NULL ), m_timeLineUpdate( true ), m_currentFrame( 0.0f ) { } - inline void setCurrentFrame( const float _f ) + inline void setCurrentFrame( const float f ) { - m_currentFrame = _f; + m_currentFrame = f; } inline float currentFrame() const { @@ -100,9 +99,9 @@ public: { return m_elapsedMilliSeconds; } - inline void setMilliSeconds( float _ellapsedMilliSeconds ) + inline void setMilliSeconds( float ellapsedMilliSeconds ) { - m_elapsedMilliSeconds = (_ellapsedMilliSeconds); + m_elapsedMilliSeconds = ellapsedMilliSeconds; } inline int getTacts() const { @@ -119,14 +118,14 @@ public: // Returns the beat position inside the bar, 0-based inline int getBeat() const { - return (currentTick() - currentTact()*ticksPerTact()) / - (ticksPerTact() / m_timeSigModel.getNumerator() ); + return ( currentTick() - currentTact() * ticksPerTact() ) / + ( ticksPerTact() / m_timeSigModel.getNumerator() ); } // the remainder after bar and beat are removed inline int getBeatTicks() const { - return (currentTick() - currentTact()*ticksPerTact()) % - (ticksPerTact() / m_timeSigModel.getNumerator() ); + return ( currentTick() - currentTact() * ticksPerTact() ) % + ( ticksPerTact() / m_timeSigModel.getNumerator() ); } inline int getTicks() const { @@ -147,7 +146,7 @@ public: inline bool isPlaying() const { - return m_playing && m_exporting == false; + return m_playing == true && m_exporting == false; } inline bool isStopped() const @@ -182,9 +181,9 @@ public: return m_playMode; } - inline playPos & getPlayPos( PlayModes _pm ) + inline PlayPos & getPlayPos( PlayModes pm ) { - return m_playPos[_pm]; + return m_playPos[pm]; } void updateLength(); @@ -204,11 +203,11 @@ public: // file management void createNewProject(); - void createNewProjectFromTemplate( const QString & _template ); - void loadProject( const QString & _filename ); + void createNewProjectFromTemplate( const QString & templ ); + void loadProject( const QString & filename ); bool guiSaveProject(); - bool guiSaveProjectAs( const QString & _filename ); - bool saveProjectFile( const QString & _filename ); + bool guiSaveProjectAs( const QString & filename ); + bool saveProjectFile( const QString & filename ); const QString & projectFileName() const { @@ -235,8 +234,8 @@ public: return false; } - void addController( Controller * _c ); - void removeController( Controller * _c ); + void addController( Controller * c ); + void removeController( Controller * c ); const ControllerVector & controllers() const @@ -255,14 +254,14 @@ public slots: void playSong(); void record(); void playAndRecord(); - void playTrack( Track * _trackToPlay ); + void playTrack( Track * trackToPlay ); void playBB(); - void playPattern(const Pattern* patternToPlay, bool _loop = true ); + void playPattern( const Pattern * patternToPlay, bool loop = true ); void togglePause(); void stop(); void importProject(); - void exportProject(bool multiExport=false); + void exportProject( bool multiExport = false ); void exportProjectTracks(); void startExport(); @@ -311,13 +310,14 @@ private: inline f_cnt_t currentFrame() const { - return m_playPos[m_playMode].getTicks() * Engine::framesPerTick() + m_playPos[m_playMode].currentFrame(); + return m_playPos[m_playMode].getTicks() * Engine::framesPerTick() + + m_playPos[m_playMode].currentFrame(); } - void setPlayPos( tick_t _ticks, PlayModes _play_mode ); + void setPlayPos( tick_t ticks, PlayModes playMode ); - void saveControllerStates( QDomDocument & _doc, QDomElement & _this ); - void restoreControllerStates( const QDomElement & _this ); + void saveControllerStates( QDomDocument & doc, QDomElement & element ); + void restoreControllerStates( const QDomElement & element ); AutomationTrack * m_globalAutomationTrack; @@ -345,7 +345,7 @@ private: bool m_loadingProject; PlayModes m_playMode; - playPos m_playPos[Mode_Count]; + PlayPos m_playPos[Mode_Count]; tact_t m_length; Track * m_trackToPlay; @@ -368,10 +368,9 @@ signals: void projectLoaded(); void playbackStateChanged(); void playbackPositionChanged(); - void lengthChanged( int _tacts ); - void tempoChanged( bpm_t _new_bpm ); - void timeSignatureChanged( int _old_ticks_per_tact, - int _ticks_per_tact ); + void lengthChanged( int tacts ); + void tempoChanged( bpm_t newBPM ); + void timeSignatureChanged( int oldTicksPerTact, int ticksPerTact ); } ; From 918eea10639899cfddac9abb84974fde5b52ea9d Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Wed, 7 Jan 2015 21:14:55 -0200 Subject: [PATCH 010/133] Update Timeline.h --- include/Timeline.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/Timeline.h b/include/Timeline.h index 78dc00ddc..0707b9956 100644 --- a/include/Timeline.h +++ b/include/Timeline.h @@ -60,11 +60,11 @@ public: } ; - Timeline( int _xoff, int _yoff, float _ppt, Song::playPos & _pos, + Timeline( int _xoff, int _yoff, float _ppt, Song::PlayPos & _pos, const MidiTime & _begin, QWidget * _parent ); virtual ~Timeline(); - inline Song::playPos & pos() + inline Song::PlayPos & pos() { return( m_pos ); } @@ -162,7 +162,7 @@ private: int m_xOffset; int m_posMarkerX; float m_ppt; - Song::playPos & m_pos; + Song::PlayPos & m_pos; const MidiTime & m_begin; MidiTime m_loopPos[2]; From d0e0d9a6320949866b456fc1e1fa329e8b4c246c Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Wed, 7 Jan 2015 21:44:48 -0200 Subject: [PATCH 011/133] Update Plugin.cpp --- src/core/Plugin.cpp | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/src/core/Plugin.cpp b/src/core/Plugin.cpp index 769ed04f2..187be15a3 100644 --- a/src/core/Plugin.cpp +++ b/src/core/Plugin.cpp @@ -37,9 +37,9 @@ #include "MainWindow.h" -static PixmapLoader __dummy_loader; +static PixmapLoader __dummyLoader; -static Plugin::Descriptor dummy_plugin_descriptor = +static Plugin::Descriptor dummyPluginDescriptor = { "dummy", "dummy", @@ -47,21 +47,21 @@ static Plugin::Descriptor dummy_plugin_descriptor = "Tobias Doerffel ", 0x0100, Plugin::Undefined, - &__dummy_loader, + &__dummyLoader, NULL } ; -Plugin::Plugin( const Descriptor * _descriptor, Model * parent ) : +Plugin::Plugin( const Descriptor * descriptor, Model * parent ) : Model( parent ), JournallingObject(), - m_descriptor( _descriptor ) + m_descriptor( descriptor ) { if( m_descriptor == NULL ) { - m_descriptor = &dummy_plugin_descriptor; + m_descriptor = &dummyPluginDescriptor; } } @@ -108,7 +108,7 @@ Plugin * Plugin::instantiate( const QString & pluginName, Model * parent, return new DummyPlugin(); } - InstantiationHook instantiationHook = ( InstantiationHook ) pluginLibrary.resolve( "lmms_plugin_main" ); + InstantiationHook instantiationHook = ( InstantiationHook )pluginLibrary.resolve( "lmms_plugin_main" ); if( instantiationHook == NULL ) { if( Engine::hasGUI() ) @@ -125,13 +125,17 @@ Plugin * Plugin::instantiate( const QString & pluginName, Model * parent, return inst; } -void Plugin::collectErrorForUI( QString err_msg ) + + + +void Plugin::collectErrorForUI( QString errMsg ) { - Engine::mainWindow()->collectError( err_msg ); + Engine::mainWindow()->collectError( errMsg ); } + void Plugin::getDescriptorsOfAvailPlugins( DescriptorList& pluginDescriptors ) { QDir directory( ConfigManager::inst()->pluginDir() ); @@ -188,13 +192,13 @@ PluginView * Plugin::createView( QWidget * parent ) -Plugin::Descriptor::SubPluginFeatures::Key::Key( - const QDomElement & _key ) : + +Plugin::Descriptor::SubPluginFeatures::Key::Key( const QDomElement & key ) : desc( NULL ), - name( _key.attribute( "key" ) ), + name( key.attribute( "key" ) ), attributes() { - QDomNodeList l = _key.elementsByTagName( "attribute" ); + QDomNodeList l = key.elementsByTagName( "attribute" ); for( int i = 0; !l.item( i ).isNull(); ++i ) { QDomElement e = l.item( i ).toElement(); @@ -207,13 +211,13 @@ Plugin::Descriptor::SubPluginFeatures::Key::Key( QDomElement Plugin::Descriptor::SubPluginFeatures::Key::saveXML( - QDomDocument & _doc ) const + QDomDocument & doc ) const { - QDomElement e = _doc.createElement( "key" ); - for( AttributeMap::ConstIterator it = attributes.begin(); - it != attributes.end(); ++it ) + QDomElement e = doc.createElement( "key" ); + for( AttributeMap::ConstIterator it = attributes.begin(); + it != attributes.end(); ++it ) { - QDomElement a = _doc.createElement( "attribute" ); + QDomElement a = doc.createElement( "attribute" ); a.setAttribute( "name", it.key() ); a.setAttribute( "value", it.value() ); e.appendChild( a ); @@ -221,3 +225,5 @@ QDomElement Plugin::Descriptor::SubPluginFeatures::Key::saveXML( return e; } + + From 9199d3e8c36e511216dade77c52bb28306183d67 Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Wed, 7 Jan 2015 21:46:02 -0200 Subject: [PATCH 012/133] Update Plugin.h --- include/Plugin.h | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/include/Plugin.h b/include/Plugin.h index b73238ab5..5efcf68b7 100644 --- a/include/Plugin.h +++ b/include/Plugin.h @@ -85,19 +85,19 @@ public: { typedef QMap AttributeMap; - inline Key( const Plugin::Descriptor * _desc = NULL, - const QString & _name = QString(), - const AttributeMap & _am = AttributeMap() ) + inline Key( const Plugin::Descriptor * desc = NULL, + const QString & name = QString(), + const AttributeMap & am = AttributeMap() ) : - desc( _desc ), - name( _name ), - attributes( _am ) + desc( desc ), + name( name ), + attributes( am ) { } - Key( const QDomElement & _key ); + Key( const QDomElement & key ); - QDomElement saveXML( QDomDocument & _doc ) const; + QDomElement saveXML( QDomDocument & doc ) const; inline bool isValid() const { @@ -142,13 +142,15 @@ public: typedef QList DescriptorList; // contructor of a plugin - Plugin( const Descriptor* descriptor, Model* parent ); + Plugin( const Descriptor * descriptor, Model * parent ); virtual ~Plugin(); // returns display-name out of descriptor virtual QString displayName() const { - return Model::displayName().isEmpty() ? m_descriptor->displayName : Model::displayName(); + return Model::displayName().isEmpty() + ? m_descriptor->displayName + : Model::displayName(); } // return plugin-type @@ -158,41 +160,41 @@ public: } // return plugin-descriptor for further information - inline const Descriptor* descriptor() const + inline const Descriptor * descriptor() const { return m_descriptor; } // can be called if a file matching supportedFileTypes should be // loaded/processed with the help of this plugin - virtual void loadFile( const QString& file ); + virtual void loadFile( const QString & file ); // Called if external source needs to change something but we cannot // reference the class header. Should return null if not key not found. - virtual AutomatableModel* childModel( const QString& modelName ); + virtual AutomatableModel* childModel( const QString & modelName ); // returns an instance of a plugin whose name matches to given one // if specified plugin couldn't be loaded, it creates a dummy-plugin static Plugin * instantiate( const QString& pluginName, Model * parent, void * data ); // fills given list with descriptors of all available plugins - static void getDescriptorsOfAvailPlugins( DescriptorList& pluginDescriptors ); + static void getDescriptorsOfAvailPlugins( DescriptorList & pluginDescriptors ); // create a view for the model - PluginView * createView( QWidget* parent ); + PluginView * createView( QWidget * parent ); protected: // create a view for the model - virtual PluginView* instantiateView( QWidget* ) = 0; - void collectErrorForUI( QString err_msg ); + virtual PluginView* instantiateView( QWidget * ) = 0; + void collectErrorForUI( QString errMsg ); private: - const Descriptor* m_descriptor; + const Descriptor * m_descriptor; // pointer to instantiation-function in plugin - typedef Plugin * ( * InstantiationHook )( Model*, void* ); + typedef Plugin * ( * InstantiationHook )( Model * , void * ); } ; From bd9cb12294dbbb582f31a2b1aa84ff645da765a4 Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Wed, 7 Jan 2015 21:50:26 -0200 Subject: [PATCH 013/133] Update ProjectVersion.h --- include/ProjectVersion.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/ProjectVersion.h b/include/ProjectVersion.h index 7326ce3c3..eed635a5c 100644 --- a/include/ProjectVersion.h +++ b/include/ProjectVersion.h @@ -32,22 +32,22 @@ class ProjectVersion : public QString { public: - ProjectVersion( const QString & _s ) : - QString( _s ) + ProjectVersion( const QString & s ) : + QString( s ) { } - static int compare( const ProjectVersion & _v1, - const ProjectVersion & _v2 ); + static int compare( const ProjectVersion & v1, + const ProjectVersion & v2 ); } ; -inline bool operator<( const ProjectVersion & _v1, const char * _str ) +inline bool operator<( const ProjectVersion & v1, const char * str ) { - return ProjectVersion::compare( _v1, ProjectVersion( _str ) ) < 0; + return ProjectVersion::compare( v1, ProjectVersion( str ) ) < 0; } From c799500f3153f5c79f8f89c86f1e48b9948d6e88 Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Wed, 7 Jan 2015 21:50:57 -0200 Subject: [PATCH 014/133] Update ProjectVersion.cpp --- src/core/ProjectVersion.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/core/ProjectVersion.cpp b/src/core/ProjectVersion.cpp index 58e5ac541..a06efe3be 100644 --- a/src/core/ProjectVersion.cpp +++ b/src/core/ProjectVersion.cpp @@ -31,38 +31,38 @@ -int ProjectVersion::compare( const ProjectVersion & _v1, - const ProjectVersion & _v2 ) +int ProjectVersion::compare( const ProjectVersion & v1, + const ProjectVersion & v2 ) { int n1, n2; // Major - n1 = _v1.section( '.', 0, 0 ).toInt(); - n2 = _v2.section( '.', 0, 0 ).toInt(); + n1 = v1.section( '.', 0, 0 ).toInt(); + n2 = v2.section( '.', 0, 0 ).toInt(); if( n1 != n2 ) { return n1 - n2; } // Minor - n1 = _v1.section( '.', 1, 1 ).toInt(); - n2 = _v2.section( '.', 1, 1 ).toInt(); + n1 = v1.section( '.', 1, 1 ).toInt(); + n2 = v2.section( '.', 1, 1 ).toInt(); if( n1 != n2 ) { return n1 - n2; } // Release - n1 = _v1.section( '.', 2 ).section( '-', 0, 0 ).toInt(); - n2 = _v2.section( '.', 2 ).section( '-', 0, 0 ).toInt(); + n1 = v1.section( '.', 2 ).section( '-', 0, 0 ).toInt(); + n2 = v2.section( '.', 2 ).section( '-', 0, 0 ).toInt(); if( n1 != n2 ) { return n1 - n2; } // Build - const QString b1 = _v1.section( '.', 2 ).section( '-', 1 ); - const QString b2 = _v2.section( '.', 2 ).section( '-', 1 ); + const QString b1 = v1.section( '.', 2 ).section( '-', 1 ); + const QString b2 = v2.section( '.', 2 ).section( '-', 1 ); // make sure 0.x.y > 0.x.y-patch if( b1.isEmpty() ) @@ -79,4 +79,3 @@ int ProjectVersion::compare( const ProjectVersion & _v1, - From 26a84837c250c5040296f89c8deefe16eefdeed4 Mon Sep 17 00:00:00 2001 From: "Raine M. Ekman" Date: Wed, 14 Jan 2015 22:01:42 +0200 Subject: [PATCH 015/133] Switch track imported from MIDI channel 10 to bank 128, patch 0 in SF2 player. (aka. import drum tracks) --- plugins/MidiImport/MidiImport.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/MidiImport/MidiImport.cpp b/plugins/MidiImport/MidiImport.cpp index ec3178d85..67e7ba3b4 100644 --- a/plugins/MidiImport/MidiImport.cpp +++ b/plugins/MidiImport/MidiImport.cpp @@ -497,6 +497,15 @@ bool MidiImport::readSMF( TrackContainer* tc ) } } + // Set channel 10 to drums as per General MIDI's orders + if( chs[9].hasNotes && chs[9].it_inst && chs[9].isSF2 ) + { + // AFAIK, 128 should be the standard bank for drums in SF2. + // If not, this has to be made configurable. + chs[9].it_inst->childModel( "bank" )->setValue( 128 ); + chs[9].it_inst->childModel( "patch" )->setValue( 0 ); + } + return true; } From b0cf5ba289fee13af0f401b158541285ebe7472d Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Mon, 5 Jan 2015 20:45:07 -0200 Subject: [PATCH 016/133] Update coding conventions on Note.cpp --- src/core/Note.cpp | 107 +++++++++++++++++++++++----------------------- 1 file changed, 53 insertions(+), 54 deletions(-) diff --git a/src/core/Note.cpp b/src/core/Note.cpp index 937f52ac8..b973bb4e9 100644 --- a/src/core/Note.cpp +++ b/src/core/Note.cpp @@ -35,24 +35,24 @@ -Note::Note( const MidiTime & _length, const MidiTime & _pos, - int _key, volume_t _volume, panning_t _panning, - DetuningHelper * _detuning ) : +Note::Note( const MidiTime & length, const MidiTime & pos, + int key, volume_t volume, panning_t panning, + DetuningHelper * detuning ) : m_selected( false ), - m_oldKey( qBound( 0, _key, NumKeys ) ), - m_oldPos( _pos ), - m_oldLength( _length ), + m_oldKey( qBound( 0, key, NumKeys ) ), + m_oldPos( pos ), + m_oldLength( length ), m_isPlaying( false ), - m_key( qBound( 0, _key, NumKeys ) ), - m_volume( qBound( MinVolume, _volume, MaxVolume ) ), - m_panning( qBound( PanningLeft, _panning, PanningRight ) ), - m_length( _length ), - m_pos( _pos ), + m_key( qBound( 0, key, NumKeys ) ), + m_volume( qBound( MinVolume, volume, MaxVolume ) ), + m_panning( qBound( PanningLeft, panning, PanningRight ) ), + m_length( length ), + m_pos( pos ), m_detuning( NULL ) { - if( _detuning ) + if( detuning ) { - m_detuning = sharedObject::ref( _detuning ); + m_detuning = sharedObject::ref( detuning ); } else { @@ -63,23 +63,23 @@ Note::Note( const MidiTime & _length, const MidiTime & _pos, -Note::Note( const Note & _note ) : - SerializingObject( _note ), - m_selected( _note.m_selected ), - m_oldKey( _note.m_oldKey ), - m_oldPos( _note.m_oldPos ), - m_oldLength( _note.m_oldLength ), - m_isPlaying( _note.m_isPlaying ), - m_key( _note.m_key), - m_volume( _note.m_volume ), - m_panning( _note.m_panning ), - m_length( _note.m_length ), - m_pos( _note.m_pos ), +Note::Note( const Note & note ) : + SerializingObject( note ), + m_selected( note.m_selected ), + m_oldKey( note.m_oldKey ), + m_oldPos( note.m_oldPos ), + m_oldLength( note.m_oldLength ), + m_isPlaying( note.m_isPlaying ), + m_key( note.m_key), + m_volume( note.m_volume ), + m_panning( note.m_panning ), + m_length( note.m_length ), + m_pos( note.m_pos ), m_detuning( NULL ) { - if( _note.m_detuning ) + if( note.m_detuning ) { - m_detuning = sharedObject::ref( _note.m_detuning ); + m_detuning = sharedObject::ref( note.m_detuning ); } } @@ -97,93 +97,93 @@ Note::~Note() -void Note::setLength( const MidiTime & _length ) +void Note::setLength( const MidiTime & length ) { - m_length = _length; + m_length = length; } -void Note::setPos( const MidiTime & _pos ) +void Note::setPos( const MidiTime & pos ) { - m_pos = _pos; + m_pos = pos; } -void Note::setKey( const int _key ) +void Note::setKey( const int key ) { - const int k = qBound( 0, _key, NumKeys ); + const int k = qBound( 0, key, NumKeys ); m_key = k; } -void Note::setVolume( volume_t _volume ) +void Note::setVolume( volume_t volume ) { - const volume_t v = qBound( MinVolume, _volume, MaxVolume ); + const volume_t v = qBound( MinVolume, volume, MaxVolume ); m_volume = v; } -void Note::setPanning( panning_t _panning ) +void Note::setPanning( panning_t panning ) { - const panning_t p = qBound( PanningLeft, _panning, PanningRight ); + const panning_t p = qBound( PanningLeft, panning, PanningRight ); m_panning = p; } -MidiTime Note::quantized( const MidiTime & _m, const int _q_grid ) +MidiTime Note::quantized( const MidiTime & m, const int qGrid ) { - float p = ( (float) _m / _q_grid ); + float p = ( (float) m / qGrid ); if( p - floorf( p ) < 0.5f ) { - return( static_cast( p ) * _q_grid ); + return static_cast( p ) * qGrid; } - return( static_cast( p + 1 ) * _q_grid ); + return static_cast( p + 1 ) * qGrid; } -void Note::quantizeLength( const int _q_grid ) +void Note::quantizeLength( const int qGrid ) { - setLength( quantized( length(), _q_grid ) ); + setLength( quantized( length(), qGrid ) ); if( length() == 0 ) { - setLength( _q_grid ); + setLength( qGrid ); } } -void Note::quantizePos( const int _q_grid ) +void Note::quantizePos( const int qGrid ) { - setPos( quantized( pos(), _q_grid ) ); + setPos( quantized( pos(), qGrid ) ); } -void Note::saveSettings( QDomDocument & _doc, QDomElement & _this ) +void Note::saveSettings( QDomDocument & doc, QDomElement & parent ) { - _this.setAttribute( "key", m_key ); - _this.setAttribute( "vol", m_volume ); - _this.setAttribute( "pan", m_panning ); - _this.setAttribute( "len", m_length ); - _this.setAttribute( "pos", m_pos ); + parent.setAttribute( "key", m_key ); + parent.setAttribute( "vol", m_volume ); + parent.setAttribute( "pan", m_panning ); + parent.setAttribute( "len", m_length ); + parent.setAttribute( "pos", m_pos ); if( m_detuning && m_length ) { - m_detuning->saveSettings( _doc, _this ); + m_detuning->saveSettings( doc, parent ); } } @@ -231,4 +231,3 @@ bool Note::hasDetuningInfo() const - From d04076f44d3b37d4f5c64fa3daf39fee0ca70092 Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Mon, 5 Jan 2015 20:45:46 -0200 Subject: [PATCH 017/133] Update coding conventions on Note.h --- include/Note.h | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/include/Note.h b/include/Note.h index d5cc0363e..990a22a59 100644 --- a/include/Note.h +++ b/include/Note.h @@ -81,36 +81,36 @@ const float MaxDetuning = 4 * 12.0f; class EXPORT Note : public SerializingObject { public: - Note( const MidiTime & _length = MidiTime( 0 ), - const MidiTime & _pos = MidiTime( 0 ), + Note( const MidiTime & length = MidiTime( 0 ), + const MidiTime & pos = MidiTime( 0 ), int key = DefaultKey, - volume_t _volume = DefaultVolume, - panning_t _panning = DefaultPanning, - DetuningHelper * _detuning = NULL ); - Note( const Note & _note ); + volume_t volume = DefaultVolume, + panning_t panning = DefaultPanning, + DetuningHelper * detuning = NULL ); + Note( const Note & note ); virtual ~Note(); // used by GUI - inline void setSelected( const bool _selected ) { m_selected = _selected; } - inline void setOldKey( const int _oldKey ) { m_oldKey = _oldKey; } - inline void setOldPos( const MidiTime & _oldPos ) { m_oldPos = _oldPos; } - inline void setOldLength( const MidiTime & _oldLength ) + inline void setSelected( const bool selected ) { m_selected = selected; } + inline void setOldKey( const int oldKey ) { m_oldKey = oldKey; } + inline void setOldPos( const MidiTime & oldPos ) { m_oldPos = oldPos; } + inline void setOldLength( const MidiTime & oldLength ) { - m_oldLength = _oldLength; + m_oldLength = oldLength; } - inline void setIsPlaying( const bool _isPlaying ) + inline void setIsPlaying( const bool isPlaying ) { - m_isPlaying = _isPlaying; + m_isPlaying = isPlaying; } - void setLength( const MidiTime & _length ); - void setPos( const MidiTime & _pos ); - void setKey( const int _key ); + void setLength( const MidiTime & length ); + void setPos( const MidiTime & pos ); + void setKey( const int key ); virtual void setVolume( volume_t volume ); virtual void setPanning( panning_t panning ); - void quantizeLength( const int _q_grid ); - void quantizePos( const int _q_grid ); + void quantizeLength( const int qGrid ); + void quantizePos( const int qGrid ); static inline bool lessThan( Note * &lhs, Note * &rhs ) { @@ -160,9 +160,9 @@ public: return m_pos; } - inline MidiTime pos( MidiTime _base_pos ) const + inline MidiTime pos( MidiTime basePos ) const { - const int bp = _base_pos; + const int bp = basePos; return m_pos - bp; } @@ -196,7 +196,7 @@ public: return classNodeName(); } - static MidiTime quantized( const MidiTime & _m, const int _q_grid ); + static MidiTime quantized( const MidiTime & m, const int qGrid ); DetuningHelper * detuning() const { @@ -208,8 +208,7 @@ public: protected: - virtual void saveSettings( QDomDocument & _doc, - QDomElement & _parent ); + virtual void saveSettings( QDomDocument & doc, QDomElement & parent ); virtual void loadSettings( const QDomElement & _this ); @@ -234,4 +233,3 @@ typedef QVector NoteVector; #endif - From 118127a3bcc9ed2fbd08ebbb64ecf7c3ef80543d Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Mon, 5 Jan 2015 22:10:09 -0200 Subject: [PATCH 018/133] Update coding conventions --- src/core/Track.cpp | 617 +++++++++++++++++++++++---------------------- 1 file changed, 317 insertions(+), 300 deletions(-) diff --git a/src/core/Track.cpp b/src/core/Track.cpp index 426676f0e..1c64531a8 100644 --- a/src/core/Track.cpp +++ b/src/core/Track.cpp @@ -101,9 +101,9 @@ TextFloat * TrackContentObjectView::s_textFloat = NULL; * * \param _track The track that will contain the new object */ -TrackContentObject::TrackContentObject( Track * _track ) : - Model( _track ), - m_track( _track ), +TrackContentObject::TrackContentObject( Track * track ) : + Model( track ), + m_track( track ), m_name( QString::null ), m_startPosition(), m_length(), @@ -148,11 +148,11 @@ TrackContentObject::~TrackContentObject() * * \param _pos The new position of the track content object. */ -void TrackContentObject::movePosition( const MidiTime & _pos ) +void TrackContentObject::movePosition( const MidiTime & pos ) { - if( m_startPosition != _pos ) + if( m_startPosition != pos ) { - m_startPosition = _pos; + m_startPosition = pos; Engine::getSong()->updateLength(); } emit positionChanged(); @@ -168,11 +168,11 @@ void TrackContentObject::movePosition( const MidiTime & _pos ) * * \param _length The new length of the track content object. */ -void TrackContentObject::changeLength( const MidiTime & _length ) +void TrackContentObject::changeLength( const MidiTime & length ) { - if( m_length != _length ) + if( m_length != length ) { - m_length = _length; + m_length = length; Engine::getSong()->updateLength(); } emit lengthChanged(); @@ -243,12 +243,12 @@ void TrackContentObject::toggleMute() * \param _tco The track content object to be displayed * \param _tv The track view that will contain the new object */ -TrackContentObjectView::TrackContentObjectView( TrackContentObject * _tco, - TrackView * _tv ) : - selectableObject( _tv->getTrackContentWidget() ), +TrackContentObjectView::TrackContentObjectView( TrackContentObject * tco, + TrackView * tv ) : + selectableObject( tv->getTrackContentWidget() ), ModelView( NULL, this ), - m_tco( _tco ), - m_trackView( _tv ), + m_tco( tco ), + m_trackView( tv ), m_action( NoAction ), m_initialMousePos( QPoint( 0, 0 ) ), m_initialMouseGlobalPos( QPoint( 0, 0 ) ), @@ -269,7 +269,7 @@ TrackContentObjectView::TrackContentObjectView( TrackContentObject * _tco, move( 0, 1 ); show(); - setFixedHeight( _tv->getTrackContentWidget()->height() - 2 ); + setFixedHeight( tv->getTrackContentWidget()->height() - 2 ); setAcceptDrops( true ); setMouseTracking( true ); @@ -329,12 +329,12 @@ QColor TrackContentObjectView::textColor() const { return m_textColor; } //! \brief CSS theming qproperty access method -void TrackContentObjectView::setFgColor( const QColor & _c ) -{ m_fgColor = QColor( _c ); } +void TrackContentObjectView::setFgColor( const QColor & c ) +{ m_fgColor = QColor( c ); } //! \brief CSS theming qproperty access method -void TrackContentObjectView::setTextColor( const QColor & _c ) -{ m_textColor = QColor( _c ); } +void TrackContentObjectView::setTextColor( const QColor & c ) +{ m_textColor = QColor( c ); } /*! \brief Close a trackContentObjectView @@ -435,19 +435,19 @@ void TrackContentObjectView::updatePosition() * We need to notify Qt to change our display if something being * dragged has entered our 'airspace'. * - * \param _dee The QDragEnterEvent to watch. + * \param dee The QDragEnterEvent to watch. */ -void TrackContentObjectView::dragEnterEvent( QDragEnterEvent * _dee ) +void TrackContentObjectView::dragEnterEvent( QDragEnterEvent * dee ) { TrackContentWidget * tcw = getTrackView()->getTrackContentWidget(); MidiTime tcoPos = MidiTime( m_tco->startPosition().getTact(), 0 ); - if( tcw->canPasteSelection( tcoPos, _dee->mimeData() ) == false ) + if( tcw->canPasteSelection( tcoPos, dee->mimeData() ) == false ) { - _dee->ignore(); + dee->ignore(); } else { - StringPairDrag::processDragEnterEvent( _dee, "tco_" + + StringPairDrag::processDragEnterEvent( dee, "tco_" + QString::number( m_tco->getTrack()->type() ) ); } } @@ -462,12 +462,12 @@ void TrackContentObjectView::dragEnterEvent( QDragEnterEvent * _dee ) * to take the xml of the track content object and turn it into something * we can write over our current state. * - * \param _de The QDropEvent to handle. + * \param de The QDropEvent to handle. */ -void TrackContentObjectView::dropEvent( QDropEvent * _de ) +void TrackContentObjectView::dropEvent( QDropEvent * de ) { - QString type = StringPairDrag::decodeKey( _de ); - QString value = StringPairDrag::decodeValue( _de ); + QString type = StringPairDrag::decodeKey( de ); + QString value = StringPairDrag::decodeValue( de ); // Track must be the same type to paste into if( type != ( "tco_" + QString::number( m_tco->getTrack()->type() ) ) ) @@ -480,15 +480,15 @@ void TrackContentObjectView::dropEvent( QDropEvent * _de ) { TrackContentWidget * tcw = getTrackView()->getTrackContentWidget(); MidiTime tcoPos = MidiTime( m_tco->startPosition().getTact(), 0 ); - if( tcw->pasteSelection( tcoPos, _de ) == true ) + if( tcw->pasteSelection( tcoPos, de ) == true ) { - _de->accept(); + de->accept(); } return; } // Don't allow pasting a tco into itself. - QObject* qwSource = _de->source(); + QObject* qwSource = de->source(); if( qwSource != NULL && dynamic_cast( qwSource ) == this ) { @@ -502,7 +502,7 @@ void TrackContentObjectView::dropEvent( QDropEvent * _de ) m_tco->restoreState( tcos.firstChildElement().firstChildElement() ); m_tco->movePosition( pos ); AutomationPattern::resolveAllIDs(); - _de->accept(); + de->accept(); } @@ -510,17 +510,17 @@ void TrackContentObjectView::dropEvent( QDropEvent * _de ) /*! \brief Handle a dragged selection leaving our 'airspace'. * - * \param _e The QEvent to watch. + * \param e The QEvent to watch. */ -void TrackContentObjectView::leaveEvent( QEvent * _e ) +void TrackContentObjectView::leaveEvent( QEvent * e ) { while( QApplication::overrideCursor() != NULL ) { QApplication::restoreOverrideCursor(); } - if( _e != NULL ) + if( e != NULL ) { - QWidget::leaveEvent( _e ); + QWidget::leaveEvent( e ); } } @@ -586,20 +586,20 @@ DataFile TrackContentObjectView::createTCODataFiles( * * or if ctrl-middle button, mute the track content object * * or if middle button, maybe delete the track content object. * - * \param _me The QMouseEvent to handle. + * \param me The QMouseEvent to handle. */ -void TrackContentObjectView::mousePressEvent( QMouseEvent * _me ) +void TrackContentObjectView::mousePressEvent( QMouseEvent * me ) { - setInitialMousePos( _me->pos() ); + setInitialMousePos( me->pos() ); if( m_trackView->trackContainerView()->allowRubberband() == true && - _me->button() == Qt::LeftButton ) + me->button() == Qt::LeftButton ) { if( m_trackView->trackContainerView()->rubberBandActive() == true ) { // Propagate to trackView for rubberbanding - selectableObject::mousePressEvent( _me ); + selectableObject::mousePressEvent( me ); } - else if ( _me->modifiers() & Qt::ControlModifier ) + else if ( me->modifiers() & Qt::ControlModifier ) { if( isSelected() == true ) { @@ -610,7 +610,7 @@ void TrackContentObjectView::mousePressEvent( QMouseEvent * _me ) m_action = ToggleSelected; } } - else if( !_me->modifiers() ) + else if( !me->modifiers() ) { if( isSelected() == true ) { @@ -618,8 +618,8 @@ void TrackContentObjectView::mousePressEvent( QMouseEvent * _me ) } } } - else if( _me->button() == Qt::LeftButton && - _me->modifiers() & Qt::ControlModifier ) + else if( me->button() == Qt::LeftButton && + me->modifiers() & Qt::ControlModifier ) { // start drag-action QVector tcoViews; @@ -633,7 +633,7 @@ void TrackContentObjectView::mousePressEvent( QMouseEvent * _me ) m_tco->getTrack()->type() ), dataFile.toString(), thumbnail, this ); } - else if( _me->button() == Qt::LeftButton && + else if( me->button() == Qt::LeftButton && /* engine::mainWindow()->isShiftPressed() == false &&*/ fixedTCOs() == false ) { @@ -642,9 +642,9 @@ void TrackContentObjectView::mousePressEvent( QMouseEvent * _me ) // move or resize m_tco->setJournalling( false ); - setInitialMousePos( _me->pos() ); + setInitialMousePos( me->pos() ); - if( _me->x() < width() - RESIZE_GRIP_WIDTH ) + if( me->x() < width() - RESIZE_GRIP_WIDTH ) { m_action = Move; m_oldTime = m_tco->startPosition(); @@ -672,23 +672,23 @@ void TrackContentObjectView::mousePressEvent( QMouseEvent * _me ) } // s_textFloat->reparent( this ); // setup text-float as if TCO was already moved/resized - mouseMoveEvent( _me ); + mouseMoveEvent( me ); s_textFloat->show(); } - else if( _me->button() == Qt::RightButton ) + else if( me->button() == Qt::RightButton ) { - if( _me->modifiers() & Qt::ControlModifier ) + if( me->modifiers() & Qt::ControlModifier ) { m_tco->toggleMute(); } - else if( _me->modifiers() & Qt::ShiftModifier && fixedTCOs() == false ) + else if( me->modifiers() & Qt::ShiftModifier && fixedTCOs() == false ) { remove(); } } - else if( _me->button() == Qt::MidButton ) + else if( me->button() == Qt::MidButton ) { - if( _me->modifiers() & Qt::ControlModifier ) + if( me->modifiers() & Qt::ControlModifier ) { m_tco->toggleMute(); } @@ -712,17 +712,17 @@ void TrackContentObjectView::mousePressEvent( QMouseEvent * _me ) * * or if in resize mode, resize ourselves, * * otherwise ??? * - * \param _me The QMouseEvent to handle. + * \param me The QMouseEvent to handle. * \todo what does the final else case do here? */ -void TrackContentObjectView::mouseMoveEvent( QMouseEvent * _me ) +void TrackContentObjectView::mouseMoveEvent( QMouseEvent * me ) { if( m_action == CopySelection ) { - if( mouseMovedDistance( _me, 2 ) == true && + if( mouseMovedDistance( me, 2 ) == true && m_trackView->trackContainerView()->allowRubberband() == true && m_trackView->trackContainerView()->rubberBandActive() == false && - ( _me->modifiers() & Qt::ControlModifier ) ) + ( me->modifiers() & Qt::ControlModifier ) ) { // Clear the action here because mouseReleaseEvent will not get // triggered once we go into drag. @@ -757,7 +757,7 @@ void TrackContentObjectView::mouseMoveEvent( QMouseEvent * _me ) } } - if( _me->modifiers() & Qt::ControlModifier ) + if( me->modifiers() & Qt::ControlModifier ) { delete m_hint; m_hint = NULL; @@ -766,13 +766,13 @@ void TrackContentObjectView::mouseMoveEvent( QMouseEvent * _me ) const float ppt = m_trackView->trackContainerView()->pixelsPerTact(); if( m_action == Move ) { - const int x = mapToParent( _me->pos() ).x() - m_initialMousePos.x(); + const int x = mapToParent( me->pos() ).x() - m_initialMousePos.x(); MidiTime t = qMax( 0, (int) m_trackView->trackContainerView()->currentPosition()+ static_cast( x * MidiTime::ticksPerTact() / ppt ) ); - if( ! ( _me->modifiers() & Qt::ControlModifier ) - && _me->button() == Qt::NoButton ) + if( ! ( me->modifiers() & Qt::ControlModifier ) + && me->button() == Qt::NoButton ) { t = t.toNearestTact(); } @@ -787,7 +787,7 @@ void TrackContentObjectView::mouseMoveEvent( QMouseEvent * _me ) } else if( m_action == MoveSelection ) { - const int dx = _me->x() - m_initialMousePos.x(); + const int dx = me->x() - m_initialMousePos.x(); QVector so = m_trackView->trackContainerView()->selectedObjects(); QVector tcos; @@ -816,8 +816,8 @@ void TrackContentObjectView::mouseMoveEvent( QMouseEvent * _me ) t = ( *it )->startPosition() + static_cast( dx *MidiTime::ticksPerTact() / ppt )-smallest_pos; - if( ! ( _me->modifiers() & Qt::AltModifier ) - && _me->button() == Qt::NoButton ) + if( ! ( me->modifiers() & Qt::AltModifier ) + && me->button() == Qt::NoButton ) { t = t.toNearestTact(); } @@ -826,8 +826,8 @@ void TrackContentObjectView::mouseMoveEvent( QMouseEvent * _me ) } else if( m_action == Resize ) { - MidiTime t = qMax( MidiTime::ticksPerTact() / 16, static_cast( _me->x() * MidiTime::ticksPerTact() / ppt ) ); - if( ! ( _me->modifiers() & Qt::ControlModifier ) && _me->button() == Qt::NoButton ) + MidiTime t = qMax( MidiTime::ticksPerTact() / 16, static_cast( me->x() * MidiTime::ticksPerTact() / ppt ) ); + if( ! ( me->modifiers() & Qt::ControlModifier ) && me->button() == Qt::NoButton ) { t = qMax( MidiTime::ticksPerTact(), t.toNearestTact() ); } @@ -847,7 +847,7 @@ void TrackContentObjectView::mouseMoveEvent( QMouseEvent * _me ) } else { - if( _me->x() > width() - RESIZE_GRIP_WIDTH && !_me->buttons() && !m_tco->getAutoResize() ) + if( me->x() > width() - RESIZE_GRIP_WIDTH && !me->buttons() && !m_tco->getAutoResize() ) { if( QApplication::overrideCursor() != NULL && QApplication::overrideCursor()->shape() != @@ -876,16 +876,16 @@ void TrackContentObjectView::mouseMoveEvent( QMouseEvent * _me ) * If we're in move or resize mode, journal the change as appropriate. * Then tidy up. * - * \param _me The QMouseEvent to handle. + * \param me The QMouseEvent to handle. */ -void TrackContentObjectView::mouseReleaseEvent( QMouseEvent * _me ) +void TrackContentObjectView::mouseReleaseEvent( QMouseEvent * me ) { // If the CopySelection was chosen as the action due to mouse movement, // it will have been cleared. At this point Toggle is the desired action. // An active StringPairDrag will prevent this method from being called, // so a real CopySelection would not have occurred. if( m_action == CopySelection || - ( m_action == ToggleSelected && mouseMovedDistance( _me, 2 ) == false ) ) + ( m_action == ToggleSelected && mouseMovedDistance( me, 2 ) == false ) ) { setSelected( !isSelected() ); } @@ -899,7 +899,7 @@ void TrackContentObjectView::mouseReleaseEvent( QMouseEvent * _me ) m_hint = NULL; s_textFloat->hide(); leaveEvent( NULL ); - selectableObject::mouseReleaseEvent( _me ); + selectableObject::mouseReleaseEvent( me ); } @@ -910,11 +910,11 @@ void TrackContentObjectView::mouseReleaseEvent( QMouseEvent * _me ) * Set up the various context menu events that can apply to a * track content object view. * - * \param _cme The QContextMenuEvent to add the actions to. + * \param cme The QContextMenuEvent to add the actions to. */ -void TrackContentObjectView::contextMenuEvent( QContextMenuEvent * _cme ) +void TrackContentObjectView::contextMenuEvent( QContextMenuEvent * cme ) { - if( _cme->modifiers() ) + if( cme->modifiers() ) { return; } @@ -958,14 +958,30 @@ float TrackContentObjectView::pixelsPerTact() +<<<<<<< HEAD +======= +/*! \brief Set whether this trackContentObjectView can resize. + * + * \param e The boolean state of whether this track content object view + * is allowed to resize. + */ +void TrackContentObjectView::setAutoResizeEnabled( bool e ) +{ + m_autoResize = e; +} + + + + +>>>>>>> Update coding conventions /*! \brief Detect whether the mouse moved more than n pixels on screen. * * \param _me The QMouseEvent. * \param distance The threshold distance that the mouse has moved to return true. */ -bool TrackContentObjectView::mouseMovedDistance( QMouseEvent * _me, int distance ) +bool TrackContentObjectView::mouseMovedDistance( QMouseEvent * me, int distance ) { - QPoint dPos = mapToGlobal( _me->pos() ) - m_initialMouseGlobalPos; + QPoint dPos = mapToGlobal( me->pos() ) - m_initialMouseGlobalPos; const int pixelsMoved = dPos.manhattanLength(); return ( pixelsMoved > distance || pixelsMoved < -distance ); } @@ -982,17 +998,17 @@ bool TrackContentObjectView::mouseMovedDistance( QMouseEvent * _me, int distance * The content widget comprises the 'grip bar' and the 'tools' button * for the track's context menu. * - * \param _track The parent track. + * \param parent The parent track. */ -TrackContentWidget::TrackContentWidget( TrackView * _parent ) : - QWidget( _parent ), - m_trackView( _parent ), +TrackContentWidget::TrackContentWidget( TrackView * parent ) : + QWidget( parent ), + m_trackView( parent ), m_darkerColor( Qt::SolidPattern ), m_lighterColor( Qt::SolidPattern ) { setAcceptDrops( true ); - connect( _parent->trackContainerView(), + connect( parent->trackContainerView(), SIGNAL( positionChanged( const MidiTime & ) ), this, SLOT( changePosition( const MidiTime & ) ) ); @@ -1062,13 +1078,13 @@ void TrackContentWidget::updateBackground() * Adds a(nother) trackContentObjectView to our list of views. We also * check that our position is up-to-date. * - * \param _tcov The trackContentObjectView to add. + * \param tcov The trackContentObjectView to add. */ -void TrackContentWidget::addTCOView( TrackContentObjectView * _tcov ) +void TrackContentWidget::addTCOView( TrackContentObjectView * tcov ) { - TrackContentObject * tco = _tcov->getTrackContentObject(); + TrackContentObject * tco = tcov->getTrackContentObject(); - m_tcoViews.push_back( _tcov ); + m_tcoViews.push_back( tcov ); tco->saveJournallingState( false ); changePosition(); @@ -1082,13 +1098,13 @@ void TrackContentWidget::addTCOView( TrackContentObjectView * _tcov ) * * Removes the given trackContentObjectView from our list of views. * - * \param _tcov The trackContentObjectView to add. + * \param tcov The trackContentObjectView to add. */ -void TrackContentWidget::removeTCOView( TrackContentObjectView * _tcov ) +void TrackContentWidget::removeTCOView( TrackContentObjectView * tcov ) { tcoViewVector::iterator it = qFind( m_tcoViews.begin(), m_tcoViews.end(), - _tcov ); + tcov ); if( it != m_tcoViews.end() ) { m_tcoViews.erase( it ); @@ -1120,13 +1136,13 @@ void TrackContentWidget::update() // change of visible viewport /*! \brief Move the trackContentWidget to a new place in time * - * \param _new_pos The MIDI time to move to. + * \param newPos The MIDI time to move to. */ -void TrackContentWidget::changePosition( const MidiTime & _new_pos ) +void TrackContentWidget::changePosition( const MidiTime & newPos ) { if( m_trackView->trackContainerView() == gui->getBBEditor()->trackContainerView() ) { - const int cur_bb = Engine::getBBTrackContainer()->currentBB(); + const int curBB = Engine::getBBTrackContainer()->currentBB(); setUpdatesEnabled( false ); // first show TCO for current BB... @@ -1134,7 +1150,7 @@ void TrackContentWidget::changePosition( const MidiTime & _new_pos ) it != m_tcoViews.end(); ++it ) { if( ( *it )->getTrackContentObject()-> - startPosition().getTact() == cur_bb ) + startPosition().getTact() == curBB ) { ( *it )->move( 0, ( *it )->y() ); ( *it )->raise(); @@ -1150,7 +1166,7 @@ void TrackContentWidget::changePosition( const MidiTime & _new_pos ) it != m_tcoViews.end(); ++it ) { if( ( *it )->getTrackContentObject()-> - startPosition().getTact() != cur_bb ) + startPosition().getTact() != curBB ) { ( *it )->hide(); } @@ -1159,7 +1175,7 @@ void TrackContentWidget::changePosition( const MidiTime & _new_pos ) return; } - MidiTime pos = _new_pos; + MidiTime pos = newPos; if( pos < 0 ) { pos = m_trackView->trackContainerView()->currentPosition(); @@ -1208,13 +1224,13 @@ void TrackContentWidget::changePosition( const MidiTime & _new_pos ) /*! \brief Return the position of the trackContentWidget in Tacts. * - * \param _mouse_x the mouse's current X position in pixels. + * \param mouseX the mouse's current X position in pixels. */ -MidiTime TrackContentWidget::getPosition( int _mouse_x ) +MidiTime TrackContentWidget::getPosition( int mouseX ) { TrackContainerView * tv = m_trackView->trackContainerView(); return MidiTime( tv->currentPosition() + - _mouse_x * + mouseX * MidiTime::ticksPerTact() / static_cast( tv->pixelsPerTact() ) ); } @@ -1224,18 +1240,18 @@ MidiTime TrackContentWidget::getPosition( int _mouse_x ) /*! \brief Respond to a drag enter event on the trackContentWidget * - * \param _dee the Drag Enter Event to respond to + * \param dee the Drag Enter Event to respond to */ -void TrackContentWidget::dragEnterEvent( QDragEnterEvent * _dee ) +void TrackContentWidget::dragEnterEvent( QDragEnterEvent * dee ) { - MidiTime tcoPos = MidiTime( getPosition( _dee->pos().x() ).getTact(), 0 ); - if( canPasteSelection( tcoPos, _dee->mimeData() ) == false ) + MidiTime tcoPos = MidiTime( getPosition( dee->pos().x() ).getTact(), 0 ); + if( canPasteSelection( tcoPos, dee->mimeData() ) == false ) { - _dee->ignore(); + dee->ignore(); } else { - StringPairDrag::processDragEnterEvent( _dee, "tco_" + + StringPairDrag::processDragEnterEvent( dee, "tco_" + QString::number( getTrack()->type() ) ); } } @@ -1246,7 +1262,7 @@ void TrackContentWidget::dragEnterEvent( QDragEnterEvent * _dee ) /*! \brief Returns whether a selection of TCOs can be pasted into this * * \param tcoPos the position of the TCO slot being pasted on - * \param _de the DropEvent generated + * \param de the DropEvent generated */ bool TrackContentWidget::canPasteSelection( MidiTime tcoPos, const QMimeData * mimeData ) { @@ -1289,7 +1305,7 @@ bool TrackContentWidget::canPasteSelection( MidiTime tcoPos, const QMimeData * m QDomNodeList tcoNodes = tcoParent.childNodes(); // Determine if all the TCOs will land on a valid track - for( int i = 0; imimeData() ) == false ) + if( canPasteSelection( tcoPos, de->mimeData() ) == false ) { return false; } - QString type = StringPairDrag::decodeKey( _de ); - QString value = StringPairDrag::decodeValue( _de ); + QString type = StringPairDrag::decodeKey( de ); + QString value = StringPairDrag::decodeValue( de ); getTrack()->addJournalCheckPoint(); @@ -1405,14 +1421,14 @@ bool TrackContentWidget::pasteSelection( MidiTime tcoPos, QDropEvent * _de ) /*! \brief Respond to a drop event on the trackContentWidget * - * \param _de the Drop Event to respond to + * \param de the Drop Event to respond to */ -void TrackContentWidget::dropEvent( QDropEvent * _de ) +void TrackContentWidget::dropEvent( QDropEvent * de ) { - MidiTime tcoPos = MidiTime( getPosition( _de->pos().x() ).getTact(), 0 ); - if( pasteSelection( tcoPos, _de ) == true ) + MidiTime tcoPos = MidiTime( getPosition( de->pos().x() ).getTact(), 0 ); + if( pasteSelection( tcoPos, de ) == true ) { - _de->accept(); + de->accept(); } } @@ -1421,29 +1437,28 @@ void TrackContentWidget::dropEvent( QDropEvent * _de ) /*! \brief Respond to a mouse press on the trackContentWidget * - * \param _me the mouse press event to respond to + * \param me the mouse press event to respond to */ -void TrackContentWidget::mousePressEvent( QMouseEvent * _me ) +void TrackContentWidget::mousePressEvent( QMouseEvent * me ) { if( m_trackView->trackContainerView()->allowRubberband() == true ) { - QWidget::mousePressEvent( _me ); + QWidget::mousePressEvent( me ); } - else if( _me->modifiers() & Qt::ShiftModifier ) + else if( me->modifiers() & Qt::ShiftModifier ) { - QWidget::mousePressEvent( _me ); + QWidget::mousePressEvent( me ); } - else if( _me->button() == Qt::LeftButton && + else if( me->button() == Qt::LeftButton && !m_trackView->trackContainerView()->fixedTCOs() ) { - const MidiTime pos = getPosition( _me->x() ).getTact() * + const MidiTime pos = getPosition( me->x() ).getTact() * MidiTime::ticksPerTact(); TrackContentObject * tco = getTrack()->createTCO( pos ); tco->saveJournallingState( false ); tco->movePosition( pos ); tco->restoreJournallingState(); - } } @@ -1452,9 +1467,9 @@ void TrackContentWidget::mousePressEvent( QMouseEvent * _me ) /*! \brief Repaint the trackContentWidget on command * - * \param _pe the Paint Event to respond to + * \param pe the Paint Event to respond to */ -void TrackContentWidget::paintEvent( QPaintEvent * _pe ) +void TrackContentWidget::paintEvent( QPaintEvent * pe ) { // Assume even-pixels-per-tact. Makes sense, should be like this anyways const TrackContainerView * tcv = m_trackView->trackContainerView(); @@ -1499,13 +1514,13 @@ Track * TrackContentWidget::getTrack() /*! \brief Return the end position of the trackContentWidget in Tacts. * - * \param _pos_start the starting position of the Widget (from getPosition()) + * \param posStart the starting position of the Widget (from getPosition()) */ -MidiTime TrackContentWidget::endPosition( const MidiTime & _pos_start ) +MidiTime TrackContentWidget::endPosition( const MidiTime & posStart ) { const float ppt = m_trackView->trackContainerView()->pixelsPerTact(); const int w = width(); - return _pos_start + static_cast( w * MidiTime::ticksPerTact() / ppt ); + return posStart + static_cast( w * MidiTime::ticksPerTact() / ppt ); } @@ -1542,11 +1557,11 @@ QPixmap * TrackOperationsWidget::s_grip = NULL; /*!< grip pixmap */ * * The trackOperationsWidget is the grip and the mute button of a track. * - * \param _parent the trackView to contain this widget + * \param parent the trackView to contain this widget */ -TrackOperationsWidget::TrackOperationsWidget( TrackView * _parent ) : - QWidget( _parent ), /*!< The parent widget */ - m_trackView( _parent ) /*!< The parent track view */ +TrackOperationsWidget::TrackOperationsWidget( TrackView * parent ) : + QWidget( parent ), /*!< The parent widget */ + m_trackView( parent ) /*!< The parent track view */ { if( s_grip == NULL ) { @@ -1557,9 +1572,9 @@ TrackOperationsWidget::TrackOperationsWidget( TrackView * _parent ) : ToolTip::add( this, tr( "Press while clicking on move-grip " "to begin a new drag'n'drop-action." ) ); - QMenu * to_menu = new QMenu( this ); - to_menu->setFont( pointSize<9>( to_menu->font() ) ); - connect( to_menu, SIGNAL( aboutToShow() ), this, SLOT( updateMenu() ) ); + QMenu * toMenu = new QMenu( this ); + toMenu->setFont( pointSize<9>( toMenu->font() ) ); + connect( toMenu, SIGNAL( aboutToShow() ), this, SLOT( updateMenu() ) ); setObjectName( "automationEnabled" ); @@ -1568,7 +1583,7 @@ TrackOperationsWidget::TrackOperationsWidget( TrackView * _parent ) : m_trackOps = new QPushButton( this ); m_trackOps->move( 12, 1 ); m_trackOps->setFocusPolicy( Qt::NoFocus ); - m_trackOps->setMenu( to_menu ); + m_trackOps->setMenu( toMenu ); ToolTip::add( m_trackOps, tr( "Actions for this track" ) ); @@ -1627,12 +1642,12 @@ TrackOperationsWidget::~TrackOperationsWidget() * * Otherwise, ignore all other events. * - * \param _me The mouse event to respond to. + * \param me The mouse event to respond to. */ -void TrackOperationsWidget::mousePressEvent( QMouseEvent * _me ) +void TrackOperationsWidget::mousePressEvent( QMouseEvent * me ) { - if( _me->button() == Qt::LeftButton && - _me->modifiers() & Qt::ControlModifier && + if( me->button() == Qt::LeftButton && + me->modifiers() & Qt::ControlModifier && m_trackView->getTrack()->type() != Track::BBTrack ) { DataFile dataFile( DataFile::DragNDropData ); @@ -1643,17 +1658,16 @@ void TrackOperationsWidget::mousePressEvent( QMouseEvent * _me ) m_trackView->getTrackSettingsWidget() ), this ); } - else if( _me->button() == Qt::LeftButton ) + else if( me->button() == Qt::LeftButton ) { // track-widget (parent-widget) initiates track-move - _me->ignore(); + me->ignore(); } } - /*! \brief Repaint the trackOperationsWidget * * If we're not moving, and in the Beat+Bassline Editor, then turn @@ -1663,9 +1677,9 @@ void TrackOperationsWidget::mousePressEvent( QMouseEvent * _me ) * Otherwise, hide ourselves. * * \todo Flesh this out a bit - is it correct? - * \param _pe The paint event to respond to + * \param pe The paint event to respond to */ -void TrackOperationsWidget::paintEvent( QPaintEvent * _pe ) +void TrackOperationsWidget::paintEvent( QPaintEvent * pe ) { QPainter p( this ); p.fillRect( rect(), palette().brush(QPalette::Background) ); @@ -1751,21 +1765,22 @@ void TrackOperationsWidget::removeTrack() */ void TrackOperationsWidget::updateMenu() { - QMenu * to_menu = m_trackOps->menu(); - to_menu->clear(); - to_menu->addAction( embed::getIconPixmap( "edit_copy", 16, 16 ), + QMenu * toMenu = m_trackOps->menu(); + toMenu->clear(); + toMenu->addAction( embed::getIconPixmap( "edit_copy", 16, 16 ), tr( "Clone this track" ), this, SLOT( cloneTrack() ) ); - to_menu->addAction( embed::getIconPixmap( "cancel", 16, 16 ), + toMenu->addAction( embed::getIconPixmap( "cancel", 16, 16 ), tr( "Remove this track" ), this, SLOT( removeTrack() ) ); if( ! m_trackView->trackContainerView()->fixedTCOs() ) { - to_menu->addAction( tr( "Clear this track" ), this, SLOT( clearTrack() ) ); + toMenu->addAction( tr( "Clear this track" ), this, SLOT( clearTrack() ) ); } if( InstrumentTrackView * trackView = dynamic_cast( m_trackView ) ) { +<<<<<<< HEAD int channelIndex = trackView->model()->effectChannelModel()->value(); FxChannel * fxChannel = Engine::fxMixer()->effectChannel( channelIndex ); @@ -1794,11 +1809,16 @@ void TrackOperationsWidget::updateMenu() to_menu->addSeparator(); to_menu->addMenu( trackView->midiMenu() ); +======= + toMenu->addSeparator(); + toMenu->addMenu( dynamic_cast( + m_trackView )->midiMenu() ); +>>>>>>> Update coding conventions } if( dynamic_cast( m_trackView ) ) { - to_menu->addAction( tr( "Turn all recording on" ), this, SLOT( recordingOn() ) ); - to_menu->addAction( tr( "Turn all recording off" ), this, SLOT( recordingOff() ) ); + toMenu->addAction( tr( "Turn all recording on" ), this, SLOT( recordingOn() ) ); + toMenu->addAction( tr( "Turn all recording off" ), this, SLOT( recordingOff() ) ); } } @@ -1844,15 +1864,15 @@ void TrackOperationsWidget::recordingOff() * The track object is the whole track, linking its contents, its * automation, name, type, and so forth. * - * \param _type The type of track (Song Editor or Beat+Bassline Editor) - * \param _tc The track Container object to encapsulate in this track. + * \param type The type of track (Song Editor or Beat+Bassline Editor) + * \param tc The track Container object to encapsulate in this track. * * \todo check the definitions of all the properties - are they OK? */ -Track::Track( TrackTypes _type, TrackContainer * _tc ) : - Model( _tc ), /*!< The track Model */ - m_trackContainer( _tc ), /*!< The track container object */ - m_type( _type ), /*!< The track type */ +Track::Track( TrackTypes type, TrackContainer * tc ) : + Model( tc ), /*!< The track Model */ + m_trackContainer( tc ), /*!< The track container object */ + m_type( type ), /*!< The track type */ m_name(), /*!< The track's name */ m_mutedModel( false, this, tr( "Muted" ) ), /*!< For controlling track muting */ @@ -1897,27 +1917,27 @@ Track::~Track() /*! \brief Create a track based on the given track type and container. * - * \param _tt The type of track to create - * \param _tc The track container to attach to + * \param tt The type of track to create + * \param tc The track container to attach to */ -Track * Track::create( TrackTypes _tt, TrackContainer * _tc ) +Track * Track::create( TrackTypes tt, TrackContainer * tc ) { Track * t = NULL; - switch( _tt ) + switch( tt ) { - case InstrumentTrack: t = new ::InstrumentTrack( _tc ); break; - case BBTrack: t = new ::BBTrack( _tc ); break; - case SampleTrack: t = new ::SampleTrack( _tc ); break; + case InstrumentTrack: t = new ::InstrumentTrack( tc ); break; + case BBTrack: t = new ::BBTrack( tc ); break; + case SampleTrack: t = new ::SampleTrack( tc ); break; // case EVENT_TRACK: // case VIDEO_TRACK: - case AutomationTrack: t = new ::AutomationTrack( _tc ); break; + case AutomationTrack: t = new ::AutomationTrack( tc ); break; case HiddenAutomationTrack: - t = new ::AutomationTrack( _tc, true ); break; + t = new ::AutomationTrack( tc, true ); break; default: break; } - _tc->updateAfterTrackAdd(); + tc->updateAfterTrackAdd(); return t; } @@ -1927,17 +1947,17 @@ Track * Track::create( TrackTypes _tt, TrackContainer * _tc ) /*! \brief Create a track inside TrackContainer from track type in a QDomElement and restore state from XML * - * \param _this The QDomElement containing the type of track to create - * \param _tc The track container to attach to + * \param element The QDomElement containing the type of track to create + * \param tc The track container to attach to */ -Track * Track::create( const QDomElement & _this, TrackContainer * _tc ) +Track * Track::create( const QDomElement & element, TrackContainer * tc ) { Track * t = create( - static_cast( _this.attribute( "type" ).toInt() ), - _tc ); + static_cast( element.attribute( "type" ).toInt() ), + tc ); if( t != NULL ) { - t->restoreState( _this ); + t->restoreState( element ); } return t; } @@ -1967,31 +1987,31 @@ void Track::clone() * specific settings. Then we iterate through the trackContentObjects * and save all their states in turn. * - * \param _doc The QDomDocument to use to save - * \param _this The The QDomElement to save into + * \param doc The QDomDocument to use to save + * \param element The The QDomElement to save into * \todo Does this accurately describe the parameters? I think not!? * \todo Save the track height */ -void Track::saveSettings( QDomDocument & _doc, QDomElement & _this ) +void Track::saveSettings( QDomDocument & doc, QDomElement & element ) { if( !m_simpleSerializingMode ) { - _this.setTagName( "track" ); + element.setTagName( "track" ); } - _this.setAttribute( "type", type() ); - _this.setAttribute( "name", name() ); - _this.setAttribute( "muted", isMuted() ); - _this.setAttribute( "solo", isSolo() ); + element.setAttribute( "type", type() ); + element.setAttribute( "name", name() ); + element.setAttribute( "muted", isMuted() ); + element.setAttribute( "solo", isSolo() ); if( m_height >= MINIMAL_TRACK_HEIGHT ) { - _this.setAttribute( "height", m_height ); + element.setAttribute( "height", m_height ); } - QDomElement ts_de = _doc.createElement( nodeName() ); + QDomElement tsDe = doc.createElement( nodeName() ); // let actual track (InstrumentTrack, bbTrack, sampleTrack etc.) save // its settings - _this.appendChild( ts_de ); - saveTrackSpecificSettings( _doc, ts_de ); + element.appendChild( tsDe ); + saveTrackSpecificSettings( doc, tsDe ); if( m_simpleSerializingMode ) { @@ -2003,7 +2023,7 @@ void Track::saveSettings( QDomDocument & _doc, QDomElement & _this ) for( tcoVector::const_iterator it = m_trackContentObjects.begin(); it != m_trackContentObjects.end(); ++it ) { - ( *it )->saveState( _doc, _this ); + ( *it )->saveState( doc, element ); } } @@ -2019,26 +2039,26 @@ void Track::saveSettings( QDomDocument & _doc, QDomElement & _this ) * track-specific settings and trackContentObjects states from it * one at a time. * - * \param _this the QDomElement to load track settings from + * \param element the QDomElement to load track settings from * \todo Load the track height. */ -void Track::loadSettings( const QDomElement & _this ) +void Track::loadSettings( const QDomElement & element ) { - if( _this.attribute( "type" ).toInt() != type() ) + if( element.attribute( "type" ).toInt() != type() ) { qWarning( "Current track-type does not match track-type of " "settings-node!\n" ); } - setName( _this.hasAttribute( "name" ) ? _this.attribute( "name" ) : - _this.firstChild().toElement().attribute( "name" ) ); + setName( element.hasAttribute( "name" ) ? element.attribute( "name" ) : + element.firstChild().toElement().attribute( "name" ) ); - setMuted( _this.attribute( "muted" ).toInt() ); - setSolo( _this.attribute( "solo" ).toInt() ); + setMuted( element.attribute( "muted" ).toInt() ); + setSolo( element.attribute( "solo" ).toInt() ); if( m_simpleSerializingMode ) { - QDomNode node = _this.firstChild(); + QDomNode node = element.firstChild(); while( !node.isNull() ) { if( node.isElement() && node.nodeName() == nodeName() ) @@ -2058,7 +2078,7 @@ void Track::loadSettings( const QDomElement & _this ) // m_trackContentObjects.erase( m_trackContentObjects.begin() ); } - QDomNode node = _this.firstChild(); + QDomNode node = element.firstChild(); while( !node.isNull() ) { if( node.isElement() ) @@ -2080,10 +2100,10 @@ void Track::loadSettings( const QDomElement & _this ) node = node.nextSibling(); } - if( _this.attribute( "height" ).toInt() >= MINIMAL_TRACK_HEIGHT && - _this.attribute( "height" ).toInt() <= DEFAULT_TRACK_HEIGHT ) // workaround for #3585927, tobydox/2012-11-11 + if( element.attribute( "height" ).toInt() >= MINIMAL_TRACK_HEIGHT && + element.attribute( "height" ).toInt() <= DEFAULT_TRACK_HEIGHT ) // workaround for #3585927, tobydox/2012-11-11 { - m_height = _this.attribute( "height" ).toInt(); + m_height = element.attribute( "height" ).toInt(); } } @@ -2092,15 +2112,15 @@ void Track::loadSettings( const QDomElement & _this ) /*! \brief Add another TrackContentObject into this track * - * \param _tco The TrackContentObject to attach to this track. + * \param tco The TrackContentObject to attach to this track. */ -TrackContentObject * Track::addTCO( TrackContentObject * _tco ) +TrackContentObject * Track::addTCO( TrackContentObject * tco ) { - m_trackContentObjects.push_back( _tco ); + m_trackContentObjects.push_back( tco ); - emit trackContentObjectAdded( _tco ); + emit trackContentObjectAdded( tco ); - return _tco; // just for convenience + return tco; // just for convenience } @@ -2108,13 +2128,13 @@ TrackContentObject * Track::addTCO( TrackContentObject * _tco ) /*! \brief Remove a given TrackContentObject from this track * - * \param _tco The TrackContentObject to remove from this track. + * \param tco The TrackContentObject to remove from this track. */ -void Track::removeTCO( TrackContentObject * _tco ) +void Track::removeTCO( TrackContentObject * tco ) { tcoVector::iterator it = qFind( m_trackContentObjects.begin(), m_trackContentObjects.end(), - _tco ); + tco ); if( it != m_trackContentObjects.end() ) { m_trackContentObjects.erase( it ); @@ -2155,21 +2175,21 @@ int Track::numOfTCOs() * numbered object from the array. Otherwise we warn the user that * we've somehow requested a TCO that is too large, and create a new * TCO for them. - * \param _tco_number The number of the TrackContentObject to fetch. + * \param tcoNum The number of the TrackContentObject to fetch. * \return the given TrackContentObject or a new one if out of range. * \todo reject TCO numbers less than zero. * \todo if we create a TCO here, should we somehow attach it to the * track? */ -TrackContentObject * Track::getTCO( int _tco_num ) +TrackContentObject * Track::getTCO( int tcoNum ) { - if( _tco_num < m_trackContentObjects.size() ) + if( tcoNum < m_trackContentObjects.size() ) { - return m_trackContentObjects[_tco_num]; + return m_trackContentObjects[tcoNum]; } printf( "called Track::getTCO( %d ), " - "but TCO %d doesn't exist\n", _tco_num, _tco_num ); - return createTCO( _tco_num * MidiTime::ticksPerTact() ); + "but TCO %d doesn't exist\n", tcoNum, tcoNum ); + return createTCO( tcoNum * MidiTime::ticksPerTact() ); } @@ -2178,15 +2198,15 @@ TrackContentObject * Track::getTCO( int _tco_num ) /*! \brief Determine the given TrackContentObject's number in our array. * - * \param _tco The TrackContentObject to search for. + * \param tco The TrackContentObject to search for. * \return its number in our array. */ -int Track::getTCONum( const TrackContentObject * _tco ) +int Track::getTCONum( const TrackContentObject * tco ) { // for( int i = 0; i < getTrackContentWidget()->numOfTCOs(); ++i ) tcoVector::iterator it = qFind( m_trackContentObjects.begin(), m_trackContentObjects.end(), - _tco ); + tco ); if( it != m_trackContentObjects.end() ) { /* if( getTCO( i ) == _tco ) @@ -2211,31 +2231,31 @@ int Track::getTCONum( const TrackContentObject * _tco ) * * We return the TCOs we find in order by time, earliest TCOs first. * - * \param _tco_c The list to contain the found trackContentObjects. - * \param _start The MIDI start time of the range. - * \param _end The MIDI endi time of the range. + * \param tcoV The list to contain the found trackContentObjects. + * \param start The MIDI start time of the range. + * \param end The MIDI endi time of the range. */ -void Track::getTCOsInRange( tcoVector & _tco_v, const MidiTime & _start, - const MidiTime & _end ) +void Track::getTCOsInRange( tcoVector & tcoV, const MidiTime & start, + const MidiTime & end ) { - for( tcoVector::iterator it_o = m_trackContentObjects.begin(); - it_o != m_trackContentObjects.end(); ++it_o ) + for( tcoVector::iterator itO = m_trackContentObjects.begin(); + itO != m_trackContentObjects.end(); ++itO ) { - TrackContentObject * tco = ( *it_o ); + TrackContentObject * tco = ( *itO ); int s = tco->startPosition(); int e = tco->endPosition(); - if( ( s <= _end ) && ( e >= _start ) ) + if( ( s <= end ) && ( e >= start ) ) { // ok, TCO is posated within given range // now let's search according position for TCO in list // -> list is ordered by TCO's position afterwards bool inserted = false; - for( tcoVector::iterator it = _tco_v.begin(); - it != _tco_v.end(); ++it ) + for( tcoVector::iterator it = tcoV.begin(); + it != tcoV.end(); ++it ) { if( ( *it )->startPosition() >= s ) { - _tco_v.insert( it, tco ); + tcoV.insert( it, tco ); inserted = true; break; } @@ -2243,7 +2263,7 @@ void Track::getTCOsInRange( tcoVector & _tco_v, const MidiTime & _start, if( inserted == false ) { // no TCOs found posated behind current TCO... - _tco_v.push_back( tco ); + tcoV.push_back( tco ); } } } @@ -2257,19 +2277,19 @@ void Track::getTCOsInRange( tcoVector & _tco_v, const MidiTime & _start, * First, we arrange to swap the positions of the two TCOs in the * trackContentObjects list. Then we swap their start times as well. * - * \param _tco_num1 The first TrackContentObject to swap. - * \param _tco_num2 The second TrackContentObject to swap. + * \param tcoNum1 The first TrackContentObject to swap. + * \param tcoNum2 The second TrackContentObject to swap. */ -void Track::swapPositionOfTCOs( int _tco_num1, int _tco_num2 ) +void Track::swapPositionOfTCOs( int tcoNum1, int tcoNum2 ) { - qSwap( m_trackContentObjects[_tco_num1], - m_trackContentObjects[_tco_num2] ); + qSwap( m_trackContentObjects[tcoNum1], + m_trackContentObjects[tcoNum2] ); - const MidiTime pos = m_trackContentObjects[_tco_num1]->startPosition(); + const MidiTime pos = m_trackContentObjects[tcoNum1]->startPosition(); - m_trackContentObjects[_tco_num1]->movePosition( - m_trackContentObjects[_tco_num2]->startPosition() ); - m_trackContentObjects[_tco_num2]->movePosition( pos ); + m_trackContentObjects[tcoNum1]->movePosition( + m_trackContentObjects[tcoNum2]->startPosition() ); + m_trackContentObjects[tcoNum2]->movePosition( pos ); } @@ -2277,19 +2297,19 @@ void Track::swapPositionOfTCOs( int _tco_num1, int _tco_num2 ) /*! \brief Move all the trackContentObjects after a certain time later by one bar. * - * \param _pos The time at which we want to insert the bar. + * \param pos The time at which we want to insert the bar. * \todo if we stepped through this list last to first, and the list was * in ascending order by TCO time, once we hit a TCO that was earlier * than the insert time, we could fall out of the loop early. */ -void Track::insertTact( const MidiTime & _pos ) +void Track::insertTact( const MidiTime & pos ) { - // we'll increase the position of every TCO, positioned behind _pos, by + // we'll increase the position of every TCO, positioned behind pos, by // one tact for( tcoVector::iterator it = m_trackContentObjects.begin(); it != m_trackContentObjects.end(); ++it ) { - if( ( *it )->startPosition() >= _pos ) + if( ( *it )->startPosition() >= pos ) { ( *it )->movePosition( (*it)->startPosition() + MidiTime::ticksPerTact() ); @@ -2302,16 +2322,16 @@ void Track::insertTact( const MidiTime & _pos ) /*! \brief Move all the trackContentObjects after a certain time earlier by one bar. * - * \param _pos The time at which we want to remove the bar. + * \param pos The time at which we want to remove the bar. */ -void Track::removeTact( const MidiTime & _pos ) +void Track::removeTact( const MidiTime & pos ) { - // we'll decrease the position of every TCO, positioned behind _pos, by + // we'll decrease the position of every TCO, positioned behind pos, by // one tact for( tcoVector::iterator it = m_trackContentObjects.begin(); it != m_trackContentObjects.end(); ++it ) { - if( ( *it )->startPosition() >= _pos ) + if( ( *it )->startPosition() >= pos ) { ( *it )->movePosition( qMax( ( *it )->startPosition() - MidiTime::ticksPerTact(), 0 ) ); @@ -2357,7 +2377,7 @@ void Track::toggleSolo() { const TrackContainer::TrackList & tl = m_trackContainer->tracks(); - bool solo_before = false; + bool soloBefore = false; for( TrackContainer::TrackList::const_iterator it = tl.begin(); it != tl.end(); ++it ) { @@ -2365,7 +2385,7 @@ void Track::toggleSolo() { if( ( *it )->m_soloModel.value() ) { - solo_before = true; + soloBefore = true; break; } } @@ -2378,7 +2398,7 @@ void Track::toggleSolo() if( solo ) { // save mute-state in case no track was solo before - if( !solo_before ) + if( !soloBefore ) { ( *it )->m_mutedBeforeSolo = ( *it )->isMuted(); } @@ -2388,7 +2408,7 @@ void Track::toggleSolo() ( *it )->m_soloModel.setValue( false ); } } - else if( !solo_before ) + else if( !soloBefore ) { ( *it )->setMuted( ( *it )->m_mutedBeforeSolo ); } @@ -2409,15 +2429,15 @@ void Track::toggleSolo() * The track View is handles the actual display of the track, including * displaying its various widgets and the track segments. * - * \param _track The track to display. - * \param _tcv The track Container View for us to be displayed in. + * \param track The track to display. + * \param tcv The track Container View for us to be displayed in. * \todo Is my description of these properties correct? */ -TrackView::TrackView( Track * _track, TrackContainerView * _tcv ) : - QWidget( _tcv->contentWidget() ), /*!< The Track Container View's content widget. */ +TrackView::TrackView( Track * track, TrackContainerView * tcv ) : + QWidget( tcv->contentWidget() ), /*!< The Track Container View's content widget. */ ModelView( NULL, this ), /*!< The model view of this track */ - m_track( _track ), /*!< The track we're displaying */ - m_trackContainerView( _tcv ), /*!< The track Container View we're displayed in */ + m_track( track ), /*!< The track we're displaying */ + m_trackContainerView( tcv ), /*!< The track Container View we're displayed in */ m_trackOperationsWidget( this ), /*!< Our trackOperationsWidget */ m_trackSettingsWidget( this ), /*!< Our trackSettingsWidget */ m_trackContentWidget( this ), /*!< Our trackContentWidget */ @@ -2481,9 +2501,9 @@ TrackView::~TrackView() /*! \brief Resize this track View. * - * \param _re the Resize Event to handle. + * \param re the Resize Event to handle. */ -void TrackView::resizeEvent( QResizeEvent * _re ) +void TrackView::resizeEvent( QResizeEvent * re ) { if( ConfigManager::inst()->value( "ui", "compacttrackbuttons" ).toInt() ) @@ -2549,11 +2569,11 @@ void TrackView::modelChanged() /*! \brief Start a drag event on this track View. * - * \param _dee the DragEnterEvent to start. + * \param dee the DragEnterEvent to start. */ -void TrackView::dragEnterEvent( QDragEnterEvent * _dee ) +void TrackView::dragEnterEvent( QDragEnterEvent * dee ) { - StringPairDrag::processDragEnterEvent( _dee, "track_" + + StringPairDrag::processDragEnterEvent( dee, "track_" + QString::number( m_track->type() ) ); } @@ -2566,12 +2586,12 @@ void TrackView::dragEnterEvent( QDragEnterEvent * _dee ) * If so, we decode the data from the drop event by just feeding it * back into the engine as a state. * - * \param _de the DropEvent to handle. + * \param de the DropEvent to handle. */ -void TrackView::dropEvent( QDropEvent * _de ) +void TrackView::dropEvent( QDropEvent * de ) { - QString type = StringPairDrag::decodeKey( _de ); - QString value = StringPairDrag::decodeValue( _de ); + QString type = StringPairDrag::decodeKey( de ); + QString value = StringPairDrag::decodeValue( de ); if( type == ( "track_" + QString::number( m_track->type() ) ) ) { // value contains our XML-data so simply create a @@ -2580,7 +2600,7 @@ void TrackView::dropEvent( QDropEvent * _de ) m_track->lock(); m_track->restoreState( dataFile.content().firstChild().toElement() ); m_track->unlock(); - _de->accept(); + de->accept(); } } @@ -2598,14 +2618,14 @@ void TrackView::dropEvent( QDropEvent * _de ) * * Otherwise we let the widget handle the mouse event as normal. * - * \param _me the MouseEvent to handle. + * \param me the MouseEvent to handle. */ -void TrackView::mousePressEvent( QMouseEvent * _me ) +void TrackView::mousePressEvent( QMouseEvent * me ) { // If previously dragged too small, restore on shift-leftclick if( height() < DEFAULT_TRACK_HEIGHT && - _me->modifiers() & Qt::ShiftModifier && - _me->button() == Qt::LeftButton ) + me->modifiers() & Qt::ShiftModifier && + me->button() == Qt::LeftButton ) { setFixedHeight( DEFAULT_TRACK_HEIGHT ); m_track->setHeight( DEFAULT_TRACK_HEIGHT ); @@ -2614,14 +2634,14 @@ void TrackView::mousePressEvent( QMouseEvent * _me ) if( m_trackContainerView->allowRubberband() == true ) { - QWidget::mousePressEvent( _me ); + QWidget::mousePressEvent( me ); } - else if( _me->button() == Qt::LeftButton ) + else if( me->button() == Qt::LeftButton ) { - if( _me->modifiers() & Qt::ShiftModifier ) + if( me->modifiers() & Qt::ShiftModifier ) { m_action = ResizeTrack; - QCursor::setPos( mapToGlobal( QPoint( _me->x(), + QCursor::setPos( mapToGlobal( QPoint( me->x(), height() ) ) ); QCursor c( Qt::SizeVerCursor); QApplication::setOverrideCursor( c ); @@ -2637,11 +2657,11 @@ void TrackView::mousePressEvent( QMouseEvent * _me ) m_trackOperationsWidget.update(); } - _me->accept(); + me->accept(); } else { - QWidget::mousePressEvent( _me ); + QWidget::mousePressEvent( me ); } } @@ -2662,29 +2682,30 @@ void TrackView::mousePressEvent( QMouseEvent * _me ) * Likewise if we've started a resize process, handle this too, making * sure that we never go below the minimum track height. * - * \param _me the MouseEvent to handle. + * \param me the MouseEvent to handle. */ -void TrackView::mouseMoveEvent( QMouseEvent * _me ) +void TrackView::mouseMoveEvent( QMouseEvent * me ) { if( m_trackContainerView->allowRubberband() == true ) { - QWidget::mouseMoveEvent( _me ); + QWidget::mouseMoveEvent( me ); } else if( m_action == MoveTrack ) { // look which track-widget the mouse-cursor is over - const int y_pos = m_trackContainerView->contentWidget()->mapFromGlobal( _me->globalPos() ).y(); - const TrackView * track_at_y = m_trackContainerView->trackViewAt( y_pos ); + const int yPos = + m_trackContainerView->contentWidget()->mapFromGlobal( me->globalPos() ).y(); + const TrackView * trackAtY = m_trackContainerView->trackViewAt( yPos ); // debug code -// qDebug( "y position %d", y_pos ); +// qDebug( "y position %d", yPos ); // a track-widget not equal to ourself? - if( track_at_y != NULL && track_at_y != this ) + if( trackAtY != NULL && trackAtY != this ) { // then move us up/down there! - if( _me->y() < 0 ) + if( me->y() < 0 ) { m_trackContainerView->moveTrackViewUp( this ); } @@ -2696,7 +2717,7 @@ void TrackView::mouseMoveEvent( QMouseEvent * _me ) } else if( m_action == ResizeTrack ) { - setFixedHeight( qMax( _me->y(), MINIMAL_TRACK_HEIGHT ) ); + setFixedHeight( qMax( me->y(), MINIMAL_TRACK_HEIGHT ) ); m_trackContainerView->realignTracks(); m_track->setHeight( height() ); } @@ -2711,9 +2732,9 @@ void TrackView::mouseMoveEvent( QMouseEvent * _me ) /*! \brief Handle a mouse release event on this track View. * - * \param _me the MouseEvent to handle. + * \param me the MouseEvent to handle. */ -void TrackView::mouseReleaseEvent( QMouseEvent * _me ) +void TrackView::mouseReleaseEvent( QMouseEvent * me ) { m_action = NoAction; while( QApplication::overrideCursor() != NULL ) @@ -2722,7 +2743,7 @@ void TrackView::mouseReleaseEvent( QMouseEvent * _me ) } m_trackOperationsWidget.update(); - QWidget::mouseReleaseEvent( _me ); + QWidget::mouseReleaseEvent( me ); } @@ -2730,9 +2751,9 @@ void TrackView::mouseReleaseEvent( QMouseEvent * _me ) /*! \brief Repaint this track View. * - * \param _pe the PaintEvent to start. + * \param pe the PaintEvent to start. */ -void TrackView::paintEvent( QPaintEvent * _pe ) +void TrackView::paintEvent( QPaintEvent * pe ) { QStyleOption opt; opt.initFrom( this ); @@ -2745,22 +2766,18 @@ void TrackView::paintEvent( QPaintEvent * _pe ) /*! \brief Create a TrackContentObject View in this track View. * - * \param _tco the TrackContentObject to create the view for. + * \param tco the TrackContentObject to create the view for. * \todo is this a good description for what this method does? */ -void TrackView::createTCOView( TrackContentObject * _tco ) +void TrackView::createTCOView( TrackContentObject * tco ) { - TrackContentObjectView * tv = _tco->createView( this ); - if( _tco->getSelectViewOnCreate() == true ) + TrackContentObjectView * tv = tco->createView( this ); + if( tco->getSelectViewOnCreate() == true ) { tv->setSelected( true ); } - _tco->selectViewOnCreate( false ); + tco->selectViewOnCreate( false ); } - - - - From c398769020ef83bbe62acc1250daebd05baa6c6b Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Mon, 5 Jan 2015 22:11:23 -0200 Subject: [PATCH 019/133] Update coding conventions --- include/Track.h | 178 +++++++++++++++++++++++++----------------------- 1 file changed, 93 insertions(+), 85 deletions(-) diff --git a/include/Track.h b/include/Track.h index b766b6056..4d4b221fc 100644 --- a/include/Track.h +++ b/include/Track.h @@ -81,7 +81,7 @@ class TrackContentObject : public Model, public JournallingObject mapPropertyFromModel(bool,isMuted,setMuted,m_mutedModel); mapPropertyFromModel(bool,isSolo,setSolo,m_soloModel); public: - TrackContentObject( Track * _track ); + TrackContentObject( Track * track ); virtual ~TrackContentObject(); inline Track * getTrack() const @@ -94,9 +94,9 @@ public: return m_name; } - inline void setName( const QString & _name ) + inline void setName( const QString & name ) { - m_name = _name; + m_name = name; emit dataChanged(); } @@ -122,9 +122,9 @@ public: return m_length; } - inline void setAutoResize( const bool _r ) + inline void setAutoResize( const bool r ) { - m_autoResize = _r; + m_autoResize = r; } inline const bool getAutoResize() const @@ -132,10 +132,10 @@ public: return m_autoResize; } - virtual void movePosition( const MidiTime & _pos ); - virtual void changeLength( const MidiTime & _length ); + virtual void movePosition( const MidiTime & pos ); + virtual void changeLength( const MidiTime & length ); - virtual TrackContentObjectView * createView( TrackView * _tv ) = 0; + virtual TrackContentObjectView * createView( TrackView * tv ) = 0; inline void selectViewOnCreate( bool select ) { @@ -195,7 +195,7 @@ class TrackContentObjectView : public selectableObject, public ModelView Q_PROPERTY( QColor textColor READ textColor WRITE setTextColor ) public: - TrackContentObjectView( TrackContentObject * _tco, TrackView * _tv ); + TrackContentObjectView( TrackContentObject * tco, TrackView * tv ); virtual ~TrackContentObjectView(); bool fixedTCOs(); @@ -207,8 +207,8 @@ public: // qproperty access func QColor fgColor() const; QColor textColor() const; - void setFgColor( const QColor & _c ); - void setTextColor( const QColor & _c ); + void setFgColor( const QColor & c ); + void setTextColor( const QColor & c ); public slots: virtual bool close(); @@ -220,14 +220,18 @@ protected: { } - virtual void contextMenuEvent( QContextMenuEvent * _cme ); - virtual void dragEnterEvent( QDragEnterEvent * _dee ); - virtual void dropEvent( QDropEvent * _de ); - virtual void leaveEvent( QEvent * _e ); - virtual void mousePressEvent( QMouseEvent * _me ); - virtual void mouseMoveEvent( QMouseEvent * _me ); - virtual void mouseReleaseEvent( QMouseEvent * _me ); + virtual void contextMenuEvent( QContextMenuEvent * cme ); + virtual void dragEnterEvent( QDragEnterEvent * dee ); + virtual void dropEvent( QDropEvent * de ); + virtual void leaveEvent( QEvent * e ); + virtual void mousePressEvent( QMouseEvent * me ); + virtual void mouseMoveEvent( QMouseEvent * me ); + virtual void mouseReleaseEvent( QMouseEvent * me ); +<<<<<<< HEAD +======= + void setAutoResizeEnabled( bool e = false ); +>>>>>>> Update coding conventions float pixelsPerTact(); inline TrackView * getTrackView() @@ -276,7 +280,7 @@ private: m_initialMouseGlobalPos = mapToGlobal( pos ); } - bool mouseMovedDistance( QMouseEvent * _me, int distance ); + bool mouseMovedDistance( QMouseEvent * me, int distance ); } ; @@ -293,46 +297,46 @@ class TrackContentWidget : public QWidget, public JournallingObject Q_PROPERTY( QBrush lighterColor READ lighterColor WRITE setLighterColor ) public: - TrackContentWidget( TrackView * _parent ); + TrackContentWidget( TrackView * parent ); virtual ~TrackContentWidget(); /*! \brief Updates the background tile pixmap. */ void updateBackground(); - void addTCOView( TrackContentObjectView * _tcov ); - void removeTCOView( TrackContentObjectView * _tcov ); - void removeTCOView( int _tco_num ) + void addTCOView( TrackContentObjectView * tcov ); + void removeTCOView( TrackContentObjectView * tcov ); + void removeTCOView( int tcoNum ) { - if( _tco_num >= 0 && _tco_num < m_tcoViews.size() ) + if( tcoNum >= 0 && tcoNum < m_tcoViews.size() ) { - removeTCOView( m_tcoViews[_tco_num] ); + removeTCOView( m_tcoViews[tcoNum] ); } } bool canPasteSelection( MidiTime tcoPos, const QMimeData * mimeData ); - bool pasteSelection( MidiTime tcoPos, QDropEvent * _de ); + bool pasteSelection( MidiTime tcoPos, QDropEvent * de ); - MidiTime endPosition( const MidiTime & _pos_start ); + MidiTime endPosition( const MidiTime & posStart ); // qproperty access methods QBrush darkerColor() const; QBrush lighterColor() const; - void setDarkerColor( const QBrush & _c ); - void setLighterColor( const QBrush & _c ); + void setDarkerColor( const QBrush & c ); + void setLighterColor( const QBrush & c ); public slots: void update(); - void changePosition( const MidiTime & _new_pos = MidiTime( -1 ) ); + void changePosition( const MidiTime & newPos = MidiTime( -1 ) ); protected: - virtual void dragEnterEvent( QDragEnterEvent * _dee ); - virtual void dropEvent( QDropEvent * _de ); - virtual void mousePressEvent( QMouseEvent * _me ); - virtual void paintEvent( QPaintEvent * _pe ); - virtual void resizeEvent( QResizeEvent * _re ); + virtual void dragEnterEvent( QDragEnterEvent * dee ); + virtual void dropEvent( QDropEvent * de ); + virtual void mousePressEvent( QMouseEvent * me ); + virtual void paintEvent( QPaintEvent * pe ); + virtual void resizeEvent( QResizeEvent * re ); virtual QString nodeName() const { @@ -353,7 +357,7 @@ protected: private: Track * getTrack(); - MidiTime getPosition( int _mouse_x ); + MidiTime getPosition( int mouseX ); TrackView * m_trackView; @@ -375,13 +379,13 @@ class TrackOperationsWidget : public QWidget { Q_OBJECT public: - TrackOperationsWidget( TrackView * _parent ); + TrackOperationsWidget( TrackView * parent ); ~TrackOperationsWidget(); protected: - virtual void mousePressEvent( QMouseEvent * _me ); - virtual void paintEvent( QPaintEvent * _pe ); + virtual void mousePressEvent( QMouseEvent * me ); + virtual void paintEvent( QPaintEvent * pe ); private slots: @@ -407,7 +411,7 @@ private: friend class TrackView; signals: - void trackRemovalScheduled( TrackView * _t ); + void trackRemovalScheduled( TrackView * t ); } ; @@ -437,12 +441,12 @@ public: NumTrackTypes } ; - Track( TrackTypes _type, TrackContainer * _tc ); + Track( TrackTypes type, TrackContainer * tc ); virtual ~Track(); - static Track * create( TrackTypes _tt, TrackContainer * _tc ); - static Track * create( const QDomElement & _this, - TrackContainer * _tc ); + static Track * create( TrackTypes tt, TrackContainer * tc ); + static Track * create( const QDomElement & element, + TrackContainer * tc ); void clone(); @@ -452,20 +456,20 @@ public: return m_type; } - virtual bool play( const MidiTime & _start, const fpp_t _frames, - const f_cnt_t _frame_base, int _tco_num = -1 ) = 0; + virtual bool play( const MidiTime & start, const fpp_t frames, + const f_cnt_t frameBase, int tcoNum = -1 ) = 0; - virtual TrackView * createView( TrackContainerView * _view ) = 0; - virtual TrackContentObject * createTCO( const MidiTime & _pos ) = 0; + virtual TrackView * createView( TrackContainerView * view ) = 0; + virtual TrackContentObject * createTCO( const MidiTime & pos ) = 0; - virtual void saveTrackSpecificSettings( QDomDocument & _doc, - QDomElement & _parent ) = 0; - virtual void loadTrackSpecificSettings( const QDomElement & _this ) = 0; + virtual void saveTrackSpecificSettings( QDomDocument & doc, + QDomElement & parent ) = 0; + virtual void loadTrackSpecificSettings( const QDomElement & element ) = 0; - virtual void saveSettings( QDomDocument & _doc, QDomElement & _this ); - virtual void loadSettings( const QDomElement & _this ); + virtual void saveSettings( QDomDocument & doc, QDomElement & element ); + virtual void loadSettings( const QDomElement & element ); void setSimpleSerializing() { @@ -473,26 +477,26 @@ public: } // -- for usage by TrackContentObject only --------------- - TrackContentObject * addTCO( TrackContentObject * _tco ); - void removeTCO( TrackContentObject * _tco ); + TrackContentObject * addTCO( TrackContentObject * tco ); + void removeTCO( TrackContentObject * tco ); // ------------------------------------------------------- void deleteTCOs(); int numOfTCOs(); - TrackContentObject * getTCO( int _tco_num ); - int getTCONum(const TrackContentObject* _tco ); + TrackContentObject * getTCO( int tcoNum ); + int getTCONum(const TrackContentObject* tco ); const tcoVector & getTCOs() const { - return( m_trackContentObjects ); + return m_trackContentObjects; } - void getTCOsInRange( tcoVector & _tco_v, const MidiTime & _start, - const MidiTime & _end ); - void swapPositionOfTCOs( int _tco_num1, int _tco_num2 ); + void getTCOsInRange( tcoVector & tcoV, const MidiTime & start, + const MidiTime & end ); + void swapPositionOfTCOs( int tcoNum1, int tcoNum2 ); - void insertTact( const MidiTime & _pos ); - void removeTact( const MidiTime & _pos ); + void insertTact( const MidiTime & pos ); + void removeTact( const MidiTime & pos ); tact_t length() const; @@ -505,21 +509,25 @@ public: // name-stuff virtual const QString & name() const { - return( m_name ); + return m_name; } virtual QString displayName() const { - return( name() ); + return name(); } using Model::dataChanged; - inline int getHeight() { - return ( m_height >= MINIMAL_TRACK_HEIGHT ? m_height : DEFAULT_TRACK_HEIGHT ); + inline int getHeight() + { + return m_height >= MINIMAL_TRACK_HEIGHT + ? m_height + : DEFAULT_TRACK_HEIGHT; } - inline void setHeight( int _height ) { - m_height = _height; + inline void setHeight( int height ) + { + m_height = height; } void lock() @@ -536,9 +544,9 @@ public: } public slots: - virtual void setName( const QString & _new_name ) + virtual void setName( const QString & newName ) { - m_name = _new_name; + m_name = newName; emit nameChanged(); } @@ -585,12 +593,12 @@ public: inline const Track * getTrack() const { - return( m_track ); + return m_track; } inline Track * getTrack() { - return( m_track ); + return m_track; } inline TrackContainerView* trackContainerView() @@ -600,22 +608,22 @@ public: inline TrackOperationsWidget * getTrackOperationsWidget() { - return( &m_trackOperationsWidget ); + return &m_trackOperationsWidget; } inline trackSettingsWidget * getTrackSettingsWidget() { - return( &m_trackSettingsWidget ); + return &m_trackSettingsWidget; } inline TrackContentWidget * getTrackContentWidget() { - return( &m_trackContentWidget ); + return &m_trackContentWidget; } bool isMovingTrack() const { - return( m_action == MoveTrack ); + return m_action == MoveTrack; } virtual void update(); @@ -645,13 +653,13 @@ protected: } - virtual void dragEnterEvent( QDragEnterEvent * _dee ); - virtual void dropEvent( QDropEvent * _de ); - virtual void mousePressEvent( QMouseEvent * _me ); - virtual void mouseMoveEvent( QMouseEvent * _me ); - virtual void mouseReleaseEvent( QMouseEvent * _me ); - virtual void paintEvent( QPaintEvent * _pe ); - virtual void resizeEvent( QResizeEvent * _re ); + virtual void dragEnterEvent( QDragEnterEvent * dee ); + virtual void dropEvent( QDropEvent * de ); + virtual void mousePressEvent( QMouseEvent * me ); + virtual void mouseMoveEvent( QMouseEvent * me ); + virtual void mouseReleaseEvent( QMouseEvent * me ); + virtual void paintEvent( QPaintEvent * pe ); + virtual void resizeEvent( QResizeEvent * re ); private: @@ -676,7 +684,7 @@ private: private slots: - void createTCOView( TrackContentObject * _tco ); + void createTCOView( TrackContentObject * tco ); } ; From 21425e3477e2ed18445b44cc1aa933d9f0301906 Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Wed, 7 Jan 2015 21:11:42 -0200 Subject: [PATCH 020/133] Update Song.cpp --- src/core/Song.cpp | 231 +++++++++++++++++++++++++--------------------- 1 file changed, 127 insertions(+), 104 deletions(-) diff --git a/src/core/Song.cpp b/src/core/Song.cpp index 3dfa1fbd0..3bd0da7f7 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -144,7 +144,7 @@ void Song::masterVolumeChanged() void Song::setTempo() { Engine::mixer()->lockPlayHandleRemoval(); - const bpm_t tempo = (bpm_t) m_tempoModel.value(); + const bpm_t tempo = ( bpm_t ) m_tempoModel.value(); PlayHandleList & playHandles = Engine::mixer()->playHandles(); for( PlayHandleList::Iterator it = playHandles.begin(); it != playHandles.end(); ++it ) @@ -176,7 +176,8 @@ void Song::setTimeSignature() emit dataChanged(); m_oldTicksPerTact = ticksPerTact(); - m_vstSyncController.setTimeSignature( getTimeSigModel().getNumerator(), getTimeSigModel().getDenominator() ); + m_vstSyncController.setTimeSignature( + getTimeSigModel().getNumerator(), getTimeSigModel().getDenominator() ); } @@ -202,13 +203,13 @@ void Song::processNextBuffer() return; } - TrackList track_list; - int tco_num = -1; + TrackList trackList; + int tcoNum = -1; switch( m_playMode ) { case Mode_PlaySong: - track_list = tracks(); + trackList = tracks(); // at song-start we have to reset the LFOs if( m_playPos[Mode_PlaySong] == 0 ) { @@ -217,25 +218,25 @@ void Song::processNextBuffer() break; case Mode_PlayTrack: - track_list.push_back( m_trackToPlay ); + trackList.push_back( m_trackToPlay ); break; case Mode_PlayBB: if( Engine::getBBTrackContainer()->numOfBBs() > 0 ) { - tco_num = Engine::getBBTrackContainer()-> + tcoNum = Engine::getBBTrackContainer()-> currentBB(); - track_list.push_back( BBTrack::findBBTrack( - tco_num ) ); + trackList.push_back( BBTrack::findBBTrack( + tcoNum ) ); } break; case Mode_PlayPattern: if( m_patternToPlay != NULL ) { - tco_num = m_patternToPlay->getTrack()-> + tcoNum = m_patternToPlay->getTrack()-> getTCONum( m_patternToPlay ); - track_list.push_back( + trackList.push_back( m_patternToPlay->getTrack() ); } break; @@ -245,41 +246,44 @@ void Song::processNextBuffer() } - if( track_list.empty() == true ) + if( trackList.empty() == true ) { return; } // check for looping-mode and act if necessary TimeLineWidget * tl = m_playPos[m_playMode].m_timeLine; - bool check_loop = tl != NULL && m_exporting == false && + bool checkLoop = tl != NULL && m_exporting == false && tl->loopPointsEnabled(); - if( check_loop ) + + if( checkLoop ) { if( m_playPos[m_playMode] < tl->loopBegin() || m_playPos[m_playMode] >= tl->loopEnd() ) { - m_elapsedMilliSeconds = (tl->loopBegin().getTicks()*60*1000/48)/getTempo(); + m_elapsedMilliSeconds = + ( tl->loopBegin().getTicks() * 60 * 1000 / 48 ) / getTempo(); m_playPos[m_playMode].setTicks( tl->loopBegin().getTicks() ); } } - f_cnt_t total_frames_played = 0; - const float frames_per_tick = Engine::framesPerTick(); + f_cnt_t totalFramesPlayed = 0; + const float framesPerTick = Engine::framesPerTick(); - while( total_frames_played - < Engine::mixer()->framesPerPeriod() ) + while( totalFramesPlayed < Engine::mixer()->framesPerPeriod() ) { m_vstSyncController.update(); - f_cnt_t played_frames = Engine::mixer()->framesPerPeriod() - total_frames_played; + f_cnt_t playedFrames = Engine::mixer()->framesPerPeriod() - + totalFramesPlayed; - float current_frame = m_playPos[m_playMode].currentFrame(); + float currentFrame = m_playPos[m_playMode].currentFrame(); // did we play a tick? - if( current_frame >= frames_per_tick ) + if( currentFrame >= framesPerTick ) { - int ticks = m_playPos[m_playMode].getTicks() + (int)( current_frame / frames_per_tick ); + int ticks = m_playPos[m_playMode].getTicks() + + ( int )( currentFrame / framesPerTick ); m_vstSyncController.setAbsolutePosition( ticks ); @@ -289,14 +293,14 @@ void Song::processNextBuffer() // per default we just continue playing even if // there's no more stuff to play // (song-play-mode) - int max_tact = m_playPos[m_playMode].getTact() + int maxTact = m_playPos[m_playMode].getTact() + 2; // then decide whether to go over to next tact // or to loop back to first tact if( m_playMode == Mode_PlayBB ) { - max_tact = Engine::getBBTrackContainer() + maxTact = Engine::getBBTrackContainer() ->lengthOfCurrentBB(); } else if( m_playMode == Mode_PlayPattern && @@ -304,34 +308,39 @@ void Song::processNextBuffer() tl != NULL && tl->loopPointsEnabled() == false ) { - max_tact = m_patternToPlay->length() + maxTact = m_patternToPlay->length() .getTact(); } // end of played object reached? if( m_playPos[m_playMode].getTact() + 1 - >= max_tact ) + >= maxTact ) { // then start from beginning and keep // offset - ticks = ticks % ( max_tact * MidiTime::ticksPerTact() ); + ticks %= ( maxTact * MidiTime::ticksPerTact() ); // wrap milli second counter - m_elapsedMilliSeconds = ( ticks * 60 * 1000 / 48 ) / getTempo(); + m_elapsedMilliSeconds = + ( ticks * 60 * 1000 / 48 ) / getTempo(); m_vstSyncController.setAbsolutePosition( ticks ); } } m_playPos[m_playMode].setTicks( ticks ); - if( check_loop ) + if( checkLoop ) { - m_vstSyncController.startCycle( tl->loopBegin().getTicks(), tl->loopEnd().getTicks() ); + m_vstSyncController.startCycle( + tl->loopBegin().getTicks(), tl->loopEnd().getTicks() ); if( m_playPos[m_playMode] >= tl->loopEnd() ) { m_playPos[m_playMode].setTicks( tl->loopBegin().getTicks() ); - m_elapsedMilliSeconds = ((tl->loopBegin().getTicks())*60*1000/48)/getTempo(); + + m_elapsedMilliSeconds = + ( ( tl->loopBegin().getTicks() ) * 60 * 1000 / 48 ) / + getTempo(); } } else @@ -339,55 +348,57 @@ void Song::processNextBuffer() m_vstSyncController.stopCycle(); } - current_frame = fmodf( current_frame, frames_per_tick ); - m_playPos[m_playMode].setCurrentFrame( current_frame ); + currentFrame = fmodf( currentFrame, framesPerTick ); + m_playPos[m_playMode].setCurrentFrame( currentFrame ); } - f_cnt_t last_frames = (f_cnt_t)frames_per_tick - - (f_cnt_t) current_frame; + f_cnt_t lastFrames = ( f_cnt_t )framesPerTick - + ( f_cnt_t )currentFrame; // skip last frame fraction - if( last_frames == 0 ) + if( lastFrames == 0 ) { - ++total_frames_played; - m_playPos[m_playMode].setCurrentFrame( current_frame + ++totalFramesPlayed; + m_playPos[m_playMode].setCurrentFrame( currentFrame + 1.0f ); continue; } // do we have some samples left in this tick but these are // less then samples we have to play? - if( last_frames < played_frames ) + if( lastFrames < playedFrames ) { // then set played_samples to remaining samples, the // rest will be played in next loop - played_frames = last_frames; + playedFrames = lastFrames; } - if( (f_cnt_t) current_frame == 0 ) + if( ( f_cnt_t ) currentFrame == 0 ) { if( m_playMode == Mode_PlaySong ) { m_globalAutomationTrack->play( m_playPos[m_playMode], - played_frames, - total_frames_played, tco_num ); + playedFrames, + totalFramesPlayed, tcoNum ); } // loop through all tracks and play them - for( int i = 0; i < track_list.size(); ++i ) + for( int i = 0; i < trackList.size(); ++i ) { - track_list[i]->play( m_playPos[m_playMode], - played_frames, - total_frames_played, tco_num ); + trackList[i]->play( m_playPos[m_playMode], + playedFrames, + totalFramesPlayed, tcoNum ); } } // update frame-counters - total_frames_played += played_frames; - m_playPos[m_playMode].setCurrentFrame( played_frames + - current_frame ); - m_elapsedMilliSeconds += (((played_frames/frames_per_tick)*60*1000/48)/getTempo()); + totalFramesPlayed += playedFrames; + m_playPos[m_playMode].setCurrentFrame( playedFrames + + currentFrame ); + m_elapsedMilliSeconds += + ( ( playedFrames / framesPerTick ) * 60 * 1000 / 48 ) + / getTempo(); m_elapsedTacts = m_playPos[Mode_PlaySong].getTact(); - m_elapsedTicks = (m_playPos[Mode_PlaySong].getTicks()%ticksPerTact())/48; + m_elapsedTicks = ( m_playPos[Mode_PlaySong].getTicks() % ticksPerTact() ) / 48; } } @@ -396,17 +407,21 @@ bool Song::isExportDone() const if ( m_renderBetweenMarkers ) { return m_exporting == true && - m_playPos[Mode_PlaySong].getTicks() >= m_playPos[Mode_PlaySong].m_timeLine->loopEnd().getTicks(); + m_playPos[Mode_PlaySong].getTicks() >= + m_playPos[Mode_PlaySong].m_timeLine->loopEnd().getTicks(); } + if( m_exportLoop) { return m_exporting == true && - m_playPos[Mode_PlaySong].getTicks() >= length() * ticksPerTact(); + m_playPos[Mode_PlaySong].getTicks() >= + length() * ticksPerTact(); } else { return m_exporting == true && - m_playPos[Mode_PlaySong].getTicks() >= ( length() + 1 ) * ticksPerTact(); + m_playPos[Mode_PlaySong].getTicks() >= + ( length() + 1 ) * ticksPerTact(); } } @@ -454,13 +469,13 @@ void Song::playAndRecord() -void Song::playTrack( Track * _trackToPlay ) +void Song::playTrack( Track * trackToPlay ) { if( isStopped() == false ) { stop(); } - m_trackToPlay = _trackToPlay; + m_trackToPlay = trackToPlay; m_playMode = Mode_PlayTrack; m_playing = true; @@ -497,7 +512,7 @@ void Song::playBB() -void Song::playPattern( const Pattern* patternToPlay, bool _loop ) +void Song::playPattern( const Pattern* patternToPlay, bool loop ) { if( isStopped() == false ) { @@ -505,7 +520,7 @@ void Song::playPattern( const Pattern* patternToPlay, bool _loop ) } m_patternToPlay = patternToPlay; - m_loopPattern = _loop; + m_loopPattern = loop; if( m_patternToPlay != NULL ) { @@ -543,12 +558,14 @@ void Song::updateLength() -void Song::setPlayPos( tick_t _ticks, PlayModes _play_mode ) +void Song::setPlayPos( tick_t ticks, PlayModes playMode ) { - m_elapsedTicks += m_playPos[_play_mode].getTicks() - _ticks; - m_elapsedMilliSeconds += (((( _ticks - m_playPos[_play_mode].getTicks()))*60*1000/48)/getTempo()); - m_playPos[_play_mode].setTicks( _ticks ); - m_playPos[_play_mode].setCurrentFrame( 0.0f ); + m_elapsedTicks += m_playPos[playMode].getTicks() - ticks; + m_elapsedMilliSeconds += + ( ( ( ( ticks - m_playPos[playMode].getTicks() ) ) * 60 * 1000 / 48) / + getTempo() ); + m_playPos[playMode].setTicks( ticks ); + m_playPos[playMode].setCurrentFrame( 0.0f ); // send a signal if playposition changes during playback if( isPlaying() ) @@ -608,7 +625,9 @@ void Song::stop() if( tl->savedPos() >= 0 ) { m_playPos[m_playMode].setTicks( tl->savedPos().getTicks() ); - m_elapsedMilliSeconds = (((tl->savedPos().getTicks())*60*1000/48)/getTempo()); + m_elapsedMilliSeconds = + ( ( ( tl->savedPos().getTicks() ) * 60 * 1000 / 48 ) / + getTempo() ); tl->savePos( -1 ); } break; @@ -713,7 +732,7 @@ void Song::addBBTrack() void Song::addSampleTrack() { - (void) Track::create( Track::SampleTrack, this ); + ( void )Track::create( Track::SampleTrack, this ); } @@ -721,7 +740,7 @@ void Song::addSampleTrack() void Song::addAutomationTrack() { - (void) Track::create( Track::AutomationTrack, this ); + ( void )Track::create( Track::AutomationTrack, this ); } @@ -729,7 +748,7 @@ void Song::addAutomationTrack() bpm_t Song::getTempo() { - return (bpm_t) m_tempoModel.value(); + return ( bpm_t )m_tempoModel.value(); } @@ -824,24 +843,23 @@ void Song::clearProject() - // create new file void Song::createNewProject() { - QString default_template = ConfigManager::inst()->userProjectsDir() + QString defaultTemplate = ConfigManager::inst()->userProjectsDir() + "templates/default.mpt"; - if( QFile::exists( default_template ) ) + if( QFile::exists( defaultTemplate ) ) { - createNewProjectFromTemplate( default_template ); + createNewProjectFromTemplate( defaultTemplate ); return; } - default_template = ConfigManager::inst()->factoryProjectsDir() + defaultTemplate = ConfigManager::inst()->factoryProjectsDir() + "templates/default.mpt"; - if( QFile::exists( default_template ) ) + if( QFile::exists( defaultTemplate ) ) { - createNewProjectFromTemplate( default_template ); + createNewProjectFromTemplate( defaultTemplate ); return; } @@ -891,9 +909,9 @@ void Song::createNewProject() -void Song::createNewProjectFromTemplate( const QString & _template ) +void Song::createNewProjectFromTemplate( const QString & templ ) { - loadProject( _template ); + loadProject( templ ); // clear file-name so that user doesn't overwrite template when // saving... m_fileName = m_oldFileName = ""; @@ -909,7 +927,7 @@ void Song::createNewProjectFromTemplate( const QString & _template ) // load given song -void Song::loadProject( const QString & _file_name ) +void Song::loadProject( const QString & fileName ) { QDomNode node; @@ -917,8 +935,8 @@ void Song::loadProject( const QString & _file_name ) Engine::projectJournal()->setJournalling( false ); - m_fileName = _file_name; - m_oldFileName = _file_name; + m_fileName = fileName; + m_oldFileName = fileName; DataFile dataFile( m_fileName ); // if file could not be opened, head-node is null and we create @@ -1023,7 +1041,7 @@ void Song::loadProject( const QString & _file_name ) Engine::mixer()->unlock(); - ConfigManager::inst()->addRecentlyOpenedProject( _file_name ); + ConfigManager::inst()->addRecentlyOpenedProject( fileName ); Engine::projectJournal()->setJournalling( true ); @@ -1053,7 +1071,7 @@ void Song::loadProject( const QString & _file_name ) // only save current song as _filename and do nothing else -bool Song::saveProjectFile( const QString & _filename ) +bool Song::saveProjectFile( const QString & filename ) { DataFile::LocaleHelper localeHelper( DataFile::LocaleHelper::ModeSave ); @@ -1079,7 +1097,7 @@ bool Song::saveProjectFile( const QString & _filename ) saveControllerStates( dataFile, dataFile.content() ); - return dataFile.writeFile( _filename ); + return dataFile.writeFile( filename ); } @@ -1157,23 +1175,23 @@ void Song::importProject() -void Song::saveControllerStates( QDomDocument & _doc, QDomElement & _this ) +void Song::saveControllerStates( QDomDocument & doc, QDomElement & element ) { // save settings of controllers - QDomElement controllersNode =_doc.createElement( "controllers" ); - _this.appendChild( controllersNode ); + QDomElement controllersNode = doc.createElement( "controllers" ); + element.appendChild( controllersNode ); for( int i = 0; i < m_controllers.size(); ++i ) { - m_controllers[i]->saveState( _doc, controllersNode ); + m_controllers[i]->saveState( doc, controllersNode ); } } -void Song::restoreControllerStates( const QDomElement & _this ) +void Song::restoreControllerStates( const QDomElement & element ) { - QDomNode node = _this.firstChild(); + QDomNode node = element.firstChild(); while( !node.isNull() ) { Controller * c = Controller::create( node.toElement(), this ); @@ -1194,10 +1212,10 @@ void Song::restoreControllerStates( const QDomElement & _this ) void Song::exportProjectTracks() { - exportProject(true); + exportProject( true ); } -void Song::exportProject(bool multiExport) +void Song::exportProject( bool multiExport ) { if( isEmpty() ) { @@ -1210,7 +1228,7 @@ void Song::exportProject(bool multiExport) } FileDialog efd( gui->mainWindow() ); - if (multiExport) + if ( multiExport ) { efd.setFileMode( FileDialog::Directory); efd.setWindowTitle( tr( "Select directory for writing exported tracks..." ) ); @@ -1230,18 +1248,18 @@ void Song::exportProject(bool multiExport) ++idx; } efd.setNameFilters( types ); - QString base_filename; + QString baseFilename; if( !m_fileName.isEmpty() ) { efd.setDirectory( QFileInfo( m_fileName ).absolutePath() ); - base_filename = QFileInfo( m_fileName ).completeBaseName(); + baseFilename = QFileInfo( m_fileName ).completeBaseName(); } else { efd.setDirectory( ConfigManager::inst()->userProjectsDir() ); - base_filename = tr( "untitled" ); + baseFilename = tr( "untitled" ); } - efd.selectFile( base_filename + __fileEncodeDevices[0].m_extension ); + efd.selectFile( baseFilename + __fileEncodeDevices[0].m_extension ); efd.setWindowTitle( tr( "Select file for project-export..." ) ); } @@ -1268,8 +1286,8 @@ void Song::exportProject(bool multiExport) } } - const QString export_file_name = efd.selectedFiles()[0] + suffix; - ExportProjectDialog epd( export_file_name, gui->mainWindow(), multiExport ); + const QString exportFileName = efd.selectedFiles()[0] + suffix; + ExportProjectDialog epd( exportFileName, gui->mainWindow(), multiExport ); epd.exec(); } } @@ -1301,11 +1319,11 @@ void Song::setModified() -void Song::addController( Controller * _c ) +void Song::addController( Controller * c ) { - if( _c != NULL && !m_controllers.contains( _c ) ) + if( c != NULL && m_controllers.contains( c ) == false ) { - m_controllers.append( _c ); + m_controllers.append( c ); emit dataChanged(); } } @@ -1313,9 +1331,9 @@ void Song::addController( Controller * _c ) -void Song::removeController( Controller * _controller ) +void Song::removeController( Controller * controller ) { - int index = m_controllers.indexOf( _controller ); + int index = m_controllers.indexOf( controller ); if( index != -1 ) { m_controllers.remove( index ); @@ -1330,6 +1348,7 @@ void Song::removeController( Controller * _controller ) + void Song::clearErrors() { m_errors->clear(); @@ -1365,3 +1384,7 @@ QString* Song::errorSummary() return errors; } + + + + From abe05af49a6599f5243f062a2aaa60cfbc4b7af4 Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Wed, 7 Jan 2015 21:12:17 -0200 Subject: [PATCH 021/133] Update Mixer.cpp --- src/core/Mixer.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/core/Mixer.cpp b/src/core/Mixer.cpp index b6aff0446..6f0b9557a 100644 --- a/src/core/Mixer.cpp +++ b/src/core/Mixer.cpp @@ -319,9 +319,9 @@ const surroundSampleFrame * Mixer::renderNextBuffer() { m_profiler.startPeriod(); - static Song::playPos last_metro_pos = -1; + static Song::PlayPos last_metro_pos = -1; - Song::playPos p = Engine::getSong()->getPlayPos( + Song::PlayPos p = Engine::getSong()->getPlayPos( Song::Mode_PlayPattern ); if( Engine::getSong()->playMode() == Song::Mode_PlayPattern && gui->pianoRoll()->isRecording() == true && @@ -969,6 +969,3 @@ void Mixer::fifoWriter::run() - - - From 92f9fd92ec67222cc3b205e82a6c32745ab51e72 Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Wed, 7 Jan 2015 21:12:50 -0200 Subject: [PATCH 022/133] Update Timeline.cpp --- src/gui/TimeLineWidget.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/gui/TimeLineWidget.cpp b/src/gui/TimeLineWidget.cpp index 5966e7d51..7de1a9b46 100644 --- a/src/gui/TimeLineWidget.cpp +++ b/src/gui/TimeLineWidget.cpp @@ -51,8 +51,8 @@ QPixmap * TimeLineWidget::s_posMarkerPixmap = NULL; QPixmap * TimeLineWidget::s_loopPointBeginPixmap = NULL; QPixmap * TimeLineWidget::s_loopPointEndPixmap = NULL; -TimeLineWidget::TimeLineWidget( const int _xoff, const int _yoff, const float _ppt, - Song::playPos & _pos, const MidiTime & _begin, +TimeLineWidget::TimeLineWidget( const int xoff, const int yoff, const float ppt, + Song::playPos & pos, const MidiTime & begin, QWidget * _parent ) : QWidget( _parent ), m_autoScroll( AutoScrollEnabled ), @@ -391,7 +391,3 @@ void TimeLineWidget::mouseReleaseEvent( QMouseEvent* event ) - - - - From 9e1a35e3276ac702da0104d269f6920decded497 Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Wed, 7 Jan 2015 21:13:27 -0200 Subject: [PATCH 023/133] Update ProjectRenderer.cpp --- src/core/ProjectRenderer.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/core/ProjectRenderer.cpp b/src/core/ProjectRenderer.cpp index 727cb630c..e8a91c77d 100644 --- a/src/core/ProjectRenderer.cpp +++ b/src/core/ProjectRenderer.cpp @@ -163,7 +163,7 @@ void ProjectRenderer::run() //skip first empty buffer Engine::mixer()->nextBuffer(); - Song::playPos & pp = Engine::getSong()->getPlayPos( + Song::PlayPos & pp = Engine::getSong()->getPlayPos( Song::Mode_PlaySong ); m_progress = 0; const int sl = ( Engine::getSong()->length() + 1 ) * 192; @@ -230,5 +230,3 @@ void ProjectRenderer::updateConsoleProgress() - - From 77ceda9385f61e387c6953e0d1ec04def8af9aaf Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Wed, 7 Jan 2015 21:14:29 -0200 Subject: [PATCH 024/133] Update Song.h --- include/Song.h | 71 +++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 36 deletions(-) diff --git a/include/Song.h b/include/Song.h index 5da09818a..1d31428d0 100644 --- a/include/Song.h +++ b/include/Song.h @@ -49,10 +49,9 @@ const tick_t MaxSongLength = 9999 * DefaultTicksPerTact; class EXPORT Song : public TrackContainer { Q_OBJECT - mapPropertyFromModel(int,getTempo,setTempo,m_tempoModel); - mapPropertyFromModel(int,masterPitch,setMasterPitch,m_masterPitchModel); - mapPropertyFromModel(int,masterVolume,setMasterVolume, - m_masterVolumeModel); + mapPropertyFromModel( int,getTempo,setTempo,m_tempoModel ); + mapPropertyFromModel( int,masterPitch,setMasterPitch,m_masterPitchModel ); + mapPropertyFromModel( int,masterVolume,setMasterVolume, m_masterVolumeModel ); public: enum PlayModes { @@ -70,19 +69,19 @@ public: bool hasErrors(); QString* errorSummary(); - class playPos : public MidiTime + class PlayPos : public MidiTime { public: - playPos( const int _abs = 0 ) : - MidiTime( _abs ), + PlayPos( const int abs = 0 ) : + MidiTime( abs ), m_timeLine( NULL ), m_timeLineUpdate( true ), m_currentFrame( 0.0f ) { } - inline void setCurrentFrame( const float _f ) + inline void setCurrentFrame( const float f ) { - m_currentFrame = _f; + m_currentFrame = f; } inline float currentFrame() const { @@ -104,9 +103,9 @@ public: { return m_elapsedMilliSeconds; } - inline void setMilliSeconds( float _ellapsedMilliSeconds ) + inline void setMilliSeconds( float ellapsedMilliSeconds ) { - m_elapsedMilliSeconds = (_ellapsedMilliSeconds); + m_elapsedMilliSeconds = ellapsedMilliSeconds; } inline int getTacts() const { @@ -123,14 +122,14 @@ public: // Returns the beat position inside the bar, 0-based inline int getBeat() const { - return (currentTick() - currentTact()*ticksPerTact()) / - (ticksPerTact() / m_timeSigModel.getNumerator() ); + return ( currentTick() - currentTact() * ticksPerTact() ) / + ( ticksPerTact() / m_timeSigModel.getNumerator() ); } // the remainder after bar and beat are removed inline int getBeatTicks() const { - return (currentTick() - currentTact()*ticksPerTact()) % - (ticksPerTact() / m_timeSigModel.getNumerator() ); + return ( currentTick() - currentTact() * ticksPerTact() ) % + ( ticksPerTact() / m_timeSigModel.getNumerator() ); } inline int getTicks() const { @@ -151,7 +150,7 @@ public: inline bool isPlaying() const { - return m_playing && m_exporting == false; + return m_playing == true && m_exporting == false; } inline bool isStopped() const @@ -186,9 +185,9 @@ public: return m_playMode; } - inline playPos & getPlayPos( PlayModes _pm ) + inline PlayPos & getPlayPos( PlayModes pm ) { - return m_playPos[_pm]; + return m_playPos[pm]; } void updateLength(); @@ -208,11 +207,11 @@ public: // file management void createNewProject(); - void createNewProjectFromTemplate( const QString & _template ); - void loadProject( const QString & _filename ); + void createNewProjectFromTemplate( const QString & templ ); + void loadProject( const QString & filename ); bool guiSaveProject(); - bool guiSaveProjectAs( const QString & _filename ); - bool saveProjectFile( const QString & _filename ); + bool guiSaveProjectAs( const QString & filename ); + bool saveProjectFile( const QString & filename ); const QString & projectFileName() const { @@ -239,8 +238,8 @@ public: return false; } - void addController( Controller * _c ); - void removeController( Controller * _c ); + void addController( Controller * c ); + void removeController( Controller * c ); const ControllerVector & controllers() const @@ -259,14 +258,14 @@ public slots: void playSong(); void record(); void playAndRecord(); - void playTrack( Track * _trackToPlay ); + void playTrack( Track * trackToPlay ); void playBB(); - void playPattern(const Pattern* patternToPlay, bool _loop = true ); + void playPattern( const Pattern * patternToPlay, bool loop = true ); void togglePause(); void stop(); void importProject(); - void exportProject(bool multiExport=false); + void exportProject( bool multiExport = false ); void exportProjectTracks(); void startExport(); @@ -315,13 +314,14 @@ private: inline f_cnt_t currentFrame() const { - return m_playPos[m_playMode].getTicks() * Engine::framesPerTick() + m_playPos[m_playMode].currentFrame(); + return m_playPos[m_playMode].getTicks() * Engine::framesPerTick() + + m_playPos[m_playMode].currentFrame(); } - void setPlayPos( tick_t _ticks, PlayModes _play_mode ); + void setPlayPos( tick_t ticks, PlayModes playMode ); - void saveControllerStates( QDomDocument & _doc, QDomElement & _this ); - void restoreControllerStates( const QDomElement & _this ); + void saveControllerStates( QDomDocument & doc, QDomElement & element ); + void restoreControllerStates( const QDomElement & element ); AutomationTrack * m_globalAutomationTrack; @@ -351,7 +351,7 @@ private: QList * m_errors; PlayModes m_playMode; - playPos m_playPos[Mode_Count]; + PlayPos m_playPos[Mode_Count]; tact_t m_length; Track * m_trackToPlay; @@ -374,10 +374,9 @@ signals: void projectLoaded(); void playbackStateChanged(); void playbackPositionChanged(); - void lengthChanged( int _tacts ); - void tempoChanged( bpm_t _new_bpm ); - void timeSignatureChanged( int _old_ticks_per_tact, - int _ticks_per_tact ); + void lengthChanged( int tacts ); + void tempoChanged( bpm_t newBPM ); + void timeSignatureChanged( int oldTicksPerTact, int ticksPerTact ); } ; From 4d6d937cf2809f893478377c28a204b4836a5359 Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Wed, 7 Jan 2015 21:14:55 -0200 Subject: [PATCH 025/133] Update Timeline.h --- include/TimeLineWidget.h | 8 ++++---- src/gui/TimeLineWidget.cpp | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/TimeLineWidget.h b/include/TimeLineWidget.h index abf622aaf..f8395ec37 100644 --- a/include/TimeLineWidget.h +++ b/include/TimeLineWidget.h @@ -61,11 +61,11 @@ public: } ; - TimeLineWidget( int _xoff, int _yoff, float _ppt, Song::playPos & _pos, - const MidiTime & _begin, QWidget * _parent ); + TimeLineWidget( int xoff, int yoff, float ppt, Song::playPos & pos, + const MidiTime & begin, QWidget * parent ); virtual ~TimeLineWidget(); - inline Song::playPos & pos() + inline Song::PlayPos & pos() { return( m_pos ); } @@ -163,7 +163,7 @@ private: int m_xOffset; int m_posMarkerX; float m_ppt; - Song::playPos & m_pos; + Song::PlayPos & m_pos; const MidiTime & m_begin; MidiTime m_loopPos[2]; diff --git a/src/gui/TimeLineWidget.cpp b/src/gui/TimeLineWidget.cpp index 7de1a9b46..bf5db2ed9 100644 --- a/src/gui/TimeLineWidget.cpp +++ b/src/gui/TimeLineWidget.cpp @@ -53,17 +53,17 @@ QPixmap * TimeLineWidget::s_loopPointEndPixmap = NULL; TimeLineWidget::TimeLineWidget( const int xoff, const int yoff, const float ppt, Song::playPos & pos, const MidiTime & begin, - QWidget * _parent ) : - QWidget( _parent ), + QWidget * parent ) : + QWidget( parent ), m_autoScroll( AutoScrollEnabled ), m_loopPoints( LoopPointsDisabled ), m_behaviourAtStop( BackToZero ), m_changedPosition( true ), - m_xOffset( _xoff ), + m_xOffset( xoff ), m_posMarkerX( 0 ), - m_ppt( _ppt ), - m_pos( _pos ), - m_begin( _begin ), + m_ppt( ppt ), + m_pos( pos ), + m_begin( begin ), m_savedPos( -1 ), m_hint( NULL ), m_action( NoAction ), @@ -94,17 +94,17 @@ TimeLineWidget::TimeLineWidget( const int xoff, const int yoff, const float ppt, } setAttribute( Qt::WA_OpaquePaintEvent, true ); - move( 0, _yoff ); + move( 0, yoff ); setFixedHeight( s_timeLinePixmap->height() ); m_xOffset -= s_posMarkerPixmap->width() / 2; m_pos.m_timeLine = this; - QTimer * update_timer = new QTimer( this ); - connect( update_timer, SIGNAL( timeout() ), + QTimer * updateTimer = new QTimer( this ); + connect( updateTimer, SIGNAL( timeout() ), this, SLOT( updatePosition() ) ); - update_timer->start( 50 ); + updateTimer->start( 50 ); } From 9e370ff12151f67ea4799491819af3d5d33dabdb Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Wed, 7 Jan 2015 21:44:48 -0200 Subject: [PATCH 026/133] Update Plugin.cpp --- src/core/Plugin.cpp | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/src/core/Plugin.cpp b/src/core/Plugin.cpp index abdc44a96..49aa41e25 100644 --- a/src/core/Plugin.cpp +++ b/src/core/Plugin.cpp @@ -38,9 +38,9 @@ #include "Song.h" -static PixmapLoader __dummy_loader; +static PixmapLoader __dummyLoader; -static Plugin::Descriptor dummy_plugin_descriptor = +static Plugin::Descriptor dummyPluginDescriptor = { "dummy", "dummy", @@ -48,21 +48,21 @@ static Plugin::Descriptor dummy_plugin_descriptor = "Tobias Doerffel ", 0x0100, Plugin::Undefined, - &__dummy_loader, + &__dummyLoader, NULL } ; -Plugin::Plugin( const Descriptor * _descriptor, Model * parent ) : +Plugin::Plugin( const Descriptor * descriptor, Model * parent ) : Model( parent ), JournallingObject(), - m_descriptor( _descriptor ) + m_descriptor( descriptor ) { if( m_descriptor == NULL ) { - m_descriptor = &dummy_plugin_descriptor; + m_descriptor = &dummyPluginDescriptor; } } @@ -109,7 +109,7 @@ Plugin * Plugin::instantiate( const QString & pluginName, Model * parent, return new DummyPlugin(); } - InstantiationHook instantiationHook = ( InstantiationHook ) pluginLibrary.resolve( "lmms_plugin_main" ); + InstantiationHook instantiationHook = ( InstantiationHook )pluginLibrary.resolve( "lmms_plugin_main" ); if( instantiationHook == NULL ) { if( Engine::hasGUI() ) @@ -126,13 +126,17 @@ Plugin * Plugin::instantiate( const QString & pluginName, Model * parent, return inst; } -void Plugin::collectErrorForUI( QString err_msg ) + + + +void Plugin::collectErrorForUI( QString errMsg ) { - Engine::getSong()->collectError( err_msg ); + Engine::getSong()->collectError( errMsg ); } + void Plugin::getDescriptorsOfAvailPlugins( DescriptorList& pluginDescriptors ) { QDir directory( ConfigManager::inst()->pluginDir() ); @@ -189,13 +193,13 @@ PluginView * Plugin::createView( QWidget * parent ) -Plugin::Descriptor::SubPluginFeatures::Key::Key( - const QDomElement & _key ) : + +Plugin::Descriptor::SubPluginFeatures::Key::Key( const QDomElement & key ) : desc( NULL ), - name( _key.attribute( "key" ) ), + name( key.attribute( "key" ) ), attributes() { - QDomNodeList l = _key.elementsByTagName( "attribute" ); + QDomNodeList l = key.elementsByTagName( "attribute" ); for( int i = 0; !l.item( i ).isNull(); ++i ) { QDomElement e = l.item( i ).toElement(); @@ -208,13 +212,13 @@ Plugin::Descriptor::SubPluginFeatures::Key::Key( QDomElement Plugin::Descriptor::SubPluginFeatures::Key::saveXML( - QDomDocument & _doc ) const + QDomDocument & doc ) const { - QDomElement e = _doc.createElement( "key" ); - for( AttributeMap::ConstIterator it = attributes.begin(); - it != attributes.end(); ++it ) + QDomElement e = doc.createElement( "key" ); + for( AttributeMap::ConstIterator it = attributes.begin(); + it != attributes.end(); ++it ) { - QDomElement a = _doc.createElement( "attribute" ); + QDomElement a = doc.createElement( "attribute" ); a.setAttribute( "name", it.key() ); a.setAttribute( "value", it.value() ); e.appendChild( a ); @@ -222,3 +226,5 @@ QDomElement Plugin::Descriptor::SubPluginFeatures::Key::saveXML( return e; } + + From 38799f80afd7322cd84bd259fcf4f88396cf9e20 Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Wed, 7 Jan 2015 21:46:02 -0200 Subject: [PATCH 027/133] Update Plugin.h --- include/Plugin.h | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/include/Plugin.h b/include/Plugin.h index b73238ab5..5efcf68b7 100644 --- a/include/Plugin.h +++ b/include/Plugin.h @@ -85,19 +85,19 @@ public: { typedef QMap AttributeMap; - inline Key( const Plugin::Descriptor * _desc = NULL, - const QString & _name = QString(), - const AttributeMap & _am = AttributeMap() ) + inline Key( const Plugin::Descriptor * desc = NULL, + const QString & name = QString(), + const AttributeMap & am = AttributeMap() ) : - desc( _desc ), - name( _name ), - attributes( _am ) + desc( desc ), + name( name ), + attributes( am ) { } - Key( const QDomElement & _key ); + Key( const QDomElement & key ); - QDomElement saveXML( QDomDocument & _doc ) const; + QDomElement saveXML( QDomDocument & doc ) const; inline bool isValid() const { @@ -142,13 +142,15 @@ public: typedef QList DescriptorList; // contructor of a plugin - Plugin( const Descriptor* descriptor, Model* parent ); + Plugin( const Descriptor * descriptor, Model * parent ); virtual ~Plugin(); // returns display-name out of descriptor virtual QString displayName() const { - return Model::displayName().isEmpty() ? m_descriptor->displayName : Model::displayName(); + return Model::displayName().isEmpty() + ? m_descriptor->displayName + : Model::displayName(); } // return plugin-type @@ -158,41 +160,41 @@ public: } // return plugin-descriptor for further information - inline const Descriptor* descriptor() const + inline const Descriptor * descriptor() const { return m_descriptor; } // can be called if a file matching supportedFileTypes should be // loaded/processed with the help of this plugin - virtual void loadFile( const QString& file ); + virtual void loadFile( const QString & file ); // Called if external source needs to change something but we cannot // reference the class header. Should return null if not key not found. - virtual AutomatableModel* childModel( const QString& modelName ); + virtual AutomatableModel* childModel( const QString & modelName ); // returns an instance of a plugin whose name matches to given one // if specified plugin couldn't be loaded, it creates a dummy-plugin static Plugin * instantiate( const QString& pluginName, Model * parent, void * data ); // fills given list with descriptors of all available plugins - static void getDescriptorsOfAvailPlugins( DescriptorList& pluginDescriptors ); + static void getDescriptorsOfAvailPlugins( DescriptorList & pluginDescriptors ); // create a view for the model - PluginView * createView( QWidget* parent ); + PluginView * createView( QWidget * parent ); protected: // create a view for the model - virtual PluginView* instantiateView( QWidget* ) = 0; - void collectErrorForUI( QString err_msg ); + virtual PluginView* instantiateView( QWidget * ) = 0; + void collectErrorForUI( QString errMsg ); private: - const Descriptor* m_descriptor; + const Descriptor * m_descriptor; // pointer to instantiation-function in plugin - typedef Plugin * ( * InstantiationHook )( Model*, void* ); + typedef Plugin * ( * InstantiationHook )( Model * , void * ); } ; From 2e7732a7f5fcf6d0fd1242d387b3bc88bc580161 Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Wed, 7 Jan 2015 21:50:26 -0200 Subject: [PATCH 028/133] Update ProjectVersion.h --- include/ProjectVersion.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/ProjectVersion.h b/include/ProjectVersion.h index 37cc83565..2148d5d60 100644 --- a/include/ProjectVersion.h +++ b/include/ProjectVersion.h @@ -39,8 +39,8 @@ enum CompareType { Major, Minor, Release, Build }; class ProjectVersion { public: - ProjectVersion(QString version, CompareType c = CompareType::Build); - ProjectVersion(const char * version, CompareType c = CompareType::Build); + ProjectVersion( QString version, CompareType c = CompareType::Build ); + ProjectVersion( const char * version, CompareType c = CompareType::Build ); int getMajor() const { return m_major; } int getMinor() const { return m_minor; } @@ -61,7 +61,6 @@ private: CompareType m_compareType; } ; - /* * ProjectVersion v. ProjectVersion */ From a34faeca712fa04238cac283cf884ad31e77b74f Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Wed, 7 Jan 2015 21:50:57 -0200 Subject: [PATCH 029/133] Update ProjectVersion.cpp --- src/core/ProjectVersion.cpp | 41 ++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/src/core/ProjectVersion.cpp b/src/core/ProjectVersion.cpp index 7fc602c67..d1347bc79 100644 --- a/src/core/ProjectVersion.cpp +++ b/src/core/ProjectVersion.cpp @@ -53,60 +53,63 @@ ProjectVersion::ProjectVersion(QString version, CompareType c) : { } -ProjectVersion::ProjectVersion(const char* version, CompareType c) : - m_version(QString(version)), - m_major(parseMajor(m_version)), - m_minor(parseMinor(m_version)), - m_release(parseRelease(m_version)) , - m_build(parseBuild(m_version)), - m_compareType(c) +ProjectVersion::ProjectVersion( const char* version, CompareType c ) : + m_version( QString( version ) ), + m_major(parseMajor( m_version ) ), + m_minor(parseMinor( m_version ) ), + m_release(parseRelease( m_version ) ), + m_build(parseBuild( m_version ) ), + m_compareType( c ) { } -int ProjectVersion::compare(const ProjectVersion& a, const ProjectVersion& b, CompareType c) +int ProjectVersion::compare( const ProjectVersion & a, const ProjectVersion & b, CompareType c ) { - if (a.getMajor() != b.getMajor()) + if( a.getMajor() != b.getMajor() ) { return a.getMajor() - b.getMajor(); } - else if (c == CompareType::Major) + else if( c == CompareType::Major ) { return 0; } - if (a.getMinor() != b.getMinor()) + if( a.getMinor() != b.getMinor() ) { return a.getMinor() - b.getMinor(); } - else if (c == CompareType::Minor) + else if( c == CompareType::Minor ) { return 0; } - if (a.getRelease() != b.getRelease()) + if( a.getRelease() != b.getRelease() ) { return a.getRelease() - b.getRelease(); } - else if (c == CompareType::Release) + else if( c == CompareType::Release ) { return 0; } // make sure 0.x.y > 0.x.y-patch - if(a.getBuild().isEmpty()) + if( a.getBuild().isEmpty() ) { return 1; } - if(b.getBuild().isEmpty()) + if( b.getBuild().isEmpty() ) { return -1; } - return QString::compare(a.getBuild(), b.getBuild()); + return QString::compare( a.getBuild(), b.getBuild() ); } -int ProjectVersion::compare(ProjectVersion v1, ProjectVersion v2) +int ProjectVersion::compare( ProjectVersion v1, ProjectVersion v2 ) { - return compare(v1, v2, std::min(v1.getCompareType(), v2.getCompareType())); + return compare( v1, v2, std::min( v1.getCompareType(), v2.getCompareType() ) ); } + + + From 2834bd17f4d1681bdcadf44e1b46b935cb673c71 Mon Sep 17 00:00:00 2001 From: Alexandre Date: Tue, 20 Jan 2015 00:00:58 -0200 Subject: [PATCH 030/133] Coding conventions update --- include/TimeLineWidget.h | 2 +- include/Track.h | 4 ---- src/core/Track.cpp | 28 +++------------------------- src/gui/TimeLineWidget.cpp | 2 +- 4 files changed, 5 insertions(+), 31 deletions(-) diff --git a/include/TimeLineWidget.h b/include/TimeLineWidget.h index f8395ec37..417ceb530 100644 --- a/include/TimeLineWidget.h +++ b/include/TimeLineWidget.h @@ -61,7 +61,7 @@ public: } ; - TimeLineWidget( int xoff, int yoff, float ppt, Song::playPos & pos, + TimeLineWidget( int xoff, int yoff, float ppt, Song::PlayPos & pos, const MidiTime & begin, QWidget * parent ); virtual ~TimeLineWidget(); diff --git a/include/Track.h b/include/Track.h index 4d4b221fc..227abf135 100644 --- a/include/Track.h +++ b/include/Track.h @@ -228,10 +228,6 @@ protected: virtual void mouseMoveEvent( QMouseEvent * me ); virtual void mouseReleaseEvent( QMouseEvent * me ); -<<<<<<< HEAD -======= - void setAutoResizeEnabled( bool e = false ); ->>>>>>> Update coding conventions float pixelsPerTact(); inline TrackView * getTrackView() diff --git a/src/core/Track.cpp b/src/core/Track.cpp index 1c64531a8..dd003a6f2 100644 --- a/src/core/Track.cpp +++ b/src/core/Track.cpp @@ -958,22 +958,6 @@ float TrackContentObjectView::pixelsPerTact() -<<<<<<< HEAD -======= -/*! \brief Set whether this trackContentObjectView can resize. - * - * \param e The boolean state of whether this track content object view - * is allowed to resize. - */ -void TrackContentObjectView::setAutoResizeEnabled( bool e ) -{ - m_autoResize = e; -} - - - - ->>>>>>> Update coding conventions /*! \brief Detect whether the mouse moved more than n pixels on screen. * * \param _me The QMouseEvent. @@ -1780,12 +1764,11 @@ void TrackOperationsWidget::updateMenu() } if( InstrumentTrackView * trackView = dynamic_cast( m_trackView ) ) { -<<<<<<< HEAD int channelIndex = trackView->model()->effectChannelModel()->value(); FxChannel * fxChannel = Engine::fxMixer()->effectChannel( channelIndex ); - QMenu * fxMenu = new QMenu( tr( "FX %1: %2" ).arg( channelIndex ).arg( fxChannel->m_name ), to_menu ); + QMenu * fxMenu = new QMenu( tr( "FX %1: %2" ).arg( channelIndex ).arg( fxChannel->m_name ), toMenu ); QSignalMapper * fxMenuSignalMapper = new QSignalMapper(this); fxMenu->addAction("Assign to new FX Channel" , this, SLOT( createFxLine() ) ); @@ -1804,16 +1787,11 @@ void TrackOperationsWidget::updateMenu() } } - to_menu->addMenu(fxMenu); + toMenu->addMenu(fxMenu); connect(fxMenuSignalMapper, SIGNAL(mapped(int)), this, SLOT(assignFxLine(int))); - to_menu->addSeparator(); - to_menu->addMenu( trackView->midiMenu() ); -======= toMenu->addSeparator(); - toMenu->addMenu( dynamic_cast( - m_trackView )->midiMenu() ); ->>>>>>> Update coding conventions + toMenu->addMenu( trackView->midiMenu() ); } if( dynamic_cast( m_trackView ) ) { diff --git a/src/gui/TimeLineWidget.cpp b/src/gui/TimeLineWidget.cpp index bf5db2ed9..953a9cd0b 100644 --- a/src/gui/TimeLineWidget.cpp +++ b/src/gui/TimeLineWidget.cpp @@ -52,7 +52,7 @@ QPixmap * TimeLineWidget::s_loopPointBeginPixmap = NULL; QPixmap * TimeLineWidget::s_loopPointEndPixmap = NULL; TimeLineWidget::TimeLineWidget( const int xoff, const int yoff, const float ppt, - Song::playPos & pos, const MidiTime & begin, + Song::PlayPos & pos, const MidiTime & begin, QWidget * parent ) : QWidget( parent ), m_autoScroll( AutoScrollEnabled ), From d4d15ea567809a702cac5e137766f364d31549ac Mon Sep 17 00:00:00 2001 From: Spekular Date: Fri, 23 Jan 2015 22:37:12 +0100 Subject: [PATCH 031/133] Update Swedish Translation --- data/locale/sv.ts | 268 +++++++++++++++++++++++----------------------- 1 file changed, 134 insertions(+), 134 deletions(-) diff --git a/data/locale/sv.ts b/data/locale/sv.ts index 6f57e6f6f..2d71c2946 100644 --- a/data/locale/sv.ts +++ b/data/locale/sv.ts @@ -5,7 +5,7 @@ AboutDialog About LMMS - + Om LMMS Version %1 (%2/%3, Qt %4, %5) @@ -17,15 +17,15 @@ LMMS - easy music production for everyone - + LMMS - enkel musikproduktion för alla Authors - + Utvecklare Translation - + Översättning Current language not translated (or native English). @@ -35,11 +35,11 @@ If you're interested in translating LMMS in another language or want to imp License - + Licens Copyright (c) 2004-2014, LMMS developers - + Copyright (c) 2004-2014, LMMS utvecklare <html><head/><body><p><a href="http://lmms.io"><span style=" text-decoration: underline; color:#0000ff;">http://lmms.io</span></a></p></body></html> @@ -47,15 +47,15 @@ If you're interested in translating LMMS in another language or want to imp LMMS - + LMMS Involved - + Involverad Contributors ordered by number of commits: - + Utvecklare ordnade efter mängd bidrag: @@ -78,19 +78,19 @@ If you're interested in translating LMMS in another language or want to imp LEFT - + VÄNSTER Left gain: - + Vänster volym: RIGHT - + HÖGER Right gain: - + Höger volym: @@ -105,11 +105,11 @@ If you're interested in translating LMMS in another language or want to imp Left gain - + Vänster volym Right gain - + Höger volym @@ -127,19 +127,19 @@ If you're interested in translating LMMS in another language or want to imp AudioFileProcessorView Open other sample - + Oppna annan ljudfil Click here, if you want to open another audio-file. A dialog will appear where you can select your file. Settings like looping-mode, start and end-points, amplify-value, and so on are not reset. So, it may not sound like the original sample. - + Klicka här för att öppna en anna ljud fil. En dialogvisas där du väljer din fil. Inställningar som looping, start och slutpunkter, volym och sådant omställs inte. Därför låter det kanske inte som originalfilen. Reverse sample - + Spela baklänges If you enable this button, the whole sample is reversed. This is useful for cool effects, e.g. a reversed crash. - + Den här knappen gör att ljudfilen spelas baklänges. Den kan användas för intressanta effeker t.ex. en baklänges cymbal. Amplify: @@ -147,7 +147,7 @@ If you're interested in translating LMMS in another language or want to imp With this knob you can set the amplify ratio. When you set a value of 100% your sample isn't changed. Otherwise it will be amplified up or down (your actual sample-file isn't touched!) - + Med detta vred ställer du in förstärkningen. Vid 100% blir det ingen skillnad. Annars blir din ljudfil mer eller mindre högljudd, men källfilen förändras inte. Startpoint: @@ -155,51 +155,51 @@ If you're interested in translating LMMS in another language or want to imp Endpoint: - + Slutpunkt: Continue sample playback across notes - + Forsätt spela ljudfil över noter Enabling this option makes the sample continue playing across different notes - if you change pitch, or the note length stops before the end of the sample, then the next note played will continue where it left off. To reset the playback to the start of the sample, insert a note at the bottom of the keyboard (< 20 Hz) - + Denna inställningen gör att ljudfilen förtsätter spela över noter. Om en not avslutas före ljudfilen är slut fortsätter nästa not där den förra slutade. Om du vill starta från början av ljudfilen innan den spelat färdigt, placera en not på botten av pianot (vid 20Hz) Disable loop - + Avaktivera looping This button disables looping. The sample plays only once from start to end. - + Den här knappen avaktiverar looping.Ljudfilen spelas bara en gång från starttill slut. Enable loop - + Aktivera looping This button enables forwards-looping. The sample loops between the end point and the loop point. - + Den här knappen aktiverar looping. Ljudfilen loopar mellan slutpunkten och looppunkten. This button enables ping-pong-looping. The sample loops backwards and forwards between the end point and the loop point. - + Den här knappen aktiverar "ping-pong" looping. Ljudfilen spelar från start till slut, och sen tilbaks, och fortsäter så. With this knob you can set the point where AudioFileProcessor should begin playing your sample. - + Med den här vreden ställer du in vartifrån ljudfilen ska börja spela. With this knob you can set the point where AudioFileProcessor should stop playing your sample. - + Med den här vreden ställer du in vart ljudfilen slutar spela. Loopback point: - + Loopback punkt: With this knob you can set the point where the loop starts. - + Den här vreden ställer in vart loopen startar. @@ -213,19 +213,19 @@ If you're interested in translating LMMS in another language or want to imp AudioJack JACK client restarted - + JACK klienten omstartades LMMS was kicked by JACK for some reason. Therefore the JACK backend of LMMS has been restarted. You will have to make manual connections again. - + LMMS blev bortkopplat från JACK. LMMS JACK backend omstartades därfor. Du får manuellt koppla om igen. JACK server down - + JACK server nerstängd The JACK server seems to have been shutdown and starting a new instance failed. Therefore LMMS is unable to proceed. You should save your project and restart JACK and LMMS. - + JACK servern stängde av och det gick inte starta en ny. LMMS kan inte fortsätta. Du bör spara ditt projekt och starta om både JACK och LMMS. CLIENT-NAME @@ -251,7 +251,7 @@ If you're interested in translating LMMS in another language or want to imp AudioPortAudio::setupWidget BACKEND - + BACKEND DEVICE @@ -284,7 +284,7 @@ If you're interested in translating LMMS in another language or want to imp &Copy value (%1%2) - + Kopiera värder (%1%2) &Paste value (%1%2) @@ -292,42 +292,42 @@ If you're interested in translating LMMS in another language or want to imp Edit song-global automation - + Redigera global automation Connected to %1 - + Kopplad till %1 Connected to controller - + Kopplad till controller Edit connection... - + Redigera koppling... Remove connection - + Ta bort koppling Connect to controller... - + Koppla till kontroller... Remove song-global automation - + Ta bort gloabal automation Remove all linked controls - + Ta bort alla kopplade kontroller AutomationEditor Please open an automation pattern with the context menu of a control! - + Öppna ett mönster ifrån en kontrollers kontext meny! Values copied @@ -346,7 +346,7 @@ If you're interested in translating LMMS in another language or want to imp Click here if you want to play the current pattern. This is useful while editing it. The pattern is automatically looped when the end is reached. - + Clicka här för att spela det aktuella mönstret. Det härär hjälpsamt närman redigerar. Mönstret spelas från början igen när de nått sitt slut. Stop playing of current pattern (Space) @@ -354,75 +354,75 @@ If you're interested in translating LMMS in another language or want to imp Click here if you want to stop playing of the current pattern. - + Klicka här för att stoppa uppspelning av de aktuella mönstret. Draw mode (Shift+D) - + Ritläge (Shift+D) Erase mode (Shift+E) - + Suddläge (Shift+E) Flip vertically - + Spegla vertikalt Flip horizontally - + Spegla horizontellt Click here and the pattern will be inverted.The points are flipped in the y direction. - + Klicka här för att spegla mönstret. Punkterna förflyttas på y-axeln Click here and the pattern will be reversed. The points are flipped in the x direction. - + Klicka här för att spegla mönstret. Punkterna förflyttas på x-axeln Click here and draw-mode will be activated. In this mode you can add and move single values. This is the default mode which is used most of the time. You can also press 'Shift+D' on your keyboard to activate this mode. - + Klicka här för att aktivera ritläget. I detta läget kan du lägga till och förflytta individuella värden. Det här är standardläget. Det går också att trycka 'Shift+D' på tangentborded för att aktivera detta läget. Click here and erase-mode will be activated. In this mode you can erase single values. You can also press 'Shift+E' on your keyboard to activate this mode. - + Klicka här för att aktivera suddläget. I detta läget kan du ta bort individuella värden. Det går också att trycka 'Shift+E' på tangentborded för att aktivera detta läget. Discrete progression - + Diskret talföljd Linear progression - + Linjär talföljd Cubic Hermite progression - + Cubic Hermite talföljd Tension value for spline - + Spänning i mönstrets spline A higher tension value may make a smoother curve but overshoot some values. A low tension value will cause the slope of the curve to level off at each control point. - + Högre spänning ger en mjuk kurva som ibland missar individuella punkter. Med lägre spänning planar kurvan ut nära punkterna. Click here to choose discrete progressions for this automation pattern. The value of the connected object will remain constant between control points and be set immediately to the new value when each control point is reached. - + Klicka här för att aktivera diskret talföljd. Värdet är konstant mella kontroll punkter och ändras direkt när en ny kontrollpunkt nås. Click here to choose linear progressions for this automation pattern. The value of the connected object will change at a steady rate over time between control points to reach the correct value at each control point without a sudden change. - + Klicka här för att aktivera linjär talföljd. Värdet ändras vid en stadig takt mellan kontrollpunkter för att gradvis nå nästa värde. Click here to choose cubic hermite progressions for this automation pattern. The value of the connected object will change in a smooth curve and ease in to the peaks and valleys. - + Klicka här för att aktivera cubic hermite talföljd. Värdet följer en mjuk kurva mellan kontrollpunkter. Cut selected values (Ctrl+X) - klipp ut valda värden (ctrl+X) + Klipp ut valda värden (ctrl+X) Copy selected values (Ctrl+C) @@ -430,57 +430,57 @@ If you're interested in translating LMMS in another language or want to imp Paste values from clipboard Ctrl+V) - + Klistra värden (Ctrl+V) Click here and selected values will be cut into the clipboard. You can paste them anywhere in any pattern by clicking on the paste button. - + Klicka här för att klippa de valda värderna. Du kan sen klistra dem var som helst genom att klicka på klistra knappen. Click here and selected values will be copied into the clipboard. You can paste them anywhere in any pattern by clicking on the paste button. - + Klicka här för att kopiera de valda värderna. Du kan sen klistra dem var som helst genom att klicka på klistra knappen. Click here and the values from the clipboard will be pasted at the first visible measure. - + Klicka här för att klistra kopierade värderna vid den första synliga metern. Tension: - + Spänning: Automation Editor - no pattern - + Redigera Automation - inget mönster Automation Editor - %1 - + Redigera Automation - %1 AutomationPattern Drag a control while pressing <Ctrl> - + Dra en kontroll samtidigt som du håller <Ctrl> Model is already connected to this pattern. - + Modellen är redan kopplad till detta mönstret. AutomationPatternView double-click to open this pattern in automation editor - + dubbelklicka för att öppna det här mönstret för redigering Open in Automation editor - + Öppna för att redigera Clear - + Rensa Reset name @@ -492,76 +492,76 @@ If you're interested in translating LMMS in another language or want to imp %1 Connections - + %1 Kopplingar Disconnect "%1" - + Avkoppla "%1" Set/clear record - + Set/rensa inspelning Flip Vertically (Visible) - + Spegla Vertikalt (Synligt) Flip Horizontally (Visible) - + Spegla Horizontellt (Synligt) AutomationTrack Automation track - + Automation spår BBEditor Beat+Bassline Editor - + Redigera Trummor+Bas Play/pause current beat/bassline (Space) - + Spela/pause Trummor+Bas Stop playback of current beat/bassline (Space) - + Avsluta uppspelning av Trummor+Bas Click here to play the current beat/bassline. The beat/bassline is automatically looped when its end is reached. - + Klicka här för att spela Trummor/Bas.Mönstret loopar när det nåt sitt slut. Click here to stop playing of current beat/bassline. - + Klicka här för att sluta spela trummor/bas. Add beat/bassline - + Lägg till trummor/bas Add automation-track - + Lägg till automationsmönster Remove steps - + Ta bort steg Add steps - + Lägg till steg BBTCOView Open in Beat+Bassline-Editor - + Öppna för att redigera Trummor+Bas Reset name @@ -577,99 +577,99 @@ If you're interested in translating LMMS in another language or want to imp Reset color to default - + Byt färg till standard BBTrack Beat/Bassline %1 - + Trummor/Bas %1 Clone of %1 - + Kopia av %1 BassBoosterControlDialog FREQ - + FREQ Frequency: - + Frekven: GAIN - + VOL Gain: - + Volym: RATIO - + RATIO Ratio: - + Ratio: BassBoosterControls Frequency - + Frekvens Gain - + Volym Ratio - + Ratio BitcrushControlDialog IN - + IN OUT - + UT GAIN - + VOL Input Gain: - + Input Volym: NOIS - + BRUS Input Noise: - + Input brus: Output Gain: - + Output Volym CLIP - + CLIP Output Clip: - + Output Clip: Rate @@ -685,11 +685,11 @@ If you're interested in translating LMMS in another language or want to imp Depth - + Djup Depth Enabled - + Djup aktiverat Enable bitdepth-crushing @@ -709,11 +709,11 @@ If you're interested in translating LMMS in another language or want to imp Levels - + Nivåer Levels: - + Nivåer: @@ -724,7 +724,7 @@ If you're interested in translating LMMS in another language or want to imp Help (not available) - + Hjälp (inte tillgängligt) @@ -735,29 +735,29 @@ If you're interested in translating LMMS in another language or want to imp Click here to show or hide the graphical user interface (GUI) of Carla. - + Klicka här för att öppna eller stänga Carlas GUI. Controller Controller %1 - + Kontroller %1 ControllerConnectionDialog Connection Settings - + Kopplingsinställningar MIDI CONTROLLER - + MIDI KONTROLLER Input channel - + Input kanal CHANNEL @@ -765,15 +765,15 @@ If you're interested in translating LMMS in another language or want to imp Input controller - + Input kontroller CONTROLLER - + KONTROLLER Auto Detect - + Upptäck automatiskt MIDI-devices to receive MIDI-events from @@ -781,7 +781,7 @@ If you're interested in translating LMMS in another language or want to imp USER CONTROLLER - + ANVÄNDARKONTROLLER MAPPING FUNCTION @@ -789,7 +789,7 @@ If you're interested in translating LMMS in another language or want to imp OK - + OK Cancel @@ -820,7 +820,7 @@ If you're interested in translating LMMS in another language or want to imp Confirm delete? There are existing connection(s) associted with this controller. There is no way to undo. - + Vill du verkligen ta bort? Det finns kopplingar till den här kotrollen, och operationen går inte ångra. @@ -831,15 +831,15 @@ If you're interested in translating LMMS in another language or want to imp Controllers are able to automate the value of a knob, slider, and other controls. - + Kontroller kan automatisera värdet på en vred, reglage, och andra kontroller Rename controller - + Byt namn på kontroller Enter the new name for this controller - + Skriv nya namnet på kontrollern &Remove this plugin From 28a51968a32c86c16ffcd6697e77ad4827c141b2 Mon Sep 17 00:00:00 2001 From: Spekular Date: Fri, 23 Jan 2015 23:00:26 +0100 Subject: [PATCH 032/133] =?UTF-8?q?Gain:=20Volym>F=C3=B6st=C3=A4rkning=20A?= =?UTF-8?q?mplification:=20Volym>Amplifiering?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/locale/sv.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/data/locale/sv.ts b/data/locale/sv.ts index 2d71c2946..d1772edf3 100644 --- a/data/locale/sv.ts +++ b/data/locale/sv.ts @@ -82,7 +82,7 @@ If you're interested in translating LMMS in another language or want to imp Left gain: - Vänster volym: + Vänster förstärkning: RIGHT @@ -90,7 +90,7 @@ If you're interested in translating LMMS in another language or want to imp Right gain: - Höger volym: + Höger förstärkning: @@ -105,11 +105,11 @@ If you're interested in translating LMMS in another language or want to imp Left gain - Vänster volym + Vänster förstärkning Right gain - Höger volym + Höger förstärkning @@ -131,7 +131,7 @@ If you're interested in translating LMMS in another language or want to imp Click here, if you want to open another audio-file. A dialog will appear where you can select your file. Settings like looping-mode, start and end-points, amplify-value, and so on are not reset. So, it may not sound like the original sample. - Klicka här för att öppna en anna ljud fil. En dialogvisas där du väljer din fil. Inställningar som looping, start och slutpunkter, volym och sådant omställs inte. Därför låter det kanske inte som originalfilen. + Klicka här för att öppna en anna ljud fil. En dialogvisas där du väljer din fil. Inställningar som looping, start och slutpunkter, amplifiering och sådant omställs inte. Därför låter det kanske inte som originalfilen. Reverse sample @@ -607,7 +607,7 @@ If you're interested in translating LMMS in another language or want to imp Gain: - Volym: + Förstärkning: RATIO @@ -626,7 +626,7 @@ If you're interested in translating LMMS in another language or want to imp Gain - Volym + Förstärkning Ratio @@ -649,7 +649,7 @@ If you're interested in translating LMMS in another language or want to imp Input Gain: - Input Volym: + Input Förstärkning: NOIS @@ -661,7 +661,7 @@ If you're interested in translating LMMS in another language or want to imp Output Gain: - Output Volym + Output Förstärkning CLIP From fccc36113c003363f66ae36c5e3d2cd1d90524f2 Mon Sep 17 00:00:00 2001 From: Spekular Date: Sun, 25 Jan 2015 16:10:22 +0100 Subject: [PATCH 033/133] Update sv.ts --- data/locale/sv.ts | 54 +++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/data/locale/sv.ts b/data/locale/sv.ts index d1772edf3..9950aed37 100644 --- a/data/locale/sv.ts +++ b/data/locale/sv.ts @@ -55,7 +55,7 @@ If you're interested in translating LMMS in another language or want to imp Contributors ordered by number of commits: - Utvecklare ordnade efter mängd bidrag: + Medverkande, ordnade efter mängd bidrag: @@ -147,7 +147,7 @@ If you're interested in translating LMMS in another language or want to imp With this knob you can set the amplify ratio. When you set a value of 100% your sample isn't changed. Otherwise it will be amplified up or down (your actual sample-file isn't touched!) - Med detta vred ställer du in förstärkningen. Vid 100% blir det ingen skillnad. Annars blir din ljudfil mer eller mindre högljudd, men källfilen förändras inte. + Med detta vred ställer du in förstärkningen. Vid 100% blir det ingen skillnad. Annars blir din ljudfil mer eller mindre högljudd, men originalfilen förändras inte. Startpoint: @@ -206,7 +206,7 @@ If you're interested in translating LMMS in another language or want to imp AudioFileProcessorWaveView Sample length: - + Ljudfilens lengd: @@ -1468,7 +1468,7 @@ Right clicking will bring up a context menu where you can change the order in wh Click here for a user-defined wave. Afterwards, drag an according sample-file onto the LFO graph. - + Klicka här för att använda en annan vågform. Dra sedan en ljudfil till LFO grafen FREQ x 100 @@ -1504,7 +1504,7 @@ Right clicking will bring up a context menu where you can change the order in wh Drag a sample from somewhere and drop it in this window. - + Dra en ljudfil till det här fönstret Click here for random wave. @@ -1958,11 +1958,11 @@ Please make sure you have write-permission to the file and the directory contain Loading sample - + Laddar ljudfil Please wait, loading sample for preview... - + Ljudfilen laddas för förhandsvisning... --- Factory files --- @@ -3559,19 +3559,19 @@ Please visit http://lmms.sf.net/wiki for documentation on LMMS. My Samples - + Mina Ljudfiler My Presets - + Mina Presets My Home - + Mit Hem My Computer - + Min Dator Root Directory @@ -3579,15 +3579,15 @@ Please visit http://lmms.sf.net/wiki for documentation on LMMS. &File - + &Fil &Recently Opened Projects - + &Nyligen Öppnade Project Save as New &Version - + Spara som ny &Version E&xport Tracks... @@ -3599,15 +3599,15 @@ Please visit http://lmms.sf.net/wiki for documentation on LMMS. What's This? - + Vad är det här? Open Project - + Öppna Project Save Project - + SparaProject @@ -5323,7 +5323,7 @@ Reason: "%2" SampleTrack Sample track - + Ljudfil spår Volume @@ -5748,7 +5748,7 @@ Latency: %2 ms Add sample-track - + Lägg til ljudfil-spår Add automation-track @@ -6621,7 +6621,7 @@ Se till att du har läsningsrättigheter för filen och katalogen som innehålle Click to load a waveform from a sample file - + Klicka för att ladda in en vågform från en ljudfil Phase left @@ -6802,7 +6802,7 @@ Se till att du har läsningsrättigheter för filen och katalogen som innehålle audioFileProcessor Reverse sample - + Spela baklänges Amplify @@ -6810,11 +6810,11 @@ Se till att du har läsningsrättigheter för filen och katalogen som innehålle Start of sample - + Start på ljudfil End of sample - + Slut på ljudfil Stutter @@ -6846,21 +6846,21 @@ Se till att du har läsningsrättigheter för filen och katalogen som innehålle Sample not found: %1 - + Ljudfil hittades inte: %1 bitInvader Samplelength - + Ljudfilslängd bitInvaderView Sample Length - + Ljudfilens längd Sine wave @@ -6868,7 +6868,7 @@ Se till att du har läsningsrättigheter för filen och katalogen som innehålle Triangle wave - triganelvåg + Triganelvåg Saw wave From e51da26a1a657bba8f13f46c02c077440c53b9fa Mon Sep 17 00:00:00 2001 From: Dave French Date: Mon, 26 Jan 2015 22:23:19 +0000 Subject: [PATCH 034/133] Automation editior undo --- src/gui/editors/AutomationEditor.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/editors/AutomationEditor.cpp b/src/gui/editors/AutomationEditor.cpp index bde69e950..7c4b77dbf 100644 --- a/src/gui/editors/AutomationEditor.cpp +++ b/src/gui/editors/AutomationEditor.cpp @@ -447,7 +447,6 @@ void AutomationEditor::mousePressEvent( QMouseEvent* mouseEvent ) { return; } - if( mouseEvent->y() > TOP_MARGIN ) { float level = getLevel( mouseEvent->y() ); @@ -493,6 +492,7 @@ void AutomationEditor::mousePressEvent( QMouseEvent* mouseEvent ) if( mouseEvent->button() == Qt::LeftButton && m_editMode == DRAW ) { + m_pattern->addJournalCheckPoint(); // Connect the dots if( mouseEvent->modifiers() & Qt::ShiftModifier ) { @@ -537,6 +537,7 @@ void AutomationEditor::mousePressEvent( QMouseEvent* mouseEvent ) m_editMode == DRAW ) || m_editMode == ERASE ) { + m_pattern->addJournalCheckPoint(); // erase single value if( it != time_map.end() ) { @@ -566,6 +567,7 @@ void AutomationEditor::mousePressEvent( QMouseEvent* mouseEvent ) else if( mouseEvent->button() == Qt::LeftButton && m_editMode == MOVE ) { + m_pattern->addJournalCheckPoint(); // move selection (including selected values) // save position where move-process began @@ -1660,6 +1662,7 @@ void AutomationEditor::setProgressionType(AutomationPattern::ProgressionTypes ty { if (validPattern()) { + m_pattern->addJournalCheckPoint(); QMutexLocker m(&m_patternMutex); m_pattern->setProgressionType(type); Engine::getSong()->setModified(); @@ -1799,6 +1802,7 @@ void AutomationEditor::cutSelectedValues() return; } + m_pattern->addJournalCheckPoint(); m_valuesToCopy.clear(); timeMap selected_values; @@ -1828,6 +1832,7 @@ void AutomationEditor::pasteValues() QMutexLocker m( &m_patternMutex ); if( validPattern() && !m_valuesToCopy.isEmpty() ) { + m_pattern->addJournalCheckPoint(); for( timeMap::iterator it = m_valuesToCopy.begin(); it != m_valuesToCopy.end(); ++it ) { @@ -1854,6 +1859,7 @@ void AutomationEditor::deleteSelectedValues() return; } + m_pattern->addJournalCheckPoint(); timeMap selected_values; getSelectedValues( selected_values ); From a30c32f8d84fbc516b25eb34a5895ab38989609d Mon Sep 17 00:00:00 2001 From: Dave French Date: Tue, 27 Jan 2015 00:11:23 +0000 Subject: [PATCH 035/133] Undo of TCO changes in song editor --- src/core/Track.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/Track.cpp b/src/core/Track.cpp index 426676f0e..2d0f80c5f 100644 --- a/src/core/Track.cpp +++ b/src/core/Track.cpp @@ -1436,6 +1436,7 @@ void TrackContentWidget::mousePressEvent( QMouseEvent * _me ) else if( _me->button() == Qt::LeftButton && !m_trackView->trackContainerView()->fixedTCOs() ) { + getTrack()->addJournalCheckPoint(); const MidiTime pos = getPosition( _me->x() ).getTact() * MidiTime::ticksPerTact(); TrackContentObject * tco = getTrack()->createTCO( pos ); From 57460c91c3802196c928521457589c3a37a3060b Mon Sep 17 00:00:00 2001 From: Dave French Date: Tue, 27 Jan 2015 00:28:40 +0000 Subject: [PATCH 036/133] bb patern --- src/tracks/Pattern.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tracks/Pattern.cpp b/src/tracks/Pattern.cpp index c39fbdbcd..c348f50b8 100644 --- a/src/tracks/Pattern.cpp +++ b/src/tracks/Pattern.cpp @@ -838,6 +838,7 @@ void PatternView::mousePressEvent( QMouseEvent * _me ) } else // note at step found { + m_pat->addJournalCheckPoint(); if( n->length() < 0 ) { n->setLength( 0 ); // set note as enabled beat note From 56635c1fcf0d6fd2d13c4f0403fa1e0e0e9a6d22 Mon Sep 17 00:00:00 2001 From: Dave French Date: Wed, 28 Jan 2015 06:35:52 +0000 Subject: [PATCH 037/133] Proposed fix for 1695 Cannot save templates --- src/gui/MainWindow.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index cccc7bd39..b40674551 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -830,8 +830,13 @@ bool MainWindow::saveProjectAs() if( sfd.exec () == FileDialog::Accepted && !sfd.selectedFiles().isEmpty() && sfd.selectedFiles()[0] != "" ) { + QString fname = sfd.selectedFiles()[0] ; + if( sfd.selectedNameFilter().contains( "(*.mpt)" ) ) + { + fname += ".mpt"; + } Engine::getSong()->guiSaveProjectAs( - sfd.selectedFiles()[0] ); + fname ); return( true ); } return( false ); From 7c0ab622f1a930172a86e940ccae020dd5be9aca Mon Sep 17 00:00:00 2001 From: Dave French Date: Wed, 28 Jan 2015 12:16:21 +0000 Subject: [PATCH 038/133] Proposed fix for 1595 Instrument track activity LED lights when muted --- include/FadeButton.h | 1 + include/InstrumentTrack.h | 1 + src/gui/widgets/FadeButton.cpp | 5 +++++ src/tracks/InstrumentTrack.cpp | 15 +++++++++++++++ 4 files changed, 22 insertions(+) diff --git a/include/FadeButton.h b/include/FadeButton.h index 6e7371f9f..4f05b3491 100644 --- a/include/FadeButton.h +++ b/include/FadeButton.h @@ -39,6 +39,7 @@ public: _activated_color, QWidget * _parent ); virtual ~FadeButton(); + void setActiveColor( const QColor & activated_color ); public slots: diff --git a/include/InstrumentTrack.h b/include/InstrumentTrack.h index 16536c081..85a19c3de 100644 --- a/include/InstrumentTrack.h +++ b/include/InstrumentTrack.h @@ -225,6 +225,7 @@ protected slots: void updateBaseNote(); void updatePitch(); void updatePitchRange(); + void muteHasChanged(); private: diff --git a/src/gui/widgets/FadeButton.cpp b/src/gui/widgets/FadeButton.cpp index 3495ae959..4fea14f97 100644 --- a/src/gui/widgets/FadeButton.cpp +++ b/src/gui/widgets/FadeButton.cpp @@ -55,6 +55,11 @@ FadeButton::~FadeButton() { } +void FadeButton::setActiveColor( const QColor & activated_color ) +{ + m_activatedColor = activated_color; +} + diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index cd598529e..a527e4300 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -124,6 +124,7 @@ InstrumentTrack::InstrumentTrack( TrackContainer* tc ) : connect( &m_baseNoteModel, SIGNAL( dataChanged() ), this, SLOT( updateBaseNote() ) ); connect( &m_pitchModel, SIGNAL( dataChanged() ), this, SLOT( updatePitch() ) ); connect( &m_pitchRangeModel, SIGNAL( dataChanged() ), this, SLOT( updatePitchRange() ) ); + connect( &m_mutedModel, SIGNAL( dataChanged() ), this, SLOT( muteHasChanged() ) ); m_effectChannelModel.setRange( 0, Engine::fxMixer()->numChannels()-1, 1); @@ -136,6 +137,7 @@ InstrumentTrack::InstrumentTrack( TrackContainer* tc ) : setName( tr( "Default preset" ) ); + } @@ -549,6 +551,19 @@ void InstrumentTrack::updatePitchRange() processOutEvent( MidiEvent( MidiControlChange, midiPort()->realOutputChannel(), MidiControllerDataEntry, midiPitchRange() ) ); } +void InstrumentTrack::muteHasChanged() +{ + if( m_mutedModel.value() ) + { + m_fb->setActiveColor( QColor( "red" ) ); + } else + { + m_fb->setActiveColor( QApplication::palette().color( QPalette::Active, + QPalette::BrightText ) ); + } + +} + From 9fee116fa7886160ba1f42002be46a853d4198f1 Mon Sep 17 00:00:00 2001 From: Dave French Date: Wed, 28 Jan 2015 12:21:57 +0000 Subject: [PATCH 039/133] 1595 removed accidental blank line --- src/tracks/InstrumentTrack.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index a527e4300..6d5a3056d 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -137,7 +137,6 @@ InstrumentTrack::InstrumentTrack( TrackContainer* tc ) : setName( tr( "Default preset" ) ); - } From f9eb128b4620e17115472883a24efc50b7707f38 Mon Sep 17 00:00:00 2001 From: Dave French Date: Wed, 28 Jan 2015 13:39:35 +0000 Subject: [PATCH 040/133] Proposed fix for 1692 Missing CLI option for rendering --- src/core/main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/main.cpp b/src/core/main.cpp index 2502058c2..dd129a096 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -191,6 +191,7 @@ int main( int argc, char * * argv ) "-x, --oversampling specify oversampling\n" " possible values: 1, 2, 4, 8\n" " default: 2\n" + "-32, --float 32bit float bit depth\n" "-u, --upgrade [out] upgrade file and save as \n" " standard out is used if no output file is specifed\n" "-d, --dump dump XML of compressed file \n" @@ -296,6 +297,12 @@ int main( int argc, char * * argv ) } ++i; } + else if ( argc > i && + ( QString( argv[i] ) =="--float") || + QString( argv[i] ) == "-32" ) + { + os.depth = ProjectRenderer::Depth_32Bit; + } else if( argc > i && ( QString( argv[i] ) == "--interpolation" || QString( argv[i] ) == "-i" ) ) From 406bc40ddd3c9a069d93671712ee82d350a0ad07 Mon Sep 17 00:00:00 2001 From: Dave French Date: Wed, 28 Jan 2015 17:06:19 +0000 Subject: [PATCH 041/133] fix 1692 reformat conditional statement to be consistant --- src/core/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/main.cpp b/src/core/main.cpp index dd129a096..6bdd1e3c9 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -298,8 +298,8 @@ int main( int argc, char * * argv ) ++i; } else if ( argc > i && - ( QString( argv[i] ) =="--float") || - QString( argv[i] ) == "-32" ) + ( QString( argv[i] ) =="--float" || + QString( argv[i] ) == "-32" ) ) { os.depth = ProjectRenderer::Depth_32Bit; } From fa6dd6da8b559b61f57e2f304f37fd3b4a70b905 Mon Sep 17 00:00:00 2001 From: Dave French Date: Wed, 28 Jan 2015 22:12:59 +0000 Subject: [PATCH 042/133] Change color of muted activity indicator from red to grey --- src/tracks/InstrumentTrack.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index 6d5a3056d..f6168801d 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -554,7 +554,7 @@ void InstrumentTrack::muteHasChanged() { if( m_mutedModel.value() ) { - m_fb->setActiveColor( QColor( "red" ) ); + m_fb->setActiveColor( QColor( 0x282828 ) ); } else { m_fb->setActiveColor( QApplication::palette().color( QPalette::Active, From c02f043b3f5e64ef4b67a76b5e4be5c8844ad6a2 Mon Sep 17 00:00:00 2001 From: Dave French Date: Thu, 29 Jan 2015 00:27:30 +0000 Subject: [PATCH 043/133] Changed color of InstrumentTrack activity indicators mute color to use the color defined in style.css as highlight --- src/tracks/InstrumentTrack.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index f6168801d..fc2035669 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -554,7 +554,8 @@ void InstrumentTrack::muteHasChanged() { if( m_mutedModel.value() ) { - m_fb->setActiveColor( QColor( 0x282828 ) ); + m_fb->setActiveColor( QApplication::palette().color( QPalette::Active, + QPalette::Highlight ) ); } else { m_fb->setActiveColor( QApplication::palette().color( QPalette::Active, From 968d0215dfebf05563abb340becff3507c329712 Mon Sep 17 00:00:00 2001 From: Dave French Date: Thu, 29 Jan 2015 09:49:20 +0000 Subject: [PATCH 044/133] Moved Setting of activity indicator color from InstrumentTrack to InstrumentTrackView --- include/InstrumentTrack.h | 2 +- src/tracks/InstrumentTrack.cpp | 32 +++++++++++++++++--------------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/include/InstrumentTrack.h b/include/InstrumentTrack.h index 85a19c3de..de5671514 100644 --- a/include/InstrumentTrack.h +++ b/include/InstrumentTrack.h @@ -225,7 +225,6 @@ protected slots: void updateBaseNote(); void updatePitch(); void updatePitchRange(); - void muteHasChanged(); private: @@ -321,6 +320,7 @@ private slots: void midiInSelected(); void midiOutSelected(); void midiConfigChanged(); + void muteHasChanged(); private: diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index fc2035669..5302658bd 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -124,7 +124,6 @@ InstrumentTrack::InstrumentTrack( TrackContainer* tc ) : connect( &m_baseNoteModel, SIGNAL( dataChanged() ), this, SLOT( updateBaseNote() ) ); connect( &m_pitchModel, SIGNAL( dataChanged() ), this, SLOT( updatePitch() ) ); connect( &m_pitchRangeModel, SIGNAL( dataChanged() ), this, SLOT( updatePitchRange() ) ); - connect( &m_mutedModel, SIGNAL( dataChanged() ), this, SLOT( muteHasChanged() ) ); m_effectChannelModel.setRange( 0, Engine::fxMixer()->numChannels()-1, 1); @@ -550,20 +549,6 @@ void InstrumentTrack::updatePitchRange() processOutEvent( MidiEvent( MidiControlChange, midiPort()->realOutputChannel(), MidiControllerDataEntry, midiPitchRange() ) ); } -void InstrumentTrack::muteHasChanged() -{ - if( m_mutedModel.value() ) - { - m_fb->setActiveColor( QApplication::palette().color( QPalette::Active, - QPalette::Highlight ) ); - } else - { - m_fb->setActiveColor( QApplication::palette().color( QPalette::Active, - QPalette::BrightText ) ); - } - -} - @@ -941,6 +926,7 @@ InstrumentTrackView::InstrumentTrackView( InstrumentTrack * _it, TrackContainerV connect( m_activityIndicator, SIGNAL( released() ), this, SLOT( activityIndicatorReleased() ) ); _it->setIndicator( m_activityIndicator ); + connect( &_it->m_mutedModel, SIGNAL( dataChanged() ), this, SLOT( muteHasChanged() ) ); setModel( _it ); } @@ -1145,6 +1131,22 @@ void InstrumentTrackView::midiConfigChanged() +void InstrumentTrackView::muteHasChanged() +{ + if(model()->m_mutedModel.value() ) + { + m_activityIndicator->setActiveColor( QApplication::palette().color( QPalette::Active, + QPalette::Highlight ) ); + } else + { + m_activityIndicator->setActiveColor( QApplication::palette().color( QPalette::Active, + QPalette::BrightText ) ); + } +} + + + + class fxLineLcdSpinBox : public LcdSpinBox From 5ce1bd874dcc6b09f5a60040f37c07c7eae7d400 Mon Sep 17 00:00:00 2001 From: Dave French Date: Thu, 29 Jan 2015 10:13:25 +0000 Subject: [PATCH 045/133] renamed muteHasChanged to muteChanged in InstrumentTrackView --- include/InstrumentTrack.h | 2 +- src/tracks/InstrumentTrack.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/InstrumentTrack.h b/include/InstrumentTrack.h index de5671514..ffbb61ccc 100644 --- a/include/InstrumentTrack.h +++ b/include/InstrumentTrack.h @@ -320,7 +320,7 @@ private slots: void midiInSelected(); void midiOutSelected(); void midiConfigChanged(); - void muteHasChanged(); + void muteChanged(); private: diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index 5302658bd..e9317dc52 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -926,7 +926,7 @@ InstrumentTrackView::InstrumentTrackView( InstrumentTrack * _it, TrackContainerV connect( m_activityIndicator, SIGNAL( released() ), this, SLOT( activityIndicatorReleased() ) ); _it->setIndicator( m_activityIndicator ); - connect( &_it->m_mutedModel, SIGNAL( dataChanged() ), this, SLOT( muteHasChanged() ) ); + connect( &_it->m_mutedModel, SIGNAL( dataChanged() ), this, SLOT( muteChanged() ) ); setModel( _it ); } @@ -1131,7 +1131,7 @@ void InstrumentTrackView::midiConfigChanged() -void InstrumentTrackView::muteHasChanged() +void InstrumentTrackView::muteChanged() { if(model()->m_mutedModel.value() ) { From efa75b0151377e8ce6d13d5bdb79cbff86236c7f Mon Sep 17 00:00:00 2001 From: Dave French Date: Thu, 29 Jan 2015 10:38:19 +0000 Subject: [PATCH 046/133] Checks for .mpt extension, before adding extension when saving project templates --- src/gui/MainWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index b40674551..b8ddd6071 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -831,7 +831,7 @@ bool MainWindow::saveProjectAs() !sfd.selectedFiles().isEmpty() && sfd.selectedFiles()[0] != "" ) { QString fname = sfd.selectedFiles()[0] ; - if( sfd.selectedNameFilter().contains( "(*.mpt)" ) ) + if( sfd.selectedNameFilter().contains( "(*.mpt)" ) && !sfd.selectedFiles()[0].endsWith( ".mpt" ) ) { fname += ".mpt"; } From 1ebbe31fae4bec778c56cfe5e4a1396d97b0d457 Mon Sep 17 00:00:00 2001 From: Dave French Date: Thu, 29 Jan 2015 11:36:21 +0000 Subject: [PATCH 047/133] Changed commandline flag to render in 32bit float from -32 to -a --- src/core/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/main.cpp b/src/core/main.cpp index 6bdd1e3c9..a489323fb 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -191,7 +191,7 @@ int main( int argc, char * * argv ) "-x, --oversampling specify oversampling\n" " possible values: 1, 2, 4, 8\n" " default: 2\n" - "-32, --float 32bit float bit depth\n" + "-a, --float 32bit float bit depth\n" "-u, --upgrade [out] upgrade file and save as \n" " standard out is used if no output file is specifed\n" "-d, --dump dump XML of compressed file \n" @@ -299,7 +299,7 @@ int main( int argc, char * * argv ) } else if ( argc > i && ( QString( argv[i] ) =="--float" || - QString( argv[i] ) == "-32" ) ) + QString( argv[i] ) == "-a" ) ) { os.depth = ProjectRenderer::Depth_32Bit; } From 27762a94378b690282c22f380d201dccfb6a2aa2 Mon Sep 17 00:00:00 2001 From: Amadeus Folego Date: Thu, 29 Jan 2015 20:04:30 -0200 Subject: [PATCH 048/133] Fix Shift+Resize for single note should be sticky --- src/gui/editors/PianoRoll.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index c14b6b930..92f7f0f1e 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -2460,6 +2460,8 @@ void PianoRoll::dragNotes( int x, int y, bool alt, bool shift, bool ctrl ) // will be our iterator in the following loop NoteVector::ConstIterator it = notes.begin(); + + int sNotes = selectionCount(); while( it != notes.end() ) { Note *note = *it; @@ -2468,8 +2470,9 @@ void PianoRoll::dragNotes( int x, int y, bool alt, bool shift, bool ctrl ) // When resizing notes: // If shift is pressed we resize and rearrange only the selected notes // If shift + ctrl then we also rearrange all posterior notes (sticky) + // If shift is pressed but only one note is selected, apply sticky if( m_action == ActionResizeNote && shift && - ( note->selected() || ctrl ) ) + ( note->selected() || ctrl || sNotes == 1 ) ) { int shifted_pos = note->oldPos().getTicks() + shift_offset; if( shifted_pos && pos == shift_ref_pos ) From b1f0dd309992e50b894a5730b589e2e409775bfe Mon Sep 17 00:00:00 2001 From: Spekular Date: Fri, 30 Jan 2015 08:39:11 +0100 Subject: [PATCH 049/133] ljud fil -> ljudfil & dialogvisas -> dialog visas --- data/locale/sv.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/locale/sv.ts b/data/locale/sv.ts index 9950aed37..c4cd327a7 100644 --- a/data/locale/sv.ts +++ b/data/locale/sv.ts @@ -131,7 +131,7 @@ If you're interested in translating LMMS in another language or want to imp Click here, if you want to open another audio-file. A dialog will appear where you can select your file. Settings like looping-mode, start and end-points, amplify-value, and so on are not reset. So, it may not sound like the original sample. - Klicka här för att öppna en anna ljud fil. En dialogvisas där du väljer din fil. Inställningar som looping, start och slutpunkter, amplifiering och sådant omställs inte. Därför låter det kanske inte som originalfilen. + Klicka här för att öppna en annan ljudfil. En dialog visas där du väljer din fil. Inställningar som looping, start och slutpunkter, amplifiering och sådant omställs inte. Därför låter det kanske inte som originalfilen. Reverse sample From fc11a09b0b80fad699af513217732f12634dbfd4 Mon Sep 17 00:00:00 2001 From: Spekular Date: Fri, 30 Jan 2015 10:38:16 +0100 Subject: [PATCH 050/133] Update Automation translations --- data/locale/sv.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/data/locale/sv.ts b/data/locale/sv.ts index c4cd327a7..12242012c 100644 --- a/data/locale/sv.ts +++ b/data/locale/sv.ts @@ -9,7 +9,7 @@ Version %1 (%2/%3, Qt %4, %5) - + Version %1 (%2/%3, Qt %4, %5) About @@ -21,7 +21,7 @@ Authors - Utvecklare + Medverkande Translation @@ -316,7 +316,7 @@ If you're interested in translating LMMS in another language or want to imp Remove song-global automation - Ta bort gloabal automation + Ta bort global automation Remove all linked controls @@ -327,7 +327,7 @@ If you're interested in translating LMMS in another language or want to imp AutomationEditor Please open an automation pattern with the context menu of a control! - Öppna ett mönster ifrån en kontrollers kontext meny! + Öppna ett automationsmönster ifrån en kontrollers kontext meny! Values copied @@ -450,7 +450,7 @@ If you're interested in translating LMMS in another language or want to imp Automation Editor - no pattern - Redigera Automation - inget mönster + Redigera Automation - inget automationsmönster Automation Editor - %1 @@ -472,11 +472,11 @@ If you're interested in translating LMMS in another language or want to imp AutomationPatternView double-click to open this pattern in automation editor - dubbelklicka för att öppna det här mönstret för redigering + dubbelklicka för att öppna det här automationsmönstret för redigering Open in Automation editor - Öppna för att redigera + Öppna för att redigera automationsmönster Clear @@ -515,7 +515,7 @@ If you're interested in translating LMMS in another language or want to imp AutomationTrack Automation track - Automation spår + Automationsspår @@ -546,7 +546,7 @@ If you're interested in translating LMMS in another language or want to imp Add automation-track - Lägg till automationsmönster + Lägg till automationsspår Remove steps From 06cb85b771cc9936279ce330b60caa1a774f3bd2 Mon Sep 17 00:00:00 2001 From: Amadeus Folego Date: Wed, 14 Jan 2015 16:46:36 -0200 Subject: [PATCH 051/133] Move FX assignment/creation logic to InsTrackView --- include/InstrumentTrack.h | 8 ++++++++ include/Track.h | 2 -- src/core/Track.cpp | 27 ++------------------------- src/tracks/InstrumentTrack.cpp | 24 ++++++++++++++++++++++++ 4 files changed, 34 insertions(+), 27 deletions(-) diff --git a/include/InstrumentTrack.h b/include/InstrumentTrack.h index ffbb61ccc..f172e6094 100644 --- a/include/InstrumentTrack.h +++ b/include/InstrumentTrack.h @@ -322,6 +322,9 @@ private slots: void midiConfigChanged(); void muteChanged(); + void assignFxLine( int channelIndex ); + void createFxLine(); + private: InstrumentTrackWindow * m_window; @@ -375,6 +378,11 @@ public: void setInstrumentTrackView( InstrumentTrackView * _tv ); + InstrumentTrackView * instrumentTrackView() + { + return m_itv; + } + PianoView * pianoView() { return m_pianoView; diff --git a/include/Track.h b/include/Track.h index b766b6056..91aadfde2 100644 --- a/include/Track.h +++ b/include/Track.h @@ -391,8 +391,6 @@ private slots: void recordingOn(); void recordingOff(); void clearTrack(); - void assignFxLine( int channelIndex ); - void createFxLine(); private: static QPixmap * s_grip; diff --git a/src/core/Track.cpp b/src/core/Track.cpp index a6f98e1df..524bc3837 100644 --- a/src/core/Track.cpp +++ b/src/core/Track.cpp @@ -1711,29 +1711,6 @@ void TrackOperationsWidget::clearTrack() -/*! \brief Create and assign a new FX Channel for this track */ -void TrackOperationsWidget::createFxLine() -{ - int channelIndex = gui->fxMixerView()->addNewChannel(); - - Engine::fxMixer()->effectChannel( channelIndex )->m_name = m_trackView->getTrack()->name(); - - assignFxLine(channelIndex); -} - - - -/*! \brief Assign a specific FX Channel for this track */ -void TrackOperationsWidget::assignFxLine(int channelIndex) -{ - Track * track = m_trackView->getTrack(); - dynamic_cast( track )->effectChannelModel()->setValue( channelIndex ); - - gui->fxMixerView()->setCurrentFxLine( channelIndex ); -} - - - /*! \brief Remove this track from the track list * */ @@ -1777,7 +1754,7 @@ void TrackOperationsWidget::updateMenu() QMenu * fxMenu = new QMenu( tr( "FX %1: %2" ).arg( channelIndex ).arg( fxChannel->m_name ), to_menu ); QSignalMapper * fxMenuSignalMapper = new QSignalMapper(this); - fxMenu->addAction("Assign to new FX Channel" , this, SLOT( createFxLine() ) ); + fxMenu->addAction( tr( "Assign to new FX Channel" ), trackView, SLOT( createFxLine() ) ); fxMenu->addSeparator(); @@ -1794,7 +1771,7 @@ void TrackOperationsWidget::updateMenu() } to_menu->addMenu(fxMenu); - connect(fxMenuSignalMapper, SIGNAL(mapped(int)), this, SLOT(assignFxLine(int))); + connect(fxMenuSignalMapper, SIGNAL(mapped(int)), trackView, SLOT(assignFxLine(int))); to_menu->addSeparator(); to_menu->addMenu( trackView->midiMenu() ); diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index e9317dc52..a4bef2828 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -963,6 +963,30 @@ InstrumentTrackWindow * InstrumentTrackView::topLevelInstrumentTrackWindow() + +/*! \brief Create and assign a new FX Channel for this track */ +void InstrumentTrackView::createFxLine() +{ + int channelIndex = gui->fxMixerView()->addNewChannel(); + + Engine::fxMixer()->effectChannel( channelIndex )->m_name = getTrack()->name(); + + assignFxLine(channelIndex); +} + + + + +/*! \brief Assign a specific FX Channel for this track */ +void InstrumentTrackView::assignFxLine(int channelIndex) +{ + model()->effectChannelModel()->setValue( channelIndex ); + + gui->fxMixerView()->setCurrentFxLine( channelIndex ); +} + + + // TODO: Add windows to free list on freeInstrumentTrackWindow. // But, don't NULL m_window or disconnect signals. This will allow windows // that are being show/hidden frequently to stay connected. From c99e47f5816e802c45d8887be4684333ade2fb44 Mon Sep 17 00:00:00 2001 From: Amadeus Folego Date: Wed, 14 Jan 2015 16:50:25 -0200 Subject: [PATCH 052/133] Add "Assign to new FX Channel" action to FXSpinBox Fix #604 #921 --- include/InstrumentTrack.h | 6 +++- src/core/Track.cpp | 25 +------------- src/tracks/InstrumentTrack.cpp | 63 ++++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 25 deletions(-) diff --git a/include/InstrumentTrack.h b/include/InstrumentTrack.h index f172e6094..8c8c963fa 100644 --- a/include/InstrumentTrack.h +++ b/include/InstrumentTrack.h @@ -306,6 +306,9 @@ public: static void cleanupWindowCache(); + // Create a menu for assigning/creating channels for this track + QMenu * createFxMenu( QString title, QString newFxLabel ); + protected: virtual void dragEnterEvent( QDragEnterEvent * _dee ); @@ -378,11 +381,12 @@ public: void setInstrumentTrackView( InstrumentTrackView * _tv ); - InstrumentTrackView * instrumentTrackView() + InstrumentTrackView *instrumentTrackView() { return m_itv; } + PianoView * pianoView() { return m_pianoView; diff --git a/src/core/Track.cpp b/src/core/Track.cpp index 524bc3837..1eb16776d 100644 --- a/src/core/Track.cpp +++ b/src/core/Track.cpp @@ -1747,31 +1747,8 @@ void TrackOperationsWidget::updateMenu() } if( InstrumentTrackView * trackView = dynamic_cast( m_trackView ) ) { - int channelIndex = trackView->model()->effectChannelModel()->value(); - - FxChannel * fxChannel = Engine::fxMixer()->effectChannel( channelIndex ); - - QMenu * fxMenu = new QMenu( tr( "FX %1: %2" ).arg( channelIndex ).arg( fxChannel->m_name ), to_menu ); - QSignalMapper * fxMenuSignalMapper = new QSignalMapper(this); - - fxMenu->addAction( tr( "Assign to new FX Channel" ), trackView, SLOT( createFxLine() ) ); - fxMenu->addSeparator(); - - - for (int i = 0; i < Engine::fxMixer()->fxChannels().size(); ++i) - { - FxChannel * currentChannel = Engine::fxMixer()->fxChannels()[i]; - - if ( currentChannel != fxChannel ) - { - QString label = tr( "FX %1: %2" ).arg( currentChannel->m_channelIndex ).arg( currentChannel->m_name ); - QAction * action = fxMenu->addAction( label, fxMenuSignalMapper, SLOT( map() ) ); - fxMenuSignalMapper->setMapping(action, currentChannel->m_channelIndex); - } - } - + QMenu *fxMenu = trackView->createFxMenu( tr( "FX %1: %2" ), tr( "Assign to new FX Channel" )); to_menu->addMenu(fxMenu); - connect(fxMenuSignalMapper, SIGNAL(mapped(int)), trackView, SLOT(assignFxLine(int))); to_menu->addSeparator(); to_menu->addMenu( trackView->midiMenu() ); diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index a4bef2828..7fcf2b0dc 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -36,12 +36,14 @@ #include #include #include +#include #include "FileDialog.h" #include "InstrumentTrack.h" #include "AudioPort.h" #include "AutomationPattern.h" #include "BBTrack.h" +#include "CaptionMenu.h" #include "ConfigManager.h" #include "ControllerConnection.h" #include "debug.h" @@ -1171,6 +1173,43 @@ void InstrumentTrackView::muteChanged() +QMenu * InstrumentTrackView::createFxMenu(QString title, QString newFxLabel) +{ + int channelIndex = model()->effectChannelModel()->value(); + + FxChannel *fxChannel = Engine::fxMixer()->effectChannel( channelIndex ); + + // If title allows interpolation, pass channel index and name + if ( title.contains( "%2" ) ) + { + title = title.arg( channelIndex ).arg( fxChannel->m_name ); + } + + QMenu *fxMenu = new QMenu( title ); + + QSignalMapper * fxMenuSignalMapper = new QSignalMapper(fxMenu); + + fxMenu->addAction( newFxLabel, this, SLOT( createFxLine() ) ); + fxMenu->addSeparator(); + + for (int i = 0; i < Engine::fxMixer()->fxChannels().size(); ++i) + { + FxChannel * currentChannel = Engine::fxMixer()->fxChannels()[i]; + + if ( currentChannel != fxChannel ) + { + QString label = tr( "FX %1: %2" ).arg( currentChannel->m_channelIndex ).arg( currentChannel->m_name ); + QAction * action = fxMenu->addAction( label, fxMenuSignalMapper, SLOT( map() ) ); + fxMenuSignalMapper->setMapping(action, currentChannel->m_channelIndex); + } + } + + connect(fxMenuSignalMapper, SIGNAL(mapped(int)), this, SLOT(assignFxLine(int))); + + return fxMenu; +} + + class fxLineLcdSpinBox : public LcdSpinBox @@ -1189,6 +1228,30 @@ class fxLineLcdSpinBox : public LcdSpinBox gui->fxMixerView()->setFocus();// set focus to fxMixer window //engine::getFxMixerView()->raise(); } + + virtual void contextMenuEvent( QContextMenuEvent* event ) + { + // for the case, the user clicked right while pressing left mouse- + // button, the context-menu appears while mouse-cursor is still hidden + // and it isn't shown again until user does something which causes + // an QApplication::restoreOverrideCursor()-call... + mouseReleaseEvent( NULL ); + + QPointer contextMenu = new CaptionMenu( model()->displayName(), this ); + + // This condition is here just as a safety check, fxLineLcdSpinBox is aways + // created inside a TabWidget inside an InstrumentTrackWindow + if ( InstrumentTrackWindow* window = dynamic_cast( (QWidget *)this->parent()->parent() ) ) + { + QMenu *fxMenu = window->instrumentTrackView()->createFxMenu( tr( "Assign to:" ), tr( "New FX Channel" ) ); + contextMenu->addMenu( fxMenu ); + + contextMenu->addSeparator(); + } + addDefaultActions( contextMenu ); + contextMenu->exec( QCursor::pos() ); + } + }; From 5504b3fe9c3dad464fdbd1ed1fb9c304fadc00ee Mon Sep 17 00:00:00 2001 From: Spekular Date: Fri, 30 Jan 2015 18:54:32 +0100 Subject: [PATCH 053/133] Remove ' type="unfinished" ' on translated strings Also miscellaneous fixes. --- data/locale/sv.ts | 342 +++++++++++++++++++++++----------------------- 1 file changed, 171 insertions(+), 171 deletions(-) diff --git a/data/locale/sv.ts b/data/locale/sv.ts index 12242012c..85198a1eb 100644 --- a/data/locale/sv.ts +++ b/data/locale/sv.ts @@ -5,27 +5,27 @@ AboutDialog About LMMS - Om LMMS + Om LMMS Version %1 (%2/%3, Qt %4, %5) - Version %1 (%2/%3, Qt %4, %5) + Version %1 (%2/%3, Qt %4, %5) About - Om + Om LMMS - easy music production for everyone - LMMS - enkel musikproduktion för alla + LMMS - enkel musikproduktion för alla Authors - Medverkande + Medverkande Translation - Översättning + Översättning Current language not translated (or native English). @@ -35,11 +35,11 @@ If you're interested in translating LMMS in another language or want to imp License - Licens + Licens Copyright (c) 2004-2014, LMMS developers - Copyright (c) 2004-2014, LMMS utvecklare + Copyright (c) 2004-2014, LMMS utvecklare <html><head/><body><p><a href="http://lmms.io"><span style=" text-decoration: underline; color:#0000ff;">http://lmms.io</span></a></p></body></html> @@ -47,26 +47,26 @@ If you're interested in translating LMMS in another language or want to imp LMMS - LMMS + LMMS Involved - Involverad + Involverad Contributors ordered by number of commits: - Medverkande, ordnade efter mängd bidrag: + Medverkande, ordnade efter mängd bidrag: AmplifierControlDialog VOL - VOL + VOL Volume: - Volym: + Volym: PAN @@ -78,26 +78,26 @@ If you're interested in translating LMMS in another language or want to imp LEFT - VÄNSTER + VÄNSTER Left gain: - Vänster förstärkning: + Vänster förstärkning: RIGHT - HÖGER + HÖGER Right gain: - Höger förstärkning: + Höger förstärkning: AmplifierControls Volume - Volym + Volym Panning @@ -105,571 +105,571 @@ If you're interested in translating LMMS in another language or want to imp Left gain - Vänster förstärkning + Vänster förstärkning Right gain - Höger förstärkning + Höger förstärkning AudioAlsa::setupWidget DEVICE - ENHET + ENHET CHANNELS - KANALER + KANALER AudioFileProcessorView Open other sample - Oppna annan ljudfil + Oppna annan ljudfil Click here, if you want to open another audio-file. A dialog will appear where you can select your file. Settings like looping-mode, start and end-points, amplify-value, and so on are not reset. So, it may not sound like the original sample. - Klicka här för att öppna en annan ljudfil. En dialog visas där du väljer din fil. Inställningar som looping, start och slutpunkter, amplifiering och sådant omställs inte. Därför låter det kanske inte som originalfilen. + Klicka här för att öppna en annan ljudfil. En dialog visas där du väljer din fil. Inställningar som looping, start och slutpunkter, amplifiering och sådant omställs inte. Därför låter det kanske inte som originalfilen. Reverse sample - Spela baklänges + Spela baklänges If you enable this button, the whole sample is reversed. This is useful for cool effects, e.g. a reversed crash. - Den här knappen gör att ljudfilen spelas baklänges. Den kan användas för intressanta effeker t.ex. en baklänges cymbal. + Den här knappen gör att ljudfilen spelas baklänges. Den kan användas för intressanta effeker t.ex. en baklänges cymbal. Amplify: - Förstärkning: + Förstärkning: With this knob you can set the amplify ratio. When you set a value of 100% your sample isn't changed. Otherwise it will be amplified up or down (your actual sample-file isn't touched!) - Med detta vred ställer du in förstärkningen. Vid 100% blir det ingen skillnad. Annars blir din ljudfil mer eller mindre högljudd, men originalfilen förändras inte. + Med detta vred ställer du in förstärkningen. Vid 100% blir det ingen skillnad. Annars blir din ljudfil mer eller mindre högljudd, men originalfilen förändras inte. Startpoint: - Startpunkt: + Startpunkt: Endpoint: - Slutpunkt: + Slutpunkt: Continue sample playback across notes - Forsätt spela ljudfil över noter + Forsätt spela ljudfil över noter Enabling this option makes the sample continue playing across different notes - if you change pitch, or the note length stops before the end of the sample, then the next note played will continue where it left off. To reset the playback to the start of the sample, insert a note at the bottom of the keyboard (< 20 Hz) - Denna inställningen gör att ljudfilen förtsätter spela över noter. Om en not avslutas före ljudfilen är slut fortsätter nästa not där den förra slutade. Om du vill starta från början av ljudfilen innan den spelat färdigt, placera en not på botten av pianot (vid 20Hz) + Denna inställningen gör att ljudfilen förtsätter spela över noter. Om en not avslutas före ljudfilen är slut fortsätter nästa not där den förra slutade. Om du vill starta från början av ljudfilen innan den spelat färdigt, placera en not på botten av pianot (vid 20Hz) Disable loop - Avaktivera looping + Avaktivera looping This button disables looping. The sample plays only once from start to end. - Den här knappen avaktiverar looping.Ljudfilen spelas bara en gång från starttill slut. + Den här knappen avaktiverar looping. Ljudfilen spelas bara en gång från start till slut. Enable loop - Aktivera looping + Aktivera looping This button enables forwards-looping. The sample loops between the end point and the loop point. - Den här knappen aktiverar looping. Ljudfilen loopar mellan slutpunkten och looppunkten. + Den här knappen aktiverar looping. Ljudfilen loopar mellan slutpunkten och looppunkten. This button enables ping-pong-looping. The sample loops backwards and forwards between the end point and the loop point. - Den här knappen aktiverar "ping-pong" looping. Ljudfilen spelar från start till slut, och sen tilbaks, och fortsäter så. + Den här knappen aktiverar "ping-pong" looping. Ljudfilen spelar från start till slut, och sen tilbaks, och fortsäter så. With this knob you can set the point where AudioFileProcessor should begin playing your sample. - Med den här vreden ställer du in vartifrån ljudfilen ska börja spela. + Med den här vreden ställer du in vartifrån ljudfilen ska börja spela. With this knob you can set the point where AudioFileProcessor should stop playing your sample. - Med den här vreden ställer du in vart ljudfilen slutar spela. + Med den här vreden ställer du in vart ljudfilen slutar spela. Loopback point: - Loopback punkt: + Loopback punkt: With this knob you can set the point where the loop starts. - Den här vreden ställer in vart loopen startar. + Den här vreden ställer in vart loopen startar. AudioFileProcessorWaveView Sample length: - Ljudfilens lengd: + Ljudfilens längd: AudioJack JACK client restarted - JACK klienten omstartades + JACK klienten omstartades LMMS was kicked by JACK for some reason. Therefore the JACK backend of LMMS has been restarted. You will have to make manual connections again. - LMMS blev bortkopplat från JACK. LMMS JACK backend omstartades därfor. Du får manuellt koppla om igen. + LMMS blev bortkopplat från JACK. LMMS JACK backend omstartades därfor. Du får manuellt koppla om igen. JACK server down - JACK server nerstängd + JACK server nerstängd The JACK server seems to have been shutdown and starting a new instance failed. Therefore LMMS is unable to proceed. You should save your project and restart JACK and LMMS. - JACK servern stängde av och det gick inte starta en ny. LMMS kan inte fortsätta. Du bör spara ditt projekt och starta om både JACK och LMMS. + JACK servern stängde av och det gick inte starta en ny. LMMS kan inte fortsätta. Du bör spara ditt projekt och starta om både JACK och LMMS. CLIENT-NAME - KLIENT-NAMN + KLIENT-NAMN CHANNELS - KANALER + KANALER AudioOss::setupWidget DEVICE - ENHET + ENHET CHANNELS - KANALER + KANALER AudioPortAudio::setupWidget BACKEND - BACKEND + BACKEND DEVICE - ENHET + ENHET AudioPulseAudio::setupWidget DEVICE - ENHET + ENHET CHANNELS - KANALER + KANALER AudioSdl::setupWidget DEVICE - ENHET + ENHET AutomatableModel &Reset (%1%2) - &Nollställ (%1%2) + &Nollställ (%1%2) &Copy value (%1%2) - Kopiera värder (%1%2) + Kopiera värde (%1%2) &Paste value (%1%2) - &Klistra in värde (%1%2) + &Klistra in värde (%1%2) Edit song-global automation - Redigera global automation + Redigera global automation Connected to %1 - Kopplad till %1 + Kopplad till %1 Connected to controller - Kopplad till controller + Kopplad till controller Edit connection... - Redigera koppling... + Redigera koppling... Remove connection - Ta bort koppling + Ta bort koppling Connect to controller... - Koppla till kontroller... + Koppla till kontroller... Remove song-global automation - Ta bort global automation + Ta bort global automation Remove all linked controls - Ta bort alla kopplade kontroller + Ta bort alla kopplade kontroller AutomationEditor Please open an automation pattern with the context menu of a control! - Öppna ett automationsmönster ifrån en kontrollers kontext meny! + Öppna ett automationsmönster ifrån en kontrollers kontextmeny! Values copied - Värden kopierade + Värden kopierade All selected values were copied to the clipboard. - Alla valda värden blev kopierade till urklipp. + Alla valda värden blev kopierade till urklipp. AutomationEditorWindow Play/pause current pattern (Space) - Spela/pausa aktuellt mönster (mellanslag) + Spela/pausa aktuellt mönster (mellanslag) Click here if you want to play the current pattern. This is useful while editing it. The pattern is automatically looped when the end is reached. - Clicka här för att spela det aktuella mönstret. Det härär hjälpsamt närman redigerar. Mönstret spelas från början igen när de nått sitt slut. + Clicka här för att spela det aktuella mönstret. Det här är hjälpsamt när man redigerar. Mönstret spelas från början igen när de nått sitt slut. Stop playing of current pattern (Space) - Sluta spela aktuellt mönster (mellanslag) + Sluta spela aktuellt mönster (mellanslag) Click here if you want to stop playing of the current pattern. - Klicka här för att stoppa uppspelning av de aktuella mönstret. + Klicka här för att stoppa uppspelning av de aktuella mönstret. Draw mode (Shift+D) - Ritläge (Shift+D) + Ritläge (Shift+D) Erase mode (Shift+E) - Suddläge (Shift+E) + Suddläge (Shift+E) Flip vertically - Spegla vertikalt + Spegla vertikalt Flip horizontally - Spegla horizontellt + Spegla horizontellt Click here and the pattern will be inverted.The points are flipped in the y direction. - Klicka här för att spegla mönstret. Punkterna förflyttas på y-axeln + Klicka här för att spegla mönstret. Punkterna förflyttas på y-axeln Click here and the pattern will be reversed. The points are flipped in the x direction. - Klicka här för att spegla mönstret. Punkterna förflyttas på x-axeln + Klicka här för att spegla mönstret. Punkterna förflyttas på x-axeln Click here and draw-mode will be activated. In this mode you can add and move single values. This is the default mode which is used most of the time. You can also press 'Shift+D' on your keyboard to activate this mode. - Klicka här för att aktivera ritläget. I detta läget kan du lägga till och förflytta individuella värden. Det här är standardläget. Det går också att trycka 'Shift+D' på tangentborded för att aktivera detta läget. + Klicka här för att aktivera ritläget. I detta läget kan du lägga till och förflytta individuella värden. Det här är standardläget. Det går också att trycka 'Shift+D' på tangentborded för att aktivera detta läget. Click here and erase-mode will be activated. In this mode you can erase single values. You can also press 'Shift+E' on your keyboard to activate this mode. - Klicka här för att aktivera suddläget. I detta läget kan du ta bort individuella värden. Det går också att trycka 'Shift+E' på tangentborded för att aktivera detta läget. + Klicka här för att aktivera suddläget. I detta läget kan du ta bort individuella värden. Det går också att trycka 'Shift+E' på tangentborded för att aktivera detta läget. Discrete progression - Diskret talföljd + Diskret talföljd Linear progression - Linjär talföljd + Linjär talföljd Cubic Hermite progression - Cubic Hermite talföljd + Cubic Hermite talföljd Tension value for spline - Spänning i mönstrets spline + Spänning i mönstrets spline A higher tension value may make a smoother curve but overshoot some values. A low tension value will cause the slope of the curve to level off at each control point. - Högre spänning ger en mjuk kurva som ibland missar individuella punkter. Med lägre spänning planar kurvan ut nära punkterna. + Högre spänning ger en mjuk kurva som ibland missar individuella punkter. Med lägre spänning planar kurvan ut nära punkterna. Click here to choose discrete progressions for this automation pattern. The value of the connected object will remain constant between control points and be set immediately to the new value when each control point is reached. - Klicka här för att aktivera diskret talföljd. Värdet är konstant mella kontroll punkter och ändras direkt när en ny kontrollpunkt nås. + Klicka här för att aktivera diskret talföljd. Värdet är konstant mella kontroll punkter och ändras direkt när en ny kontrollpunkt nås. Click here to choose linear progressions for this automation pattern. The value of the connected object will change at a steady rate over time between control points to reach the correct value at each control point without a sudden change. - Klicka här för att aktivera linjär talföljd. Värdet ändras vid en stadig takt mellan kontrollpunkter för att gradvis nå nästa värde. + Klicka här för att aktivera linjär talföljd. Värdet ändras vid en stadig takt mellan kontrollpunkter för att gradvis nå nästa värde. Click here to choose cubic hermite progressions for this automation pattern. The value of the connected object will change in a smooth curve and ease in to the peaks and valleys. - Klicka här för att aktivera cubic hermite talföljd. Värdet följer en mjuk kurva mellan kontrollpunkter. + Klicka här för att aktivera cubic hermite talföljd. Värdet följer en mjuk kurva mellan kontrollpunkter. Cut selected values (Ctrl+X) - Klipp ut valda värden (ctrl+X) + Klipp ut valda värden (Ctrl+X) Copy selected values (Ctrl+C) - Kopiera valda värden (ctrl+C) + Kopiera valda värden (ctrl+C) Paste values from clipboard Ctrl+V) - Klistra värden (Ctrl+V) + Klistra värden (Ctrl+V) Click here and selected values will be cut into the clipboard. You can paste them anywhere in any pattern by clicking on the paste button. - Klicka här för att klippa de valda värderna. Du kan sen klistra dem var som helst genom att klicka på klistra knappen. + Klicka här för att klippa de valda värderna. Du kan sen klistra dem var som helst genom att klicka på klistra knappen. Click here and selected values will be copied into the clipboard. You can paste them anywhere in any pattern by clicking on the paste button. - Klicka här för att kopiera de valda värderna. Du kan sen klistra dem var som helst genom att klicka på klistra knappen. + Klicka här för att kopiera de valda värderna. Du kan sedan klistra dem var som helst genom att klicka på klistra knappen. Click here and the values from the clipboard will be pasted at the first visible measure. - Klicka här för att klistra kopierade värderna vid den första synliga metern. + Klicka här för att klistra kopierade värderna vid den första synliga metern. Tension: - Spänning: + Spänning: Automation Editor - no pattern - Redigera Automation - inget automationsmönster + Redigera Automation - inget automationsmönster Automation Editor - %1 - Redigera Automation - %1 + Redigera Automation - %1 AutomationPattern Drag a control while pressing <Ctrl> - Dra en kontroll samtidigt som du håller <Ctrl> + Dra en kontroll samtidigt som du håller <Ctrl> Model is already connected to this pattern. - Modellen är redan kopplad till detta mönstret. + Modellen är redan kopplad till detta mönstret. AutomationPatternView double-click to open this pattern in automation editor - dubbelklicka för att öppna det här automationsmönstret för redigering + dubbelklicka för att öppna det här automationsmönstret för redigering Open in Automation editor - Öppna för att redigera automationsmönster + Redigera automationsmönster Clear - Rensa + Rensa Reset name - Nollställ namn + Nollställ namn Change name - Byt namn + Byt namn %1 Connections - %1 Kopplingar + %1 Kopplingar Disconnect "%1" - Avkoppla "%1" + Avkoppla "%1" Set/clear record - Set/rensa inspelning + Flip Vertically (Visible) - Spegla Vertikalt (Synligt) + Spegla Vertikalt (Synligt) Flip Horizontally (Visible) - Spegla Horizontellt (Synligt) + Spegla Horizontellt (Synligt) AutomationTrack Automation track - Automationsspår + Automationsspår BBEditor Beat+Bassline Editor - Redigera Trummor+Bas + Redigera Trummor+Bas Play/pause current beat/bassline (Space) - Spela/pause Trummor+Bas + Spela/pause Trummor+Bas Stop playback of current beat/bassline (Space) - Avsluta uppspelning av Trummor+Bas + Avsluta uppspelning av trummor/bas Click here to play the current beat/bassline. The beat/bassline is automatically looped when its end is reached. - Klicka här för att spela Trummor/Bas.Mönstret loopar när det nåt sitt slut. + Klicka här för att spela trummor/bas. Mönstret loopar när det nåt sitt slut. Click here to stop playing of current beat/bassline. - Klicka här för att sluta spela trummor/bas. + Klicka här för att sluta spela trummor/bas. Add beat/bassline - Lägg till trummor/bas + Lägg till trummor/bas Add automation-track - Lägg till automationsspår + Lägg till automationsspår Remove steps - Ta bort steg + Ta bort steg Add steps - Lägg till steg + Lägg till steg BBTCOView Open in Beat+Bassline-Editor - Öppna för att redigera Trummor+Bas + Redigera Trummor+Bas Reset name - Nollställ namn + Nollställ namn Change name - Byt namn + Byt namn Change color - Byt färg + Byt färg Reset color to default - Byt färg till standard + Byt färg till standard BBTrack Beat/Bassline %1 - Trummor/Bas %1 + Trum/Basmönster %1 Clone of %1 - Kopia av %1 + Kopia av %1 BassBoosterControlDialog FREQ - FREQ + FREQ Frequency: - Frekven: + Frekvens: GAIN - VOL + FÖRST Gain: - Förstärkning: + Förstärkning: RATIO - RATIO + RATIO Ratio: - Ratio: + Ratio: BassBoosterControls Frequency - Frekvens + Frekvens Gain - Förstärkning + Förstärkning Ratio - Ratio + Ratio BitcrushControlDialog IN - IN + IN OUT - UT + UT GAIN - VOL + FÖRST Input Gain: - Input Förstärkning: + Input Förstärkning: NOIS - BRUS + Input Noise: - Input brus: + Output Gain: - Output Förstärkning + Output Förstärkning CLIP - CLIP + Output Clip: - Output Clip: + Rate @@ -709,22 +709,22 @@ If you're interested in translating LMMS in another language or want to imp Levels - Nivåer + Nivåer Levels: - Nivåer: + Nivåer: CaptionMenu &Help - &Hjälp + &Hjälp Help (not available) - Hjälp (inte tillgängligt) + Hjälp (inte tillgängligt) @@ -735,45 +735,45 @@ If you're interested in translating LMMS in another language or want to imp Click here to show or hide the graphical user interface (GUI) of Carla. - Klicka här för att öppna eller stänga Carlas GUI. + Controller Controller %1 - Kontroller %1 + Kontroller %1 ControllerConnectionDialog Connection Settings - Kopplingsinställningar + Kopplingsinställningar MIDI CONTROLLER - MIDI KONTROLLER + MIDI KONTROLLER Input channel - Input kanal + Inputkanal CHANNEL - KANAL + KANAL Input controller - Input kontroller + Inputkontroller CONTROLLER - KONTROLLER + KONTROLLER Auto Detect - Upptäck automatiskt + Upptäck Automatiskt MIDI-devices to receive MIDI-events from @@ -781,7 +781,7 @@ If you're interested in translating LMMS in another language or want to imp USER CONTROLLER - ANVÄNDARKONTROLLER + ANVÄNDARKONTROLLER MAPPING FUNCTION @@ -789,15 +789,15 @@ If you're interested in translating LMMS in another language or want to imp OK - OK + OK Cancel - Avbryt + Avbryt LMMS - + LMMS Cycle Detected. @@ -812,38 +812,38 @@ If you're interested in translating LMMS in another language or want to imp Add - Lägg till + Lägg till Confirm Delete - + Bekräfta Borttagning Confirm delete? There are existing connection(s) associted with this controller. There is no way to undo. - Vill du verkligen ta bort? Det finns kopplingar till den här kotrollen, och operationen går inte ångra. + Vill du verkligen ta bort? Det finns kopplingar till den här kontrollern, och operationen går inte ångra. ControllerView Controls - Kontroller + Kontroller Controllers are able to automate the value of a knob, slider, and other controls. - Kontroller kan automatisera värdet på en vred, reglage, och andra kontroller + Kontroller kan automatisera värdet på en vred, reglage, och andra kontroller Rename controller - Byt namn på kontroller + Byt namn på kontroller Enter the new name for this controller - Skriv nya namnet på kontrollern + Skriv nya namnet på kontrollern &Remove this plugin - &Ta bort denna pluginen + @@ -1124,7 +1124,7 @@ If you're interested in translating LMMS in another language or want to imp DummyEffect NOT FOUND - + HITTAS INTE From 5a92243db6baed331aef827078b44c1678939f36 Mon Sep 17 00:00:00 2001 From: Dave French Date: Sat, 31 Jan 2015 12:43:14 +0000 Subject: [PATCH 054/133] Save and load the mute flag for automation patterns --- src/core/AutomationPattern.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/AutomationPattern.cpp b/src/core/AutomationPattern.cpp index 4c8791ee3..f14e6cb70 100644 --- a/src/core/AutomationPattern.cpp +++ b/src/core/AutomationPattern.cpp @@ -519,6 +519,7 @@ void AutomationPattern::saveSettings( QDomDocument & _doc, QDomElement & _this ) _this.setAttribute( "name", name() ); _this.setAttribute( "prog", QString::number( progressionType() ) ); _this.setAttribute( "tens", QString::number( getTension() ) ); + _this.setAttribute( "mute", QString::number( isMuted() ) ); for( timeMap::const_iterator it = m_timeMap.begin(); it != m_timeMap.end(); ++it ) @@ -553,6 +554,7 @@ void AutomationPattern::loadSettings( const QDomElement & _this ) setProgressionType( static_cast( _this.attribute( "prog" ).toInt() ) ); setTension( _this.attribute( "tens" ) ); + setMuted(_this.attribute( "mute", QString::number( false ) ).toInt() ); for( QDomNode node = _this.firstChild(); !node.isNull(); node = node.nextSibling() ) From 5f32c361e4b2b61d8a8acee99c452d838aa9207f Mon Sep 17 00:00:00 2001 From: Spekular Date: Tue, 3 Feb 2015 20:43:42 +0100 Subject: [PATCH 055/133] Fix project version check on preset load. --- src/core/DataFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index 8db694367..1e79b0c08 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -804,7 +804,7 @@ void DataFile::loadData( const QByteArray & _data, const QString & _sourceFile ) // only one compareType needs to be set, and we can compare on one line because setCompareType returns ProjectVersion if ( createdWith.setCompareType(Minor) != openedWith) { - if( Engine::hasGUI() ) + if( Engine::hasGUI() && root.attribute( "type" ) == "song" ) //documentElement() { QMessageBox::information( NULL, SongEditor::tr( "Project Version Mismatch" ), From 690995620ad6d139156830848685a67d4a9a004c Mon Sep 17 00:00:00 2001 From: Dave French Date: Wed, 4 Feb 2015 15:41:27 +0000 Subject: [PATCH 056/133] Changed the Song Editor time position line to correctly draw from underneath the timeline widget --- src/gui/editors/SongEditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index a9dab5d83..b14f90a37 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -579,7 +579,7 @@ void SongEditor::updatePosition( const MidiTime & _t ) if( x >= trackOpWidth + widgetWidth -1 ) { m_positionLine->show(); - m_positionLine->move( x, 50 ); + m_positionLine->move( x, m_timeLine->height() ); } else { From b25ed327e07a1e368aea218ef58fb9f388539587 Mon Sep 17 00:00:00 2001 From: mohamed Date: Wed, 4 Feb 2015 20:23:43 +0100 Subject: [PATCH 057/133] export filter for export plugins --- include/ExportFilter.h | 64 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 include/ExportFilter.h diff --git a/include/ExportFilter.h b/include/ExportFilter.h new file mode 100644 index 000000000..857ed1b6c --- /dev/null +++ b/include/ExportFilter.h @@ -0,0 +1,64 @@ +/* + * ExportFilter.h - declaration of class ExportFilter, the base-class for all + * file export filters + * + * Copyright (c) 2006-2014 Tobias Doerffel + * + * This file is part of LMMS - http://lmms.io + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + +#ifndef EXPORT_FILTER_H +#define EXPORT_FILTER_H + +#include + +#include "TrackContainer.h" +#include "Plugin.h" + + +class EXPORT ExportFilter : public Plugin +{ +public: + ExportFilter( const Descriptor * _descriptor ) : Plugin( _descriptor, NULL ) {} + virtual ~ExportFilter() {} + + + virtual bool tryExport( const TrackContainer::TrackList &tracks, int tempo, const QString &filename ) = 0; +protected: + + virtual void saveSettings( QDomDocument &, QDomElement & ) + { + } + + virtual void loadSettings( const QDomElement & ) + { + } + + virtual QString nodeName() const + { + return "import_filter"; + } + + +private: + +} ; + + +#endif From af0f997af8c86515c302f3b0dc28ed8b83411db8 Mon Sep 17 00:00:00 2001 From: mohamed Date: Wed, 4 Feb 2015 20:23:53 +0100 Subject: [PATCH 058/133] midi export plugin --- plugins/MidiExport/CMakeLists.txt | 4 + plugins/MidiExport/MidiExport.cpp | 183 +++++++++++++++++ plugins/MidiExport/MidiExport.h | 58 ++++++ plugins/MidiExport/MidiFile.hpp | 320 ++++++++++++++++++++++++++++++ 4 files changed, 565 insertions(+) create mode 100644 plugins/MidiExport/CMakeLists.txt create mode 100644 plugins/MidiExport/MidiExport.cpp create mode 100644 plugins/MidiExport/MidiExport.h create mode 100644 plugins/MidiExport/MidiFile.hpp diff --git a/plugins/MidiExport/CMakeLists.txt b/plugins/MidiExport/CMakeLists.txt new file mode 100644 index 000000000..1d19f081e --- /dev/null +++ b/plugins/MidiExport/CMakeLists.txt @@ -0,0 +1,4 @@ +INCLUDE(BuildPlugin) + +BUILD_PLUGIN(midiexport MidiExport.cpp MidiExport.h MidiFile.hpp + MOCFILES MidiExport.h) diff --git a/plugins/MidiExport/MidiExport.cpp b/plugins/MidiExport/MidiExport.cpp new file mode 100644 index 000000000..03ef3a496 --- /dev/null +++ b/plugins/MidiExport/MidiExport.cpp @@ -0,0 +1,183 @@ +/* + * MidiExport.cpp - support for importing MIDI files + * + * Author: Mohamed Abdel Maksoud + * + * This file is part of LMMS - http://lmms.io + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + + +#include +#include +#include +#include +#include + +#include "MidiExport.h" +#include "Engine.h" +#include "TrackContainer.h" +#include "InstrumentTrack.h" + + +extern "C" +{ + +Plugin::Descriptor PLUGIN_EXPORT midiexport_plugin_descriptor = +{ + STRINGIFY( PLUGIN_NAME ), + "MIDI Export", + QT_TRANSLATE_NOOP( "pluginBrowser", + "Filter for exporting MIDI-files from LMMS" ), + "Mohamed Abdel Maksoud ", + 0x0100, + Plugin::ExportFilter, + NULL, + NULL, + NULL +} ; + +} + + +MidiExport::MidiExport() : ExportFilter( &midiexport_plugin_descriptor) +{ +} + + + + +MidiExport::~MidiExport() +{ +} + + + +bool MidiExport::tryExport( const TrackContainer::TrackList &tracks, int tempo, const QString &filename ) +{ + QFile f(filename); + f.open(QIODevice::WriteOnly); + QDataStream midiout(&f); + + InstrumentTrack* instTrack; + QDomElement element; + + + int nTracks = 0; + const int BUFFER_SIZE = 50*1024; + uint8_t buffer[BUFFER_SIZE]; + uint32_t size; + + foreach( Track* track, tracks ) if( track->type() == Track::InstrumentTrack ) nTracks++; + + // midi header + MidiFile::MIDIHeader header(nTracks); + size = header.writeToBuffer(buffer); + midiout.writeRawData((char *)buffer, size); + + // midi tracks + foreach( Track* track, tracks ) + { + DataFile dataFile( DataFile::SongProject ); + MidiFile::MIDITrack mtrack; + + if( track->type() != Track::InstrumentTrack ) continue; + + //qDebug() << "exporting " << track->name(); + + + mtrack.addName(track->name().toStdString(), 0); + //mtrack.addProgramChange(0, 0); + mtrack.addTempo(tempo, 0); + + instTrack = dynamic_cast( track ); + element = instTrack->saveState( dataFile, dataFile.content() ); + + // instrumentTrack + // - instrumentTrack + // - pattern + int base_pitch = 0; + double base_volume = 1.0; + int base_time = 0; + + + for(QDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling()) + { + //QDomText txt = n.toText(); + //qDebug() << ">> child node " << n.nodeName(); + + if (n.nodeName() == "instrumenttrack") + { + // TODO interpret pan="0" fxch="0" usemasterpitch="1" pitchrange="1" pitch="0" basenote="57" + QDomElement it = n.toElement(); + base_pitch = it.attribute("pitch", "0").toInt(); + base_volume = it.attribute("volume", "100").toDouble()/100.0; + } + + if (n.nodeName() == "pattern") + { + base_time = n.toElement().attribute("pos", "0").toInt(); + // TODO interpret steps="12" muted="0" type="1" name="Piano1" len="2592" + for(QDomNode nn = n.firstChild(); !nn.isNull(); nn = nn.nextSibling()) + { + QDomElement note = nn.toElement(); + if (note.attribute("len", "0") == "0" || note.attribute("vol", "0") == "0") continue; + #if 0 + qDebug() << ">>>> key " << note.attribute( "key", "0" ) + << " " << note.attribute("len", "0") << " @" + << note.attribute("pos", "0"); + #endif + mtrack.addNote( + note.attribute("key", "0").toInt()+base_pitch + , 100 * base_volume * (note.attribute("vol", "100").toDouble()/100) + , (base_time+note.attribute("pos", "0").toDouble())/48 + , (note.attribute("len", "0")).toDouble()/48); + } + } + + } + size = mtrack.writeToBuffer(buffer); + midiout.writeRawData((char *)buffer, size); + } // for each track + + return true; + +} + + + + +void MidiExport::error() +{ + //qDebug() << "MidiExport error: " << m_error ; +} + + + +extern "C" +{ + +// necessary for getting instance out of shared lib +Plugin * PLUGIN_EXPORT lmms_plugin_main( Model *, void * _data ) +{ + return new MidiExport(); +} + + +} + diff --git a/plugins/MidiExport/MidiExport.h b/plugins/MidiExport/MidiExport.h new file mode 100644 index 000000000..d829a8b8f --- /dev/null +++ b/plugins/MidiExport/MidiExport.h @@ -0,0 +1,58 @@ +/* + * MidiExport.h - support for Exporting MIDI-files + * + * Author: Mohamed Abdel Maksoud + * + * This file is part of LMMS - http://lmms.io + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + +#ifndef _MIDI_EXPORT_H +#define _MIDI_EXPORT_H + +#include + +#include "ExportFilter.h" +#include "MidiFile.hpp" + + + +class MidiExport: public ExportFilter +{ +// Q_OBJECT +public: + MidiExport( ); + ~MidiExport(); + + virtual PluginView * instantiateView( QWidget * ) + { + return( NULL ); + } + + virtual bool tryExport( const TrackContainer::TrackList &tracks, int tempo, const QString &filename ); + +private: + + + void error( void ); + + +} ; + + +#endif diff --git a/plugins/MidiExport/MidiFile.hpp b/plugins/MidiExport/MidiFile.hpp new file mode 100644 index 000000000..33955e10a --- /dev/null +++ b/plugins/MidiExport/MidiFile.hpp @@ -0,0 +1,320 @@ +#ifndef MIDIFILE_HPP +#define MIDIFILE_HPP + +/** + * Name: MidiFile.hpp + * Purpose: C++ re-write of the python module MidiFile.py + * Author: Mohamed Abdel Maksoud + *----------------------------------------------------------------------------- + * Name: MidiFile.py + * Purpose: MIDI file manipulation utilities + * + * Author: Mark Conway Wirt + * + * Created: 2008/04/17 + * Copyright: (c) 2009 Mark Conway Wirt + * License: Please see License.txt for the terms under which this + * software is distributed. + *----------------------------------------------------------------------------- + */ + +#include +#include +#include +#include +#include +#include +#include + +using std::string; +using std::vector; +using std::set; + +namespace MidiFile +{ + +const int TICKSPERBEAT = 128; + + +int writeVarLength(uint32_t val, uint8_t *buffer) +{ + /* + Accept an input, and write a MIDI-compatible variable length stream + + The MIDI format is a little strange, and makes use of so-called variable + length quantities. These quantities are a stream of bytes. If the most + significant bit is 1, then more bytes follow. If it is zero, then the + byte in question is the last in the stream + */ + int size = 0; + uint8_t result, little_endian[4]; + result = val & 0x7F; + little_endian[size++] = result; + val = val >> 7; + while (val > 0) + { + result = val & 0x7F; + result = result | 0x80; + little_endian[size++] = result; + val = val >> 7; + } + for (int i=0; i> 24; + buf[1] = val >> 16 & 0xff; + buf[2] = val >> 8 & 0xff; + buf[3] = val & 0xff; + return 4; +} + +int writeBigEndian2(uint16_t val, uint8_t *buf) +{ + buf[0] = val >> 8 & 0xff; + buf[1] = val & 0xff; + return 2; +} + + +class MIDIHeader +{ + // Class to encapsulate the MIDI header structure. + uint16_t numTracks; + uint16_t ticksPerBeat; + + public: + + MIDIHeader(uint16_t nTracks, uint16_t ticksPB=TICKSPERBEAT): numTracks(nTracks), ticksPerBeat(ticksPB) {} + + inline int writeToBuffer(uint8_t *buffer, int start=0) const + { + // chunk ID + buffer[start++] = 'M'; buffer[start++] = 'T'; buffer[start++] = 'h'; buffer[start++] = 'd'; + // chunk size (6 bytes always) + buffer[start++] = 0; buffer[start++] = 0; buffer[start++] = 0; buffer[start++] = 0x06; + // format: 1 (multitrack) + buffer[start++] = 0; buffer[start++] = 0x01; + + start += writeBigEndian2(numTracks, buffer+start); + + start += writeBigEndian2(ticksPerBeat, buffer+start); + + return start; + } + +}; + + +struct Event +{ + uint32_t time; + uint32_t tempo; + string trackName; + enum {NOTE_ON, NOTE_OFF, TEMPO, PROG_CHANGE, TRACK_NAME} type; + // TODO make a union to save up space + uint8_t pitch; + uint8_t programNumber; + uint8_t duration; + uint8_t volume; + uint8_t channel; + + Event() {time=tempo=pitch=programNumber=duration=volume=channel=0; trackName="";} + + inline int writeToBuffer(uint8_t *buffer) const + { + uint8_t code, fourbytes[4]; + int size=0; + switch (type) + { + case NOTE_ON: + code = 0x9 << 4 | channel; + size += writeVarLength(time, buffer+size); + buffer[size++] = code; + buffer[size++] = pitch; + buffer[size++] = volume; + break; + case NOTE_OFF: + code = 0x8 << 4 | channel; + size += writeVarLength(time, buffer+size); + buffer[size++] = code; + buffer[size++] = pitch; + buffer[size++] = volume; + break; + case TEMPO: + code = 0xFF; + size += writeVarLength(time, buffer+size); + buffer[size++] = code; + buffer[size++] = 0x51; + buffer[size++] = 0x03; + writeBigEndian4(int(60000000.0 / tempo), fourbytes); + + //printf("tempo of %x translates to ", tempo); + for (int i=0; i<3; i++) printf("%02x ", fourbytes[i+1]); + printf("\n"); + buffer[size++] = fourbytes[1]; + buffer[size++] = fourbytes[2]; + buffer[size++] = fourbytes[3]; + break; + case PROG_CHANGE: + code = 0xC << 4 | channel; + size += writeVarLength(time, buffer+size); + buffer[size++] = code; + buffer[size++] = programNumber; + break; + case TRACK_NAME: + size += writeVarLength(time, buffer+size); + buffer[size++] = 0xFF; + buffer[size++] = 0x03; + size += writeVarLength(trackName.size(), buffer+size); + trackName.copy((char *)(&buffer[size]), trackName.size()); + size += trackName.size(); +// buffer[size++] = '\0'; +// buffer[size++] = '\0'; + + break; + } + return size; + } // writeEventsToBuffer + + + // events are sorted by their time + inline bool operator < (const Event& b) const { + if (this->time < b.time) return true; +#if 0 + if (this->type < b.type) return true; + if (this->pitch < b.pitch) return true; + if (this->duration < b.duration) return true; + if (this->volume < b.volume) return true; + #if 1 + if (this->programNumber < b.programNumber) return true; + if (this->channel < b.channel) return true; + if (this->trackName < b.trackName) return true; + #endif +#endif + return false; + } +}; + +template +class MIDITrack +{ + // A class that encapsulates a MIDI track + // Nested class definitions. + vector events; + + public: + uint8_t channel; + + MIDITrack(): channel(0) {} + + inline void addEvent(const Event &e) + { + Event E = e; + events.push_back(E); + } + + inline void addNote(uint8_t pitch, uint8_t volume, double time, double duration) + { + Event event; event.channel = channel; + event.volume = volume; + + event.type = Event::NOTE_ON; event.pitch = pitch; event.time= (uint32_t) (time * TICKSPERBEAT); + addEvent(event); + + event.type = Event::NOTE_OFF; event.pitch = pitch; event.time=(uint32_t) ((time+duration) * TICKSPERBEAT); + addEvent(event); + + //printf("note: %d-%d\n", (uint32_t) time * TICKSPERBEAT, (uint32_t)((time+duration) * TICKSPERBEAT)); + } + + inline void addName(const string &name, uint32_t time) + { + Event event; event.channel = channel; + event.type = Event::TRACK_NAME; event.time=time; event.trackName = name; + addEvent(event); + } + + inline void addProgramChange(uint8_t prog, uint32_t time) + { + Event event; event.channel = channel; + event.type = Event::PROG_CHANGE; event.time=time; event.programNumber = prog; + addEvent(event); + } + + inline void addTempo(uint8_t tempo, uint32_t time) + { + Event event; event.channel = channel; + event.type = Event::TEMPO; event.time=time; event.tempo = tempo; + addEvent(event); + } + + inline int writeMIDIToBuffer(uint8_t *buffer, int start=0) const + { + // Write the meta data and note data to the packed MIDI stream. + // Process the events in the eventList + + start += writeEventsToBuffer(buffer, start); + + // Write MIDI close event. + buffer[start++] = 0x00; + buffer[start++] = 0xFF; + buffer[start++] = 0x2F; + buffer[start++] = 0x00; + + // return the entire length of the data and write to the header + + return start; + } + + inline int writeEventsToBuffer(uint8_t *buffer, int start=0) const + { + // Write the events in MIDIEvents to the MIDI stream. + vector _events = events; + std::sort(_events.begin(), _events.end()); + vector::const_iterator it; + uint32_t time_last = 0, tmp; + for (it = _events.begin(); it!=_events.end(); ++it) + { + Event e = *it; + if (e.time < time_last){ + printf("error: e.time=%d time_last=%d\n", e.time, time_last); + assert(false); + } + tmp = e.time; + e.time -= time_last; + time_last = tmp; + start += e.writeToBuffer(buffer+start); + if (start >= MAX_TRACK_SIZE) { + break; + } + } + return start; + } + + inline int writeToBuffer(uint8_t *buffer, int start=0) const + { + uint8_t eventsBuffer[MAX_TRACK_SIZE]; + uint32_t events_size = writeMIDIToBuffer(eventsBuffer); + //printf(">> track %lu events took 0x%x bytes\n", events.size(), events_size); + + // chunk ID + buffer[start++] = 'M'; buffer[start++] = 'T'; buffer[start++] = 'r'; buffer[start++] = 'k'; + // chunk size + start += writeBigEndian4(events_size, buffer+start); + // copy events data + memmove(buffer+start, eventsBuffer, events_size); + start += events_size; + return start; + } +}; + +}; // namespace + +#endif From fd2efe034799e33410077c014c7cad251cec16d9 Mon Sep 17 00:00:00 2001 From: Ra Date: Fri, 30 Jan 2015 21:55:47 +0300 Subject: [PATCH 059/133] Russian translation update Russian translation update --- data/locale/ru.ts | 1018 +++++++++++++++++++++++---------------------- 1 file changed, 524 insertions(+), 494 deletions(-) diff --git a/data/locale/ru.ts b/data/locale/ru.ts index a59fe4814..950529e06 100644 --- a/data/locale/ru.ts +++ b/data/locale/ru.ts @@ -1,6 +1,6 @@ - + AboutDialog @@ -32,9 +32,13 @@ Current language not translated (or native English). If you're interested in translating LMMS in another language or want to improve existing translations, you're welcome to help us! Simply contact the maintainer! - На этом языке не переведено (или установлен Английский). + Перевод выполнили: +Alexey Kouznetsov <alexey/dot/kouznetsov/at/gmail/dot/com> +Oe Ai <oeai/at/symbiants/dot/com> -Если Вы заинтересованы в переводе LMMS на другой язык или хотите улучшить существующий перевод, мы приветствуем любую помощь! Просто свяжитесь с разработчиками! +Музыкльные термины можно нйти в словаре dic.academic.ru/dic.nsf/enc_colier/6207/ТЕРМИНЫ +Если Вы заинтересованы в переводе LMMS на другой язык или хотите улучшить существующий перевод, мы приветствуем любую помощь! Просто свяжитесь с разработчиками! + License @@ -50,15 +54,15 @@ If you're interested in translating LMMS in another language or want to imp LMMS - ЛММС + ЛММС Involved - Участники + Участники Contributors ordered by number of commits: - Разработчики сортированные по числу коммитов: + Разработчики сортированные по числу коммитов: @@ -69,7 +73,7 @@ If you're interested in translating LMMS in another language or want to imp Volume: - Громкость: + Громкость: PAN @@ -77,42 +81,42 @@ If you're interested in translating LMMS in another language or want to imp Panning: - + Балансировка: LEFT - + Лево Left gain: - + Лево мощность: RIGHT - + Право Right gain: - + Право мощность: AmplifierControls Volume - Громкость + Громкость Panning - + Баланс Left gain - + Лево мощн Right gain - + Право мощн @@ -171,39 +175,39 @@ If you're interested in translating LMMS in another language or want to imp Disable loop - + Отключить петлю This button disables looping. The sample plays only once from start to end. - + Эта кнопка отключает петлю (loop-цикл). Запись проигрывается только один раз от начала до конца. Enable loop - + Включить петлю This button enables forwards-looping. The sample loops between the end point and the loop point. - + Эта кнопка включает переднюю петлю. Сэмпл кольцуется между конечной точкой и точкой петли. This button enables ping-pong-looping. The sample loops backwards and forwards between the end point and the loop point. - + Эта кнопка включает пинг-понг петлю. Сэмпл кольцуется обратно и вперёд между конечной точкой и точкой петли. With this knob you can set the point where AudioFileProcessor should begin playing your sample. - + Этим регулятором можно установить точку где АудиоФайлПроцессор должен начать воспроизведение сэмпла. With this knob you can set the point where AudioFileProcessor should stop playing your sample. - + Этот регулятор устанавливает точку в которой АудиоФайлПроцессор должен перестать воспроизвдение сэмпла. Loopback point: - + Точка возврата петли: With this knob you can set the point where the loop starts. - + Этот регулятор ставит точку начала петли. @@ -233,11 +237,11 @@ If you're interested in translating LMMS in another language or want to imp CLIENT-NAME - ИМЯ КЛИЕНТА + ИМЯ КЛИЕНТА CHANNELS - КАНАЛЫ + КАНАЛЫ @@ -347,109 +351,109 @@ If you're interested in translating LMMS in another language or want to imp AutomationEditorWindow Play/pause current pattern (Space) - + Игра/Пауза текущей мелодии (Пробел) Click here if you want to play the current pattern. This is useful while editing it. The pattern is automatically looped when the end is reached. - Нажмите здесь чтобы проиграть текущий шаблон. Это может пригодиться при его редактировании. Шаблон автоматически закольцуется при достижении конца. + Нажмите здесь чтобы проиграть текущую мелодию. Это может пригодиться при его редактировании. Мелодия автоматически закольцуется при достижении конца. Stop playing of current pattern (Space) - + Остановить воспроизведение текущей мелодии (Пробел) Click here if you want to stop playing of the current pattern. - Нажмите здесь, если вы хотите остановить воспроизведение текущего шаблона. + Нажмите здесь, если вы хотите остановить воспроизведение текущей мелодии. Draw mode (Shift+D) - Режим рисования (Shift+D) + Режим рисования (Shift+D) Erase mode (Shift+E) - + Режим стирания (Shift-E) Flip vertically - + Перевернуть вертикально Flip horizontally - + Перевернуть горизонтально Click here and the pattern will be inverted.The points are flipped in the y direction. - + Нажмите здесь и мелодия перевернётся. Точки переворачиваются в Y направлении. Click here and the pattern will be reversed. The points are flipped in the x direction. - + Нажмите здесь и мелодия перевернётся в направлении X. Click here and draw-mode will be activated. In this mode you can add and move single values. This is the default mode which is used most of the time. You can also press 'Shift+D' on your keyboard to activate this mode. - При нажатии на эту кнопку активируется режим рисования нот, в нём вы можете добавлять/перемещать и изменять длительность одиночных нот. Это основной режим и используется большую часть времени. + При нажатии на эту кнопку активируется режим рисования нот, в нём вы можете добавлять/перемещать и изменять длительность одиночных нот. Это основной режим и используется большую часть времени. Для включения этого режима можно использовать комбинацию клавиш Shift+D. Click here and erase-mode will be activated. In this mode you can erase single values. You can also press 'Shift+E' on your keyboard to activate this mode. - При нажатии на эту кнопку активируется режим стирания. В этом режиме вы можете стирать ноты по одной. + При нажатии на эту кнопку активируется режим стирания. В этом режиме вы можете стирать ноты по одной. Для включения этого режима можно использовать комбинацию клавиш Shift+E. Discrete progression - Дискретная прогрессия + Дискретная прогрессия Linear progression - Линейная прогрессия + Линейная прогрессия Cubic Hermite progression - Кубическая Эрмитова прогрессия + Кубическая Эрмитова прогрессия Tension value for spline - Величина напряжения для сплайна + Величина напряжения для сплайна A higher tension value may make a smoother curve but overshoot some values. A low tension value will cause the slope of the curve to level off at each control point. - + Более высокое напряжение может сделать кривую более мягкой, но перегрузит некоторые величины. Низкое напряжение сделает наклон кривой ниже в каждой контрольной точке. Click here to choose discrete progressions for this automation pattern. The value of the connected object will remain constant between control points and be set immediately to the new value when each control point is reached. - Выбор дискретной прогрессии для этого шаблона автоматизации. Кол-во подсоединенных объектов будет оставаться постоянным между управляющими точками и будет установлено на новое значение сразу по достижении каждой управляющей точки. + Выбор дискретной прогрессии для этого шаблона автоматизации. Кол-во подсоединенных объектов будет оставаться постоянным между управляющими точками и будет установлено на новое значение сразу по достижении каждой управляющей точки. Click here to choose linear progressions for this automation pattern. The value of the connected object will change at a steady rate over time between control points to reach the correct value at each control point without a sudden change. - Выбор линейной прогрессии для этого шаблона автоматизации. Кол-во подсоединенных объектов будет меняться с постоянной скоростью во времени между управляющими точками для достижения точного значения в каждой управляющей точки без внезапных изменений. + Выбор линейной прогрессии для этого шаблона автоматизации. Кол-во подсоединенных объектов будет меняться с постоянной скоростью во времени между управляющими точками для достижения точного значения в каждой управляющей точки без внезапных изменений. Click here to choose cubic hermite progressions for this automation pattern. The value of the connected object will change in a smooth curve and ease in to the peaks and valleys. - Кубическая Эрмитова прогрессия для этого шаблона автоматизации. Кол-во подсоединенных объектов изменится по сглаженной кривой и смягчится на пиках и спадах. + Кубическая Эрмитова прогрессия для этого шаблона автоматизации. Кол-во подсоединенных объектов изменится по сглаженной кривой и смягчится на пиках и спадах. Cut selected values (Ctrl+X) - Вырезать выбранные ноты (Ctrl+X) + Вырезать выбранные ноты (Ctrl+X) Copy selected values (Ctrl+C) - Копировать выбранные ноты в буфер (Ctrl+C) + Копировать выбранные ноты в буфер (Ctrl+C) Paste values from clipboard Ctrl+V) - + Вставить запомненные значения (Ctrl+V) Click here and selected values will be cut into the clipboard. You can paste them anywhere in any pattern by clicking on the paste button. - При нажатии на эту кнопку выделеные ноты будут вырезаны в буфер. Позже вы можете вставить их в любое место любого шаблона с помощью кнопки "Вставить". + При нажатии на эту кнопку выделеные ноты будут вырезаны в буфер. Позже вы можете вставить их в любое место любой мелодии с помощью кнопки "Вставить". Click here and selected values will be copied into the clipboard. You can paste them anywhere in any pattern by clicking on the paste button. - При нажатии на эту кнопку выделеные ноты будут скопированы в буфер. Позже вы можете вставить их в любое место любого шаблона с помощью кнопки "Вставить". + При нажатии на эту кнопку выделеные ноты будут скопированы в буфер. Позже вы можете вставить их в любое место любой мелодии с помощью кнопки "Вставить". Click here and the values from the clipboard will be pasted at the first visible measure. - При нажатии на эту кнопку ноты из буфера будут вставлены в первый видимый такт. + При нажатии на эту кнопку ноты из буфера будут вставлены в первый видимый такт. Tension: @@ -457,11 +461,11 @@ If you're interested in translating LMMS in another language or want to imp Automation Editor - no pattern - Редактор автоматизаци — нет шаблона + Редактор автоматизаци — нет шаблона Automation Editor - %1 - Редактор автоматизации — %1 + Редактор автоматизации — %1 @@ -472,14 +476,15 @@ If you're interested in translating LMMS in another language or want to imp Model is already connected to this pattern. - + паттерн - шаблон, мелодия + Модель уже подключена к этому шаблону. AutomationPatternView double-click to open this pattern in automation editor - Дважды щёлкните мышью чтобы настроить автоматизацию для этого шаблона + Дважды щёлкните мышью чтобы настроить автоматизацию этого шаблона Open in Automation editor @@ -507,15 +512,15 @@ If you're interested in translating LMMS in another language or want to imp Set/clear record - Установить/очистить запись + Установить/очистить запись Flip Vertically (Visible) - + Перевернуть вертикально (Видимое) Flip Horizontally (Visible) - + Перевернуть горизонтально (Видимое) @@ -529,115 +534,115 @@ If you're interested in translating LMMS in another language or want to imp BBEditor Beat+Bassline Editor - Ритм Басс Редактор + Ритм+Бас Редактор Play/pause current beat/bassline (Space) - Игра/пауза текущей линии ритма/басса (<Space>) + Игра/пауза текущей линии ритма/баса (<Space>) Stop playback of current beat/bassline (Space) - Остановить воспроизведение текущей линии ритм-басса (ПРОБЕЛ) + Остановить воспроизведение текущей линии ритм-баса (ПРОБЕЛ) Click here to play the current beat/bassline. The beat/bassline is automatically looped when its end is reached. - Нажмите чтобы проиграть текущую линию ритм-басса. Она будет закольцована по достижении окончания. + Нажмите чтобы проиграть текущую линию ритм-баса. Она будет закольцована по достижении окончания. Click here to stop playing of current beat/bassline. - Остановить воспроизведение (Пробел). + Остановить воспроизведение (Пробел). Add beat/bassline - + Добавить ритм/бас Add automation-track - Добавить дорожку автоматизации + Добавить дорожку автоматизации Remove steps - + Убрать такты Add steps - + Добавить такты BBTCOView Open in Beat+Bassline-Editor - Открыть в редакторе ритма и басса + Открыть в редакторе ритм + баса Reset name - Сбросить название + Сбросить название Change name - Переименовать + Переименовать Change color - Изменить цвет + Изменить цвет Reset color to default - + Установить цвет по умолчанию BBTrack Beat/Bassline %1 - Ритм-Басс Линия %1 + Ритм-Бас Линия %1 Clone of %1 - Копия %1 + Копия %1 BassBoosterControlDialog FREQ - + ЧАСТ Frequency: - Частота: + Частота: GAIN - УСИЛ + МОЩ Gain: - Усиление: + Мощность: RATIO - ОТН + ОТН Ratio: - Отношение: + Отношение: BassBoosterControls Frequency - Частота + Частота Gain - Усиление + Мощность Ratio - Отношение + Отношение @@ -652,11 +657,11 @@ If you're interested in translating LMMS in another language or want to imp GAIN - УСИЛ + Input Gain: - + Входная мощность: NOIS @@ -664,7 +669,7 @@ If you're interested in translating LMMS in another language or want to imp Input Noise: - + Входной шум: Output Gain: @@ -712,37 +717,37 @@ If you're interested in translating LMMS in another language or want to imp Stereo difference: - + Стерео разница: Levels - + Уровни Levels: - + Уровни: CaptionMenu &Help - &H Справка + &H Справка Help (not available) - + Справка (не доступна) CarlaInstrumentView Show GUI - Показать интерфейс + Показать интерфейс Click here to show or hide the graphical user interface (GUI) of Carla. - + Нажмите сюда, чтобы показать или скрыть графический интерфейс Карла. @@ -920,11 +925,11 @@ If you're interested in translating LMMS in another language or want to imp DelayControls Delay Samples - + Задержка сэмплов Feedback - + Возврат Lfo Frequency @@ -939,11 +944,11 @@ If you're interested in translating LMMS in another language or want to imp DelayControlsDialog Delay - + Задержка Delay Time - + Время задержки Regen @@ -970,26 +975,26 @@ If you're interested in translating LMMS in another language or want to imp DetuningHelper Note detuning - + Расстройка нот DualFilterControlDialog Filter 1 enabled - + Фильтр 1 включен Filter 2 enabled - + Фильтр 2 включен Click to enable/disable Filter 1 - + Кликнуть для включения/выключения Фильтра 1 Click to enable/disable Filter 2 - + Кликнуть для включения/выключения Фильтра 2 @@ -1131,26 +1136,26 @@ If you're interested in translating LMMS in another language or want to imp DummyEffect NOT FOUND - + НЕ НАЙДЕН Editor Play (Space) - + Игра (Пробел) Stop (Space) - + Стоп (Пробел) Record - + Запись Record while playing - + Запись при игре @@ -1532,18 +1537,18 @@ Right clicking will bring up a context menu where you can change the order in wh Click here for random wave. - + Нажмите сюда для случайной волны. EqControls Input gain - + Входная мощность Output gain - + Выходная мощность Low shelf gain @@ -1738,7 +1743,7 @@ Right clicking will bring up a context menu where you can change the order in wh Gain - Усиление + Мощность Out Gain @@ -1746,15 +1751,15 @@ Right clicking will bring up a context menu where you can change the order in wh Bandwidth: - + Полоса: Resonance : - + Резонанс: Frequency: - Частота: + Частота: 12dB @@ -1781,7 +1786,7 @@ Right clicking will bring up a context menu where you can change the order in wh EqParameterWidget Hz - + Гц @@ -1924,74 +1929,74 @@ Right clicking will bring up a context menu where you can change the order in wh Export between loop markers - + Экспорт между метками петли Could not open file - Не могу открыть файл + Не могу открыть файл Could not open file %1 for writing. Please make sure you have write-permission to the file and the directory containing the file and try again! - Не могу открыть файл %1 для записи. + Не могу открыть файл %1 для записи. Проверьте, обладаете ли вы правами на запись в выбранный файл и содержащий его каталог и попробуйте снова! Export project to %1 - Экспорт проекта в %1 + Экспорт проекта в %1 Error - Ошибка + Ошибка Error while determining file-encoder device. Please try to choose a different output format. - Ошибка при определении кодека файла. Попробуйте выбрать другой формат вывода. + Ошибка при определении кодека файла. Попробуйте выбрать другой формат вывода. Rendering: %1% - Обработка: %1% + Обработка: %1% Fader Please enter a new value between %1 and %2: - Введите новое значение от %1 до %2: + Введите новое значение от %1 до %2: FileBrowser Browser - Обозреватель файлов + Обозреватель файлов FileBrowserTreeWidget Send to active instrument-track - Соединить с активным инструментом-дорожкой + Послать на активную инструментальную-дорожку Open in new instrument-track/Song-Editor - Отркрыть в новой дорожке инструмента/редакторе песни + Отркрыть в новой инструментальной дорожке/редакторе песни Open in new instrument-track/B+B Editor - Открыть в новой инструментальной дорожке/Бит+Басс редакторе + Открыть в новой инструментальной дорожке/Б+Б редакторе Loading sample - Загрузка записи + Загрузка записи Please wait, loading sample for preview... - Пж. ждите, запись загружается для просмотра... + Пж. ждите, запись загружается для просмотра... --- Factory files --- - --- Заводские файлы --- + --- Заводские файлы --- @@ -2025,11 +2030,11 @@ Please make sure you have write-permission to the file and the directory contain FlangerControlsDialog Delay - + Задержка Delay Time: - + Время задержки: Lfo Hz @@ -2061,14 +2066,14 @@ Please make sure you have write-permission to the file and the directory contain White Noise Amount: - + Объём белого шума: FxLine Channel send amount - + Величина отправки канала The FX channel receives input from one or more instrument tracks. @@ -2078,27 +2083,31 @@ In order to route the channel to another channel, select the FX channel and clic You can remove and move FX channels in the context menu, which is accessed by right-clicking the FX channel. - + Канал эффектов (ЭФ) получает сигнал на вход от одной или нескольких инструментальных дорожек. +В свою очередь его можно подключить к нескольким другим каналам эффектов. ЛММС автоматически предотвращает бесконечные циклы и не позволяет создавать соединения, которые приведут к бесконечному циклу. +Чтобы соединить один канал с другим, выберите канал ЭФфектов и кликните кнопку послать (Send) на канале, куда нужно послать. Регулятор под кнопкой "послать" контролирует уровень сигнала, посылаемого на канал. +Можно убирать и двигать каналы эффектов через контекстное меню, если кликнуть правой кнопкой мыши по каналу эффектов. + Move &left - + Двигать влево &L Move &right - + Двигать вправо &r Rename &channel - + Переименовать канал &c R&emove channel - + Удалить канал &e Remove &unused channels - + Удалить неиспользуемые каналы &u @@ -2144,76 +2153,76 @@ You can remove and move FX channels in the context menu, which is accessed by ri Solo FX channel - + Соло канал ЭФ FxRoute Amount to send from channel %1 to channel %2 - + Величина отправки с канала %1 на канал %2 GigInstrument Bank - Банк + Банк Patch - Патч + Патч Gain - Усиление + Мощность GigInstrumentView Open other GIG file - + Открыть другой GIG файл Click here to open another GIG file - + Кликните сюда, чтобы открыть другой GIG файл Choose the patch - Выбрать патч + Выбрать патч Click here to change which patch of the GIG file to use - + Нажмите здесь для смены используемого патча GIG файла Change which instrument of the GIG file is being played - + Изменить инструмент, который воспроизводит GIG файл Which GIG file is currently being used - + Какой GIG файл сейчас используется Which patch of the GIG file is currently being used - + Какой патч GIG файла сейчас используется Gain - Усиление + Мощность Factor to multiply samples by - + Фактор умножения сэмплов Open GIG file - + Открыть GIG файл GIG Files (*.gig) - + GIG Файлы (*.gig) @@ -2276,7 +2285,7 @@ You can remove and move FX channels in the context menu, which is accessed by ri Down and up - + Вниз и вверх @@ -2394,7 +2403,7 @@ You can remove and move FX channels in the context menu, which is accessed by ri 6 - 8х {6?} + 6sus4 @@ -2414,7 +2423,7 @@ You can remove and move FX channels in the context menu, which is accessed by ri 7 - 8х {7?} + 7sus4 @@ -2797,15 +2806,15 @@ You can remove and move FX channels in the context menu, which is accessed by ri CUSTOM BASE VELOCITY - + ПРОИЗВОЛЬНАЯ БАЗОВАЯ СКОРОСТЬ Specify the velocity normalization base for MIDI-based instruments at note volume 100% - + Опрделяет базовую скорость нормальизации для MiDi инструментов при громкости ноты 100% BASE VELOCITY - + БАЗОВАЯ СКОРОСТЬ @@ -2816,7 +2825,7 @@ You can remove and move FX channels in the context menu, which is accessed by ri Enables the use of Master Pitch - + Включает использование основной тональности @@ -2856,7 +2865,7 @@ You can remove and move FX channels in the context menu, which is accessed by ri Q/Resonance или качество? - Кол./Резонанса + LowPass @@ -2996,7 +3005,7 @@ You can remove and move FX channels in the context menu, which is accessed by ri Envelopes, LFOs and filters are not supported by the current instrument. - + Огибающие, LFO и фильтры не поддерживаются этим инструментом. @@ -3165,38 +3174,38 @@ You can remove and move FX channels in the context menu, which is accessed by ri RANGE - ДИАПАЗОН + ДИАП Save current instrument track settings in a preset file - + Сохранить текущую инструментаьную дорожку в файл предустановок Click here, if you want to save current instrument track settings in a preset file. Later you can load this preset by double-clicking it in the preset-browser. - + Нажать здесь, чтобы сохранить настройки текущей инстр. дорожки в файл предустановок. Позже можно загрузить эту предустановку двойным кликом в браузере предустановок. MISC - РАЗНОЕ + РАЗН Knob Set linear - + Установить линейно Set logarithmic - + Установить логарифмически Please enter a new value between -96.0 dBV and 6.0 dBV: - Введите новое значение от –96,0 дБВ до 6,0 дБВ: + Введите новое значение от –96,0 дБВ до 6,0 дБВ: Please enter a new value between %1 and %2: - Введите новое значение от %1 до %2: + Введите новое значение от %1 до %2: @@ -3243,7 +3252,7 @@ You can remove and move FX channels in the context menu, which is accessed by ri LcdSpinBox Please enter a new value between %1 and %2: - Введите новое значение от %1 до %2: + Введите новое значение от %1 до %2: @@ -3376,7 +3385,7 @@ Double click to pick a file. Click here for a moog saw-wave. - + Нажать здесь для зигзагообразной муг волны. @@ -3490,11 +3499,11 @@ Please make sure you have write-access to the file and try again. Show/hide Beat+Bassline Editor - Показать/скрыть ритм-басс редактор + Показать/скрыть ритм-бас редактор By pressing this button, you can show or hide the Beat+Bassline Editor. The Beat+Bassline Editor is needed for creating beats, and for opening, adding, and removing channels, and for cutting, copying and pasting beat and bassline-patterns, and for other things like that. - Сим запускается ритм-басс редактор. Он необходим для установки ритма, открытия, добавления и удаления каналов, а также вырезания, копирования и вставки ритм-басс шаблонов и т. п. + Сим запускается ритм-бас редактор. Он необходим для установки ритма, открытия, добавления и удаления каналов, а также вырезания, копирования и вставки ритм-бас шаблонов, мелодий и т. п. Show/hide Piano-Roll @@ -3576,15 +3585,16 @@ Please visit http://lmms.sf.net/wiki for documentation on LMMS. Volumes - + Объёмы? + Громкости Undo - + Откатить действие Redo - + Возврат действия LMMS Project (*.mmpz *.mmp);;LMMS Project Template (*.mpt) @@ -3592,59 +3602,59 @@ Please visit http://lmms.sf.net/wiki for documentation on LMMS. My Projects - + Мои проекты My Samples - + Мои сэмплы My Presets - + Мои предустановки My Home - + Моя домашняя папка My Computer - + Мой компьютер Root Directory - + Корневая директория &File - + &F Файл &Recently Opened Projects - + &R Недавние проекты Save as New &Version - + &V Сохранить как новую версию E&xport Tracks... - + &x Экспорт дорожек... Online Help - + Помощь онлайн What's This? - + Что это? Open Project - + Открыть проект Save Project - + Сохранить проект @@ -3686,7 +3696,7 @@ Please visit http://lmms.sf.net/wiki for documentation on LMMS. MidiAlsaSeq DEVICE - УСТРОЙСТВО + УСТРОЙСТВО @@ -3767,7 +3777,7 @@ Please visit http://lmms.sf.net/wiki for documentation on LMMS. Base velocity - + Базовая скорость @@ -4249,17 +4259,19 @@ Please visit http://lmms.sf.net/wiki for documentation on LMMS. MonstroView Operators view - + Операторский вид The Operators view contains all the operators. These include both audible operators (oscillators) and inaudible operators, or modulators: Low-frequency oscillators and Envelopes. Knobs and other widgets in the Operators view have their own what's this -texts, so you can get more specific help for them that way. - + Операторский вид содержит все операторы. Они включают и звучащие операторы (осцилляторы) и беззвучные операторы или модуляторы: Низко-частотные осцилляторы и огибающие. + +Регуляторы и другие виджеты в Операторском виде имеют свои подписи "Что это?", можно получить по ним более детальную справку таким образом. Matrix view - + Матричный вид The Matrix view contains the modulation matrix. Here you can define the modulation relationships between the various operators: Each audible operator (oscillators 1-3) has 3-4 properties that can be modulated by any of the modulators. Using more modulations consumes more CPU power. @@ -4267,153 +4279,171 @@ Knobs and other widgets in the Operators view have their own what's this -t The view is divided to modulation targets, grouped by the target oscillator. Available targets are volume, pitch, phase, pulse width and sub-osc ratio. Note: some targets are specific to one oscillator only. Each modulation target has 4 knobs, one for each modulator. By default the knobs are at 0, which means no modulation. Turning a knob to 1 causes that modulator to affect the modulation target as much as possible. Turning it to -1 does the same, but the modulation is inversed. - + Матричный вид содержит матрицу модуляции. Здесь можно определить модуляционное отношение между разными операторами. Каждый слышимый оператор (осцилляторы 1-3) имеют 3-4 свойства, которые можно модулировать любыми модуляторами. Используя больше модуляций увеличивается нагрузка на процессор. + +Вид делится на цели модуляции, сгруппированные на целевой осциллятор. Доступные цели : громкость, тон, фаза, ширина пульсации и отношение с подчиненным (под-) осциллятором. Отметим что некоторые цели определены только для одного осциллятора. + +Каждая цель модуляции имеет 4 регулятора, один на каждый модулятор. По умолчанию регуляторы установлены на 0, то есть без модуляции. Включая регулятор на 1 ведёт к тому, что модулятор влияет на цель модуляции на столько на сколько возможно. Включая его на -1 делает то же, но с обратной модуляцией. Mix Osc2 with Osc3 - + Смешать Осц2 с Осц3 Modulate amplitude of Osc3 with Osc2 - + Модулировать амплитуду осциллятора 3 сигналом с осц2 Modulate frequency of Osc3 with Osc2 - + Модулировать частоту осциллятора 3 сигналом с осц2 Modulate phase of Osc3 with Osc2 - + Модулировать фазу Осц3 осциллятором2 The CRS knob changes the tuning of oscillator 1 in semitone steps. - + Регулятор CRS меняет настройку осциллятора 1 в размере полутона. The CRS knob changes the tuning of oscillator 2 in semitone steps. - + Регулятор CRS меняет настройку осциллятора 2 в размере полутона. The CRS knob changes the tuning of oscillator 3 in semitone steps. - + Регулятор CRS меняет настройку осциллятора 3 в размере полутона. FTL and FTR change the finetuning of the oscillator for left and right channels respectively. These can add stereo-detuning to the oscillator which widens the stereo image and causes an illusion of space. - + FTL и FTR меняют подстройку осциллятора для левого и правого канала соответственно. Они могут добавить стерео расстраивания осциллятора, которое расширяет стерео картину и создаёт иллюзию космоса. The SPO knob modifies the difference in phase between left and right channels. Higher difference creates a wider stereo image. - + Регулятор SPO меняет фазовую разницу между левым и правым каналами. Высокая разница создаёт более широкую стерео картину. The PW knob controls the pulse width, also known as duty cycle, of oscillator 1. Oscillator 1 is a digital pulse wave oscillator, it doesn't produce bandlimited output, which means that you can use it as an audible oscillator but it will cause aliasing. You can also use it as an inaudible source of a sync signal, which can be used to synchronize oscillators 2 and 3. - + PW регулятор контролирует ширину пульсаций, также известную как рабочий цикл осциллятора 1. Осциллятор 1 это цифровой импульсный волновой генератор, он не воспроизводит сигнал с ограниченной полосой, это значит, что его можно использовать как слышимый осциллятор, но приведёт к наложению сигналов (или сглаживанию). Его можно использовать и как не слышимый источник синхронизирующего сигнала, для использования в синхронизации осцилляторов 2 и 3. Send Sync on Rise: When enabled, the Sync signal is sent every time the state of oscillator 1 changes from low to high, ie. when the amplitude changes from -1 to 1. Oscillator 1's pitch, phase and pulse width may affect the timing of syncs, but its volume has no effect on them. Sync signals are sent independently for both left and right channels. - + Посылать синхронизацию при повышении: при включении, сигнал синхронизации посылается каждый раз когда состояние осциллятора 1 меняется с низкого на высокое, т.е. когда амплитуда меняется от -1 до 1. +Тон осциллятора 1, фаза и ширина пульсаций может влиять на время синхронизации, но громкость не имеет эффекта. Сигнал синхронизации посылается независимо для левого и правого каналов. Send Sync on Fall: When enabled, the Sync signal is sent every time the state of oscillator 1 changes from high to low, ie. when the amplitude changes from 1 to -1. Oscillator 1's pitch, phase and pulse width may affect the timing of syncs, but its volume has no effect on them. Sync signals are sent independently for both left and right channels. - + Посылать синхронизацию при падении: при включении, сигнал синхронизации посылается каждый раз когда состояние осциллятора 1 меняется с выского на низкое, т.е. когда амплитуда меняется от 1 до -1. +Тон осциллятора 1, фаза и ширина пульсаций может влиять на время синхронизации, но громкость не имеет эффекта. Сигнал синхронизации посылается независимо для левого и правого каналов. Hard sync: Every time the oscillator receives a sync signal from oscillator 1, its phase is reset to 0 + whatever its phase offset is. - + Жесткая синхр. : Каждый раз при получении осциллятором сигнала синхронизации от осциллятора 1, его фаза сбрасывается до 0 + его граница фазы, какой бы она ни была. Reverse sync: Every time the oscillator receives a sync signal from oscillator 1, the amplitude of the oscillator gets inverted. - + Обратная синхронизация: Каждый раз при получении сигнала синхронизации от осциллятора 1, амплитуда осцилятора переворачивается. Choose waveform for oscillator 2. - + Выбрать форму волны для осциллятора 2. Choose waveform for oscillator 3's first sub-osc. Oscillator 3 can smoothly interpolate between two different waveforms. - + Выберите форму волны для первого доп. осциллятора осциллятора 3. Осциллятор 3 может мягко переходить между двумя разными волнами. Choose waveform for oscillator 3's second sub-osc. Oscillator 3 can smoothly interpolate between two different waveforms. - + Выберите форму волны для второго доп. осциллятора осциллятора 3. Осциллятор 3 может мягко переходить между двумя разными волнами. The SUB knob changes the mixing ratio of the two sub-oscs of oscillator 3. Each sub-osc can be set to produce a different waveform, and oscillator 3 can smoothly interpolate between them. All incoming modulations to oscillator 3 are applied to both sub-oscs/waveforms in the exact same way. - + SUB меняет смешивание двух доп. осяцилляторов осциллятора 3. Каждый доп. осц. может быть установлен для создания разных волн и осциллятор 3 может мягко переходить между ними. Все входящие модуляции для осциллятора 3 применяются на оба доп.осц./волны одним и тем же образом. In addition to dedicated modulators, Monstro allows oscillator 3 to be modulated by the output of oscillator 2. Mix mode means no modulation: the outputs of the oscillators are simply mixed together. - + В дополнение к выделенным модуляторам Монстро позволяет выходу осциллятора 2 модулировать осцллятор 3. + +Смешанный (Mix) режим значит без модуляции: выходы осцилляторов просто смешиваются друг с другом. In addition to dedicated modulators, Monstro allows oscillator 3 to be modulated by the output of oscillator 2. AM means amplitude modulation: Oscillator 3's amplitude (volume) is modulated by oscillator 2. - + В дополнение к выделенным модуляторам Монстро позволяет выходу осциллятора 2 модулировать осцллятор 3. + +AM режим значит Амплитуда Модуляции: Осциллятор 2 модулирует амплитуду (громкость) осциллятора 3. In addition to dedicated modulators, Monstro allows oscillator 3 to be modulated by the output of oscillator 2. FM means frequency modulation: Oscillator 3's frequency (pitch) is modulated by oscillator 2. The frequency modulation is implemented as phase modulation, which gives a more stable overall pitch than "pure" frequency modulation. - + В дополнение к выделенным модуляторам Монстро позволяет выходу осциллятора 2 модулировать осцллятор 3. + +FM (ЧМ) режим значит Частотная Модуляция: Осциллятор 2 модулирует частоту (pitch, тональность) осциллятора 3. Частота модуляции происходит в фазе модуляции, которая даёт более стабильный общий тон, чем "чистая" частотная модуляция. In addition to dedicated modulators, Monstro allows oscillator 3 to be modulated by the output of oscillator 2. PM means phase modulation: Oscillator 3's phase is modulated by oscillator 2. It differs from frequency modulation in that the phase changes are not cumulative. - + В дополнение к выделенным модуляторам Монстро позволяет выходу осциллятора 2 модулировать осцллятор 3. + +PM (ФМ) режим значит фазовая модуляция: Осциллятор 2 модулирует фазу осциллятора 3. Это отличается от частотной модуляции тем, что изменения фаз не суммируются. Select the waveform for LFO 1. "Random" and "Random smooth" are special waveforms: they produce random output, where the rate of the LFO controls how often the state of the LFO changes. The smooth version interpolates between these states with cosine interpolation. These random modes can be used to give "life" to your presets - add some of that analog unpredictability... - + Выберите форму волны для LFO 1 (НизкоЧастотныйГенератор). +"Random" (Случайно) и "Random-smooth" (случайное сглаживание) - это специальные волны: они создают случаный сигнал, где частота LFO контролирует как часто изменяется состояние генератора (LFO). +Сглаженная версия переходит между этими состояниями с косинусоидальной интерплояцией. Эти случайные режимы могут быть использованы, чтобы дать "жизни" вашим настройкам - добавить немного аналоговой непредсказуемости... Select the waveform for LFO 2. "Random" and "Random smooth" are special waveforms: they produce random output, where the rate of the LFO controls how often the state of the LFO changes. The smooth version interpolates between these states with cosine interpolation. These random modes can be used to give "life" to your presets - add some of that analog unpredictability... - + Выберите форму волны для LFO 2 (НизкоЧастотныйГенератор). +"Random" (Случайно) и "Random-smooth" (случайное сглаживание) - это специальные волны: они создают случаный сигнал, где частота LFO контролирует как часто изменяется состояние генератора (LFO). +Сглаженная версия переходит между этими состояниями с косинусоидальной интерплояцией. Эти случайные режимы могут быть использованы, чтобы дать "жизни" вашим настройкам - добавить немного аналоговой непредсказуемости... Attack causes the LFO to come on gradually from the start of the note. - + Атака отвечает за плавность поведения LFO от начала ноты. Rate sets the speed of the LFO, measured in milliseconds per cycle. Can be synced to tempo. - + Rate (Частота) устанавливает скорость LFO, измеряемую в миллисекундах за цикл. Может синхронизироваться с темпом. PHS controls the phase offset of the LFO. - + PHS контролирует сдвиг фазы LFO (НЧГ). PRE, or pre-delay, delays the start of the envelope from the start of the note. 0 means no delay. - + PRE предзадержка, задерживает старт огибающей от начала ноты. 0 значит без задержки. ATT, or attack, controls how fast the envelope ramps up at start, measured in milliseconds. A value of 0 means instant. - + ATT атака контролирует как быстро огибающая наращивается на старте, измеряясь в милисекундах. Значение 0 значит мгновенно. HOLD controls how long the envelope stays at peak after the attack phase. - + HOLD (УДЕРЖ) контролирует как долго огибающая остаётся на пике после фазы атаки. DEC, or decay, controls how fast the envelope falls off from its peak, measured in milliseconds it would take to go from peak to zero. The actual decay may be shorter if sustain is used. - + DEC (decay) затухание контролирует как быстро огибающая спадает с пикового значения, измеряется в милисекундах, как долго будет идти с пика до нуля. Реальное затухание может быть короче, если используется выдержка. SUS, or sustain, controls the sustain level of the envelope. The decay phase will not go below this level as long as the note is held. - + SUS (sustain) выдержка, контролирует уровень огибающей. Затухание фазы не пойдёт ниже этого уровня пока нота удерживается. REL, or release, controls how long the release is for the note, measured in how long it would take to fall from peak to zero. Actual release may be shorter, depending on at what phase the note is released. - + REL (release) отпуск контролирует как долго нота отпускается, измеряясь в долготе падения от пика до нуля. Реальный отпуск может быть короче, в зависимости от фазы, в которой нота отпущена. The slope knob controls the curve or shape of the envelope. A value of 0 creates straight rises and falls. Negative values create curves that start slowly, peak quickly and fall of slowly again. Positive values create curves that start and end quickly, and stay longer near the peaks. - + Регулятор наклона контролирует кривую или образ огибающей. Значение 0 создаёт прямые подъёмы и спады. Отрицательные величины создают кривые с замедленным началом, быстрым пиком и снова замедленным спадом. Позитивные значения создают кривые которые начинаются и кончаются быстро, но долбше остаются на пиках. @@ -4448,7 +4478,7 @@ PM means phase modulation: Oscillator 3's phase is modulated by oscillator Swap left and right input channel for reflections - + Поменять вход левого и правого канала для отзвуков @@ -4578,7 +4608,7 @@ PM means phase modulation: Oscillator 3's phase is modulated by oscillator Osc %1 harmonic - + Осц %1 гармонический @@ -4633,8 +4663,8 @@ PM means phase modulation: Oscillator 3's phase is modulated by oscillator double-click to open this pattern in piano-roll use mouse wheel to set volume of a step - Чтобы открыть этот шаблон в нотном редакторе, дважды на нём щёлкните -Используйте колёсико мыши для установки громкости отдельного шага + Чтобы открыть эту мелодию в нотном редакторе, дважды на нём щёлкните +Используйте колёсико мыши для установки громкости отдельного такта Open in piano-roll @@ -4654,11 +4684,11 @@ use mouse wheel to set volume of a step Add steps - Добавить шаги + Добавить такты Remove steps - Удалить шаги + Удалить такты @@ -4770,14 +4800,14 @@ use mouse wheel to set volume of a step Treshold - + Порог PianoRoll Piano-Roll - no pattern - Нотный редактор - без шаблона + Нотный редактор - нет мелодии Piano-Roll - %1 @@ -4785,7 +4815,7 @@ use mouse wheel to set volume of a step Please open a pattern by double-clicking on it! - Откройте шаблон с помощью двойного щелчка мышью! + Откройте мелодию с помощью двойного щелчка мышью! Last note @@ -4829,135 +4859,135 @@ use mouse wheel to set volume of a step Volume: %1% - + Громкость %1% Panning: %1% left - + Баланс: %1% лево Panning: %1% right - + Баланс: %1% право Panning: center - + Баланс: центр Please enter a new value between %1 and %2: - Введите новое значение от %1 до %2: + Введите новое значение от %1 до %2: PianoRollWindow Play/pause current pattern (Space) - + Игра/Пауза текущей мелодии (Пробел) Record notes from MIDI-device/channel-piano - Записать ноты с цифрового музыкального инструмента (MIDI) + Записать ноты с музыкального инструмента (MIDI)/канала Record notes from MIDI-device/channel-piano while playing song or BB track - Записать ноты с цифрового музыкального инструмента (MIDI) во время воспроизведения композиции или дорожки Ритм-Басса + Записать ноты с цифрового музыкального инструмента (MIDI) во время воспроизведения композиции или дорожки Ритм-Баса Stop playing of current pattern (Space) - + Остановить воспроизведение текущей мелодии (Пробел) Click here to play the current pattern. This is useful while editing it. The pattern is automatically looped when its end is reached. - Нажмите здесь чтобы проиграть текущий шаблон. Это может пригодиться при его редактировании. По окончании шаблона воспроизведение начнётся сначала. + Нажмите здесь чтобы проиграть текущую мелодию. Это может пригодиться при её редактировании. По окончании мелодии воспроизведение начнётся сначала. Click here to record notes from a MIDI-device or the virtual test-piano of the according channel-window to the current pattern. When recording all notes you play will be written to this pattern and you can play and edit them afterwards. - Нажмите эту кнопку, если вы хотите записать ноты с устройства MIDI или виртуального синтезатора соответствующего канала. Позже вы сможете отредактировать записанный шаблон. + Нажмите эту кнопку, если вы хотите записать ноты с устройства MIDI или виртуального синтезатора соответствующего канала. Позже вы сможете отредактировать записанную мелодию. Click here to record notes from a MIDI-device or the virtual test-piano of the according channel-window to the current pattern. When recording all notes you play will be written to this pattern and you will hear the song or BB track in the background. - Нажмите эту кнопку, если вы хотите записать ноты с устройства MIDI или виртуального синтезатора соответствующего канала. Во время записи все ноты записываются в этот шаблон, и вы будете слышать композицию или РБ дорожку на заднем плане. + Нажмите эту кнопку, если вы хотите записать ноты с устройства MIDI или виртуального синтезатора соответствующего канала. Во время записи все ноты записываются в эту мелодию, и вы будете слышать композицию или РБ дорожку на заднем плане. Click here to stop playback of current pattern. - Нажмите здесь, если вы хотите остановить воспроизведение текущего шаблона. + Нажмите здесь, если вы хотите остановить воспроизведение текущей мелодии. Draw mode (Shift+D) - Режим рисования (Shift+D) + Режим рисования (Shift+D) Erase mode (Shift+E) - + Режим стирания (Shift+E) Select mode (Shift+S) - Режим выбора нот (Shift+S) + Режим выбора нот (Shift+S) Detune mode (Shift+T) - Режим подстраивания (Shift+T) + Режим подстраивания (Shift+T) Click here and draw mode will be activated. In this mode you can add, resize and move notes. This is the default mode which is used most of the time. You can also press 'Shift+D' on your keyboard to activate this mode. In this mode, hold Ctrl to temporarily go into select mode. - Режим рисования нот, в нём вы можете добавлять/перемещать и изменять длительность одиночных нот. Это режим по умолчанию и используется большую часть времени. + Режим рисования нот, в нём вы можете добавлять/перемещать и изменять длительность одиночных нот. Это режим по умолчанию и используется большую часть времени. Для включения этого режима можно использовать комбинацию клавиш Shift+D, удерживайте Ctrl для временного переключения в режим выбора. Click here and erase mode will be activated. In this mode you can erase notes. You can also press 'Shift+E' on your keyboard to activate this mode. - Режим стирания. В этом режиме вы можете стирать ноты. Для включения этого режима можно использовать комбинацию клавиш Shift+E. + Режим стирания. В этом режиме вы можете стирать ноты. Для включения этого режима можно использовать комбинацию клавиш Shift+E. Click here and select mode will be activated. In this mode you can select notes. Alternatively, you can hold Ctrl in draw mode to temporarily use select mode. - Режим выделения. В этом режиме можно выделять ноты, можно также удерживать Ctrl в режиме рисования, чтобы можно было на время войти в режим выделения. + Режим выделения. В этом режиме можно выделять ноты, можно также удерживать Ctrl в режиме рисования, чтобы можно было на время войти в режим выделения. Click here and detune mode will be activated. In this mode you can click a note to open its automation detuning. You can utilize this to slide notes from one to another. You can also press 'Shift+T' on your keyboard to activate this mode. - Режим подстройки. В этом режиме можно выбирать ноты для автоматизации их подстраивания. Можно использовать это для переходов нот от одной к другой. Для активации с клавиатуры <Shift+T>. + Режим подстройки. В этом режиме можно выбирать ноты для автоматизации их подстраивания. Можно использовать это для переходов нот от одной к другой. Для активации с клавиатуры <Shift+T>. Cut selected notes (Ctrl+X) - Переместить выделенные ноты в буфер (Ctrl+X) + Переместить выделенные ноты в буфер (Ctrl+X) Copy selected notes (Ctrl+C) - Копировать выделенные ноты в буфер (Ctrl+X) + Копировать выделенные ноты в буфер (Ctrl+X) Paste notes from clipboard (Ctrl+V) - Вставить ноты из буфера (Ctrl+V) + Вставить ноты из буфера (Ctrl+V) Click here and the selected notes will be cut into the clipboard. You can paste them anywhere in any pattern by clicking on the paste button. - При нажатии на эту кнопку выделеные ноты будут вырезаны в буфер. Позже вы можете вставить их в любое место любого шаблона с помощью кнопки "Вставить". + При нажатии на эту кнопку выделеные ноты будут вырезаны в буфер. Позже вы можете вставить их в любое место любой мелодии с помощью кнопки "Вставить". Click here and the selected notes will be copied into the clipboard. You can paste them anywhere in any pattern by clicking on the paste button. - При нажатии на эту кнопку выделеные ноты будут скопированы в буфер. Позже вы можете вставить их в любое место любого шаблона с помощью кнопки "Вставить". + При нажатии на эту кнопку выделеные ноты будут скопированы в буфер. Позже вы можете вставить их в любое место любой мелодии с помощью кнопки "Вставить". Click here and the notes from the clipboard will be pasted at the first visible measure. - При нажатии на эту кнопку ноты из буфера будут вставлены в первый видимый такт. + При нажатии на эту кнопку ноты из буфера будут вставлены в первый видимый такт. This controls the magnification of an axis. It can be helpful to choose magnification for a specific task. For ordinary editing, the magnification should be fitted to your smallest notes. - + Этим контролируется масштаб оси. Это может быть полезно для специальных задач. Для обычного редактирования, масштаб следует устанавливать по наименьшей ноте. The 'Q' stands for quantization, and controls the grid size notes and control points snap to. With smaller quantization values, you can draw shorter notes in Piano Roll, and more exact control points in the Automation Editor. - + "Q" обозначает квантизацию и контролирует размер нотной сетки и контрольные точки притяжения. С меньшей величиной квантизации, можно рисовать короткие ноты в редаторе нот и более точно контролировать точки в Редакторе Автоматизации. This lets you select the length of new notes. 'Last Note' means that LMMS will use the note length of the note you last edited - + Позволяет выбрть длину новой ноты. "Последняя Нота" значит, что LMMS будет использовать длину ноты, изменённой в последний раз The feature is directly connected to the context-menu on the virtual keyboard, to the left in Piano Roll. After you have chosen the scale you want in this drop-down menu, you can right click on a desired key in the virtual keyboard, and then choose 'Mark current Scale'. LMMS will highlight all notes that belongs to the chosen scale, and in the key you have selected! - + Функция напрямую связана с контекстным меню на виртуальной клавиатуре слева в нотном редакторе. После того, как выбран масштаб в выпадающем меню, можно кликнуть правой кнопкой в виртуальной клавиатуре и выбрать "Mark Current Scale" (Отметить текущий масштаб). LMMS подсветит все ноты лежащие в выбранном масштабе для выбранной клавиши! Let you select a chord which LMMS then can draw or highlight.You can find the most common chords in this drop-down menu. After you have selected a chord, click anywhere to place the chord, and right click on the virtual keyboard to open context menu and highlight the chord. To return to single note placement, you need to choose 'No chord' in this drop-down menu. - + Позволяет выбрать аккорд, который LMMS затем сможет нарисовать или подсветить. В этом меню можно найти ниболее популярные аккорды. После того, как вы выбрали аккорд, кликните в любом месте, чтобы поставить его и правым кликом по виртуальной клавиатуре открывается контекстное меню и подсветка аккорда. Для возврата в режим одной ноты нужно выбрать "Без аккорда" в этом выпадающем меню. @@ -4989,117 +5019,117 @@ Reason: "%2" LMMS plugin %1 does not have a plugin descriptor named %2! - + ЛММС плагин %1 не имеет описания плагина с именем %2! PluginBrowser Instrument plugins - Инструменты + Плагины инструментов Instrument browser - Обзор инструментов + Обзор инструментов Drag an instrument into either the Song-Editor, the Beat+Bassline Editor or into an existing instrument track. - Вы можете переносить нужные вам инструменты из этой панели в музыкальный, ритм-басс редактор или в существующую дорожку инструмента. + Вы можете переносить нужные вам инструменты из этой панели в музыкальный, ритм-бас редактор или в существующую дорожку инструмента. ProjectNotes Project notes - Заметки к проекту + Заметки к проекту Put down your project notes here. - Здесь вы можете держать заметки к своему проекту. + Здесь вы можете держать заметки к своему проекту. Edit Actions - Правка + Правка &Undo - &U Отменить + &U Отменить Ctrl+Z - Ctrl+Z + Ctrl+Z &Redo - &R Повторить + &R Повторить Ctrl+Y - Ctrl+Y + Ctrl+Y &Copy - &C Копировать + &C Копировать Ctrl+C - Ctrl+C + Ctrl+C Cu&t - &t Вырезать + &t Вырезать Ctrl+X - Ctrl+X + Ctrl+X &Paste - &P Вставить + &P Вставить Ctrl+V - Ctrl+V + Ctrl+V Format Actions - Форматирование + Форматирование &Bold - Полу&жирный + &b Полужирный Ctrl+B - Ctrl+B + Ctrl+B &Italic - &Курсив + &i Курсив Ctrl+I - + Ctrl+I &Underline - &Подчеркнуть + &U Подчеркнутый Ctrl+U - + Ctrl+U &Left - По &левому краю + &L По левому краю Ctrl+L - + Ctrl+L C&enter - По &центру + По &центру Ctrl+E @@ -5261,7 +5291,7 @@ Reason: "%2" In Place Broken: - Вместо сломанного: + Вместо сломанного: Channels In: @@ -5273,14 +5303,14 @@ Reason: "%2" File: %1 - + Файл: %1 RenameDialog Rename... - Переименовать... + Переименовать... @@ -5327,7 +5357,7 @@ Reason: "%2" All Audio-Files (*.wav *.ogg *.ds *.flac *.spx *.voc *.aif *.aiff *.au *.raw) - + Все аудио файлы (*.wav *.ogg *.ds *.flac *.spx *.voc *.aif *.aiff *.au *.raw) @@ -5374,7 +5404,7 @@ Reason: "%2" Panning - + Баланс @@ -5393,162 +5423,162 @@ Reason: "%2" Panning - + Баланс Panning: - + Баланс: PAN - БАЛ + БАЛ SetupDialog Setup LMMS - Настройка LMMS + Настройка LMMS General settings - Общие параметры + Общие параметры BUFFER SIZE - РАЗМЕР БУФЕРА + РАЗМЕР БУФЕРА Reset to default-value - Восстановить значение по умолчанию + Восстановить значение по умолчанию MISC - РАЗНОЕ + РАЗНОЕ Enable tooltips - Включить подсказки + Включить подсказки Show restart warning after changing settings - Показывать предупреждение о перезапуске при изменении настроек + Показывать предупреждение о перезапуске при изменении настроек Display volume as dBV - Отображать громкости в децибелах (напр.) + Отображать громкость в децибелах dBV Compress project files per default - По умолчанию сжимать файлы проектов + По умолчанию сжимать файлы проектов One instrument track window mode - Режим окна одной инструментальной дорожки + Режим окна одной инструментальной дорожки HQ-mode for output audio-device - Режим высокого качества для вывода звука + Режим высокого качества для устройства вывода звука Compact track buttons - Ужать кнопки дорожки + Ужать кнопки дорожки Sync VST plugins to host playback - Синхронизировать VST плагины с хостом воспроизведения + Синхронизировать VST плагины с хостом воспроизведения Enable note labels in piano roll - Включить обозначение нот в музыкальном редакторе + Включить обозначение нот в музыкальном редакторе Enable waveform display by default - Включить отображение формы звуков по умолчанию + Включить отображение формы звуков по умолчанию Keep effects running even without input - + Продолжать работу эффектов даже без входящего сигнала Create backup file when saving a project - + Создать запасной файл при сохранении проекта LANGUAGE - + ЯЗЫК Paths - Пути + Пути LMMS working directory - Рабочий каталог LMMS + Рабочий каталог LMMS VST-plugin directory - Каталог модулей VST + Каталог модулей VST Artwork directory - Каталог с элементами оформления + Каталог с элементами оформления Background artwork - Фоновое изображение + Фоновое изображение FL Studio installation directory - Каталог установки FL Studio + Каталог установки FL Studio LADSPA plugin paths - Пути модулей LADSPA + Пути модулей LADSPA STK rawwave directory - Каталог STK rawwave + Каталог STK rawwave Default Soundfont File - Основной Soundfont файл + Основной Soundfont файл Performance settings - Параметры производительности + Параметры производительности UI effects vs. performance - Визуальные эффекты/производительность + Визуальные эффекты/производительность Smooth scroll in Song Editor - Плавная прокрутка в музыкальном редакторе + Плавная прокрутка в музыкальном редакторе Enable auto save feature - Включить функцию авто-сохранения + Включить функцию авто-сохранения Show playback cursor in AudioFileProcessor - Показывать указатель воспроизведения в процессоре аудио файлов + Показывать указатель воспроизведения в процессоре аудио файлов (AFP) Audio settings - Параметры звука + Параметры звука AUDIO INTERFACE - ЗВУКОВАЯ СИСТЕМА + ЗВУКОВАЯ СИСТЕМА MIDI settings - Параметры MIDI + Параметры MIDI MIDI INTERFACE - ИНТЕРФЕЙС MIDI + MIDI СИСТЕМА OK @@ -5556,65 +5586,65 @@ Reason: "%2" Cancel - Отменить + Отменить Restart LMMS - Перезапустите LMMS + Перезапустить LMMS Please note that most changes won't take effect until you restart LMMS! - Учтите, что большинство настроек не вступят в силу до перезапуска программы! + Учтите, что большинство настроек не вступят в силу до перезапуска ЛММС! Frames: %1 Latency: %2 ms - Фрагментов: %1 + Фрагментов: %1 Отклик: %2 Here you can setup the internal buffer-size used by LMMS. Smaller values result in a lower latency but also may cause unusable sound or bad performance, especially on older computers or systems with a non-realtime kernel. - Здесь вы можете настроить размер внутреннего звукового буфера LMMS. Меньшие значения дают меньшее время отклика программы, но повышают потребление ресурсов - это особенно заметно на старых машинах и системах, ядро которых не поддерживает приоритета реального времени. Если наблюдается прерывистый звук, попробуйте увеличить размер буфера. + Здесь вы можете настроить размер внутреннего звукового буфера LMMS. Меньшие значения дают меньшее время отклика программы, но повышают потребление ресурсов - это особенно заметно на старых машинах и системах, ядро которых не поддерживает приоритета реального времени. Если наблюдается прерывистый звук, попробуйте увеличить размер буфера. Choose LMMS working directory - Выбор рабочего каталога LMMS + Выбор рабочего каталога LMMS Choose your VST-plugin directory - Выбор своего каталога для модулей VST + Выбор своего каталога для модулей VST Choose artwork-theme directory - Выбор каталога с темой оформления для LMMS + Выбор каталога с темой оформления для LMMS Choose FL Studio installation directory - Выбор каталога установленной FL Studio + Выбор каталога установленной FL Studio Choose LADSPA plugin directory - Выбор каталога с модулями LADSPA + Выбор каталога с модулями LADSPA Choose STK rawwave directory - Выбор каталога STK rawwave + Выбор каталога STK rawwave Choose default SoundFont - Выбрать главный SoundFont + Выбрать главный SoundFont Choose background artwork - Выбрать фоновое изображение + Выбрать фоновое изображение Here you can select your preferred audio-interface. Depending on the configuration of your system during compilation time you can choose between ALSA, JACK, OSS and more. Below you see a box which offers controls to setup the selected audio-interface. - Пожалуйста, выберите звуковую систему. В зависимости от конфигурации во время компилирования программы, вы можете использовать ALSA, JACK, OSS и другие. В нижней части окна настройки можно задать специфические параметры выбранной системы. + Пожалуйста, выберите желаемую звуковую систему. В зависимости от конфигурации во время компилирования программы вы можете использовать ALSA, JACK, OSS и другие. В нижней части окна настройки можно задать специфические параметры выбранной системы. Here you can select your preferred MIDI-interface. Depending on the configuration of your system during compilation time you can choose between ALSA, OSS and more. Below you see a box which offers controls to setup the selected MIDI-interface. - Пожалуйста, выберите интерфейс MIDI. В зависимости от конфигурации во время компилирования программы, вы можете использовать ALSA, OSS и другие. В нижней части окна настройки можно задать специфические параметры выбранного интерфейса. + Пожалуйста, выберите интерфейс MIDI. В зависимости от конфигурации во время компилирования программы вы можете использовать ALSA, OSS и другие. В нижней части окна настройки можно задать специфические параметры выбранного интерфейса. @@ -5633,63 +5663,63 @@ Latency: %2 ms Project saved - Проект сохранён + Проект сохранён The project %1 is now saved. - Проект %1 сохранён. + Проект %1 сохранён. Project NOT saved. - Проект НЕ СОХРАНЁН. + Проект НЕ СОХРАНЁН. The project %1 was not saved! - Проект %1 не сохранён! + Проект %1 не сохранён! Import file - Импорт файла + Импорт файла MIDI sequences - MiDi последовательности + MiDi последовательности FL Studio projects - FL Studio проекты + FL Studio проекты Hydrogen projects - Hydrogen проекты + Hydrogen проекты All file types - Все типы файлов + Все типы файлов Empty project - Проект пуст + Пустой проект This project is empty so exporting makes no sense. Please put some items into Song Editor first! - Проект ничего не содержит, так что и экспортировать нечего. Сначала добавьте хотя бы одну дорожку с помощью музыкального редактора! + Проект ничего не содержит, так что и экспортировать нечего. Сначала добавьте хотя бы одну дорожку в музыкальном редакторе! Select directory for writing exported tracks... - Выберите папку для записи экспортированных дорожек... + Выберите папку для записи экспортированных дорожек... untitled - Неназванное + Неназванное Select file for project-export... - Выбор файла для экспорта проекта... + Выбор файла для экспорта проекта... The following errors occured while loading: - + Следующие ошибки возникли при загрузке: @@ -5769,84 +5799,84 @@ Latency: %2 ms SongEditorWindow Song-Editor - Музыкальный редактор + Музыкальный редактор Play song (Space) - Начать воспроизведение (Пробел) + Начать воспроизведение (Пробел) Record samples from Audio-device - Записать сэмпл со звукового устройства + Записать сэмпл со звукового устройства Record samples from Audio-device while playing song or BB track - Записать сэмпл с аудио-устройства во время воспроизведения в музыкальном или ритм/басс редакторе + Записать сэмпл с аудио-устройства во время воспроизведения в музыкальном или ритм/бас редакторе Stop song (Space) - Остановить воспроизведение (Пробел) + Остановить воспроизведение (Пробел) Add beat/bassline - + Добавить ритм/бас Add sample-track - Добавить дорожку записи + Добавить дорожку записи Add automation-track - Добавить дорожку автоматизации + Добавить дорожку автоматизации Draw mode - Режим рисования + Режим рисования Edit mode (select and move) - Правка (выделение/перемещение) + Правка (выделение/перемещение) Click here, if you want to play your whole song. Playing will be started at the song-position-marker (green). You can also move it while playing. - Нажмите, чтобы прослушать созданную мелодию. Воспроизведение начнётся с позиции курсора (зелёный треугольник); вы можете двигать его во время проигрывания. + Нажмите, чтобы прослушать созданную мелодию. Воспроизведение начнётся с позиции курсора (зелёный треугольник); вы можете двигать его во время проигрывания. Click here, if you want to stop playing of your song. The song-position-marker will be set to the start of your song. - Нажмите сюда, если вы хотите остановить воспроизведение мелодии. Курсор при этом будет установлен на начало композиции. + Нажмите сюда, если вы хотите остановить воспроизведение мелодии. Курсор при этом будет установлен на начало композиции. SpectrumAnalyzerControlDialog Linear spectrum - Линейный спектр + Линейный спектр Linear Y axis - Линейная ось ординат + Линейная ось ординат (Y) SpectrumAnalyzerControls Linear spectrum - Линейный спектр + Линейный спектр Linear Y axis - Линейная ось ординат + Линейная ось ординат (Y) Channel mode - Режим канала + Режим канала TabWidget Settings for %1 - + Настройки для %1 @@ -5935,46 +5965,46 @@ Latency: %2 ms TimeLineWidget Enable/disable auto-scrolling - Вкл/выкл автопрокрутку + Вкл/выкл автопрокрутку Enable/disable loop-points - Вкл/выкл точки кольцевания + Вкл/выкл точки петли After stopping go back to begin - После остановки переходить к началу + После остановки переходить к началу After stopping go back to position at which playing was started - После остановки переходить к месту, с которого началось воспроизведение + После остановки переходить к месту, с которого началось воспроизведение After stopping keep position - Оставаться на месте остановки + Оставаться на месте остановки Hint - Подсказка + Подсказка Press <Ctrl> to disable magnetic loop points. - Нажмите <Ctrl>, чтобы убрать прилипание точек цикла + Нажмите <Ctrl>, чтобы убрать прилипание точек петли. Hold <Shift> to move the begin loop point; Press <Ctrl> to disable magnetic loop points. - Зажмите <Shift> чтобы сдвинуть начало точек цикла; Нажмите <Ctrl>, чтобы убрать прилипание точек цикла + Зажмите <Shift> чтобы сдвинуть начало точек петли; Нажмите <Ctrl>, чтобы убрать прилипание точек петли. Track Muted - Тихо + Тихо Solo - Соло + Соло @@ -6024,101 +6054,101 @@ Please make sure you have read-permission to the file and the directory containi TrackContentObject Muted - Тихо + Тихо TrackContentObjectView Current position - Позиция + Текущая позиция Hint - Подсказка + Подсказка Press <Ctrl> and drag to make a copy. - Нажмите <Ctrl> и перетащите, чтобы создать копию. + Нажмите <Ctrl> и тащите мышью, чтобы создать копию. Current length - Длительность + Текущая длительность Press <Ctrl> for free resizing. - Для свободного изменения размера нажмите <Ctrl>. + Для свободного изменения размера нажмите <Ctrl>. %1:%2 (%3:%4 to %5:%6) - %1:%2 (от %3:%4 до %5:%6) + %1:%2 (от %3:%4 до %5:%6) Delete (middle mousebutton) - Удалить (средняя кнопка мыши) + Удалить (средняя кнопка мыши) Cut - Вырезать + Вырезать Copy - Копировать + Копировать Paste - Вставить + Вставить Mute/unmute (<Ctrl> + middle click) - + Тихо/громко (<Ctrl> + middle click) TrackOperationsWidget Press <Ctrl> while clicking on move-grip to begin a new drag'n'drop-action. - Зажмите <Сtrl> и нажимайте мышь во время движения, чтобы начать новую переброску. + Зажмите <Сtrl> и нажимайте мышь во время движения, чтобы начать новую переброску. Actions for this track - Действия для этой дорожки + Действия для этой дорожки Mute - Заглушить + Тихо Solo - Соло + Соло Mute this track - Отключить дорожку + Заглушить эту дорожку Clone this track - Клонировать дорожку + Клонировать дорожку Remove this track - Удалить дорожку + Удалить дорожку Clear this track - + Очистить эту дорожку FX %1: %2 - + ЭФ %1: %2 Turn all recording on - + Включить всё на запись Turn all recording off - + Выключить всю запись @@ -6370,11 +6400,11 @@ Please make sure you have read-permission to the file and the directory containi VisualizationWidget click to enable/disable visualization of master-output - Нажмите, чтобы включить/выключить визуализацию главного вывода + Нажмите, чтобы включить/выключить визуализацию главного вывода Click to enable - Нажать для включения + Нажать для включения @@ -6480,11 +6510,11 @@ Please make sure you have read-permission to the file and the directory containi Please wait while loading VST plugin... - + Пожалуйста, подождите пока грузится VST плагин... The VST plugin %1 could not be loaded. - + VST плагин %1 не может быть загружен. @@ -6603,7 +6633,7 @@ Please make sure you have read-permission to the file and the directory containi Selected graph - + Выбранный граф @@ -6630,15 +6660,15 @@ Please make sure you have read-permission to the file and the directory containi Modulate amplitude of A1 with output of A2 - + Модулировать амплитуду A1 сигналом с A2 Ring-modulate A1 and A2 - + Кольцевая модуляция А1 и А2 Modulate phase of A1 with output of A2 - + Модулировать фазу A1 сигналом с A2 Mix output of B2 to B1 @@ -6646,19 +6676,19 @@ Please make sure you have read-permission to the file and the directory containi Modulate amplitude of B1 with output of B2 - + Модулировать амплитуду B1 сигналом с B2 Ring-modulate B1 and B2 - + Кольцевая модуляция B1 и B2 Modulate phase of B1 with output of B2 - + Модулировать фазу B1 сигналом с B2 Draw your own waveform here by dragging your mouse on this graph. - Здесь вы можете рисовать собственный сигнал. + Здесь вы можете рисовать собственный сигнал передвигая зажатой мышью по этому графу. Load waveform @@ -6666,11 +6696,11 @@ Please make sure you have read-permission to the file and the directory containi Click to load a waveform from a sample file - + Кликнуть для загрузки формы звука из файла с образцом Phase left - + Фаза слева Click to shift phase by -15 degrees @@ -6678,7 +6708,7 @@ Please make sure you have read-permission to the file and the directory containi Phase right - + Фаза справа Click to shift phase by +15 degrees @@ -6686,7 +6716,7 @@ Please make sure you have read-permission to the file and the directory containi Normalize - Нормализовать + Нормализовать Click to normalize @@ -6702,7 +6732,7 @@ Please make sure you have read-permission to the file and the directory containi Smooth - Сгладить + Сгладить Click to smooth @@ -6710,7 +6740,7 @@ Please make sure you have read-permission to the file and the directory containi Sine wave - Синусоида + Синусоида Click for sine wave @@ -6984,7 +7014,7 @@ Please make sure you have read-permission to the file and the directory containi Input gain: - + Входная мощность: OUTPUT @@ -6992,7 +7022,7 @@ Please make sure you have read-permission to the file and the directory containi Output gain: - + Выходная мощность: ATTACK @@ -7000,7 +7030,7 @@ Please make sure you have read-permission to the file and the directory containi Peak attack time: - + Время пиковой атаки: RELEASE @@ -7008,7 +7038,7 @@ Please make sure you have read-permission to the file and the directory containi Peak release time: - + Время отпуска пика: Reset waveform @@ -7016,7 +7046,7 @@ Please make sure you have read-permission to the file and the directory containi Click here to reset the wavegraph back to default - + Нажмите здесь, чтобы скинуть граф волны обратно по умолчанию Smooth waveform @@ -7024,7 +7054,7 @@ Please make sure you have read-permission to the file and the directory containi Click here to apply smoothing to wavegraph - + Нажмите здесь, чтобы применить сглаживание графа волны Increase wavegraph amplitude by 1dB @@ -7032,7 +7062,7 @@ Please make sure you have read-permission to the file and the directory containi Click here to increase wavegraph amplitude by 1dB - + Нажмите здесь, чтобы увеличить амплитуду графа волны на 1дБ Decrease wavegraph amplitude by 1dB @@ -7040,7 +7070,7 @@ Please make sure you have read-permission to the file and the directory containi Click here to decrease wavegraph amplitude by 1dB - + Нажмите здесь, чтобы снизить амплитуду графа волны на 1дБ Stereomode Maximum @@ -7048,7 +7078,7 @@ Please make sure you have read-permission to the file and the directory containi Process based on the maximum of both stereo channels - + Процесс основанный на максимуме от обоих каналов Stereomode Average @@ -7056,7 +7086,7 @@ Please make sure you have read-permission to the file and the directory containi Process based on the average of both stereo channels - + Процесс основанный на средней обоих каналов Stereomode Unlinked @@ -7064,7 +7094,7 @@ Please make sure you have read-permission to the file and the directory containi Process each stereo channel independently - + Обрабатывает каждый стерео канал независимо @@ -7227,7 +7257,7 @@ Analysis Tools are plugins for which only input channels were identified. Don't Knows are plugins for which no input or output channels were identified. Double clicking any of the plugins will bring up information on the ports. - В этом окне показана информация обо всех модулях LADSPA, которые обнаружила LMMS. Они разделены на пять категорий, в зависимости от названий и типов портов. + В этом окне показана информация обо всех модулях LADSPA, которые обнаружила LMMS. Они разделены на пять категорий, в зависимости от названий и типов портов. Доступные эффекты — это те, которые могут быть использоаны в LMMS. Чтобы эффект LADSPA мог быть использован, он должен, во-первых, быть собственно эффектом, т. е. иметь как входные так и выходные каналы. LMMS в качестве входного канала воспринимает аудиопорт, содержащий в названии „in“, а выходные узнаёт по подстроке „out“. Для использования в LMMS число входных каналов должно совпадать с числом выходных, и эффект должен иметь возможность использования в реальном времени. @@ -7239,7 +7269,7 @@ Double clicking any of the plugins will bring up information on the ports. +Двойной щелчок левой кнопкой мыши по модулю даст информацию о его портах. Type: @@ -7472,7 +7502,7 @@ Double clicking any of the plugins will bring up information on the ports. Click here for bandlimited saw wave. - + Нажать здесь для пилообразной волны с ограниченной полосой. Bandlimited square wave @@ -7480,7 +7510,7 @@ Double clicking any of the plugins will bring up information on the ports. Click here for bandlimited square wave. - + Нажать здесь для квадратной волны с ограниченной полосой. Bandlimited triangle wave @@ -7488,7 +7518,7 @@ Double clicking any of the plugins will bring up information on the ports. Click here for bandlimited triangle wave. - + Нажать здесь для треуголной волны с ограниченной полосой. Bandlimited moog saw wave @@ -7496,7 +7526,7 @@ Double clicking any of the plugins will bring up information on the ports. Click here for bandlimited moog saw wave. - + Нажать здесь для пилообразной муг (moog) волны с ограниченной полосой. @@ -8091,23 +8121,23 @@ Double clicking any of the plugins will bring up information on the ports. The distortion knob adds distortion to the output of the instrument. - + Дисторшн добавляет искажения к выводу инструмента. The volume knob controls the volume of the output of the instrument. It is cumulative with the instrument window's volume control. - + Регулятор громкости вывода инструмента, суммируется с регулятором громкости окна инструмента. The randomize button randomizes all knobs except the harmonics,main volume and distortion knobs. - + Кнопка рандомизации случайно устанавливает все регуляторы, кроме гармоник, основной громкости и регулятора искажений (дисторшн). Osc %1 stereo detuning - + Осц %1 стерео расстройка Osc %1 harmonic: - + Осц %1 гармоника: @@ -8237,11 +8267,11 @@ Double clicking any of the plugins will bring up information on the ports. Length of each step in sweep: - Длина каждого шага в развёртке: + Длина каждого такта в развёртке: Length of each step in sweep - Длина каждого шага в развёртке + Длина каждого такта в развёртке Wave pattern duty @@ -8369,7 +8399,7 @@ Double clicking any of the plugins will bring up information on the ports. The delay between step change - Задержка между изменениями шага + Задержка между изменениями такта Draw the wave here @@ -8470,19 +8500,19 @@ This chip was used in the Commodore 64 computer. Monstrous 3-oscillator synth with modulation matrix - + Монстро 3-осциляторный синт с матрицей модуляции Three powerful oscillators you can modulate in several ways - + Три мощных осциллятора, которые можно модулировать несколькими способами A native amplifier plugin - + Родной плагин усилителя Carla Rack Instrument - + Карла инструментальная стойка 4-oscillator modulatable wavetable synth @@ -8490,11 +8520,11 @@ This chip was used in the Commodore 64 computer. plugin for waveshaping - + Плагин для сглаживания волн Boost your bass the fast and simple way - + Накачай свой бас быстро и просто Versatile drum synthesizer @@ -8546,7 +8576,7 @@ This chip was used in the Commodore 64 computer. A native eq plugin - + Родной плагин эквалайзера A 4-band Crossover Equalizer @@ -8569,11 +8599,11 @@ This chip was used in the Commodore 64 computer. PulseAudio (bad latency!) - + PulseAudio (большая задержка!) Dummy (no MIDI support) - + Dummy (без поддержки MIDI) ALSA Raw-MIDI (Advanced Linux Sound Architecture) @@ -8585,7 +8615,7 @@ This chip was used in the Commodore 64 computer. Dummy (no sound output) - + Dummy (без вывода звука) ALSA (Advanced Linux Sound Architecture) @@ -8660,7 +8690,7 @@ This chip was used in the Commodore 64 computer. A soundfont %1 could not be loaded. - + Soundfont %1 не удаётся загрузить. @@ -9283,19 +9313,19 @@ The LED in the lower right corner of the waveform editor determines whether the waveShaperControlDialog INPUT - + ВХОД Input gain: - + Входная мощность: OUTPUT - + Выход Output gain: - + Выходная мощность: Reset waveform @@ -9303,7 +9333,7 @@ The LED in the lower right corner of the waveform editor determines whether the Click here to reset the wavegraph back to default - + Сбросить граф волны обратно по умолчанию Smooth waveform @@ -9311,7 +9341,7 @@ The LED in the lower right corner of the waveform editor determines whether the Click here to apply smoothing to wavegraph - + Применить сглаживание к графу волны Increase graph amplitude by 1dB @@ -9319,7 +9349,7 @@ The LED in the lower right corner of the waveform editor determines whether the Click here to increase wavegraph amplitude by 1dB - + Повыситьить амплитуду графа волны на 1дБ Decrease graph amplitude by 1dB @@ -9327,7 +9357,7 @@ The LED in the lower right corner of the waveform editor determines whether the Click here to decrease wavegraph amplitude by 1dB - + Снизить амплитуду графа волны на 1дБ Clip input @@ -9335,18 +9365,18 @@ The LED in the lower right corner of the waveform editor determines whether the Clip input signal to 0dB - + Срезать входной сигнал до 0дБ waveShaperControls Input gain - + Входная мощность Output gain - + Выходная мощность From 826591817a3ef601bfd8e59d3e0cad664b08ea3a Mon Sep 17 00:00:00 2001 From: mohamed Date: Wed, 4 Feb 2015 22:36:03 +0100 Subject: [PATCH 060/133] adding midiexport plugin to the list --- plugins/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index d7b4cf11e..56212ef3e 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -20,6 +20,7 @@ ADD_SUBDIRECTORY(LadspaEffect) ADD_SUBDIRECTORY(lb302) #ADD_SUBDIRECTORY(lb303) ADD_SUBDIRECTORY(MidiImport) +ADD_SUBDIRECTORY(MidiExport) ADD_SUBDIRECTORY(MultitapEcho) ADD_SUBDIRECTORY(monstro) ADD_SUBDIRECTORY(nes) From 9b7ac3b3db8ac075be9010d533875d0588c33785 Mon Sep 17 00:00:00 2001 From: mohamed Date: Wed, 4 Feb 2015 22:36:34 +0100 Subject: [PATCH 061/133] cleaning up event ordering function --- plugins/MidiExport/MidiFile.hpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/plugins/MidiExport/MidiFile.hpp b/plugins/MidiExport/MidiFile.hpp index 33955e10a..0e2bfbe5b 100644 --- a/plugins/MidiExport/MidiFile.hpp +++ b/plugins/MidiExport/MidiFile.hpp @@ -186,19 +186,7 @@ struct Event // events are sorted by their time inline bool operator < (const Event& b) const { - if (this->time < b.time) return true; -#if 0 - if (this->type < b.type) return true; - if (this->pitch < b.pitch) return true; - if (this->duration < b.duration) return true; - if (this->volume < b.volume) return true; - #if 1 - if (this->programNumber < b.programNumber) return true; - if (this->channel < b.channel) return true; - if (this->trackName < b.trackName) return true; - #endif -#endif - return false; + return this->time < b.time; } }; From 8d5077af96497db2071f0680ad60b0b7467fdb46 Mon Sep 17 00:00:00 2001 From: mohamed Date: Wed, 4 Feb 2015 22:37:00 +0100 Subject: [PATCH 062/133] adding menu entry file->export midi --- src/gui/MainWindow.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index b8ddd6071..b37c3a79b 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -273,6 +273,12 @@ void MainWindow::finalize() SLOT( exportProjectTracks() ), Qt::CTRL + Qt::SHIFT + Qt::Key_E ); + project_menu->addAction( embed::getIconPixmap( "midi_file" ), + tr( "E&xport MIDI..." ), + Engine::getSong(), + SLOT( exportProjectMidi() ), + Qt::CTRL + Qt::Key_M ); + project_menu->addSeparator(); project_menu->addAction( embed::getIconPixmap( "exit" ), tr( "&Quit" ), qApp, SLOT( closeAllWindows() ), From 2260907285284b8c4b5b7cfee9a217ee3ff57785 Mon Sep 17 00:00:00 2001 From: mohamed Date: Wed, 4 Feb 2015 22:37:43 +0100 Subject: [PATCH 063/133] adding exportProjectMidi method, internally uses midiexport plugin --- include/Song.h | 1 + src/core/Song.cpp | 59 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/include/Song.h b/include/Song.h index 5da09818a..487e856a6 100644 --- a/include/Song.h +++ b/include/Song.h @@ -268,6 +268,7 @@ public slots: void importProject(); void exportProject(bool multiExport=false); void exportProjectTracks(); + void exportProjectMidi(); void startExport(); void stopExport(); diff --git a/src/core/Song.cpp b/src/core/Song.cpp index 7198416cc..7942b6452 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -47,6 +47,7 @@ #include "FxMixerView.h" #include "GuiApplication.h" #include "ImportFilter.h" +#include "ExportFilter.h" #include "InstrumentTrack.h" #include "MainWindow.h" #include "FileDialog.h" @@ -1275,6 +1276,64 @@ void Song::exportProject(bool multiExport) } +void Song::exportProjectMidi() +{ + if( isEmpty() ) + { + QMessageBox::information( gui->mainWindow(), + tr( "Empty project" ), + tr( "This project is empty so exporting makes " + "no sense. Please put some items into " + "Song Editor first!" ) ); + return; + } + + FileDialog efd( gui->mainWindow() ); + + efd.setFileMode( FileDialog::AnyFile ); + + QStringList types; + types << tr("MIDI File (*.mid)"); + efd.setNameFilters( types ); + QString base_filename; + if( !m_fileName.isEmpty() ) + { + efd.setDirectory( QFileInfo( m_fileName ).absolutePath() ); + base_filename = QFileInfo( m_fileName ).completeBaseName(); + } + else + { + efd.setDirectory( ConfigManager::inst()->userProjectsDir() ); + base_filename = tr( "untitled" ); + } + efd.selectFile( base_filename + ".mid" ); + efd.setWindowTitle( tr( "Select file for project-export..." ) ); + + efd.setAcceptMode( FileDialog::AcceptSave ); + + + if( efd.exec() == QDialog::Accepted && !efd.selectedFiles().isEmpty() && !efd.selectedFiles()[0].isEmpty() ) + { + const QString suffix = ".mid"; + + QString export_filename = efd.selectedFiles()[0]; + if (!export_filename.endsWith(suffix)) export_filename += suffix; + + // NOTE start midi export + + // instantiate midi export plugin + TrackContainer::TrackList tracks; + tracks += Engine::getSong()->tracks(); + tracks += Engine::getBBTrackContainer()->tracks(); + ExportFilter *exf = dynamic_cast (Plugin::instantiate("midiexport", NULL, NULL)); + if (exf==NULL) { + qDebug() << "failed to load midi export filter!"; + return; + } + exf->tryExport(tracks, Engine::getSong()->getTempo(), export_filename); + } +} + void Song::updateFramesPerTick() From 0a48b2f7bc3bce6eb88b02d6984029440b314582 Mon Sep 17 00:00:00 2001 From: Lukas W Date: Thu, 5 Feb 2015 17:40:16 +0100 Subject: [PATCH 064/133] Fix: Respect custom working directory whenw riting recovery file Fixes #1726 --- include/ConfigManager.h | 5 ++--- src/core/ConfigManager.cpp | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/ConfigManager.h b/include/ConfigManager.h index b22792288..0db1cd789 100644 --- a/include/ConfigManager.h +++ b/include/ConfigManager.h @@ -140,9 +140,9 @@ public: return m_ladDir; } - const QString & recoveryFile() const + const QString recoveryFile() const { - return m_recoveryFile; + return m_workingDir + "recover.mmp"; } #ifdef LMMS_HAVE_STK @@ -206,7 +206,6 @@ private: QString m_vstDir; QString m_flDir; QString m_ladDir; - QString m_recoveryFile; #ifdef LMMS_HAVE_STK QString m_stkDir; #endif diff --git a/src/core/ConfigManager.cpp b/src/core/ConfigManager.cpp index c556870c3..7fb9cbc5e 100644 --- a/src/core/ConfigManager.cpp +++ b/src/core/ConfigManager.cpp @@ -66,8 +66,7 @@ ConfigManager::ConfigManager() : m_pluginDir( qApp->applicationDirPath() + '/' + PLUGIN_DIR ), #endif m_vstDir( m_workingDir + "vst" + QDir::separator() ), - m_flDir( QDir::home().absolutePath() ), - m_recoveryFile( QDir(m_workingDir).absoluteFilePath("recover.mmp") ) + m_flDir( QDir::home().absolutePath() ) { } From 94e9d5b137cb02832c1b3eb51453f8ab3fc9c733 Mon Sep 17 00:00:00 2001 From: Lukas W Date: Thu, 5 Feb 2015 17:48:51 +0100 Subject: [PATCH 065/133] Travis: no make verbose output [skip ci] --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 390f7f0b6..24c6df1c9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ before_script: - mkdir build && cd build script: - sh ${TRAVIS_BUILD_DIR}/.travis/${TRAVIS_OS_NAME}.${TARGET_OS}.script.sh - - make -j4 VERBOSE=1 + - make -j4 - if [[ $TARGET_OS != win* ]]; then make tests && ./tests/tests; fi; before_deploy: make package deploy: From afb0777a6ef2cfd3d0fd547b31994de6baa0e1de Mon Sep 17 00:00:00 2001 From: tresf Date: Sun, 8 Feb 2015 18:22:14 -0500 Subject: [PATCH 066/133] Remove "(bad latency!)" warning from PulseAudio --- data/locale/ca.ts | 2 +- data/locale/cs.ts | 2 +- data/locale/de.ts | 2 +- data/locale/en.ts | 2 +- data/locale/es.ts | 2 +- data/locale/fa.ts | 2 +- data/locale/fr.ts | 2 +- data/locale/gl.ts | 2 +- data/locale/it.ts | 2 +- data/locale/ja.ts | 2 +- data/locale/ko.ts | 2 +- data/locale/nl.ts | 2 +- data/locale/pl.ts | 2 +- data/locale/pt.ts | 2 +- data/locale/ru.ts | 2 +- data/locale/sv.ts | 2 +- data/locale/zh.ts | 2 +- include/AudioPulseAudio.h | 2 +- include/ConfigManager.h | 15 +++++++++++ src/core/ConfigManager.cpp | 52 ++++++++++++++++++++++++++++++-------- 20 files changed, 75 insertions(+), 28 deletions(-) diff --git a/data/locale/ca.ts b/data/locale/ca.ts index f59930462..c58fb75f3 100644 --- a/data/locale/ca.ts +++ b/data/locale/ca.ts @@ -8521,7 +8521,7 @@ This chip was used in the Commodore 64 computer. - PulseAudio (bad latency!) + PulseAudio diff --git a/data/locale/cs.ts b/data/locale/cs.ts index 12bc754bb..f75924349 100644 --- a/data/locale/cs.ts +++ b/data/locale/cs.ts @@ -8523,7 +8523,7 @@ This chip was used in the Commodore 64 computer. - PulseAudio (bad latency!) + PulseAudio diff --git a/data/locale/de.ts b/data/locale/de.ts index f6f4194cd..fb91f0ed7 100644 --- a/data/locale/de.ts +++ b/data/locale/de.ts @@ -8568,7 +8568,7 @@ Dieser Chip wurde in Commodore 64 Computern genutzt. ALSA Raw-MIDI (Advanced Linux Sound Architecture) - PulseAudio (bad latency!) + PulseAudio PulseAudio (Schlechte Latenz!) diff --git a/data/locale/en.ts b/data/locale/en.ts index 49f9dcbd3..87db27019 100644 --- a/data/locale/en.ts +++ b/data/locale/en.ts @@ -8502,7 +8502,7 @@ This chip was used in the Commodore 64 computer. - PulseAudio (bad latency!) + PulseAudio diff --git a/data/locale/es.ts b/data/locale/es.ts index 5394c8973..37fca5929 100644 --- a/data/locale/es.ts +++ b/data/locale/es.ts @@ -8503,7 +8503,7 @@ This chip was used in the Commodore 64 computer. - PulseAudio (bad latency!) + PulseAudio diff --git a/data/locale/fa.ts b/data/locale/fa.ts index 50b3a3fad..1dc48d62a 100644 --- a/data/locale/fa.ts +++ b/data/locale/fa.ts @@ -8502,7 +8502,7 @@ This chip was used in the Commodore 64 computer. - PulseAudio (bad latency!) + PulseAudio diff --git a/data/locale/fr.ts b/data/locale/fr.ts index b2570b07c..ef8fc4177 100644 --- a/data/locale/fr.ts +++ b/data/locale/fr.ts @@ -8537,7 +8537,7 @@ This chip was used in the Commodore 64 computer. - PulseAudio (bad latency!) + PulseAudio diff --git a/data/locale/gl.ts b/data/locale/gl.ts index c06249d2d..d418fe848 100644 --- a/data/locale/gl.ts +++ b/data/locale/gl.ts @@ -8536,7 +8536,7 @@ Este chip empregábase no computador Commodore 64. - PulseAudio (bad latency!) + PulseAudio diff --git a/data/locale/it.ts b/data/locale/it.ts index fe49348ab..b8e2fcd24 100644 --- a/data/locale/it.ts +++ b/data/locale/it.ts @@ -8561,7 +8561,7 @@ Questo chip era utilizzato nel Commode 64. - PulseAudio (bad latency!) + PulseAudio diff --git a/data/locale/ja.ts b/data/locale/ja.ts index a568ffbbf..b5aa1586d 100644 --- a/data/locale/ja.ts +++ b/data/locale/ja.ts @@ -8538,7 +8538,7 @@ This chip was used in the Commodore 64 computer. - PulseAudio (bad latency!) + PulseAudio diff --git a/data/locale/ko.ts b/data/locale/ko.ts index ad7ee413f..200af7bb2 100644 --- a/data/locale/ko.ts +++ b/data/locale/ko.ts @@ -8507,7 +8507,7 @@ This chip was used in the Commodore 64 computer. - PulseAudio (bad latency!) + PulseAudio diff --git a/data/locale/nl.ts b/data/locale/nl.ts index e77143ee9..f775c1985 100644 --- a/data/locale/nl.ts +++ b/data/locale/nl.ts @@ -8506,7 +8506,7 @@ This chip was used in the Commodore 64 computer. - PulseAudio (bad latency!) + PulseAudio diff --git a/data/locale/pl.ts b/data/locale/pl.ts index 9cab92906..18a3899ea 100644 --- a/data/locale/pl.ts +++ b/data/locale/pl.ts @@ -8542,7 +8542,7 @@ Te układy scalone były stosowane w komputerach Commodore 64. - PulseAudio (bad latency!) + PulseAudio diff --git a/data/locale/pt.ts b/data/locale/pt.ts index ecc6bfab7..ae4e5d5ab 100644 --- a/data/locale/pt.ts +++ b/data/locale/pt.ts @@ -8540,7 +8540,7 @@ Este chip foi utilizado no computador Commodore 64. - PulseAudio (bad latency!) + PulseAudio diff --git a/data/locale/ru.ts b/data/locale/ru.ts index 950529e06..e7d086300 100644 --- a/data/locale/ru.ts +++ b/data/locale/ru.ts @@ -8598,7 +8598,7 @@ This chip was used in the Commodore 64 computer. - PulseAudio (bad latency!) + PulseAudio PulseAudio (большая задержка!) diff --git a/data/locale/sv.ts b/data/locale/sv.ts index 85198a1eb..2cc7d6c64 100644 --- a/data/locale/sv.ts +++ b/data/locale/sv.ts @@ -8505,7 +8505,7 @@ This chip was used in the Commodore 64 computer. - PulseAudio (bad latency!) + PulseAudio diff --git a/data/locale/zh.ts b/data/locale/zh.ts index 48e18d2bf..8978c1aa3 100644 --- a/data/locale/zh.ts +++ b/data/locale/zh.ts @@ -8517,7 +8517,7 @@ This chip was used in the Commodore 64 computer. - PulseAudio (bad latency!) + PulseAudio diff --git a/include/AudioPulseAudio.h b/include/AudioPulseAudio.h index f8893733c..5a8504d1f 100644 --- a/include/AudioPulseAudio.h +++ b/include/AudioPulseAudio.h @@ -46,7 +46,7 @@ public: inline static QString name() { - return QT_TRANSLATE_NOOP( "setupWidget", "PulseAudio (bad latency!)" ); + return QT_TRANSLATE_NOOP( "setupWidget", "PulseAudio" ); } static QString probeDevice(); diff --git a/include/ConfigManager.h b/include/ConfigManager.h index 0db1cd789..36fbdebb5 100644 --- a/include/ConfigManager.h +++ b/include/ConfigManager.h @@ -35,6 +35,7 @@ #include "export.h" #include "MemoryManager.h" +#include "lmmsversion.h" class Engine; @@ -100,6 +101,11 @@ public: return dataDir() + SAMPLES_PATH; } + QString defaultVersion() const + { + return LMMS_VERSION; + } + QString defaultArtworkDir() const { return m_dataDir + DEFAULT_THEME_PATH; @@ -144,6 +150,11 @@ public: { return m_workingDir + "recover.mmp"; } + + const QString & version() const + { + return m_version; + } #ifdef LMMS_HAVE_STK const QString & stkDir() const @@ -185,6 +196,7 @@ public: void setArtworkDir( const QString & _ad ); void setFLDir( const QString & _fd ); void setLADSPADir( const QString & _fd ); + void setVersion( const QString & _cv ); void setSTKDir( const QString & _fd ); void setDefaultSoundfont( const QString & _sf ); void setBackgroundArtwork( const QString & _ba ); @@ -197,6 +209,8 @@ private: ConfigManager( const ConfigManager & _c ); ~ConfigManager(); + + void upgrade(); const QString m_lmmsRcFile; QString m_workingDir; @@ -206,6 +220,7 @@ private: QString m_vstDir; QString m_flDir; QString m_ladDir; + QString m_version; #ifdef LMMS_HAVE_STK QString m_stkDir; #endif diff --git a/src/core/ConfigManager.cpp b/src/core/ConfigManager.cpp index 7fb9cbc5e..1254977f0 100644 --- a/src/core/ConfigManager.cpp +++ b/src/core/ConfigManager.cpp @@ -28,9 +28,9 @@ #include #include -#include "lmmsversion.h" #include "ConfigManager.h" #include "MainWindow.h" +#include "ProjectVersion.h" static inline QString ensureTrailingSlash( const QString & _s ) @@ -66,7 +66,8 @@ ConfigManager::ConfigManager() : m_pluginDir( qApp->applicationDirPath() + '/' + PLUGIN_DIR ), #endif m_vstDir( m_workingDir + "vst" + QDir::separator() ), - m_flDir( QDir::home().absolutePath() ) + m_flDir( QDir::home().absolutePath() ), + m_version( defaultVersion() ) { } @@ -81,6 +82,36 @@ ConfigManager::~ConfigManager() +void ConfigManager::upgrade() +{ + // Skip the upgrade if versions match + if ( m_version == LMMS_VERSION ) + { + return; + } + + ProjectVersion createdWith = m_version; + + // Remove trailing " (bad latency!)" string which was once saved with PulseAudio + if ( createdWith.setCompareType(Build) < "1.1.90" ) + { + if( value( "mixer", "audiodev" ).startsWith( "PulseAudio (" ) ) + { + setValue("mixer", "audiodev", "PulseAudio"); + } + } + + // Don't use old themes as they break the UI (i.e. 0.4 != 1.0, etc) + if ( createdWith.setCompareType(Minor) != LMMS_VERSION ) + { + m_artworkDir = defaultArtworkDir(); + } + + // Bump the version, now that we are upgraded + m_version = LMMS_VERSION; +} + + void ConfigManager::setWorkingDir( const QString & _wd ) { m_workingDir = ensureTrailingSlash( _wd ); @@ -251,6 +282,11 @@ void ConfigManager::loadConfigFile() QDomNode node = root.firstChild(); + // Cache the config version for upgrade() + if ( !root.attribute( "version" ).isNull() ) { + m_version = root.attribute( "version" ); + } + // create the settings-map out of the DOM while( !node.isNull() ) { @@ -289,13 +325,7 @@ void ConfigManager::loadConfigFile() node = node.nextSibling(); } - // don't use dated theme folders as they break the UI (i.e. 0.4 != 1.0, etc) - bool use_artwork_path = - root.attribute( "version" ).startsWith( - QString::number( LMMS_VERSION_MAJOR ) + "." + - QString::number( LMMS_VERSION_MINOR ) ); - - if( use_artwork_path && value( "paths", "artwork" ) != "" ) + if( value( "paths", "artwork" ) != "" ) { m_artworkDir = value( "paths", "artwork" ); if( !QDir( m_artworkDir ).exists() ) @@ -396,6 +426,8 @@ void ConfigManager::loadConfigFile() QDir().mkpath( userSamplesDir() ); QDir().mkpath( userPresetsDir() ); } + + upgrade(); } @@ -419,7 +451,7 @@ void ConfigManager::saveConfigFile() QDomDocument doc( "lmms-config-file" ); QDomElement lmms_config = doc.createElement( "lmms" ); - lmms_config.setAttribute( "version", LMMS_VERSION ); + lmms_config.setAttribute( "version", m_version ); doc.appendChild( lmms_config ); for( settingsMap::iterator it = m_settings.begin(); From fde014b9a55f54fda2b4dfea6d7812b5136e77c6 Mon Sep 17 00:00:00 2001 From: Dave French Date: Mon, 9 Feb 2015 22:56:39 +0000 Subject: [PATCH 067/133] Delay plugin renamed files and folder to use CamelCase --- plugins/CMakeLists.txt | 2 +- plugins/Delay/CMakeLists.txt | 3 +++ .../delaycontrols.cpp => Delay/DelayControls.cpp} | 4 ++-- .../delaycontrols.h => Delay/DelayControls.h} | 2 +- .../DelayControlsDialog.cpp} | 4 ++-- .../DelayControlsDialog.h} | 0 .../delayeffect.cpp => Delay/DelayEffect.cpp} | 2 +- .../{delay/delayeffect.h => Delay/DelayEffect.h} | 6 +++--- plugins/{delay/lfo.cpp => Delay/Lfo.cpp} | 2 +- plugins/{delay/lfo.h => Delay/Lfo.h} | 0 .../stereodelay.cpp => Delay/StereoDelay.cpp} | 2 +- .../{delay/stereodelay.h => Delay/StereoDelay.h} | 0 plugins/{delay => Delay}/artwork.png | Bin plugins/{delay => Delay}/logo.png | Bin plugins/delay/CMakeLists.txt | 3 --- 15 files changed, 15 insertions(+), 15 deletions(-) create mode 100644 plugins/Delay/CMakeLists.txt rename plugins/{delay/delaycontrols.cpp => Delay/DelayControls.cpp} (97%) rename plugins/{delay/delaycontrols.h => Delay/DelayControls.h} (98%) rename plugins/{delay/delaycontrolsdialog.cpp => Delay/DelayControlsDialog.cpp} (97%) rename plugins/{delay/delaycontrolsdialog.h => Delay/DelayControlsDialog.h} (100%) rename plugins/{delay/delayeffect.cpp => Delay/DelayEffect.cpp} (99%) rename plugins/{delay/delayeffect.h => Delay/DelayEffect.h} (95%) rename plugins/{delay/lfo.cpp => Delay/Lfo.cpp} (98%) rename plugins/{delay/lfo.h => Delay/Lfo.h} (100%) rename plugins/{delay/stereodelay.cpp => Delay/StereoDelay.cpp} (98%) rename plugins/{delay/stereodelay.h => Delay/StereoDelay.h} (100%) rename plugins/{delay => Delay}/artwork.png (100%) rename plugins/{delay => Delay}/logo.png (100%) delete mode 100644 plugins/delay/CMakeLists.txt diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 56212ef3e..34dbb1aca 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -7,7 +7,7 @@ ADD_SUBDIRECTORY(carlabase) ADD_SUBDIRECTORY(carlapatchbay) ADD_SUBDIRECTORY(carlarack) ADD_SUBDIRECTORY(CrossoverEQ) -ADD_SUBDIRECTORY(delay) +ADD_SUBDIRECTORY(Delay) ADD_SUBDIRECTORY(DualFilter) ADD_SUBDIRECTORY(dynamics_processor) ADD_SUBDIRECTORY(Eq) diff --git a/plugins/Delay/CMakeLists.txt b/plugins/Delay/CMakeLists.txt new file mode 100644 index 000000000..13c9ebb7f --- /dev/null +++ b/plugins/Delay/CMakeLists.txt @@ -0,0 +1,3 @@ +INCLUDE(BuildPlugin) + +BUILD_PLUGIN(delay DelayEffect.cpp DelayControls.cpp DelayControlsDialog.cpp Lfo.cpp StereoDelay.cpp MOCFILES DelayControls.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png") diff --git a/plugins/delay/delaycontrols.cpp b/plugins/Delay/DelayControls.cpp similarity index 97% rename from plugins/delay/delaycontrols.cpp rename to plugins/Delay/DelayControls.cpp index fd7aaf240..604fd8e46 100644 --- a/plugins/delay/delaycontrols.cpp +++ b/plugins/Delay/DelayControls.cpp @@ -24,8 +24,8 @@ #include -#include "delaycontrols.h" -#include "delayeffect.h" +#include "DelayControls.h" +#include "DelayEffect.h" #include "Engine.h" #include "Song.h" diff --git a/plugins/delay/delaycontrols.h b/plugins/Delay/DelayControls.h similarity index 98% rename from plugins/delay/delaycontrols.h rename to plugins/Delay/DelayControls.h index a02758ebb..4e4fb4f75 100644 --- a/plugins/delay/delaycontrols.h +++ b/plugins/Delay/DelayControls.h @@ -27,7 +27,7 @@ #include "EffectControls.h" #include "Knob.h" -#include "delaycontrolsdialog.h" +#include "DelayControlsDialog.h" diff --git a/plugins/delay/delaycontrolsdialog.cpp b/plugins/Delay/DelayControlsDialog.cpp similarity index 97% rename from plugins/delay/delaycontrolsdialog.cpp rename to plugins/Delay/DelayControlsDialog.cpp index aae4c0aa4..ed45ec363 100644 --- a/plugins/delay/delaycontrolsdialog.cpp +++ b/plugins/Delay/DelayControlsDialog.cpp @@ -22,8 +22,8 @@ * */ -#include "delaycontrolsdialog.h" -#include "delaycontrols.h" +#include "DelayControlsDialog.h" +#include "DelayControls.h" #include "embed.h" #include "TempoSyncKnob.h" diff --git a/plugins/delay/delaycontrolsdialog.h b/plugins/Delay/DelayControlsDialog.h similarity index 100% rename from plugins/delay/delaycontrolsdialog.h rename to plugins/Delay/DelayControlsDialog.h diff --git a/plugins/delay/delayeffect.cpp b/plugins/Delay/DelayEffect.cpp similarity index 99% rename from plugins/delay/delayeffect.cpp rename to plugins/Delay/DelayEffect.cpp index 4e5bcd95e..b4d2d0082 100644 --- a/plugins/delay/delayeffect.cpp +++ b/plugins/Delay/DelayEffect.cpp @@ -22,7 +22,7 @@ * */ -#include "delayeffect.h" +#include "DelayEffect.h" #include "Engine.h" #include "embed.cpp" diff --git a/plugins/delay/delayeffect.h b/plugins/Delay/DelayEffect.h similarity index 95% rename from plugins/delay/delayeffect.h rename to plugins/Delay/DelayEffect.h index 21aa31b5e..f51b08f62 100644 --- a/plugins/delay/delayeffect.h +++ b/plugins/Delay/DelayEffect.h @@ -26,9 +26,9 @@ #define DELAYEFFECT_H #include "Effect.h" -#include "delaycontrols.h" -#include "lfo.h" -#include "stereodelay.h" +#include "DelayControls.h" +#include "Lfo.h" +#include "StereoDelay.h" class DelayEffect : public Effect { diff --git a/plugins/delay/lfo.cpp b/plugins/Delay/Lfo.cpp similarity index 98% rename from plugins/delay/lfo.cpp rename to plugins/Delay/Lfo.cpp index 8936bd186..42809f343 100644 --- a/plugins/delay/lfo.cpp +++ b/plugins/Delay/Lfo.cpp @@ -22,7 +22,7 @@ * */ -#include "lfo.h" +#include "Lfo.h" #include "lmms_math.h" diff --git a/plugins/delay/lfo.h b/plugins/Delay/Lfo.h similarity index 100% rename from plugins/delay/lfo.h rename to plugins/Delay/Lfo.h diff --git a/plugins/delay/stereodelay.cpp b/plugins/Delay/StereoDelay.cpp similarity index 98% rename from plugins/delay/stereodelay.cpp rename to plugins/Delay/StereoDelay.cpp index 9bdf29fdb..98f9b95da 100644 --- a/plugins/delay/stereodelay.cpp +++ b/plugins/Delay/StereoDelay.cpp @@ -22,7 +22,7 @@ * */ -#include "stereodelay.h" +#include "StereoDelay.h" #include #include "lmms_basics.h" #include "interpolation.h" diff --git a/plugins/delay/stereodelay.h b/plugins/Delay/StereoDelay.h similarity index 100% rename from plugins/delay/stereodelay.h rename to plugins/Delay/StereoDelay.h diff --git a/plugins/delay/artwork.png b/plugins/Delay/artwork.png similarity index 100% rename from plugins/delay/artwork.png rename to plugins/Delay/artwork.png diff --git a/plugins/delay/logo.png b/plugins/Delay/logo.png similarity index 100% rename from plugins/delay/logo.png rename to plugins/Delay/logo.png diff --git a/plugins/delay/CMakeLists.txt b/plugins/delay/CMakeLists.txt deleted file mode 100644 index 0663b9458..000000000 --- a/plugins/delay/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -INCLUDE(BuildPlugin) - -BUILD_PLUGIN(delay delayeffect.cpp delaycontrols.cpp delaycontrolsdialog.cpp lfo.cpp stereodelay.cpp MOCFILES delaycontrols.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png") From ee3c9a13332a4e37d1d61c170edf5ed4e24f07b7 Mon Sep 17 00:00:00 2001 From: Dave French Date: Tue, 10 Feb 2015 13:47:17 +0000 Subject: [PATCH 068/133] Added a XY pad to the Delay Pluging. also added a volume control, and smothed the delay time input changes, to improve audio. --- plugins/Delay/CMakeLists.txt | 2 +- plugins/Delay/DelayControls.cpp | 7 +- plugins/Delay/DelayControls.h | 7 +- plugins/Delay/DelayControlsDialog.cpp | 88 ++++++++++++++++++++++++-- plugins/Delay/DelayControlsDialog.h | 20 ++++++ plugins/Delay/DelayEffect.cpp | 20 +++++- plugins/Delay/DelayEffect.h | 2 + plugins/Delay/StereoDelay.cpp | 2 +- plugins/Delay/artwork.png | Bin 9620 -> 14151 bytes 9 files changed, 138 insertions(+), 10 deletions(-) diff --git a/plugins/Delay/CMakeLists.txt b/plugins/Delay/CMakeLists.txt index 13c9ebb7f..ceb7ceb4a 100644 --- a/plugins/Delay/CMakeLists.txt +++ b/plugins/Delay/CMakeLists.txt @@ -1,3 +1,3 @@ INCLUDE(BuildPlugin) -BUILD_PLUGIN(delay DelayEffect.cpp DelayControls.cpp DelayControlsDialog.cpp Lfo.cpp StereoDelay.cpp MOCFILES DelayControls.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png") +BUILD_PLUGIN(delay DelayEffect.cpp DelayControls.cpp DelayControlsDialog.cpp Lfo.cpp StereoDelay.cpp MOCFILES DelayControls.h DelayControlsDialog.h ../Eq/EqFader.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png") diff --git a/plugins/Delay/DelayControls.cpp b/plugins/Delay/DelayControls.cpp index 604fd8e46..f8241b95e 100644 --- a/plugins/Delay/DelayControls.cpp +++ b/plugins/Delay/DelayControls.cpp @@ -35,9 +35,12 @@ DelayControls::DelayControls( DelayEffect* effect ): m_delayTimeModel( 0.5, 0.01, 20.0, 0.0001, 20000.0, this, tr( "Delay Samples" )) , m_feedbackModel(0.0f,0.0f,1.0f,0.01f,this,tr( "Feedback" ) ), m_lfoTimeModel(2.0, 0.01, 20.0, 0.0001, 20000.0, this, tr( "Lfo Frequency" ) ), - m_lfoAmountModel(0.0, 0.0, 2.0, 0.0001, 2000.0, this, tr ( "Lfo Amount" ) ) + m_lfoAmountModel(0.0, 0.0, 2.0, 0.0001, 2000.0, this, tr ( "Lfo Amount" ) ), + m_outGainModel( 0.0, -60.0, 20.0, 0.01, this, tr( "Output gain" ) ) { connect( Engine::mixer(), SIGNAL( sampleRateChanged() ), this, SLOT( changeSampleRate() ) ); + m_outPeakL = 0.0; + m_outPeakR = 0.0; } @@ -49,6 +52,7 @@ void DelayControls::loadSettings( const QDomElement &_this ) m_feedbackModel.loadSettings( _this, "FeebackAmount" ); m_lfoTimeModel.loadSettings( _this , "LfoFrequency"); m_lfoAmountModel.loadSettings( _this, "LfoAmount"); + m_outGainModel.loadSettings( _this, "OutGain" ); } @@ -60,6 +64,7 @@ void DelayControls::saveSettings( QDomDocument& doc, QDomElement& _this ) m_feedbackModel.saveSettings( doc, _this ,"FeebackAmount" ); m_lfoTimeModel.saveSettings( doc, _this, "LfoFrequency" ); m_lfoAmountModel.saveSettings( doc, _this ,"LfoAmount" ); + m_outGainModel.saveSettings( doc, _this, "OutGain" ); } diff --git a/plugins/Delay/DelayControls.h b/plugins/Delay/DelayControls.h index 4e4fb4f75..1cd987152 100644 --- a/plugins/Delay/DelayControls.h +++ b/plugins/Delay/DelayControls.h @@ -48,13 +48,17 @@ public: return "Delay"; } virtual int controlCount(){ - return 4; + return 5; } virtual EffectControlDialog* createView() { return new DelayControlsDialog( this ); } + float m_outPeakL; + float m_outPeakR; + + private slots: void changeSampleRate(); @@ -64,6 +68,7 @@ private: FloatModel m_feedbackModel; TempoSyncKnobModel m_lfoTimeModel; TempoSyncKnobModel m_lfoAmountModel; + FloatModel m_outGainModel; friend class DelayControlsDialog; friend class DelayEffect; diff --git a/plugins/Delay/DelayControlsDialog.cpp b/plugins/Delay/DelayControlsDialog.cpp index ed45ec363..7da0cf49f 100644 --- a/plugins/Delay/DelayControlsDialog.cpp +++ b/plugins/Delay/DelayControlsDialog.cpp @@ -26,6 +26,9 @@ #include "DelayControls.h" #include "embed.h" #include "TempoSyncKnob.h" +#include "../Eq/EqFader.h" +#include +#include @@ -37,37 +40,112 @@ DelayControlsDialog::DelayControlsDialog( DelayControls *controls ) : QPalette pal; pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) ); setPalette( pal ); - setFixedSize( 200, 75 ); + setFixedSize( 300, 200 ); TempoSyncKnob* sampleDelayKnob = new TempoSyncKnob( knobBright_26, this ); - sampleDelayKnob->move( 20,10 ); + sampleDelayKnob->move( 13,10 ); sampleDelayKnob->setVolumeKnob( false ); sampleDelayKnob->setModel( &controls->m_delayTimeModel ); sampleDelayKnob->setLabel( tr( "Delay" ) ); sampleDelayKnob->setHintText( tr( "Delay Time" ) + " ", " s" ); Knob * feedbackKnob = new Knob( knobBright_26, this ); - feedbackKnob->move( 63,10 ); + feedbackKnob->move( 13, 55 ); feedbackKnob->setVolumeKnob( true) ; feedbackKnob->setModel( &controls->m_feedbackModel); feedbackKnob->setLabel( tr( "Regen" ) ); feedbackKnob->setHintText( tr ( "Feedback Amount" ) + " " , "" ); TempoSyncKnob * lfoFreqKnob = new TempoSyncKnob( knobBright_26, this ); - lfoFreqKnob->move( 106,10 ); + lfoFreqKnob->move( 13, 100 ); lfoFreqKnob->setVolumeKnob( false ); lfoFreqKnob->setModel( &controls->m_lfoTimeModel ); lfoFreqKnob->setLabel( tr( "Rate" ) ); lfoFreqKnob->setHintText( tr ( "Lfo") + " ", " s" ); TempoSyncKnob * lfoAmtKnob = new TempoSyncKnob( knobBright_26, this ); - lfoAmtKnob->move( 150,10 ); + lfoAmtKnob->move( 13, 145 ); lfoAmtKnob->setVolumeKnob( false ); lfoAmtKnob->setModel( &controls->m_lfoAmountModel ); lfoAmtKnob->setLabel( tr( "Lfo" ) ); lfoAmtKnob->setHintText( tr ( "Lfo Amt" ) + " " , " s" ); + EqFader * outFader = new EqFader( &controls->m_outGainModel,tr( "Out Gain" ), + this, &controls->m_outPeakL, &controls->m_outPeakR ); + outFader->setMaximumHeight( 196 ); + outFader->move( 263, 42 ); + outFader->setDisplayConversion( false ); + outFader->setHintText( tr( "Gain" ), "dBv" ); + XyPad * pad = new XyPad( this, &controls->m_feedbackModel, &controls->m_delayTimeModel ); + pad->resize( 196, 196 ); + pad->move( 50, 2 ); } + + +XyPad::XyPad(QWidget *parent, FloatModel *xModel, FloatModel *yModel) : + QWidget( parent ), + m_xModel( xModel ), + m_yModel( yModel ), + m_acceptInput( false ) +{ + connect( m_xModel, SIGNAL( dataChanged() ) , this, SLOT( update() ) ); + connect( m_yModel, SIGNAL( dataChanged() ) , this, SLOT( update() ) ); +} + + + + +void XyPad::paintEvent(QPaintEvent *event) +{ + QPainter painter( this ); + //Draw Frequecy maker lines + painter.setPen( QPen( QColor( 200, 200, 200, 200 ), 8, Qt::SolidLine, Qt::RoundCap, Qt::BevelJoin ) ); + float xRange = m_xModel->maxValue() - m_xModel->minValue(); + float xInc = xRange / width(); + int xPos = ( m_xModel->value() - m_xModel->minValue() ) / xInc; + + float yRange = m_yModel->maxValue() - m_yModel->minValue(); + float yInc = yRange / height(); + int yPos = ( m_yModel->value() - m_yModel->minValue() ) / yInc; + + painter.drawPoint( xPos, yPos ); +} + + + + +void XyPad::mousePressEvent(QMouseEvent *event) +{ + m_acceptInput = true; +} + + + + +void XyPad::mouseReleaseEvent(QMouseEvent *event) +{ + m_acceptInput = false; +} + + + + +void XyPad::mouseMoveEvent(QMouseEvent *event) +{ + if( m_acceptInput && (event->x() >= 0) && ( event->x() < width() ) + && ( event->y() >= 0) && ( event->y() < height() ) ) + { + //set xmodel + float xRange = m_xModel->maxValue() - m_xModel->minValue(); + float xInc = xRange / width(); + m_xModel->setValue( m_xModel->minValue() + ( event->x() * xInc ) ); + + //set ymodel + float yRange = m_yModel->maxValue() - m_yModel->minValue(); + float yInc = yRange / height(); + m_yModel->setValue( m_yModel->minValue() + ( event->y() * yInc ) ); + } +} diff --git a/plugins/Delay/DelayControlsDialog.h b/plugins/Delay/DelayControlsDialog.h index 9afe1d7c7..386c97052 100644 --- a/plugins/Delay/DelayControlsDialog.h +++ b/plugins/Delay/DelayControlsDialog.h @@ -26,6 +26,7 @@ #define DELAYCONTROLSDIALOG_H #include "EffectControlDialog.h" +#include "AutomatableModel.h" class DelayControls; @@ -38,4 +39,23 @@ public: } }; +class XyPad : public QWidget +{ + Q_OBJECT +public: + XyPad( QWidget *parent = 0, FloatModel *xModel = 0, FloatModel *yModel = 0 ); + ~XyPad() {} + +protected: + virtual void paintEvent ( QPaintEvent * event ); + virtual void mousePressEvent(QMouseEvent * event ); + virtual void mouseReleaseEvent(QMouseEvent * event); + virtual void mouseMoveEvent(QMouseEvent * event); + +private: + FloatModel *m_xModel; + FloatModel *m_yModel; + bool m_acceptInput; +}; + #endif // DELAYCONTROLSDIALOG_H diff --git a/plugins/Delay/DelayEffect.cpp b/plugins/Delay/DelayEffect.cpp index b4d2d0082..aa01a49d0 100644 --- a/plugins/Delay/DelayEffect.cpp +++ b/plugins/Delay/DelayEffect.cpp @@ -25,6 +25,7 @@ #include "DelayEffect.h" #include "Engine.h" #include "embed.cpp" +#include "interpolation.h" extern "C" @@ -53,6 +54,7 @@ DelayEffect::DelayEffect( Model* parent, const Plugin::Descriptor::SubPluginFeat m_delay = 0; m_delay = new StereoDelay( 20, Engine::mixer()->processingSampleRate() ); m_lfo = new Lfo( Engine::mixer()->processingSampleRate() ); + m_outGain = 1.0; } @@ -87,18 +89,34 @@ bool DelayEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) m_lfo->setFrequency( 1.0 / m_delayControls.m_lfoTimeModel.value() ); m_delay->setFeedback( m_delayControls.m_feedbackModel.value() ); sample_t dryS[2]; + float lPeak = 0.0; + float rPeak = 0.0; + if( m_delayControls.m_outGainModel.isValueChanged() ) + { + m_outGain = dbvToAmp( m_delayControls.m_outGainModel.value() ); + } for( fpp_t f = 0; f < frames; ++f ) { + m_currentLength = linearInterpolate( length, m_currentLength, 0.9999 ); dryS[0] = buf[f][0]; dryS[1] = buf[f][1]; - m_delay->setLength( ( float )length + ( amplitude * ( float )m_lfo->tick() ) ); + m_delay->setLength( ( float )m_currentLength + ( amplitude * ( float )m_lfo->tick() ) ); m_delay->tick( buf[f] ); + buf[f][0] *= m_outGain; + buf[f][1] *= m_outGain; + + lPeak = buf[f][0] > lPeak ? buf[f][0] : lPeak; + rPeak = buf[f][1] > rPeak ? buf[f][1] : rPeak; + buf[f][0] = ( d * dryS[0] ) + ( w * buf[f][0] ); buf[f][1] = ( d * dryS[1] ) + ( w * buf[f][1] ); outSum += buf[f][0]*buf[f][0] + buf[f][1]*buf[f][1]; } checkGate( outSum / frames ); + m_delayControls.m_outPeakL = lPeak; + m_delayControls.m_outPeakR = rPeak; + return isRunning(); } diff --git a/plugins/Delay/DelayEffect.h b/plugins/Delay/DelayEffect.h index f51b08f62..b98a19e70 100644 --- a/plugins/Delay/DelayEffect.h +++ b/plugins/Delay/DelayEffect.h @@ -46,6 +46,8 @@ private: DelayControls m_delayControls; StereoDelay* m_delay; Lfo* m_lfo; + float m_outGain; + float m_currentLength; }; #endif // DELAYEFFECT_H diff --git a/plugins/Delay/StereoDelay.cpp b/plugins/Delay/StereoDelay.cpp index 98f9b95da..21e637740 100644 --- a/plugins/Delay/StereoDelay.cpp +++ b/plugins/Delay/StereoDelay.cpp @@ -74,7 +74,7 @@ void StereoDelay::tick( sampleFrame frame ) m_buffer[m_index][0] += frame[0] * m_feedback; m_buffer[m_index][1] += frame[1] * m_feedback; - m_index = ( m_index + 1) % m_maxLength; + m_index = ( m_index + 1) % (int) m_maxLength; } diff --git a/plugins/Delay/artwork.png b/plugins/Delay/artwork.png index 459c1c5441df100a14163542700c3f4ec6040b9e..2ac7a2f7496d910b711bd0e112cc12d75812ef16 100644 GIT binary patch literal 14151 zcmW+-1yqyo_cu@k2}x-bMvagflJXT8jApQn1{ozF-EDxdk)s=7)W+zL1_@~pDQRgX zL_oU!`~A<(>ODK}dEY(vx%U(IqV#msD9KsKZ{4~@sSZ)mzjf=j5b<;0gZso+{iS(0 z@$EiRQ%&X8&Ho;sT8k5jN66eD#-6usJ*4~J^Y*QbEGFVXQZIFFFzM1A@&{Z%$ehEY zTeqIvQdfBi^PAlb9xex{?FZX<$0%0zavLLW(^hmo>|ixYQ((=xhq@;Ri1)i?^Ayqd z%-ZMeo9Ny2x#Tlb82G5)fUnx|@;T?ZE}K{571Z2(AxHj1#iko|klKD(n5;iEG!$Ao zR|YcRFJx-F9&iq6y~!#1EvKNkcwJs@*{UYc7_<8-gyDVnR>eGYcO}_^``QvHlwy_sw9 zU^j$_pGUVGmk06LSFC&fb+SA;yy9!4Zmahvp7ULCG2g}ccExT;yJ^{^hQNjE(c@mu zO>0%lC&&z5r?Qz{AGsiDL$h&7z`GPcV6UR?8~|>)jg; zG(p)nKUdSPzihh2g#P_Pdc4vT73;)nGno3!@{g{_;P+srpc?3Phox_drQTU#jTuRV zeQxM=;}!8Lcaq=<@D=UeXQ5}B7u%LM0eT3_(5s`iuVycoGrrP4KvTvR8ENmk>--1I z_Gn%>4ys7ZyxE99ih9;o`K0otZBl3rHInFIlrp;zK1w0;jyiyPvHP zfA%An_*aMK-k8vlNnCVsUVmG-*($A|@`v#W>SSqwdoykQ*b+XqQ^ldAe#CcQ zrd70^;|+om72VsHs0k5@ezzUf-ZAKTaehI^Fc{TJe8lffmKt8H<^~<8Uu$XuhIVvA z&kcN+?xCIqAvEo`)0Ceh%tx5h0ym~tWfa2X=|pn!O;UPNY>j=%7zDX4fa3eq!B)cqBpq;g4-4gaU#3Z2 zBR-B zhu3msf|!Q;acL7GPp%QoH-E{+5wh`!dK4RQ8yjN1-quNiFGqz_B^EO8(Bh-Iqrj>vsvC>S zwX%q0{OfmHCs)1wk#SJ-`J4XR%&6`gYH9A0k}>A#Kamuputno2_Ef!+5@*B!xpBSfuRC4BA`2NqpPc{|GKg_84ok` zr1p=7MmrW@;G}^ zS3r|_aX+dFS^h)A+l7)X1g!j+`w3lO=(k@DzaGMyqy1dUQxuxZRk%D6af<(b?8)IV zFd#pRM&1Kqe6Rj?Zn)NjKuxMf$>o^*D5-VD>z%;0K|-Vs^VL2Tz_7LXU$^zCrpDcN z6(k$2hl@!v`>TM6i;oPC`E})EiyE?ZX_CpA3%5)vTx9`mjT5hI$i!Hf@;FXBWyq@D zWEJ%j!yv2>NQl1H0ML>txEq%lSd^xX9`ln&UF$iSV^Ya) z{3I&tj$aQiZ~1^WNR>g0?_r596Ql-Z3J{IHwbP#E#w4H?fL3bg=I1T4dHL0IzC~u6 zst!y{wSpm?5A1a$Dm16BPOxg0U@YNeCqb3?^BYAnRmkmuR~8@%39>4QyL`Wr2r9<1 zTs?p?m3-2K1hkePB{%c33D|q%H(Pm#;jWzh>Zxk1AQ3r~4iiA7-Vz*dBvVCMp6?QN zydR_MDkK3C%VM_$F48eP+IWHrvSm?KWqErlaR+KCk`wW~|3^>Kz3!PLLdoCxAwqI; zfr&)TEFrxz6%|w&Z&L}6P^8}@|H&_EXA+%y7PYpGX5k^GX35J$O|!TR;2t~}*8op4ABeY?sPa8s_(iJd}*WuwHxV#aFivnhswY0&n36{s>+2iB{)n-SXOr;;BaoZO7 z9CEQnVooF$5eWQPM>jvJuQ`^Pg_m|UUi6^Apv)ufm0=BQl4VMO?mPyTycZOlEp3u( zrtWDxx%|>9PZHJ&-l-{HF$D1Gl$YYz9N(5UQ+Pm_X-r_MQp1Wj#Z9*k`$d-pTgWwjEhh(8lutKh|D+-CjdB`E?t@%qM zwIE9Ae0sq`<8)p@LM7~uIY@SuNkpo^&{Dq3v1rQ;Y+iNy!pL26^*8H(i ztE-~EJtV!@58?nV0Mfe${tKcyFmS1L#UIi!b_B(|UfX(ImE*lPWKO zfwy0KlyWJi;LV;^m_3?IjVG4*36ZSor-p4t=v(kuA^dvufi1r*tS6{+@|4H?JG<{~ zIPP}p!r?0SWVg4`QoXy3V~W;_1|XJPbN8#jb3H~npkkrVy~*=9J64aIeAyFhL7ofi zJ9sLnG6)vdRY(Svz>;6(i=CkT+?RJlhqWO98mi*;=M|l zC)|jIEav`AL`60>$`BX{Pi}eydo^%8akU~g^E`uO5dN8P&2_8`5T}qwRL5z_`nOiy zL5ib4n*Htj?>HjP#50Z5u@vDH${x`<20?fzzDm+sO_O55_l@Elec%Ie3F6z8w8WZ) z{I0+C(bP?Kyi9sN`s=%@I&FYTer1h_==Q`wmxZc1#b9?IfWz8+k%tK+TbdAjDd^U| zWIJY(A`YOf&^03Xh_)D{^g?VJXukfP&fgVJgs(X~Cd*Mf^sF;^?pj{`LadaGK|^>M zg~>~v)mLwz>92%`CuBeZFzQBJm~RfW90C>hnR16YVcXKxYMkju*$*k_^MV?ldp&)c zF&Y?ipIQt)m!&0T1Sx6@E6EW=HydApD1_x>iQgECMNgl=QwdskXm&;8nBc!EgJX2qC=*H~M*RxG(p(F zaI5F6{;{)1FpHi24h<8F{l%eJ>o%?r@`Y&Fk=o zB`HIDI)RHi#4=!($#ms5dvALFbq1xHg`?Ed95v>fq9c-cdShQiG;#sjdATH;=(eev9-fOY(jY4&-~)ZqFe^v!1WIF#pS~q)i?^ zzO0YX9%QEUCc@g@nGe{1D10Iep$p-fH|=W_bXjUd8q$%c?Eblw{jM*NT_W`mbzfO+ zU4%tlyYRboKM^BJ=2Ouy?Eclsp}lQph~wfaT*(hgc4R*wX&y-24O=gu-EFJV?3}4( z0gadpOUiKz=nNe`4yuO|lfo3}XlJITRWWrM=+nr*|ETQQXq3D9-4q`1F%g}q|IL$dp{&3PYX6c2$=vdPkMlJzGKU@b+)X;Utl27 zVj9aO2w9Mf=FtrfMpNzy^J}nZY`T7=;Gf*AutArR&QPEFW&WG7xS4rhN%a+hcRM;V z-{;djj~3voO^=*cmWkCtXLhT^!7>QFkQ%CYY z8bvn4<=Cxe={H)*$&hHWC{ipQR5(PQ&#%VJeVSntDBwehD3f-4|4&leDQaY*ee<7e zV;&Uqt1lUbd&04Y)#{>$x(`K%n4wfUshlXBo~mIRlWs|`-qT^IimLRm>NxrO{`(b3 zuFCnGT$+ciAOPIRAMu@LhJR{P6c&!o>O$6BsBqDg3g%1%A#6vSsKV7Jwxg`b_7)Kf}ADy$51&IG4MQkz=rDb`tsB z88f=)t43nD`;IybKUZnezhrwy0v{z?rUHaw;py6wQaF7FHWt-J@uSBtC&Qz8`~J7o z8mMeIY}M1|fyuu37t zU${&=()M_jh-rIa6gOjrF0EP?4S&px^MonXj4{??8yT%FTp3f>dOk-?z!YSUFBzQ4 zFGbY)KtIo9LO2$Tlb6X*{x7NO7Yjy$oDOx!#;C^Q_`ZpyDuQG0Qu>%$oJ=6jXT%?O znPSpAJhe=BzW`LK(ws3tNW!2^{gD!i9P7>b0JgYsqHd($XzP~-VI#Xu7Cx>33|cjF zFZ2E^x#3BqytrTV4(_g%T!IX!^n1-=P>$aNS{;J-%^Wv%TQ^J4QXWx|Y7GD~ypVPo zL&o=cSbFT|gZ7e0uiEBOe?pDGH|J;ezqs4dyIP@p@%Yimfcx0Zd~;=y*Vc3|hobVH zej?YVL#bSn=1${S#6LKD;8_;S9AV8d6$XD?m}83#Tf4XWWhbT7NV;cm~ z&z~-xe$}4WtX{&qqr&ALZPq}Zt=yRXNGjBaO3NsVgB+fg6f6adZkF}tCg)CmoSKjcL8u#{y1l*ELr;_WCez6ej!<`n{hU>;Thh|< zpEAi=N!2t>SVNf1UnPav%itVqf6$q%cl>=QC-@&L4Y2@9-$A{b7E2WYC-2SENw1K5 zv+*sfSv}eOj75iQ8Lpk{*5_&bkpJWprZoX!yaWZPh%S(&meyRdZEad?S zaUE2wnui*`u_!Ktc-Y)!aHi1u+<%-v7~T%H`wE_WToD^nq#$_I4dUQFj`QK0AZ71g zP~o!bQe124;-D0ZiBtj0Pyt#nzy8a6za5&yVzMQ5=3f`M_fSpjB_j=$i86mFGdzqD z!yp0d?dFa`EC~#0oDh?^S3|u9PjB*HX>QI?g*kcL5usB@YkvDSfrHBB5}W3k|+!1O)Glgp$G3@8zhaC-4w=$?E5%!S{~oQJ2-Hbw*kPn_W&nttT2)$7_YS2o4!< zayDb7^WRrSdZ!b9aD03Q+2uV?jVdo-%C}Qj=5lA>`Gr#ggJnyyU{0~<0_ocomle{w zjAt#GM_d{#r{M9F(E$b+(qdPoWExk75TUhA{XRDF`+s*F8{a1-Lw;dI>8_MB=bR71 z4X~8&TynChT>+q{pxL}AGv$5hW0&42Rix5;YtyJP7b~K0B$`c!iss)NLhaY+M~uZj z*=U-O$ww&OkSyv-&sWb*lw%FB$i5a_xgf_v$O|Ll; zD<1yq2zVB2(+!9)%O|+d7tye)QLtB)i!XXo3;wHGIWfrD!$eS@@Dw&_07e*6Gm9ugFMiYfX|R_c;rRC!;Zu(nn_$IaJ?E&N!;btq2R_Za;|}&aO@BWiZvPw3nP6 z%!1EulvJp!1eoyYn-Ow?hO6^epq4GGkJsx|laHj0{Fgdv)H>P4BC||jMVSGu(_$o+cVt40#78U<-u-RCKsU2 z!6;~9Anb`OK2NWXmAl=S@JcbN%>DBtK21+o)3~9y-+n$IQAW>3aV!fNb9{r;+cED7DhO1pnq> zWB#a9h&4+uEp@rd>wrk;PYG^-FkP=feh>hllv6`mM&j^x2 z70smWrtczQl%p5>bK{4amh>iJl~o+63a6{mdNgrXqy~EcdtU<% z%-+(`hy9xV&7d5aiq%HdO-J)KCwW)Q$fvjJ4sA zOHu9aYcpgTl|9QolH#Rxm9=uuF)C{uo0VbZ8|5NBT*UUv0AbzRCNjmd7Atz_WE@-K zAIwaSM*M0IG8sr^vbM^VVv%CY_Y|Pc%e|PPolh(YJ@m;y@FBSIGLq~b7Qka8t-q3e z*{AmssE{{dM|Ic|-LcfINnQ!KJ(H-|09@ak6_PJTy2Lra&y+vDLv?Q_GS+wHmC==Z z{yAaC=+^%J*q*J{zz{dxk|BR1ZMYX8`_#(n>(VnuxjOjq%|Ps8$ucI+;Cck3t;&UI zP&L7en$EBt_2Da1C|mmk^1m=I8gpAN5kIxAM(WB=7Gb+7%MBQ%@W%)4*><*D z)5mP#E8C}@CPVq%@fYImi-b83!;Mieo_CAS138YxtfO<0A3t})6ZBR zs^FNjy5275Xq1$$$qPPXsM^hR7nP~|CPPIYwQ3Ag#8kwP-)5NeWGmJBr6~}oPQv$3 zCKTlHLJN>k&}U&3{eAU24?Sm#>F8RR^{H74(e+_pWbN-)R}T-r*sj<6)sYgGV&H+?0wd!_-IfStYxqBk;qtdjLe39Z{OEsiqA6AdZqqOcCqm; z@ryyes=Y{@J~Sg4X^=iYxsdS^;zwks{Jr1f_YVD@@!XrFXCG0|<0+Mp3Q@;T@(sih zi_gPpwp75Uj*d$A3|^u)wh(=v=ZW4s_g~K){Seb+-*{aBwWucbS^Nz)|J3n@5(>;;yjX?6f z2X3|kf>WLyPk)y`i0iTx}=6fE8_F@Rn22u(>$ zjSDV;E*dft(d2DneC1}GN#A~0j%R59WA3cJpMru&1$q40?TSJ=JyeXNV*yt8CBM5t zzB&@RCKAf4*?*iuivQhN?H}EW;QN*3-@>bl;lgt0H#n{ z9(^8qDh=ixz|i|rr(=>)mNq0rQ-Oo4TirTm(}kM?9A+9L=TIe!v@PVdtQy`gIS;mp z?eKw>)s9FRpIZqWF!!svyhczAQ{_Py)r||!A9GTA4V!nWtUR#&8PUjF9^m_3iKesj zz4CLNrIPR5u>_+vwyh5GM@2`?7>V8*EM{_mLn)cV&8TnrlfG-i73xf^e0gQx(&&bm zkIx}?u-NW0zrNdBemo-Io>BKiZRsrEckBVxAu`|0K2(iLUr6nlJ#JF|9z4-au*qR5 zM|&i>dgd{|_*1af8g?rG+>Bd{*NUjmRR*;ZK{d1RKGjp&sM)8{oiBo%Csd2ylp6JE zjoX~q&Rje&Ekh_wuYZ7L3+0>N0Z^3dpFC4$-XWU3!4%Ua5XyE6oo;Nx%BBY_n2YAa zU}FB*zq+aHZ%OK$smh<;E>}MQ{U>wKuaBACnyQ>arq9ftwj{>S4DoF?q-ZkbR|mDb zMLU=aFYk0q&0jN|@sZMQWmT)bCU>viJPmB` zQ1%6pK(3@&BDOQRIYxBBhYU%PdW8@1Mp;dP5K-s=Gwqs@}4I4c5=UIbYhS6VZn_OK1gAH#yUM&$Cq z(LjDwlyhxI4HzXfDfw7pB3O`so3sVxb0$RCzk=$ z{ZyR`9S|a_=_UF+B(kM$3E93!e`Ssb&{O%-j`(i*JuaW3&_M)uy@HgQx_FBF(5&4Q zJkRrW5$#&mHj6^9hDP#pfI1KDGy@|oYVfVY0rYu9Zr_JZ*74XYyeu zN$}cg>~Fr~Z_P6{t_p#IBUZSC`wZLSPjPD;=LmO!yL*?*5w`XbP!u@9kjp*WPZfJS zac)RMpZE|cITG$qa|U_CR^;q_WN7Dfc$lMu)b*XLD2Bx~-4eN6s~jfNzzMnFyAK0{ zSnE~*#Jx5hsnIB^^5PG_-iYcq!Nra&@7ll;NNEys+NdNg^i@jdx0Y)`^14!UG}4J=A?u08yY_>HHQyEm7{j7S2zOa<~S($m|d+tj2q))p~a1`ik{41iyfV2^? z@7d4vCvC0XXY~$qi=DY2%KHL7_7u(gblKiqf^h=lD56vKaq>O`BC&Kq&Sf1nVIt6z zqY&uhmpk^B<#L$S-<&7NdCJ6`6xwhKefoG4r^k@TKr&^GThZg=7qb7)Lm6qH8mfhK zoRd@+#7OfABM|oBoNK1I;!QVwh7aO#(Fy?xL_)V_M*d48sK zTP0k2e+1BLd~x@pT=-~F(tvK@;p+|xRxc#YbG~jF9{TW@u|u|};6t_{jpt{LR?8(w zb)j3{h23Y|LZF{C{|@Cjzk1`wEZ81g^R4T zj~{Fd%KQ6Mign0T4V2zcj{Plfw$Wirqh(juIlH*%$pMeT>Lypev<>fhiY)j@pILfh zi1LrcB$g0ikS9bMtyvhF|MfK^H+IZSL%!tNQfJ4yKhYy_e`Ty%d(6R3&EwHfYB0O;GtbLxqTwYpSbgKSUq7w0FOsJbR9dSID|&=U)$P@9{s4q6 z^iO3Z*TK2#u0a#YoUkJeQ@ zE3IX&duWH)6yqUsH{n6l+Y;k+aQMOKY72ZVbaK5?s@idCsHj&I9UPBGYSqj1R0<8S zS8?Cn{E`-a_L+rHf_zmtLTosZP7QAj!QOFBW+PfB&-+j79lN4bG@geSYaz-^9Bi{M zTe9PHiJ^S6BA$_Wra>|fB36|)**pyO=>L=+d( zvJ5Yd=IVkZ$v5P`z^l#`RmPGY$pu40qLPz6IBe?*2mX#~9l(=asPZ9zk>q4GX$xex z4-}t+rrRA*m*z@?lr3+=xGZsHvv~MlwCfZ{a~Poj)@i0talZsvJ}}D8kbvX02ibtC z2@oRxDaSBUC!w^Cf7AdS$GdPQEgZ&QaBB)`>VXfMKraMC(imiL)I-5a7|Z5ry|13Q z?5|^w+08#R;b+naWJAqJV#l9>b4At?K8hRRDGKonYz=;b3I{cJh=tW z>e&iI19L#_UH9X4;)Zbg*&_DQ2V+%?ZaMuyQzaImvYqP7?D{hAw7fFS%J`*BRYNcZ zEoGp2Rdn<@2{ZuMY{PJ{E<{9DM=%CgynCnV(IxH+EqBzK#GMt-{7UHXv^hPZ>pTl5(86C?u_Wg zB}flBXHb*zZ;PZ>NYfYU$0@knIP}D^u90>GJnk0%V}c}Gg-c8)_f?GT#N6ZcYA#O_ zHfU(dW4Y!RAYEi=h^EspL?2p_vswRRBrTm@^AG&l@{CBXV{2ozX<9)tBrEC`T&>5J zTnho@E1bGWhNubf<2p2EdIQ*p82#?(6!`q@!iCMIXKxvkb(TEFknL#M5p`kK>z9W8 z|DYK>w5<3<9&&YVq?}uXN7&!^_=kf@nM#s0jEZJ9mBltT-2)iG4@etoT?1nt+RXu8 zpvNWdQjk2Cvbo!gDm)l<)lpv#cr~pmls>_2wMPfWo7tnZHhXe z90!yfgf$AZ4cleC*?68|fL4(vzesult?$RPZU1L9kL>b@_cS==m5vbAC;-2ZmXC(= zoS%L;=#C-c2L{Htil3elK=I>jH5Wr46V)-0WuZ`$b5&$wj#?ouA zb$4v8T+TwH3H!^0wYk11a=zbg2?_}*Y*SY6Sl+XQh^r1BRYiO!xnjhdDul`R|FC68`pe8OIS&y78vPY_h^6*7d?_ z;j5*{9~?YF)-IU7D#gVoI)8CM;xb+S;jQ-6|&TuFR%U$$kOyH4kS@}0vf8VmqYy-z||{6OiCf%)a@$s zWu$9Qxi$?CwAo4mlmxhK8;W;y7fv;`$Ny^#n9BHorrtHCLy^!R!oS~oVfc`RijU{~l$mUZ<3oapiBm*HwJ z_PfV-RMB#!W2YXCuW&Q=*tJ2H7fo-|2u5{k z7KBMV0|5kIjegz+9+Zi%On(x4Ey=~~GHSJ6_`|d@)nl1CXONv6Ce2KV7-l1) z|4swD?I6XP57Za1BJ+JCs6iSh*-4D@)I1_EI^Nan?N-a}_fG9pdo;D?dd4$-)ds=; zRgiX~3%DX)&wmILbC#r(Wic;{jLV&CpLq3sq|b;5;iHw6EtS0!UzQ-EXKbwJcmIMoo% zA&?hg)8qQJ$3Y&K4re-7UG0Dinf}y|!k8k7mPZ02b&mnNsX%u9fbw%SF2D==y0V7Y zQ2YS5i}HWd_%giiJjav63(Fvde>7D%#G9sJ&W;uB=+S` zAq{$$*n%`+)ccY;@V8R3zu>b27~Wp7{La{Z(QN(2=0KUzH_r!a>sG5e{TJe*hM|!mY{vK*B6sT z0$+MU`=dlXy`Rbxs`V*{RoU*VIy;7)s4Z41)QU?8(h)381%E{CO}Q4Vtdx$6^bkaj zpaXj6^GrgjHMlfQtP58ynW?}JVXuVwQMy`kj)Xssgp>hW+{IY!RODL2wTAb*QjZ4& zf-Vs&=x}#tv$be{t-KY;jY@{edpJ-lIo79&!uDuHu0*azJk}w8#I`W!$s(zj(z9=> z9eDby!HBw9=bYxp5~D-FX-S}KWTcw$pqoT(HGD&#Ob7-BeGTi|BF0g75D(?|;B1$( ze1-m29KUWxO&;&ZfU-1gDdU+zZi?o@GNYO%SZ48zBW_M?*hElHeb(pt%*XW5{AKt% zX6=wa33mCs8fQ)1?@ElrbP!`g%C$~0BinIS{E;d?-~}F9R}rV(m&=R#o@}>XGOjVs zaqPtmsLEY0Y%Aae%@u5CBFChji4bZIIC>S{!DDfS=?o7O8B?j;v~VAF+^TbeSN5d| zSTufj-$-XmP>t9bGFB=CsJQ=|5rCbotn{R0Jy|$+fJ5897wb3ClJJ6R)D9&dXFeN5 z?s$cxf`=Qyfz&_VFpqq${b2O?!{OchWyFmHIDv6_A3LyCjo1LupcIT5L8OD0>@5lJQGS=|}U z;vG)sK3P}!)R-Ch0dp~#{a{ee3-JQQ(oennuYkqg#Fp}{hlj@Le!2h=$MUj&pR7VT zjk*Xt59|3B1Y_dusgGMj9QUpcvpXYxHZ1LRrEt0~&5VOhl_gW34{5-&F|i&7Of+nq z6#-=a*UT1lapX?<1Vv)Qv9zHvFngRjp+oNgid`R2Lxo@YIQe82iD23U1%q6H94Dow zsM^)95@5cM$hdjjtAHnY`Op?;U|T94AJ-Lysda@Ij+s<9EK*=GkYwtnd$o9=dqdC^EDY;jepEeV)&q z#tqF$_hqMqT3WKQ^3KTO(ohqIZz@iI|K5FPU0PPU3`Fc~)FDi7xa#lzE-BqPGG$1( zxNcI4751cGbcf5Gm#ATPiXCJrG9s0<4UM759EHV3cqB2nQDF~`RQ}+`jD!^#d%!mQ zZ^t_|1nMVxOe9L{n^KWvbWtg@vE?-PBJn@OBFuyBF}*=n{EUqe)#*6{hTye`5lV}* zKO~!RtNx;6A?-`ehb3fk>K3SOu^#^4eJ+f9wVNfL=s*$xh0Jk%Uu4 z=y?2|iidQQm%c%Wj{jp47fbHPPl5{O(5lU{B~7eMoa#=2^Ol?BI6;oOHt+KKbAA$M z>dcHL3B#EPZND0j1)a-;_Em(Sa>7=@tk27AOC3>@wz16IT?iLeWDt3B5nN|gcJ%jy zK@f3Rr0dc!1Cn;+WW}j9``XKJ%*y6QTqbeQ2L~Inf=lK36i-&>2i5k^up;Q6pKkqQ-l9g>+NI35xN{RN{$ebVCm4 zp5!18<@fr%`6&1}lCQti^>tz&DgLa4gT;UF?ew1^odmjJ=g5d2bvL==-Oo#ZEZXU& z;^2ILn8{>w*srF{ht&lytdcMgMsMR;EUAYh2 zdT6y@ktjdL=X)&|u?nF#jl`LwKz8c%84OXE#PO>{TLi94wWst31ZR520?M?6?q@!< zZy(KR4!9PamX{6v*LZCii}HxS!CB|GY$mT(Z0K5UvYb)>^L1w(=WO9utAN|x-P(_= zwAj2H7}N;19|L7)KWkc`^e?3Ue%b!-F&B%%=xR^-{Klb~`9D;*@4o9Px$)KWzfC?` q9@Bd(oSm-BJhZsFW+cdjEg1zgp4& literal 9620 zcmV;FC2QJ=P)e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{03ZNKL_t(|+U;FwtRz=;{!Vqj z)q^p3WpxOP#~zOj#9)>H5eO8ruqq)Sf)#L3P!*G5WLRHjNf~`)X9&od+&G7y;a?B-r#ZKS5|xaRaJN2y7%no zJLk#`*IlnwRY63|E1WA`1Cad<0Cio14^=I`=fC-U_`IqXUt_IXuc<1=<8l1Hy0-TM zKvh-o`%Bly<8kM8{|x->{(V(d+1$;~&&P4_D_rmOdS?Fl1po^R3&rc)5 z&a^~b*Qly0{>uzdVkVYgZ4!5u3GX_ps_MMgO9B6ycD+qHmL|JIbbcQFyDS%Qt*42SM(wYM zTZhA8r-?N;H#f7im{lu0kd7`Q@+OiuQ%j#e9Eo|jlJ-a(qtU3-gbL4jxCfg;B@?Sl zgSB1bx$5lvqG^VmFQJ;tLkMuQPX!x6@#8l&L|Dm8{pBx^hxI|f%Q_Lmw)X$U`R zVS!W?Dw+H%m7v$FAXSB4zt_B#AIzcfGzC_SAs?fTI2p|w>T~E#_;`Q)1bn<S;#j8 zNt2m7laoqg@b^mTy}MuCed$bQ%(zi$K0<9KA$*56^EG*LXgtUFXqqhkjrd(K-;<3+ zc`_#NC$~@TSDBoTW(O@uGwl$h&#M5^tZ!H&;YVpVKqE~^KB@WNex~U+G}40o?a2&E zdSsf4KnLlx@{{3npSaZg_GOn{7BvX~tgWpXzh^ui&u(J9{58LwNFff?5`Q8(jsJ(H z2a4Pt7EWO)T;sRe8P#Ty4bf<1#JI{vo(K_u(mYBUtO9jpYDvuBj4{!t(29kXN*p$s zgJvR_h}9Cb@+2vd2uYIg{83J3JgAY$g>I2%ylCD>UPwaZ{*(v|L=5LD6_MzjP1Y-TcE_F~0ph$MBzYBHx)AjqV# zHiRv(62~uY7)O-AjULkkI_c%=!m&$2E!vS6nFo}~AEvgLGe9Z@HVcpHbL=BUvG*2W+P)hS&N?KoY z3uH7H+B{3WmNN(^n-~g_MQ6-XXcD$;La7xqQL2$yskQw`QU^QN;J^CHt6{L^XZO7xoqM7U8|$j~?>SO;m< zn{(>)S@^zW)36SmpPx5QdO#|$Uv3zLaZFj#r*0Od4hz~0sCuPi*C*Y0*9)DaC3iQfhpgfy-c0tmr@hBbpU znOkT~EaUV=;lvs|n1>T0R_9SGoGlo&Xjr2xqGB|mIxbfBlru}OO^s-}&aPVKn^`}| zPiG1cX_y9Dokj!%;T421-5E0L!JPvF(2bivdSBEn=xORfopnO==_jZsLRqNojxt7#)F( zJt57ZDJwr54l`IwmPzLtg7J8qAw%Iqe}2|zk!{36lgf6cM_lMAeaJ2?IbCAIe&QT* zVQx`7QRQGfA~R3sOs%D$EJV|9stZ}$@U{y$utN_uks*%p!^QeDAV54qUL!ks_JVRaVWc5~i=NV`*tA z*C2sGs;bHoh57Q>NP%igOg-A$3J!2mWVGO=2=dqkNhXdknp{H)-*QAJBk_Wn!}DfB zl2TX{QD^(w@Ut2xMhhm3CIO>1a_6;GDG!t+r4tCb6ie5P29-wB`5zQF#zt^RZpwJ= zmIPFa@)^NbC-cmHFL_| z%r!^g#!=@CeGJiy(OS|(qpVM>k)fk+XL7(w2n==Mb#(!U=DgUXjCax*?Hl3l3kwS< zK~21grOwGylGZ8K971Kt9XHYnqTb|!k^OA^*0|5*VG2v5};nq^%#w69qsS{2@QV>zZ(xT*H zVw3z+$wS|e%*PW?9EAj}{eGcbgqUo55=NdhOQ*yHVoU@A1^A88_AtpfpZpDLnMK=L zqEu1)3Wrp5;%mpCNS!(ROe-Q53#TSoj3R2J1lToDlll4ib_OxdW1X0VwVVOn@RT?d zW3Z{EfF_VU0g)1eNXa2}-iwM2CaA+}85I$<7A$lEUfQWKiIl^S>a`l!oi}J3sAJ>; zHcA~1NeWJB!M!jM9SO)+5>_xyxsX{S>k!K4wP=NBcrc4FpE#hAd+AR~hInPpSsV1$O(V0mQ8n^P&QFOBJ` zF80yV2%;IRh;^(LIY3ZUt#H{Kp48lH0w~3|EL58z)%>#+Imr6D-EsxreaX4SQM3xULv+d*ojvmrt zrI|w2p=Ij~@>nFAVB4zWc}6q~qm-L3Pio)8vu!lUd#@%1Xn>z}hAXl_3x@4jRH;eZ zd2p^t{2{|m8HRN{Vc{;CqZ~rKOC2UpT_)V4Ga}MkjIWdtJiV#C1*oMpg@L-aG6+Yp zMx#+=j;skBtZ9^-V5Jg?az@ifYEAMA7O4xZDG{i)fJ$<5=R8LU4GVJcqaiRULLDie z#Wg54S>;2!KAfpy9eNwM7Y9A@)(2m*7H z$RufJSOWo$Da6;+h}htUv%U>T zLJRZn!xe;4vterodUR$hW4lVidN3Gt)}*T{`iqN;kwLoJwg^Mplp*W3#)3m>)=`vV zpj`{7+AN$2TfwMOXZa6?Q)Gonl;I8$6E@{AUMW7ybuI_saL8c5QR5r4(u;x(& zSACj?tBapu6a)mNswp-AbQ>DDLk8Q26e6Lo1JDMXq=*e_Fg#C&-g zqL63`@O&%YII*M-@00B0LXoxll3leB_n6VOwcaLqr`DcUDP!tIZF*82EF{xx{2PV9 z6bb-)MP8o*cp_IHrzSe%YB#6BIlC>E`58+PB5vZKJuJ=xlY5M+8K-a+CHXDQIvRgV z#R{xaWUOFfu>}S7;#)I&Sb#ZoyEl(Flu?o6BmU|y`VV?lhWP&ulD=`uC3>>;~+EhT`R(?$upEYXOUSVIl!PGuOy3M&Op5E<2X!^fS~3g z4#q%6Osv&+#Yhn*ET$A0eopAn@zsFYgPz}EAVAQG3` zX`n8dmnu1oJ+^~FAt)2c!Uhh!sxhbvQ7b^1h8%;0JfQFHuBzzI&CPY9c(e0_7!{)` zLspc10kH(-Q~fBl;*<=bV}3^*0I?G9nYy{NC2&@y^7jiegEdH5l?)Xn5NM^=_9mpU zsF?hKUmOzxQY*5B3WeMZ!E)IU0sb%`qI);H=_t*WF`!z zB3Oj){34Zic741)X&QE(g+p=#TZm>1U}D@+0xLJAb7?-t`-nB^V%43b0xlJ?mYdRe z#B!sNej?5hB-+s~EdnE9g_uHMfdU4aV13u!x&% zgNk2Y6^p_JnX2jo{Wf1z>MtgOtofd3ZhndL-W)u-)nek_z(HyB=jZ1mgK+ouj6sBe zdLo28wvHYOu(znjxFep5Rk`eokZBUIPHM8flAJInJ-n7G*~b#?Xfckskd5tKAV?KM zu9CTkUbe%TiMi>RD@!rGv9j+KA8=q(3z7ImOCBysb(2|lc?)5?ez=c!$yK_x?siM$!n@F)~ha^YEKtz3sAf z9QW?e&0}?SWs^EK4~&LGjD|xjEG}U@8fN}Sp!Lx9Cxm%32I-7mB^_qMtiI$U;)%Qs zA(p^7Ae`_u;)-Yl{+rkwneamuHGfDN&dn`gb@jeY%Gf;2v9`K`#iix=w=cQn#)(n; zz}aM7y?I4ig75-@u5(oy!`T~KmEzKj*O8b3Wk`WKTht~4#Y8>ReWUSklNvUUvNjttAh3A|O$$L)jyh$IpB9}G*Ofy|0^TOKgyOUoIX7;0LfSkw4}UOi ztXqR{kE{$MFDXQ48y0ZOQYCnfASDkOn`474@Y;s<(TIsgprzA?PvE5{&YQ>PQ4FOM zZTK!GQ+<%GD3%l=QpWU(!raxf31jsw4BDiUe5g}WCf4TfgxYhuFeIjJ@UnSq9+P8b zWd*CNtH#6%43n8yfvdV2$036rz(7kPP*DUG3Qjunf>u;DC$?K*tZ~n?@Ji_5Lf$81 zmd#`HXgijcmax3MY#3y1Z7p**X5L|nF*G8sp_y?fG}jM85O$XqPCc0|?p+*AeB#Sc zcMK6{av>&Sr=+%F2rIL3~AR)|$;-0k@{+y$L(+{ZAUD524)LW_P zo{+XA8IMs_J_6b24& z(t7HmU8WHj!Ovaszu&1fF^4*MyVCBoFnyAI*T2oy^IN%Ld<>)S6p$0 z+0k@FFa!gSr#z9LK$bin%jWwY^Yw5oyrx|*ZBN11!nwAwgy$$p%<#VS%zQ2o63-dm zGe19{?Go#E5AY?eY~ln{m=kq;{m`L9o!3j7aGEmO(Kz}V{QGUVLlLoEO+shI;x^DO zahLlI9`-KO{KVo*vXbPgO1_N}L`5ehwW&Fx*bW@7WHljt-DaHvx7Azu2+z!f)TUv5 ziDsBTCQeVJol(LT2`1}IeDZe2>-}sfm}?Uf!A5Um5Wmkj6DJFpY0uu~FP64Q3$MU{ z8_9ur2FtpdaBtpHCY@W@*!tBJmf~x+vpGzMJkFZik}$-6OCt6&DQ>2|Yrk!908LO8 z(-zdXrYSQ>mjo>lU-;W25lWr&XJL#Zb*S45W7@$^YU%k|fRq>|_^^DQwN7`Q4Q6in z#bvNeylm}w!BG1Aw1YKV?2EOwww9^-QuAuzb}yzpuu$jh>qEd*gS_8|&8TPlPGrBu zPP#SIvZ^f;ik9}q364QnGk8r>(kQ$zB?f8RYh^vhtc=s8J!T;iCg75}#q(3rA|+xx z5~zmoEL;j(V&G|?UylZf48k?(or@u<0a(_R!1&VEnNALJm6``Lv6E9SgwIOb*l}Y8 z-u8>OK+wEZK5rG5Hnfo=0@d=8IS_~6q05_DT~R__$RlN9l^DJ2;PI6RFqn{@F?^$g zjWPm{m!GBA>&4&m+jaQyl|H}TF#tfn*Xu>?(X~fm)(k;>FQ(uhXx^TNGlRZMj%4k` zsQZQ~y|O_7;cgoODMuAtYoYEKR!M@EBx#!lndYRgXMr}NL8fVyi~s&|+;P`kxbx0? zu;Y@8X4W8{(ApSfy_&1b)Z%dm2Jrre|LwNV&uU^8d-GORg?_)^u|J69IS7ly9mHrjM!(m`mMzP8)FV#D_A^h%GtPMmmX;Qectne%SnKscfC*A|T9|iM z<|vs+fq>f>Bske^pPzQHhKd?wI2>kR#gbVd#%yWLY>=ep9aoVxa!UYS%4}n3zUF#dea&^) zyKf)<`r;k<^9$aBeGmTVZSMjAoOr_Vc>jCf+3Kv95^<~{X33M3{50Qu znhBgcm3Zd#iN?Ude7+iw#|SUaRk{9X)OM)s3nmh`zcO7%V7rMokP(r}elc-~QY%T` zL)`Sfk`$rxeU-!bOc53LrLN?tYmYW3JgkG4x_tfxzwqpM?Z%sS#`pK#w}K1b_d$H& zi(kgw_w2^FRvbKd2-kh{M!e%ae}!GQeQ)ace)KBv4%l%z}EKI7LSDzaj)P_1fm!IDO4)SHsdIo(oOLL0ah;r zfE2rF`UA|w>h49Bj+0J2KEB_*cW-?E`7d6HAO83b0Ko6O;kCHzl8f+%zkB|K@kS$j z`m>*(I<_~R|2ll=1MkJhcl-_h^ew+1&tLN&Hvj<6BnG+pmRkV;JHN9lo;&l5twrZO z5b0<%im%~tnEksE1_?fN*XwWuSxAH#=se9U~$ zuJ3khkk!>STyyOWxcVE{W6z$wSXxd|vfXX5TKeBN4Y0GT0Nkp{pwK0pg^GOgtZ)o$vSi`0<^0#cRi(@UZxPf8#f_ z9m7F)GrfQK$j5Qjzo-1j!Gnjg@b|IDJ_JvE!sD>(w(sGdd-veFZ{CPKdndoU^|U8o zX=$-lgLo&p&e|5=AG75c9QesW0Ki2TUVu|hK53?8V_nzi^?JDWx^KpF?|%DR@H3}A2CsYL zo3s0$`Lw4-f99i~_)I*1?m17L8r|}6_EIu&)(m?Ij5s$pmxXx)6Y}quG>DI~6`gc% z7xMAx%P)Zgez5g5i7JWlx+8Ol---+sP}r~$lov_nl}vV#GR+?({+FpT(soj%jaUKT zQy=+TeCi_?w@caK(9D59L2eDK5nh#ePSglC-lRQ%glt_A>H@b1589piDwJrqwlYa6cr)_=uw zXK&wzEnBusohJ`A^wFhRe2^06iW8+JCJa6X|2~^{r9!Y+!tnavdi|f3>|=h2-S_Us z2`8TT|AslPyz{;q&ktuY3uPd+4!dY|Beac=j`%hVgie0|yUcb#;JVua8qsIT71W--;)nwJnZg z`?jq(cO?{;Ne{d*6H8;(asPWKY%aIeoYCcg+gp>0r;usCfcv!!x_()Hk@v_V;>K~35= zYwcP`e!p-3ek{x{;Gz$F7&q;_1psiu@ejveUU&iK8V9^>?b_fyzT~+p(>`1qWX^bL z{n|3+45swg{P#t$B8PdWF-QR0wM}jqz${RNqh-cSGjY1cy3u-vjfR0s!s&2PzlU>N z{Nc-Sm|_W7Vi4aqs1%=G zFLUs@Fo7j0bblU4i*bFqfuH|2X1U+y1&W3F1pvUKAAJgb{bj#`GbuPQ%e-!cLE4z4 z%j)o^*fhV!f41*|VqKZu5ZP+eAhSx?w!xNan)&{<;ozrA0HvDr`;$q0MWQc-=AHq5 zZSIfb?Qi{qR$`oWe!CcCJvHkk4N@|Z+Q5ju(9Pc)e4e2|i3zY!CQOD2zo z7AZxsyoNiP8l+2m$p3+DAGn<0aGE+Cu7(QV>o>^Z97)Ls$y$%{zoi8#rT7n*LAttT zv}+M5PHfxnv^jBY3&eP!()j#5_yV6&*AEUe&g!gsN!#{(e(o8nGD|H;8-aBNO}d1f zuQ>F1it(`93GX`zUx)RUW Date: Sun, 15 Feb 2015 20:05:00 +0100 Subject: [PATCH 069/133] Fixed path to FLTK DLL mingw-x-fltk >= 1.3.3 has the FLTK DLL inside the bin directory like all the other library packages as well. --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d0f8760a1..2dd80421a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -176,7 +176,7 @@ IF(LMMS_BUILD_WIN32) "${MINGW_PREFIX}/bin/libvorbisfile-3.dll" "${MINGW_PREFIX}/bin/libjpeg-9.dll" "${MINGW_PREFIX}/bin/libogg-0.dll" - "${MINGW_PREFIX}/lib/libfltk.dll" + "${MINGW_PREFIX}/bin/libfltk.dll" "${MINGW_PREFIX}/bin/libfluidsynth.dll" "${MINGW_PREFIX}/bin/libfftw3f-3.dll" "${MINGW_PREFIX}/bin/libFLAC-8.dll" From 317b2f02a829f694a66c760fc6de7df1db99b006 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Mon, 16 Feb 2015 18:22:49 +0100 Subject: [PATCH 070/133] AutomatableModel: fix wrong comparison logic We must not negate the float but instead test for inequality in order to determine whether the linked model has to be updated. Closes #1761. --- src/core/AutomatableModel.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/AutomatableModel.cpp b/src/core/AutomatableModel.cpp index 6c7501c8b..bf56285e5 100644 --- a/src/core/AutomatableModel.cpp +++ b/src/core/AutomatableModel.cpp @@ -318,8 +318,7 @@ void AutomatableModel::setAutomatedValue( const float value ) it != m_linkedModels.end(); ++it ) { if( (*it)->m_setValueDepth < 1 && - !(*it)->fittedValue( m_value ) != - (*it)->m_value ) + (*it)->fittedValue( m_value ) != (*it)->m_value ) { (*it)->setAutomatedValue( value ); } From 15e759b6d3287c4fb0bfdca9f56f96f090bcc147 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Mon, 16 Feb 2015 15:13:02 -0500 Subject: [PATCH 071/133] Update NSIS URLs Closes #1766. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a526df3df..1ba886503 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -575,8 +575,8 @@ IF(WIN32) SET(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/data/lmms.ico") SET(CPACK_NSIS_INSTALLED_ICON_NAME "lmms.exe") SET(CPACK_NSIS_DISPLAY_NAME "LMMS ${VERSION}") - SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lmms.io") - SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\lmms.io") + SET(CPACK_NSIS_HELP_LINK "http://lmms.io") + SET(CPACK_NSIS_URL_INFO_ABOUT "http://lmms.io") SET(CPACK_NSIS_CONTACT "lmms-devel@lists.sourceforge.net") SET(CPACK_PACKAGE_EXECUTABLES "lmms.exe;LMMS") SET(CPACK_NSIS_MENU_LINKS "lmms.exe;LMMS") From 96882f44d5e473e8efe5c2d5ed62e64c020e23ab Mon Sep 17 00:00:00 2001 From: "Raine M. Ekman" Date: Tue, 17 Feb 2015 23:36:53 +0100 Subject: [PATCH 072/133] Added view menu To be reviewed and reverted if undesired. Based on https://sourceforge.net/p/lmms/patches/38/ Signed-off-by: Tobias Doerffel --- include/MainWindow.h | 3 ++ src/gui/MainWindow.cpp | 115 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 117 insertions(+), 1 deletion(-) diff --git a/include/MainWindow.h b/include/MainWindow.h index 82f3cd365..86ab8adc6 100644 --- a/include/MainWindow.h +++ b/include/MainWindow.h @@ -172,6 +172,7 @@ private: friend class GuiApplication; + QMenu * m_viewMenu; private slots: void browseHelp(); @@ -179,6 +180,8 @@ private slots: void openRecentlyOpenedProject( QAction * _action ); void showTool( QAction * _idx ); void updateRecentlyOpenedProjectsMenu(); + void updateViewMenu( void ); + void updateConfig( QAction * _who ); void autoSave(); diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index b37c3a79b..de1599112 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -74,7 +74,8 @@ MainWindow::MainWindow() : m_templatesMenu( NULL ), m_recentlyOpenedProjectsMenu( NULL ), m_toolsMenu( NULL ), - m_autoSaveTimer( this ) + m_autoSaveTimer( this ), + m_viewMenu( NULL ) { setAttribute( Qt::WA_DeleteOnClose ); @@ -300,6 +301,13 @@ void MainWindow::finalize() tr( "Settings" ), this, SLOT( showSettingsDialog() ) ); + m_viewMenu = new QMenu( this ); + menuBar()->addMenu( m_viewMenu )->setText( tr( "&View" ) ); + connect( m_viewMenu, SIGNAL( aboutToShow() ), + this, SLOT( updateViewMenu() ) ); + connect( m_viewMenu, SIGNAL(triggered(QAction*)), this, + SLOT(updateConfig(QAction*))); + m_toolsMenu = new QMenu( this ); Plugin::DescriptorList pluginDescriptors; @@ -1008,6 +1016,111 @@ void MainWindow::toggleFxMixerWin() } +void MainWindow::updateViewMenu() +{ + m_viewMenu->clear(); + // TODO: get current visibility for these and indicate in menu? + // Not that it's straight visible <-> invisible, more like + // not on top -> top <-> invisible + m_viewMenu->addAction(embed::getIconPixmap( "songeditor" ), + tr( "Song Editor" ) + " (F5)", + this, SLOT( toggleSongEditorWin() ) + ); + m_viewMenu->addAction(embed::getIconPixmap( "bb_track" ), + tr( "Pattern Editor" ) + " (F6)", + this, SLOT( toggleBBEditorWin() ) + ); + m_viewMenu->addAction(embed::getIconPixmap( "piano" ), + tr( "Piano Roll" ) + " (F7)", + this, SLOT( togglePianoRollWin() ) + ); + m_viewMenu->addAction(embed::getIconPixmap( "automation" ), + tr( "Automation Editor" ) + " (F8)", + this, + SLOT( toggleAutomationEditorWin()) + ); + m_viewMenu->addAction(embed::getIconPixmap( "fx_mixer" ), + tr( "FX Mixer" ) + " (F9)", + this, SLOT( toggleFxMixerWin() ) + ); + m_viewMenu->addAction(embed::getIconPixmap( "project_notes" ), + tr( "Project Notes" ) + " (F10)", + this, SLOT( toggleProjectNotesWin() ) + ); + m_viewMenu->addAction(embed::getIconPixmap( "controller" ), + tr( "Show/hide controller rack" ) + + " (F11)", + this, SLOT( toggleControllerRack() ) + ); + + m_viewMenu->addSeparator(); + + // Here we should put all look&feel -stuff from configmanager + // that is safe to change on the fly. There is probably some + // more elegant way to do this. + QAction *qa; + qa = new QAction(tr( "Volume as dBV" ), this); + qa->setData("displaydbv"); + qa->setCheckable( true ); + qa->setChecked( ConfigManager::inst()->value( "app", "displaydbv" ). + toInt() ? true : false ); + m_viewMenu->addAction(qa); + + // Maybe this is impossible? + /* qa = new QAction(tr( "Tooltips" ), this); + qa->setData("tooltips"); + qa->setCheckable( true ); + qa->setChecked( ConfigManager::inst()->value( "tooltips", "disabled" ). + toInt() ? false : true ); + m_viewMenu->addAction(qa); + */ + + // Should be doable. + /* qa = new QAction(tr( "Smooth scroll" ), this); + qa->setData("smoothscroll"); + qa->setCheckable( true ); + qa->setChecked( ConfigManager::inst()->value( "ui", "smoothscroll" ). + toInt() ? true : false ); + m_viewMenu->addAction(qa); + */ + + // Not yet. + /* qa = new QAction(tr( "One instrument track window" ), this); + qa->setData("oneinstrument"); + qa->setCheckable( true ); + qa->setChecked( ConfigManager::inst()->value( "ui", "oneinstrumenttrackwindow" ). + toInt() ? true : false ); + m_viewMenu->addAction(qa); + */ +} + + +void MainWindow::updateConfig( QAction * _who ) +{ + QString tag = _who->data().toString(); + bool checked = _who->isChecked(); + + if( tag == "displaydbv" ) + { + ConfigManager::inst()->setValue( "app", "displaydbv", + QString::number(checked) ); + } + else if ( tag == "tooltips" ) + { + ConfigManager::inst()->setValue( "tooltips", "disabled", + QString::number(!checked) ); + } + else if ( tag == "smoothscroll" ) + { + ConfigManager::inst()->setValue( "ui", "smoothscroll", + QString::number(checked) ); + } + else if ( tag == "oneinstrument" ) + { + ConfigManager::inst()->setValue( "ui", "oneinstrumenttrackwindow", + QString::number(checked) ); + } +} void MainWindow::toggleControllerRack() From 1dcacbb95e5182f784d8a951dee63c96c7487830 Mon Sep 17 00:00:00 2001 From: Hannu Haahti Date: Wed, 18 Feb 2015 13:24:28 +0200 Subject: [PATCH 073/133] Remove semaphores from JACK backend --- include/AudioJack.h | 2 -- src/core/audio/AudioJack.cpp | 10 +--------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/include/AudioJack.h b/include/AudioJack.h index 32f658399..35801ef03 100644 --- a/include/AudioJack.h +++ b/include/AudioJack.h @@ -97,8 +97,6 @@ private: bool m_active; bool m_stopped; - QSemaphore m_stopSemaphore; - QVector m_outputPorts; jack_default_audio_sample_t * * m_tempOutBufs; surroundSampleFrame * m_outBuf; diff --git a/src/core/audio/AudioJack.cpp b/src/core/audio/AudioJack.cpp index 513898983..b491ea826 100644 --- a/src/core/audio/AudioJack.cpp +++ b/src/core/audio/AudioJack.cpp @@ -51,7 +51,6 @@ AudioJack::AudioJack( bool & _success_ful, Mixer* _mixer ) : _mixer ), m_client( NULL ), m_active( false ), - m_stopSemaphore( 1 ), m_tempOutBufs( new jack_default_audio_sample_t *[channels()] ), m_outBuf( new surroundSampleFrame[mixer()->framesPerPeriod()] ), m_framesDoneInCurBuf( 0 ), @@ -60,8 +59,6 @@ AudioJack::AudioJack( bool & _success_ful, Mixer* _mixer ) : _success_ful = initJackClient(); if( _success_ful ) { - m_stopSemaphore.acquire(); - connect( this, SIGNAL( zombified() ), this, SLOT( restartAfterZombified() ), Qt::QueuedConnection ); @@ -74,8 +71,6 @@ AudioJack::AudioJack( bool & _success_ful, Mixer* _mixer ) : AudioJack::~AudioJack() { - m_stopSemaphore.release(); - #ifdef AUDIO_PORT_SUPPORT while( m_portMap.size() ) { @@ -249,7 +244,6 @@ void AudioJack::startProcessing() void AudioJack::stopProcessing() { - m_stopSemaphore.acquire(); } @@ -390,7 +384,6 @@ int AudioJack::processCallback( jack_nframes_t _nframes, void * _udata ) if( !m_framesToDoInCurBuf ) { m_stopped = true; - m_stopSemaphore.release(); } m_framesDoneInCurBuf = 0; } @@ -446,7 +439,7 @@ AudioJack::setupWidget::setupWidget( QWidget * _parent ) : cn_lbl->setFont( pointSize<7>( cn_lbl->font() ) ); cn_lbl->setGeometry( 10, 40, 160, 10 ); - LcdSpinBoxModel * m = new LcdSpinBoxModel( /* this */ ); + LcdSpinBoxModel * m = new LcdSpinBoxModel( /* this */ ); m->setRange( DEFAULT_CHANNELS, SURROUND_CHANNELS ); m->setStep( 2 ); m->setValue( ConfigManager::inst()->value( "audiojack", @@ -483,4 +476,3 @@ void AudioJack::setupWidget::saveSettings() #endif - From 4f5f855e875bdab3238483282dee78c99b37c454 Mon Sep 17 00:00:00 2001 From: Dave French Date: Thu, 29 Jan 2015 12:41:59 +0000 Subject: [PATCH 074/133] Remove the file extensions from the translations in the saveAsDialog --- src/gui/MainWindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index de1599112..7cd5bb580 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -828,8 +828,8 @@ bool MainWindow::saveProject() bool MainWindow::saveProjectAs() { VersionedSaveDialog sfd( this, tr( "Save Project" ), "", - tr( "LMMS Project (*.mmpz *.mmp);;" - "LMMS Project Template (*.mpt)" ) ); + tr( "LMMS Project " ) + "(*.mmpz *.mmp);;" + + tr( "LMMS Project Template " ) + "(*.mpt)" ); QString f = Engine::getSong()->projectFileName(); if( f != "" ) { From c1272fb1c57ef04db76356b2ea1d03e703e9079f Mon Sep 17 00:00:00 2001 From: curlymorphic Date: Thu, 19 Feb 2015 08:47:17 +0000 Subject: [PATCH 075/133] removed file extensions from translations for SaveAs dialog --- data/locale/ca.ts | 8 ++++++++ data/locale/cs.ts | 8 ++++++++ data/locale/de.ts | 8 ++++++++ data/locale/en.ts | 6 +++++- data/locale/es.ts | 6 +++++- data/locale/fa.ts | 6 +++++- data/locale/fr.ts | 6 +++++- data/locale/gl.ts | 6 +++++- data/locale/it.ts | 8 ++++++-- data/locale/ja.ts | 6 +++++- data/locale/ko.ts | 6 +++++- data/locale/nl.ts | 6 +++++- data/locale/pl.ts | 6 +++++- data/locale/pt.ts | 6 +++++- data/locale/ru.ts | 6 +++++- data/locale/sv.ts | 6 +++++- data/locale/zh.ts | 8 ++++++-- 17 files changed, 96 insertions(+), 16 deletions(-) diff --git a/data/locale/ca.ts b/data/locale/ca.ts index c58fb75f3..90893329e 100644 --- a/data/locale/ca.ts +++ b/data/locale/ca.ts @@ -3556,6 +3556,14 @@ Per favor, visita http://lmms.sf.net/wiki per a documentació sobre LMMS.LMMS Project (*.mmpz *.mmp);;LMMS Project Template (*.mpt) + + LMMS Project + + + + LMMS Project Template + + My Projects diff --git a/data/locale/cs.ts b/data/locale/cs.ts index f75924349..f8504641c 100644 --- a/data/locale/cs.ts +++ b/data/locale/cs.ts @@ -3556,6 +3556,14 @@ Navštivte prosím stránku s dokumentací k LMMS na adrese http://lmms.sf.net/w LMMS Project (*.mmpz *.mmp);;LMMS Project Template (*.mpt) + + LMMS Project + + + + LMMS Project Template + + My Projects diff --git a/data/locale/de.ts b/data/locale/de.ts index fb91f0ed7..23769bbd4 100644 --- a/data/locale/de.ts +++ b/data/locale/de.ts @@ -3573,6 +3573,14 @@ Bitte besuchen Sie http://lmms.sf.net/wiki für Dokumentationen über LMMS.LMMS Project (*.mmpz *.mmp);;LMMS Project Template (*.mpt) LMMS Projekt (*.mmpz *.mmp);;LMMS Projektvorlage (*.mpt) + + LMMS Project + LMMS Projekt + + + LMMS Project Template + LMMS Projektvorlage + Volumes Volumes diff --git a/data/locale/en.ts b/data/locale/en.ts index 87db27019..c0d553bdb 100644 --- a/data/locale/en.ts +++ b/data/locale/en.ts @@ -3550,7 +3550,11 @@ Please visit http://lmms.sf.net/wiki for documentation on LMMS. - LMMS Project (*.mmpz *.mmp);;LMMS Project Template (*.mpt) + LMMS Project + + + + LMMS Project Template diff --git a/data/locale/es.ts b/data/locale/es.ts index 37fca5929..713892a31 100644 --- a/data/locale/es.ts +++ b/data/locale/es.ts @@ -3550,7 +3550,11 @@ Please visit http://lmms.sf.net/wiki for documentation on LMMS. - LMMS Project (*.mmpz *.mmp);;LMMS Project Template (*.mpt) + LMMS Project + + + + LMMS Project Template diff --git a/data/locale/fa.ts b/data/locale/fa.ts index 1dc48d62a..a20b0dbef 100644 --- a/data/locale/fa.ts +++ b/data/locale/fa.ts @@ -3550,7 +3550,11 @@ Please visit http://lmms.sf.net/wiki for documentation on LMMS. - LMMS Project (*.mmpz *.mmp);;LMMS Project Template (*.mpt) + LMMS Project + + + + LMMS Project Template diff --git a/data/locale/fr.ts b/data/locale/fr.ts index ef8fc4177..9a3ccf4ba 100644 --- a/data/locale/fr.ts +++ b/data/locale/fr.ts @@ -3566,7 +3566,11 @@ Veuillez visiter http://lmms.sf.net/wiki pour la documentation de LMMS. - LMMS Project (*.mmpz *.mmp);;LMMS Project Template (*.mpt) + LMMS Project + + + + LMMS Project Template diff --git a/data/locale/gl.ts b/data/locale/gl.ts index d418fe848..b1e7216ad 100644 --- a/data/locale/gl.ts +++ b/data/locale/gl.ts @@ -3566,7 +3566,11 @@ Visitehttp://lmms.sf.net/wiki para documentación sobre o LMMS. - LMMS Project (*.mmpz *.mmp);;LMMS Project Template (*.mpt) + LMMS Project + + + + LMMS Project Template diff --git a/data/locale/it.ts b/data/locale/it.ts index b8e2fcd24..cd1ef22f9 100644 --- a/data/locale/it.ts +++ b/data/locale/it.ts @@ -3574,8 +3574,12 @@ Visitare http://lmms.sf.net/wiki per la documentazione di LMMS. Rifai - LMMS Project (*.mmpz *.mmp);;LMMS Project Template (*.mpt) - Progetto LMMS (*mmpz *.mmp);;Progetto Template LMMS (*.mpt) + LMMS Project + Progetto LMMS + + + LMMS Project Template + Progetto Template LMMS My Projects diff --git a/data/locale/ja.ts b/data/locale/ja.ts index b5aa1586d..8bcf4c5f0 100644 --- a/data/locale/ja.ts +++ b/data/locale/ja.ts @@ -3569,7 +3569,11 @@ Please visit http://lmms.sf.net/wiki for documentation on LMMS. - LMMS Project (*.mmpz *.mmp);;LMMS Project Template (*.mpt) + LMMS Project + + + + LMMS Project Template diff --git a/data/locale/ko.ts b/data/locale/ko.ts index 200af7bb2..27f7a9044 100644 --- a/data/locale/ko.ts +++ b/data/locale/ko.ts @@ -3551,7 +3551,11 @@ LMMS 문서는 http://lmms.sf.net/wiki를 방문하세요. - LMMS Project (*.mmpz *.mmp);;LMMS Project Template (*.mpt) + LMMS Project + + + + LMMS Project Template diff --git a/data/locale/nl.ts b/data/locale/nl.ts index f775c1985..1d3ff74e2 100644 --- a/data/locale/nl.ts +++ b/data/locale/nl.ts @@ -3550,7 +3550,11 @@ Please visit http://lmms.sf.net/wiki for documentation on LMMS. - LMMS Project (*.mmpz *.mmp);;LMMS Project Template (*.mpt) + LMMS Project + + + + LMMS Project Template diff --git a/data/locale/pl.ts b/data/locale/pl.ts index 18a3899ea..8a1ab0103 100644 --- a/data/locale/pl.ts +++ b/data/locale/pl.ts @@ -3571,7 +3571,11 @@ Odwiedź witrynę http://lmms.sf.net/wiki for documentation on LMMS. - LMMS Project (*.mmpz *.mmp);;LMMS Project Template (*.mpt) + LMMS Project + + + + LMMS Project Template diff --git a/data/locale/pt.ts b/data/locale/pt.ts index ae4e5d5ab..8e5ee5a53 100644 --- a/data/locale/pt.ts +++ b/data/locale/pt.ts @@ -3569,7 +3569,11 @@ Por favor certifique-se que você tem permissão de escrita para este arquivo e - LMMS Project (*.mmpz *.mmp);;LMMS Project Template (*.mpt) + LMMS Project + + + + LMMS Project Template diff --git a/data/locale/ru.ts b/data/locale/ru.ts index e7d086300..03bd19f1f 100644 --- a/data/locale/ru.ts +++ b/data/locale/ru.ts @@ -3597,7 +3597,11 @@ Please visit http://lmms.sf.net/wiki for documentation on LMMS. Возврат действия - LMMS Project (*.mmpz *.mmp);;LMMS Project Template (*.mpt) + LMMS Project + + + + LMMS Project Template diff --git a/data/locale/sv.ts b/data/locale/sv.ts index 2cc7d6c64..cae965bd7 100644 --- a/data/locale/sv.ts +++ b/data/locale/sv.ts @@ -3550,7 +3550,11 @@ Please visit http://lmms.sf.net/wiki for documentation on LMMS. - LMMS Project (*.mmpz *.mmp);;LMMS Project Template (*.mpt) + LMMS Project + + + + LMMS Project Template diff --git a/data/locale/zh.ts b/data/locale/zh.ts index 8978c1aa3..4457fe715 100644 --- a/data/locale/zh.ts +++ b/data/locale/zh.ts @@ -3557,8 +3557,12 @@ Please visit http://lmms.sf.net/wiki for documentation on LMMS. 重做 - LMMS Project (*.mmpz *.mmp);;LMMS Project Template (*.mpt) - LMMS 工程 (*.mmpz *.mmp);;LMMS 工程模板 (*.mpt) + LMMS Project + LMMS 工程 + + + LMMS Project Template + LMMS 工程模板 Volumes From d6a1a61b4505fbc44b68886ec9af576f19067bbd Mon Sep 17 00:00:00 2001 From: Dave French Date: Thu, 19 Feb 2015 16:20:55 +0000 Subject: [PATCH 076/133] Removed trailing spaces form save as Translations --- data/locale/de.ts | 8 ++++---- data/locale/it.ts | 4 ++-- data/locale/zh.ts | 6 +++--- src/gui/MainWindow.cpp | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/data/locale/de.ts b/data/locale/de.ts index 23769bbd4..7ea9b3f8b 100644 --- a/data/locale/de.ts +++ b/data/locale/de.ts @@ -3574,12 +3574,12 @@ Bitte besuchen Sie http://lmms.sf.net/wiki für Dokumentationen über LMMS.LMMS Projekt (*.mmpz *.mmp);;LMMS Projektvorlage (*.mpt) - LMMS Project - LMMS Projekt + LMMS Project + LMMS Projekt - LMMS Project Template - LMMS Projektvorlage + LMMS Project Template + LMMS Projektvorlage Volumes diff --git a/data/locale/it.ts b/data/locale/it.ts index cd1ef22f9..08376ac3e 100644 --- a/data/locale/it.ts +++ b/data/locale/it.ts @@ -3574,11 +3574,11 @@ Visitare http://lmms.sf.net/wiki per la documentazione di LMMS. Rifai - LMMS Project + LMMS Project Progetto LMMS - LMMS Project Template + LMMS Project Template Progetto Template LMMS diff --git a/data/locale/zh.ts b/data/locale/zh.ts index 4457fe715..c0c0c572e 100644 --- a/data/locale/zh.ts +++ b/data/locale/zh.ts @@ -3557,12 +3557,12 @@ Please visit http://lmms.sf.net/wiki for documentation on LMMS. 重做 - LMMS Project + LMMS Project LMMS 工程 - LMMS Project Template - LMMS 工程模板 + LMMS Project Template + LMMS 工程模板 Volumes diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 7cd5bb580..63b90179b 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -828,8 +828,8 @@ bool MainWindow::saveProject() bool MainWindow::saveProjectAs() { VersionedSaveDialog sfd( this, tr( "Save Project" ), "", - tr( "LMMS Project " ) + "(*.mmpz *.mmp);;" + - tr( "LMMS Project Template " ) + "(*.mpt)" ); + tr( "LMMS Project" ) + " (*.mmpz *.mmp);;" + + tr( "LMMS Project Template" ) + " (*.mpt)" ); QString f = Engine::getSong()->projectFileName(); if( f != "" ) { From 0d560671217d57f89eefdcedf6c52bfb9998754a Mon Sep 17 00:00:00 2001 From: Ododo Date: Thu, 19 Feb 2015 22:30:53 +0100 Subject: [PATCH 077/133] Update fr.ts --- data/locale/fr.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/locale/fr.ts b/data/locale/fr.ts index ef8fc4177..f9886b94c 100644 --- a/data/locale/fr.ts +++ b/data/locale/fr.ts @@ -584,7 +584,7 @@ If you're interested in translating LMMS in another language or want to imp BBTrack Beat/Bassline %1 - Ryhtme ou ligne de basse %1 + Rythme ou ligne de basse %1 Clone of %1 From 42e12e6b27b7aff809347ae25c63aa082832942b Mon Sep 17 00:00:00 2001 From: Dave French Date: Fri, 20 Feb 2015 11:55:51 +0000 Subject: [PATCH 078/133] Delay the deleting of a track view until the next event loop, this stops the segfault when deleting BB tracks during playback --- src/gui/TrackContainerView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/TrackContainerView.cpp b/src/gui/TrackContainerView.cpp index 23250dc10..4513e9edf 100644 --- a/src/gui/TrackContainerView.cpp +++ b/src/gui/TrackContainerView.cpp @@ -237,7 +237,7 @@ void TrackContainerView::deleteTrackView( TrackView * _tv ) removeTrackView( _tv ); delete _tv; - delete t; + t->deleteLater(); } From 6a70fbd724dbd68dd02a96099a74902e69a6f2b2 Mon Sep 17 00:00:00 2001 From: Dave French Date: Fri, 20 Feb 2015 12:48:27 +0000 Subject: [PATCH 079/133] Stop quantizing copied notes, leaving them at there original timings. Notes that were quantised remain so --- src/gui/editors/PianoRoll.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 92f7f0f1e..c235fa8b4 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -1535,7 +1535,7 @@ void PianoRoll::mousePressEvent(QMouseEvent * me ) //put notes from vector into piano roll for( int i = 0; i < newNotes.size(); ++i) { - Note * newNote = m_pattern->addNote( newNotes[i] ); + Note * newNote = m_pattern->addNote( newNotes[i], false ); newNote->setSelected( false ); } From a6e37316f135724958bda59f5fd91fea2a920a9e Mon Sep 17 00:00:00 2001 From: Dave French Date: Fri, 20 Feb 2015 16:56:28 +0000 Subject: [PATCH 080/133] linearToLogScale and logToLinearScale return 0 rather than nan --- include/lmms_math.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/include/lmms_math.h b/include/lmms_math.h index d1a9dcc79..d89280be2 100644 --- a/include/lmms_math.h +++ b/include/lmms_math.h @@ -217,9 +217,11 @@ static inline float logToLinearScale( float min, float max, float value ) { const float mmax = qMax( qAbs( min ), qAbs( max ) ); const float val = value * ( max - min ) + min; - return signedPowf( val / mmax, F_E ) * mmax; + float result = signedPowf( val / mmax, F_E ) * mmax; + return isnan( result ) ? 0 : result; } - return powf( value, F_E ) * ( max - min ) + min; + float result = powf( value, F_E ) * ( max - min ) + min; + return isnan( result ) ? 0 : result; } @@ -231,9 +233,11 @@ static inline float linearToLogScale( float min, float max, float value ) if( min < 0 ) { const float mmax = qMax( qAbs( min ), qAbs( max ) ); - return signedPowf( value / mmax, EXP ) * mmax; + float result = signedPowf( value / mmax, EXP ) * mmax; + return isnan( result ) ? 0 : result; } - return powf( val, EXP ) * ( max - min ) + min; + float result = powf( val, EXP ) * ( max - min ) + min; + return isnan( result ) ? 0 : result; } From 7e2bb36104861369e8f19b8aed24d7c996ebdb1a Mon Sep 17 00:00:00 2001 From: Dave French Date: Mon, 23 Feb 2015 21:16:38 +0000 Subject: [PATCH 081/133] Added Checking of filetypes from the xml. Added a static function fileTypeFromData to the DataFile class. This opens the given file and checks the xml for its file type, as oposed to relying on the file extension --- include/DataFile.h | 5 +++++ src/core/DataFile.cpp | 39 +++++++++++++++++++++++++++++++++++++++ src/gui/FileBrowser.cpp | 3 ++- 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/include/DataFile.h b/include/DataFile.h index 1d5f71f78..86dee8675 100644 --- a/include/DataFile.h +++ b/include/DataFile.h @@ -56,6 +56,11 @@ public: DataFile( const QByteArray& data ); DataFile( Type type ); + /// \brief fileTypeFromData + /// Reads the given file and checks the xml for the type + /// returns UnknownType if the file is not reconised + static DataFile::Type fileTypeFromData( const QString fileName); + virtual ~DataFile(); QString nameWithExtension( const QString& fn ) const; diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index 1e79b0c08..2be3f0377 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -114,6 +114,45 @@ DataFile::DataFile( Type type ) : } +DataFile::Type DataFile::fileTypeFromData(const QString fileName) +{ + QString errorMsg; + DataFile::Type t; + QDomDocument doc; + + QFile inFile( fileName ); + if( !inFile.open( QIODevice::ReadOnly ) ) + { + return DataFile::Type::UnknownType; + } + + QByteArray data = inFile.readAll(); + inFile.close(); + + int line = -1, col = -1; + if( !doc.setContent( data, &errorMsg, &line, &col ) ) + { + // parsing failed? then try to uncompress data + QByteArray uncompressed = qUncompress( data ); + if( !uncompressed.isEmpty() ) + { + if( doc.setContent( uncompressed, &errorMsg, &line, &col ) ) + { + line = col = -1; + } + } + if( line >= 0 && col >= 0 ) + { + return DataFile::Type::UnknownType; + } + } + + QDomElement root = doc.documentElement(); + t = type( root.attribute( "type" ) ); + + return t; +} + diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index 0d19ec6aa..4253ce55d 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -459,7 +459,8 @@ void FileBrowserTreeWidget::mousePressEvent(QMouseEvent * me ) } else if( f->type() != FileItem::VstPluginFile && ( f->handling() == FileItem::LoadAsPreset || - f->handling() == FileItem::LoadByPlugin ) ) + f->handling() == FileItem::LoadByPlugin ) + && DataFile::fileTypeFromData( f->fullName() ) == DataFile::Type::InstrumentTrackSettings ) { m_previewPlayHandle = new PresetPreviewPlayHandle( f->fullName(), f->handling() == FileItem::LoadByPlugin ); } From 448f5be35004c157197db309aaa7904e0a518171 Mon Sep 17 00:00:00 2001 From: Dave French Date: Tue, 24 Feb 2015 22:08:46 +0000 Subject: [PATCH 082/133] Removed Double click to open piano roll, in the BBeditor, this is to stop notes being added in error --- include/Pattern.h | 1 - src/tracks/Pattern.cpp | 20 -------------------- 2 files changed, 21 deletions(-) diff --git a/include/Pattern.h b/include/Pattern.h index 511dd6cd3..d57538404 100644 --- a/include/Pattern.h +++ b/include/Pattern.h @@ -179,7 +179,6 @@ protected slots: protected: virtual void constructContextMenu( QMenu * ); - virtual void mouseDoubleClickEvent( QMouseEvent * _me ); virtual void mousePressEvent( QMouseEvent * _me ); virtual void paintEvent( QPaintEvent * _pe ); virtual void resizeEvent( QResizeEvent * _re ) diff --git a/src/tracks/Pattern.cpp b/src/tracks/Pattern.cpp index c348f50b8..ca0f15e2c 100644 --- a/src/tracks/Pattern.cpp +++ b/src/tracks/Pattern.cpp @@ -776,26 +776,6 @@ void PatternView::constructContextMenu( QMenu * _cm ) -void PatternView::mouseDoubleClickEvent( QMouseEvent * _me ) -{ - if( _me->button() != Qt::LeftButton ) - { - _me->ignore(); - return; - } - if( m_pat->type() == Pattern::MelodyPattern || - !( m_pat->type() == Pattern::BeatPattern && - ( pixelsPerTact() >= 192 || - m_pat->m_steps != MidiTime::stepsPerTact() ) && - _me->y() > height() - s_stepBtnOff->height() ) ) - { - openInPianoRoll(); - } -} - - - - void PatternView::mousePressEvent( QMouseEvent * _me ) { if( _me->button() == Qt::LeftButton && From e1e91cecb2c737dd627ef3a01afef349564da994 Mon Sep 17 00:00:00 2001 From: tresf Date: Thu, 15 Jan 2015 15:44:21 -0500 Subject: [PATCH 083/133] Prevent running as root user --- src/core/main.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/core/main.cpp b/src/core/main.cpp index a489323fb..5313811d1 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -116,6 +116,7 @@ int main( int argc, char * * argv ) bool core_only = false; bool fullscreen = true; bool exit_after_import = false; + bool allow_root = false; QString file_to_load, file_to_save, file_to_import, render_out, profilerOutputFile; for( int i = 1; i < argc; ++i ) @@ -127,6 +128,10 @@ int main( int argc, char * * argv ) { core_only = true; } + else if( argc > i && ( QString( argv[i] ) == "--allowroot" ) ) + { + allow_root = true; + } else if( argc > i && QString( argv[i] ) == "-geometry" ) { // option -geometry is filtered by Qt later, @@ -137,6 +142,14 @@ int main( int argc, char * * argv ) } } +#ifndef LMMS_BUILD_WIN32 + if ( ( getuid() == 0 || geteuid() == 0 ) && !allow_root ) + { + printf("LMMS cannot be run as root.\nUse \"--allowroot\" to override.\n\n"); + return(EXIT_FAILURE); + } +#endif + QCoreApplication * app = core_only ? new QCoreApplication( argc, argv ) : new QApplication( argc, argv ) ; @@ -196,6 +209,7 @@ int main( int argc, char * * argv ) " standard out is used if no output file is specifed\n" "-d, --dump dump XML of compressed file \n" "-v, --version show version information and exit.\n" + " --allowroot bypass root user startup check (use with caution).\n" "-h, --help show this usage information and exit.\n\n", LMMS_VERSION ); return( EXIT_SUCCESS ); @@ -218,6 +232,17 @@ int main( int argc, char * * argv ) } return( EXIT_SUCCESS ); } + else if( argc > i && QString( argv[i] ) == "--allowroot" ) + { + // Ignore, processed earlier +#ifdef LMMS_BUILD_WIN32 + if ( allow_root ) + { + printf( "\nOption \"--allowroot\" will be ignored on this platform.\n\n" ); + } +#endif + + } else if( argc > i && ( QString( argv[i] ) == "--dump" || QString( argv[i] ) == "-d" ) ) { From 09232ce6e81bdd3798fb2fdba92c662bb4ba4636 Mon Sep 17 00:00:00 2001 From: Dave French Date: Wed, 25 Feb 2015 21:30:45 +0000 Subject: [PATCH 084/133] Begginings of XML validation --- include/DataFile.h | 7 +-- include/PresetPreviewPlayHandle.h | 2 +- src/core/DataFile.cpp | 87 +++++++++++++++------------- src/core/PresetPreviewPlayHandle.cpp | 22 +++++-- src/gui/FileBrowser.cpp | 15 ++++- 5 files changed, 80 insertions(+), 53 deletions(-) diff --git a/include/DataFile.h b/include/DataFile.h index 86dee8675..6f01ffc5e 100644 --- a/include/DataFile.h +++ b/include/DataFile.h @@ -56,13 +56,10 @@ public: DataFile( const QByteArray& data ); DataFile( Type type ); - /// \brief fileTypeFromData - /// Reads the given file and checks the xml for the type - /// returns UnknownType if the file is not reconised - static DataFile::Type fileTypeFromData( const QString fileName); - virtual ~DataFile(); + bool validate( QString extension ); + QString nameWithExtension( const QString& fn ) const; void write( QTextStream& strm ); diff --git a/include/PresetPreviewPlayHandle.h b/include/PresetPreviewPlayHandle.h index 6dd8c8e19..0ebed9c89 100644 --- a/include/PresetPreviewPlayHandle.h +++ b/include/PresetPreviewPlayHandle.h @@ -35,7 +35,7 @@ class PreviewTrackContainer; class EXPORT PresetPreviewPlayHandle : public PlayHandle { public: - PresetPreviewPlayHandle( const QString& presetFile, bool loadByPlugin = false ); + PresetPreviewPlayHandle( const QString& presetFile, bool loadByPlugin = false, DataFile *dataFile = 0 ); virtual ~PresetPreviewPlayHandle(); virtual void play( sampleFrame* buffer ); diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index 2be3f0377..85d7f0e35 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -114,45 +114,6 @@ DataFile::DataFile( Type type ) : } -DataFile::Type DataFile::fileTypeFromData(const QString fileName) -{ - QString errorMsg; - DataFile::Type t; - QDomDocument doc; - - QFile inFile( fileName ); - if( !inFile.open( QIODevice::ReadOnly ) ) - { - return DataFile::Type::UnknownType; - } - - QByteArray data = inFile.readAll(); - inFile.close(); - - int line = -1, col = -1; - if( !doc.setContent( data, &errorMsg, &line, &col ) ) - { - // parsing failed? then try to uncompress data - QByteArray uncompressed = qUncompress( data ); - if( !uncompressed.isEmpty() ) - { - if( doc.setContent( uncompressed, &errorMsg, &line, &col ) ) - { - line = col = -1; - } - } - if( line >= 0 && col >= 0 ) - { - return DataFile::Type::UnknownType; - } - } - - QDomElement root = doc.documentElement(); - t = type( root.attribute( "type" ) ); - - return t; -} - @@ -202,6 +163,54 @@ DataFile::~DataFile() +bool DataFile::validate( QString extension ) +{ + bool result = false; + switch( m_type ) + { + case Type::SongProject: + if( extension == "mmp" || extension == "mmpz" ) + { + result = true; + } + break; + case Type::SongProjectTemplate: + if( extension == "mpt" ) + { + result = true; + } + break; + case Type::InstrumentTrackSettings: + if ( extension == "xpf" || extension == "xml" ) + { + result = true; + } + break; + case Type::UnknownType: + if (! ( extension == "mmp" || extension == "mpt" || extension == "mmpz" || + extension == "xpf" || extension == "xml" || + ( extension == "xiz" && Engine::pluginFileHandling().contains( extension ) ) || + extension == "sf2" || extension == "pat" || extension == "mid" || + extension == "flp" || extension == "dll" + ) ) + { + result = true; + } + if( extension == "wav" || extension == "ogg" || + extension == "ds" ) + { + result = true; + } + break; + default: + return true; + } + return result; +} + + + + QString DataFile::nameWithExtension( const QString & _fn ) const { switch( type() ) diff --git a/src/core/PresetPreviewPlayHandle.cpp b/src/core/PresetPreviewPlayHandle.cpp index 09ebaca16..658160098 100644 --- a/src/core/PresetPreviewPlayHandle.cpp +++ b/src/core/PresetPreviewPlayHandle.cpp @@ -111,7 +111,7 @@ PreviewTrackContainer * PresetPreviewPlayHandle::s_previewTC; -PresetPreviewPlayHandle::PresetPreviewPlayHandle( const QString & _preset_file, bool _load_by_plugin ) : +PresetPreviewPlayHandle::PresetPreviewPlayHandle( const QString & _preset_file, bool _load_by_plugin, DataFile *dataFile ) : PlayHandle( TypePresetPreviewHandle ), m_previewNote( NULL ) { @@ -144,22 +144,34 @@ PresetPreviewPlayHandle::PresetPreviewPlayHandle( const QString & _preset_file, } else { - DataFile dataFile( _preset_file ); + bool dataFileCreated = false; + if( dataFile == 0 ) + { + dataFile = new DataFile( _preset_file ); + dataFileCreated = true; + } + + DataFile data(*dataFile); + // vestige previews are bug prone; fallback on 3xosc with volume of 0 // without an instrument in preview track, it will segfault - if(dataFile.content().elementsByTagName( "vestige" ).length() == 0 ) + if(data.content().elementsByTagName( "vestige" ).length() == 0 ) { s_previewTC->previewInstrumentTrack()-> loadTrackSpecificSettings( - dataFile.content().firstChild().toElement() ); + data.content().firstChild().toElement() ); } else { s_previewTC->previewInstrumentTrack()->loadInstrument("tripleoscillator"); s_previewTC->previewInstrumentTrack()->setVolume( 0 ); } + if( dataFileCreated ) + { + delete dataFile; + } } - + dataFile = 0; // make sure, our preset-preview-track does not appear in any MIDI- // devices list, so just disable receiving/sending MIDI-events at all s_previewTC->previewInstrumentTrack()-> diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index 4253ce55d..f865fab19 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include "FileBrowser.h" #include "BBTrackContainer.h" @@ -459,10 +460,18 @@ void FileBrowserTreeWidget::mousePressEvent(QMouseEvent * me ) } else if( f->type() != FileItem::VstPluginFile && ( f->handling() == FileItem::LoadAsPreset || - f->handling() == FileItem::LoadByPlugin ) - && DataFile::fileTypeFromData( f->fullName() ) == DataFile::Type::InstrumentTrackSettings ) + f->handling() == FileItem::LoadByPlugin ) ) { - m_previewPlayHandle = new PresetPreviewPlayHandle( f->fullName(), f->handling() == FileItem::LoadByPlugin ); + DataFile dataFile( f->fullName() ); + if( !dataFile.validate( f->extension() ) ) + { + QMessageBox::warning( 0, "Corrupt File", + "File : " + f->fullName() + " contains invalid data", + QMessageBox::Ok, QMessageBox::NoButton ); + m_pphMutex.unlock(); + return; + } + m_previewPlayHandle = new PresetPreviewPlayHandle( f->fullName(), f->handling() == FileItem::LoadByPlugin, &dataFile ); } if( m_previewPlayHandle != NULL ) { From 81f0b14465456cdba8ab71c0d604ad8a406eb030 Mon Sep 17 00:00:00 2001 From: Dave French Date: Wed, 25 Feb 2015 22:12:22 +0000 Subject: [PATCH 085/133] smoothed the time parameter of the delay pluging --- plugins/Delay/DelayEffect.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/Delay/DelayEffect.cpp b/plugins/Delay/DelayEffect.cpp index aa01a49d0..5b13b92a0 100644 --- a/plugins/Delay/DelayEffect.cpp +++ b/plugins/Delay/DelayEffect.cpp @@ -91,13 +91,14 @@ bool DelayEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) sample_t dryS[2]; float lPeak = 0.0; float rPeak = 0.0; + float incr = ( m_currentLength - length ) / frames; if( m_delayControls.m_outGainModel.isValueChanged() ) { m_outGain = dbvToAmp( m_delayControls.m_outGainModel.value() ); } for( fpp_t f = 0; f < frames; ++f ) { - m_currentLength = linearInterpolate( length, m_currentLength, 0.9999 ); + m_currentLength -= incr; dryS[0] = buf[f][0]; dryS[1] = buf[f][1]; m_delay->setLength( ( float )m_currentLength + ( amplitude * ( float )m_lfo->tick() ) ); From a0360d2a8edf9a64e4e249b481e4e4173583dc9d Mon Sep 17 00:00:00 2001 From: Dave French Date: Thu, 26 Feb 2015 18:05:34 +0000 Subject: [PATCH 086/133] Delay effect, the delay time parameter now uses sample exact modeling --- plugins/Delay/DelayEffect.cpp | 8 ++++---- plugins/Delay/DelayEffect.h | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/Delay/DelayEffect.cpp b/plugins/Delay/DelayEffect.cpp index 5b13b92a0..c90669ab9 100644 --- a/plugins/Delay/DelayEffect.cpp +++ b/plugins/Delay/DelayEffect.cpp @@ -84,24 +84,24 @@ bool DelayEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) double outSum = 0.0; const float d = dryLevel(); const float w = wetLevel(); - const float length = m_delayControls.m_delayTimeModel.value() * Engine::mixer()->processingSampleRate(); const float amplitude = m_delayControls.m_lfoAmountModel.value() * Engine::mixer()->processingSampleRate(); m_lfo->setFrequency( 1.0 / m_delayControls.m_lfoTimeModel.value() ); m_delay->setFeedback( m_delayControls.m_feedbackModel.value() ); sample_t dryS[2]; float lPeak = 0.0; float rPeak = 0.0; - float incr = ( m_currentLength - length ) / frames; + ValueBuffer *lengthBuffer = m_delayControls.m_delayTimeModel.valueBuffer(); if( m_delayControls.m_outGainModel.isValueChanged() ) { m_outGain = dbvToAmp( m_delayControls.m_outGainModel.value() ); } for( fpp_t f = 0; f < frames; ++f ) { - m_currentLength -= incr; dryS[0] = buf[f][0]; dryS[1] = buf[f][1]; - m_delay->setLength( ( float )m_currentLength + ( amplitude * ( float )m_lfo->tick() ) ); + float length = lengthBuffer ? lengthBuffer->values()[ f ] : m_delayControls.m_delayTimeModel.value(); + length *= Engine::mixer()->processingSampleRate(); + m_delay->setLength( length + ( amplitude * ( float )m_lfo->tick() ) ); m_delay->tick( buf[f] ); buf[f][0] *= m_outGain; diff --git a/plugins/Delay/DelayEffect.h b/plugins/Delay/DelayEffect.h index b98a19e70..af4f86b07 100644 --- a/plugins/Delay/DelayEffect.h +++ b/plugins/Delay/DelayEffect.h @@ -29,6 +29,7 @@ #include "DelayControls.h" #include "Lfo.h" #include "StereoDelay.h" +#include "ValueBuffer.h" class DelayEffect : public Effect { From 7f72be6f69b048aa044c7d48e0aba7d96f7b9009 Mon Sep 17 00:00:00 2001 From: Dave French Date: Thu, 26 Feb 2015 20:07:45 +0000 Subject: [PATCH 087/133] Validates Xml files opened with the main menu --- src/core/DataFile.cpp | 13 ++++++------- src/core/Song.cpp | 2 +- src/gui/FileBrowser.cpp | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index 85d7f0e35..06afd9bc3 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -165,25 +165,24 @@ DataFile::~DataFile() bool DataFile::validate( QString extension ) { - bool result = false; switch( m_type ) { case Type::SongProject: if( extension == "mmp" || extension == "mmpz" ) { - result = true; + return true; } break; case Type::SongProjectTemplate: if( extension == "mpt" ) { - result = true; + return true; } break; case Type::InstrumentTrackSettings: if ( extension == "xpf" || extension == "xml" ) { - result = true; + return true; } break; case Type::UnknownType: @@ -194,18 +193,18 @@ bool DataFile::validate( QString extension ) extension == "flp" || extension == "dll" ) ) { - result = true; + return true; } if( extension == "wav" || extension == "ogg" || extension == "ds" ) { - result = true; + return true; } break; default: return true; } - return result; + return false; } diff --git a/src/core/Song.cpp b/src/core/Song.cpp index 7942b6452..0f072076e 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -924,7 +924,7 @@ void Song::loadProject( const QString & _file_name ) DataFile dataFile( m_fileName ); // if file could not be opened, head-node is null and we create // new project - if( dataFile.head().isNull() ) + if( !dataFile.validate( _file_name.right(_file_name.lastIndexOf(".") ) ) ) { return; } diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index f865fab19..50059734c 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -465,8 +465,8 @@ void FileBrowserTreeWidget::mousePressEvent(QMouseEvent * me ) DataFile dataFile( f->fullName() ); if( !dataFile.validate( f->extension() ) ) { - QMessageBox::warning( 0, "Corrupt File", - "File : " + f->fullName() + " contains invalid data", + QMessageBox::warning( 0, tr ( "Error" ), + f->fullName() + " " + tr( "does not appear to be a valid") + " " + f->extension(), QMessageBox::Ok, QMessageBox::NoButton ); m_pphMutex.unlock(); return; From 0d220b9584f6f29e1d2be8e8c9b5fc49517d490d Mon Sep 17 00:00:00 2001 From: Dave French Date: Fri, 27 Feb 2015 18:00:56 +0000 Subject: [PATCH 088/133] Added the use of sample exact controls to the Delay plugin Added Sample exactness to the following parameters Delay time Regen Lfo time Lfo amount Did not add this to the output gain contol, This model is used in a dbScale, and a much more pleaseing result was gained by using an amplifier plugin. --- plugins/Delay/DelayEffect.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/plugins/Delay/DelayEffect.cpp b/plugins/Delay/DelayEffect.cpp index c90669ab9..3ca1e17ce 100644 --- a/plugins/Delay/DelayEffect.cpp +++ b/plugins/Delay/DelayEffect.cpp @@ -82,15 +82,20 @@ bool DelayEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) return( false ); } double outSum = 0.0; + const float sr = Engine::mixer()->processingSampleRate(); const float d = dryLevel(); const float w = wetLevel(); - const float amplitude = m_delayControls.m_lfoAmountModel.value() * Engine::mixer()->processingSampleRate(); - m_lfo->setFrequency( 1.0 / m_delayControls.m_lfoTimeModel.value() ); - m_delay->setFeedback( m_delayControls.m_feedbackModel.value() ); + float length = m_delayControls.m_delayTimeModel.value(); + float amplitude = m_delayControls.m_lfoAmountModel.value() * sr; + float lfoTime = 1.0 / m_delayControls.m_lfoTimeModel.value(); + float feedback = m_delayControls.m_feedbackModel.value(); sample_t dryS[2]; float lPeak = 0.0; float rPeak = 0.0; ValueBuffer *lengthBuffer = m_delayControls.m_delayTimeModel.valueBuffer(); + ValueBuffer *feedbackBuffer = m_delayControls.m_feedbackModel.valueBuffer(); + ValueBuffer *lfoTimeBuffer = m_delayControls.m_lfoTimeModel.valueBuffer(); + ValueBuffer *lfoAmountBuffer = m_delayControls.m_lfoAmountModel.valueBuffer(); if( m_delayControls.m_outGainModel.isValueChanged() ) { m_outGain = dbvToAmp( m_delayControls.m_outGainModel.value() ); @@ -99,7 +104,14 @@ bool DelayEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) { dryS[0] = buf[f][0]; dryS[1] = buf[f][1]; - float length = lengthBuffer ? lengthBuffer->values()[ f ] : m_delayControls.m_delayTimeModel.value(); + length = lengthBuffer ? lengthBuffer->values()[ f ] : length; + amplitude = lfoAmountBuffer ? lfoAmountBuffer->values()[ f ] * sr : amplitude; + lfoTime = lfoTimeBuffer ? 1 / lfoTimeBuffer->values()[ f ] : lfoTime; + feedback = feedbackBuffer ? feedbackBuffer->values()[ f ] : feedback; + + + m_delay->setFeedback( feedback ); + m_lfo->setFrequency( lfoTime ); length *= Engine::mixer()->processingSampleRate(); m_delay->setLength( length + ( amplitude * ( float )m_lfo->tick() ) ); m_delay->tick( buf[f] ); From 9343cb75496daf0a629c36c1a46d3fa12ee2853c Mon Sep 17 00:00:00 2001 From: Dave French Date: Sat, 28 Feb 2015 13:26:17 +0000 Subject: [PATCH 089/133] Optimised sample exactness in the Delay plugin implemented a pointer increment system as suggested by diizy --- plugins/Delay/DelayEffect.cpp | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/plugins/Delay/DelayEffect.cpp b/plugins/Delay/DelayEffect.cpp index 3ca1e17ce..4b3095ab2 100644 --- a/plugins/Delay/DelayEffect.cpp +++ b/plugins/Delay/DelayEffect.cpp @@ -85,35 +85,40 @@ bool DelayEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) const float sr = Engine::mixer()->processingSampleRate(); const float d = dryLevel(); const float w = wetLevel(); + sample_t dryS[2]; + float lPeak = 0.0; + float rPeak = 0.0; float length = m_delayControls.m_delayTimeModel.value(); float amplitude = m_delayControls.m_lfoAmountModel.value() * sr; float lfoTime = 1.0 / m_delayControls.m_lfoTimeModel.value(); float feedback = m_delayControls.m_feedbackModel.value(); - sample_t dryS[2]; - float lPeak = 0.0; - float rPeak = 0.0; ValueBuffer *lengthBuffer = m_delayControls.m_delayTimeModel.valueBuffer(); ValueBuffer *feedbackBuffer = m_delayControls.m_feedbackModel.valueBuffer(); ValueBuffer *lfoTimeBuffer = m_delayControls.m_lfoTimeModel.valueBuffer(); ValueBuffer *lfoAmountBuffer = m_delayControls.m_lfoAmountModel.valueBuffer(); + int lengthInc = lengthBuffer ? 1 : 0; + int amplitudeInc = lfoAmountBuffer ? 1 : 0; + int lfoTimeInc = lfoTimeBuffer ? 1 : 0; + int feedbackInc = feedbackBuffer ? 1 : 0; + float *lengthPtr = lengthBuffer ? &( lengthBuffer->values()[ 0 ] ) : &length; + float *amplitudePtr = lfoAmountBuffer ? &( lfoAmountBuffer->values()[ 0 ] ) : &litude; + float *lfoTimePtr = lfoTimeBuffer ? &( lfoTimeBuffer->values()[ 0 ] ) : &lfoTime; + float *feedbackPtr = feedbackBuffer ? &( feedbackBuffer->values()[ 0 ] ) : &feedback; + if( m_delayControls.m_outGainModel.isValueChanged() ) { m_outGain = dbvToAmp( m_delayControls.m_outGainModel.value() ); } + int sampleLength; for( fpp_t f = 0; f < frames; ++f ) { dryS[0] = buf[f][0]; dryS[1] = buf[f][1]; - length = lengthBuffer ? lengthBuffer->values()[ f ] : length; - amplitude = lfoAmountBuffer ? lfoAmountBuffer->values()[ f ] * sr : amplitude; - lfoTime = lfoTimeBuffer ? 1 / lfoTimeBuffer->values()[ f ] : lfoTime; - feedback = feedbackBuffer ? feedbackBuffer->values()[ f ] : feedback; - - m_delay->setFeedback( feedback ); - m_lfo->setFrequency( lfoTime ); - length *= Engine::mixer()->processingSampleRate(); - m_delay->setLength( length + ( amplitude * ( float )m_lfo->tick() ) ); + m_delay->setFeedback( *feedbackPtr ); + m_lfo->setFrequency( *lfoTimePtr ); + sampleLength = *lengthPtr * Engine::mixer()->processingSampleRate(); + m_delay->setLength( sampleLength + ( *amplitudePtr * ( float )m_lfo->tick() ) ); m_delay->tick( buf[f] ); buf[f][0] *= m_outGain; @@ -125,6 +130,11 @@ bool DelayEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) buf[f][0] = ( d * dryS[0] ) + ( w * buf[f][0] ); buf[f][1] = ( d * dryS[1] ) + ( w * buf[f][1] ); outSum += buf[f][0]*buf[f][0] + buf[f][1]*buf[f][1]; + + lengthPtr += lengthInc; + amplitudePtr += amplitudeInc; + lfoTimePtr += lfoTimeInc; + feedbackPtr += feedbackInc; } checkGate( outSum / frames ); m_delayControls.m_outPeakL = lPeak; From e06c4bfa384688a3769652d3ca6599412a35d507 Mon Sep 17 00:00:00 2001 From: Dave French Date: Sat, 28 Feb 2015 23:05:55 +0000 Subject: [PATCH 090/133] Updated the equliser plugin to use sample exact controls For this i had to do some major refactoring within the processAudioBuffer() function. --- plugins/Eq/EqEffect.cpp | 256 +++++++++++++++++++++++++++++----------- plugins/Eq/EqFilter.h | 6 + 2 files changed, 196 insertions(+), 66 deletions(-) diff --git a/plugins/Eq/EqEffect.cpp b/plugins/Eq/EqEffect.cpp index 885eebe2a..e42460ae6 100644 --- a/plugins/Eq/EqEffect.cpp +++ b/plugins/Eq/EqEffect.cpp @@ -71,6 +71,101 @@ EqEffect::~EqEffect() bool EqEffect::processAudioBuffer(sampleFrame *buf, const fpp_t frames) { + // setup sample exact controls + float hpRes = m_eqControls.m_hpResModel.value(); + float lowShelfRes = m_eqControls.m_lowShelfResModel.value(); + float para1Bw = m_eqControls.m_para1BwModel.value(); + float para2Bw = m_eqControls.m_para2BwModel.value(); + float para3Bw = m_eqControls.m_para3BwModel.value(); + float para4Bw = m_eqControls.m_para4BwModel.value(); + float highShelfRes = m_eqControls.m_highShelfResModel.value(); + float lpRes = m_eqControls.m_lpResModel.value(); + + float hpFreq = m_eqControls.m_hpFeqModel.value(); + float lowShelfFreq = m_eqControls.m_lowShelfFreqModel.value(); + float para1Freq = m_eqControls.m_para1FreqModel.value(); + float para2Freq = m_eqControls.m_para2FreqModel.value(); + float para3Freq = m_eqControls.m_para3FreqModel.value(); + float para4Freq = m_eqControls.m_para4FreqModel.value(); + float highShelfFreq = m_eqControls.m_highShelfFreqModel.value(); + float lpFreq = m_eqControls.m_lpFreqModel.value(); + + ValueBuffer *hpResBuffer = m_eqControls.m_hpResModel.valueBuffer(); + ValueBuffer *lowShelfResBuffer = m_eqControls.m_lowShelfResModel.valueBuffer(); + ValueBuffer *para1BwBuffer = m_eqControls.m_para1BwModel.valueBuffer(); + ValueBuffer *para2BwBuffer = m_eqControls.m_para2BwModel.valueBuffer(); + ValueBuffer *para3BwBuffer = m_eqControls.m_para3BwModel.valueBuffer(); + ValueBuffer *para4BwBuffer = m_eqControls.m_para4BwModel.valueBuffer(); + ValueBuffer *highShelfResBuffer = m_eqControls.m_highShelfResModel.valueBuffer(); + ValueBuffer *lpResBuffer = m_eqControls.m_lpResModel.valueBuffer(); + + ValueBuffer *hpFreqBuffer = m_eqControls.m_hpFeqModel.valueBuffer(); + ValueBuffer *lowShelfFreqBuffer = m_eqControls.m_lowShelfFreqModel.valueBuffer(); + ValueBuffer *para1FreqBuffer = m_eqControls.m_para1FreqModel.valueBuffer(); + ValueBuffer *para2FreqBuffer = m_eqControls.m_para2FreqModel.valueBuffer(); + ValueBuffer *para3FreqBuffer = m_eqControls.m_para3FreqModel.valueBuffer(); + ValueBuffer *para4FreqBuffer = m_eqControls.m_para4FreqModel.valueBuffer(); + ValueBuffer *highShelfFreqBuffer = m_eqControls.m_highShelfFreqModel.valueBuffer(); + ValueBuffer *lpFreqBuffer = m_eqControls.m_lpFreqModel.valueBuffer(); + + int hpResInc = hpResBuffer ? 1 : 0; + int lowShelfResInc = lowShelfResBuffer ? 1 : 0; + int para1BwInc = para1BwBuffer ? 1 : 0; + int para2BwInc = para2BwBuffer ? 1 : 0; + int para3BwInc = para3BwBuffer ? 1 : 0; + int para4BwInc = para4BwBuffer ? 1 : 0; + int highShelfResInc = highShelfResBuffer ? 1 : 0; + int lpResInc = lpResBuffer ? 1 : 0; + + int hpFreqInc = hpFreqBuffer ? 1 : 0; + int lowShelfFreqInc = lowShelfFreqBuffer ? 1 : 0; + int para1FreqInc = para1FreqBuffer ? 1 : 0; + int para2FreqInc = para2FreqBuffer ? 1 : 0; + int para3FreqInc = para3FreqBuffer ? 1 : 0; + int para4FreqInc = para4FreqBuffer ? 1 : 0; + int highShelfFreqInc = highShelfFreqBuffer ? 1 : 0; + int lpFreqInc = lpFreqBuffer ? 1 : 0; + + float *hpResPtr = hpResBuffer ? &( hpResBuffer->values()[ 0 ] ) : &hpRes; + float *lowShelfResPtr = lowShelfFreqBuffer ? &( lowShelfFreqBuffer->values()[ 0 ] ) : &lowShelfRes; + float *para1BwPtr = para1BwBuffer ? &( para1BwBuffer->values()[ 0 ] ) : ¶1Bw; + float *para2BwPtr = para2BwBuffer ? &( para2BwBuffer->values()[ 0 ] ) : ¶2Bw; + float *para3BwPtr = para3BwBuffer ? &( para3BwBuffer->values()[ 0 ] ) : ¶3Bw; + float *para4BwPtr = para4BwBuffer ? &( para4BwBuffer->values()[ 0 ] ) : ¶4Bw; + float *highShelfResPtr = highShelfResBuffer ? &( highShelfResBuffer->values()[ 0 ] ) : &highShelfRes; + float *lpResPtr = lpResBuffer ? &( lpResBuffer->values()[ 0 ] ) : &lpRes; + + float *hpFreqPtr = hpFreqBuffer ? &( hpFreqBuffer->values()[ 0 ] ) : &hpFreq; + float *lowShelfFreqPtr = lowShelfFreqBuffer ? &( lowShelfFreqBuffer->values()[ 0 ] ) : &lowShelfFreq; + float *para1FreqPtr = para1FreqBuffer ? &(para1FreqBuffer->values()[ 0 ] ) : ¶1Freq; + float *para2FreqPtr = para2FreqBuffer ? &(para2FreqBuffer->values()[ 0 ] ) : ¶2Freq; + float *para3FreqPtr = para3FreqBuffer ? &(para3FreqBuffer->values()[ 0 ] ) : ¶3Freq; + float *para4FreqPtr = para4FreqBuffer ? &(para4FreqBuffer->values()[ 0 ] ) : ¶4Freq; + float *hightShelfFreqPtr = highShelfFreqBuffer ? &(highShelfFreqBuffer->values()[ 0 ] ) : &highShelfFreq; + float *lpFreqPtr = lpFreqBuffer ? &(lpFreqBuffer ->values()[ 0 ] ) : &lpFreq; + + bool hpActive = m_eqControls.m_hpActiveModel.value(); + bool hp24Active = m_eqControls.m_hp24Model.value(); + bool hp48Active = m_eqControls.m_hp48Model.value(); + bool lowShelfActive = m_eqControls.m_lowShelfActiveModel.value(); + bool para1Active = m_eqControls.m_para1ActiveModel.value(); + bool para2Active = m_eqControls.m_para2ActiveModel.value(); + bool para3Active = m_eqControls.m_para3ActiveModel.value(); + bool para4Active = m_eqControls.m_para4ActiveModel.value(); + bool highShelfActive = m_eqControls.m_highShelfActiveModel.value(); + bool lpActive = m_eqControls.m_lpActiveModel.value(); + bool lp24Active = m_eqControls.m_lp24Model.value(); + bool lp48Active = m_eqControls.m_lp48Model.value(); + + float lowShelfGain = m_eqControls.m_lowShelfGainModel.value(); + float para1Gain = m_eqControls.m_para1GainModel.value(); + float para2Gain = m_eqControls.m_para2GainModel.value(); + float para3Gain = m_eqControls.m_para3GainModel.value(); + float para4Gain = m_eqControls.m_para4GainModel.value(); + float highShelfGain = m_eqControls.m_highShelfGainModel.value(); + + + if( !isEnabled() || !isRunning () ) { return( false ); @@ -105,83 +200,112 @@ bool EqEffect::processAudioBuffer(sampleFrame *buf, const fpp_t frames) m_eqControls.m_inPeakL = m_eqControls.m_inPeakL < m_inPeak[0] ? m_inPeak[0] : m_eqControls.m_inPeakL; m_eqControls.m_inPeakR = m_eqControls.m_inPeakR < m_inPeak[1] ? m_inPeak[1] : m_eqControls.m_inPeakR; - if(m_eqControls.m_hpActiveModel.value() ){ + for( fpp_t f = 0; f < frames; f++) + { + if( hpActive ){ - m_hp12.setParameters( sampleRate, m_eqControls.m_hpFeqModel.value(), m_eqControls.m_hpResModel.value(), 1 ); - m_hp12.processBuffer( buf, frames ); + m_hp12.setParameters( sampleRate, *hpFreqPtr, *hpResPtr, 1 ); + m_hp12.tick( &buf[ f ] ); - if( m_eqControls.m_hp24Model.value() || m_eqControls.m_hp48Model.value() ) - { - m_hp24.setParameters( sampleRate, m_eqControls.m_hpFeqModel.value(), m_eqControls.m_hpResModel.value(), 1 ); - m_hp24.processBuffer( buf, frames ); + if( hp24Active || hp48Active ) + { + m_hp24.setParameters( sampleRate, *hpFreqPtr, *hpResPtr, 1 ); + m_hp24.tick( &buf[ f ] ); + } + + if( hp48Active ) + { + m_hp480.setParameters( sampleRate, *hpFreqPtr, *hpResPtr, 1 ); + m_hp480.tick( &buf[ f ] ); + + m_hp481.setParameters( sampleRate, *hpFreqPtr, *hpResPtr, 1 ); + m_hp481.tick( &buf[ f ] ); + } } - if( m_eqControls.m_hp48Model.value() ) + if( lowShelfActive ) { - m_hp480.setParameters( sampleRate, m_eqControls.m_hpFeqModel.value(), m_eqControls.m_hpResModel.value(), 1 ); - m_hp480.processBuffer( buf, frames ); - - m_hp481.setParameters( sampleRate, m_eqControls.m_hpFeqModel.value(), m_eqControls.m_hpResModel.value(), 1 ); - m_hp481.processBuffer( buf, frames ); - } - } - - if( m_eqControls.m_lowShelfActiveModel.value() ) - { - m_lowShelf.setParameters( sampleRate, m_eqControls.m_lowShelfFreqModel.value(), m_eqControls.m_lowShelfResModel .value(), m_eqControls.m_lowShelfGainModel.value() ); - m_lowShelf.processBuffer( buf, frames ); - } - - if( m_eqControls.m_para1ActiveModel.value() ) - { - m_para1.setParameters( sampleRate, m_eqControls.m_para1FreqModel.value(), m_eqControls.m_para1BwModel.value(), m_eqControls.m_para1GainModel.value() ); - m_para1.processBuffer( buf, frames ); - } - - if( m_eqControls.m_para2ActiveModel.value() ) - { - m_para2.setParameters( sampleRate, m_eqControls.m_para2FreqModel.value(), m_eqControls.m_para2BwModel.value(), m_eqControls.m_para2GainModel.value() ); - m_para2.processBuffer( buf, frames ); - } - - if( m_eqControls.m_para3ActiveModel.value() ) - { - m_para3.setParameters( sampleRate, m_eqControls.m_para3FreqModel.value(), m_eqControls.m_para3BwModel.value(), m_eqControls.m_para3GainModel.value() ); - m_para3.processBuffer( buf, frames ); - } - - if( m_eqControls.m_para4ActiveModel.value() ) - { - m_para4.setParameters( sampleRate, m_eqControls.m_para4FreqModel.value(), m_eqControls.m_para4BwModel.value(), m_eqControls.m_para4GainModel.value() ); - m_para4.processBuffer( buf, frames ); - } - - if( m_eqControls.m_highShelfActiveModel.value() ) - { - m_highShelf.setParameters( sampleRate, m_eqControls.m_highShelfFreqModel.value(), m_eqControls.m_highShelfResModel.value(), m_eqControls.m_highShelfGainModel.value()); - m_highShelf.processBuffer( buf, frames ); - } - - if(m_eqControls.m_lpActiveModel.value() ){ - m_lp12.setParameters( sampleRate, m_eqControls.m_lpFreqModel.value(), m_eqControls.m_lpResModel.value(), 1 ); - m_lp12.processBuffer( buf, frames ); - - if( m_eqControls.m_lp24Model.value() || m_eqControls.m_lp48Model.value() ) - { - m_lp24.setParameters( sampleRate, m_eqControls.m_lpFreqModel.value(), m_eqControls.m_lpResModel.value(), 1 ); - m_lp24.processBuffer( buf, frames ); + m_lowShelf.setParameters( sampleRate, *lowShelfFreqPtr, *lowShelfResPtr, lowShelfGain ); + m_lowShelf.tick( &buf[ f ] ); } - if( m_eqControls.m_lp48Model.value() ) + if( para1Active ) { - m_lp480.setParameters( sampleRate, m_eqControls.m_lpFreqModel.value(), m_eqControls.m_lpResModel.value(), 1 ); - m_lp480.processBuffer( buf, frames ); - - m_lp481.setParameters( sampleRate, m_eqControls.m_lpFreqModel.value(), m_eqControls.m_lpResModel.value(), 1 ); - m_lp481.processBuffer( buf, frames ); + m_para1.setParameters( sampleRate, *para1FreqPtr, *para1BwPtr, para1Gain ); + m_para1.tick( &buf[ f ] ); } + + if( para2Active ) + { + m_para2.setParameters( sampleRate, *para2FreqPtr, *para2BwPtr, para2Gain ); + m_para2.tick( &buf[ f ] ); + } + + if( para3Active ) + { + m_para3.setParameters( sampleRate, *para3FreqPtr, *para3BwPtr, para3Gain ); + m_para3.tick( &buf[ f ] ); + } + + if( para4Active ) + { + m_para4.setParameters( sampleRate, *para4FreqPtr, *para4BwPtr, para4Gain ); + m_para4.tick( &buf[ f ] ); + } + + if( highShelfActive ) + { + m_highShelf.setParameters( sampleRate, *hightShelfFreqPtr, *highShelfResPtr, highShelfGain ); + m_highShelf.tick( &buf[ f ] ); + } + + if( lpActive ){ + m_lp12.setParameters( sampleRate, *lpFreqPtr, *lpResPtr, 1 ); + m_lp12.tick( &buf[ f ] ); + + if( lp24Active || lp48Active ) + { + m_lp24.setParameters( sampleRate, *lpFreqPtr, *lpResPtr, 1 ); + m_lp24.tick( &buf[ f ] ); + } + + if( lp48Active ) + { + m_lp480.setParameters( sampleRate, *lpFreqPtr, *lpResPtr, 1 ); + m_lp480.tick( &buf[ f ] ); + + m_lp481.setParameters( sampleRate, *lpFreqPtr, *lpResPtr, 1 ); + m_lp481.tick( &buf[ f ] ); + } + } + + //increment pointers if needed + hpResPtr += hpResInc; + lowShelfResPtr += lowShelfResInc; + para1BwPtr += para1BwInc; + para2BwPtr += para2BwInc; + para3BwPtr += para3BwInc; + para4BwPtr += para4BwInc; + highShelfResPtr += highShelfResInc; + lpResPtr += lpResInc; + + hpFreqPtr += hpFreqInc; + lowShelfFreqPtr += lowShelfFreqInc; + para1FreqPtr += para1FreqInc; + para2FreqPtr += para2FreqInc; + para3FreqPtr += para3FreqInc; + para4FreqPtr += para4FreqInc; + hightShelfFreqPtr += highShelfFreqInc; + lpFreqPtr += lpFreqInc; } + + + + + + + sampleFrame outPeak = { 0, 0 }; gain( buf, frames, outGain, &outPeak ); m_eqControls.m_outPeakL = m_eqControls.m_outPeakL < outPeak[0] ? outPeak[0] : m_eqControls.m_outPeakL; diff --git a/plugins/Eq/EqFilter.h b/plugins/Eq/EqFilter.h index 7e75a2e6c..9e608d5e7 100644 --- a/plugins/Eq/EqFilter.h +++ b/plugins/Eq/EqFilter.h @@ -136,6 +136,12 @@ public: } } + virtual void tick( sampleFrame *frame ) + { + frame[0][0] = update( frame[0][0], 0); + frame[0][1] = update( frame[0][1], 1); + } + protected: /// /// \brief calcCoefficents From 8a588d4934b11cff6769bc0dd1e78b0e28345e28 Mon Sep 17 00:00:00 2001 From: Dave French Date: Sun, 1 Mar 2015 00:03:24 +0000 Subject: [PATCH 091/133] Delay added addional smoothing to the delay time parameter The delay time paramter was responding very badly ui user input. This now has a much more plesant sound, not dis simular to a record being sped up or slowed down. --- plugins/Delay/DelayEffect.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/Delay/DelayEffect.cpp b/plugins/Delay/DelayEffect.cpp index 4b3095ab2..7f41653a2 100644 --- a/plugins/Delay/DelayEffect.cpp +++ b/plugins/Delay/DelayEffect.cpp @@ -118,7 +118,8 @@ bool DelayEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) m_delay->setFeedback( *feedbackPtr ); m_lfo->setFrequency( *lfoTimePtr ); sampleLength = *lengthPtr * Engine::mixer()->processingSampleRate(); - m_delay->setLength( sampleLength + ( *amplitudePtr * ( float )m_lfo->tick() ) ); + m_currentLength = linearInterpolate( sampleLength, m_currentLength, 0.9999 ); + m_delay->setLength( m_currentLength + ( *amplitudePtr * ( float )m_lfo->tick() ) ); m_delay->tick( buf[f] ); buf[f][0] *= m_outGain; From 673ce6e17a34ea2c1c7d71eb8fbcf09f137348c7 Mon Sep 17 00:00:00 2001 From: Dave French Date: Sun, 1 Mar 2015 11:42:54 +0000 Subject: [PATCH 092/133] Enabled the use of sample exact controls in Dual Filter The following controls have sample exact enabled Filter 1 Cutoff Filter 1 res Filter 1 gain Filter 2 Cutoff Filter 2 res Filter 2 Gain Model.isValueChanged() does not eveluate when recieving sample accurate so added checks to see if the cutoff and res needed to be recalculated, --- plugins/DualFilter/DualFilter.cpp | 83 ++++++++++++++++++++++++------- plugins/DualFilter/DualFilter.h | 5 ++ 2 files changed, 70 insertions(+), 18 deletions(-) diff --git a/plugins/DualFilter/DualFilter.cpp b/plugins/DualFilter/DualFilter.cpp index 035740dbf..c78d68a29 100644 --- a/plugins/DualFilter/DualFilter.cpp +++ b/plugins/DualFilter/DualFilter.cpp @@ -95,33 +95,52 @@ bool DualFilterEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames m_filter2changed = true; } + float cut1 = m_dfControls.m_cut1Model.value(); + float res1 = m_dfControls.m_res1Model.value(); + float gain1 = m_dfControls.m_gain1Model.value(); + float cut2 = m_dfControls.m_cut2Model.value(); + float res2 = m_dfControls.m_res2Model.value(); + float gain2 = m_dfControls.m_gain2Model.value(); + float mix = m_dfControls.m_mixModel.value(); + + ValueBuffer *cut1Buffer = m_dfControls.m_cut1Model.valueBuffer(); + ValueBuffer *res1Buffer = m_dfControls.m_res1Model.valueBuffer(); + ValueBuffer *gain1Buffer = m_dfControls.m_gain1Model.valueBuffer(); + ValueBuffer *cut2Buffer = m_dfControls.m_cut2Model.valueBuffer(); + ValueBuffer *res2Buffer = m_dfControls.m_res2Model.valueBuffer(); + ValueBuffer *gain2Buffer = m_dfControls.m_gain2Model.valueBuffer(); + ValueBuffer *mixBuffer = m_dfControls.m_mixModel.valueBuffer(); + + int cut1Inc = cut1Buffer ? 1 : 0; + int res1Inc = res1Buffer ? 1 : 0; + int gain1Inc = gain1Buffer ? 1 : 0; + int cut2Inc = cut2Buffer ? 1 : 0; + int res2Inc = res2Buffer ? 1 : 0; + int gain2Inc = gain2Buffer ? 1 : 0; + int mixInc = mixBuffer ? 1 : 0; + + float *cut1Ptr = cut1Buffer ? &( cut1Buffer->values()[ 0 ] ) : &cut1; + float *res1Ptr = res1Buffer ? &( res1Buffer->values()[ 0 ] ) : &res1; + float *gain1Ptr = gain1Buffer ? &( gain1Buffer->values()[ 0 ] ) : &gain1; + float *cut2Ptr = cut2Buffer ? &( cut2Buffer->values()[ 0 ] ) : &cut2; + float *res2Ptr = res2Buffer ? &( res2Buffer->values()[ 0 ] ) : &res2; + float *gain2Ptr = gain2Buffer ? &( gain2Buffer->values()[ 0 ] ) : &gain2; + float *mixPtr = mixBuffer ? &( mixBuffer->values()[ 0 ] ) : &mix; + const bool enabled1 = m_dfControls.m_enabled1Model.value(); const bool enabled2 = m_dfControls.m_enabled2Model.value(); - // recalculate only when necessary: either cut/res is changed, or the changed-flag is set (filter type or samplerate changed) - if( ( enabled1 && ( m_dfControls.m_cut1Model.isValueChanged() || - m_dfControls.m_res1Model.isValueChanged() ) ) || m_filter1changed ) - { - m_filter1->calcFilterCoeffs( m_dfControls.m_cut1Model.value(), m_dfControls.m_res1Model.value() ); - m_filter1changed = false; - } - if( ( enabled2 && ( m_dfControls.m_cut2Model.isValueChanged() || - m_dfControls.m_res2Model.isValueChanged() ) ) || m_filter2changed ) - { - m_filter2->calcFilterCoeffs( m_dfControls.m_cut2Model.value(), m_dfControls.m_res2Model.value() ); - m_filter2changed = false; - } - // get mix amounts for wet signals of both filters - const float mix2 = ( ( m_dfControls.m_mixModel.value() + 1.0f ) * 0.5f ); - const float mix1 = 1.0f - mix2; - const float gain1 = m_dfControls.m_gain1Model.value() * 0.01f; - const float gain2 = m_dfControls.m_gain2Model.value() * 0.01f; // buffer processing loop for( fpp_t f = 0; f < frames; ++f ) { + // get mix amounts for wet signals of both filters + const float mix2 = ( ( *mixPtr + 1.0f ) * 0.5f ); + const float mix1 = 1.0f - mix2; + const float gain1 = *gain1Ptr * 0.01f; + const float gain2 = *gain2Ptr * 0.01f; sample_t s[2] = { 0.0f, 0.0f }; // mix sample_t s1[2] = { buf[f][0], buf[f][1] }; // filter 1 sample_t s2[2] = { buf[f][0], buf[f][1] }; // filter 2 @@ -129,6 +148,16 @@ bool DualFilterEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames // update filter 1 if( enabled1 ) { + //update filter 1 params here + // recalculate only when necessary: either cut/res is changed, or the changed-flag is set (filter type or samplerate changed) + if( ( ( *cut1Ptr != m_currentCut1 || + *res1Ptr != m_currentRes1 ) ) || m_filter1changed ) + { + m_filter1->calcFilterCoeffs( *cut1Ptr, *res2Ptr ); + m_filter1changed = false; + m_currentCut1 = *cut1Ptr; + m_currentRes1 = *res1Ptr; + } s1[0] = m_filter1->update( s1[0], 0 ); s1[1] = m_filter1->update( s1[1], 1 ); @@ -144,6 +173,15 @@ bool DualFilterEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames // update filter 2 if( enabled2 ) { + //update filter 2 params here + if( ( ( *cut2Ptr != m_currentCut2 || + *res2Ptr != m_currentRes2 ) ) || m_filter2changed ) + { + m_filter2->calcFilterCoeffs( *cut2Ptr, *res2Ptr ); + m_filter2changed = false; + m_currentCut2 = *cut2Ptr; + m_currentRes2 = *res2Ptr; + } s2[0] = m_filter2->update( s2[0], 0 ); s2[1] = m_filter2->update( s2[1], 1 ); @@ -160,6 +198,15 @@ bool DualFilterEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames // do another mix with dry signal buf[f][0] = d * buf[f][0] + w * s[0]; buf[f][1] = d * buf[f][1] + w * s[1]; + + //increment pointers + cut1Ptr += cut1Inc; + res1Ptr += res1Inc; + gain1Ptr += gain1Inc; + cut2Ptr += cut2Inc; + res2Ptr += res2Inc; + gain2Ptr += gain2Inc; + mixPtr += mixInc; } checkGate( outSum / frames ); diff --git a/plugins/DualFilter/DualFilter.h b/plugins/DualFilter/DualFilter.h index 851531333..561f04dd6 100644 --- a/plugins/DualFilter/DualFilter.h +++ b/plugins/DualFilter/DualFilter.h @@ -53,6 +53,11 @@ private: bool m_filter1changed; bool m_filter2changed; + float m_currentCut1; + float m_currentRes1; + float m_currentCut2; + float m_currentRes2; + friend class DualFilterControls; } ; From 6ad5d88c086adb47c4019b3f7794bbbf0d8751bd Mon Sep 17 00:00:00 2001 From: Dave French Date: Sun, 1 Mar 2015 13:42:07 +0000 Subject: [PATCH 093/133] Reinstate Double Click opening the piano roll from song editor This fixes a bug introduced when removing double click from BB patterns. It Now checks if we use fixedTCO's (bb tomb stones), only disable double clikc if so, leaving it working correcly in the song editor --- include/Pattern.h | 1 + src/tracks/Pattern.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/include/Pattern.h b/include/Pattern.h index d57538404..1e3c5db10 100644 --- a/include/Pattern.h +++ b/include/Pattern.h @@ -180,6 +180,7 @@ protected slots: protected: virtual void constructContextMenu( QMenu * ); virtual void mousePressEvent( QMouseEvent * _me ); + virtual void mouseDoubleClickEvent( QMouseEvent * _me ); virtual void paintEvent( QPaintEvent * _pe ); virtual void resizeEvent( QResizeEvent * _re ) { diff --git a/src/tracks/Pattern.cpp b/src/tracks/Pattern.cpp index ca0f15e2c..cea27895a 100644 --- a/src/tracks/Pattern.cpp +++ b/src/tracks/Pattern.cpp @@ -846,6 +846,19 @@ void PatternView::mousePressEvent( QMouseEvent * _me ) } } +void PatternView::mouseDoubleClickEvent(QMouseEvent *_me) +{ + if( _me->button() != Qt::LeftButton ) + { + _me->ignore(); + return; + } + if( !fixedTCOs() ) + { + openInPianoRoll(); + } +} + From 1cb7336189c23aa5747ce69f015bf9392d5f7211 Mon Sep 17 00:00:00 2001 From: Dave French Date: Sun, 1 Mar 2015 20:33:04 +0000 Subject: [PATCH 094/133] Enable sample exact controls for BassBoost plugin Enabled the use of sample exactness on gain control. After checking the m_bbfx_leftFX.getGain() function, It was found that this functiomn only sets a member variable, and causes no other over head, so decided that checking if the value had changed would take more clock cycles, than the check to see if the value had changhed. --- plugins/BassBooster/BassBooster.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/BassBooster/BassBooster.cpp b/plugins/BassBooster/BassBooster.cpp index d75fa2c66..d75c7c5c8 100644 --- a/plugins/BassBooster/BassBooster.cpp +++ b/plugins/BassBooster/BassBooster.cpp @@ -83,11 +83,18 @@ bool BassBoosterEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames if( m_bbControls.m_gainModel.isValueChanged() ) { changeGain(); } if( m_bbControls.m_ratioModel.isValueChanged() ) { changeRatio(); } + float gain = m_bbControls.m_gainModel.value(); + ValueBuffer *gainBuffer = m_bbControls.m_gainModel.valueBuffer(); + int gainInc = gainBuffer ? 1 : 0; + float *gainPtr = gainBuffer ? &( gainBuffer->values()[ 0 ] ) : &gain; + double outSum = 0.0; const float d = dryLevel(); const float w = wetLevel(); for( fpp_t f = 0; f < frames; ++f ) { + m_bbFX.leftFX().setGain( *gainPtr ); + m_bbFX.rightFX().setGain( *gainPtr ); outSum += buf[f][0]*buf[f][0] + buf[f][1]*buf[f][1]; sample_t s[2] = { buf[f][0], buf[f][1] }; @@ -95,6 +102,7 @@ bool BassBoosterEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames buf[f][0] = d * buf[f][0] + w * s[0]; buf[f][1] = d * buf[f][1] + w * s[1]; + gainPtr += gainInc; } checkGate( outSum / frames ); From be6f25b7a1fdb7ef2e8a65ff9e6949108b400546 Mon Sep 17 00:00:00 2001 From: Dave French Date: Sun, 1 Mar 2015 22:54:06 +0000 Subject: [PATCH 095/133] Enable sample exact controls for WaveShaper plugin Enabled sample exactness for the input and output control. --- plugins/waveshaper/waveshaper.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/plugins/waveshaper/waveshaper.cpp b/plugins/waveshaper/waveshaper.cpp index 7389e27e1..33300a32d 100644 --- a/plugins/waveshaper/waveshaper.cpp +++ b/plugins/waveshaper/waveshaper.cpp @@ -82,18 +82,27 @@ bool waveShaperEffect::processAudioBuffer( sampleFrame * _buf, double out_sum = 0.0; const float d = dryLevel(); const float w = wetLevel(); - const float input = m_wsControls.m_inputModel.value(); - const float output = m_wsControls.m_outputModel.value(); + float input = m_wsControls.m_inputModel.value(); + float output = m_wsControls.m_outputModel.value(); const float * samples = m_wsControls.m_wavegraphModel.samples(); const bool clip = m_wsControls.m_clipModel.value(); + ValueBuffer *inputBuffer = m_wsControls.m_inputModel.valueBuffer(); + ValueBuffer *outputBufer = m_wsControls.m_outputModel.valueBuffer(); + + int inputInc = inputBuffer ? 1 : 0; + int outputInc = outputBufer ? 1 : 0; + + float *inputPtr = inputBuffer ? &( inputBuffer->values()[ 0 ] ) : &input; + float *outputPtr = outputBufer ? &( outputBufer->values()[ 0 ] ) : &output; + for( fpp_t f = 0; f < _frames; ++f ) { float s[2] = { _buf[f][0], _buf[f][1] }; // apply input gain - s[0] *= input; - s[1] *= input; + s[0] *= *inputPtr; + s[1] *= *inputPtr; // clip if clip enabled if( clip ) @@ -127,13 +136,16 @@ bool waveShaperEffect::processAudioBuffer( sampleFrame * _buf, } // apply output gain - s[0] *= output; - s[1] *= output; + s[0] *= *outputPtr; + s[1] *= *outputPtr; out_sum += _buf[f][0]*_buf[f][0] + _buf[f][1]*_buf[f][1]; // mix wet/dry signals _buf[f][0] = d * _buf[f][0] + w * s[0]; _buf[f][1] = d * _buf[f][1] + w * s[1]; + + outputPtr += outputInc; + inputPtr += inputInc; } checkGate( out_sum / _frames ); From ecb4c636c899b8d522905f115aca0666c805c091 Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Sun, 1 Mar 2015 23:12:35 -0300 Subject: [PATCH 096/133] Adjust parentheses conventions --- src/core/ProjectVersion.cpp | 42 +++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/core/ProjectVersion.cpp b/src/core/ProjectVersion.cpp index ce4555b4c..111e014a8 100644 --- a/src/core/ProjectVersion.cpp +++ b/src/core/ProjectVersion.cpp @@ -65,70 +65,72 @@ ProjectVersion::ProjectVersion(QString version, CompareType c) : { } -ProjectVersion::ProjectVersion( const char* version, CompareType c ) : - m_version( QString( version ) ), - m_major(parseMajor( m_version ) ), - m_minor(parseMinor( m_version ) ), - m_release(parseRelease( m_version ) ), - m_build(parseBuild( m_version ) ), - m_compareType( c ) + + + +ProjectVersion::ProjectVersion(const char* version, CompareType c) : + m_version(QString(version)), + m_major(parseMajor(m_version)), + m_minor(parseMinor(m_version)), + m_release(parseRelease(m_version)), + m_build(parseBuild(m_version)), + m_compareType(c) { } -int ProjectVersion::compare( const ProjectVersion & a, const ProjectVersion & b, CompareType c ) +int ProjectVersion::compare(const ProjectVersion & a, const ProjectVersion & b, CompareType c) { - if( a.getMajor() != b.getMajor() ) + if(a.getMajor() != b.getMajor()) { return a.getMajor() - b.getMajor(); } - else if( c == CompareType::Major ) + else if(c == CompareType::Major) { return 0; } - if( a.getMinor() != b.getMinor() ) + if(a.getMinor() != b.getMinor()) { return a.getMinor() - b.getMinor(); } - else if( c == CompareType::Minor ) + else if(c == CompareType::Minor) { return 0; } - if( a.getRelease() != b.getRelease() ) + if(a.getRelease() != b.getRelease()) { return a.getRelease() - b.getRelease(); } - else if( c == CompareType::Release ) + else if(c == CompareType::Release) { return 0; } // make sure 0.x.y > 0.x.y-patch - if( a.getBuild().isEmpty() ) + if(a.getBuild().isEmpty()) { return 1; } - if( b.getBuild().isEmpty() ) + if(b.getBuild().isEmpty()) { return -1; } - return QString::compare( a.getBuild(), b.getBuild() ); + return QString::compare(a.getBuild(), b.getBuild()); } -int ProjectVersion::compare( ProjectVersion v1, ProjectVersion v2 ) +int ProjectVersion::compare(ProjectVersion v1, ProjectVersion v2) { - return compare( v1, v2, std::min( v1.getCompareType(), v2.getCompareType() ) ); + return compare(v1, v2, std::min(v1.getCompareType(), v2.getCompareType())); } - From 91ebba65f7d7784cf132007ed0f788eeede394db Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Sun, 1 Mar 2015 23:15:55 -0300 Subject: [PATCH 097/133] Adjust parentheses conventions --- include/ProjectVersion.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/ProjectVersion.h b/include/ProjectVersion.h index 670e339d5..545b91668 100644 --- a/include/ProjectVersion.h +++ b/include/ProjectVersion.h @@ -39,8 +39,8 @@ enum CompareType { Major, Minor, Release, Build }; class ProjectVersion { public: - ProjectVersion( QString version, CompareType c = CompareType::Build ); - ProjectVersion( const char * version, CompareType c = CompareType::Build ); + ProjectVersion(QString version, CompareType c = CompareType::Build); + ProjectVersion(const char * version, CompareType c = CompareType::Build); int getMajor() const { return m_major; } int getMinor() const { return m_minor; } From 2acfa0eecacdab37070b8fd4e4cb2053e4b7606d Mon Sep 17 00:00:00 2001 From: Spekular Date: Mon, 2 Mar 2015 08:15:08 +0100 Subject: [PATCH 098/133] Remove unused toolbar gradient images. --- data/themes/default/main_toolbar_bg.png | Bin 716 -> 0 bytes data/themes/default/toolbar_bg.png | Bin 160 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 data/themes/default/main_toolbar_bg.png delete mode 100644 data/themes/default/toolbar_bg.png diff --git a/data/themes/default/main_toolbar_bg.png b/data/themes/default/main_toolbar_bg.png deleted file mode 100644 index d6e662ab309940e541ed95d4d87efda78a50e4c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 716 zcmV;-0yF)IP)Px#24YJ`L;yGdKLAWPPv_CX>@2HRA^-&M@dak?_?!z0006b zNkl`m3 zF#AT?4FM3G5C9cYvZv?MTT7BI+s&*H@*;!+RUkxUgAE{caXHAv%om{CP%+VYcJf;b z5u}9}2fHSela|-gHW|B9Zm-_+{S~0F-wOkNNCUA{r(JOnokD@?Thw1}(NNpNq4Lxb zlC}^YGhwm|QCZ|4;3^)F)n2IXWRC=bg$@clv$|Tr!Zx8-1j!LVqLgS02?Hlvx|>{R zoS`c@Xw7}RF;n4y=o<3#kwBKXk)loL&Oi+tH1E`^;jpuV9GuOu!BTQ;GDPTywKLEu z(KM!bYLPiTGZ;A>A|oHim>^fFi`ql~D70EH@DF8y(`&a{ME-90&j(o@oToi-6H7nuq?ORacDD?`P&#Le}&fDi7xmkDP_Kb7n zk-Y?JHpiyyA1RN{M@D3KOecfi|csu&3UfV yPKiUi3eFKmP$>NNcuuW?nY{0000k^*j6l}C)mSLv!5fi?}Niz3$ruc=MegA#v;&y%g2idWOl@V_PfJQNRy85}Sb4q9e E0Pv$RDF6Tf From d15a1136de042f98c9d48bfc41f87f4449bd1d9e Mon Sep 17 00:00:00 2001 From: Dave French Date: Mon, 2 Mar 2015 18:44:03 +0000 Subject: [PATCH 099/133] Added sample exactness to the Lfo controller controls Added sample exactness to the amount control. --- src/core/LfoController.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/LfoController.cpp b/src/core/LfoController.cpp index f7c65a752..e1b20a492 100644 --- a/src/core/LfoController.cpp +++ b/src/core/LfoController.cpp @@ -98,6 +98,10 @@ void LfoController::updateValueBuffer() m_bufferLastUpdated += diff; } + float amount = m_amountModel.value(); + ValueBuffer *amountBuffer = m_amountModel.valueBuffer(); + int amountInc = amountBuffer ? 1 : 0; + float *amountPtr = amountBuffer ? &(amountBuffer->values()[ 0 ] ) : &amount; for( int i = 0; i < m_valueBuffer.length(); i++ ) { @@ -105,15 +109,15 @@ void LfoController::updateValueBuffer() ? m_sampleFunction( phase ) : m_userDefSampleBuffer->userWaveSample( phase ); - values[i] = qBound( 0.0f, m_baseModel.value() + ( m_amountModel.value() * currentSample / 2.0f ), 1.0f ); + values[i] = qBound( 0.0f, m_baseModel.value() + ( *amountPtr * currentSample / 2.0f ), 1.0f ); phase += 1.0 / m_duration; + amountPtr += amountInc; } m_currentPhase = absFraction( phase - m_phaseOffset ); } - void LfoController::updatePhase() { m_currentPhase = ( Engine::getSong()->getFrames() ) / m_duration; From d8dce9605e8791b2df8187f3764aad3638cd75bb Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Thu, 5 Mar 2015 12:34:21 -0500 Subject: [PATCH 100/133] zynaddsubfx: just don't build if FLTK is not found rather than hard-failing. --- plugins/zynaddsubfx/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/zynaddsubfx/CMakeLists.txt b/plugins/zynaddsubfx/CMakeLists.txt index 9f751f38c..77569dd78 100644 --- a/plugins/zynaddsubfx/CMakeLists.txt +++ b/plugins/zynaddsubfx/CMakeLists.txt @@ -32,7 +32,11 @@ IF(MINGW_PREFIX) SET(FLTK_SKIP_FLUID TRUE) ENDIF() -FIND_PACKAGE(FLTK REQUIRED) +FIND_PACKAGE(FLTK) + +IF(NOT FLTK_FOUND) + RETURN() +ENDIF() IF(MINGW_PREFIX) SET(FLTK_FLUID_EXECUTABLE "${MINGW_PREFIX}/bin/fluid") From 48ac1b02eb1e391a788efa7d549a4ae93bb66dc2 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Thu, 5 Mar 2015 12:39:35 -0500 Subject: [PATCH 101/133] DetectMachine: de-convolute 'if' maze and add Haiku. --- cmake/modules/DetectMachine.cmake | 12 ++++++------ lmmsconfig.h.in | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cmake/modules/DetectMachine.cmake b/cmake/modules/DetectMachine.cmake index ccb8638be..5bbbef44e 100644 --- a/cmake/modules/DetectMachine.cmake +++ b/cmake/modules/DetectMachine.cmake @@ -1,11 +1,11 @@ IF(WIN32) SET(LMMS_BUILD_WIN32 1) -ELSE(WIN32) - IF(APPLE) - SET(LMMS_BUILD_APPLE 1) - ELSE(APPLE) - SET(LMMS_BUILD_LINUX 1) - ENDIF(APPLE) +ELSEIF(APPLE) + SET(LMMS_BUILD_APPLE 1) +ELSEIF(HAIKU) + SET(LMMS_BUILD_HAIKU 1) +ELSE() + SET(LMMS_BUILD_LINUX 1) ENDIF(WIN32) MESSAGE("PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}") diff --git a/lmmsconfig.h.in b/lmmsconfig.h.in index d645c5025..496d0db67 100644 --- a/lmmsconfig.h.in +++ b/lmmsconfig.h.in @@ -2,6 +2,7 @@ #cmakedefine LMMS_BUILD_WIN32 #cmakedefine LMMS_BUILD_WIN64 #cmakedefine LMMS_BUILD_APPLE +#cmakedefine LMMS_BUILD_HAIKU #cmakedefine LMMS_HOST_X86 #cmakedefine LMMS_HOST_X86_64 From 946d8a143178a75bb3bf6a3bb34aff6f60bc5f2d Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Thu, 5 Mar 2015 12:41:59 -0500 Subject: [PATCH 102/133] lmms_math: also enable workarounds on Haiku. --- include/lmms_math.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/lmms_math.h b/include/lmms_math.h index d89280be2..1e3b530ae 100644 --- a/include/lmms_math.h +++ b/include/lmms_math.h @@ -34,7 +34,7 @@ #include using namespace std; -#if defined (LMMS_BUILD_WIN32) || defined (LMMS_BUILD_APPLE) +#if defined (LMMS_BUILD_WIN32) || defined (LMMS_BUILD_APPLE) || defined(LMMS_BUILD_HAIKU) #ifndef isnanf #define isnanf(x) isnan(x) #endif From 9b0c602b65ac8bf4b51fc71548c49f770f6db227 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Thu, 5 Mar 2015 12:51:35 -0500 Subject: [PATCH 103/133] LadspaEffect: use same cflags as Linux on Haiku. --- plugins/LadspaEffect/swh/CMakeLists.txt | 4 ++-- plugins/LadspaEffect/tap/CMakeLists.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/LadspaEffect/swh/CMakeLists.txt b/plugins/LadspaEffect/swh/CMakeLists.txt index 080f446e0..64d67bd5f 100644 --- a/plugins/LadspaEffect/swh/CMakeLists.txt +++ b/plugins/LadspaEffect/swh/CMakeLists.txt @@ -24,9 +24,9 @@ FOREACH(_item ${PLUGIN_SOURCES}) ELSE(LMMS_BUILD_APPLE) SET_TARGET_PROPERTIES("${_plugin}" PROPERTIES LINK_FLAGS "${LINK_FLAGS} -shared -Wl,-no-undefined -Wl,-Bsymbolic -lm") ENDIF(LMMS_BUILD_APPLE) - IF(LMMS_BUILD_LINUX) + IF(LMMS_BUILD_LINUX OR LMMS_BUILD_HAIKU) SET_TARGET_PROPERTIES("${_plugin}" PROPERTIES LINK_FLAGS "${LINK_FLAGS} -nostartfiles") - ENDIF(LMMS_BUILD_LINUX) + ENDIF(LMMS_BUILD_LINUX OR LMMS_BUILD_HAIKU) ENDFOREACH(_item ${PLUGIN_SOURCES}) diff --git a/plugins/LadspaEffect/tap/CMakeLists.txt b/plugins/LadspaEffect/tap/CMakeLists.txt index d88c6990b..b747f853b 100644 --- a/plugins/LadspaEffect/tap/CMakeLists.txt +++ b/plugins/LadspaEffect/tap/CMakeLists.txt @@ -14,8 +14,8 @@ FOREACH(_item ${PLUGIN_SOURCES}) ELSE(LMMS_BUILD_APPLE) SET_TARGET_PROPERTIES("${_plugin}" PROPERTIES LINK_FLAGS "${LINK_FLAGS} -shared -Wl,-no-undefined -Wl,-Bsymbolic -lm") ENDIF(LMMS_BUILD_APPLE) - IF(LMMS_BUILD_LINUX) + IF(LMMS_BUILD_LINUX OR LMMS_BUILD_HAIKU) SET_TARGET_PROPERTIES("${_plugin}" PROPERTIES LINK_FLAGS "${LINK_FLAGS} -nostartfiles") - ENDIF(LMMS_BUILD_LINUX) + ENDIF(LMMS_BUILD_LINUX OR LMMS_BUILD_HAIKU) ENDFOREACH(_item ${PLUGIN_SOURCES}) From d6a55442333120670142b0ca10a06400bc2ee47b Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Thu, 5 Mar 2015 12:57:04 -0500 Subject: [PATCH 104/133] lb302: remove unused MIN function. --- plugins/lb302/lb302.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/plugins/lb302/lb302.cpp b/plugins/lb302/lb302.cpp index 14ecb8fa1..5864b94c8 100644 --- a/plugins/lb302/lb302.cpp +++ b/plugins/lb302/lb302.cpp @@ -458,10 +458,6 @@ void lb302Synth::recalcFilter() vcf_envpos = ENVINC; // Trigger filter update in process() } -inline int MIN(int a, int b) { - return (aprocessingSampleRate(); // TODO: Use actual sampling rate. } From 582c9ee678f19aeffe112dd59a863e4bf4b9dda5 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Thu, 5 Mar 2015 13:47:43 -0500 Subject: [PATCH 105/133] Refactor shared memory logic. --- include/RemotePlugin.h | 45 ++++++++++------------------------ src/core/VstSyncController.cpp | 7 +----- 2 files changed, 14 insertions(+), 38 deletions(-) diff --git a/include/RemotePlugin.h b/include/RemotePlugin.h index d57a5d293..42caa36aa 100644 --- a/include/RemotePlugin.h +++ b/include/RemotePlugin.h @@ -36,17 +36,12 @@ #include #include -#ifdef LMMS_BUILD_WIN32 + +#if defined(LMMS_HAVE_SYS_IPC_H) && defined(LMMS_HAVE_SEMAPHORE_H) +#include +#include +#else #define USE_QT_SEMAPHORES -#define USE_QT_SHMEM -#endif - -#ifdef LMMS_BUILD_APPLE -#define USE_QT_SEMAPHORES -#endif - - -#ifdef USE_QT_SEMAPHORES #ifdef LMMS_HAVE_PROCESS_H #include @@ -54,39 +49,25 @@ #include #include - -#else /* USE_QT_SEMAPHORES */ - -#ifdef LMMS_HAVE_SYS_IPC_H -#include #endif -#ifdef LMMS_HAVE_SEMAPHORE_H -#include -#endif - -#endif - - -#ifdef USE_QT_SHMEM - -#include -#include - -typedef int32_t key_t; - -#else /* USE_QT_SHMEM */ #ifdef LMMS_HAVE_SYS_SHM_H #include -#endif #ifdef LMMS_HAVE_UNISTD_H #include #endif +#else +#define USE_QT_SHMEM +#include +#include + +#if !defined(LMMS_HAVE_SYS_TYPES_H) || defined(LMMS_BUILD_WIN32) +typedef int32_t key_t; +#endif #endif - #ifdef LMMS_HAVE_LOCALE_H diff --git a/src/core/VstSyncController.cpp b/src/core/VstSyncController.cpp index 1e1294c32..a28b9adb1 100644 --- a/src/core/VstSyncController.cpp +++ b/src/core/VstSyncController.cpp @@ -30,12 +30,7 @@ #include "lmmsconfig.h" #include "Mixer.h" #include "VstSyncController.h" - -#ifdef LMMS_BUILD_WIN32 -#ifndef USE_QT_SHMEM -#define USE_QT_SHMEM -#endif -#endif +#include "RemotePlugin.h" #ifndef USE_QT_SHMEM #include From 14ba57a531de120bb3d70fa3365055ecc3bebd6e Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Thu, 5 Mar 2015 13:48:10 -0500 Subject: [PATCH 106/133] versioninfo: add Haiku. --- include/versioninfo.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/versioninfo.h b/include/versioninfo.h index 9295a56c4..58f7a79e9 100644 --- a/include/versioninfo.h +++ b/include/versioninfo.h @@ -27,3 +27,7 @@ #ifdef LMMS_BUILD_WIN32 #define PLATFORM "win32" #endif + +#ifdef LMMS_BUILD_HAIKU +#define PLATFORM "Haiku" +#endif From 6e3d4f431dda9bbeddb7deb19849bfe0dc29bfe3 Mon Sep 17 00:00:00 2001 From: Amadeus Folego Date: Sun, 1 Mar 2015 22:22:17 -0300 Subject: [PATCH 107/133] Change behaviour for changing volume/pan on Piano All the selected notes are changed by default for the 3 possible events: - Mouse dragging the volume/pan meter - Rolling the mouse wheel over the meter - Double-clicking the meter The user can still change each note individually by holding alt before performing the desired action --- include/Note.h | 1 + src/core/Note.cpp | 5 +++ src/gui/editors/PianoRoll.cpp | 70 ++++++++++++++--------------------- 3 files changed, 33 insertions(+), 43 deletions(-) diff --git a/include/Note.h b/include/Note.h index 05839a006..62a6f6f93 100644 --- a/include/Note.h +++ b/include/Note.h @@ -204,6 +204,7 @@ public: return m_detuning; } bool hasDetuningInfo() const; + bool withinRange(int tickStart, int tickEnd) const; void createDetuning(); diff --git a/src/core/Note.cpp b/src/core/Note.cpp index ed41abea8..f5851dde4 100644 --- a/src/core/Note.cpp +++ b/src/core/Note.cpp @@ -231,3 +231,8 @@ bool Note::hasDetuningInfo() const +bool Note::withinRange(int tickStart, int tickEnd) const +{ + return pos().getTicks() >= tickStart && pos().getTicks() <= tickEnd + && length().getTicks() != 0; +} diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index c235fa8b4..76f918c83 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -1657,13 +1657,11 @@ void PianoRoll::mouseDoubleClickEvent(QMouseEvent * me ) notes += m_pattern->notes(); // go through notes to figure out which one we want to change + bool altPressed = me->modifiers() & Qt::AltModifier; NoteVector nv; foreach( Note * i, notes ) { - if( i->pos().getTicks() >= ticks_start - && i->pos().getTicks() <= ticks_end - && i->length().getTicks() != 0 - && ( i->selected() || ! isSelection() ) ) + if( i->withinRange( ticks_start, ticks_end ) || ( i->selected() && !altPressed ) ) { nv += i; } @@ -2077,27 +2075,22 @@ void PianoRoll::mouseMoveEvent( QMouseEvent * me ) } } - - - // loop through vector - bool on_note = false; - bool use_selection = isSelection(); + // When alt is pressed we only edit the note under the cursor + bool altPressed = me->modifiers() & Qt::AltModifier; + // We iterate from last note in pattern to the first, + // chronologically NoteVector::ConstIterator it = notes.begin()+notes.size()-1; for( int i = 0; i < notes.size(); ++i ) { - Note * n = *it; - if( n->pos().getTicks() >= ticks_start - && n->pos().getTicks() <= ticks_end - && n->length().getTicks() != 0 - && ( n->selected() || ! use_selection ) ) + Note* n = *it; + + bool isUnderPosition = n->withinRange( ticks_start, ticks_end ); + // Play note under the cursor + if ( isUnderPosition ) { testPlayNote( n ); } + // If note is the one under the cursor or is selected when alt is + // not pressed + if ( isUnderPosition || ( n->selected() && !altPressed ) ) { - on_note = true; - m_pattern->dataChanged(); - - // play the note so that the user can tell how loud it is - // and where it is panned - testPlayNote( n ); - if( m_noteEditMode == NoteEditVolume ) { n->setVolume( vol ); @@ -2114,31 +2107,23 @@ void PianoRoll::mouseMoveEvent( QMouseEvent * me ) m_pattern->instrumentTrack()->processInEvent( evt ); } } - else + else if( n->isPlaying() ) { - if( n->isPlaying() ) - { - // mouse not over this note, stop playing it. - m_pattern->instrumentTrack()->pianoModel()->handleKeyRelease( n->key() ); + // mouse not over this note, stop playing it. + m_pattern->instrumentTrack()->pianoModel()->handleKeyRelease( n->key() ); - n->setIsPlaying( false ); - } + n->setIsPlaying( false ); } - // set textfloat visible if we're on a note - if( on_note ) - { - s_textFloat->moveGlobal( this, QPoint( me->x() + 4, me->y() + 16 ) ); - s_textFloat->show(); - } - else - { - s_textFloat->hide(); - } --it; - } + + // Emit pattern has changed + m_pattern->dataChanged(); + // Show the new volume value + s_textFloat->moveGlobal( this, QPoint( me->x() + 4, me->y() + 16 ) ); + s_textFloat->show(); } else if( me->buttons() == Qt::NoButton && m_editMode == ModeDraw ) @@ -3165,14 +3150,13 @@ void PianoRoll::wheelEvent(QWheelEvent * we ) NoteVector notes; notes += m_pattern->notes(); + // When alt is pressed we only edit the note under the cursor + bool altPressed = we->modifiers() & Qt::AltModifier; // go through notes to figure out which one we want to change NoteVector nv; foreach( Note * i, notes ) { - if( i->pos().getTicks() >= ticks_start - && i->pos().getTicks() <= ticks_end - && i->length().getTicks() != 0 - && ( i->selected() || ! isSelection() ) ) + if( i->withinRange( ticks_start, ticks_end ) || ( i->selected() && !altPressed ) ) { nv += i; } From de74760586211f949bbd90527b3afded0bfea32e Mon Sep 17 00:00:00 2001 From: Dave French Date: Thu, 26 Feb 2015 20:45:34 +0000 Subject: [PATCH 108/133] xml validation, removed redundant boxing, unknown files fail validation, caught a inverse logic error --- src/core/DataFile.cpp | 2 +- src/core/PresetPreviewPlayHandle.cpp | 6 ++---- src/core/Song.cpp | 2 +- src/gui/FileBrowser.cpp | 3 ++- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index 06afd9bc3..15fa5abde 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -202,7 +202,7 @@ bool DataFile::validate( QString extension ) } break; default: - return true; + return false; } return false; } diff --git a/src/core/PresetPreviewPlayHandle.cpp b/src/core/PresetPreviewPlayHandle.cpp index 658160098..a91681758 100644 --- a/src/core/PresetPreviewPlayHandle.cpp +++ b/src/core/PresetPreviewPlayHandle.cpp @@ -151,15 +151,13 @@ PresetPreviewPlayHandle::PresetPreviewPlayHandle( const QString & _preset_file, dataFileCreated = true; } - DataFile data(*dataFile); - // vestige previews are bug prone; fallback on 3xosc with volume of 0 // without an instrument in preview track, it will segfault - if(data.content().elementsByTagName( "vestige" ).length() == 0 ) + if(dataFile->content().elementsByTagName( "vestige" ).length() == 0 ) { s_previewTC->previewInstrumentTrack()-> loadTrackSpecificSettings( - data.content().firstChild().toElement() ); + dataFile->content().firstChild().toElement() ); } else { diff --git a/src/core/Song.cpp b/src/core/Song.cpp index 0f072076e..7e5d36e8b 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -924,7 +924,7 @@ void Song::loadProject( const QString & _file_name ) DataFile dataFile( m_fileName ); // if file could not be opened, head-node is null and we create // new project - if( !dataFile.validate( _file_name.right(_file_name.lastIndexOf(".") ) ) ) + if( dataFile.validate( _file_name.right(_file_name.lastIndexOf(".") ) ) ) { return; } diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index 50059734c..942e1f360 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -466,7 +466,8 @@ void FileBrowserTreeWidget::mousePressEvent(QMouseEvent * me ) if( !dataFile.validate( f->extension() ) ) { QMessageBox::warning( 0, tr ( "Error" ), - f->fullName() + " " + tr( "does not appear to be a valid") + " " + f->extension(), + f->fullName() + " " + tr( "does not appear to be a valid" ) + " " + f->extension() + + " " + tr( "file" ), QMessageBox::Ok, QMessageBox::NoButton ); m_pphMutex.unlock(); return; From 3829990e00f6e8b112e55374687595a79de02cd3 Mon Sep 17 00:00:00 2001 From: Dave French Date: Sun, 8 Mar 2015 14:48:23 +0000 Subject: [PATCH 109/133] Commented DataFile::validate in headder --- include/DataFile.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/DataFile.h b/include/DataFile.h index 6f01ffc5e..c8586fd9d 100644 --- a/include/DataFile.h +++ b/include/DataFile.h @@ -58,6 +58,10 @@ public: virtual ~DataFile(); + /// + /// \brief validate + /// performs basic validation, compared to file extension. + /// bool validate( QString extension ); QString nameWithExtension( const QString& fn ) const; From 7037faedd35eedc969284eb3c990c955bdb761c6 Mon Sep 17 00:00:00 2001 From: Dave French Date: Mon, 23 Feb 2015 21:16:38 +0000 Subject: [PATCH 110/133] Added Checking of filetypes from the xml. Added a static function fileTypeFromData to the DataFile class. This opens the given file and checks the xml for its file type, as oposed to relying on the file extension --- include/DataFile.h | 5 +++++ src/core/DataFile.cpp | 39 +++++++++++++++++++++++++++++++++++++++ src/gui/FileBrowser.cpp | 3 ++- 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/include/DataFile.h b/include/DataFile.h index 1d5f71f78..86dee8675 100644 --- a/include/DataFile.h +++ b/include/DataFile.h @@ -56,6 +56,11 @@ public: DataFile( const QByteArray& data ); DataFile( Type type ); + /// \brief fileTypeFromData + /// Reads the given file and checks the xml for the type + /// returns UnknownType if the file is not reconised + static DataFile::Type fileTypeFromData( const QString fileName); + virtual ~DataFile(); QString nameWithExtension( const QString& fn ) const; diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index 1e79b0c08..2be3f0377 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -114,6 +114,45 @@ DataFile::DataFile( Type type ) : } +DataFile::Type DataFile::fileTypeFromData(const QString fileName) +{ + QString errorMsg; + DataFile::Type t; + QDomDocument doc; + + QFile inFile( fileName ); + if( !inFile.open( QIODevice::ReadOnly ) ) + { + return DataFile::Type::UnknownType; + } + + QByteArray data = inFile.readAll(); + inFile.close(); + + int line = -1, col = -1; + if( !doc.setContent( data, &errorMsg, &line, &col ) ) + { + // parsing failed? then try to uncompress data + QByteArray uncompressed = qUncompress( data ); + if( !uncompressed.isEmpty() ) + { + if( doc.setContent( uncompressed, &errorMsg, &line, &col ) ) + { + line = col = -1; + } + } + if( line >= 0 && col >= 0 ) + { + return DataFile::Type::UnknownType; + } + } + + QDomElement root = doc.documentElement(); + t = type( root.attribute( "type" ) ); + + return t; +} + diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index 0d19ec6aa..4253ce55d 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -459,7 +459,8 @@ void FileBrowserTreeWidget::mousePressEvent(QMouseEvent * me ) } else if( f->type() != FileItem::VstPluginFile && ( f->handling() == FileItem::LoadAsPreset || - f->handling() == FileItem::LoadByPlugin ) ) + f->handling() == FileItem::LoadByPlugin ) + && DataFile::fileTypeFromData( f->fullName() ) == DataFile::Type::InstrumentTrackSettings ) { m_previewPlayHandle = new PresetPreviewPlayHandle( f->fullName(), f->handling() == FileItem::LoadByPlugin ); } From ad9dfd853d6c350932773ba65a289884b88ba784 Mon Sep 17 00:00:00 2001 From: Dave French Date: Wed, 25 Feb 2015 21:30:45 +0000 Subject: [PATCH 111/133] Begginings of XML validation --- include/DataFile.h | 7 +-- include/PresetPreviewPlayHandle.h | 2 +- src/core/DataFile.cpp | 87 +++++++++++++++------------- src/core/PresetPreviewPlayHandle.cpp | 22 +++++-- src/gui/FileBrowser.cpp | 15 ++++- 5 files changed, 80 insertions(+), 53 deletions(-) diff --git a/include/DataFile.h b/include/DataFile.h index 86dee8675..6f01ffc5e 100644 --- a/include/DataFile.h +++ b/include/DataFile.h @@ -56,13 +56,10 @@ public: DataFile( const QByteArray& data ); DataFile( Type type ); - /// \brief fileTypeFromData - /// Reads the given file and checks the xml for the type - /// returns UnknownType if the file is not reconised - static DataFile::Type fileTypeFromData( const QString fileName); - virtual ~DataFile(); + bool validate( QString extension ); + QString nameWithExtension( const QString& fn ) const; void write( QTextStream& strm ); diff --git a/include/PresetPreviewPlayHandle.h b/include/PresetPreviewPlayHandle.h index 6dd8c8e19..0ebed9c89 100644 --- a/include/PresetPreviewPlayHandle.h +++ b/include/PresetPreviewPlayHandle.h @@ -35,7 +35,7 @@ class PreviewTrackContainer; class EXPORT PresetPreviewPlayHandle : public PlayHandle { public: - PresetPreviewPlayHandle( const QString& presetFile, bool loadByPlugin = false ); + PresetPreviewPlayHandle( const QString& presetFile, bool loadByPlugin = false, DataFile *dataFile = 0 ); virtual ~PresetPreviewPlayHandle(); virtual void play( sampleFrame* buffer ); diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index 2be3f0377..85d7f0e35 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -114,45 +114,6 @@ DataFile::DataFile( Type type ) : } -DataFile::Type DataFile::fileTypeFromData(const QString fileName) -{ - QString errorMsg; - DataFile::Type t; - QDomDocument doc; - - QFile inFile( fileName ); - if( !inFile.open( QIODevice::ReadOnly ) ) - { - return DataFile::Type::UnknownType; - } - - QByteArray data = inFile.readAll(); - inFile.close(); - - int line = -1, col = -1; - if( !doc.setContent( data, &errorMsg, &line, &col ) ) - { - // parsing failed? then try to uncompress data - QByteArray uncompressed = qUncompress( data ); - if( !uncompressed.isEmpty() ) - { - if( doc.setContent( uncompressed, &errorMsg, &line, &col ) ) - { - line = col = -1; - } - } - if( line >= 0 && col >= 0 ) - { - return DataFile::Type::UnknownType; - } - } - - QDomElement root = doc.documentElement(); - t = type( root.attribute( "type" ) ); - - return t; -} - @@ -202,6 +163,54 @@ DataFile::~DataFile() +bool DataFile::validate( QString extension ) +{ + bool result = false; + switch( m_type ) + { + case Type::SongProject: + if( extension == "mmp" || extension == "mmpz" ) + { + result = true; + } + break; + case Type::SongProjectTemplate: + if( extension == "mpt" ) + { + result = true; + } + break; + case Type::InstrumentTrackSettings: + if ( extension == "xpf" || extension == "xml" ) + { + result = true; + } + break; + case Type::UnknownType: + if (! ( extension == "mmp" || extension == "mpt" || extension == "mmpz" || + extension == "xpf" || extension == "xml" || + ( extension == "xiz" && Engine::pluginFileHandling().contains( extension ) ) || + extension == "sf2" || extension == "pat" || extension == "mid" || + extension == "flp" || extension == "dll" + ) ) + { + result = true; + } + if( extension == "wav" || extension == "ogg" || + extension == "ds" ) + { + result = true; + } + break; + default: + return true; + } + return result; +} + + + + QString DataFile::nameWithExtension( const QString & _fn ) const { switch( type() ) diff --git a/src/core/PresetPreviewPlayHandle.cpp b/src/core/PresetPreviewPlayHandle.cpp index 09ebaca16..658160098 100644 --- a/src/core/PresetPreviewPlayHandle.cpp +++ b/src/core/PresetPreviewPlayHandle.cpp @@ -111,7 +111,7 @@ PreviewTrackContainer * PresetPreviewPlayHandle::s_previewTC; -PresetPreviewPlayHandle::PresetPreviewPlayHandle( const QString & _preset_file, bool _load_by_plugin ) : +PresetPreviewPlayHandle::PresetPreviewPlayHandle( const QString & _preset_file, bool _load_by_plugin, DataFile *dataFile ) : PlayHandle( TypePresetPreviewHandle ), m_previewNote( NULL ) { @@ -144,22 +144,34 @@ PresetPreviewPlayHandle::PresetPreviewPlayHandle( const QString & _preset_file, } else { - DataFile dataFile( _preset_file ); + bool dataFileCreated = false; + if( dataFile == 0 ) + { + dataFile = new DataFile( _preset_file ); + dataFileCreated = true; + } + + DataFile data(*dataFile); + // vestige previews are bug prone; fallback on 3xosc with volume of 0 // without an instrument in preview track, it will segfault - if(dataFile.content().elementsByTagName( "vestige" ).length() == 0 ) + if(data.content().elementsByTagName( "vestige" ).length() == 0 ) { s_previewTC->previewInstrumentTrack()-> loadTrackSpecificSettings( - dataFile.content().firstChild().toElement() ); + data.content().firstChild().toElement() ); } else { s_previewTC->previewInstrumentTrack()->loadInstrument("tripleoscillator"); s_previewTC->previewInstrumentTrack()->setVolume( 0 ); } + if( dataFileCreated ) + { + delete dataFile; + } } - + dataFile = 0; // make sure, our preset-preview-track does not appear in any MIDI- // devices list, so just disable receiving/sending MIDI-events at all s_previewTC->previewInstrumentTrack()-> diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index 4253ce55d..f865fab19 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include "FileBrowser.h" #include "BBTrackContainer.h" @@ -459,10 +460,18 @@ void FileBrowserTreeWidget::mousePressEvent(QMouseEvent * me ) } else if( f->type() != FileItem::VstPluginFile && ( f->handling() == FileItem::LoadAsPreset || - f->handling() == FileItem::LoadByPlugin ) - && DataFile::fileTypeFromData( f->fullName() ) == DataFile::Type::InstrumentTrackSettings ) + f->handling() == FileItem::LoadByPlugin ) ) { - m_previewPlayHandle = new PresetPreviewPlayHandle( f->fullName(), f->handling() == FileItem::LoadByPlugin ); + DataFile dataFile( f->fullName() ); + if( !dataFile.validate( f->extension() ) ) + { + QMessageBox::warning( 0, "Corrupt File", + "File : " + f->fullName() + " contains invalid data", + QMessageBox::Ok, QMessageBox::NoButton ); + m_pphMutex.unlock(); + return; + } + m_previewPlayHandle = new PresetPreviewPlayHandle( f->fullName(), f->handling() == FileItem::LoadByPlugin, &dataFile ); } if( m_previewPlayHandle != NULL ) { From 318260a7e25acc9c3433b37dfa63e3acf5acc913 Mon Sep 17 00:00:00 2001 From: Dave French Date: Thu, 26 Feb 2015 20:07:45 +0000 Subject: [PATCH 112/133] Validates Xml files opened with the main menu --- src/core/DataFile.cpp | 13 ++++++------- src/core/Song.cpp | 2 +- src/gui/FileBrowser.cpp | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index 85d7f0e35..06afd9bc3 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -165,25 +165,24 @@ DataFile::~DataFile() bool DataFile::validate( QString extension ) { - bool result = false; switch( m_type ) { case Type::SongProject: if( extension == "mmp" || extension == "mmpz" ) { - result = true; + return true; } break; case Type::SongProjectTemplate: if( extension == "mpt" ) { - result = true; + return true; } break; case Type::InstrumentTrackSettings: if ( extension == "xpf" || extension == "xml" ) { - result = true; + return true; } break; case Type::UnknownType: @@ -194,18 +193,18 @@ bool DataFile::validate( QString extension ) extension == "flp" || extension == "dll" ) ) { - result = true; + return true; } if( extension == "wav" || extension == "ogg" || extension == "ds" ) { - result = true; + return true; } break; default: return true; } - return result; + return false; } diff --git a/src/core/Song.cpp b/src/core/Song.cpp index 6759abb4b..27673d401 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -942,7 +942,7 @@ void Song::loadProject( const QString & fileName ) DataFile dataFile( m_fileName ); // if file could not be opened, head-node is null and we create // new project - if( dataFile.head().isNull() ) + if( !dataFile.validate( _file_name.right(_file_name.lastIndexOf(".") ) ) ) { return; } diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index f865fab19..50059734c 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -465,8 +465,8 @@ void FileBrowserTreeWidget::mousePressEvent(QMouseEvent * me ) DataFile dataFile( f->fullName() ); if( !dataFile.validate( f->extension() ) ) { - QMessageBox::warning( 0, "Corrupt File", - "File : " + f->fullName() + " contains invalid data", + QMessageBox::warning( 0, tr ( "Error" ), + f->fullName() + " " + tr( "does not appear to be a valid") + " " + f->extension(), QMessageBox::Ok, QMessageBox::NoButton ); m_pphMutex.unlock(); return; From 335711aac73224996a60fb1c2e4bab82e3c133a4 Mon Sep 17 00:00:00 2001 From: Dave French Date: Thu, 26 Feb 2015 20:45:34 +0000 Subject: [PATCH 113/133] xml validation, removed redundant boxing, unknown files fail validation, caught a inverse logic error --- src/core/DataFile.cpp | 2 +- src/core/PresetPreviewPlayHandle.cpp | 6 ++---- src/core/Song.cpp | 2 +- src/gui/FileBrowser.cpp | 3 ++- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index 06afd9bc3..15fa5abde 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -202,7 +202,7 @@ bool DataFile::validate( QString extension ) } break; default: - return true; + return false; } return false; } diff --git a/src/core/PresetPreviewPlayHandle.cpp b/src/core/PresetPreviewPlayHandle.cpp index 658160098..a91681758 100644 --- a/src/core/PresetPreviewPlayHandle.cpp +++ b/src/core/PresetPreviewPlayHandle.cpp @@ -151,15 +151,13 @@ PresetPreviewPlayHandle::PresetPreviewPlayHandle( const QString & _preset_file, dataFileCreated = true; } - DataFile data(*dataFile); - // vestige previews are bug prone; fallback on 3xosc with volume of 0 // without an instrument in preview track, it will segfault - if(data.content().elementsByTagName( "vestige" ).length() == 0 ) + if(dataFile->content().elementsByTagName( "vestige" ).length() == 0 ) { s_previewTC->previewInstrumentTrack()-> loadTrackSpecificSettings( - data.content().firstChild().toElement() ); + dataFile->content().firstChild().toElement() ); } else { diff --git a/src/core/Song.cpp b/src/core/Song.cpp index 27673d401..b53efb33d 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -942,7 +942,7 @@ void Song::loadProject( const QString & fileName ) DataFile dataFile( m_fileName ); // if file could not be opened, head-node is null and we create // new project - if( !dataFile.validate( _file_name.right(_file_name.lastIndexOf(".") ) ) ) + if( dataFile.validate( _file_name.right(_file_name.lastIndexOf(".") ) ) ) { return; } diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index 50059734c..942e1f360 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -466,7 +466,8 @@ void FileBrowserTreeWidget::mousePressEvent(QMouseEvent * me ) if( !dataFile.validate( f->extension() ) ) { QMessageBox::warning( 0, tr ( "Error" ), - f->fullName() + " " + tr( "does not appear to be a valid") + " " + f->extension(), + f->fullName() + " " + tr( "does not appear to be a valid" ) + " " + f->extension() + + " " + tr( "file" ), QMessageBox::Ok, QMessageBox::NoButton ); m_pphMutex.unlock(); return; From f310a4066f4d4986fcc65108bcd0a712a481583a Mon Sep 17 00:00:00 2001 From: Dave French Date: Sun, 8 Mar 2015 14:48:23 +0000 Subject: [PATCH 114/133] Commented DataFile::validate in headder --- include/DataFile.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/DataFile.h b/include/DataFile.h index 6f01ffc5e..c8586fd9d 100644 --- a/include/DataFile.h +++ b/include/DataFile.h @@ -58,6 +58,10 @@ public: virtual ~DataFile(); + /// + /// \brief validate + /// performs basic validation, compared to file extension. + /// bool validate( QString extension ); QString nameWithExtension( const QString& fn ) const; From 8e244a2e777a5d8da1cec138c4fc16f7b46f27ef Mon Sep 17 00:00:00 2001 From: Dave French Date: Sun, 8 Mar 2015 17:17:21 +0000 Subject: [PATCH 115/133] Corrected fileName typo --- src/core/Song.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/Song.cpp b/src/core/Song.cpp index b53efb33d..0f688a1b1 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -942,7 +942,7 @@ void Song::loadProject( const QString & fileName ) DataFile dataFile( m_fileName ); // if file could not be opened, head-node is null and we create // new project - if( dataFile.validate( _file_name.right(_file_name.lastIndexOf(".") ) ) ) + if( dataFile.validate( fileName.right( fileName.lastIndexOf(".") ) ) ) { return; } From 51fa26ecb119f07ba7f2500d0c12aeef5f3e043f Mon Sep 17 00:00:00 2001 From: Dave French Date: Mon, 9 Mar 2015 22:43:44 +0000 Subject: [PATCH 116/133] Fixed bug where cross hairs were incrorrectly draw in Automation Editor The cross hairs in the automation editor were incorrectly drawn when moving another window infront. This change only draws the cross hairs when the window has focus. --- src/gui/editors/AutomationEditor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/editors/AutomationEditor.cpp b/src/gui/editors/AutomationEditor.cpp index 7c4b77dbf..3146d49b1 100644 --- a/src/gui/editors/AutomationEditor.cpp +++ b/src/gui/editors/AutomationEditor.cpp @@ -1314,8 +1314,9 @@ void AutomationEditor::paintEvent(QPaintEvent * pe ) m_leftRightScroll->setPageStep( l ); } - if( validPattern() ) + if( validPattern() && GuiApplication::instance()->automationEditor()->hasFocus() ) { + drawCross( p ); } From 42e2c8ff7ee82103115698eb327ac131feacbd33 Mon Sep 17 00:00:00 2001 From: Alexandre Date: Fri, 6 Mar 2015 22:34:56 -0300 Subject: [PATCH 117/133] Fix issue of reverting settings Fix issue of reverting settings Delete file created accidentally Delete SetupDialog.cpp --- src/gui/SetupDialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/SetupDialog.cpp b/src/gui/SetupDialog.cpp index b3450e700..a02b7ba0d 100644 --- a/src/gui/SetupDialog.cpp +++ b/src/gui/SetupDialog.cpp @@ -686,7 +686,7 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : m_audioInterfaces->addItem( it.key() ); } m_audioInterfaces->setCurrentIndex( m_audioInterfaces->findText( - tr( Engine::mixer()->audioDevName().toLatin1() ) ) ); + ConfigManager::inst()->value( "mixer", "audiodev" ) ) ); m_audioIfaceSetupWidgets[Engine::mixer()->audioDevName()]->show(); connect( m_audioInterfaces, SIGNAL( activated( const QString & ) ), @@ -767,7 +767,7 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : } m_midiInterfaces->setCurrentIndex( m_midiInterfaces->findText( - tr( Engine::mixer()->midiClientName().toLatin1() ) ) ); + ConfigManager::inst()->value( "mixer", "mididev" ) ) ); m_midiIfaceSetupWidgets[Engine::mixer()->midiClientName()]->show(); connect( m_midiInterfaces, SIGNAL( activated( const QString & ) ), From b3f60dde955dc40098c072f4e07d0faa85da61b4 Mon Sep 17 00:00:00 2001 From: Alexandre Date: Tue, 10 Mar 2015 00:51:28 -0300 Subject: [PATCH 118/133] Update SetupDialog.cpp --- src/gui/SetupDialog.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/gui/SetupDialog.cpp b/src/gui/SetupDialog.cpp index a02b7ba0d..964e357d0 100644 --- a/src/gui/SetupDialog.cpp +++ b/src/gui/SetupDialog.cpp @@ -685,9 +685,12 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : asw_layout->addWidget( audioWidget ); m_audioInterfaces->addItem( it.key() ); } - m_audioInterfaces->setCurrentIndex( m_audioInterfaces->findText( - ConfigManager::inst()->value( "mixer", "audiodev" ) ) ); - m_audioIfaceSetupWidgets[Engine::mixer()->audioDevName()]->show(); + + QString audioDevName = + ConfigManager::inst()->value( "mixer", "audiodev" ); + m_audioInterfaces-> + setCurrentIndex( m_audioInterfaces->findText( audioDevName ) ); + m_audioIfaceSetupWidgets[audioDevName]->show(); connect( m_audioInterfaces, SIGNAL( activated( const QString & ) ), this, SLOT( audioInterfaceChanged( const QString & ) ) ); @@ -766,9 +769,11 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : m_midiInterfaces->addItem( it.key() ); } - m_midiInterfaces->setCurrentIndex( m_midiInterfaces->findText( - ConfigManager::inst()->value( "mixer", "mididev" ) ) ); - m_midiIfaceSetupWidgets[Engine::mixer()->midiClientName()]->show(); + QString midiDevName = + ConfigManager::inst()->value( "mixer", "mididev" ); + m_midiInterfaces->setCurrentIndex( + m_midiInterfaces->findText( midiDevName ) ); + m_midiIfaceSetupWidgets[midiDevName]->show(); connect( m_midiInterfaces, SIGNAL( activated( const QString & ) ), this, SLOT( midiInterfaceChanged( const QString & ) ) ); @@ -1373,5 +1378,3 @@ void SetupDialog::displayMIDIHelp() - - From 3f8cfbd7a82319ce3210590a8df1d815caaf402e Mon Sep 17 00:00:00 2001 From: "Christopher L. Simons" Date: Tue, 10 Mar 2015 06:47:05 -0400 Subject: [PATCH 119/133] No longer halting playback when 'Open project' dialog is summoned; fixes #1384 --- src/gui/MainWindow.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 63b90179b..de12baaa8 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -620,8 +620,6 @@ void MainWindow::resetWindowTitle() bool MainWindow::mayChangeProject() { - Engine::getSong()->stop(); - if( !Engine::getSong()->isModified() ) { return( true ); From 393eacad7dc6d56eb2dd2565c3aa56fba84c50b8 Mon Sep 17 00:00:00 2001 From: "Christopher L. Simons" Date: Tue, 10 Mar 2015 07:05:10 -0400 Subject: [PATCH 120/133] Ensuring playback is halted once file selection is confirmed in 'Open project' dialog; fixes #1384 --- src/gui/MainWindow.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index de12baaa8..6c052593a 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -767,6 +767,8 @@ void MainWindow::openProject() if( ofd.exec () == QDialog::Accepted && !ofd.selectedFiles().isEmpty() ) { + Engine::getSong()->stop(); + setCursor( Qt::WaitCursor ); Engine::getSong()->loadProject( ofd.selectedFiles()[0] ); From 95c7d72a90858616c63014c49cbe9623931d5966 Mon Sep 17 00:00:00 2001 From: "Christopher L. Simons" Date: Tue, 10 Mar 2015 07:41:13 -0400 Subject: [PATCH 121/133] Added 'bool stopPlayback' parameter to MainWindow::mayChangeProject() to preserve old behavior outside of 'Open project dialog' case; fixes #1384 --- include/MainWindow.h | 4 +++- src/gui/FileBrowser.cpp | 4 ++-- src/gui/MainWindow.cpp | 15 +++++++++------ src/gui/TrackContainerView.cpp | 2 +- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/include/MainWindow.h b/include/MainWindow.h index 86ab8adc6..5e1f294ae 100644 --- a/include/MainWindow.h +++ b/include/MainWindow.h @@ -69,10 +69,12 @@ public: /// opens another file...) must call this before and may only proceed if /// this function returns true. /// + /// \param stopPlayback whether playback should be stopped upon prompting. If set to false, the caller should ensure that Engine::getSong()->stop() is called before unloading/loading a song. + /// /// \return true if the user allows the software to proceed, false if they /// cancel the action. /// - bool mayChangeProject(); + bool mayChangeProject(bool stopPlayback); void clearKeyModifiers(); diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index 942e1f360..6ea9d5134 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -583,7 +583,7 @@ void FileBrowserTreeWidget::handleFile(FileItem * f, InstrumentTrack * it ) switch( f->handling() ) { case FileItem::LoadAsProject: - if( gui->mainWindow()->mayChangeProject() ) + if( gui->mainWindow()->mayChangeProject(true) ) { Engine::getSong()->loadProject( f->fullName() ); } @@ -614,7 +614,7 @@ void FileBrowserTreeWidget::handleFile(FileItem * f, InstrumentTrack * it ) case FileItem::ImportAsProject: if( f->type() == FileItem::FlpFile && - !gui->mainWindow()->mayChangeProject() ) + !gui->mainWindow()->mayChangeProject(true) ) { break; } diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 6c052593a..8250163af 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -618,8 +618,11 @@ void MainWindow::resetWindowTitle() -bool MainWindow::mayChangeProject() +bool MainWindow::mayChangeProject(bool stopPlayback) { + if( stopPlayback ) + Engine::getSong()->stop(); + if( !Engine::getSong()->isModified() ) { return( true ); @@ -731,7 +734,7 @@ void MainWindow::enterWhatsThisMode() void MainWindow::createNewProject() { - if( mayChangeProject() ) + if( mayChangeProject(true) ) { Engine::getSong()->createNewProject(); } @@ -742,7 +745,7 @@ void MainWindow::createNewProject() void MainWindow::createNewProjectFromTemplate( QAction * _idx ) { - if( m_templatesMenu != NULL && mayChangeProject() ) + if( m_templatesMenu != NULL && mayChangeProject(true) ) { QString dir_base = m_templatesMenu->actions().indexOf( _idx ) >= m_custom_templates_count ? @@ -758,7 +761,7 @@ void MainWindow::createNewProjectFromTemplate( QAction * _idx ) void MainWindow::openProject() { - if( mayChangeProject() ) + if( mayChangeProject(false) ) { FileDialog ofd( this, tr( "Open Project" ), "", tr( "LMMS (*.mmp *.mmpz)" ) ); @@ -796,7 +799,7 @@ void MainWindow::updateRecentlyOpenedProjectsMenu() void MainWindow::openRecentlyOpenedProject( QAction * _action ) { - if ( mayChangeProject() ) + if ( mayChangeProject(true) ) { const QString & f = _action->text(); setCursor( Qt::WaitCursor ); @@ -1185,7 +1188,7 @@ void MainWindow::redo() void MainWindow::closeEvent( QCloseEvent * _ce ) { - if( mayChangeProject() ) + if( mayChangeProject(true) ) { // delete recovery file QFile::remove(ConfigManager::inst()->recoveryFile()); diff --git a/src/gui/TrackContainerView.cpp b/src/gui/TrackContainerView.cpp index 4513e9edf..f49f75bba 100644 --- a/src/gui/TrackContainerView.cpp +++ b/src/gui/TrackContainerView.cpp @@ -377,7 +377,7 @@ void TrackContainerView::dropEvent( QDropEvent * _de ) else if( type == "projectfile") { - if( gui->mainWindow()->mayChangeProject() ) + if( gui->mainWindow()->mayChangeProject(true) ) { Engine::getSong()->loadProject( value ); } From bcd44ded5b20e159411e5795e43c502b02166699 Mon Sep 17 00:00:00 2001 From: "Raine M. Ekman" Date: Tue, 10 Mar 2015 20:53:29 +0200 Subject: [PATCH 122/133] Added smooth scrolling to view menu --- src/gui/MainWindow.cpp | 3 +-- src/gui/editors/SongEditor.cpp | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 8250163af..9a0afbe38 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -1079,13 +1079,12 @@ void MainWindow::updateViewMenu() */ // Should be doable. - /* qa = new QAction(tr( "Smooth scroll" ), this); + qa = new QAction(tr( "Smooth scroll" ), this); qa->setData("smoothscroll"); qa->setCheckable( true ); qa->setChecked( ConfigManager::inst()->value( "ui", "smoothscroll" ). toInt() ? true : false ); m_viewMenu->addAction(qa); - */ // Not yet. /* qa = new QAction(tr( "One instrument track window" ), this); diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index b14f90a37..2807c7a67 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -555,6 +555,7 @@ void SongEditor::updatePosition( const MidiTime & _t ) && m_timeLine->autoScroll() == TimeLineWidget::AutoScrollEnabled) || m_scrollBack == true ) { + m_smoothScroll = ConfigManager::inst()->value( "ui", "smoothscroll" ).toInt(); const int w = width() - widgetWidth - trackOpWidth - contentWidget()->verticalScrollBar()->width(); // width of right scrollbar From 733388a8ff33f93a1756815d19411e5cddb12fc5 Mon Sep 17 00:00:00 2001 From: M374LX Date: Tue, 10 Mar 2015 22:45:54 -0300 Subject: [PATCH 123/133] Fix piano roll select and move issue --- src/gui/editors/PianoRoll.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index c235fa8b4..3184fa44f 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -862,6 +862,8 @@ void PianoRoll::shiftPos( int amount ) //shift notes pos by amount } } + m_pattern->rearrangeAllNotes(); + // we modified the song update(); gui->songEditor()->update(); From a4ab8c1cdadda23b3119f127dcdfd9bef086c426 Mon Sep 17 00:00:00 2001 From: "Raine M. Ekman" Date: Wed, 11 Mar 2015 10:11:57 +0200 Subject: [PATCH 124/133] Tripleoscillator: Change "what's this" text for CRS knob to be in line with reality. --- plugins/triple_oscillator/TripleOscillator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/triple_oscillator/TripleOscillator.cpp b/plugins/triple_oscillator/TripleOscillator.cpp index cdb35606c..b984d10da 100644 --- a/plugins/triple_oscillator/TripleOscillator.cpp +++ b/plugins/triple_oscillator/TripleOscillator.cpp @@ -581,7 +581,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument, ck->setWhatsThis( tr( "With this knob you can set the coarse detuning of " "oscillator %1. You can detune the oscillator " - "12 semitones (1 octave) up and down. This is " + "24 semitones (2 octaves) up and down. This is " "useful for creating sounds with a chord." ). arg( i + 1 ) ); From 07a099a0db57b274ba3085d7bb1959344f40a005 Mon Sep 17 00:00:00 2001 From: "Raine M. Ekman" Date: Wed, 11 Mar 2015 15:42:43 +0200 Subject: [PATCH 125/133] Language update --- data/locale/ca.ts | 2 +- data/locale/cs.ts | 2 +- data/locale/de.ts | 2 +- data/locale/en.ts | 2 +- data/locale/es.ts | 2 +- data/locale/fa.ts | 2 +- data/locale/fr.ts | 2 +- data/locale/gl.ts | 2 +- data/locale/it.ts | 2 +- data/locale/ja.ts | 2 +- data/locale/ko.ts | 2 +- data/locale/nl.ts | 2 +- data/locale/pl.ts | 2 +- data/locale/pt.ts | 2 +- data/locale/ru.ts | 2 +- data/locale/sv.ts | 2 +- data/locale/zh.ts | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/data/locale/ca.ts b/data/locale/ca.ts index 90893329e..b4d143d4d 100644 --- a/data/locale/ca.ts +++ b/data/locale/ca.ts @@ -6155,7 +6155,7 @@ Per favor, assegura't que tens permís de lectura per al fitxer i el direct semitons - With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 12 semitones (1 octave) up and down. This is useful for creating sounds with a chord. + With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 24 semitones (2 octaves) up and down. This is useful for creating sounds with a chord. Amb aquesta roda pots ajustar el desafinament gruixut de l'oscil·lador %1. Pots desafinar l'oscil·lador 12 semitons (1 octava) cap a dalt i a baix. Això és útil per a crear sons amb un acord. diff --git a/data/locale/cs.ts b/data/locale/cs.ts index f8504641c..b0381f897 100644 --- a/data/locale/cs.ts +++ b/data/locale/cs.ts @@ -6157,7 +6157,7 @@ Přesvědčte se prosím, že máte právo ke čtení tohoto souboru a příslu - With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 12 semitones (1 octave) up and down. This is useful for creating sounds with a chord. + With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 24 semitones (2 octaves) up and down. This is useful for creating sounds with a chord. diff --git a/data/locale/de.ts b/data/locale/de.ts index 7ea9b3f8b..92d7f3945 100644 --- a/data/locale/de.ts +++ b/data/locale/de.ts @@ -6193,7 +6193,7 @@ Bitte stellen Sie sicher, dass Sie Leserechte auf diese Datei sowie das Verzeich Halbtöne - With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 12 semitones (1 octave) up and down. This is useful for creating sounds with a chord. + With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 24 semitones (2 octaves) up and down. This is useful for creating sounds with a chord. Mit diesem Regler können Sie die grobe Verstimmung von Oszillator %1 setzen. Sie können den Oszillator 12 Halbtöne (1 Oktave) nach oben und unten verstimmen. Das ist nützlich, wenn Sie einen Sound mit einem Akkord erstellen möchten. diff --git a/data/locale/en.ts b/data/locale/en.ts index c0d553bdb..0c4bae00b 100644 --- a/data/locale/en.ts +++ b/data/locale/en.ts @@ -6144,7 +6144,7 @@ Please make sure you have read-permission to the file and the directory containi - With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 12 semitones (1 octave) up and down. This is useful for creating sounds with a chord. + With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 24 semitones (2 octaves) up and down. This is useful for creating sounds with a chord. diff --git a/data/locale/es.ts b/data/locale/es.ts index 713892a31..39c23530d 100644 --- a/data/locale/es.ts +++ b/data/locale/es.ts @@ -6144,7 +6144,7 @@ Please make sure you have read-permission to the file and the directory containi semitonos - With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 12 semitones (1 octave) up and down. This is useful for creating sounds with a chord. + With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 24 semitones (2 octaves) up and down. This is useful for creating sounds with a chord. Con este control usted podrá establecer la desintonización gruesa del oscilador %1. Usted puede desintonizar el oscilador 12 semitonos (1 octava) arriba y abajo. Esto es útil para la creación de sonidos con acorde. diff --git a/data/locale/fa.ts b/data/locale/fa.ts index a20b0dbef..50d1e790a 100644 --- a/data/locale/fa.ts +++ b/data/locale/fa.ts @@ -6144,7 +6144,7 @@ Please make sure you have read-permission to the file and the directory containi - With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 12 semitones (1 octave) up and down. This is useful for creating sounds with a chord. + With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 24 semitones (2 octaves) up and down. This is useful for creating sounds with a chord. با این دستگیره می توانید کوک زمختی نوسان ساز %1 را تنظیم کنید.شما می توانید کوک نوسان ساز را در ۱۲ نیم صدا (۱ نت) بالا یا پایین کنید. این برای ایجاد صدا به همراه زه (Chord) مفید خواهد بود. diff --git a/data/locale/fr.ts b/data/locale/fr.ts index 5a5dd0bf4..c8dd7361a 100644 --- a/data/locale/fr.ts +++ b/data/locale/fr.ts @@ -6166,7 +6166,7 @@ Veuillez vérifier que vous avez les droits en lecture pour ce fichier et le ré demi-tons - With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 12 semitones (1 octave) up and down. This is useful for creating sounds with a chord. + With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 24 semitones (2 octaves) up and down. This is useful for creating sounds with a chord. Avec ce bouton vous pouvez régler le désaccord grossier de l'oscillateur %1. Vous pouvez désaccorder l'oscillateur de 12 demi-tons (1 octave) vers le haut et vers le bas. Ceci est utile pour la création de sons avec un accord. diff --git a/data/locale/gl.ts b/data/locale/gl.ts index b1e7216ad..e8828ef79 100644 --- a/data/locale/gl.ts +++ b/data/locale/gl.ts @@ -6165,7 +6165,7 @@ Asegúrese de ter permiso de lectura sobre o ficheiro e o directorio que o cont semitóns - With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 12 semitones (1 octave) up and down. This is useful for creating sounds with a chord. + With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 24 semitones (2 octaves) up and down. This is useful for creating sounds with a chord. Con este botón pódese definir a desafinación bruta do oscilador %1. Pódese desafinar o oscilador 12 semitóns (unha oitava) para arriba e para abaixo. Isto é útil para crear sons cun acorde. diff --git a/data/locale/it.ts b/data/locale/it.ts index 08376ac3e..99bc63bf4 100644 --- a/data/locale/it.ts +++ b/data/locale/it.ts @@ -6190,7 +6190,7 @@ Assicurarsi di avere i permessi in lettura per il file e per la directory che lo semitoni - With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 12 semitones (1 octave) up and down. This is useful for creating sounds with a chord. + With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 24 semitones (2 octaves) up and down. This is useful for creating sounds with a chord. Questa manopola regola l'intonazione, con la precisione di 1 semitono, dell'oscillatore %1. L'intonazione può essere variata di 24 semitoni (due ottave) in positivo e in negativo. Può essere usata per creare suoni con un accordo. diff --git a/data/locale/ja.ts b/data/locale/ja.ts index 8bcf4c5f0..2aa1b1e50 100644 --- a/data/locale/ja.ts +++ b/data/locale/ja.ts @@ -6169,7 +6169,7 @@ Please make sure you have read-permission to the file and the directory containi - With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 12 semitones (1 octave) up and down. This is useful for creating sounds with a chord. + With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 24 semitones (2 octaves) up and down. This is useful for creating sounds with a chord. diff --git a/data/locale/ko.ts b/data/locale/ko.ts index 27f7a9044..aea6c5611 100644 --- a/data/locale/ko.ts +++ b/data/locale/ko.ts @@ -6149,7 +6149,7 @@ Please make sure you have read-permission to the file and the directory containi - With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 12 semitones (1 octave) up and down. This is useful for creating sounds with a chord. + With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 24 semitones (2 octaves) up and down. This is useful for creating sounds with a chord. diff --git a/data/locale/nl.ts b/data/locale/nl.ts index 1d3ff74e2..8219d7e7c 100644 --- a/data/locale/nl.ts +++ b/data/locale/nl.ts @@ -6148,7 +6148,7 @@ Zorg ervoor dat je schrijf-bevoegdheid hebt voor deze bestanden en mapen en prob semitonen - With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 12 semitones (1 octave) up and down. This is useful for creating sounds with a chord. + With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 24 semitones (2 octaves) up and down. This is useful for creating sounds with a chord. Met deze knop stel je de grove ontstemming van oscillator %1 in. Je kunt de oscillator 12 seminote (1oktaaf) naar boven of beneden ontstemmen.Dit is bruikbaar voor het maken van geluiden met een akkoord. diff --git a/data/locale/pl.ts b/data/locale/pl.ts index 8a1ab0103..e9e1daad2 100644 --- a/data/locale/pl.ts +++ b/data/locale/pl.ts @@ -6171,7 +6171,7 @@ Upewnij się, że masz uprawnienia do odczytu tego pliku i katalogu zawierające półtony - With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 12 semitones (1 octave) up and down. This is useful for creating sounds with a chord. + With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 24 semitones (2 octaves) up and down. This is useful for creating sounds with a chord. Za pomocą tego pokrętła możesz ustawić zgrubne odstrojenie oscylatora %1. Możesz odstrajać oscylator o 12 półtonów (całą oktawę) w górę lub w dół. diff --git a/data/locale/pt.ts b/data/locale/pt.ts index 8e5ee5a53..52d8c9fc5 100644 --- a/data/locale/pt.ts +++ b/data/locale/pt.ts @@ -6121,7 +6121,7 @@ Por favor certifique-se que você tem permissões de leitura para o arquivo e pa Ajuste fino esquerdo Osc %1: - With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 12 semitones (1 octave) up and down. This is useful for creating sounds with a chord. + With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 24 semitones (2 octaves) up and down. This is useful for creating sounds with a chord. Com este botão você pode modificar Ajuste bruto do oscilador %1. Você pode descer o tom do oscilador 12 semitons (1 oitava) para cima e para baixo. Isto é útil para criar sons com um acorde. diff --git a/data/locale/ru.ts b/data/locale/ru.ts index 03bd19f1f..30da19d05 100644 --- a/data/locale/ru.ts +++ b/data/locale/ru.ts @@ -6222,7 +6222,7 @@ Please make sure you have read-permission to the file and the directory containi полутон[а,ов] - With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 12 semitones (1 octave) up and down. This is useful for creating sounds with a chord. + With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 24 semitones (2 octaves) up and down. This is useful for creating sounds with a chord. Грубая регулировка подстройки осциллятора %1. Возможна подстройка до 12 полутонов (до одной октавы) вверх и вниз. Полезно для создания аккордов. diff --git a/data/locale/sv.ts b/data/locale/sv.ts index cae965bd7..632307fa6 100644 --- a/data/locale/sv.ts +++ b/data/locale/sv.ts @@ -6147,7 +6147,7 @@ Se till att du har läsningsrättigheter för filen och katalogen som innehålle - With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 12 semitones (1 octave) up and down. This is useful for creating sounds with a chord. + With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 24 semitones (2 octaves) up and down. This is useful for creating sounds with a chord. diff --git a/data/locale/zh.ts b/data/locale/zh.ts index c0c0c572e..07c696fb2 100644 --- a/data/locale/zh.ts +++ b/data/locale/zh.ts @@ -6159,7 +6159,7 @@ Please make sure you have read-permission to the file and the directory containi - With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 12 semitones (1 octave) up and down. This is useful for creating sounds with a chord. + With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 24 semitones (2 octaves) up and down. This is useful for creating sounds with a chord. From 881f0088960fad5e0003954a0ba98c9f0342343b Mon Sep 17 00:00:00 2001 From: "Raine M. Ekman" Date: Wed, 11 Mar 2015 22:03:12 +0200 Subject: [PATCH 126/133] Crude translations for the CRS knob in Triple Oscillator. --- data/locale/ca.ts | 2 +- data/locale/de.ts | 2 +- data/locale/es.ts | 2 +- data/locale/fr.ts | 2 +- data/locale/gl.ts | 2 +- data/locale/nl.ts | 2 +- data/locale/pl.ts | 2 +- data/locale/pt.ts | 2 +- data/locale/ru.ts | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/data/locale/ca.ts b/data/locale/ca.ts index b4d143d4d..edc368108 100644 --- a/data/locale/ca.ts +++ b/data/locale/ca.ts @@ -6156,7 +6156,7 @@ Per favor, assegura't que tens permís de lectura per al fitxer i el direct With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 24 semitones (2 octaves) up and down. This is useful for creating sounds with a chord. - Amb aquesta roda pots ajustar el desafinament gruixut de l'oscil·lador %1. Pots desafinar l'oscil·lador 12 semitons (1 octava) cap a dalt i a baix. Això és útil per a crear sons amb un acord. + Amb aquesta roda pots ajustar el desafinament gruixut de l'oscil·lador %1. Pots desafinar l'oscil·lador 24 semitons (1 octavaes) cap a dalt i a baix. Això és útil per a crear sons amb un acord. Osc %1 fine detuning left: diff --git a/data/locale/de.ts b/data/locale/de.ts index 92d7f3945..090e2bc79 100644 --- a/data/locale/de.ts +++ b/data/locale/de.ts @@ -6194,7 +6194,7 @@ Bitte stellen Sie sicher, dass Sie Leserechte auf diese Datei sowie das Verzeich With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 24 semitones (2 octaves) up and down. This is useful for creating sounds with a chord. - Mit diesem Regler können Sie die grobe Verstimmung von Oszillator %1 setzen. Sie können den Oszillator 12 Halbtöne (1 Oktave) nach oben und unten verstimmen. Das ist nützlich, wenn Sie einen Sound mit einem Akkord erstellen möchten. + Mit diesem Regler können Sie die grobe Verstimmung von Oszillator %1 setzen. Sie können den Oszillator 24 Halbtöne (2 Oktaven) nach oben und unten verstimmen. Das ist nützlich, wenn Sie einen Sound mit einem Akkord erstellen möchten. Osc %1 fine detuning left: diff --git a/data/locale/es.ts b/data/locale/es.ts index 39c23530d..3ba7312a3 100644 --- a/data/locale/es.ts +++ b/data/locale/es.ts @@ -6145,7 +6145,7 @@ Please make sure you have read-permission to the file and the directory containi With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 24 semitones (2 octaves) up and down. This is useful for creating sounds with a chord. - Con este control usted podrá establecer la desintonización gruesa del oscilador %1. Usted puede desintonizar el oscilador 12 semitonos (1 octava) arriba y abajo. Esto es útil para la creación de sonidos con acorde. + Con este control usted podrá establecer la desintonización gruesa del oscilador %1. Usted puede desintonizar el oscilador 24 semitonos (2 octavas) arriba y abajo. Esto es útil para la creación de sonidos con acorde. Osc %1 fine detuning left: diff --git a/data/locale/fr.ts b/data/locale/fr.ts index c8dd7361a..6a3b0d36e 100644 --- a/data/locale/fr.ts +++ b/data/locale/fr.ts @@ -6167,7 +6167,7 @@ Veuillez vérifier que vous avez les droits en lecture pour ce fichier et le ré With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 24 semitones (2 octaves) up and down. This is useful for creating sounds with a chord. - Avec ce bouton vous pouvez régler le désaccord grossier de l'oscillateur %1. Vous pouvez désaccorder l'oscillateur de 12 demi-tons (1 octave) vers le haut et vers le bas. Ceci est utile pour la création de sons avec un accord. + Avec ce bouton vous pouvez régler le désaccord grossier de l'oscillateur %1. Vous pouvez désaccorder l'oscillateur de 24 demi-tons (2 octaves) vers le haut et vers le bas. Ceci est utile pour la création de sons avec un accord. Osc %1 fine detuning left: diff --git a/data/locale/gl.ts b/data/locale/gl.ts index e8828ef79..98c130485 100644 --- a/data/locale/gl.ts +++ b/data/locale/gl.ts @@ -6166,7 +6166,7 @@ Asegúrese de ter permiso de lectura sobre o ficheiro e o directorio que o cont With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 24 semitones (2 octaves) up and down. This is useful for creating sounds with a chord. - Con este botón pódese definir a desafinación bruta do oscilador %1. Pódese desafinar o oscilador 12 semitóns (unha oitava) para arriba e para abaixo. Isto é útil para crear sons cun acorde. + Con este botón pódese definir a desafinación bruta do oscilador %1. Pódese desafinar o oscilador 24 semitóns (2 oitavas) para arriba e para abaixo. Isto é útil para crear sons cun acorde. Osc %1 fine detuning left: diff --git a/data/locale/nl.ts b/data/locale/nl.ts index 8219d7e7c..2b4416f46 100644 --- a/data/locale/nl.ts +++ b/data/locale/nl.ts @@ -6149,7 +6149,7 @@ Zorg ervoor dat je schrijf-bevoegdheid hebt voor deze bestanden en mapen en prob With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 24 semitones (2 octaves) up and down. This is useful for creating sounds with a chord. - Met deze knop stel je de grove ontstemming van oscillator %1 in. Je kunt de oscillator 12 seminote (1oktaaf) naar boven of beneden ontstemmen.Dit is bruikbaar voor het maken van geluiden met een akkoord. + Met deze knop stel je de grove ontstemming van oscillator %1 in. Je kunt de oscillator 24 seminote (2 oktaven) naar boven of beneden ontstemmen.Dit is bruikbaar voor het maken van geluiden met een akkoord. Osc %1 fine detuning left: diff --git a/data/locale/pl.ts b/data/locale/pl.ts index e9e1daad2..60a86b97c 100644 --- a/data/locale/pl.ts +++ b/data/locale/pl.ts @@ -6172,7 +6172,7 @@ Upewnij się, że masz uprawnienia do odczytu tego pliku i katalogu zawierające With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 24 semitones (2 octaves) up and down. This is useful for creating sounds with a chord. - Za pomocą tego pokrętła możesz ustawić zgrubne odstrojenie oscylatora %1. Możesz odstrajać oscylator o 12 półtonów (całą oktawę) w górę lub w dół. + Za pomocą tego pokrętła możesz ustawić zgrubne odstrojenie oscylatora %1. Możesz odstrajać oscylator o 24 półtonów (dwie oktawy) w górę lub w dół. Osc %1 fine detuning left: diff --git a/data/locale/pt.ts b/data/locale/pt.ts index 52d8c9fc5..b797a15d5 100644 --- a/data/locale/pt.ts +++ b/data/locale/pt.ts @@ -6122,7 +6122,7 @@ Por favor certifique-se que você tem permissões de leitura para o arquivo e pa With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 24 semitones (2 octaves) up and down. This is useful for creating sounds with a chord. - Com este botão você pode modificar Ajuste bruto do oscilador %1. Você pode descer o tom do oscilador 12 semitons (1 oitava) para cima e para baixo. Isto é útil para criar sons com um acorde. + Com este botão você pode modificar Ajuste bruto do oscilador %1. Você pode descer o tom do oscilador 24 semitons (2 oitavas) para cima e para baixo. Isto é útil para criar sons com um acorde. Use phase modulation for modulating oscillator 3 with oscillator 2 diff --git a/data/locale/ru.ts b/data/locale/ru.ts index 30da19d05..8d8fe034b 100644 --- a/data/locale/ru.ts +++ b/data/locale/ru.ts @@ -6223,7 +6223,7 @@ Please make sure you have read-permission to the file and the directory containi With this knob you can set the coarse detuning of oscillator %1. You can detune the oscillator 24 semitones (2 octaves) up and down. This is useful for creating sounds with a chord. - Грубая регулировка подстройки осциллятора %1. Возможна подстройка до 12 полутонов (до одной октавы) вверх и вниз. Полезно для создания аккордов. + Грубая регулировка подстройки осциллятора %1. Возможна подстройка до 24 полутонов (до 2 октавы) вверх и вниз. Полезно для создания аккордов. Osc %1 fine detuning left: From ca414dab10445809a3f25324e113dbaa551f8ae1 Mon Sep 17 00:00:00 2001 From: Dave French Date: Mon, 9 Mar 2015 17:23:22 +0000 Subject: [PATCH 127/133] Added option to duplicate first bar, in BBEditor Added a new button to the action bar, using step_btn_duplicate.png The new button, aswell as adding a bar to the patten, then copies the first bar to the last. fixes #457 BBEditor Duplicate Pattern. updated image, changed function name Have updated the new image step_button_duplicate.png Renamed the function from duplicateFirstBarAtEnd to duplicateSteps. BBEditor renamed function duplicateSteps renamed duplicateSteps() to cloneSteps() as requested BBEditor rechange duplicateSteps to cloneSteps BB Editor changed actionBtn text from duplicate to clone --- data/themes/default/step_btn_duplicate.png | Bin 0 -> 544 bytes include/BBEditor.h | 2 + include/Pattern.h | 1 + src/gui/editors/BBEditor.cpp | 43 +++++++++++++++------ src/tracks/Pattern.cpp | 23 +++++++++++ 5 files changed, 58 insertions(+), 11 deletions(-) create mode 100644 data/themes/default/step_btn_duplicate.png diff --git a/data/themes/default/step_btn_duplicate.png b/data/themes/default/step_btn_duplicate.png new file mode 100644 index 0000000000000000000000000000000000000000..af9521fad20c4285888f1a1d4a5e98744850dd32 GIT binary patch literal 544 zcmV+*0^j|KP)ymGz!Jxtq>LEyKHWFPxJ`R4a~`Mzfr3Wd`k2ow=nxQR)U zM22B_Af;Sqc|j0Rar@IF+(ELrG0Np~EKj6qiu*9efa?ik3`^vCtO?UJ1=kZqbgxK6 z;Cif;C+l!{_zC|@pfLtq@4;&$IdveSX>B@3P5k_@1(J_LZBBqA2_vMbY8dX;|PQtk`+Fq@addAction(embed::getIconPixmap("step_btn_remove"), tr("Remove steps"), m_trackContainerView, SLOT(removeSteps())); m_toolBar->addAction(embed::getIconPixmap("step_btn_add"), tr("Add steps"), - m_trackContainerView, SLOT(addSteps())); + m_trackContainerView, SLOT( addSteps())); + m_toolBar->addAction( embed::getIconPixmap( "step_btn_duplicate" ), tr( "Clone Steps" ), + m_trackContainerView, SLOT( cloneSteps() ) ); m_toolBar->addSeparator(); connect( &tc->m_bbComboBoxModel, SIGNAL( dataChanged() ), @@ -170,17 +172,12 @@ BBTrackContainerView::BBTrackContainerView(BBTrackContainer* tc) : void BBTrackContainerView::addSteps() { - TrackContainer::TrackList tl = model()->tracks(); + makeSteps( false ); +} - for( TrackContainer::TrackList::iterator it = tl.begin(); - it != tl.end(); ++it ) - { - if( ( *it )->type() == Track::InstrumentTrack ) - { - Pattern* p = static_cast( ( *it )->getTCO( m_bbtc->currentBB() ) ); - p->addSteps(); - } - } +void BBTrackContainerView::cloneSteps() +{ + makeSteps( true ); } @@ -264,3 +261,27 @@ void BBTrackContainerView::updatePosition() //realignTracks(); emit positionChanged( m_currentPosition ); } + + + + +void BBTrackContainerView::makeSteps( bool clone ) +{ + TrackContainer::TrackList tl = model()->tracks(); + + for( TrackContainer::TrackList::iterator it = tl.begin(); + it != tl.end(); ++it ) + { + if( ( *it )->type() == Track::InstrumentTrack ) + { + Pattern* p = static_cast( ( *it )->getTCO( m_bbtc->currentBB() ) ); + if( clone ) + { + p->cloneSteps(); + } else + { + p->addSteps(); + } + } + } +} diff --git a/src/tracks/Pattern.cpp b/src/tracks/Pattern.cpp index cea27895a..e9ba69d9f 100644 --- a/src/tracks/Pattern.cpp +++ b/src/tracks/Pattern.cpp @@ -478,6 +478,29 @@ void Pattern::addSteps() updateBBTrack(); } +void Pattern::cloneSteps() +{ + int oldLength = m_steps; + m_steps += MidiTime::stepsPerTact(); + ensureBeatNotes(); + for(int i = 0; i < MidiTime::stepsPerTact(); ++i ) + { + Note *toCopy = noteAtStep( i ); + if( toCopy ) + { + setStep( oldLength + i, true ); + Note *newNote = noteAtStep( oldLength + i ); + newNote->setKey( toCopy->key() ); + newNote->setLength( toCopy->length() ); + newNote->setPanning( toCopy->getPanning() ); + newNote->setVolume( toCopy->getVolume() ); + } + } + ensureBeatNotes(); + emit dataChanged(); + updateBBTrack(); +} + From da9e88e48804c47a0b6c9551e9ac1498e8a3d3ee Mon Sep 17 00:00:00 2001 From: M374LX Date: Wed, 11 Mar 2015 22:01:18 -0300 Subject: [PATCH 128/133] Fix song editor pattern update bug --- src/gui/editors/PianoRoll.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 3184fa44f..4b5f6cd74 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -863,6 +863,7 @@ void PianoRoll::shiftPos( int amount ) //shift notes pos by amount } m_pattern->rearrangeAllNotes(); + m_pattern->dataChanged(); // we modified the song update(); From 9a8700cfaebd428b428d3c6c8ad3bc9929f83b6f Mon Sep 17 00:00:00 2001 From: M374LX Date: Thu, 12 Mar 2015 23:11:21 -0300 Subject: [PATCH 129/133] Use the word "template" instead of "project" when appropriate --- src/core/DataFile.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index 15fa5abde..ccd5d07c0 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -856,9 +856,12 @@ void DataFile::loadData( const QByteArray & _data, const QString & _sourceFile ) QMessageBox::information( NULL, SongEditor::tr( "Project Version Mismatch" ), SongEditor::tr( - "This project was created with " - "LMMS version %1, but version %2 " + "This %1 was created with " + "LMMS version %2, but version %3 " "is installed") + .arg( _sourceFile.endsWith( ".mpt" ) ? + "template" : + "project" ) .arg( root.attribute( "creatorversion" ) ) .arg( LMMS_VERSION ) ); } From 693ffb586f58d6af399debcfed2b377e46292432 Mon Sep 17 00:00:00 2001 From: M374LX Date: Fri, 13 Mar 2015 00:12:51 -0300 Subject: [PATCH 130/133] Fix segfault --- src/gui/SetupDialog.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/gui/SetupDialog.cpp b/src/gui/SetupDialog.cpp index 964e357d0..91984f696 100644 --- a/src/gui/SetupDialog.cpp +++ b/src/gui/SetupDialog.cpp @@ -688,6 +688,12 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : QString audioDevName = ConfigManager::inst()->value( "mixer", "audiodev" ); + if( audioDevName.length() == 0 ) + { + audioDevName = Engine::mixer()->audioDevName(); + ConfigManager::inst()->setValue( + "mixer", "audiodev", audioDevName ); + } m_audioInterfaces-> setCurrentIndex( m_audioInterfaces->findText( audioDevName ) ); m_audioIfaceSetupWidgets[audioDevName]->show(); @@ -771,6 +777,12 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : QString midiDevName = ConfigManager::inst()->value( "mixer", "mididev" ); + if( midiDevName.length() == 0 ) + { + midiDevName = Engine::mixer()->midiClientName(); + ConfigManager::inst()->setValue( + "mixer", "mididev", midiDevName ); + } m_midiInterfaces->setCurrentIndex( m_midiInterfaces->findText( midiDevName ) ); m_midiIfaceSetupWidgets[midiDevName]->show(); From c747c7a9ee6d69205e0b0df9c8805cda0eb5ed63 Mon Sep 17 00:00:00 2001 From: Dave French Date: Mon, 16 Mar 2015 06:57:12 +0000 Subject: [PATCH 131/133] BassBoost, seperated sample exact and regular process loops This was done to increase performance when sample exactness is not in use. This was a consern becasue of the 2 extra function calls each frame introduced with SA. --- plugins/BassBooster/BassBooster.cpp | 33 +++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/plugins/BassBooster/BassBooster.cpp b/plugins/BassBooster/BassBooster.cpp index d75c7c5c8..54fa9e98e 100644 --- a/plugins/BassBooster/BassBooster.cpp +++ b/plugins/BassBooster/BassBooster.cpp @@ -91,18 +91,37 @@ bool BassBoosterEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames double outSum = 0.0; const float d = dryLevel(); const float w = wetLevel(); - for( fpp_t f = 0; f < frames; ++f ) + if( gainBuffer ) { + //process period using sample exact data + for( fpp_t f = 0; f < frames; ++f ) + { + m_bbFX.leftFX().setGain( *gainPtr ); + m_bbFX.rightFX().setGain( *gainPtr ); + outSum += buf[f][0]*buf[f][0] + buf[f][1]*buf[f][1]; + + sample_t s[2] = { buf[f][0], buf[f][1] }; + m_bbFX.nextSample( s[0], s[1] ); + + buf[f][0] = d * buf[f][0] + w * s[0]; + buf[f][1] = d * buf[f][1] + w * s[1]; + gainPtr += gainInc; + } + } else + { + //process period without sample exact data m_bbFX.leftFX().setGain( *gainPtr ); m_bbFX.rightFX().setGain( *gainPtr ); - outSum += buf[f][0]*buf[f][0] + buf[f][1]*buf[f][1]; + for( fpp_t f = 0; f < frames; ++f ) + { + outSum += buf[f][0]*buf[f][0] + buf[f][1]*buf[f][1]; - sample_t s[2] = { buf[f][0], buf[f][1] }; - m_bbFX.nextSample( s[0], s[1] ); + sample_t s[2] = { buf[f][0], buf[f][1] }; + m_bbFX.nextSample( s[0], s[1] ); - buf[f][0] = d * buf[f][0] + w * s[0]; - buf[f][1] = d * buf[f][1] + w * s[1]; - gainPtr += gainInc; + buf[f][0] = d * buf[f][0] + w * s[0]; + buf[f][1] = d * buf[f][1] + w * s[1]; + } } checkGate( outSum / frames ); From 0f864682ff3b8b1737821294bd03e3f580954ff5 Mon Sep 17 00:00:00 2001 From: Dave French Date: Mon, 16 Mar 2015 15:52:33 +0000 Subject: [PATCH 132/133] Equalizer refactored EqFilter to remove tick() removed the tick() function, and replaced the invoking code with direct calls to update(). fixed a bug, where the low shelf bandwidth was getting the incorrect data. --- plugins/Eq/EqEffect.cpp | 44 +++++++++++++++++++++++++++-------------- plugins/Eq/EqFilter.h | 19 ------------------ 2 files changed, 29 insertions(+), 34 deletions(-) diff --git a/plugins/Eq/EqEffect.cpp b/plugins/Eq/EqEffect.cpp index e42460ae6..01830ce10 100644 --- a/plugins/Eq/EqEffect.cpp +++ b/plugins/Eq/EqEffect.cpp @@ -127,7 +127,7 @@ bool EqEffect::processAudioBuffer(sampleFrame *buf, const fpp_t frames) int lpFreqInc = lpFreqBuffer ? 1 : 0; float *hpResPtr = hpResBuffer ? &( hpResBuffer->values()[ 0 ] ) : &hpRes; - float *lowShelfResPtr = lowShelfFreqBuffer ? &( lowShelfFreqBuffer->values()[ 0 ] ) : &lowShelfRes; + float *lowShelfResPtr = lowShelfResBuffer ? &( lowShelfResBuffer->values()[ 0 ] ) : &lowShelfRes; float *para1BwPtr = para1BwBuffer ? &( para1BwBuffer->values()[ 0 ] ) : ¶1Bw; float *para2BwPtr = para2BwBuffer ? &( para2BwBuffer->values()[ 0 ] ) : ¶2Bw; float *para3BwPtr = para3BwBuffer ? &( para3BwBuffer->values()[ 0 ] ) : ¶3Bw; @@ -205,77 +205,91 @@ bool EqEffect::processAudioBuffer(sampleFrame *buf, const fpp_t frames) if( hpActive ){ m_hp12.setParameters( sampleRate, *hpFreqPtr, *hpResPtr, 1 ); - m_hp12.tick( &buf[ f ] ); + buf[f][0] = m_hp12.update( buf[f][0], 0 ); + buf[f][1] = m_hp12.update( buf[f][1], 1 ); if( hp24Active || hp48Active ) { m_hp24.setParameters( sampleRate, *hpFreqPtr, *hpResPtr, 1 ); - m_hp24.tick( &buf[ f ] ); + buf[f][0] = m_hp24.update( buf[f][0], 0 ); + buf[f][1] = m_hp24.update( buf[f][1], 1 ); } if( hp48Active ) { m_hp480.setParameters( sampleRate, *hpFreqPtr, *hpResPtr, 1 ); - m_hp480.tick( &buf[ f ] ); + buf[f][0] = m_hp480.update( buf[f][0], 0 ); + buf[f][1] = m_hp480.update( buf[f][1], 1 ); m_hp481.setParameters( sampleRate, *hpFreqPtr, *hpResPtr, 1 ); - m_hp481.tick( &buf[ f ] ); + buf[f][0] = m_hp481.update( buf[f][0], 0 ); + buf[f][1] = m_hp481.update( buf[f][1], 1 ); } } if( lowShelfActive ) { m_lowShelf.setParameters( sampleRate, *lowShelfFreqPtr, *lowShelfResPtr, lowShelfGain ); - m_lowShelf.tick( &buf[ f ] ); + buf[f][0] = m_lowShelf.update( buf[f][0], 0 ); + buf[f][1] = m_lowShelf.update( buf[f][1], 1 ); } if( para1Active ) { m_para1.setParameters( sampleRate, *para1FreqPtr, *para1BwPtr, para1Gain ); - m_para1.tick( &buf[ f ] ); + buf[f][0] = m_para1.update( buf[f][0], 0 ); + buf[f][1] = m_para1.update( buf[f][1], 1 ); } if( para2Active ) { m_para2.setParameters( sampleRate, *para2FreqPtr, *para2BwPtr, para2Gain ); - m_para2.tick( &buf[ f ] ); + buf[f][0] = m_para2.update( buf[f][0], 0 ); + buf[f][1] = m_para2.update( buf[f][1], 1 ); } if( para3Active ) { m_para3.setParameters( sampleRate, *para3FreqPtr, *para3BwPtr, para3Gain ); - m_para3.tick( &buf[ f ] ); + buf[f][0] = m_para3.update( buf[f][0], 0 ); + buf[f][1] = m_para3.update( buf[f][1], 1 ); } if( para4Active ) { m_para4.setParameters( sampleRate, *para4FreqPtr, *para4BwPtr, para4Gain ); - m_para4.tick( &buf[ f ] ); + buf[f][0] = m_para4.update( buf[f][0], 0 ); + buf[f][1] = m_para4.update( buf[f][1], 1 ); } if( highShelfActive ) { m_highShelf.setParameters( sampleRate, *hightShelfFreqPtr, *highShelfResPtr, highShelfGain ); - m_highShelf.tick( &buf[ f ] ); + buf[f][0] = m_highShelf.update( buf[f][0], 0 ); + buf[f][1] = m_highShelf.update( buf[f][1], 1 ); } if( lpActive ){ m_lp12.setParameters( sampleRate, *lpFreqPtr, *lpResPtr, 1 ); - m_lp12.tick( &buf[ f ] ); + buf[f][0] = m_lp12.update( buf[f][0], 0 ); + buf[f][1] = m_lp12.update( buf[f][1], 1 ); if( lp24Active || lp48Active ) { m_lp24.setParameters( sampleRate, *lpFreqPtr, *lpResPtr, 1 ); - m_lp24.tick( &buf[ f ] ); + buf[f][0] = m_lp24.update( buf[f][0], 0 ); + buf[f][1] = m_lp24.update( buf[f][1], 1 ); } if( lp48Active ) { m_lp480.setParameters( sampleRate, *lpFreqPtr, *lpResPtr, 1 ); - m_lp480.tick( &buf[ f ] ); + buf[f][0] = m_lp480.update( buf[f][0], 0 ); + buf[f][1] = m_lp480.update( buf[f][1], 1 ); m_lp481.setParameters( sampleRate, *lpFreqPtr, *lpResPtr, 1 ); - m_lp481.tick( &buf[ f ] ); + buf[f][0] = m_lp481.update( buf[f][0], 0 ); + buf[f][1] = m_lp481.update( buf[f][1], 1 ); } } diff --git a/plugins/Eq/EqFilter.h b/plugins/Eq/EqFilter.h index 9e608d5e7..37cef312d 100644 --- a/plugins/Eq/EqFilter.h +++ b/plugins/Eq/EqFilter.h @@ -122,25 +122,6 @@ public: - /// - /// \brief processBuffer - /// \param buf Audio Buffer - /// \param frames Count of sampleFrames in Audio Buffer - /// - virtual void processBuffer( sampleFrame* buf, const fpp_t frames ) - { - for ( fpp_t f = 0 ; f < frames ; ++f) - { - buf[f][0] = update( buf[f][0] , 0); - buf[f][1] = update( buf[f][1] , 1); - } - } - - virtual void tick( sampleFrame *frame ) - { - frame[0][0] = update( frame[0][0], 0); - frame[0][1] = update( frame[0][1], 1); - } protected: /// From e00241ff5dbca71f6e025530f17609c207433c5d Mon Sep 17 00:00:00 2001 From: Dave French Date: Thu, 19 Mar 2015 13:03:03 +0000 Subject: [PATCH 133/133] FileBrowser, revert to not loading xiz files into DataFile xiz files are again, correctly not passed into a DataFile. DataFile is for LMMS xml files. --- src/gui/FileBrowser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index 6ea9d5134..033a5982f 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -458,6 +458,10 @@ void FileBrowserTreeWidget::mousePressEvent(QMouseEvent * me ) m_previewPlayHandle = s; delete tf; } + else if( f->extension ()== "xiz" && Engine::pluginFileHandling().contains( f->extension() ) ) + { + m_previewPlayHandle = new PresetPreviewPlayHandle( f->fullName(), f->handling() == FileItem::LoadByPlugin ); + } else if( f->type() != FileItem::VstPluginFile && ( f->handling() == FileItem::LoadAsPreset || f->handling() == FileItem::LoadByPlugin ) )