Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Loading...
Searching...
No Matches
driver_info.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/driver_info.h
10//! @brief Driver info interface.
11
12#ifndef ROC_SNDIO_DRIVER_INFO_H_
13#define ROC_SNDIO_DRIVER_INFO_H_
14
15#include "roc_core/array.h"
16
17namespace roc {
18namespace sndio {
19
20//! Driver info interface.
21struct DriverInfo {
22 DriverInfo();
23
24 //! Max size of string
25 enum { MaxSize = 20 };
26
27 //! Parameterized Constructor initializes name, assumes driver_name is terminated with
28 //! null char
29 explicit DriverInfo(const char* driver_name);
30
31 //! Placeholder for the driver name
32 char name[MaxSize];
33};
34
35//! Append driver to array and ensure uniqueness, returns false if unable to allocate
36//! space for item.
37bool add_driver_uniq(core::Array<DriverInfo>& arr, const char* driver_name);
38
39} // namespace sndio
40} // namespace roc
41
42#endif // ROC_SNDIO_DRIVER_INFO_H_
Dynamic array.
Dynamic array.
Definition: array.h:25
bool add_driver_uniq(core::Array< DriverInfo > &arr, const char *driver_name)
Append driver to array and ensure uniqueness, returns false if unable to allocate space for item.
Root namespace.
Driver info interface.
Definition: driver_info.h:21
char name[MaxSize]
Placeholder for the driver name.
Definition: driver_info.h:32
DriverInfo(const char *driver_name)
Parameterized Constructor initializes name, assumes driver_name is terminated with null char.