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

AudioTrack: Make all fields immutable

parent 129fc00e
......@@ -37,15 +37,15 @@ const std::string AudioTrack::Table::PrimaryKeyColumn = "id_track";
int64_t AudioTrack::* const AudioTrack::Table::PrimaryKey = &AudioTrack::m_id;
AudioTrack::AudioTrack( MediaLibraryPtr, sqlite::Row& row )
: m_id( row.extract<decltype(m_id)>() )
, m_codec( row.extract<decltype(m_codec)>() )
, m_bitrate( row.extract<decltype(m_bitrate)>() )
, m_sampleRate( row.extract<decltype(m_sampleRate)>() )
, m_nbChannels( row.extract<decltype(m_nbChannels)>() )
, m_language( row.extract<decltype(m_language)>() )
, m_description( row.extract<decltype(m_description)>() )
, m_mediaId( row.extract<decltype(m_mediaId)>() )
{
row >> m_id
>> m_codec
>> m_bitrate
>> m_sampleRate
>> m_nbChannels
>> m_language
>> m_description
>> m_mediaId;
}
AudioTrack::AudioTrack( MediaLibraryPtr, const std::string& codec, unsigned int bitrate, unsigned int sampleRate,
......
......@@ -61,13 +61,13 @@ class AudioTrack : public IAudioTrack, public DatabaseHelpers<AudioTrack>
private:
int64_t m_id;
std::string m_codec;
unsigned int m_bitrate;
unsigned int m_sampleRate;
unsigned int m_nbChannels;
std::string m_language;
std::string m_description;
int64_t m_mediaId;
const std::string m_codec;
const unsigned int m_bitrate;
const unsigned int m_sampleRate;
const unsigned int m_nbChannels;
const std::string m_language;
const std::string m_description;
const int64_t m_mediaId;
private:
friend struct AudioTrack::Table;
......
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