Commit 6f9be2ef authored by luyikei's avatar luyikei

Library: Add clipAdded and clipRemoved signals

parent c9987f17
......@@ -105,14 +105,17 @@ Library::addMedia( QSharedPointer<Media> media )
return;
m_media[media->id()] = media;
m_clips[media->baseClip()->uuid()] = media->baseClip();
emit clipAdded( media->baseClip()->uuid().toString() );
vlmcDebug() << "Clip " << media->baseClip()->uuid().toString() << " is added to Library";
connect( media.data(), &Media::subclipAdded, [this]( QSharedPointer<Clip> c ) {
m_clips[c->uuid()] = c;
emit clipAdded( c->uuid().toString() );
vlmcDebug() << "Clip " << c->uuid().toString() << " is added to Library";
setCleanState( false );
});
connect( media.data(), &Media::subclipRemoved, [this]( const QUuid& uuid ) {
m_clips.remove( uuid );
emit clipRemoved( uuid.toString() );
vlmcDebug() << "Clip " << uuid.toString() << " is removed in Library";
// This seems wrong, for instance if we undo a clip splitting
setCleanState( false );
......
......@@ -130,6 +130,9 @@ signals:
void discoveryProgress( QString );
void discoveryCompleted( QString );
void clipAdded( const QString& uuid );
void clipRemoved( const QString& uuid );
};
#endif // LIBRARY_H
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