Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
pulseaudio_backend.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 Roc 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_backend.h
10 //! @brief Pulseaudio backend.
11 
12 #ifndef ROC_SNDIO_PULSEAUDIO_BACKEND_H_
13 #define ROC_SNDIO_PULSEAUDIO_BACKEND_H_
14 
15 #include "roc_core/array.h"
16 #include "roc_core/noncopyable.h"
17 #include "roc_core/singleton.h"
18 #include "roc_sndio/ibackend.h"
19 
20 namespace roc {
21 namespace sndio {
22 
23 //! Pulseaudio backend.
25 public:
26  //! Get instance.
29  }
30 
31  //! Check whether the backend can handle given input or output.
32  virtual bool probe(const char* driver, const char* inout, int filter_flags);
33 
34  //! Create and open a sink.
35  virtual ISink* open_sink(core::IAllocator& allocator,
36  const char* driver,
37  const char* output,
38  const Config& config);
39 
40  //! Create and open a source.
41  virtual ISource* open_source(core::IAllocator& allocator,
42  const char* driver,
43  const char* input,
44  const Config& config);
45 
46  //! Append supported dirvers to the list.
47  virtual bool get_drivers(core::Array<DriverInfo>& arr, int filter_flags);
48 
49 private:
50  friend class core::Singleton<PulseaudioBackend>;
51 
52  PulseaudioBackend();
53 };
54 
55 } // namespace sndio
56 } // namespace roc
57 
58 #endif // ROC_SNDIO_PULSEAUDIO_BACKEND_H_
Sink interface.
Definition: isink.h:21
Memory allocator interface.
Definition: iallocator.h:23
Singleton.
Root namespace.
virtual bool probe(const char *driver, const char *inout, int filter_flags)
Check whether the backend can handle given input or output.
Backend interface.
Dynamic array.
virtual ISource * open_source(core::IAllocator &allocator, const char *driver, const char *input, const Config &config)
Create and open a source.
Sink and source config.
Definition: config.h:22
Singleton.
Definition: singleton.h:26
Base class for non-copyable objects.
Definition: noncopyable.h:23
static PulseaudioBackend & instance()
Get instance.
Dynamic array.
Definition: array.h:25
Non-copyable object.
Source interface.
Definition: isource.h:21
static T & instance()
Get singleton instance.
Definition: singleton.h:29
virtual ISink * open_sink(core::IAllocator &allocator, const char *driver, const char *output, const Config &config)
Create and open a sink.
Backend interface.
Definition: ibackend.h:27
virtual bool get_drivers(core::Array< DriverInfo > &arr, int filter_flags)
Append supported dirvers to the list.