Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
5bd86267
Commit
5bd86267
authored
Feb 19, 2010
by
Hugo Beauzee-Luyssen
Browse files
Removed anything related to the import from the library
parent
1fcf654f
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Library/Library.cpp
View file @
5bd86267
...
...
@@ -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
)
{
...
...
src/Library/Library.h
View file @
5bd86267
...
...
@@ -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
import
ed
* \param media The newly
import
ed media
* \brief This signal should be emitted to tell a new media have been
add
ed
* \param media The newly
add
ed media
*/
void
newMediaLoaded
(
Media
*
);
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment