20 #ifndef MPD_DETACHED_SONG_HXX 21 #define MPD_DETACHED_SONG_HXX 91 :
uri(std::move(_uri)) {}
95 :
uri(std::forward<U>(_uri)),
96 tag(std::move(_tag)) {}
109 uri = std::forward<T>(_uri);
118 return !real_uri.empty();
132 real_uri = std::forward<T>(_uri);
141 return uri == other.
uri &&
147 bool IsURI(
const char *other_uri)
const noexcept {
148 return uri == other_uri;
178 tag = std::move(_tag);
182 tag = std::move(other.
tag);
bool Update()
Update the #tag and #mtime.
SongTime GetStartTime() const
time_t GetLastModified() const
static constexpr SongTime zero()
gcc_pure SignedSongTime GetDuration() const noexcept
The meta information about a song file.
A time stamp within a song.
gcc_pure const char * GetURI() const noexcept
gcc_pure bool IsSame(const DetachedSong &other) const noexcept
Returns true if both objects refer to the same physical song.
gcc_pure bool IsRemote() const noexcept
void SetLastModified(time_t _value)
gcc_pure bool IsFile() const noexcept
void SetEndTime(SongTime _value)
DetachedSong(const std::string &_uri)
gcc_pure bool HasRealURI() const noexcept
Does this object have a "real" URI different from the displayed URI?
bool LoadFile(Path path)
Load #tag and #mtime from a local file.
void SetRealURI(T &&_uri)
gcc_pure gcc_nonnull_all bool IsURI(const char *other_uri) const noexcept
SongTime GetEndTime() const
SongTime start_time
Start of this sub-song within the file.
A path name in the native file system character set.
DetachedSong(const char *_uri)
void MoveTagFrom(DetachedSong &&other)
void MoveItemsFrom(Tag &&other)
Similar to the move operator, but move only the TagItem array.
DetachedSong(std::string &&_uri)
SongTime end_time
End of this sub-song within the file.
gcc_pure bool IsAbsoluteFile() const noexcept
friend DetachedSong DatabaseDetachSong(const Storage &db, const LightSong &song)
"Detach" the Song object, i.e.
const Tag * tag
Must not be nullptr.
A variant of SongTime that is based on a signed integer.
void SetTag(const Tag &_tag)
const Tag & GetTag() const noexcept
void SetStartTime(SongTime _value)
Tag & WritableTag() noexcept
gcc_pure const char * GetRealURI() const noexcept
Returns "real" URI (#real_uri) and falls back to just GetURI().
DetachedSong(U &&_uri, Tag &&_tag)
const Storage const char * uri
gcc_pure bool IsInDatabase() const noexcept
void MoveTagItemsFrom(DetachedSong &&other)
Similar to the MoveTagFrom(), but move only the TagItem array.
A reference to a song file.