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() ...@@ -55,7 +55,7 @@ void Commands::MainWorkflow::AddClip::redo()
void Commands::MainWorkflow::AddClip::undo() 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, Commands::MainWorkflow::MoveClip::MoveClip( ::MainWorkflow* workflow, const QUuid& uuid,
...@@ -97,7 +97,7 @@ Commands::MainWorkflow::RemoveClip::RemoveClip( Clip* clip, quint32 trackNumber, ...@@ -97,7 +97,7 @@ Commands::MainWorkflow::RemoveClip::RemoveClip( Clip* clip, quint32 trackNumber,
void Commands::MainWorkflow::RemoveClip::redo() 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() void Commands::MainWorkflow::RemoveClip::undo()
{ {
...@@ -143,7 +143,7 @@ void Commands::MainWorkflow::ResizeClip::undo() ...@@ -143,7 +143,7 @@ void Commands::MainWorkflow::ResizeClip::undo()
else else
{ {
m_clip->setBoundaries( m_oldBegin, m_oldEnd ); 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 ) : ...@@ -34,7 +34,7 @@ ClipProperty::ClipProperty( Clip* clip, QWidget *parent ) :
m_clip( clip ) m_clip( clip )
{ {
QTime duration; QTime duration;
duration = duration.addSecs( m_clip->getLengthSecond() ); duration = duration.addSecs( m_clip->lengthSecond() );
ui->setupUi(this); ui->setupUi(this);
connect( this, SIGNAL( accepted() ), this, SLOT( deleteLater() ) ); connect( this, SIGNAL( accepted() ), this, SLOT( deleteLater() ) );
...@@ -61,11 +61,11 @@ ClipProperty::ClipProperty( Clip* clip, QWidget *parent ) : ...@@ -61,11 +61,11 @@ ClipProperty::ClipProperty( Clip* clip, QWidget *parent ) :
Q_ASSERT( button != NULL); Q_ASSERT( button != NULL);
connect( button, SIGNAL( clicked() ), this, SLOT( apply() ) ); 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 ); ui->metaTagsView->setModel( m_model );
//Notes: //Notes:
ui->annotationInput->setPlainText( m_clip->getNotes() ); ui->annotationInput->setPlainText( m_clip->notes() );
connect( ui->addTagsButton, SIGNAL( clicked() ), this, SLOT( addTagsRequired() ) ); connect( ui->addTagsButton, SIGNAL( clicked() ), this, SLOT( addTagsRequired() ) );
connect( ui->deleteTagsButton, SIGNAL( clicked() ), this, SLOT( removeTagsRequired() ) ); connect( ui->deleteTagsButton, SIGNAL( clicked() ), this, SLOT( removeTagsRequired() ) );
......
...@@ -216,7 +216,7 @@ void ...@@ -216,7 +216,7 @@ void
ImportController::setUIMetaData( Clip* clip ) ImportController::setUIMetaData( Clip* clip )
{ {
QTime time; QTime time;
qint64 length = clip->getLengthSecond(); qint64 length = clip->lengthSecond();
time = time.addSecs( length ); time = time.addSecs( length );
m_ui->durationValueLabel->setText( time.toString( "hh:mm:ss" ) ); m_ui->durationValueLabel->setText( time.toString( "hh:mm:ss" ) );
m_ui->nameValueLabel->setText( clip->getParent()->fileInfo()->fileName() ); m_ui->nameValueLabel->setText( clip->getParent()->fileInfo()->fileName() );
......
...@@ -88,7 +88,7 @@ ImportMediaListController::removeMedia( const QUuid& uuid ) ...@@ -88,7 +88,7 @@ ImportMediaListController::removeMedia( const QUuid& uuid )
void void
ImportMediaListController::addClip( Clip* clip ) ImportMediaListController::addClip( Clip* clip )
{ {
ImportMediaCellView* cell = new ImportMediaCellView( clip->getUuid() ); ImportMediaCellView* cell = new ImportMediaCellView( clip->uuid() );
cell->containsClip(); cell->containsClip();
connect( cell, SIGNAL( cellSelected( const QUuid& ) ), connect( cell, SIGNAL( cellSelected( const QUuid& ) ),
this, SIGNAL( clipSelected( const QUuid& ) ) ); this, SIGNAL( clipSelected( const QUuid& ) ) );
...@@ -101,11 +101,11 @@ ImportMediaListController::addClip( Clip* clip ) ...@@ -101,11 +101,11 @@ ImportMediaListController::addClip( Clip* clip )
cell->setTitle( clip->getParent()->fileName() + "_" + size ); cell->setTitle( clip->getParent()->fileName() + "_" + size );
cell->setThumbnail( clip->getParent()->snapshot() ); cell->setThumbnail( clip->getParent()->snapshot() );
cell->setLength( clip->getLengthSecond(), false ); cell->setLength( clip->lengthSecond(), false );
cell->setEnabled( true ); cell->setEnabled( true );
addCell( cell ); addCell( cell );
m_mediaCellList->insert( clip->getUuid(), cell ); m_mediaCellList->insert( clip->uuid(), cell );
} }
void void
......
...@@ -61,7 +61,7 @@ void ClipListViewController::resetNbDeletion() ...@@ -61,7 +61,7 @@ void ClipListViewController::resetNbDeletion()
void ClipListViewController::addClip( Clip* clip ) void ClipListViewController::addClip( Clip* clip )
{ {
MediaCellView* cell = new MediaCellView( clip->getUuid() ); MediaCellView* cell = new MediaCellView( clip->uuid() );
cell->containsClip(); cell->containsClip();
connect( cell, SIGNAL( cellSelected( QUuid ) ), this, SLOT( cellSelection( const QUuid& ) ) ); connect( cell, SIGNAL( cellSelected( QUuid ) ), this, SLOT( cellSelection( const QUuid& ) ) );
connect( cell, SIGNAL( cellDeleted( const QUuid& ) ), this, SLOT( clipDeletion( const QUuid& ) ) ); connect( cell, SIGNAL( cellDeleted( const QUuid& ) ), this, SLOT( clipDeletion( const QUuid& ) ) );
...@@ -70,9 +70,9 @@ void ClipListViewController::addClip( Clip* clip ) ...@@ -70,9 +70,9 @@ void ClipListViewController::addClip( Clip* clip )
QString number; QString number;
number.setNum( m_cells.size() + 1 ); number.setNum( m_cells.size() + 1 );
cell->setTitle( clip->getParent()->fileName() + number ); cell->setTitle( clip->getParent()->fileName() + number );
cell->setLength( clip->getLengthSecond(), false ); cell->setLength( clip->lengthSecond(), false );
addCell( cell ); addCell( cell );
m_cells.insert( clip->getUuid(), cell ); m_cells.insert( clip->uuid(), cell );
cell->enableCell(); cell->enableCell();
} }
......
...@@ -144,13 +144,13 @@ void AbstractGraphicsMediaItem::contextMenuEvent( QGraphicsSceneContextMenuEvent ...@@ -144,13 +144,13 @@ void AbstractGraphicsMediaItem::contextMenuEvent( QGraphicsSceneContextMenuEvent
if ( ( m_muted = muteAction->isChecked() ) ) if ( ( m_muted = muteAction->isChecked() ) )
{ {
tracksView()->m_mainWorkflow->muteClip( clip()->getUuid(), tracksView()->m_mainWorkflow->muteClip( clip()->uuid(),
trackNumber(), trackNumber(),
mediaType() ); mediaType() );
} }
else else
{ {
tracksView()->m_mainWorkflow->unmuteClip( clip()->getUuid(), tracksView()->m_mainWorkflow->unmuteClip( clip()->uuid(),
trackNumber(), trackNumber(),
mediaType() ); mediaType() );
} }
...@@ -176,7 +176,7 @@ void AbstractGraphicsMediaItem::contextMenuEvent( QGraphicsSceneContextMenuEvent ...@@ -176,7 +176,7 @@ void AbstractGraphicsMediaItem::contextMenuEvent( QGraphicsSceneContextMenuEvent
{ {
item1->group( this ); item1->group( this );
tracksView()->moveMediaItem( item1, item1->trackNumber(), startPos() ); tracksView()->moveMediaItem( item1, item1->trackNumber(), startPos() );
MainWorkflow::getInstance()->moveClip( item1->clip()->getUuid(), item1->trackNumber(), MainWorkflow::getInstance()->moveClip( item1->clip()->uuid(), item1->trackNumber(),
trackNumber(), startPos(), trackNumber(), startPos(),
item1->mediaType() ); item1->mediaType() );
} }
...@@ -216,13 +216,13 @@ void AbstractGraphicsMediaItem::resize( qint64 size, From from ) ...@@ -216,13 +216,13 @@ void AbstractGraphicsMediaItem::resize( qint64 size, From from )
return; return;
if ( clip()->getParent()->fileType() != Media::Image ) if ( clip()->getParent()->fileType() != Media::Image )
if ( size > clip()->getMaxEnd() ) if ( size > clip()->maxEnd() )
return; return;
if ( from == BEGINNING ) if ( from == BEGINNING )
{ {
if ( clip()->getParent()->fileType() != Media::Image ) if ( clip()->getParent()->fileType() != Media::Image )
if ( clip()->getBegin() + size > clip()->getMaxEnd() ) if ( clip()->begin() + size > clip()->maxEnd() )
return; return;
//FIXME //FIXME
// tracksView()->getRenderer()->resizeClip( clip(), clip()->getBegin(), clip()->getBegin() + size, 0, //This parameter is unused in this case // 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 ) ...@@ -232,16 +232,16 @@ void AbstractGraphicsMediaItem::resize( qint64 size, From from )
{ {
if ( clip()->getParent()->fileType() != Media::Image ) if ( clip()->getParent()->fileType() != Media::Image )
{ {
qint64 newBegin = qMax( clip()->getEnd() - size, (qint64)0 ); qint64 newBegin = qMax( clip()->end() - size, (qint64)0 );
if ( clip()->getMaxBegin() > newBegin ) if ( clip()->maxBegin() > newBegin )
return; return;
m_resizeExpected = true; m_resizeExpected = true;
qint64 oldLength = clip()->getLength(); qint64 oldLength = clip()->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()->getEnd() - size, (qint64)0 ), clip()->getEnd(), MainWorkflow::getInstance()->resizeClip( clip(), qMax( clip()->end() - size, (qint64)0 ), clip()->end(),
newStart, trackNumber(), mediaType() ); newStart, trackNumber(), mediaType() );
setStartPos( newStart ); setStartPos( newStart );
//FIXME //FIXME
...@@ -249,7 +249,7 @@ void AbstractGraphicsMediaItem::resize( qint64 size, From from ) ...@@ -249,7 +249,7 @@ void AbstractGraphicsMediaItem::resize( qint64 size, From from )
else else
{ {
m_resizeExpected = true; m_resizeExpected = true;
qint64 oldLength = clip()->getLength(); qint64 oldLength = clip()->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,
...@@ -262,7 +262,7 @@ void AbstractGraphicsMediaItem::resize( qint64 size, From from ) ...@@ -262,7 +262,7 @@ void AbstractGraphicsMediaItem::resize( qint64 size, From from )
} }
} }
setWidth( clip()->getLength() ); setWidth( clip()->length() );
} }
void AbstractGraphicsMediaItem::adjustLength() void AbstractGraphicsMediaItem::adjustLength()
...@@ -273,7 +273,7 @@ void AbstractGraphicsMediaItem::adjustLength() ...@@ -273,7 +273,7 @@ void AbstractGraphicsMediaItem::adjustLength()
return ; return ;
} }
Q_ASSERT( clip() ); Q_ASSERT( clip() );
resize( clip()->getLength() ); resize( clip()->length() );
} }
bool AbstractGraphicsMediaItem::resizeZone( const QPointF& position ) bool AbstractGraphicsMediaItem::resizeZone( const QPointF& position )
......
...@@ -42,7 +42,7 @@ GraphicsAudioItem::GraphicsAudioItem( Clip* clip ) : m_clip( clip ) ...@@ -42,7 +42,7 @@ GraphicsAudioItem::GraphicsAudioItem( Clip* clip ) : m_clip( clip )
setAcceptHoverEvents( true ); setAcceptHoverEvents( true );
// Adjust the width // Adjust the width
setWidth( clip->getLength() ); setWidth( clip->length() );
// Automatically adjust future changes // Automatically adjust future changes
connect( clip, SIGNAL( lengthUpdated() ), this, SLOT( adjustLength() ) ); connect( clip, SIGNAL( lengthUpdated() ), this, SLOT( adjustLength() ) );
} }
......
...@@ -50,7 +50,7 @@ public: ...@@ -50,7 +50,7 @@ public:
virtual int type() const { return Type; } virtual int type() const { return Type; }
virtual bool expandable() const { return false; } virtual bool expandable() const { return false; }
virtual bool moveable() const { return true; } 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 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 );
......
...@@ -42,7 +42,7 @@ GraphicsMovieItem::GraphicsMovieItem( Clip* clip ) : m_clip( clip ) ...@@ -42,7 +42,7 @@ GraphicsMovieItem::GraphicsMovieItem( Clip* clip ) : m_clip( clip )
setAcceptHoverEvents( true ); setAcceptHoverEvents( true );
// Adjust the width // Adjust the width
setWidth( clip->getLength() ); setWidth( clip->length() );
// Automatically adjust for future changes // Automatically adjust for future changes
connect( clip, SIGNAL( lengthUpdated() ), this, SLOT( adjustLength() ) ); connect( clip, SIGNAL( lengthUpdated() ), this, SLOT( adjustLength() ) );
} }
......
...@@ -49,7 +49,7 @@ public: ...@@ -49,7 +49,7 @@ public:
virtual int type() const { return Type; } virtual int type() const { return Type; }
virtual bool expandable() const { return false; } virtual bool expandable() const { return false; }
virtual bool moveable() const { return true; } 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 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 );
......
...@@ -173,5 +173,5 @@ void Timeline::actionMoveClip( const QUuid& uuid, unsigned int track, qint64 tim ...@@ -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 ) 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 ...@@ -253,7 +253,7 @@ TracksView::addMediaItem( Clip *clip, unsigned int track, MainWorkflow::TrackTyp
{ {
AbstractGraphicsMediaItem *item = AbstractGraphicsMediaItem *item =
dynamic_cast<AbstractGraphicsMediaItem*>( trackItems.at( i ) ); dynamic_cast<AbstractGraphicsMediaItem*>( trackItems.at( i ) );
if ( !item || item->uuid() != clip->getUuid() ) continue; if ( !item || item->uuid() != clip->uuid() ) continue;
// Item already exist: goodbye! // Item already exist: goodbye!
return; return;
} }
...@@ -863,8 +863,8 @@ TracksView::mousePressEvent( QMouseEvent *event ) ...@@ -863,8 +863,8 @@ TracksView::mousePressEvent( QMouseEvent *event )
m_actionResizeType = AbstractGraphicsMediaItem::BEGINNING; m_actionResizeType = AbstractGraphicsMediaItem::BEGINNING;
m_actionResize = true; m_actionResize = true;
m_actionResizeStart = mapToScene( event->pos() ).x(); m_actionResizeStart = mapToScene( event->pos() ).x();
m_actionResizeBase = item->clip()->getLength(); m_actionResizeBase = item->clip()->length();
m_actionResizeOldBegin = item->clip()->getBegin(); m_actionResizeOldBegin = item->clip()->begin();
m_actionItem = item; m_actionItem = item;
} }
else if ( item->moveable() ) else if ( item->moveable() )
...@@ -928,7 +928,7 @@ TracksView::mouseReleaseEvent( QMouseEvent *event ) ...@@ -928,7 +928,7 @@ TracksView::mouseReleaseEvent( QMouseEvent *event )
UndoStack::getInstance()->beginMacro( "Move clip" ); UndoStack::getInstance()->beginMacro( "Move clip" );
Commands::trigger( new Commands::MainWorkflow::MoveClip( m_mainWorkflow, Commands::trigger( new Commands::MainWorkflow::MoveClip( m_mainWorkflow,
m_actionItem->clip()->getUuid(), m_actionItem->clip()->uuid(),
m_actionItem->oldTrackNumber, m_actionItem->oldTrackNumber,
m_actionItem->trackNumber(), m_actionItem->trackNumber(),
m_actionItem->startPos(), m_actionItem->startPos(),
...@@ -938,7 +938,7 @@ TracksView::mouseReleaseEvent( QMouseEvent *event ) ...@@ -938,7 +938,7 @@ TracksView::mouseReleaseEvent( QMouseEvent *event )
if ( m_actionItem->groupItem() ) if ( m_actionItem->groupItem() )
{ {
Commands::trigger( new Commands::MainWorkflow::MoveClip( m_mainWorkflow, 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()->oldTrackNumber,
m_actionItem->groupItem()->trackNumber(), m_actionItem->groupItem()->trackNumber(),
m_actionItem->groupItem()->startPos(), m_actionItem->groupItem()->startPos(),
...@@ -960,8 +960,8 @@ TracksView::mouseReleaseEvent( QMouseEvent *event ) ...@@ -960,8 +960,8 @@ TracksView::mouseReleaseEvent( QMouseEvent *event )
Clip *clip = m_actionItem->clip(); Clip *clip = m_actionItem->clip();
//This is a "pointless action". The resize already occured. However, by doing this //This is a "pointless action". The resize already occured. However, by doing this
//we can have an undo action. //we can have an undo action.
Commands::trigger( new Commands::MainWorkflow::ResizeClip( clip->getUuid(), clip->getBegin(), Commands::trigger( new Commands::MainWorkflow::ResizeClip( clip->uuid(), clip->begin(),
clip->getEnd(), m_actionResizeOldBegin, m_actionResizeOldBegin + m_actionResizeBase, clip->end(), m_actionResizeOldBegin, m_actionResizeOldBegin + m_actionResizeBase,
m_actionItem->pos().x(), m_actionResizeStart, m_actionItem->trackNumber(), m_actionItem->mediaType() ) ); m_actionItem->pos().x(), m_actionResizeStart, m_actionItem->trackNumber(), m_actionItem->mediaType() ) );
updateDuration(); updateDuration();
} }
...@@ -1171,6 +1171,6 @@ TracksView::split( AbstractGraphicsMediaItem *item, qint64 frame ) ...@@ -1171,6 +1171,6 @@ TracksView::split( AbstractGraphicsMediaItem *item, qint64 frame )
//therefore, the position of the newly created clip is //therefore, the position of the newly created clip is
//the splitted clip pos + the splitting point (ie startPos() + frame) //the splitted clip pos + the splitting point (ie startPos() + frame)
Commands::trigger( new Commands::MainWorkflow::SplitClip( item->clip(), item->trackNumber(), 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() ) ); item->mediaType() ) );
} }
...@@ -263,9 +263,9 @@ Library::saveProject( QDomDocument& doc, QDomElement& rootNode ) ...@@ -263,9 +263,9 @@ Library::saveProject( QDomDocument& doc, QDomElement& rootNode )
foreach( Clip* c, it.value()->clips()->values() ) foreach( Clip* c, it.value()->clips()->values() )
{ {
QDomElement clip = doc.createElement( "clip" ); QDomElement clip = doc.createElement( "clip" );
clip.setAttribute( "begin", c->getBegin() ); clip.setAttribute( "begin", c->begin() );
clip.setAttribute( "end", c->getEnd() ); clip.setAttribute( "end", c->end() );
clip.setAttribute( "uuid", c->getUuid() ); clip.setAttribute( "uuid", c->uuid() );
clip.setAttribute( "parentUuid", c->getParent()->uuid() ); clip.setAttribute( "parentUuid", c->getParent()->uuid() );
clips.appendChild( clip ); clips.appendChild( clip );
} }
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
const int Clip::DefaultFPS = 30; const int Clip::DefaultFPS = 30;
Clip::Clip( Media* parent ) : Clip::Clip( Media *parent ) :
m_parent( parent ), m_parent( parent ),
m_begin( 0 ), m_begin( 0 ),
m_end( parent->nbFrames() ), m_end( parent->nbFrames() ),
...@@ -42,7 +42,7 @@ Clip::Clip( Media* parent ) : ...@@ -42,7 +42,7 @@ Clip::Clip( Media* parent ) :
computeLength(); computeLength();
} }
Clip::Clip( Clip* creator, qint64 begin, qint64 end ) : Clip::Clip( Clip *creator, qint64 begin, qint64 end ) :
m_parent( creator->getParent() ), m_parent( creator->getParent() ),
m_begin( begin ), m_begin( begin ),
m_end( end ), m_end( end ),
...@@ -53,7 +53,7 @@ Clip::Clip( Clip* creator, qint64 begin, qint64 end ) : ...@@ -53,7 +53,7 @@ Clip::Clip( Clip* creator, qint64 begin, qint64 end ) :
computeLength(); computeLength();
} }
Clip::Clip( Media* parent, qint64 begin, qint64 end /*= -1*/ ) : Clip::Clip( Media *parent, qint64 begin, qint64 end /*= -1*/ ) :
m_parent( parent ), m_parent( parent ),
m_begin( begin ), m_begin( begin ),
m_end( end ), m_end( end ),
...@@ -72,7 +72,7 @@ Clip::Clip( Media* parent, qint64 begin, qint64 end /*= -1*/ ) : ...@@ -72,7 +72,7 @@ Clip::Clip( Media* parent, qint64 begin, qint64 end /*= -1*/ ) :
computeLength(); computeLength();
} }
Clip::Clip( const Clip* clip ) : Clip::Clip( const Clip *clip ) :
m_parent( clip->m_parent ), m_parent( clip->m_parent ),
m_begin( clip->m_begin ), m_begin( clip->m_begin ),
m_end( clip->m_end ), m_end( clip->m_end ),
...@@ -86,7 +86,7 @@ Clip::Clip( const Clip* clip ) : ...@@ -86,7 +86,7 @@ Clip::Clip( const Clip* clip ) :
m_Uuid = QUuid::createUuid(); 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_begin( begin),
m_end( end ), m_end( end ),
m_maxBegin( begin ), m_maxBegin( begin ),
...@@ -100,7 +100,7 @@ Clip::Clip( const QUuid& uuid, qint64 begin, qint64 end ) : ...@@ -100,7 +100,7 @@ Clip::Clip( const QUuid& uuid, qint64 begin, qint64 end ) :
computeLength(); 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_parent( parent ),
m_begin( begin ), m_begin( begin ),
m_end( end ), m_end( end ),
...@@ -114,32 +114,38 @@ Clip::~Clip() ...@@ -114,32 +114,38 @@ Clip::~Clip()
{ {
} }
qint64 Clip::getBegin() const qint64
Clip::begin() const
{ {
return m_begin; return m_begin;
} }
qint64 Clip::getEnd() const qint64
Clip::end() const
{ {
return m_end; return m_end;
} }
Media* Clip::getParent() Media*
Clip::getParent()
{ {
return m_parent; return m_parent;
} }
qint64 Clip::getLength() const qint64
Clip::length() const
{ {
return m_length; return m_length;
} }
qint64 Clip::getLengthSecond() const qint64
Clip::lengthSecond() const
{ {
return m_lengthSeconds; return m_lengthSeconds;
} }
void Clip::computeLength() void
Clip::computeLength()
{ {
if ( m_parent->inputType() == Media::File ) if ( m_parent->inputType() == Media::File )
{ {
...@@ -157,17 +163,20 @@ void Clip::computeLength() ...@@ -157,17 +163,20 @@ void Clip::computeLength()
} }
} }
const QStringList& Clip::getMetaTags() const const QStringList&
Clip::metaTags() const
{ {
return m_metaTags; return m_metaTags;
} }
void Clip::setMetaTags( const QStringList& tags ) void
Clip::setMetaTags( const QStringList &tags )