Commit 5bd86267 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Removed anything related to the import from the library

parent 1fcf654f
......@@ -97,26 +97,7 @@ void
Library::deleteMedia( const QUuid& uuid )
{
if ( m_medias.contains( uuid ) )
{
disconnect( m_medias.value( uuid ),
SIGNAL( audioSpectrumComputed( const QUuid& ) ),
this,
SLOT( deleteMedia( const QUuid& ) ) );
delete m_medias.take( uuid );
}
else if ( m_mediaToDelete.contains( uuid ) )
{
delete m_mediaToDelete.value( uuid );
}
else if ( m_medias.contains( uuid ) )
{
Media* media = m_medias.take( uuid );
m_mediaToDelete.insert( uuid, media );
connect( media,
SIGNAL( audioSpectrumComputed( const QUuid& ) ),
this,
SLOT( deleteMedia( const QUuid& ) ) );
}
}
void
......@@ -134,18 +115,7 @@ Library::addMedia( const QFileInfo& fileInfo, const QString& uuid )
return;
}
}
connect( media,
SIGNAL( metaDataComputed( Media* ) ),
this,
SLOT( metaDataComputed( Media* ) ), Qt::QueuedConnection );
connect( media,
SIGNAL( snapshotComputed( Media* ) ),
this,
SLOT( snapshotComputed( Media* ) ), Qt::QueuedConnection );
MetaDataManager::getInstance()->computeMediaMetadata( media );
m_medias[media->getUuid()] = media;
}
......@@ -156,55 +126,6 @@ Library::addClip( Clip* clip )
media->addClip( clip );
}
void
Library::loadMedia( const QString& path, const QUuid& uuid )
{
Media* it;
foreach ( it, m_medias )
{
if ( it->getFileInfo()->absoluteFilePath() == path )
{
m_medias.remove( it->getUuid() );
m_medias[uuid] = it;
it->setUuid( uuid );
return ;
}
}
if ( QFile::exists( path ) == false )
{
QMessageBox::warning( NULL, tr( "Import error" ),
tr( "Can't open file :" ) + path );
return ;
}
Media* media = new Media( path, uuid );
connect( media,
SIGNAL( metaDataComputed( Media* ) ),
this,
SLOT( metaDataComputed( Media* ) ) );
MetaDataManager::getInstance()->computeMediaMetadata( media );
m_medias[uuid] = media;
}
void
Library::metaDataComputed( Media* media )
{
disconnect( media,
SIGNAL( metaDataComputed( Media* ) ),
this,
SLOT( metaDataComputed( Media* ) ) );
emit updateMediaRequested( media->getUuid() );
}
void
Library::snapshotComputed( Media *media )
{
disconnect( media,
SIGNAL( snapshotComputed( Media* ) ),
this,
SLOT( snapshotComputed( Media* ) ) );
emit updateMediaRequested( media->getUuid() );
}
bool
Library::mediaAlreadyLoaded( const QFileInfo& fileInfo )
{
......
......@@ -131,16 +131,11 @@ private:
* \param path The path of the media file
* \param uuid The uuid you want for the new media
*/
void loadMedia( const QString& path, const QUuid& uuid );
/**
* \brief The List of medias loaded into the library
*/
QHash<QUuid, Media*> m_medias;
/**
* \brief The list of media being queued for deletion
*/
QHash<QUuid, Media*> m_mediaToDelete;
/**
* \brief This method allows to get whereas Media or clip by uuid
* \param container The type of container used for storage, where T is Clip or Media
......@@ -195,20 +190,11 @@ public slots:
* \brief Remove a clip from a media
*/
void removeClip( const QUuid& mediaId, const QUuid& clipId );
private slots:
/**
* \brief Will update the media cell with its metadata
*/
void metaDataComputed( Media* media );
/**
* \brief Will update the media cell with its snapshot
*/
void snapshotComputed( Media* media );
signals:
/**
* \brief This signal should be emitted to tell a new media have been imported
* \param media The newly imported media
* \brief This signal should be emitted to tell a new media have been added
* \param media The newly added media
*/
void newMediaLoaded( Media* );
/**
......
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