channel.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <string>
9 #include <vector>
10 #include <etk/types.hpp>
11 
12 #ifdef ETK_EXTERN_FRAMEWORK_ROS
13  #include <ros/ros.h>
14  #include "audio_msg/AudioBuffer.h"
15  namespace audio {
16  enum channel {
17  channel_unknow = audio_msg::AudioBuffer::CHANNEL_UNKNOW,
18  channel_frontLeft = audio_msg::AudioBuffer::CHANNEL_FRONT_LEFT,
19  channel_frontCenter = audio_msg::AudioBuffer::CHANNEL_FRONT_CENTER,
20  channel_frontRight = audio_msg::AudioBuffer::CHANNEL_FRONT_RIGHT,
21  channel_rearLeft = audio_msg::AudioBuffer::CHANNEL_REAR_LEFT,
22  channel_rearCenter = audio_msg::AudioBuffer::CHANNEL_REAR_CENTER,
23  channel_rearRight = audio_msg::AudioBuffer::CHANNEL_REAR_RIGHT,
24  channel_centerLeft = audio_msg::AudioBuffer::CHANNEL_CENTER_LEFT,
25  channel_centerRight = audio_msg::AudioBuffer::CHANNEL_CENTER_RIGHT,
26  channel_topFrontLeft = audio_msg::AudioBuffer::CHANNEL_TOP_FRONT_LEFT,
27  channel_topFrontCenter = audio_msg::AudioBuffer::CHANNEL_TOP_FRONT_CENTER,
28  channel_topFrontRight = audio_msg::AudioBuffer::CHANNEL_TOP_FRONT_RIGHT,
29  channel_topRearLeft = audio_msg::AudioBuffer::CHANNEL_TOP_REAR_LEFT,
30  channel_topRearCenter = audio_msg::AudioBuffer::CHANNEL_TOP_REAR_CENTER,
31  channel_topRearRight = audio_msg::AudioBuffer::CHANNEL_TOP_REAR_RIGHT,
32  channel_topCenterLeft = audio_msg::AudioBuffer::CHANNEL_TOP_CENTER_LEFT,
33  channel_topCenterRight = audio_msg::AudioBuffer::CHANNEL_TOP_CENTER_RIGHT,
34  channel_lfe = audio_msg::AudioBuffer::CHANNEL_LFE,
35  channel_aux0 = audio_msg::AudioBuffer::CHANNEL_AUX0,
36  channel_aux1 = audio_msg::AudioBuffer::CHANNEL_AUX1,
37  channel_aux2 = audio_msg::AudioBuffer::CHANNEL_AUX2,
38  channel_aux3 = audio_msg::AudioBuffer::CHANNEL_AUX3,
39  channel_aux4 = audio_msg::AudioBuffer::CHANNEL_AUX4,
40  channel_aux5 = audio_msg::AudioBuffer::CHANNEL_AUX5,
41  channel_aux6 = audio_msg::AudioBuffer::CHANNEL_AUX6,
42  channel_aux7 = audio_msg::AudioBuffer::CHANNEL_AUX7,
43  channel_aux8 = audio_msg::AudioBuffer::CHANNEL_AUX8,
44  channel_aux9 = audio_msg::AudioBuffer::CHANNEL_AUX9,
45  channel_aux10 = audio_msg::AudioBuffer::CHANNEL_AUX10,
46  channel_aux11 = audio_msg::AudioBuffer::CHANNEL_AUX11,
47  channel_aux12 = audio_msg::AudioBuffer::CHANNEL_AUX12,
48  channel_aux13 = audio_msg::AudioBuffer::CHANNEL_AUX13,
49  channel_aux14 = audio_msg::AudioBuffer::CHANNEL_AUX14,
50  channel_aux15 = audio_msg::AudioBuffer::CHANNEL_AUX15,
51  channel_aux16 = audio_msg::AudioBuffer::CHANNEL_AUX16,
52  channel_aux17 = audio_msg::AudioBuffer::CHANNEL_AUX17,
53  channel_aux18 = audio_msg::AudioBuffer::CHANNEL_AUX18,
54  channel_aux19 = audio_msg::AudioBuffer::CHANNEL_AUX19,
55  channel_aux20 = audio_msg::AudioBuffer::CHANNEL_AUX20,
56  channel_aux21 = audio_msg::AudioBuffer::CHANNEL_AUX21,
57  channel_aux22 = audio_msg::AudioBuffer::CHANNEL_AUX22,
58  channel_aux23 = audio_msg::AudioBuffer::CHANNEL_AUX23,
59  channel_aux24 = audio_msg::AudioBuffer::CHANNEL_AUX24,
60  channel_aux25 = audio_msg::AudioBuffer::CHANNEL_AUX25,
61  channel_aux26 = audio_msg::AudioBuffer::CHANNEL_AUX26,
62  channel_aux27 = audio_msg::AudioBuffer::CHANNEL_AUX27,
63  channel_aux28 = audio_msg::AudioBuffer::CHANNEL_AUX28,
64  channel_aux29 = audio_msg::AudioBuffer::CHANNEL_AUX29,
65  channel_aux30 = audio_msg::AudioBuffer::CHANNEL_AUX30,
66  channel_aux31 = audio_msg::AudioBuffer::CHANNEL_AUX31,
67  };
68  };
69 #else
70  namespace audio {
71  enum channel {
73  // normal level
82  // top level
91  // global elements
93  // Some user auxyliary channel (audio mixing table)
94  channel_aux0,
95  channel_aux1,
96  channel_aux2,
97  channel_aux3,
98  channel_aux4,
99  channel_aux5,
100  channel_aux6,
101  channel_aux7,
102  channel_aux8,
103  channel_aux9,
104  channel_aux10,
105  channel_aux11,
106  channel_aux12,
107  channel_aux13,
108  channel_aux14,
109  channel_aux15,
110  channel_aux16,
111  channel_aux17,
112  channel_aux18,
113  channel_aux19,
114  channel_aux20,
115  channel_aux21,
116  channel_aux22,
117  channel_aux23,
118  channel_aux24,
119  channel_aux25,
120  channel_aux26,
121  channel_aux27,
122  channel_aux28,
123  channel_aux29,
124  channel_aux30,
125  channel_aux31,
126  };
127  };
128 #endif
129 namespace audio {
130  std::string getChannelString(enum audio::channel _obj);
131  std::string getChannelString(const std::vector<enum audio::channel>& _obj);
132  enum audio::channel getChannelFromString(const std::string& _value);
133  std::vector<enum audio::channel> getListChannelFromString(const std::string& _value);
134  std::ostream& operator <<(std::ostream& _os, enum audio::channel _obj);
135  std::ostream& operator <<(std::ostream& _os, const std::vector<enum audio::channel>& _obj);
136  std::ostream& operator <<(std::ostream& _os, const std::vector<std::vector<enum audio::channel> >& _obj);
137  // For ROS Interface:
138  std::vector<uint8_t> convertChannel(const std::vector<enum audio::channel>& _obj);
139  std::vector<enum audio::channel> convertChannel(const std::vector<uint8_t>& _obj);
140 };
141 
channel Front Center
Definition: channel.hpp:75
channel Low frequency
Definition: channel.hpp:92
channel top center right
Definition: channel.hpp:90
channel center Right
Definition: channel.hpp:81
Error channel ...
Definition: channel.hpp:72
channel top rear Right
Definition: channel.hpp:88
channel top rear center
Definition: channel.hpp:87
channel Front Left
Definition: channel.hpp:74
channel
Definition: channel.hpp:71
channel top front right
Definition: channel.hpp:85
channel rear Center
Definition: channel.hpp:78
channel top front left
Definition: channel.hpp:83
Audio library namespace.
Definition: channel.hpp:70
channel top center left
Definition: channel.hpp:89
channel rear Left
Definition: channel.hpp:77
channel top rear left
Definition: channel.hpp:86
channel center Left
Definition: channel.hpp:80
channel rear Right
Definition: channel.hpp:79
channel Front Right
Definition: channel.hpp:76
channel top front center
Definition: channel.hpp:84