audioConfig.h
1 #pragma once
2 
3 #include <map>
4 #include <list>
5 #include <vector>
6 #include <string>
7 #include <boost/system/error_code.hpp>
8 #include <mutex>
9 
10 
11 namespace dpyAudio {
12 
13  const int MAX_PRIORITY_VALUE = 100;
14  const int MIN_PRIORITY_VALUE = 0;
15  const int DEFAULT_PRIORITY_VALUE = 0;
16 
17  const int MIN_VOLUME = 0;
18  const int MAX_VOLUME = 100;
19  const int DEF_CONNECTION_VOLUME = -1;
20 
21  const int MIN_GAIN = 0;
22  const int MAX_GAIN = 100;
23  const int DEF_CONNECTION_GAIN = -1;
24 
28  enum Parameter
29  {
30  UNKNOWN = -1,
31  VOLUME = 0
32  };
33 
34 
39  {
40  dpyAudio::Parameter parameter = dpyAudio::Parameter::UNKNOWN;
41  int value = 0;
42 
43  public:
49  static inline std::string parameterToString(dpyAudio::Parameter parameter){
50  switch (parameter) {
51  case dpyAudio::Parameter::VOLUME:
52  return "VOLUME";
53  default:
54  return "UNKNOWN";
55  }
56  }
57 
63  static inline dpyAudio::Parameter stringToParameter(std::string parameter){
64  if (parameter.compare("VOLUME") == 0) {
65  return dpyAudio::Parameter::VOLUME;
66  }
67  return dpyAudio::Parameter::UNKNOWN;
68  }
69 
70 
76  inline AudioConfig(dpyAudio::Parameter parameter, int value) : parameter(parameter), value(value){
77  }
78 
82  inline AudioConfig() : parameter(dpyAudio::Parameter::UNKNOWN), value (0) {
83  }
84 
85 
91  {
92  return parameter;
93  }
94 
99  int getValue() const
100  {
101  return value;
102  }
103 
108  void setValue(const int value)
109  {
110  this->value = value;
111  }
112  };
113 
114 };
static std::string parameterToString(dpyAudio::Parameter parameter)
converts a parameter to string
Definition: audioConfig.h:49
AudioConfig(dpyAudio::Parameter parameter, int value)
initialization of the class
Definition: audioConfig.h:76
const int MIN_VOLUME
Min allowed value for volume.
Definition: audioConfig.h:17
Volume.
Definition: audioConfig.h:30
const int DEF_CONNECTION_VOLUME
Default value for connection volume if not defined.
Definition: audioConfig.h:19
dpyAudio::Parameter getParameter() const
Definition: audioConfig.h:90
void setValue(const int value)
Definition: audioConfig.h:108
const int MAX_GAIN
Max allowed value for gain.
Definition: audioConfig.h:22
const int DEFAULT_PRIORITY_VALUE
Default value for connection priority if not defined.
Definition: audioConfig.h:15
Deepsy Audio namespace that includes the different enums, structs or method signatures that should be...
Parameter
Parameter for defining audio properties.
Definition: audioConfig.h:28
Struct defining audio configuration.
Definition: audioConfig.h:38
const int MIN_PRIORITY_VALUE
Min allowed value for connection priority.
Definition: audioConfig.h:14
AudioConfig()
initialization of the class
Definition: audioConfig.h:82
int getValue() const
Definition: audioConfig.h:99
const int MAX_VOLUME
Max allowed value for volume.
Definition: audioConfig.h:18
const int MAX_PRIORITY_VALUE
Max allowed value for connection priority.
Definition: audioConfig.h:13
const int MIN_GAIN
Min allowed value for gain.
Definition: audioConfig.h:21
Volume.
Definition: audioConfig.h:31
static dpyAudio::Parameter stringToParameter(std::string parameter)
converts a string into a parameter
Definition: audioConfig.h:63
const int DEF_CONNECTION_GAIN
Default value for connection gain if not defined.
Definition: audioConfig.h:23