[Android] medialibrary: Update according to API changes
Hugo Beauzée-Luyssen
git at videolan.org
Tue Jan 28 10:28:45 CET 2020
vlc-android | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Jan 28 10:02:22 2020 +0100| [50d2ce39f6e1dfeb59a9e9a598f1c81fa3cd2585] | committer: Hugo Beauzée-Luyssen
medialibrary: Update according to API changes
> https://code.videolan.org/videolan/vlc-android/commit/50d2ce39f6e1dfeb59a9e9a598f1c81fa3cd2585
---
medialibrary/jni/AndroidMediaLibrary.cpp | 26 +++++++++++++-------------
medialibrary/jni/AndroidMediaLibrary.h | 27 ++++++++++++++-------------
2 files changed, 27 insertions(+), 26 deletions(-)
diff --git a/medialibrary/jni/AndroidMediaLibrary.cpp b/medialibrary/jni/AndroidMediaLibrary.cpp
index 7a9905b90..5bacc283c 100644
--- a/medialibrary/jni/AndroidMediaLibrary.cpp
+++ b/medialibrary/jni/AndroidMediaLibrary.cpp
@@ -585,7 +585,7 @@ AndroidMediaLibrary::onMediaAdded( std::vector<medialibrary::MediaPtr> mediaList
}
}
-void AndroidMediaLibrary::onMediaModified( std::vector<int64_t> mediaIds )
+void AndroidMediaLibrary::onMediaModified( std::set<int64_t> mediaIds )
{
if (m_mediaUpdatedType & FLAG_MEDIA_UPDATED_AUDIO || m_mediaUpdatedType & FLAG_MEDIA_UPDATED_VIDEO
|| m_mediaUpdatedType & FLAG_MEDIA_UPDATED_AUDIO_EMPTY) {
@@ -599,7 +599,7 @@ void AndroidMediaLibrary::onMediaModified( std::vector<int64_t> mediaIds )
}
}
-void AndroidMediaLibrary::onMediaDeleted( std::vector<int64_t> ids )
+void AndroidMediaLibrary::onMediaDeleted( std::set<int64_t> ids )
{
if (m_mediaAddedType & (FLAG_MEDIA_ADDED_AUDIO_EMPTY|FLAG_MEDIA_ADDED_AUDIO|FLAG_MEDIA_ADDED_VIDEO|FLAG_MEDIA_ADDED_VIDEO_EMPTY))
{
@@ -618,7 +618,7 @@ void AndroidMediaLibrary::onArtistsAdded( std::vector<medialibrary::ArtistPtr> a
}
}
-void AndroidMediaLibrary::onArtistsModified( std::vector<int64_t> artistsIds )
+void AndroidMediaLibrary::onArtistsModified( std::set<int64_t> artistsIds )
{
if (m_mediaUpdatedType & (FLAG_MEDIA_UPDATED_AUDIO|FLAG_MEDIA_UPDATED_AUDIO_EMPTY))
{
@@ -631,7 +631,7 @@ void AndroidMediaLibrary::onArtistsModified( std::vector<int64_t> artistsIds )
}
}
-void AndroidMediaLibrary::onArtistsDeleted( std::vector<int64_t> ids )
+void AndroidMediaLibrary::onArtistsDeleted( std::set<int64_t> ids )
{
if (m_mediaUpdatedType & (FLAG_MEDIA_UPDATED_AUDIO|FLAG_MEDIA_UPDATED_AUDIO_EMPTY))
{
@@ -656,7 +656,7 @@ void AndroidMediaLibrary::onAlbumsAdded( std::vector<medialibrary::AlbumPtr> alb
}
}
-void AndroidMediaLibrary::onAlbumsModified( std::vector<int64_t> albums )
+void AndroidMediaLibrary::onAlbumsModified( std::set<int64_t> albums )
{
if (m_mediaUpdatedType & (FLAG_MEDIA_UPDATED_AUDIO|FLAG_MEDIA_UPDATED_AUDIO_EMPTY))
{
@@ -683,7 +683,7 @@ void AndroidMediaLibrary::onPlaylistsAdded( std::vector<medialibrary::PlaylistPt
}
-void AndroidMediaLibrary::onPlaylistsModified( std::vector<int64_t> playlist )
+void AndroidMediaLibrary::onPlaylistsModified( std::set<int64_t> playlist )
{
if (m_mediaUpdatedType & (FLAG_MEDIA_UPDATED_AUDIO|FLAG_MEDIA_UPDATED_AUDIO_EMPTY))
{
@@ -696,7 +696,7 @@ void AndroidMediaLibrary::onPlaylistsModified( std::vector<int64_t> playlist )
}
}
-void AndroidMediaLibrary::onPlaylistsDeleted( std::vector<int64_t> ids )
+void AndroidMediaLibrary::onPlaylistsDeleted( std::set<int64_t> ids )
{
if (m_mediaUpdatedType & (FLAG_MEDIA_UPDATED_AUDIO|FLAG_MEDIA_UPDATED_AUDIO_EMPTY))
{
@@ -722,7 +722,7 @@ void AndroidMediaLibrary::onGenresAdded( std::vector<medialibrary::GenrePtr> )
}
}
-void AndroidMediaLibrary::onGenresModified( std::vector<int64_t> )
+void AndroidMediaLibrary::onGenresModified( std::set<int64_t> )
{
if (m_mediaUpdatedType & (FLAG_MEDIA_UPDATED_AUDIO|FLAG_MEDIA_UPDATED_AUDIO_EMPTY))
{
@@ -735,7 +735,7 @@ void AndroidMediaLibrary::onGenresModified( std::vector<int64_t> )
}
}
-void AndroidMediaLibrary::onGenresDeleted( std::vector<int64_t> )
+void AndroidMediaLibrary::onGenresDeleted( std::set<int64_t> )
{
if (m_mediaUpdatedType & (FLAG_MEDIA_UPDATED_AUDIO|FLAG_MEDIA_UPDATED_AUDIO_EMPTY))
{
@@ -748,7 +748,7 @@ void AndroidMediaLibrary::onGenresDeleted( std::vector<int64_t> )
}
}
-void AndroidMediaLibrary::onAlbumsDeleted( std::vector<int64_t> )
+void AndroidMediaLibrary::onAlbumsDeleted( std::set<int64_t> )
{
if (m_mediaUpdatedType & (FLAG_MEDIA_UPDATED_AUDIO|FLAG_MEDIA_UPDATED_AUDIO_EMPTY))
{
@@ -900,7 +900,7 @@ void AndroidMediaLibrary::onHistoryChanged( medialibrary::HistoryType type)
}
-void AndroidMediaLibrary::onMediaGroupAdded( std::vector<medialibrary::MediaGroupPtr> mediaGroups )
+void AndroidMediaLibrary::onMediaGroupsAdded( std::vector<medialibrary::MediaGroupPtr> mediaGroups )
{
JNIEnv *env = getEnv();
if (env != nullptr && weak_thiz)
@@ -909,7 +909,7 @@ void AndroidMediaLibrary::onMediaGroupAdded( std::vector<medialibrary::MediaGrou
}
}
-void AndroidMediaLibrary::onMediaGroupModified( std::vector<int64_t> mediaGroupsIds )
+void AndroidMediaLibrary::onMediaGroupsModified( std::set<int64_t> mediaGroupsIds )
{
JNIEnv *env = getEnv();
if (env != nullptr && weak_thiz)
@@ -918,7 +918,7 @@ void AndroidMediaLibrary::onMediaGroupModified( std::vector<int64_t> mediaGroups
}
}
-void AndroidMediaLibrary::onMediaGroupDeleted( std::vector<int64_t> mediaGroupsIds )
+void AndroidMediaLibrary::onMediaGroupsDeleted( std::set<int64_t> mediaGroupsIds )
{
JNIEnv *env = getEnv();
if (env != nullptr && weak_thiz)
diff --git a/medialibrary/jni/AndroidMediaLibrary.h b/medialibrary/jni/AndroidMediaLibrary.h
index fae7c556e..6b35b8b82 100644
--- a/medialibrary/jni/AndroidMediaLibrary.h
+++ b/medialibrary/jni/AndroidMediaLibrary.h
@@ -2,6 +2,7 @@
#define ANDROIDMEDIALIBRARY_H
#include <vector>
+#include <set>
#include <string>
#include <tuple>
#include <stdlib.h>
@@ -103,9 +104,9 @@ public:
// VideoGroups
medialibrary::Query<medialibrary::IMedia> mediaFromMediaGroup(const std::string& name, const medialibrary::QueryParameters* params );
medialibrary::Query<medialibrary::IMedia> searchFromMediaGroup( const std::string& name, const std::string& query, const medialibrary::QueryParameters* params );
- void onMediaGroupAdded( std::vector<medialibrary::MediaGroupPtr> mediaGroups );
- void onMediaGroupModified( std::vector<int64_t> mediaGroupsIds );
- void onMediaGroupDeleted( std::vector<int64_t> mediaGroupsIds );
+ void onMediaGroupsAdded( std::vector<medialibrary::MediaGroupPtr> mediaGroups );
+ void onMediaGroupsModified( std::set<int64_t> mediaGroupsIds );
+ void onMediaGroupsDeleted( std::set<int64_t> mediaGroupsIds );
//Playlists
bool playlistAppend(int64_t playlistId, int64_t mediaId);
bool playlistAdd(int64_t playlistId, int64_t mediaId, unsigned int position);
@@ -117,24 +118,24 @@ public:
uint32_t desiredHeight, float position );
void onMediaAdded( std::vector<medialibrary::MediaPtr> media );
- void onMediaModified( std::vector<int64_t> media ) ;
- void onMediaDeleted( std::vector<int64_t> ids ) ;
+ void onMediaModified( std::set<int64_t> media ) ;
+ void onMediaDeleted( std::set<int64_t> ids ) ;
void onArtistsAdded( std::vector<medialibrary::ArtistPtr> artists ) ;
- void onArtistsModified( std::vector<int64_t> artist );
- void onArtistsDeleted( std::vector<int64_t> ids );
+ void onArtistsModified( std::set<int64_t> artist );
+ void onArtistsDeleted( std::set<int64_t> ids );
void onAlbumsAdded( std::vector<medialibrary::AlbumPtr> albums );
- void onAlbumsModified( std::vector<int64_t> albums );
- void onAlbumsDeleted( std::vector<int64_t> ids );
+ void onAlbumsModified( std::set<int64_t> albums );
+ void onAlbumsDeleted( std::set<int64_t> ids );
void onPlaylistsAdded( std::vector<medialibrary::PlaylistPtr> playlists );
- void onPlaylistsModified( std::vector<int64_t> playlist );
- void onPlaylistsDeleted( std::vector<int64_t> ids );
+ void onPlaylistsModified( std::set<int64_t> playlist );
+ void onPlaylistsDeleted( std::set<int64_t> ids );
void onGenresAdded( std::vector<medialibrary::GenrePtr> );
- void onGenresModified( std::vector<int64_t> );
- void onGenresDeleted( std::vector<int64_t> );
+ void onGenresModified( std::set<int64_t> );
+ void onGenresDeleted( std::set<int64_t> );
void onDiscoveryStarted( const std::string& entryPoint );
void onDiscoveryProgress( const std::string& entryPoint );
More information about the Android
mailing list