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

IMediaLibrary: Allow IFileSystemFactory to be provided by the users

parent 7377c51f
...@@ -406,6 +406,14 @@ class IMediaLibrary ...@@ -406,6 +406,14 @@ class IMediaLibrary
virtual void addParserService( std::shared_ptr<parser::IParserService> service ) = 0; virtual void addParserService( std::shared_ptr<parser::IParserService> service ) = 0;
/**
* @brief addNetworkFileSystemFactory Provides a network filesystem factory implementation
*
* This must be called between initialize() and start().
* A network file system factory must be inserted before enabling network
* file systems discovery.
*/
virtual void addNetworkFileSystemFactory( std::shared_ptr<fs::IFileSystemFactory> fsFactory ) = 0;
}; };
} }
......
...@@ -53,6 +53,11 @@ namespace parser ...@@ -53,6 +53,11 @@ namespace parser
class IParserService; class IParserService;
} }
namespace fs
{
class IFileSystemFactory;
}
using AlbumPtr = std::shared_ptr<IAlbum>; using AlbumPtr = std::shared_ptr<IAlbum>;
using AlbumTrackPtr = std::shared_ptr<IAlbumTrack>; using AlbumTrackPtr = std::shared_ptr<IAlbumTrack>;
using ArtistPtr = std::shared_ptr<IArtist>; using ArtistPtr = std::shared_ptr<IArtist>;
......
...@@ -1224,6 +1224,11 @@ void MediaLibrary::discover( const std::string& entryPoint ) ...@@ -1224,6 +1224,11 @@ void MediaLibrary::discover( const std::string& entryPoint )
m_discovererWorker->discover( entryPoint ); m_discovererWorker->discover( entryPoint );
} }
void MediaLibrary::addNetworkFileSystemFactory( std::shared_ptr<fs::IFileSystemFactory> fsFactory )
{
m_fsFactories.emplace_back( std::move( fsFactory ) );
}
bool MediaLibrary::setDiscoverNetworkEnabled( bool enabled ) bool MediaLibrary::setDiscoverNetworkEnabled( bool enabled )
{ {
if ( enabled ) if ( enabled )
......
...@@ -166,6 +166,8 @@ class MediaLibrary : public IMediaLibrary, public IDeviceListerCb ...@@ -166,6 +166,8 @@ class MediaLibrary : public IMediaLibrary, public IDeviceListerCb
virtual void addParserService( std::shared_ptr<parser::IParserService> service ) override; virtual void addParserService( std::shared_ptr<parser::IParserService> service ) override;
virtual void addNetworkFileSystemFactory( std::shared_ptr<fs::IFileSystemFactory> fsFactory ) override;
static bool isExtensionSupported( const char* ext ); static bool isExtensionSupported( const char* ext );
protected: protected:
......
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