"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/gui/TrackContainerView.cpp" between
lmms_1.2.0.tar.xz and lmms_1.2.1.tar.xz

About: LMMS (Linux MultiMedia Studio) is a sound generation system (creation of melodies and beats, synthesis and mixing of sounds, arranging of samples; full MIDI support).

TrackContainerView.cpp  (lmms_1.2.0.tar.xz):TrackContainerView.cpp  (lmms_1.2.1.tar.xz)
skipping to change at line 58 skipping to change at line 58
TrackContainerView::TrackContainerView( TrackContainer * _tc ) : TrackContainerView::TrackContainerView( TrackContainer * _tc ) :
QWidget(), QWidget(),
ModelView( NULL, this ), ModelView( NULL, this ),
JournallingObject(), JournallingObject(),
SerializingObjectHook(), SerializingObjectHook(),
m_currentPosition( 0, 0 ), m_currentPosition( 0, 0 ),
m_tc( _tc ), m_tc( _tc ),
m_trackViews(), m_trackViews(),
m_scrollArea( new scrollArea( this ) ), m_scrollArea( new scrollArea( this ) ),
m_ppt( DEFAULT_PIXELS_PER_TACT ), m_ppt( DEFAULT_PIXELS_PER_TACT ),
m_rubberBand( new RubberBand( m_scrollArea ) ), m_rubberBand( new RubberBand( m_scrollArea ) )
m_origin()
{ {
m_tc->setHook( this ); m_tc->setHook( this );
//keeps the direction of the widget, undepended on the locale //keeps the direction of the widget, undepended on the locale
setLayoutDirection( Qt::LeftToRight ); setLayoutDirection( Qt::LeftToRight );
QVBoxLayout * layout = new QVBoxLayout( this ); QVBoxLayout * layout = new QVBoxLayout( this );
layout->setMargin( 0 ); layout->setMargin( 0 );
layout->setSpacing( 0 ); layout->setSpacing( 0 );
layout->addWidget( m_scrollArea ); layout->addWidget( m_scrollArea );
QWidget * scrollContent = new QWidget; QWidget * scrollContent = new QWidget;
skipping to change at line 300 skipping to change at line 299
void TrackContainerView::dragEnterEvent( QDragEnterEvent * _dee ) void TrackContainerView::dragEnterEvent( QDragEnterEvent * _dee )
{ {
StringPairDrag::processDragEnterEvent( _dee, StringPairDrag::processDragEnterEvent( _dee,
QString( "presetfile,pluginpresetfile,samplefile,instrument," QString( "presetfile,pluginpresetfile,samplefile,instrument,"
"importedproject,soundfontfile,patchfile,vstplugi nfile,projectfile," "importedproject,soundfontfile,patchfile,vstplugi nfile,projectfile,"
"track_%1,track_%2" ). "track_%1,track_%2" ).
arg( Track::InstrumentTrack ). arg( Track::InstrumentTrack ).
arg( Track::SampleTrack ) ); arg( Track::SampleTrack ) );
} }
void TrackContainerView::selectRegionFromPixels(int xStart, int xEnd)
{
m_rubberBand->setEnabled( true );
m_rubberBand->show();
m_rubberBand->setGeometry( min( xStart, xEnd ), 0, max( xStart, xEnd ) -
min( xStart, xEnd ), std::numeric_limits<int>::max() );
}
void TrackContainerView::stopRubberBand() void TrackContainerView::stopRubberBand()
{ {
m_rubberBand->hide(); m_rubberBand->hide();
m_rubberBand->setEnabled( false ); m_rubberBand->setEnabled( false );
} }
void TrackContainerView::dropEvent( QDropEvent * _de ) void TrackContainerView::dropEvent( QDropEvent * _de )
{ {
QString type = StringPairDrag::decodeKey( _de ); QString type = StringPairDrag::decodeKey( _de );
QString value = StringPairDrag::decodeValue( _de ); QString value = StringPairDrag::decodeValue( _de );
skipping to change at line 375 skipping to change at line 367
} }
else if( type.left( 6 ) == "track_" ) else if( type.left( 6 ) == "track_" )
{ {
DataFile dataFile( value.toUtf8() ); DataFile dataFile( value.toUtf8() );
Track::create( dataFile.content().firstChild().toElement(), m_tc ); Track::create( dataFile.content().firstChild().toElement(), m_tc );
_de->accept(); _de->accept();
} }
} }
void TrackContainerView::mousePressEvent( QMouseEvent * _me )
{
if( allowRubberband() == true )
{
m_origin = m_scrollArea->mapFromParent( _me->pos() );
m_rubberBand->setEnabled( true );
m_rubberBand->setGeometry( QRect( m_origin, QSize() ) );
m_rubberBand->show();
}
QWidget::mousePressEvent( _me );
}
void TrackContainerView::mouseMoveEvent( QMouseEvent * _me )
{
if( rubberBandActive() == true )
{
m_rubberBand->setGeometry( QRect( m_origin,
m_scrollArea->mapFromParent( _me->pos() ) ).
normalized() );
}
QWidget::mouseMoveEvent( _me );
}
void TrackContainerView::mouseReleaseEvent( QMouseEvent * _me )
{
m_rubberBand->hide();
m_rubberBand->setEnabled( false );
QWidget::mouseReleaseEvent( _me );
}
void TrackContainerView::resizeEvent( QResizeEvent * _re ) void TrackContainerView::resizeEvent( QResizeEvent * _re )
{ {
realignTracks(); realignTracks();
QWidget::resizeEvent( _re ); QWidget::resizeEvent( _re );
} }
RubberBand *TrackContainerView::rubberBand() const
{
return m_rubberBand;
}
TrackContainerView::scrollArea::scrollArea( TrackContainerView * _parent ) : TrackContainerView::scrollArea::scrollArea( TrackContainerView * _parent ) :
QScrollArea( _parent ), QScrollArea( _parent ),
m_trackContainerView( _parent ) m_trackContainerView( _parent )
{ {
setFrameStyle( QFrame::NoFrame ); setFrameStyle( QFrame::NoFrame );
setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn ); setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn );
} }
TrackContainerView::scrollArea::~scrollArea() TrackContainerView::scrollArea::~scrollArea()
 End of changes. 4 change blocks. 
40 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)