Commit 7943ed3f authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

media_library: Update to new IMediaLibrary API

parent 2be0d0f4
...@@ -47,15 +47,46 @@ media_library::media_library() ...@@ -47,15 +47,46 @@ media_library::media_library()
} }
void void
media_library::onMediaAdded( MediaPtr file ) media_library::onMediaAdded( std::vector<MediaPtr> media )
{ {
sendFileUpdate( file, true ); for ( const auto& m : media )
sendFileUpdate( m, true );
} }
void void
media_library::onFileUpdated( MediaPtr file ) media_library::onMediaUpdated( std::vector<MediaPtr> media )
{
for ( const auto& m : media )
sendFileUpdate( m, false );
}
void media_library::onMediaDeleted( std::vector<int64_t> ids )
{
}
void media_library::onArtistsAdded( std::vector<ArtistPtr> artists )
{
}
void media_library::onArtistsModified( std::vector<ArtistPtr> artist )
{
}
void media_library::onArtistsDeleted( std::vector<int64_t> ids )
{
}
void media_library::onAlbumsAdded( std::vector<AlbumPtr> albums )
{
}
void media_library::onAlbumsModified( std::vector<AlbumPtr> albums )
{
}
void media_library::onAlbumsDeleted( std::vector<int64_t> ids )
{ {
sendFileUpdate( file, false );
} }
void void
...@@ -163,6 +194,14 @@ media_library::unregisterOnItemUpdated(media_library_item_updated_cb cb, void* u ...@@ -163,6 +194,14 @@ media_library::unregisterOnItemUpdated(media_library_item_updated_cb cb, void* u
} }
} }
void media_library::onTracksAdded( std::vector<AlbumTrackPtr> tracks )
{
}
void media_library::onTracksDeleted( std::vector<int64_t> trackIds )
{
}
void media_library::registerProgressCb( media_library_scan_progress_cb pf_progress, void* p_data ) void media_library::registerProgressCb( media_library_scan_progress_cb pf_progress, void* p_data )
{ {
m_progressCb = pf_progress; m_progressCb = pf_progress;
......
...@@ -68,8 +68,20 @@ public: ...@@ -68,8 +68,20 @@ public:
virtual ~media_library() = default; virtual ~media_library() = default;
// IMediaLibraryCb // IMediaLibraryCb
virtual void onMediaAdded( MediaPtr file ) override; virtual void onMediaAdded( std::vector<MediaPtr> media ) override;
virtual void onFileUpdated( MediaPtr file ) override; virtual void onMediaUpdated( std::vector<MediaPtr> media ) override;
virtual void onMediaDeleted( std::vector<int64_t> media ) override;
virtual void onArtistsAdded( std::vector<ArtistPtr> artists ) override;
virtual void onArtistsModified( std::vector<ArtistPtr> artist ) override;
virtual void onArtistsDeleted( std::vector<int64_t> ids ) override;
virtual void onAlbumsAdded( std::vector<AlbumPtr> albums ) override;
virtual void onAlbumsModified( std::vector<AlbumPtr> albums ) override;
virtual void onAlbumsDeleted( std::vector<int64_t> ids ) override;
virtual void onTracksAdded( std::vector<AlbumTrackPtr> tracks ) override;
virtual void onTracksDeleted( std::vector<int64_t> trackIds ) override;
virtual void onDiscoveryStarted( const std::string& entryPoint ) override; virtual void onDiscoveryStarted( const std::string& entryPoint ) override;
virtual void onDiscoveryCompleted( const std::string& entryPoint ) override; virtual void onDiscoveryCompleted( const std::string& entryPoint ) override;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment