Debian Codegraph @

modules/lsp-runtime-lib/include/lsp-plug.in/fmt/lspc/InAudioStream.h

raw
1 /*
2 * Copyright (C) 2022 Linux Studio Plugins Project <https://lsp-plug.in/>
3 * (C) 2022 Vladimir Sadovnikov <[email protected]>
4 *
5 * This file is part of lsp-runtime-lib
6 * Created on: 27 окт. 2022 г.
7 *
8 * lsp-runtime-lib is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * any later version.
12 *
13 * lsp-runtime-lib is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with lsp-runtime-lib. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22 #ifndef LSP_PLUG_IN_FMT_LSPC_INAUDIOSTREAM_H_
23 #define LSP_PLUG_IN_FMT_LSPC_INAUDIOSTREAM_H_
24
25 #include <lsp-plug.in/runtime/version.h>
26
27 #include <lsp-plug.in/fmt/lspc/AudioReader.h>
28 #include <lsp-plug.in/mm/IInAudioStream.h>
29
30 namespace lsp
31 {
32 namespace lspc
33 {
34 class InAudioStream: public mm::IInAudioStream
35 {
36 private:
37 InAudioStream(const InAudioStream &);
38 InAudioStream &operator = (const InAudioStream &);
39
40 protected:
41 AudioReader *pReader;
42 mm::audio_stream_t sFormat;
43 bool bDelete;
44
45 protected:
46 status_t do_close();
47
48 protected:
49 virtual ssize_t direct_read(void *dst, size_t nframes, size_t fmt) override;
50 virtual size_t select_format(size_t fmt) override;
51
52 public:
53 InAudioStream(AudioReader *in, const mm::audio_stream_t *fmt, bool free = false);
54 virtual ~InAudioStream() override;
55
56 public:
57 virtual status_t info(mm::audio_stream_t *dst) const override;
58 virtual size_t sample_rate() const override;
59 virtual size_t channels() const override;
60 virtual wssize_t length() const override;
61 virtual size_t format() const override;
62
63 virtual status_t close() override;
64 virtual wssize_t skip(wsize_t nframes) override;
65 };
66
67 } /* namespace lspc */
68 } /* namespace lsp */
69
70 #endif /* LSP_PLUG_IN_FMT_LSPC_INAUDIOSTREAM_H_ */