2 * Copyright (C) 2003-2010 The Music Player Daemon Project
3 * http://www.musicpd.org
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
33 * A queue of #music_chunk objects. One party appends chunks at the
34 * tail, and the other consumes them from the head.
39 * Creates a new #music_pipe object. It is empty.
45 * Frees the object. It must be empty now.
48 music_pipe_free(struct music_pipe
*mp
);
53 * Checks if the audio format if the chunk is equal to the specified
57 music_pipe_check_format(const struct music_pipe
*pipe
,
58 const struct audio_format
*audio_format
);
61 * Checks if the specified chunk is enqueued in the music pipe.
64 music_pipe_contains(const struct music_pipe
*mp
,
65 const struct music_chunk
*chunk
);
70 * Returns the first #music_chunk from the pipe. Returns NULL if the
73 const struct music_chunk
*
74 music_pipe_peek(const struct music_pipe
*mp
);
77 * Removes the first chunk from the head, and returns it.
80 music_pipe_shift(struct music_pipe
*mp
);
83 * Clears the whole pipe and returns the chunks to the buffer.
85 * @param buffer the buffer object to return the chunks to
88 music_pipe_clear(struct music_pipe
*mp
, struct music_buffer
*buffer
);
91 * Pushes a chunk to the tail of the pipe.
94 music_pipe_push(struct music_pipe
*mp
, struct music_chunk
*chunk
);
97 * Returns the number of chunks currently in this pipe.
100 music_pipe_size(const struct music_pipe
*mp
);