DetachedSong: add LightSong cast operator
This commit is contained in:
parent
332baa4f67
commit
e9c99e0518
@ -31,6 +31,19 @@ DetachedSong::DetachedSong(const LightSong &other)
|
||||
start_time(other.start_time),
|
||||
end_time(other.end_time) {}
|
||||
|
||||
DetachedSong::operator LightSong() const
|
||||
{
|
||||
LightSong result;
|
||||
result.directory = nullptr;
|
||||
result.uri = uri.c_str();
|
||||
result.real_uri = real_uri.empty() ? nullptr : real_uri.c_str();
|
||||
result.tag = &tag;
|
||||
result.mtime = mtime;
|
||||
result.start_time = start_time;
|
||||
result.end_time = end_time;
|
||||
return result;
|
||||
}
|
||||
|
||||
bool
|
||||
DetachedSong::IsRemote() const
|
||||
{
|
||||
|
@ -107,6 +107,9 @@ public:
|
||||
DetachedSong(DetachedSong &&) = default;
|
||||
DetachedSong &operator=(DetachedSong &&) = default;
|
||||
|
||||
gcc_pure
|
||||
explicit operator LightSong() const;
|
||||
|
||||
gcc_pure
|
||||
const char *GetURI() const {
|
||||
return uri.c_str();
|
||||
|
Loading…
Reference in New Issue
Block a user