Commit f9a0f5f3 authored by Rohit Yadav's avatar Rohit Yadav

Merge branch 'master' of git.videolan.org:vlmc

parents 41c5709f a87ee053
......@@ -111,7 +111,7 @@ AbstractGraphicsItem::setStartPos( qint64 position )
}
qint64
AbstractGraphicsItem::startPos()
AbstractGraphicsItem::startPos() const
{
return qRound64( QGraphicsItem::pos().x() );
}
......
......@@ -88,7 +88,7 @@ class AbstractGraphicsItem : public QObject, public QGraphicsItem
virtual void setStartPos( qint64 position );
/// Return the position of the item (in frames) for the x-axis.
qint64 startPos();
qint64 startPos() const;
void setColor( const QColor& color );
QColor itemColor();
......
......@@ -313,6 +313,12 @@ GraphicsEffectItem::setContainer( AbstractGraphicsMediaItem *item )
}
}
const AbstractGraphicsMediaItem*
GraphicsEffectItem::container() const
{
return m_container;
}
void
GraphicsEffectItem::contextMenuEvent( QGraphicsSceneContextMenuEvent *event )
{
......@@ -336,4 +342,3 @@ GraphicsEffectItem::contextMenuEvent( QGraphicsSceneContextMenuEvent *event )
update();
}
}
......@@ -60,6 +60,7 @@ class GraphicsEffectItem : public AbstractGraphicsItem
virtual qint32 zSelected() const;
virtual qint32 zNotSelected() const;
void setContainer( AbstractGraphicsMediaItem *item );
const AbstractGraphicsMediaItem *container() const;
protected:
virtual bool hasResizeBoundaries() const;
virtual void contextMenuEvent( QGraphicsSceneContextMenuEvent *event );
......
......@@ -1103,11 +1103,26 @@ TracksView::mouseReleaseEvent( QMouseEvent *event )
{
Q_ASSERT( m_actionItem );
m_actionItem->setOpacity( 1.0 );
GraphicsEffectItem *effectItem = qgraphicsitem_cast<GraphicsEffectItem*>( m_actionItem );
//Check if the clip moved.
if ( m_actionItem->m_oldTrack == m_actionItem->track()->trackWorkflow() &&
m_actionItem->startPos() == m_actionItem->track()->trackWorkflow()->getClipPosition( m_actionItem->uuid() ) )
return ;
//Check if the item moved.
if ( effectItem != NULL )
{
if ( m_actionItem->m_oldTrack == m_actionItem->track()->trackWorkflow() )
{
const AbstractGraphicsMediaItem *container = effectItem->container();
if ( container != NULL && container->startPos() + effectItem->begin() == effectItem->startPos() )
return ;
else if ( container == NULL && effectItem->startPos() == effectItem->begin() )
return ;
}
}
else
{
if ( m_actionItem->m_oldTrack == m_actionItem->track()->trackWorkflow() &&
m_actionItem->startPos() == m_actionItem->track()->trackWorkflow()->getClipPosition( m_actionItem->uuid() ) )
return ;
}
updateDuration();
......@@ -1117,7 +1132,6 @@ TracksView::mouseReleaseEvent( QMouseEvent *event )
addTrack( Workflow::AudioTrack );
EffectUser *target = m_actionItem->track()->trackWorkflow();
GraphicsEffectItem *effectItem = qgraphicsitem_cast<GraphicsEffectItem*>( m_actionItem );
qint64 targetPos = m_actionItem->startPos();
if ( effectItem != NULL )
{
......
......@@ -184,7 +184,7 @@ TrackWorkflow::renderClip( ClipWorkflow* cw, qint64 currentFrame,
if ( cw->isResyncRequired() == true || needRepositioning == true )
adjustClipTime( currentFrame, start, cw );
return cw->getOutput( mode, currentFrame );
return cw->getOutput( mode, currentFrame - start );
}
else if ( cw->getState() == ClipWorkflow::Stopped )
{
......@@ -199,7 +199,7 @@ TrackWorkflow::renderClip( ClipWorkflow* cw, qint64 currentFrame,
//Clip was not started at its real begining: adjust the position
adjustClipTime( currentFrame, start, cw );
}
return cw->getOutput( mode, currentFrame );
return cw->getOutput( mode, currentFrame - start );
}
else if ( cw->getState() == ClipWorkflow::EndReached ||
cw->getState() == ClipWorkflow::Muted ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment