Commit afedc84d authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

ClipHelpers are now used everywhere

parent db219732
...@@ -77,6 +77,7 @@ SET (VLMC_HDRS ...@@ -77,6 +77,7 @@ SET (VLMC_HDRS
Tools/VlmcDebug.h Tools/VlmcDebug.h
Workflow/AudioClipWorkflow.h Workflow/AudioClipWorkflow.h
Workflow/ClipWorkflow.h Workflow/ClipWorkflow.h
Workflow/ClipHelper.h
Workflow/ImageClipWorkflow.h Workflow/ImageClipWorkflow.h
Workflow/MainWorkflow.h Workflow/MainWorkflow.h
Workflow/TrackHandler.h Workflow/TrackHandler.h
......
...@@ -42,15 +42,15 @@ void Commands::trigger( Commands::Generic* command ) ...@@ -42,15 +42,15 @@ void Commands::trigger( Commands::Generic* command )
Commands::MainWorkflow::AddClip::AddClip( Clip* clip, Commands::MainWorkflow::AddClip::AddClip( ClipHelper* ch,
unsigned int trackNumber, qint64 pos, unsigned int trackNumber, qint64 pos,
::MainWorkflow::TrackType trackType, ::MainWorkflow::TrackType trackType,
bool undoRedoAction /*= false*/ ) : bool undoRedoAction /*= false*/ ) :
m_clip( clip ),
m_trackNumber( trackNumber ), m_trackNumber( trackNumber ),
m_pos( pos ), m_pos( pos ),
m_trackType( trackType ), m_trackType( trackType ),
m_undoRedoAction( undoRedoAction ) m_undoRedoAction( undoRedoAction ),
m_clipHelper( ch )
{ {
setText( QObject::tr( "Adding clip to track %1" ).arg( QString::number( trackNumber ) ) ); setText( QObject::tr( "Adding clip to track %1" ).arg( QString::number( trackNumber ) ) );
} }
...@@ -61,7 +61,7 @@ Commands::MainWorkflow::AddClip::~AddClip() ...@@ -61,7 +61,7 @@ Commands::MainWorkflow::AddClip::~AddClip()
void Commands::MainWorkflow::AddClip::redo() void Commands::MainWorkflow::AddClip::redo()
{ {
m_clipHelper = ::MainWorkflow::getInstance()->addClip( m_clip, m_trackNumber, m_pos, m_trackType, m_undoRedoAction ); ::MainWorkflow::getInstance()->addClip( m_clipHelper, m_trackNumber, m_pos, m_trackType, m_undoRedoAction );
m_undoRedoAction = false; m_undoRedoAction = false;
} }
...@@ -70,12 +70,6 @@ void Commands::MainWorkflow::AddClip::undo() ...@@ -70,12 +70,6 @@ void Commands::MainWorkflow::AddClip::undo()
::MainWorkflow::getInstance()->removeClip( m_clipHelper->uuid(), m_trackNumber, m_trackType ); ::MainWorkflow::getInstance()->removeClip( m_clipHelper->uuid(), m_trackNumber, m_trackType );
} }
ClipHelper*
Commands::MainWorkflow::AddClip::clipHelper()
{
return m_clipHelper;
}
Commands::MainWorkflow::MoveClip::MoveClip( ::MainWorkflow* workflow, const QUuid& uuid, Commands::MainWorkflow::MoveClip::MoveClip( ::MainWorkflow* workflow, const QUuid& uuid,
unsigned int oldTrack, unsigned int newTrack, qint64 newPos, unsigned int oldTrack, unsigned int newTrack, qint64 newPos,
::MainWorkflow::TrackType trackType ) : ::MainWorkflow::TrackType trackType ) :
...@@ -105,31 +99,29 @@ void Commands::MainWorkflow::MoveClip::undo() ...@@ -105,31 +99,29 @@ void Commands::MainWorkflow::MoveClip::undo()
m_undoRedoAction = true; m_undoRedoAction = true;
} }
Commands::MainWorkflow::RemoveClip::RemoveClip( Clip* clip, const QUuid& uuid, quint32 trackNumber, Commands::MainWorkflow::RemoveClip::RemoveClip( ClipHelper* ch, quint32 trackNumber,
qint64 pos, ::MainWorkflow::TrackType trackType ) : qint64 pos, ::MainWorkflow::TrackType trackType ) :
m_clip( clip ), m_trackNumber( trackNumber ), m_clipHelper( ch ), m_trackNumber( trackNumber ),
m_pos( pos ), m_trackType( trackType ), m_pos( pos ), m_trackType( trackType )
m_uuid( uuid )
{ {
setText( QObject::tr( "Remove clip" ) ); setText( QObject::tr( "Remove clip" ) );
} }
void Commands::MainWorkflow::RemoveClip::redo() void Commands::MainWorkflow::RemoveClip::redo()
{ {
::MainWorkflow::getInstance()->removeClip( m_uuid, m_trackNumber, m_trackType ); ::MainWorkflow::getInstance()->removeClip( m_clipHelper->uuid(), m_trackNumber, m_trackType );
} }
void Commands::MainWorkflow::RemoveClip::undo() void Commands::MainWorkflow::RemoveClip::undo()
{ {
m_uuid = (::MainWorkflow::getInstance()->addClip( m_clip, m_trackNumber, m_pos, m_trackType, true ))->uuid(); ::MainWorkflow::getInstance()->addClip( m_clipHelper, m_trackNumber, m_pos, m_trackType, true );
} }
Commands::MainWorkflow::ResizeClip::ResizeClip( const QUuid& uuid, Commands::MainWorkflow::ResizeClip::ResizeClip( ClipHelper* clipHelper,
qint64 newBegin, qint64 newEnd, qint64 newBegin, qint64 newEnd,
qint64 oldBegin, qint64 oldEnd, qint64 oldBegin, qint64 oldEnd,
qint64 newPos, qint64 oldPos, qint64 newPos, qint64 oldPos,
quint32 trackId, quint32 trackId,
::MainWorkflow::TrackType trackType ) : ::MainWorkflow::TrackType trackType ) :
m_uuid( uuid ),
m_newBegin( newBegin ), m_newBegin( newBegin ),
m_newEnd( newEnd ), m_newEnd( newEnd ),
m_oldBegin( oldBegin ), m_oldBegin( oldBegin ),
...@@ -137,16 +129,16 @@ Commands::MainWorkflow::ResizeClip::ResizeClip( const QUuid& uuid, ...@@ -137,16 +129,16 @@ Commands::MainWorkflow::ResizeClip::ResizeClip( const QUuid& uuid,
m_newPos( newPos ), m_newPos( newPos ),
m_oldPos( oldPos ), m_oldPos( oldPos ),
m_trackId( trackId ), m_trackId( trackId ),
m_clipHelper( clipHelper ),
m_trackType( trackType ), m_trackType( trackType ),
m_undoRedoAction( false ) m_undoRedoAction( false )
{ {
m_clip = ::MainWorkflow::getInstance()->getClip( uuid, trackId, m_trackType );
setText( QObject::tr( "Resizing clip" ) ); setText( QObject::tr( "Resizing clip" ) );
} }
void Commands::MainWorkflow::ResizeClip::redo() void Commands::MainWorkflow::ResizeClip::redo()
{ {
::MainWorkflow::getInstance()->resizeClip( m_clip, m_newBegin, m_newEnd, m_newPos, m_trackId, m_trackType, m_undoRedoAction ); ::MainWorkflow::getInstance()->resizeClip( m_clipHelper, m_newBegin, m_newEnd, m_newPos, m_trackId, m_trackType, m_undoRedoAction );
m_undoRedoAction = true; m_undoRedoAction = true;
} }
...@@ -157,16 +149,16 @@ void Commands::MainWorkflow::ResizeClip::undo() ...@@ -157,16 +149,16 @@ void Commands::MainWorkflow::ResizeClip::undo()
//In the other cases, we need to move, then resize. //In the other cases, we need to move, then resize.
if ( m_oldBegin == m_newBegin ) if ( m_oldBegin == m_newBegin )
{ {
::MainWorkflow::getInstance()->resizeClip( m_clip, m_oldBegin, m_oldEnd, m_oldPos, m_trackId, m_trackType, m_undoRedoAction ); ::MainWorkflow::getInstance()->resizeClip( m_clipHelper, m_oldBegin, m_oldEnd, m_oldPos, m_trackId, m_trackType, m_undoRedoAction );
} }
else else
{ {
m_clip->setBoundaries( m_oldBegin, m_oldEnd ); m_clipHelper->setBoundaries( m_oldBegin, m_oldEnd );
::MainWorkflow::getInstance()->moveClip( m_clip->uuid(), m_trackId, m_trackId, m_oldPos, m_trackType, m_undoRedoAction ); ::MainWorkflow::getInstance()->moveClip( m_clipHelper->uuid(), m_trackId, m_trackId, m_oldPos, m_trackType, m_undoRedoAction );
} }
} }
Commands::MainWorkflow::SplitClip::SplitClip( Clip* toSplit, quint32 trackId, Commands::MainWorkflow::SplitClip::SplitClip( ClipHelper* toSplit, quint32 trackId,
qint64 newClipPos, qint64 newClipBegin, ::MainWorkflow::TrackType trackType ) : qint64 newClipPos, qint64 newClipBegin, ::MainWorkflow::TrackType trackType ) :
m_toSplit( toSplit ), m_toSplit( toSplit ),
m_newClip( NULL ), m_newClip( NULL ),
......
...@@ -62,14 +62,12 @@ namespace Commands ...@@ -62,14 +62,12 @@ namespace Commands
NEW_COMMAND( AddClip ) NEW_COMMAND( AddClip )
{ {
public: public:
AddClip( Clip* clip, unsigned int trackNumber, qint64 pos, AddClip( ClipHelper* ch, unsigned int trackNumber, qint64 pos,
::MainWorkflow::TrackType trackType, bool undoRedoAction = false ); ::MainWorkflow::TrackType trackType, bool undoRedoAction = false );
virtual ~AddClip(); virtual ~AddClip();
virtual void redo(); virtual void redo();
virtual void undo(); virtual void undo();
ClipHelper *clipHelper();
private: private:
Clip* m_clip;
unsigned int m_trackNumber; unsigned int m_trackNumber;
qint64 m_pos; qint64 m_pos;
::MainWorkflow::TrackType m_trackType; ::MainWorkflow::TrackType m_trackType;
...@@ -100,17 +98,16 @@ namespace Commands ...@@ -100,17 +98,16 @@ namespace Commands
NEW_COMMAND( RemoveClip ) NEW_COMMAND( RemoveClip )
{ {
public: public:
RemoveClip( Clip* clip, const QUuid& uuid, unsigned int trackNumber, RemoveClip( ClipHelper* clip, unsigned int trackNumber,
qint64 pos, ::MainWorkflow::TrackType trackType ); qint64 pos, ::MainWorkflow::TrackType trackType );
virtual void redo(); virtual void redo();
virtual void undo(); virtual void undo();
private: private:
Clip* m_clip; ClipHelper* m_clipHelper;
unsigned int m_trackNumber; unsigned int m_trackNumber;
qint64 m_pos; qint64 m_pos;
::MainWorkflow::TrackType m_trackType; ::MainWorkflow::TrackType m_trackType;
QUuid m_uuid;
}; };
/** /**
...@@ -127,14 +124,13 @@ namespace Commands ...@@ -127,14 +124,13 @@ namespace Commands
NEW_COMMAND( ResizeClip ) NEW_COMMAND( ResizeClip )
{ {
public: public:
ResizeClip( const QUuid& uuid, ResizeClip( ClipHelper* clipHelper,
qint64 newBegin, qint64 newEnd, qint64 oldBegin, qint64 newBegin, qint64 newEnd, qint64 oldBegin,
qint64 oldEnd, qint64 newPos, qint64 oldPos, qint64 oldEnd, qint64 newPos, qint64 oldPos,
quint32 trackId, ::MainWorkflow::TrackType trackType ); quint32 trackId, ::MainWorkflow::TrackType trackType );
virtual void redo(); virtual void redo();
virtual void undo(); virtual void undo();
private: private:
QUuid m_uuid;
qint64 m_newBegin; qint64 m_newBegin;
qint64 m_newEnd; qint64 m_newEnd;
qint64 m_oldBegin; qint64 m_oldBegin;
...@@ -142,7 +138,7 @@ namespace Commands ...@@ -142,7 +138,7 @@ namespace Commands
qint64 m_newPos; qint64 m_newPos;
qint64 m_oldPos; qint64 m_oldPos;
quint32 m_trackId; quint32 m_trackId;
Clip* m_clip; ClipHelper* m_clipHelper;
::MainWorkflow::TrackType m_trackType; ::MainWorkflow::TrackType m_trackType;
bool m_undoRedoAction; bool m_undoRedoAction;
}; };
...@@ -150,14 +146,14 @@ namespace Commands ...@@ -150,14 +146,14 @@ namespace Commands
NEW_COMMAND( SplitClip ) NEW_COMMAND( SplitClip )
{ {
public: public:
SplitClip( Clip* toSplit, quint32 trackId, SplitClip( ClipHelper* toSplit, quint32 trackId, qint64 newClipPos,
qint64 newClipPos, qint64 newClipBegin, ::MainWorkflow::TrackType trackType ); qint64 newClipBegin, ::MainWorkflow::TrackType trackType );
~SplitClip(); ~SplitClip();
virtual void redo(); virtual void redo();
virtual void undo(); virtual void undo();
private: private:
Clip* m_toSplit; ClipHelper* m_toSplit;
Clip* m_newClip; ClipHelper* m_newClip;
quint32 m_trackId; quint32 m_trackId;
qint64 m_newClipPos; qint64 m_newClipPos;
qint64 m_newClipBegin; qint64 m_newClipBegin;
......
...@@ -33,10 +33,15 @@ ...@@ -33,10 +33,15 @@
#include "Media.h" #include "Media.h"
AbstractGraphicsMediaItem::AbstractGraphicsMediaItem( Clip* clip ) : AbstractGraphicsMediaItem::AbstractGraphicsMediaItem( Clip* clip ) :
oldTrackNumber( -1 ), oldPosition( -1 ), m_clip( clip ), m_tracksView( NULL ), oldTrackNumber( -1 ), oldPosition( -1 ), m_tracksView( NULL ),
m_group( NULL ), m_width( 0 ), m_height( 0 ), m_resizeExpected( false ), m_group( NULL ), m_width( 0 ), m_height( 0 ), m_resizeExpected( false ),
m_muted( false ) m_muted( false )
{ {
m_clipHelper = new ClipHelper( clip );
// Adjust the width
setWidth( clip->length() );
// Automatically adjust future changes
connect( m_clipHelper, SIGNAL( lengthUpdated() ), this, SLOT( adjustLength() ) );
connect( clip, SIGNAL( unloaded( Clip* ) ), connect( clip, SIGNAL( unloaded( Clip* ) ),
this, SLOT( clipDestroyed( Clip* ) ), Qt::DirectConnection ); this, SLOT( clipDestroyed( Clip* ) ), Qt::DirectConnection );
} }
...@@ -225,58 +230,59 @@ qint64 AbstractGraphicsMediaItem::startPos() ...@@ -225,58 +230,59 @@ qint64 AbstractGraphicsMediaItem::startPos()
void AbstractGraphicsMediaItem::resize( qint64 size, From from ) void AbstractGraphicsMediaItem::resize( qint64 size, From from )
{ {
Q_ASSERT( clip() ); Q_ASSERT( clipHelper() );
if ( size < 1 ) if ( size < 1 )
return; return;
if ( clip()->getMedia()->fileType() != Media::Image ) if ( clipHelper()->clip()->getMedia()->fileType() != Media::Image )
if ( size > clip()->maxEnd() ) if ( size > clipHelper()->clip()->end() )
size = clip()->maxEnd(); size = clipHelper()->clip()->end();
if ( from == BEGINNING ) if ( from == BEGINNING )
{ {
if ( clip()->getMedia()->fileType() != Media::Image ) if ( clipHelper()->clip()->getMedia()->fileType() != Media::Image )
if ( clip()->begin() + size > clip()->maxEnd() ) if ( clipHelper()->begin() + size > clipHelper()->end() )
return; return;
MainWorkflow::getInstance()->resizeClip( clip(), clip()->begin(), MainWorkflow::getInstance()->resizeClip( m_clipHelper, m_clipHelper->begin(),
clip()->begin() + size, 0, m_clipHelper->begin() + size, 0,
trackNumber(), mediaType() ); trackNumber(), mediaType() );
} }
else else
{ {
if ( clip()->getMedia()->fileType() != Media::Image ) if ( m_clipHelper->clip()->getMedia()->fileType() != Media::Image )
{ {
qint64 newBegin = qMax( clip()->end() - size, (qint64)0 ); qint64 newBegin = qMax( m_clipHelper->end() - size, (qint64)0 );
if ( clip()->maxBegin() > newBegin ) if ( m_clipHelper->clip()->begin() > newBegin )
return; return;
m_resizeExpected = true; m_resizeExpected = true;
qint64 oldLength = clip()->length(); qint64 oldLength = m_clipHelper->length();
qint64 newStart = startPos() + ( oldLength - size ); qint64 newStart = startPos() + ( oldLength - size );
if ( newStart < 0 ) if ( newStart < 0 )
return ; return ;
MainWorkflow::getInstance()->resizeClip( clip(), qMax( clip()->end() - size, (qint64)0 ), clip()->end(), MainWorkflow::getInstance()->resizeClip( m_clipHelper, qMax( m_clipHelper->end() - size,
(qint64)0 ), m_clipHelper->end(),
newStart, trackNumber(), mediaType() ); newStart, trackNumber(), mediaType() );
setStartPos( newStart ); setStartPos( newStart );
} }
else else
{ {
m_resizeExpected = true; m_resizeExpected = true;
qint64 oldLength = clip()->length(); qint64 oldLength = m_clipHelper->length();
// Commands::trigger( new Commands::MainWorkflow::ResizeClip( clip()->getUuid(), // Commands::trigger( new Commands::MainWorkflow::ResizeClip( clip()->getUuid(),
// 0, size, startPos(), // 0, size, startPos(),
// startPos() + oldLength, // startPos() + oldLength,
// startPos() + ( oldLength - size ), // startPos() + ( oldLength - size ),
// //
// )) // ))
MainWorkflow::getInstance()->resizeClip( clip(), 0, size, startPos() + ( oldLength - size ), MainWorkflow::getInstance()->resizeClip( m_clipHelper, 0, size, startPos() + ( oldLength - size ),
trackNumber(), mediaType() ); trackNumber(), mediaType() );
setStartPos( startPos() + ( oldLength - size ) ); setStartPos( startPos() + ( oldLength - size ) );
} }
} }
setWidth( clip()->length() ); setWidth( m_clipHelper->length() );
} }
void AbstractGraphicsMediaItem::adjustLength() void AbstractGraphicsMediaItem::adjustLength()
...@@ -286,8 +292,8 @@ void AbstractGraphicsMediaItem::adjustLength() ...@@ -286,8 +292,8 @@ void AbstractGraphicsMediaItem::adjustLength()
m_resizeExpected = false; m_resizeExpected = false;
return ; return ;
} }
Q_ASSERT( clip() ); Q_ASSERT( m_clipHelper );
setWidth( clip()->length() ); setWidth( m_clipHelper->length() );
} }
bool AbstractGraphicsMediaItem::resizeZone( const QPointF& position ) bool AbstractGraphicsMediaItem::resizeZone( const QPointF& position )
...@@ -316,3 +322,9 @@ AbstractGraphicsMediaItem::clipDestroyed( Clip* clip ) ...@@ -316,3 +322,9 @@ AbstractGraphicsMediaItem::clipDestroyed( Clip* clip )
if ( m_tracksView != NULL ) if ( m_tracksView != NULL )
m_tracksView->removeClip( clip->uuid() ); m_tracksView->removeClip( clip->uuid() );
} }
ClipHelper*
AbstractGraphicsMediaItem::clipHelper()
{
return m_clipHelper;
}
...@@ -74,9 +74,6 @@ public: ...@@ -74,9 +74,6 @@ public:
return m_clipHelper->uuid(); return m_clipHelper->uuid();
} }
/// Clip contained in the item
virtual Clip* clip() const = 0;
/// Return a pointer to the TracksScene /// Return a pointer to the TracksScene
TracksScene* scene(); TracksScene* scene();
...@@ -107,6 +104,8 @@ public: ...@@ -107,6 +104,8 @@ public:
/// Resize an item from its beginning or from its end. /// Resize an item from its beginning or from its end.
void resize( qint64 size, From from = BEGINNING ); void resize( qint64 size, From from = BEGINNING );
ClipHelper *clipHelper();
protected: protected:
/** /**
* \details Returns a pointer to the tracksView which contains the item, * \details Returns a pointer to the tracksView which contains the item,
...@@ -123,10 +122,7 @@ protected: ...@@ -123,10 +122,7 @@ protected:
*/ */
qint64 oldPosition; qint64 oldPosition;
/** ClipHelper* m_clipHelper;
* \brief The Clip this AbstractGraphicsMediaItem is based upon.
*/
Clip* m_clip;
/** /**
* \brief Return a pointer to the linked item. * \brief Return a pointer to the linked item.
...@@ -181,8 +177,6 @@ private: ...@@ -181,8 +177,6 @@ private:
//FIXME: this is a nasty forest boolean //FIXME: this is a nasty forest boolean
bool m_resizeExpected; bool m_resizeExpected;
ClipHelper* m_clipHelper;
}; };
#endif // ABSTRACTGRAPHICSMEDIAITEM_H #endif // ABSTRACTGRAPHICSMEDIAITEM_H
...@@ -32,7 +32,8 @@ ...@@ -32,7 +32,8 @@
#include <QGraphicsSceneMouseEvent> #include <QGraphicsSceneMouseEvent>
#include <QGraphicsSceneHoverEvent> #include <QGraphicsSceneHoverEvent>
GraphicsAudioItem::GraphicsAudioItem( Clip* clip ) : AbstractGraphicsMediaItem( clip ) GraphicsAudioItem::GraphicsAudioItem( Clip* clip ) :
AbstractGraphicsMediaItem( clip )
{ {
setFlags( QGraphicsItem::ItemIsSelectable ); setFlags( QGraphicsItem::ItemIsSelectable );
...@@ -43,11 +44,6 @@ GraphicsAudioItem::GraphicsAudioItem( Clip* clip ) : AbstractGraphicsMediaItem( ...@@ -43,11 +44,6 @@ GraphicsAudioItem::GraphicsAudioItem( Clip* clip ) : AbstractGraphicsMediaItem(
.arg( length.toString("hh:mm:ss.zzz") ) ); .arg( length.toString("hh:mm:ss.zzz") ) );
setToolTip( tooltip ); setToolTip( tooltip );
setAcceptHoverEvents( true ); setAcceptHoverEvents( true );
// Adjust the width
setWidth( clip->length() );
// Automatically adjust future changes
connect( clip, SIGNAL( lengthUpdated() ), this, SLOT( adjustLength() ) );
} }
GraphicsAudioItem::~GraphicsAudioItem() GraphicsAudioItem::~GraphicsAudioItem()
...@@ -70,11 +66,6 @@ void GraphicsAudioItem::paint( QPainter* painter, const QStyleOptionGraphicsItem ...@@ -70,11 +66,6 @@ void GraphicsAudioItem::paint( QPainter* painter, const QStyleOptionGraphicsItem
painter->restore(); painter->restore();
} }
Clip* GraphicsAudioItem::clip() const
{
return m_clip;
}
void GraphicsAudioItem::paintRect( QPainter* painter, const QStyleOptionGraphicsItem* option ) void GraphicsAudioItem::paintRect( QPainter* painter, const QStyleOptionGraphicsItem* option )
{ {
QRectF drawRect; QRectF drawRect;
...@@ -160,7 +151,7 @@ void GraphicsAudioItem::paintTitle( QPainter* painter, const QStyleOptionGraphic ...@@ -160,7 +151,7 @@ void GraphicsAudioItem::paintTitle( QPainter* painter, const QStyleOptionGraphic
// Initiate the font metrics calculation // Initiate the font metrics calculation
QFontMetrics fm( painter->font() ); QFontMetrics fm( painter->font() );
QString text = m_clip->getMedia()->fileName(); QString text = m_clipHelper->clip()->getMedia()->fileName();
// Get the transformations required to map the text on the viewport // Get the transformations required to map the text on the viewport
QTransform viewPortTransform = Timeline::getInstance()->tracksView()->viewportTransform(); QTransform viewPortTransform = Timeline::getInstance()->tracksView()->viewportTransform();
......
...@@ -53,8 +53,6 @@ public: ...@@ -53,8 +53,6 @@ public:
virtual MainWorkflow::TrackType mediaType() const; virtual MainWorkflow::TrackType mediaType() const;
virtual void paint( QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0 ); virtual void paint( QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0 );
virtual Clip* clip() const;
protected: protected:
/** /**
* \brief Paint the item's rectangle. * \brief Paint the item's rectangle.
......
...@@ -33,7 +33,8 @@ ...@@ -33,7 +33,8 @@
#include "TracksView.h" #include "TracksView.h"
#include "Timeline.h" #include "Timeline.h"
GraphicsMovieItem::GraphicsMovieItem( Clip* clip ) : AbstractGraphicsMediaItem( clip ) GraphicsMovieItem::GraphicsMovieItem( Clip* clip ) :
AbstractGraphicsMediaItem( clip )
{ {
setFlags( QGraphicsItem::ItemIsSelectable ); setFlags( QGraphicsItem::ItemIsSelectable );
...@@ -44,11 +45,6 @@ GraphicsMovieItem::GraphicsMovieItem( Clip* clip ) : AbstractGraphicsMediaItem( ...@@ -44,11 +45,6 @@ GraphicsMovieItem::GraphicsMovieItem( Clip* clip ) : AbstractGraphicsMediaItem(
.arg( length.toString("hh:mm:ss.zzz") ) ); .arg( length.toString("hh:mm:ss.zzz") ) );
setToolTip( tooltip ); setToolTip( tooltip );