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

IMedia: constify tracks accessors

parent 9a6aa534
......@@ -140,8 +140,8 @@ class IMedia
virtual bool removeLabel( LabelPtr label ) = 0;
virtual MoviePtr movie() const = 0;
virtual Query<ILabel> labels() const = 0;
virtual Query<IVideoTrack> videoTracks() = 0;
virtual Query<IAudioTrack> audioTracks() = 0;
virtual Query<IVideoTrack> videoTracks() const = 0;
virtual Query<IAudioTrack> audioTracks() const = 0;
///
/// \brief thumbnail Returns the path of a thumbnail for this media
/// \return A path, relative to the thumbnailPath configured when initializing
......
......@@ -251,7 +251,7 @@ bool Media::addVideoTrack(const std::string& codec, unsigned int width, unsigned
return VideoTrack::create( m_ml, codec, width, height, fps, m_id, language, description ) != nullptr;
}
Query<IVideoTrack> Media::videoTracks()
Query<IVideoTrack> Media::videoTracks() const
{
static const std::string req = "FROM " + policy::VideoTrackTable::Name +
" WHERE media_id = ?";
......@@ -265,7 +265,7 @@ bool Media::addAudioTrack( const std::string& codec, unsigned int bitrate,
return AudioTrack::create( m_ml, codec, bitrate, sampleRate, nbChannels, language, desc, m_id ) != nullptr;
}
Query<IAudioTrack> Media::audioTracks()
Query<IAudioTrack> Media::audioTracks() const
{
static const std::string req = "FROM " + policy::AudioTrackTable::Name +
" WHERE media_id = ?";
......
......@@ -100,10 +100,10 @@ class Media : public IMedia, public DatabaseHelpers<Media, policy::MediaTable>
void setMovie( MoviePtr movie );
bool addVideoTrack( const std::string& codec, unsigned int width, unsigned int height,
float fps, const std::string& language, const std::string& description );
virtual Query<IVideoTrack> videoTracks() override;
virtual Query<IVideoTrack> videoTracks() const override;
bool addAudioTrack( const std::string& codec, unsigned int bitrate, unsigned int sampleRate,
unsigned int nbChannels, const std::string& language, const std::string& desc );
virtual Query<IAudioTrack> audioTracks() override;
virtual Query<IAudioTrack> audioTracks() const override;
virtual const std::string& thumbnail() const override;
virtual bool isThumbnailGenerated() const override;
virtual bool setThumbnail( const std::string &thumbnail ) override;
......
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