RemoteTagCache: new glue class for integrating RemoteTagScanner
This commit also puts an instance of RemoteTagScanner into the Instance class, and hooks it into the "add" and "addid" commands.
This commit is contained in:
@@ -43,6 +43,24 @@ playlist::TagModified(DetachedSong &&song)
|
||||
OnModified();
|
||||
}
|
||||
|
||||
void
|
||||
playlist::TagModified(const char *uri, const Tag &tag) noexcept
|
||||
{
|
||||
bool modified = false;
|
||||
|
||||
for (unsigned i = 0; i < queue.length; ++i) {
|
||||
auto &song = *queue.items[i].song;
|
||||
if (song.IsURI(uri)) {
|
||||
song.SetTag(tag);
|
||||
queue.ModifyAtPosition(i);
|
||||
modified = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (modified)
|
||||
OnModified();
|
||||
}
|
||||
|
||||
inline void
|
||||
playlist::QueueSongOrder(PlayerControl &pc, unsigned order)
|
||||
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#include "queue/Queue.hxx"
|
||||
|
||||
enum TagType : uint8_t;
|
||||
struct Tag;
|
||||
struct PlayerControl;
|
||||
class DetachedSong;
|
||||
class Database;
|
||||
@@ -192,6 +193,7 @@ public:
|
||||
* the song matches.
|
||||
*/
|
||||
void TagModified(DetachedSong &&song);
|
||||
void TagModified(const char *uri, const Tag &tag) noexcept;
|
||||
|
||||
#ifdef ENABLE_DATABASE
|
||||
/**
|
||||
|
Reference in New Issue
Block a user