Commit 136e58ab authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Aplying HACKING rules on Clip.h/cpp

parent 3c1f83ec
......@@ -55,7 +55,7 @@ void Commands::MainWorkflow::AddClip::redo()
void Commands::MainWorkflow::AddClip::undo()
{
::MainWorkflow::getInstance()->removeClip( m_clip->getUuid(), m_trackNumber, m_trackType );
::MainWorkflow::getInstance()->removeClip( m_clip->uuid(), m_trackNumber, m_trackType );
}
Commands::MainWorkflow::MoveClip::MoveClip( ::MainWorkflow* workflow, const QUuid& uuid,
......@@ -97,7 +97,7 @@ Commands::MainWorkflow::RemoveClip::RemoveClip( Clip* clip, quint32 trackNumber,
void Commands::MainWorkflow::RemoveClip::redo()
{
::MainWorkflow::getInstance()->removeClip( m_clip->getUuid(), m_trackNumber, m_trackType );
::MainWorkflow::getInstance()->removeClip( m_clip->uuid(), m_trackNumber, m_trackType );
}
void Commands::MainWorkflow::RemoveClip::undo()
{
......@@ -143,7 +143,7 @@ void Commands::MainWorkflow::ResizeClip::undo()
else
{
m_clip->setBoundaries( m_oldBegin, m_oldEnd );
::MainWorkflow::getInstance()->moveClip( m_clip->getUuid(), m_trackId, m_trackId, m_oldPos, m_trackType, m_undoRedoAction );
::MainWorkflow::getInstance()->moveClip( m_clip->uuid(), m_trackId, m_trackId, m_oldPos, m_trackType, m_undoRedoAction );
}
}
......
......@@ -34,7 +34,7 @@ ClipProperty::ClipProperty( Clip* clip, QWidget *parent ) :
m_clip( clip )
{
QTime duration;
duration = duration.addSecs( m_clip->getLengthSecond() );
duration = duration.addSecs( m_clip->lengthSecond() );
ui->setupUi(this);
connect( this, SIGNAL( accepted() ), this, SLOT( deleteLater() ) );
......@@ -61,11 +61,11 @@ ClipProperty::ClipProperty( Clip* clip, QWidget *parent ) :
Q_ASSERT( button != NULL);
connect( button, SIGNAL( clicked() ), this, SLOT( apply() ) );
m_model = new QStringListModel( m_clip->getMetaTags(), this );
m_model = new QStringListModel( m_clip->metaTags(), this );
ui->metaTagsView->setModel( m_model );
//Notes:
ui->annotationInput->setPlainText( m_clip->getNotes() );
ui->annotationInput->setPlainText( m_clip->notes() );
connect( ui->addTagsButton, SIGNAL( clicked() ), this, SLOT( addTagsRequired() ) );
connect( ui->deleteTagsButton, SIGNAL( clicked() ), this, SLOT( removeTagsRequired() ) );
......
......@@ -216,7 +216,7 @@ void
ImportController::setUIMetaData( Clip* clip )
{
QTime time;
qint64 length = clip->getLengthSecond();
qint64 length = clip->lengthSecond();
time = time.addSecs( length );
m_ui->durationValueLabel->setText( time.toString( "hh:mm:ss" ) );
m_ui->nameValueLabel->setText( clip->getParent()->fileInfo()->fileName() );
......
......@@ -88,7 +88,7 @@ ImportMediaListController::removeMedia( const QUuid& uuid )
void
ImportMediaListController::addClip( Clip* clip )
{
ImportMediaCellView* cell = new ImportMediaCellView( clip->getUuid() );
ImportMediaCellView* cell = new ImportMediaCellView( clip->uuid() );
cell->containsClip();
connect( cell, SIGNAL( cellSelected( const QUuid& ) ),
this, SIGNAL( clipSelected( const QUuid& ) ) );
......@@ -101,11 +101,11 @@ ImportMediaListController::addClip( Clip* clip )
cell->setTitle( clip->getParent()->fileName() + "_" + size );
cell->setThumbnail( clip->getParent()->snapshot() );
cell->setLength( clip->getLengthSecond(), false );
cell->setLength( clip->lengthSecond(), false );
cell->setEnabled( true );
addCell( cell );
m_mediaCellList->insert( clip->getUuid(), cell );
m_mediaCellList->insert( clip->uuid(), cell );
}
void
......
......@@ -61,7 +61,7 @@ void ClipListViewController::resetNbDeletion()
void ClipListViewController::addClip( Clip* clip )
{
MediaCellView* cell = new MediaCellView( clip->getUuid() );
MediaCellView* cell = new MediaCellView( clip->uuid() );
cell->containsClip();
connect( cell, SIGNAL( cellSelected( QUuid ) ), this, SLOT( cellSelection( const QUuid& ) ) );
connect( cell, SIGNAL( cellDeleted( const QUuid& ) ), this, SLOT( clipDeletion( const QUuid& ) ) );
......@@ -70,9 +70,9 @@ void ClipListViewController::addClip( Clip* clip )
QString number;
number.setNum( m_cells.size() + 1 );
cell->setTitle( clip->getParent()->fileName() + number );
cell->setLength( clip->getLengthSecond(), false );
cell->setLength( clip->lengthSecond(), false );
addCell( cell );
m_cells.insert( clip->getUuid(), cell );
m_cells.insert( clip->uuid(), cell );
cell->enableCell();
}
......
......@@ -144,13 +144,13 @@ void AbstractGraphicsMediaItem::contextMenuEvent( QGraphicsSceneContextMenuEvent
if ( ( m_muted = muteAction->isChecked() ) )
{
tracksView()->m_mainWorkflow->muteClip( clip()->getUuid(),
tracksView()->m_mainWorkflow->muteClip( clip()->uuid(),
trackNumber(),
mediaType() );
}
else
{
tracksView()->m_mainWorkflow->unmuteClip( clip()->getUuid(),
tracksView()->m_mainWorkflow->unmuteClip( clip()->uuid(),
trackNumber(),
mediaType() );
}
......@@ -176,7 +176,7 @@ void AbstractGraphicsMediaItem::contextMenuEvent( QGraphicsSceneContextMenuEvent
{
item1->group( this );
tracksView()->moveMediaItem( item1, item1->trackNumber(), startPos() );
MainWorkflow::getInstance()->moveClip( item1->clip()->getUuid(), item1->trackNumber(),
MainWorkflow::getInstance()->moveClip( item1->clip()->uuid(), item1->trackNumber(),
trackNumber(), startPos(),
item1->mediaType() );
}
......@@ -216,13 +216,13 @@ void AbstractGraphicsMediaItem::resize( qint64 size, From from )
return;
if ( clip()->getParent()->fileType() != Media::Image )
if ( size > clip()->getMaxEnd() )
if ( size > clip()->maxEnd() )
return;
if ( from == BEGINNING )
{
if ( clip()->getParent()->fileType() != Media::Image )
if ( clip()->getBegin() + size > clip()->getMaxEnd() )
if ( clip()->begin() + size > clip()->maxEnd() )
return;
//FIXME
// tracksView()->getRenderer()->resizeClip( clip(), clip()->getBegin(), clip()->getBegin() + size, 0, //This parameter is unused in this case
......@@ -232,16 +232,16 @@ void AbstractGraphicsMediaItem::resize( qint64 size, From from )
{
if ( clip()->getParent()->fileType() != Media::Image )
{
qint64 newBegin = qMax( clip()->getEnd() - size, (qint64)0 );
if ( clip()->getMaxBegin() > newBegin )
qint64 newBegin = qMax( clip()->end() - size, (qint64)0 );
if ( clip()->maxBegin() > newBegin )
return;
m_resizeExpected = true;
qint64 oldLength = clip()->getLength();
qint64 oldLength = clip()->length();
qint64 newStart = startPos() + ( oldLength - size );
if ( newStart < 0 )
return ;
MainWorkflow::getInstance()->resizeClip( clip(), qMax( clip()->getEnd() - size, (qint64)0 ), clip()->getEnd(),
MainWorkflow::getInstance()->resizeClip( clip(), qMax( clip()->end() - size, (qint64)0 ), clip()->end(),
newStart, trackNumber(), mediaType() );
setStartPos( newStart );
//FIXME
......@@ -249,7 +249,7 @@ void AbstractGraphicsMediaItem::resize( qint64 size, From from )
else
{
m_resizeExpected = true;
qint64 oldLength = clip()->getLength();
qint64 oldLength = clip()->length();
// Commands::trigger( new Commands::MainWorkflow::ResizeClip( clip()->getUuid(),
// 0, size, startPos(),
// startPos() + oldLength,
......@@ -262,7 +262,7 @@ void AbstractGraphicsMediaItem::resize( qint64 size, From from )
}
}
setWidth( clip()->getLength() );
setWidth( clip()->length() );
}
void AbstractGraphicsMediaItem::adjustLength()
......@@ -273,7 +273,7 @@ void AbstractGraphicsMediaItem::adjustLength()
return ;
}
Q_ASSERT( clip() );
resize( clip()->getLength() );
resize( clip()->length() );
}
bool AbstractGraphicsMediaItem::resizeZone( const QPointF& position )
......
......@@ -42,7 +42,7 @@ GraphicsAudioItem::GraphicsAudioItem( Clip* clip ) : m_clip( clip )
setAcceptHoverEvents( true );
// Adjust the width
setWidth( clip->getLength() );
setWidth( clip->length() );
// Automatically adjust future changes
connect( clip, SIGNAL( lengthUpdated() ), this, SLOT( adjustLength() ) );
}
......
......@@ -50,7 +50,7 @@ public:
virtual int type() const { return Type; }
virtual bool expandable() const { return false; }
virtual bool moveable() const { return true; }
virtual const QUuid& uuid() const { return m_clip->getUuid(); }
virtual const QUuid& uuid() const { return m_clip->uuid(); }
virtual MainWorkflow::TrackType mediaType() const;
virtual void paint( QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0 );
......
......@@ -42,7 +42,7 @@ GraphicsMovieItem::GraphicsMovieItem( Clip* clip ) : m_clip( clip )
setAcceptHoverEvents( true );
// Adjust the width
setWidth( clip->getLength() );
setWidth( clip->length() );
// Automatically adjust for future changes
connect( clip, SIGNAL( lengthUpdated() ), this, SLOT( adjustLength() ) );
}
......
......@@ -49,7 +49,7 @@ public:
virtual int type() const { return Type; }
virtual bool expandable() const { return false; }
virtual bool moveable() const { return true; }
virtual const QUuid& uuid() const { return m_clip->getUuid(); }
virtual const QUuid& uuid() const { return m_clip->uuid(); }
virtual MainWorkflow::TrackType mediaType() const;
virtual void paint( QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0 );
......
......@@ -173,5 +173,5 @@ void Timeline::actionMoveClip( const QUuid& uuid, unsigned int track, qint64 tim
void Timeline::actionRemoveClip( Clip* clip, unsigned int track, MainWorkflow::TrackType trackType )
{
tracksView()->removeMediaItem( clip->getUuid(), track, trackType );
tracksView()->removeMediaItem( clip->uuid(), track, trackType );
}
......@@ -253,7 +253,7 @@ TracksView::addMediaItem( Clip *clip, unsigned int track, MainWorkflow::TrackTyp
{
AbstractGraphicsMediaItem *item =
dynamic_cast<AbstractGraphicsMediaItem*>( trackItems.at( i ) );
if ( !item || item->uuid() != clip->getUuid() ) continue;
if ( !item || item->uuid() != clip->uuid() ) continue;
// Item already exist: goodbye!
return;
}
......@@ -863,8 +863,8 @@ TracksView::mousePressEvent( QMouseEvent *event )
m_actionResizeType = AbstractGraphicsMediaItem::BEGINNING;
m_actionResize = true;
m_actionResizeStart = mapToScene( event->pos() ).x();
m_actionResizeBase = item->clip()->getLength();
m_actionResizeOldBegin = item->clip()->getBegin();
m_actionResizeBase = item->clip()->length();
m_actionResizeOldBegin = item->clip()->begin();
m_actionItem = item;
}
else if ( item->moveable() )
......@@ -928,7 +928,7 @@ TracksView::mouseReleaseEvent( QMouseEvent *event )
UndoStack::getInstance()->beginMacro( "Move clip" );
Commands::trigger( new Commands::MainWorkflow::MoveClip( m_mainWorkflow,
m_actionItem->clip()->getUuid(),
m_actionItem->clip()->uuid(),
m_actionItem->oldTrackNumber,
m_actionItem->trackNumber(),
m_actionItem->startPos(),
......@@ -938,7 +938,7 @@ TracksView::mouseReleaseEvent( QMouseEvent *event )
if ( m_actionItem->groupItem() )
{
Commands::trigger( new Commands::MainWorkflow::MoveClip( m_mainWorkflow,
m_actionItem->groupItem()->clip()->getUuid(),
m_actionItem->groupItem()->clip()->uuid(),
m_actionItem->groupItem()->oldTrackNumber,
m_actionItem->groupItem()->trackNumber(),
m_actionItem->groupItem()->startPos(),
......@@ -960,8 +960,8 @@ TracksView::mouseReleaseEvent( QMouseEvent *event )
Clip *clip = m_actionItem->clip();
//This is a "pointless action". The resize already occured. However, by doing this
//we can have an undo action.
Commands::trigger( new Commands::MainWorkflow::ResizeClip( clip->getUuid(), clip->getBegin(),
clip->getEnd(), m_actionResizeOldBegin, m_actionResizeOldBegin + m_actionResizeBase,
Commands::trigger( new Commands::MainWorkflow::ResizeClip( clip->uuid(), clip->begin(),
clip->end(), m_actionResizeOldBegin, m_actionResizeOldBegin + m_actionResizeBase,
m_actionItem->pos().x(), m_actionResizeStart, m_actionItem->trackNumber(), m_actionItem->mediaType() ) );
updateDuration();
}
......@@ -1171,6 +1171,6 @@ TracksView::split( AbstractGraphicsMediaItem *item, qint64 frame )
//therefore, the position of the newly created clip is
//the splitted clip pos + the splitting point (ie startPos() + frame)
Commands::trigger( new Commands::MainWorkflow::SplitClip( item->clip(), item->trackNumber(),
item->startPos() + frame, frame + item->clip()->getBegin(),
item->startPos() + frame, frame + item->clip()->begin(),
item->mediaType() ) );
}
......@@ -263,9 +263,9 @@ Library::saveProject( QDomDocument& doc, QDomElement& rootNode )
foreach( Clip* c, it.value()->clips()->values() )
{
QDomElement clip = doc.createElement( "clip" );
clip.setAttribute( "begin", c->getBegin() );
clip.setAttribute( "end", c->getEnd() );
clip.setAttribute( "uuid", c->getUuid() );
clip.setAttribute( "begin", c->begin() );
clip.setAttribute( "end", c->end() );
clip.setAttribute( "uuid", c->uuid() );
clip.setAttribute( "parentUuid", c->getParent()->uuid() );
clips.appendChild( clip );
}
......
......@@ -31,7 +31,7 @@
const int Clip::DefaultFPS = 30;
Clip::Clip( Media* parent ) :
Clip::Clip( Media *parent ) :
m_parent( parent ),
m_begin( 0 ),
m_end( parent->nbFrames() ),
......@@ -42,7 +42,7 @@ Clip::Clip( Media* parent ) :
computeLength();
}
Clip::Clip( Clip* creator, qint64 begin, qint64 end ) :
Clip::Clip( Clip *creator, qint64 begin, qint64 end ) :
m_parent( creator->getParent() ),
m_begin( begin ),
m_end( end ),
......@@ -53,7 +53,7 @@ Clip::Clip( Clip* creator, qint64 begin, qint64 end ) :
computeLength();
}
Clip::Clip( Media* parent, qint64 begin, qint64 end /*= -1*/ ) :
Clip::Clip( Media *parent, qint64 begin, qint64 end /*= -1*/ ) :
m_parent( parent ),
m_begin( begin ),
m_end( end ),
......@@ -72,7 +72,7 @@ Clip::Clip( Media* parent, qint64 begin, qint64 end /*= -1*/ ) :
computeLength();
}
Clip::Clip( const Clip* clip ) :
Clip::Clip( const Clip *clip ) :
m_parent( clip->m_parent ),
m_begin( clip->m_begin ),
m_end( clip->m_end ),
......@@ -86,7 +86,7 @@ Clip::Clip( const Clip* clip ) :
m_Uuid = QUuid::createUuid();
}
Clip::Clip( const QUuid& uuid, qint64 begin, qint64 end ) :
Clip::Clip( const QUuid &uuid, qint64 begin, qint64 end ) :
m_begin( begin),
m_end( end ),
m_maxBegin( begin ),
......@@ -100,7 +100,7 @@ Clip::Clip( const QUuid& uuid, qint64 begin, qint64 end ) :
computeLength();
}
Clip::Clip( Media* parent, qint64 begin, qint64 end, const QUuid& uuid )
Clip::Clip( Media *parent, qint64 begin, qint64 end, const QUuid &uuid )
: m_parent( parent ),
m_begin( begin ),
m_end( end ),
......@@ -114,32 +114,38 @@ Clip::~Clip()
{
}
qint64 Clip::getBegin() const
qint64
Clip::begin() const
{
return m_begin;
}
qint64 Clip::getEnd() const
qint64
Clip::end() const
{
return m_end;
}
Media* Clip::getParent()
Media*
Clip::getParent()
{
return m_parent;
}
qint64 Clip::getLength() const
qint64
Clip::length() const
{
return m_length;
}
qint64 Clip::getLengthSecond() const
qint64
Clip::lengthSecond() const
{
return m_lengthSeconds;
}
void Clip::computeLength()
void
Clip::computeLength()
{
if ( m_parent->inputType() == Media::File )
{
......@@ -157,17 +163,20 @@ void Clip::computeLength()
}
}
const QStringList& Clip::getMetaTags() const
const QStringList&
Clip::metaTags() const
{
return m_metaTags;
}
void Clip::setMetaTags( const QStringList& tags )
void
Clip::setMetaTags( const QStringList &tags )
{
m_metaTags = tags;
}
bool Clip::matchMetaTag( const QString& tag ) const
bool
Clip::matchMetaTag( const QString &tag ) const
{
if ( tag.length() == 0 )
return true;
......@@ -182,23 +191,27 @@ bool Clip::matchMetaTag( const QString& tag ) const
return false;
}
const QString& Clip::getNotes() const
const QString&
Clip::notes() const
{
return m_notes;
}
void Clip::setNotes( const QString& notes )
void
Clip::setNotes( const QString &notes )
{
m_notes = notes;
}
const QUuid& Clip::getUuid() const
const QUuid&
Clip::uuid() const
{
Q_ASSERT( m_Uuid.isNull() == false );
return m_Uuid;
}
void Clip::setBegin( qint64 begin, bool updateMax /*= false*/ )
void
Clip::setBegin( qint64 begin, bool updateMax /*= false*/ )
{
Q_ASSERT( begin >= .0f );
if ( begin == m_begin ) return;
......@@ -208,7 +221,8 @@ void Clip::setBegin( qint64 begin, bool updateMax /*= false*/ )
computeLength();
}
void Clip::setEnd( qint64 end, bool updateMax /*= false*/ )
void
Clip::setEnd( qint64 end, bool updateMax /*= false*/ )
{
if ( end == m_end ) return;
m_end = end;
......@@ -217,7 +231,8 @@ void Clip::setEnd( qint64 end, bool updateMax /*= false*/ )
computeLength();
}
void Clip::setBoundaries( qint64 newBegin, qint64 newEnd, bool updateMax /*= false*/ )
void
Clip::setBoundaries( qint64 newBegin, qint64 newEnd, bool updateMax /*= false*/ )
{
Q_ASSERT( newBegin < newEnd );
if ( newBegin == m_begin && m_end == newEnd )
......@@ -232,12 +247,14 @@ void Clip::setBoundaries( qint64 newBegin, qint64 newEnd, bool up
computeLength();
}
qint64 Clip::getMaxBegin() const
qint64
Clip::maxBegin() const
{
return m_maxBegin;
}
qint64 Clip::getMaxEnd() const
qint64
Clip::maxEnd() const
{
return m_maxEnd;
}
......@@ -42,16 +42,16 @@ class Clip : public QObject
public:
static const int DefaultFPS;
Clip( Media* parent );
Clip( Media* parent, qint64 begin, qint64 end = -1 );
Clip( Clip* creator, qint64 begin, qint64 end );
Clip( const Clip* clip );
Clip( const QUuid& uuid, qint64 begin = 0, qint64 end = -1 );
Clip( Media* parent, qint64 begin, qint64 end, const QUuid& uuid );
Clip( Media *parent );
Clip( Media *parent, qint64 begin, qint64 end = -1 );
Clip( Clip *creator, qint64 begin, qint64 end );
Clip( const Clip *clip );
Clip( const QUuid &uuid, qint64 begin = 0, qint64 end = -1 );
Clip( Media *parent, qint64 begin, qint64 end, const QUuid &uuid );
virtual ~Clip();
qint64 getBegin() const;
qint64 getEnd() const;
qint64 begin() const;
qint64 end() const;
void setBegin( qint64 begin, bool updateMax = false );
void setEnd( qint64 end, bool updateMax = false );
......@@ -60,12 +60,12 @@ class Clip : public QObject
/**
\return Returns the clip length in frame.
*/
qint64 getLength() const;
qint64 length() const;
/**
\return Returns the clip length in seconds.
*/
qint64 getLengthSecond() const;
qint64 lengthSecond() const;
/**
\return Returns the Media that the clip was basep uppon.
......@@ -79,64 +79,64 @@ class Clip : public QObject
\return The Clip's Uuid as a QUuid
*/
const QUuid& getUuid() const;
const QUuid &uuid() const;
const QStringList& getMetaTags() const;
void setMetaTags( const QStringList& tags );
bool matchMetaTag( const QString& tag ) const;
const QStringList &metaTags() const;
void setMetaTags( const QStringList &tags );
bool matchMetaTag( const QString &tag ) const;
const QString& getNotes() const;
void setNotes( const QString& notes );
const QString &notes() const;
void setNotes( const QString &notes );
qint64 getMaxBegin() const;
qint64 getMaxEnd() const;
qint64 maxBegin() const;
qint64 maxEnd() const;
private:
void computeLength();
void computeLength();
Media* m_parent;
Media *m_parent;
/**
* \brief This represents the beginning of the Clip in frames, from the
* beginning of the parent Media.
*/
qint64 m_begin;
qint64 m_begin;
/**
* \brief This represents the end of the Clip in frames, from the
* beginning of the parent Media.
*/
qint64 m_end;
qint64 m_end;
/**
* \brief The length in frames
*/
qint64 m_length;
qint64 m_length;
/**
* \brief The length in seconds (Be carreful, VLC uses MILLIseconds)
*/
qint64 m_lengthSeconds;
qint64 m_lengthSeconds;
/**
* The Clip's timeline UUID. Used to identify the Clip in the
* timeline, as a unique object, even if this clip is present more than
* once.
*/
QUuid m_Uuid;
QStringList m_metaTags;
QString m_notes;
QUuid m_Uuid;
QStringList m_metaTags;
QString m_notes;
/**
* This is used for the resize. The clip won't be abble to be resized beyond this value.
* ie this clip won't start before m_maxBegin.
*/
qint64 m_maxBegin;
qint64 m_maxBegin;
/**
* This is used for the resize. The clip won't be abble to be resized beyond this value
* ie this clip won't end before m_maxEnd.
*/
qint64 m_maxEnd;
qint64 m_maxEnd;
signals:
void lengthUpdated();
void lengthUpdated();
};
#endif //CLIP_H__
......@@ -270,7 +270,7 @@ bool Media::matchMetaTag( const QString& tag ) const
void Media::addClip( Clip* clip )
{
m_clips.insert( clip->getUuid(), clip );
m_clips.insert( clip->uuid(), clip );
}
void Media::removeClip( const QUuid& uuid )
......
......@@ -72,14 +72,14 @@ ClipRenderer::setMedia( Media *media )
void
ClipRenderer::setClip( Clip *clip )
{
if ( clip == NULL || clip->getLength() == 0 )
if ( clip == NULL || clip->length() == 0 )
{
m_selectedMedia = NULL;
return ;
}
m_selectedMedia = clip->getParent();
m_begin = clip->getBegin();
m_end = clip->getEnd();
m_begin = clip->begin();
m_end = clip->end();
if ( m_isRendering == true )
m_mediaChanged = true;
else
......
......@@ -91,7 +91,7 @@ void ClipWorkflow::adjustBegin()
if ( m_clip->getParent()->fileType() == Media::Video ||
m_clip->getParent()->fileType() == Media::Audio )
{
m_mediaPlayer->setTime( m_clip->getBegin() /
m_mediaPlayer->setTime( m_clip->begin() /
m_clip->getParent()->fps() * 1000 );
}
}
......
......@@ -465,7 +465,7 @@ MainWorkflow::split( Clip* toSplit, Clip* newClip, quint32 trackId, qint64 newCl
QMutexLocker lock( m_renderStartedMutex );
if ( newClip == NULL )
newClip = new Clip( toSplit, newClipBegin, toSplit->getEnd() );
newClip = new Clip( toSplit, newClipBegin, toSplit->end() );
toSplit->setEnd( newClipBegin, true );
addClip( newClip, trackId, newClipPos, trackType );
......@@ -479,9 +479,9 @@ MainWorkflow::resizeClip( Clip* clip, qint64 newBegin, qint64 newEnd, qint64 new
{
QMutexLocker lock( m_renderStartedMutex );
if ( newBegin != clip->getBegin() )
if ( newBegin != clip->begin() )
{
moveClip( clip->getUuid(), trackId, trackId, newPos, trackType, undoRedoAction );
moveClip( clip->uuid(), trackId, trackId, newPos, trackType, undoRedoAction );
}
clip->setBoundaries( newBegin, newEnd );
}
......@@ -492,6 +492,6 @@ MainWorkflow::unsplit( Clip* origin, Clip* splitted, quint32 trackId,
{
QMutexLocker lock( m_renderStartedMutex );
removeClip( splitted->getUuid(), trackId, trackType );
origin->setEnd( splitted->getEnd(), true );
removeClip( splitted->uuid(), trackId, trackType );
origin->setEnd( splitted->end(), true );
}
......@@ -91,7 +91,7 @@ void TrackWorkflow::computeLength()
return ;
}
QMap<qint64, ClipWorkflow*>::const_iterator it = m_clips.end() - 1;
m_length = (it.key() + it.value()->getClip()->getLength() );
m_length = (it.key() + it.value()->getClip()->length() );
}
qint64 TrackWorkflow::getLength() const
......@@ -106,7 +106,7 @@ qint64 TrackWorkflow::getClipPosition( const QUuid& uuid ) const
while ( it != end )
{
if ( it.value()->getClip()->getUuid() == uuid )
if ( it.value()->getClip()->uuid() == uuid )
return it.key();
++it;
}
......@@ -120,7 +120,7 @@ Clip* TrackWorkflow::getClip( const QUuid& uuid )
while ( it != end )
{
if ( it.value()->getClip()->getUuid() == uuid )
if ( it.value()->getClip()->uuid() == uuid )
return it.value()->getClip();
++it;
}
......@@ -153,7 +153,7 @@ TrackWorkflow::renderClip( ClipWorkflow* cw, qint64 currentFrame,
cw->getStateLock()->unlock();
cw->initialize();
cw->waitForCompleteInit();
if ( start != currentFrame || cw->getClip()->getBegin() != 0 ) //Clip was not started as its real begining
if ( start != currentFrame || cw->getClip()->begin() != 0 ) //Clip was not started as its real begining