97 static inline unsigned
111 return queue->
length == 0;
131 return position < queue->
length;
140 return order < queue->
length;
158 assert(position < queue->length);
160 return queue->
items[position].
id;
163 static inline unsigned
166 assert(order < queue->length);
168 return queue->
order[order];
171 static inline unsigned
174 assert(position < queue->length);
176 for (
unsigned i = 0;; ++i) {
177 assert(i < queue->length);
179 if (queue->
order[i] == position)
187 static inline struct song *
190 assert(position < queue->length);
198 static inline struct song *
212 assert(position < queue->length);
214 return version > queue->
version ||
283 unsigned tmp = queue->
order[order1];
285 queue->
order[order2] = tmp;
318 for (
unsigned i = 0; i < queue->
length; ++i)