aboutsummaryrefslogtreecommitdiffstats
path: root/src/Queue.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-07 21:39:47 +0100
committerMax Kellermann <max@duempel.org>2014-01-09 09:05:58 +0100
commit322b0616322760dc162447563d8f4da7e024ca90 (patch)
tree2f87cb3ce061556161797aba9f57ee08de5b9e21 /src/Queue.hxx
parent43847f2244a34064af24704aac4cfad4a3c76f7d (diff)
downloadmpd-322b0616322760dc162447563d8f4da7e024ca90.tar.gz
mpd-322b0616322760dc162447563d8f4da7e024ca90.tar.xz
mpd-322b0616322760dc162447563d8f4da7e024ca90.zip
DetachedSong: fork of struct Song
From now on, struct Song will be used by the database only, and DetachedSong will be used by everybody else. DetachedSong is easier to use, but Song has lower overhead.
Diffstat (limited to 'src/Queue.hxx')
-rw-r--r--src/Queue.hxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Queue.hxx b/src/Queue.hxx
index da90d4a3d..8f893dbfa 100644
--- a/src/Queue.hxx
+++ b/src/Queue.hxx
@@ -29,7 +29,7 @@
#include <assert.h>
#include <stdint.h>
-struct Song;
+class DetachedSong;
/**
* A queue of songs. This is the backend of the playlist: it contains
@@ -53,7 +53,7 @@ struct queue {
* information attached.
*/
struct Item {
- Song *song;
+ DetachedSong *song;
/** the unique id of this item in the queue */
unsigned id;
@@ -200,7 +200,7 @@ struct queue {
/**
* Returns the song at the specified position.
*/
- Song &Get(unsigned position) const {
+ DetachedSong &Get(unsigned position) const {
assert(position < length);
return *items[position].song;
@@ -209,7 +209,7 @@ struct queue {
/**
* Returns the song at the specified order number.
*/
- Song &GetOrder(unsigned _order) const {
+ DetachedSong &GetOrder(unsigned _order) const {
return Get(OrderToPosition(_order));
}
@@ -268,7 +268,7 @@ struct queue {
*
* @param priority the priority of this new queue item
*/
- unsigned Append(Song *song, uint8_t priority);
+ unsigned Append(DetachedSong &&song, uint8_t priority);
/**
* Swaps two songs, addressed by their position.