<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div>
<div id="appendonsend" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Please forget this patch, don't know why but my name got lost...<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>Da:</b> Vlmc-devel <vlmc-devel-bounces@videolan.org> per conto di Luni- 4 <luni-4@hotmail.it><br>
<b>Inviato:</b> marted́ 19 novembre 2019 15:55<br>
<b>A:</b> vlmc-devel@videolan.org <vlmc-devel@videolan.org><br>
<b>Oggetto:</b> [vlmc-devel] [PATCH] Fix vlmc build</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">Use the latest version of medialibrary to build vlmc<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..b747b539 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().get()->items(0, 0) )<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().get()->items(0, 0) )<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..876dae40 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().get()->items(0, 0);<br>
+ const auto& videoFiles = m_ml.videoFiles().get()->items(0, 0);<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>
2.20.1<br>
<br>
_______________________________________________<br>
Vlmc-devel mailing list<br>
Vlmc-devel@videolan.org<br>
<a href="https://mailman.videolan.org/listinfo/vlmc-devel">https://mailman.videolan.org/listinfo/vlmc-devel</a><br>
</div>
</span></font></div>
</div>
</body>
</html>