[DEV] remove ROS dependency

This commit is contained in:
Edouard DUPIN 2016-11-16 22:26:07 +01:00
parent cec6914685
commit ad6cbd0870
2 changed files with 72 additions and 157 deletions

View File

@ -9,65 +9,7 @@
#include <vector> #include <vector>
#include <etk/types.hpp> #include <etk/types.hpp>
#ifdef ETK_EXTERN_FRAMEWORK_ROS namespace audio {
#include <ros/ros.h>
#include "audio_msg/AudioBuffer.h"
namespace audio {
enum channel {
channel_unknow = audio_msg::AudioBuffer::CHANNEL_UNKNOW,
channel_frontLeft = audio_msg::AudioBuffer::CHANNEL_FRONT_LEFT,
channel_frontCenter = audio_msg::AudioBuffer::CHANNEL_FRONT_CENTER,
channel_frontRight = audio_msg::AudioBuffer::CHANNEL_FRONT_RIGHT,
channel_rearLeft = audio_msg::AudioBuffer::CHANNEL_REAR_LEFT,
channel_rearCenter = audio_msg::AudioBuffer::CHANNEL_REAR_CENTER,
channel_rearRight = audio_msg::AudioBuffer::CHANNEL_REAR_RIGHT,
channel_centerLeft = audio_msg::AudioBuffer::CHANNEL_CENTER_LEFT,
channel_centerRight = audio_msg::AudioBuffer::CHANNEL_CENTER_RIGHT,
channel_topFrontLeft = audio_msg::AudioBuffer::CHANNEL_TOP_FRONT_LEFT,
channel_topFrontCenter = audio_msg::AudioBuffer::CHANNEL_TOP_FRONT_CENTER,
channel_topFrontRight = audio_msg::AudioBuffer::CHANNEL_TOP_FRONT_RIGHT,
channel_topRearLeft = audio_msg::AudioBuffer::CHANNEL_TOP_REAR_LEFT,
channel_topRearCenter = audio_msg::AudioBuffer::CHANNEL_TOP_REAR_CENTER,
channel_topRearRight = audio_msg::AudioBuffer::CHANNEL_TOP_REAR_RIGHT,
channel_topCenterLeft = audio_msg::AudioBuffer::CHANNEL_TOP_CENTER_LEFT,
channel_topCenterRight = audio_msg::AudioBuffer::CHANNEL_TOP_CENTER_RIGHT,
channel_lfe = audio_msg::AudioBuffer::CHANNEL_LFE,
channel_aux0 = audio_msg::AudioBuffer::CHANNEL_AUX0,
channel_aux1 = audio_msg::AudioBuffer::CHANNEL_AUX1,
channel_aux2 = audio_msg::AudioBuffer::CHANNEL_AUX2,
channel_aux3 = audio_msg::AudioBuffer::CHANNEL_AUX3,
channel_aux4 = audio_msg::AudioBuffer::CHANNEL_AUX4,
channel_aux5 = audio_msg::AudioBuffer::CHANNEL_AUX5,
channel_aux6 = audio_msg::AudioBuffer::CHANNEL_AUX6,
channel_aux7 = audio_msg::AudioBuffer::CHANNEL_AUX7,
channel_aux8 = audio_msg::AudioBuffer::CHANNEL_AUX8,
channel_aux9 = audio_msg::AudioBuffer::CHANNEL_AUX9,
channel_aux10 = audio_msg::AudioBuffer::CHANNEL_AUX10,
channel_aux11 = audio_msg::AudioBuffer::CHANNEL_AUX11,
channel_aux12 = audio_msg::AudioBuffer::CHANNEL_AUX12,
channel_aux13 = audio_msg::AudioBuffer::CHANNEL_AUX13,
channel_aux14 = audio_msg::AudioBuffer::CHANNEL_AUX14,
channel_aux15 = audio_msg::AudioBuffer::CHANNEL_AUX15,
channel_aux16 = audio_msg::AudioBuffer::CHANNEL_AUX16,
channel_aux17 = audio_msg::AudioBuffer::CHANNEL_AUX17,
channel_aux18 = audio_msg::AudioBuffer::CHANNEL_AUX18,
channel_aux19 = audio_msg::AudioBuffer::CHANNEL_AUX19,
channel_aux20 = audio_msg::AudioBuffer::CHANNEL_AUX20,
channel_aux21 = audio_msg::AudioBuffer::CHANNEL_AUX21,
channel_aux22 = audio_msg::AudioBuffer::CHANNEL_AUX22,
channel_aux23 = audio_msg::AudioBuffer::CHANNEL_AUX23,
channel_aux24 = audio_msg::AudioBuffer::CHANNEL_AUX24,
channel_aux25 = audio_msg::AudioBuffer::CHANNEL_AUX25,
channel_aux26 = audio_msg::AudioBuffer::CHANNEL_AUX26,
channel_aux27 = audio_msg::AudioBuffer::CHANNEL_AUX27,
channel_aux28 = audio_msg::AudioBuffer::CHANNEL_AUX28,
channel_aux29 = audio_msg::AudioBuffer::CHANNEL_AUX29,
channel_aux30 = audio_msg::AudioBuffer::CHANNEL_AUX30,
channel_aux31 = audio_msg::AudioBuffer::CHANNEL_AUX31,
};
};
#else
namespace audio {
enum channel { enum channel {
channel_unknow, //!< Error channel ... channel_unknow, //!< Error channel ...
// normal level // normal level
@ -124,9 +66,6 @@
channel_aux30, channel_aux30,
channel_aux31, channel_aux31,
}; };
};
#endif
namespace audio {
std::string getChannelString(enum audio::channel _obj); std::string getChannelString(enum audio::channel _obj);
std::string getChannelString(const std::vector<enum audio::channel>& _obj); std::string getChannelString(const std::vector<enum audio::channel>& _obj);
enum audio::channel getChannelFromString(const std::string& _value); enum audio::channel getChannelFromString(const std::string& _value);
@ -137,5 +76,5 @@ namespace audio {
// For ROS Interface: // For ROS Interface:
std::vector<uint8_t> convertChannel(const std::vector<enum audio::channel>& _obj); std::vector<uint8_t> convertChannel(const std::vector<enum audio::channel>& _obj);
std::vector<enum audio::channel> convertChannel(const std::vector<uint8_t>& _obj); std::vector<enum audio::channel> convertChannel(const std::vector<uint8_t>& _obj);
}; }

