<div><div dir="auto">I wish I knew how to do that. I think is beyond my scope of skills</div></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 20, 2019 at 6:37 AM Michele Valsesia <<a href="mailto:git@videolan.org">git@videolan.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">vlmc | branch: master | Michele Valsesia <<a href="mailto:luni-4@hotmail.it" target="_blank">luni-4@hotmail.it</a>> | Tue Nov 19 12:38:33 2019 +0100| [d8e4a693fe689cb05b90eb4ff8505d32a4c73ee6] | committer: Michele Valsesia<br>
<br>
Fix vlmc build<br>
<br>
Use the latest version of medialibrary to build vlmc<br>
<br>
> <a href="https://code.videolan.org/videolan/vlmc/commit/d8e4a693fe689cb05b90eb4ff8505d32a4c73ee6" rel="noreferrer" target="_blank">https://code.videolan.org/videolan/vlmc/commit/d8e4a693fe689cb05b90eb4ff8505d32a4c73ee6</a><br>
---<br>
<br>
src/Library/Library.cpp | 52 ++++++++++++++++++++++++++++++++-------<br>
src/Library/Library.h | 23 +++++++++++------<br>
src/Library/MediaLibraryModel.cpp | 8 +++---<br>
src/Media/Media.cpp | 2 +-<br>
src/Media/Media.h | 1 +<br>
5 files changed, 64 insertions(+), 22 deletions(-)<br>
<br>
diff --git a/src/Library/Library.cpp b/src/Library/Library.cpp<br>
index c7488fc0..9965cae6 100644<br>
--- a/src/Library/Library.cpp<br>
+++ b/src/Library/Library.cpp<br>
@@ -218,13 +218,13 @@ Library::onMediaAdded( std::vector<medialibrary::MediaPtr> mediaList )<br>
}<br>
<br>
void<br>
-Library::onMediaUpdated( std::vector<medialibrary::MediaPtr> mediaList )<br>
+Library::onMediaModified( std::vector<int64_t> mediaList )<br>
{<br>
for ( auto m : mediaList )<br>
{<br>
QMetaObject::invokeMethod( m_model, "updateMedia",<br>
Qt::QueuedConnection,<br>
- Q_ARG( medialibrary::MediaPtr, m ) );<br>
+ Q_ARG( int64_t, m ) );<br>
}<br>
}<br>
<br>
@@ -237,13 +237,18 @@ Library::onMediaDeleted( std::vector<int64_t> mediaList )<br>
Q_ARG( int64_t, id ) );<br>
}<br>
<br>
+void<br>
+Library::onMediaThumbnailReady( medialibrary::MediaPtr media, medialibrary::ThumbnailSizeType sizeType, bool success )<br>
+{<br>
+}<br>
+<br>
void<br>
Library::onArtistsAdded( std::vector<medialibrary::ArtistPtr> )<br>
{<br>
}<br>
<br>
void<br>
-Library::onArtistsModified( std::vector<medialibrary::ArtistPtr> )<br>
+Library::onArtistsModified( std::vector<int64_t> )<br>
{<br>
}<br>
<br>
@@ -258,7 +263,7 @@ Library::onAlbumsAdded( std::vector<medialibrary::AlbumPtr> )<br>
}<br>
<br>
void<br>
-Library::onAlbumsModified( std::vector<medialibrary::AlbumPtr> )<br>
+Library::onAlbumsModified( std::vector<int64_t> )<br>
{<br>
}<br>
<br>
@@ -289,7 +294,7 @@ Library::onDiscoveryProgress( const std::string& entryPoint )<br>
}<br>
<br>
void<br>
-Library::onDiscoveryCompleted( const std::string& entryPoint )<br>
+Library::onDiscoveryCompleted( const std::string& entryPoint, bool success )<br>
{<br>
if ( entryPoint.empty() == true )<br>
QMetaObject::invokeMethod( m_model, "refresh",<br>
@@ -310,7 +315,7 @@ Library::onPlaylistsAdded( std::vector<medialibrary::PlaylistPtr> )<br>
}<br>
<br>
void<br>
-Library::onPlaylistsModified( std::vector<medialibrary::PlaylistPtr> )<br>
+Library::onPlaylistsModified( std::vector<int64_t> )<br>
{<br>
}<br>
<br>
@@ -325,16 +330,21 @@ Library::onReloadStarted( const std::string& )<br>
}<br>
<br>
void<br>
-Library::onReloadCompleted( const std::string& entryPoint )<br>
+Library::onEntryPointAdded( const std::string& entryPoint, bool success )<br>
+{<br>
+}<br>
+<br>
+void<br>
+Library::onReloadCompleted( const std::string& entryPoint, bool success )<br>
{<br>
if ( entryPoint.empty() == true )<br>
{<br>
- for ( auto media : m_ml->videoFiles() )<br>
+ for ( auto media : m_ml->videoFiles()->all() )<br>
QMetaObject::invokeMethod( m_model, "addMedia",<br>
Qt::QueuedConnection,<br>
Q_ARG( medialibrary::MediaPtr, media ) );<br>
<br>
- for ( auto media : m_ml->audioFiles() )<br>
+ for ( auto media : m_ml->audioFiles()->all() )<br>
QMetaObject::invokeMethod( m_model, "addMedia",<br>
Qt::QueuedConnection,<br>
Q_ARG( medialibrary::MediaPtr, media ) );<br>
@@ -359,5 +369,29 @@ Library::onEntryPointUnbanned( const std::string&, bool )<br>
void<br>
Library::onBackgroundTasksIdleChanged( bool )<br>
{<br>
+}<br>
+<br>
+void<br>
+Library::onGenresAdded( std::vector<medialibrary::GenrePtr> genres )<br>
+{<br>
+}<br>
+<br>
+void<br>
+Library::onGenresModified( std::vector<int64_t> genres )<br>
+{<br>
+}<br>
+<br>
+void<br>
+Library::onGenresDeleted( std::vector<int64_t> genreIds )<br>
+{<br>
+}<br>
<br>
+void<br>
+Library::onHistoryChanged( medialibrary::HistoryType type )<br>
+{<br>
+}<br>
+<br>
+void<br>
+Library::onRescanStarted( )<br>
+{<br>
}<br>
diff --git a/src/Library/Library.h b/src/Library/Library.h<br>
index b38f276a..1460c263 100644<br>
--- a/src/Library/Library.h<br>
+++ b/src/Library/Library.h<br>
@@ -84,29 +84,36 @@ private:<br>
<br>
private:<br>
virtual void onMediaAdded( std::vector<medialibrary::MediaPtr> media ) override;<br>
- virtual void onMediaUpdated( std::vector<medialibrary::MediaPtr> media ) override;<br>
+ virtual void onMediaModified( std::vector<int64_t> media ) override;<br>
virtual void onMediaDeleted( std::vector<int64_t> ids ) override;<br>
+ virtual void onMediaThumbnailReady( medialibrary::MediaPtr media, medialibrary::ThumbnailSizeType sizeType, bool success ) override;<br>
virtual void onArtistsAdded( std::vector<medialibrary::ArtistPtr> artists ) override;<br>
- virtual void onArtistsModified( std::vector<medialibrary::ArtistPtr> artist ) override;<br>
+ virtual void onArtistsModified( std::vector<int64_t> artist ) override;<br>
virtual void onArtistsDeleted( std::vector<int64_t> ids ) override;<br>
virtual void onAlbumsAdded( std::vector<medialibrary::AlbumPtr> albums ) override;<br>
- virtual void onAlbumsModified( std::vector<medialibrary::AlbumPtr> albums ) override;<br>
+ virtual void onAlbumsModified( std::vector<int64_t> albums ) override;<br>
virtual void onAlbumsDeleted( std::vector<int64_t> ids ) override;<br>
- virtual void onTracksAdded( std::vector<medialibrary::AlbumTrackPtr> tracks ) override;<br>
- virtual void onTracksDeleted( std::vector<int64_t> trackIds ) override;<br>
+ virtual void onTracksAdded( std::vector<medialibrary::AlbumTrackPtr> tracks );<br>
+ virtual void onTracksDeleted( std::vector<int64_t> trackIds );<br>
virtual void onDiscoveryStarted( const std::string& entryPoint ) override;<br>
virtual void onDiscoveryProgress( const std::string& entryPoint ) override;<br>
- virtual void onDiscoveryCompleted( const std::string& entryPoint ) override;<br>
+ virtual void onDiscoveryCompleted( const std::string& entryPoint, bool success ) override;<br>
virtual void onParsingStatsUpdated( uint32_t percent ) override;<br>
virtual void onPlaylistsAdded( std::vector<medialibrary::PlaylistPtr> playlists ) override;<br>
- virtual void onPlaylistsModified( std::vector<medialibrary::PlaylistPtr> playlists ) override;<br>
+ virtual void onPlaylistsModified( std::vector<int64_t> playlists ) override;<br>
virtual void onPlaylistsDeleted( std::vector<int64_t> playlistIds ) override;<br>
virtual void onReloadStarted( const std::string& entryPoint ) override;<br>
- virtual void onReloadCompleted( const std::string& entryPoint ) override;<br>
+ virtual void onReloadCompleted( const std::string& entryPoint, bool success ) override;<br>
+ virtual void onEntryPointAdded( const std::string& entryPoint, bool success ) override;<br>
virtual void onEntryPointRemoved( const std::string& entryPoint, bool success ) override;<br>
virtual void onEntryPointBanned( const std::string& entryPoint, bool success ) override;<br>
virtual void onEntryPointUnbanned( const std::string& entryPoint, bool success ) override;<br>
virtual void onBackgroundTasksIdleChanged( bool isIdle ) override;<br>
+ virtual void onGenresAdded( std::vector<medialibrary::GenrePtr> genres ) override;<br>
+ virtual void onGenresModified( std::vector<int64_t> genres ) override;<br>
+ virtual void onGenresDeleted( std::vector<int64_t> genreIds ) override;<br>
+ virtual void onHistoryChanged( medialibrary::HistoryType type ) override;<br>
+ virtual void onRescanStarted( ) override;<br>
<br>
private:<br>
std::unique_ptr<medialibrary::IMediaLibrary> m_ml;<br>
diff --git a/src/Library/MediaLibraryModel.cpp b/src/Library/MediaLibraryModel.cpp<br>
index ab0be056..966c529f 100644<br>
--- a/src/Library/MediaLibraryModel.cpp<br>
+++ b/src/Library/MediaLibraryModel.cpp<br>
@@ -95,10 +95,10 @@ QVariant MediaLibraryModel::data( const QModelIndex &index, int role ) const<br>
return QVariant( QUrl::fromPercentEncoding( QByteArray( m->title().c_str() ) ) );<br>
#ifdef WITH_GUI<br>
case Qt::DecorationRole:<br>
- return QPixmap( QString::fromStdString( m->thumbnail() ) );<br>
+ return QPixmap( QString::fromStdString( m->thumbnailMrl(medialibrary::ThumbnailSizeType::Thumbnail) ) );<br>
#endif<br>
case Roles::ThumbnailPath:<br>
- return QVariant( QString::fromStdString( m->thumbnail() ) );<br>
+ return QVariant( QString::fromStdString( m->thumbnailMrl(medialibrary::ThumbnailSizeType::Thumbnail) ) );<br>
case Roles::Duration:<br>
return QVariant::fromValue( m->duration() );<br>
case Roles::Id:<br>
@@ -126,8 +126,8 @@ MediaLibraryModel::roleNames() const<br>
void MediaLibraryModel::refresh()<br>
{<br>
beginResetModel();<br>
- const auto& audioFiles = m_ml.audioFiles();<br>
- const auto& videoFiles = m_ml.videoFiles();<br>
+ const auto& audioFiles = m_ml.audioFiles()->all();<br>
+ const auto& videoFiles = m_ml.videoFiles()->all();<br>
m_media.insert( m_media.end(), audioFiles.begin(), audioFiles.end() );<br>
m_media.insert( m_media.end(), videoFiles.begin(), videoFiles.end() );<br>
endResetModel();<br>
diff --git a/src/Media/Media.cpp b/src/Media/Media.cpp<br>
index c5a28b90..edc75ec1 100644<br>
--- a/src/Media/Media.cpp<br>
+++ b/src/Media/Media.cpp<br>
@@ -205,7 +205,7 @@ Media::fromVariant( const QVariant& v )<br>
QString<br>
Media::snapshot()<br>
{<br>
- return QString::fromStdString( m_mlMedia->thumbnail() );<br>
+ return QString::fromStdString( m_mlMedia->thumbnailMrl(medialibrary::ThumbnailSizeType::Thumbnail) );<br>
}<br>
<br>
QSharedPointer<Clip><br>
diff --git a/src/Media/Media.h b/src/Media/Media.h<br>
index 4a4b6295..08aad5c2 100644<br>
--- a/src/Media/Media.h<br>
+++ b/src/Media/Media.h<br>
@@ -44,6 +44,7 @@<br>
#include "Backend/MLT/MLTInput.h"<br>
<br>
#include <medialibrary/IMedia.h><br>
+#include <medialibrary/IMediaLibrary.h><br>
#include <medialibrary/IFile.h><br>
<br>
namespace Backend<br>
<br>
_______________________________________________<br>
Vlmc-devel mailing list<br>
<a href="mailto:Vlmc-devel@videolan.org" target="_blank">Vlmc-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/vlmc-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/vlmc-devel</a><br>
</blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Sent from my iphone please excuse any typos and brevity</div>