[vlmc-devel] Library: Add clipAdded and clipRemoved signals
Yikai Lu
git at videolan.org
Mon Dec 12 04:19:55 CET 2016
vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Sun Dec 11 21:06:26 2016 -0600| [6f9be2ef7f2381932958ba3778708e49f889b3ab] | committer: Yikai Lu
Library: Add clipAdded and clipRemoved signals
> https://code.videolan.org/videolan/vlmc/commit/6f9be2ef7f2381932958ba3778708e49f889b3ab
---
src/Library/Library.cpp | 3 +++
src/Library/Library.h | 3 +++
2 files changed, 6 insertions(+)
diff --git a/src/Library/Library.cpp b/src/Library/Library.cpp
index 5eabf9e..1ae4f83 100644
--- a/src/Library/Library.cpp
+++ b/src/Library/Library.cpp
@@ -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 );
diff --git a/src/Library/Library.h b/src/Library/Library.h
index 41cd431..163e80b 100644
--- a/src/Library/Library.h
+++ b/src/Library/Library.h
@@ -130,6 +130,9 @@ signals:
void discoveryProgress( QString );
void discoveryCompleted( QString );
+ void clipAdded( const QString& uuid );
+ void clipRemoved( const QString& uuid );
+
};
#endif // LIBRARY_H
More information about the Vlmc-devel
mailing list