Commit abe1c6f3 authored by Ludovic Fauvet's avatar Ludovic Fauvet

Remove all occurences of clip->getUuid()

After some discussions we decided to remove this uid which didn't fit
well.
parent 4f40f4a8
......@@ -82,7 +82,7 @@ void LibraryWidget::removeMedia( const QUuid& uuid )
ListViewMediaItem* item;
foreach (item, *m_clips)
{
if ( item->getClip()->getUuid() == uuid )
if ( item->getClip()->getParent()->getUuid() == uuid )
{
switch( item->getFileType() )
{
......
......@@ -82,7 +82,9 @@ void MediaListWidget::mouseMoveEvent( QMouseEvent* event )
ListViewMediaItem* item = static_cast<ListViewMediaItem*>( currentItem() );
QMimeData* mimeData = new QMimeData;
mimeData->setData( "vlmc/uuid", item->getClip()->getUuid().toString().toAscii() );
//FIXME the second argument is a media UUID instead of a Clip
// and this is not logical... but it works.
mimeData->setData( "vlmc/uuid", item->getClip()->getParent()->getUuid().toString().toAscii() );
QDrag* drag = new QDrag( this );
drag->setMimeData( mimeData );
const QPixmap& dragPixmap = static_cast<ListViewMediaItem*>( currentItem() )->getClip()->getParent()->getSnapshot();
......
......@@ -59,7 +59,7 @@ void Library::removingMediaAsked( const QUuid& uuid )
void Library::metaDataComputed( Media* media )
{
Clip* clip = new Clip( media );
m_clips[clip->getUuid()] = clip;
m_clips[media->getUuid()] = clip;
emit newClipLoaded( clip );
}
......
......@@ -30,42 +30,39 @@
Clip::Clip( Media* parent ) : m_parent( parent ), m_begin( 0.0f ), m_end( 1.0f )
{
init();
m_timelineUuid = QUuid::createUuid();
computeLength();
}
Clip::Clip( Clip* creator, float begin, float end ) : m_parent( creator->getParent() ), m_begin( begin ), m_end( end )
{
init();
m_timelineUuid = QUuid::createUuid();
computeLength();
}
Clip::Clip( Media* parent, float begin, float end ) : m_parent( parent ), m_begin( begin ), m_end( end )
{
Q_ASSERT( parent->getInputType() == Media::File || ( begin == .0f && end == .0f ) );
init();
m_timelineUuid = QUuid::createUuid();
computeLength();
}
Clip::Clip( Clip* clip ) :
Clip::Clip( Clip* clip ) :
m_parent( clip->m_parent ),
m_begin( clip->m_begin ),
m_end( clip->m_end ),
m_length( clip->m_length ),
m_lengthSeconds( clip->m_lengthSeconds ),
m_uuid( clip->m_uuid ),
m_metaTags( clip->m_metaTags ),
m_notes( clip->m_notes )
{
m_timelineUuid = QUuid::createUuid();
}
Clip::~Clip()
{
}
void Clip::init()
{
m_uuid = QUuid::createUuid();
computeLength();
}
float Clip::getBegin() const
{
return m_begin;
......@@ -109,11 +106,6 @@ void Clip::computeLength()
}
}
const QUuid& Clip::getUuid() const
{
return m_uuid;
}
const QStringList& Clip::getMetaTags() const
{
return m_metaTags;
......@@ -154,11 +146,6 @@ const QUuid& Clip::getTimelineUuid() const
return m_timelineUuid;
}
void Clip::setTimelineUuid( const QUuid& uuid )
{
m_timelineUuid = uuid;
}
void Clip::setBegin( float begin )
{
Q_ASSERT( begin >= .0f );
......
......@@ -90,7 +90,7 @@ class Clip : public QObject
\return The Clip's Uuid as a QUuid
*/
const QUuid& getUuid() const;
const QUuid& getTimelineUuid() const;
const QStringList& getMetaTags() const;
......@@ -100,21 +100,14 @@ class Clip : public QObject
const QString& getNotes() const;
void setNotes( const QString& notes );
void setTimelineUuid( const QUuid& uuid );
private:
void computeLength();
void init();
Media* m_parent;
float m_begin;
float m_end;
qint64 m_length;
qint64 m_lengthSeconds;
/**
* The Clip's UUID. It's used to identify the clip in the library.
*/
QUuid m_uuid;
/**
* 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
......
......@@ -142,7 +142,7 @@ void ClipRenderer::previousFrame()
void ClipRenderer::mediaUnloaded( const QUuid& uuid )
{
if ( m_selectedClip != NULL && m_selectedClip->getUuid() == uuid )
if ( m_selectedClip != NULL && m_selectedClip->getTimelineUuid() == uuid )
{
m_mediaPlayer->stop();
m_clipLoaded = false;
......
......@@ -82,7 +82,6 @@ void MainWorkflow::addClip( Clip* clip, unsigned int trackId, qint64 start )
m_tracks[trackId]->addClip( clip, start );
if ( m_tracks[trackId]->getLength() > m_length )
m_length = m_tracks[trackId]->getLength();
clip->setTimelineUuid( QUuid::createUuid() );
}
void MainWorkflow::computeLength()
......
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