diff options
author | Andrzej Rybczak <electricityispower@gmail.com> | 2012-08-14 16:09:45 +0200 |
---|---|---|
committer | Andrzej Rybczak <electricityispower@gmail.com> | 2012-08-14 16:09:45 +0200 |
commit | bab756c57952238bfcd306f1e3a6e6f42f4338c6 (patch) | |
tree | 4fd2370b605a60ec16139b6e9ab38a1e0ba64194 /src/mpdpp.cpp | |
parent | d51edfd262bb11845fa026004549c81e8aa6b716 (diff) |
add support for priorities (queueing)
Diffstat (limited to 'src/mpdpp.cpp')
-rw-r--r-- | src/mpdpp.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mpdpp.cpp b/src/mpdpp.cpp index 7a2e82af..285d0573 100644 --- a/src/mpdpp.cpp +++ b/src/mpdpp.cpp @@ -839,6 +839,22 @@ void MPD::Connection::SetCrossfade(unsigned crossfade) } } +bool MPD::Connection::SetPriority(const Song &s, int prio) +{ + if (!itsConnection) + return false; + if (!isCommandsListEnabled) + { + GoBusy(); + return mpd_run_prio_id(itsConnection, prio, s.GetID()); + } + else + { + assert(!isIdle); + return mpd_send_prio_id(itsConnection, prio, s.GetID()); + } +} + int MPD::Connection::AddSong(const std::string &path, int pos) { if (!itsConnection) |