[vlmc-devel] Use ClipLibraryView

Yikai Lu git at videolan.org
Mon Dec 12 04:20:04 CET 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Sun Dec 11 21:15:50 2016 -0600| [a1a1aa3d3405ca6fa542ac0fe031b953ff700055] | committer: Yikai Lu

Use ClipLibraryView

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

 Makefile.am            |  5 +++++
 src/Gui/MainWindow.cpp | 13 +++++++++++--
 src/Gui/MainWindow.h   |  7 +++++--
 3 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 4f84bb4..8d81dd7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -124,6 +124,7 @@ nodist_vlmc_SOURCES = \
 	src/Library/Library.moc.cpp \
 	src/Library/MediaLibraryModel.moc.cpp \
 	src/Gui/library/MediaLibraryView.moc.cpp \
+        src/Gui/library/ClipLibraryView.moc.cpp \
 	$(NULL)
 
 vlmc_RC = \
@@ -184,6 +185,7 @@ vlmc_SOURCES += \
 	src/Gui/export/ShareOnInternet.cpp \
 	src/Gui/import/TagWidget.cpp \
 	src/Gui/library/MediaLibraryView.cpp \
+        src/Gui/library/ClipLibraryView.cpp \
 	src/Gui/media/ClipMetadataDisplayer.cpp \
 	src/Gui/preview/LCDTimecode.cpp \
 	src/Gui/preview/PreviewRuler.cpp \
@@ -248,6 +250,7 @@ vlmc_SOURCES += \
 	src/Gui/About.h \
 	src/Gui/LanguageHelper.h \
 	src/Gui/library/MediaLibraryView.h \
+        src/Gui/library/ClipLibraryView.h \
 	src/Gui/library/ViewController.h \
 	src/Gui/media/ClipMetadataDisplayer.h \
 	src/Gui/preview/RenderWidget.h \
@@ -383,7 +386,9 @@ vlmc_QML = \
 	src/Gui/timeline/ClipContextMenu.qml \
 	src/Gui/timeline/Cursor.qml \
 	src/Gui/library/ui/MediaLibraryView.qml \
+        src/Gui/library/ui/ClipLibraryView.qml \
 	src/Gui/library/ui/MediaItem.qml \
+	src/Gui/library/ui/ClipItem.qml \
 	src/Gui/effectsengine/Effect.qml \
 	src/Gui/effectsengine/EffectsListView.qml \
 	$(NULL)
diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp
index 90ccbc8..bae570f 100644
--- a/src/Gui/MainWindow.cpp
+++ b/src/Gui/MainWindow.cpp
@@ -57,6 +57,7 @@
 /* Widgets */
 #include "effectsengine/EffectsListView.h"
 #include "library/MediaLibraryView.h"
+#include "library/ClipLibraryView.h"
 #include "preview/PreviewWidget.h"
 #include "timeline/Timeline.h"
 
@@ -177,7 +178,8 @@ MainWindow::retranslateUi()
 {
     m_dockedUndoView->setWindowTitle( tr( "History" ) );
     m_dockedEffectsList->setWindowTitle( tr( "Effects List" ) );
-    m_dockedLibrary->setWindowTitle( tr( "Media Library" ) );
+    m_dockedMediaLibrary->setWindowTitle( tr( "Media Library" ) );
+    m_dockedClipLibrary->setWindowTitle( tr( "Clip Library" ) );
     m_dockedClipPreview->setWindowTitle( tr( "Clip Preview" ) );
     m_dockedProjectPreview->setWindowTitle( tr( "Project Preview" ) );
 }
@@ -510,7 +512,10 @@ void
 MainWindow::setupLibrary()
 {
     m_mediaLibrary = new MediaLibraryView( this );
-    m_dockedLibrary = dockWidget( m_mediaLibrary->container(), Qt::TopDockWidgetArea );
+    m_clipLibrary = new ClipLibraryView( this );
+    m_dockedMediaLibrary = dockWidget( m_mediaLibrary->container(), Qt::TopDockWidgetArea );
+    m_dockedClipLibrary = dockWidget( m_clipLibrary->container(), Qt::TopDockWidgetArea );
+    tabifyDockWidget( m_dockedMediaLibrary, m_dockedClipLibrary );
 }
 
 void
@@ -522,6 +527,10 @@ MainWindow::setupClipPreview()
     m_clipPreview->setRenderer( renderer );
     connect( Core::instance()->library(), SIGNAL( clipRemoved( const QUuid& ) ),
              renderer, SLOT( clipUnloaded( const QUuid& ) ) );
+    connect( m_clipLibrary, &ClipLibraryView::clipSelected, renderer, [renderer]( const QString& uuid )
+    {
+        renderer->setClip( Core::instance()->library()->clip( uuid ).data() );
+    } );
 
     KeyboardShortcutHelper* clipShortcut = new KeyboardShortcutHelper( "keyboard/mediapreview", this );
     connect( clipShortcut, SIGNAL( activated() ), m_clipPreview, SLOT( on_pushButtonPlay_clicked() ) );
diff --git a/src/Gui/MainWindow.h b/src/Gui/MainWindow.h
index c5349d4..fceb5c1 100644
--- a/src/Gui/MainWindow.h
+++ b/src/Gui/MainWindow.h
@@ -37,6 +37,7 @@ class QProgressBar;
 #include "ui/MainWindow.h"
 
 class   EffectsListView;
+class   ClipLibraryView;
 class   MediaLibraryView;
 class   PreviewWidget;
 class   Project;
@@ -128,12 +129,14 @@ private:
     SettingsDialog*         m_DefaultProjectPreferences;
     SettingsDialog*         m_projectPreferences;
     ProjectWizard*          m_wizard;
-    MediaLibraryView            *m_mediaLibrary;
+    MediaLibraryView*       m_mediaLibrary;
+    ClipLibraryView*        m_clipLibrary;
     EffectsListView*        m_effectsList;
     QUndoView*              m_undoView;
     QDockWidget*            m_dockedUndoView;
     QDockWidget*            m_dockedEffectsList;
-    QDockWidget*            m_dockedLibrary;
+    QDockWidget*            m_dockedClipLibrary;
+    QDockWidget*            m_dockedMediaLibrary;
     QDockWidget*            m_dockedClipPreview;
     QDockWidget*            m_dockedProjectPreview;
     QProgressBar*           m_progressBar;



More information about the Vlmc-devel mailing list