[vlmc-devel] Reflect recent MediaLibrary API changes

Hugo Beauzée-Luyssen git at videolan.org
Mon Jan 2 23:42:16 CET 2017


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Jan  2 22:49:57 2017 +0100| [37615c8650c58a05fcacf75a102ed097f4042d34] | committer: Hugo Beauzée-Luyssen

Reflect recent MediaLibrary API changes

> https://code.videolan.org/videolan/vlmc/commit/37615c8650c58a05fcacf75a102ed097f4042d34
---

 src/Library/Library.cpp           | 24 ++++++++++++++++++------
 src/Library/Library.h             |  3 +++
 src/Library/MediaLibraryModel.cpp |  4 ++--
 src/Media/Media.cpp               |  3 +--
 4 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/src/Library/Library.cpp b/src/Library/Library.cpp
index 1ae4f83..9c74b43 100644
--- a/src/Library/Library.cpp
+++ b/src/Library/Library.cpp
@@ -51,8 +51,8 @@ Library::Library( Settings* vlmcSettings, Settings *projectSettings )
     // Setting up the external media library
     m_ml.reset( NewMediaLibrary() );
     m_ml->setVerbosity( medialibrary::LogLevel::Warning );
-    m_videoModel = new MediaLibraryModel( *m_ml, medialibrary::IMedia::Type::VideoType, this );
-    m_audioModel = new MediaLibraryModel( *m_ml, medialibrary::IMedia::Type::AudioType, this );
+    m_videoModel = new MediaLibraryModel( *m_ml, medialibrary::IMedia::Type::Video, this );
+    m_audioModel = new MediaLibraryModel( *m_ml, medialibrary::IMedia::Type::Audio, this );
 
     auto s = vlmcSettings->createVar( SettingValue::List, QStringLiteral( "vlmc/mlDirs" ), QVariantList(),
                         "Media Library folders", "List of folders VLMC will search for media files",
@@ -216,10 +216,10 @@ Library::onMediaAdded( std::vector<medialibrary::MediaPtr> mediaList )
     {
         switch ( m->type() )
         {
-        case medialibrary::IMedia::Type::VideoType:
+        case medialibrary::IMedia::Type::Video:
             m_videoModel->addMedia( m );
             break;
-        case medialibrary::IMedia::Type::AudioType:
+        case medialibrary::IMedia::Type::Audio:
             m_audioModel->addMedia( m );
             break;
         default:
@@ -235,10 +235,10 @@ Library::onMediaUpdated( std::vector<medialibrary::MediaPtr> mediaList )
     {
         switch ( m->type() )
         {
-        case medialibrary::IMedia::Type::VideoType:
+        case medialibrary::IMedia::Type::Video:
             m_videoModel->updateMedia( m );
             break;
-        case medialibrary::IMedia::Type::AudioType:
+        case medialibrary::IMedia::Type::Audio:
             m_audioModel->updateMedia( m );
             break;
         default:
@@ -327,3 +327,15 @@ Library::onParsingStatsUpdated( uint32_t percent )
 {
     emit progressUpdated( static_cast<int>( percent ) );
 }
+
+void Library::onPlaylistsAdded( std::vector<medialibrary::PlaylistPtr> )
+{
+}
+
+void Library::onPlaylistsModified( std::vector<medialibrary::PlaylistPtr> )
+{
+}
+
+void Library::onPlaylistsDeleted( std::vector<int64_t> )
+{
+}
diff --git a/src/Library/Library.h b/src/Library/Library.h
index 163e80b..5c50927 100644
--- a/src/Library/Library.h
+++ b/src/Library/Library.h
@@ -104,6 +104,9 @@ private:
     virtual void onDiscoveryProgress( const std::string& entryPoint ) override;
     virtual void onDiscoveryCompleted( const std::string& entryPoint ) override;
     virtual void onParsingStatsUpdated( uint32_t percent ) override;
+    virtual void onPlaylistsAdded( std::vector<medialibrary::PlaylistPtr> playlists ) override;
+    virtual void onPlaylistsModified( std::vector<medialibrary::PlaylistPtr> playlists ) override;
+    virtual void onPlaylistsDeleted( std::vector<int64_t> playlistIds ) override;
 
 private:
     std::unique_ptr<medialibrary::IMediaLibrary>    m_ml;
diff --git a/src/Library/MediaLibraryModel.cpp b/src/Library/MediaLibraryModel.cpp
index b319cb5..cb766aa 100644
--- a/src/Library/MediaLibraryModel.cpp
+++ b/src/Library/MediaLibraryModel.cpp
@@ -144,10 +144,10 @@ void MediaLibraryModel::refresh()
 
     switch ( m_mediaType )
     {
-    case medialibrary::IMedia::Type::AudioType:
+    case medialibrary::IMedia::Type::Audio:
         m_media = m_ml.audioFiles();
         break;
-    case medialibrary::IMedia::Type::VideoType:
+    case medialibrary::IMedia::Type::Video:
         m_media = m_ml.videoFiles();
         break;
     default:
diff --git a/src/Media/Media.cpp b/src/Media/Media.cpp
index 5ce81b0..cde058d 100644
--- a/src/Media/Media.cpp
+++ b/src/Media/Media.cpp
@@ -68,8 +68,7 @@ Media::Media( medialibrary::MediaPtr media, const QUuid& uuid /* = QUuid() */ )
     Q_ASSERT( files.size() > 0 );
     for ( const auto& f : files )
     {
-        if ( f->type() == medialibrary::IFile::Type::Entire ||
-             f->type() == medialibrary::IFile::Type::Main )
+        if ( f->type() == medialibrary::IFile::Type::Main )
         {
             m_mlFile = f;
             break;



More information about the Vlmc-devel mailing list