Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
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 
17 namespace roc {
18 namespace sndio {
19 
20 //! Driver info interface.
21 struct 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.
37 bool 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_
Root namespace.
Dynamic array.
char name[MaxSize]
Placeholder for the driver name.
Definition: driver_info.h:32
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...
Dynamic array.
Definition: array.h:25
Driver info interface.
Definition: driver_info.h:21