Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Loading...
Searching...
No Matches
pulseaudio_sink.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 Roc Streaming authors
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 */
8
9//! @file roc_sndio/target_pulseaudio/roc_sndio/pulseaudio_sink.h
10//! @brief PulseAudio sink.
11
12#ifndef ROC_SNDIO_PULSEAUDIO_SINK_H_
13#define ROC_SNDIO_PULSEAUDIO_SINK_H_
14
15#include "roc_sndio/isink.h"
17
18namespace roc {
19namespace sndio {
20
21//! PulseAudio sink,
22class PulseaudioSink : public ISink, public PulseaudioDevice {
23public:
24 //! Initialize.
25 PulseaudioSink(const Config& config);
26
28
29 //! Get device type.
30 virtual DeviceType type() const;
31
32 //! Get device state.
33 virtual DeviceState state() const;
34
35 //! Pause reading.
36 virtual void pause();
37
38 //! Resume paused reading.
39 virtual bool resume();
40
41 //! Restart reading from the beginning.
42 virtual bool restart();
43
44 //! Get sample specification of the sink.
46
47 //! Get latency of the sink.
49
50 //! Check if the sink supports latency reports.
51 virtual bool has_latency() const;
52
53 //! Check if the sink has own clock.
54 virtual bool has_clock() const;
55
56 //! Write audio frame.
57 virtual void write(audio::Frame& frame);
58};
59
60} // namespace sndio
61} // namespace roc
62
63#endif // ROC_SNDIO_PULSEAUDIO_SINK_H_
Audio frame.
Definition frame.h:25
Sample specification. Describes sample rate and channels.
Definition sample_spec.h:26
Shared ownership intrusive pointer.
Definition shared_ptr.h:32
Sink interface.
Definition isink.h:22
PulseAudio device. Base class for PulseAudio source and sink.
virtual DeviceState state() const
Get device state.
virtual core::nanoseconds_t latency() const
Get latency of the sink.
virtual bool has_clock() const
Check if the sink has own clock.
PulseaudioSink(const Config &config)
Initialize.
virtual void pause()
Pause reading.
virtual bool has_latency() const
Check if the sink supports latency reports.
virtual void write(audio::Frame &frame)
Write audio frame.
virtual bool resume()
Resume paused reading.
virtual audio::SampleSpec sample_spec() const
Get sample specification of the sink.
virtual DeviceType type() const
Get device type.
virtual bool restart()
Restart reading from the beginning.
Sink interface.
DeviceType
Device type.
Definition device_type.h:19
DeviceState
Device state.
Root namespace.
PulseAudio device.
Sink and source config.
Definition config.h:29