Commit 1fb8c5a6 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Media: Expose subtype

parent ea37516d
......@@ -40,10 +40,19 @@ class IMedia
AudioType,
UnknownType
};
enum class SubType : uint8_t
{
Unknown,
ShowEpisode,
Movie,
AlbumTrack,
};
virtual ~IMedia() = default;
virtual unsigned int id() const = 0;
virtual Type type() = 0;
virtual SubType subType() const = 0;
virtual const std::string& title() const = 0;
virtual AlbumTrackPtr albumTrack() const = 0;
/**
......
......@@ -310,6 +310,11 @@ IMedia::Type Media::type()
return m_type;
}
IMedia::SubType Media::subType() const
{
return m_subType;
}
void Media::setType( Type type )
{
if ( m_type != type )
......
......@@ -50,14 +50,6 @@ struct MediaTable
class Media : public IMedia, public DatabaseHelpers<Media, policy::MediaTable>
{
enum class SubType : uint8_t
{
Unknown,
ShowEpisode,
Movie,
AlbumTrack,
};
public:
// Those should be private, however the standard states that the expression
// ::new (pv) T(std::forward(args)...)
......@@ -72,6 +64,7 @@ class Media : public IMedia, public DatabaseHelpers<Media, policy::MediaTable>
virtual unsigned int id() const override;
virtual Type type() override;
virtual SubType subType() const override;
void setType( Type type );
virtual const std::string& title() const override;
void setTitle( const std::string& title );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment