[vlmc-devel] Library: Watch subclip creation to allow clips to be fetched directly from library

Hugo Beauzée-Luyssen git at videolan.org
Fri Aug 19 02:41:49 CEST 2016


vlmc | branch: medialibrary | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Fri Aug 19 02:17:19 2016 +0200| [f7b16b423e27ae0a3c08fad5241183ae771ab533] | committer: Hugo Beauzée-Luyssen

Library: Watch subclip creation to allow clips to be fetched directly from library

> https://code.videolan.org/videolan/vlmc/commit/f7b16b423e27ae0a3c08fad5241183ae771ab533
---

 src/Library/Library.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/Library/Library.cpp b/src/Library/Library.cpp
index 91d400a..2d8e753 100644
--- a/src/Library/Library.cpp
+++ b/src/Library/Library.cpp
@@ -85,6 +85,15 @@ Library::addMedia( QSharedPointer<Media> media )
     if ( m_media.contains( media->id() ) )
         return;
     m_media[media->id()] = media;
+    connect( media.data(), &Media::subclipAdded, [this]( Clip* c ) {
+        m_clips[c->uuid()] = c;
+        setCleanState( false );
+    });
+    connect( media.data(), &Media::subclipRemoved, [this]( const QUuid& uuid ) {
+        m_clips.remove( uuid );
+        // This seems wrong, for instance if we undo a clip splitting
+        setCleanState( false );
+    } );
 }
 
 bool



More information about the Vlmc-devel mailing list