[vlmc-devel] Plugin notification bar with medialibrary

Hugo Beauzée-Luyssen git at videolan.org
Mon Jun 6 01:55:30 CEST 2016


vlmc | branch: medialibrary | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Jun  6 01:44:37 2016 +0200| [aac93e0f82eb82ea3cd6f2955e77068befca0fdb] | committer: Hugo Beauzée-Luyssen

Plugin notification bar with medialibrary

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

 src/Gui/MainWindow.cpp       | 11 +++++++++++
 src/Library/MediaLibrary.cpp | 15 ++++++++++-----
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp
index 3c618cc..0381761 100644
--- a/src/Gui/MainWindow.cpp
+++ b/src/Gui/MainWindow.cpp
@@ -40,6 +40,7 @@
 #include "Tools/VlmcLogger.h"
 #include "EffectsEngine/EffectsEngine.h"
 #include "Backend/IBackend.h"
+#include "Library/MediaLibrary.h"
 #include "Workflow/MainWorkflow.h"
 #include "Renderer/WorkflowRenderer.h"
 #include "Renderer/ClipRenderer.h"
@@ -116,6 +117,16 @@ MainWindow::MainWindow( Backend::IBackend* backend, QWidget *parent )
              this, SLOT( onProjectSaved() ) );
     connect( Core::instance()->project(), &Project::cleanStateChanged,
              this, &MainWindow::cleanStateChanged );
+    connect( Core::instance()->mediaLibrary(), &MediaLibrary::progressUpdated,
+             NotificationZone::instance(), &NotificationZone::progressUpdated );
+    connect( Core::instance()->mediaLibrary(), &MediaLibrary::discoveryStarted,
+         [](const QString& folder) {
+            NotificationZone::instance()->notify( "Discovering " + folder + "..." );
+    });
+    connect( Core::instance()->mediaLibrary(), &MediaLibrary::reloadStarted,
+        [](const QString& folder) {
+            NotificationZone::instance()->notify( "Reloading medialibrary (" + folder + ")..." );
+    });
 
 
     //Connecting Library stuff:
diff --git a/src/Library/MediaLibrary.cpp b/src/Library/MediaLibrary.cpp
index ee63c78..4619527 100644
--- a/src/Library/MediaLibrary.cpp
+++ b/src/Library/MediaLibrary.cpp
@@ -108,22 +108,27 @@ void MediaLibrary::onTracksDeleted( std::vector<int64_t> )
 {
 }
 
-void MediaLibrary::onDiscoveryStarted( const std::string& )
+void MediaLibrary::onDiscoveryStarted( const std::string& entryPoint )
 {
+    emit discoveryStarted( QString::fromStdString( entryPoint ) );
 }
 
-void MediaLibrary::onDiscoveryCompleted( const std::string& )
+void MediaLibrary::onDiscoveryCompleted( const std::string& entryPoint )
 {
+    emit discoveryCompleted( QString::fromStdString( entryPoint ) );
 }
 
-void MediaLibrary::onReloadStarted( const std::string& )
+void MediaLibrary::onReloadStarted( const std::string& entryPoint )
 {
+    emit reloadStarted( QString::fromStdString( entryPoint ) );
 }
 
-void MediaLibrary::onReloadCompleted( const std::string& )
+void MediaLibrary::onReloadCompleted( const std::string& entryPoint )
 {
+    emit reloadCompleted( QString::fromStdString( entryPoint ) );
 }
 
-void MediaLibrary::onParsingStatsUpdated( uint32_t )
+void MediaLibrary::onParsingStatsUpdated( uint32_t percent )
 {
+    emit progressUpdated( static_cast<int>( percent ) );
 }



More information about the Vlmc-devel mailing list