Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
sndfile_backend.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023 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_sndfile/roc_sndio/sndfile_backend.h
10 //! @brief SndFile backend.
11 
12 #ifndef ROC_SNDIO_SNDFILE_BACKEND_H_
13 #define ROC_SNDIO_SNDFILE_BACKEND_H_
14 
15 #include <sndfile.h>
16 
17 #include "roc_audio/sample_spec.h"
18 #include "roc_core/noncopyable.h"
19 #include "roc_sndio/ibackend.h"
20 
21 namespace roc {
22 namespace sndio {
23 
24 //! Sndfile backend.
26 public:
28 
29  //! Append supported drivers to the list.
31 
32  //! Create and open a sink or source.
33  virtual IDevice* open_device(DeviceType device_type,
34  DriverType driver_type,
35  const char* driver,
36  const char* path,
37  const Config& config,
38  core::IArena& arena);
39  //! Returns name of backend.
40  virtual const char* name() const;
41 };
42 
43 } // namespace sndio
44 } // namespace roc
45 
46 #endif // ROC_SNDIO_SNDFILE_BACKEND_H_
Dynamic array.
Definition: array.h:40
Memory arena interface.
Definition: iarena.h:23
Base class for non-copyable objects.
Definition: noncopyable.h:23
Backend interface.
Definition: ibackend.h:29
Base interface for sinks and sources.
Definition: idevice.h:28
virtual void discover_drivers(core::Array< DriverInfo, MaxDrivers > &driver_list)
Append supported drivers to the list.
virtual const char * name() const
Returns name of backend.
virtual IDevice * open_device(DeviceType device_type, DriverType driver_type, const char *driver, const char *path, const Config &config, core::IArena &arena)
Create and open a sink or source.
Backend interface.
DeviceType
Device type.
Definition: device_type.h:19
DriverType
Driver type.
Definition: driver.h:27
Root namespace.
Non-copyable object.
Sample specifications.
Sink and source config.
Definition: config.h:29