IFile.h 2.48 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
/*****************************************************************************
 * Media Library
 *****************************************************************************
 * Copyright (C) 2015 Hugo Beauzée-Luyssen, Videolabs
 *
 * Authors: Hugo Beauzée-Luyssen<hugo@beauzee.fr>
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

23 24 25 26
#ifndef IFILE_H
#define IFILE_H

#include <vector>
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
27
#include <memory>
28 29

#include "IMediaLibrary.h"
30 31 32 33 34 35 36 37

class IAlbumTrack;
class IShowEpisode;
class ITrackInformation;

class IFile
{
    public:
38
        enum class Type : uint8_t
39 40 41
        {
            VideoType, // Any video file, not being a tv show episode
            AudioType, // Any kind of audio file, not being an album track
42
            UnknownType
43
        };
44 45
        virtual ~IFile() {}

46
        virtual unsigned int id() const = 0;
47
        virtual Type type() = 0;
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
48
        virtual const std::string& name() = 0;
49
        virtual AlbumTrackPtr albumTrack() = 0;
50 51 52 53
        /**
         * @brief duration Returns the file duration in ms
         */
        virtual int64_t duration() const = 0;
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
54
        virtual std::shared_ptr<IShowEpisode> showEpisode() = 0;
55 56
        virtual int playCount() const = 0;
        virtual const std::string& mrl() const = 0;
57 58
        virtual bool addLabel( LabelPtr label ) = 0;
        virtual bool removeLabel( LabelPtr label ) = 0;
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
59
        virtual MoviePtr movie() = 0;
60
        virtual std::vector<std::shared_ptr<ILabel> > labels() = 0;
61 62
        virtual std::vector<VideoTrackPtr> videoTracks() = 0;
        virtual std::vector<AudioTrackPtr> audioTracks() = 0;
63 64 65
        // Returns the location of this file snapshot.
        // This is likely to be used for album arts as well.
        virtual const std::string& snapshot() = 0;
66 67 68
};

#endif // IFILE_H