IMediaLibrary.h 1.72 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
class IMovie;
14
class IShow;
15
class IShowEpisode;
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
16 17

typedef std::shared_ptr<IFile> FilePtr;
18
typedef std::shared_ptr<ILabel> LabelPtr;
19
typedef std::shared_ptr<IAlbum> AlbumPtr;
20
typedef std::shared_ptr<IAlbumTrack> AlbumTrackPtr;
21
typedef std::shared_ptr<IShow> ShowPtr;
22
typedef std::shared_ptr<IShowEpisode> ShowEpisodePtr;
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
23
typedef std::shared_ptr<IMovie> MoviePtr;
24 25 26 27

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

45
        virtual void addMetadataService( IMetadataService* service ) = 0;
46 47
};

48 49 50 51 52 53
class MediaLibraryFactory
{
    public:
        static IMediaLibrary* create();
};

54
#endif // IMEDIALIBRARY_H