IMediaLibrary.h 1.47 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;
13
class IShow;
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
14 15

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

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

39
        virtual void addMetadataService( IMetadataService* service ) = 0;
40 41
};

42 43 44 45 46 47
class MediaLibraryFactory
{
    public:
        static IMediaLibrary* create();
};

48
#endif // IMEDIALIBRARY_H