00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef MPD_PIPE_H
00021 #define MPD_PIPE_H
00022
00023 #include <glib.h>
00024 #include <stdbool.h>
00025
00026 #ifndef NDEBUG
00027 struct audio_format;
00028 #endif
00029
00030 struct music_chunk;
00031 struct music_buffer;
00032
00037 struct music_pipe;
00038
00042 G_GNUC_MALLOC
00043 struct music_pipe *
00044 music_pipe_new(void);
00045
00049 void
00050 music_pipe_free(struct music_pipe *mp);
00051
00052 #ifndef NDEBUG
00053
00058 bool
00059 music_pipe_check_format(const struct music_pipe *pipe,
00060 const struct audio_format *audio_format);
00061
00065 bool
00066 music_pipe_contains(const struct music_pipe *mp,
00067 const struct music_chunk *chunk);
00068
00069 #endif
00070
00075 G_GNUC_PURE
00076 const struct music_chunk *
00077 music_pipe_peek(const struct music_pipe *mp);
00078
00082 struct music_chunk *
00083 music_pipe_shift(struct music_pipe *mp);
00084
00090 void
00091 music_pipe_clear(struct music_pipe *mp, struct music_buffer *buffer);
00092
00096 void
00097 music_pipe_push(struct music_pipe *mp, struct music_chunk *chunk);
00098
00102 G_GNUC_PURE
00103 unsigned
00104 music_pipe_size(const struct music_pipe *mp);
00105
00106 G_GNUC_PURE
00107 static inline bool
00108 music_pipe_empty(const struct music_pipe *mp)
00109 {
00110 return music_pipe_size(mp) == 0;
00111 }
00112
00113 #endif