IFile.h 2.2 KB
Newer Older
1
2
3
4
#ifndef IFILE_H
#define IFILE_H

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

#include "IMediaLibrary.h"
8
9
10
11
12
13
14
15

class IAlbumTrack;
class IShowEpisode;
class ITrackInformation;

class IFile
{
    public:
16
        enum class Type : uint8_t
17
18
19
20
21
        {
            VideoType, // Any video file, not being a tv show episode
            AudioType, // Any kind of audio file, not being an album track
            ShowEpisodeType,
            AlbumTrackType,
22
            UnknownType
23
        };
24
25
        virtual ~IFile() {}

26
        virtual unsigned int id() const = 0;
27
28
        virtual AlbumTrackPtr albumTrack() = 0;
        virtual bool setAlbumTrack(AlbumTrackPtr albumTrack ) = 0;
29
        virtual unsigned int duration() const = 0;
30
        virtual bool setDuration( unsigned int duration) = 0;
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
31
        virtual std::shared_ptr<IShowEpisode> showEpisode() = 0;
32
        virtual bool setShowEpisode( ShowEpisodePtr showEpisode ) = 0;
33
34
        virtual int playCount() const = 0;
        virtual const std::string& mrl() const = 0;
35
36
        virtual bool addLabel( LabelPtr label ) = 0;
        virtual bool removeLabel( LabelPtr label ) = 0;
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
37
38
        virtual MoviePtr movie() = 0;
        virtual bool setMovie( MoviePtr movie ) = 0;
39
        virtual std::vector<std::shared_ptr<ILabel> > labels() = 0;
40
41
        virtual bool addVideoTrack( const std::string& codec, unsigned int width,
                                    unsigned int height, float fps ) = 0;
42
        virtual std::vector<VideoTrackPtr> videoTracks() = 0;
43
44
        virtual bool addAudioTrack( const std::string& codec, unsigned int bitrate,
                                    unsigned int sampleRate, unsigned int nbChannels ) = 0;
45
        virtual std::vector<AudioTrackPtr> audioTracks() = 0;
46
47
48
49
        // Returns the location of this file snapshot.
        // This is likely to be used for album arts as well.
        virtual const std::string& snapshot() = 0;
        virtual bool setSnapshot( const std::string& snapshot ) = 0;
50
51
52
        /// Returns wether the file has been added as a stand alone file (true), or as
        /// part of a folder (false)
        virtual bool isStandAlone() = 0;
53
        virtual bool isReady() const = 0;
54
        virtual unsigned int lastModificationDate() = 0;
55
56
57
};

#endif // IFILE_H