MCPcopy Create free account
hub / github.com/MusicPlayerDaemon/MPD / PrintQueue

Function PrintQueue

src/queue/Print.cxx:166–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164}
165
166void
167PrintQueue(Response &r, const Queue &queue,
168 const QueueSelection &selection)
169{
170 if (selection.sort != TAG_NUM_OF_ITEM_TYPES) {
171 PrintSortedQueue(r, queue, selection);
172 return;
173 }
174
175 auto window = selection.window;
176
177 if (!window.CheckClip(queue.GetLength()))
178 throw PlaylistError::BadRange();
179
180 if (selection.window.IsEmpty())
181 return;
182
183 unsigned skip = window.start;
184 unsigned n = window.Count();
185
186 for (unsigned i = 0; i < queue.GetLength(); i++) {
187 if (!selection.MatchPosition(queue, i))
188 continue;
189
190 if (skip > 0) {
191 --skip;
192 continue;
193 }
194
195 queue_print_song_info(r, queue, i);
196
197 if (--n == 0)
198 break;
199 }
200}

Callers 1

playlist_print_findFunction · 0.85

Calls 5

PrintSortedQueueFunction · 0.85
GetLengthMethod · 0.80
IsEmptyMethod · 0.80
MatchPositionMethod · 0.80
queue_print_song_infoFunction · 0.70

Tested by

no test coverage detected