IMediaLibrary.h 1.22 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;
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
9
class IFile;
10
class ILabel;
11
class IMetadataService;
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
12 13

typedef std::shared_ptr<IFile> FilePtr;
14
typedef std::shared_ptr<ILabel> LabelPtr;
15
typedef std::shared_ptr<IAlbum> AlbumPtr;
16 17 18 19

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

33
        virtual void addMetadataService( IMetadataService* service ) = 0;
34 35
};

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

42
#endif // IMEDIALIBRARY_H