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

#include <vector>
#include <string>

7
#include "Types.h"
8 9 10 11

class IMediaLibrary
{
    public:
12 13
        virtual ~IMediaLibrary() {}
        virtual bool initialize( const std::string& dbPath ) = 0;
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
14 15
        virtual FilePtr addFile( const std::string& path ) = 0;
        virtual FilePtr file( const std::string& path ) = 0;
16 17
        virtual bool deleteFile( const std::string& mrl ) = 0;
        virtual bool deleteFile( FilePtr file ) = 0;
18
        virtual LabelPtr createLabel( const std::string& label ) = 0;
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
19 20
        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
21
        virtual bool files( std::vector<FilePtr>& res ) = 0;
22 23
        virtual AlbumPtr album( const std::string& title ) = 0;
        virtual AlbumPtr createAlbum( const std::string& title ) = 0;
24 25
        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
26 27
        virtual MoviePtr movie( const std::string& title ) = 0;
        virtual MoviePtr createMovie( const std::string& title ) = 0;
28

29 30 31 32 33 34
        /**
         * @brief addMetadataService Adds a service to parse media
         *
         * Use is expected to add all services before calling parse for the first time.
         * Once parse has been called, adding another service is an undefined behavior
         */
35
        virtual void addMetadataService( IMetadataService* service ) = 0;
36
        virtual void parse( FilePtr file ) = 0;
37 38
};

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

45
#endif // IMEDIALIBRARY_H