MPD  0.20.15
DecoderAPI.hxx
Go to the documentation of this file.
1 /*
2  * Copyright 2003-2017 The Music Player Daemon Project
3  * http://www.musicpd.org
4  *
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.
9  *
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.
14  *
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.
18  */
19 
27 #ifndef MPD_DECODER_API_HXX
28 #define MPD_DECODER_API_HXX
29 
30 // IWYU pragma: begin_exports
31 
32 #include "check.h"
33 #include "Client.hxx"
34 #include "input/Ptr.hxx"
35 #include "DecoderCommand.hxx"
36 #include "DecoderPlugin.hxx"
37 #include "ReplayGainInfo.hxx"
38 #include "tag/Tag.hxx"
39 #include "AudioFormat.hxx"
40 #include "MixRampInfo.hxx"
41 #include "config/Block.hxx"
42 #include "Chrono.hxx"
43 
44 // IWYU pragma: end_exports
45 
46 #include <stdint.h>
47 
48 class DecoderClient;
49 
55 class StopDecoder {};
56 
67 size_t
69  void *buffer, size_t length);
70 
71 static inline size_t
73  void *buffer, size_t length)
74 {
75  return decoder_read(&decoder, is, buffer, length);
76 }
77 
85 bool
87  void *buffer, size_t size);
88 
94 bool
95 decoder_skip(DecoderClient *decoder, InputStream &is, size_t size);
96 
97 #endif
An interface between the decoder plugin and the MPD core.
Definition: Client.hxx:39
size_t decoder_read(DecoderClient *decoder, InputStream &is, void *buffer, size_t length)
Blocking read from the input stream.
Throw an instance of this class to stop decoding the current song (successfully). ...
Definition: DecoderAPI.hxx:55
bool decoder_skip(DecoderClient *decoder, InputStream &is, size_t size)
Skip data on the InputStream.
bool decoder_read_full(DecoderClient *decoder, InputStream &is, void *buffer, size_t size)
Blocking read from the input stream.