/** @file * @author Edouard DUPIN * @copyright 2015, Edouard DUPIN, all right reserved * @license APACHE v2.0 (see license file) */ #ifndef __AIRTIO_MANAGER_H__ #define __AIRTIO_MANAGER_H__ #include #include #include #include #include #include namespace airtio { /** * @brief Audio interface manager : Single interface for every application that want to access on the Audio input/output */ class Manager { private: const std::string& m_applicationUniqueId; //!< name of the application that open the Audio Interface. std::vector > m_listOpenInterface; //!< List of all open Stream. protected: /** * @brief Constructor */ Manager(const std::string& _applicationUniqueId); public: static std::shared_ptr create(const std::string& _applicationUniqueId); /** * @brief Destructor */ virtual ~Manager(); public: /** * @brief Get all input audio stream description. * @return a list of all availlables input stream (name + description) */ virtual std::vector > getListStreamInput(); /** * @brief Get all output audio stream description. * @return a list of all availlables output stream (name + description) */ virtual std::vector > getListStreamOutput(); /** * @brief Set a volume for a specific group * @param[in] _volumeName Name of the volume (MASTER, MATER_BT ...) * @param[in] _value Volume in dB to set. * @return true set done * @return false An error occured * @example : setVolume("MASTER", -3.0f); */ virtual bool setVolume(const std::string& _volumeName, float _valuedB); /** * @brief Get a volume value * @param[in] _volumeName Name of the volume (MASTER, MATER_BT ...) * @return The Volume value in dB. * @example ret = getVolume("MASTER"); can return something like ret = -3.0f */ virtual float getVolume(const std::string& _volumeName) const; /** * @brief Get a parameter value * @param[in] _volumeName Name of the volume (MASTER, MATER_BT ...) * @return The requested value Range. * @example ret = getVolumeRange("MASTER"); can return something like ret=(-120.0f,0.0f) */ virtual std::pair getVolumeRange(const std::string& _volumeName) const; /** * @brief Create output Interface * @param[in] _freq Frequency to open Interface [8,16,22,32,48] kHz * @param[in] _map ChannelMap of the Output * @param[in] _format Sample Format to open the stream [int8_t] * @param[in] _streamName Stream name to open: "" or "default" open current selected output * @param[in] _name Name of this interface * @return a pointer on the interface */ virtual std::shared_ptr createOutput(float _freq, const std::vector& _map, airtalgo::format _format, const std::string& _streamName = "", const std::string& _name = ""); /** * @brief Create input Interface * @param[in] _freq Frequency to open Interface [8,16,22,32,48] kHz * @param[in] _map ChannelMap of the Output * @param[in] _format Sample Format to open the stream [int8_t] * @param[in] _streamName Stream name to open: "" or "default" open current selected input * @param[in] _name Name of this interface * @return a pointer on the interface */ virtual std::shared_ptr createInput(float _freq, const std::vector& _map, airtalgo::format _format, const std::string& _streamName = "", const std::string& _name = ""); }; }; #endif