IMediaLibrary.h 1.29 KB
Newer Older
1 2 3 4 5
#ifndef IMEDIALIBRARY_H
#define IMEDIALIBRARY_H

#include <vector>
#include <string>
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
6
#include <memory>
7

8
class IAlbum;
9
class IAlbumTrack;
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
10
class IFile;
11
class ILabel;
12
class IMetadataService;
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
13 14

typedef std::shared_ptr<IFile> FilePtr;
15
typedef std::shared_ptr<ILabel> LabelPtr;
16
typedef std::shared_ptr<IAlbum> AlbumPtr;
17
typedef std::shared_ptr<IAlbumTrack> AlbumTrackPtr;
18 19 20 21

class IMediaLibrary
{
    public:
22 23
        virtual ~IMediaLibrary() {}
        virtual bool initialize( const std::string& dbPath ) = 0;
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
24 25
        virtual FilePtr addFile( const std::string& path ) = 0;
        virtual FilePtr file( const std::string& path ) = 0;
26 27
        virtual bool deleteFile( const std::string& mrl ) = 0;
        virtual bool deleteFile( FilePtr file ) = 0;
28
        virtual LabelPtr createLabel( const std::string& label ) = 0;
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
29 30
        virtual bool deleteLabel( const std::string& label ) = 0;
        virtual bool deleteLabel( LabelPtr label ) = 0;
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
31
        virtual bool files( std::vector<FilePtr>& res ) = 0;
32 33 34
        virtual AlbumPtr album( const std::string& id3Tag ) = 0;
        virtual AlbumPtr createAlbum( const std::string& id3Tag ) = 0;

35
        virtual void addMetadataService( IMetadataService* service ) = 0;
36 37
};

38 39 40 41 42 43
class MediaLibraryFactory
{
    public:
        static IMediaLibrary* create();
};

44
#endif // IMEDIALIBRARY_H