View File

@ -7,27 +7,7 @@
#include <string> #include <string>
#ifdef ETK_EXTERN_FRAMEWORK_ROS namespace audio {
#include <ros/ros.h>
#include "audio_msg/AudioBuffer.h"
namespace audio {
enum format {
format_unknow = audio_msg::AudioBuffer::FORMAT_UNKNOW,
format_int8 = audio_msg::AudioBuffer::FORMAT_INT8,
format_int8_on_int16 = audio_msg::AudioBuffer::FORMAT_INT8_ON_INT16,
format_int16 = audio_msg::AudioBuffer::FORMAT_INT16,
format_int16_on_int32 = audio_msg::AudioBuffer::FORMAT_INT16_ON_INT32,
format_int24 = audio_msg::AudioBuffer::FORMAT_INT24,
format_int24_on_int32 = audio_msg::AudioBuffer::FORMAT_INT24_ON_INT32,
format_int32 = audio_msg::AudioBuffer::FORMAT_INT32,
format_int32_on_int64 = audio_msg::AudioBuffer::FORMAT_INT32_ON_INT64,
format_int64 = audio_msg::AudioBuffer::FORMAT_INT64,
format_float = audio_msg::AudioBuffer::FORMAT_FLOAT,
format_double = audio_msg::AudioBuffer::FORMAT_DOUBLE
};
};
#else
namespace audio {
enum format { enum format {
format_unknow, format_unknow,
format_int8, //!< Signed 8 bits format_int8, //!< Signed 8 bits
@ -42,10 +22,6 @@
format_float, //!< Floating point 32 bits (single precision) format_float, //!< Floating point 32 bits (single precision)
format_double //!< Floating point 64 bits (double precision) format_double //!< Floating point 64 bits (double precision)
}; };
};
#endif
namespace audio {
std::string getFormatString(enum audio::format _format); std::string getFormatString(enum audio::format _format);
enum audio::format getFormatFromString(const std::string& _value); enum audio::format getFormatFromString(const std::string& _value);
std::vector<enum audio::format> getListFormatFromString(const std::string& _value); std::vector<enum audio::format> getListFormatFromString(const std::string& _value);
@ -57,5 +33,5 @@ namespace audio {
std::vector<enum audio::format> convertFormat(const std::vector<uint8_t>& _obj); std::vector<enum audio::format> convertFormat(const std::vector<uint8_t>& _obj);
uint8_t convertFormat(enum audio::format _obj); uint8_t convertFormat(enum audio::format _obj);
enum audio::format convertFormat(uint8_t _obj); enum audio::format convertFormat(uint8_t _obj);
}; }