diff options
author | Loïc Collignon <loic.collignon@iot.bzh> | 2018-12-14 14:42:45 +0100 |
---|---|---|
committer | Loïc Collignon <loic.collignon@iot.bzh> | 2018-12-17 16:54:31 +0100 |
commit | 87be9daee783c15219f960afb092fecb755ab5fc (patch) | |
tree | 4c1088d749fa748316982c56a2b3a351349ebff3 /ahl-binding/ahl-binding.hpp | |
parent | 22c3fc2ae2ba2125bc3af55ab8e6de4bc4102ac6 (diff) |
WIP: adding a master volumesandbox/ctxnop/mastervolume
Create a master volume that binds to the master volume of the real
hardware, as set up in the corresponding HAL.
Change-Id: I18b02327bb42177c21ed8d9db9f7a7b8adbd87d0
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
Diffstat (limited to 'ahl-binding/ahl-binding.hpp')
-rw-r--r-- | ahl-binding/ahl-binding.hpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/ahl-binding/ahl-binding.hpp b/ahl-binding/ahl-binding.hpp index 24f4acb..e5a1d05 100644 --- a/ahl-binding/ahl-binding.hpp +++ b/ahl-binding/ahl-binding.hpp @@ -17,13 +17,13 @@ * limitations under the License. */ +#include <cassert> #include <exception> #include <functional> -#include <sstream> -#include <vector> #include <list> #include <map> -#include <cassert> +#include <sstream> +#include <stack> #include "config_entry.hpp" #include "role.hpp" @@ -31,6 +31,8 @@ #define HL_API_NAME "ahl-4a" #define HL_API_INFO "Audio high level API for AGL applications" #define HAL_MGR_API "4a-hal-manager" +#define VOLUME_CHANGED "volume_changed" +#define MASTER_CONTROL "agl-master-playback-volume" #include "afb-binding-common.h" @@ -42,6 +44,7 @@ private: afb_api_t handle_; afb_event_t volume_changed_; std::vector<role_t> roles_; + std::stack<std::string> active_role_; explicit ahl_binding_t(); @@ -62,6 +65,8 @@ public: int init(); void event(std::string name, json_object* arg); void get_roles(afb_req_t req) const; + void active(afb_req_t req); + void master(afb_req_t req) const; void subscribe(afb_req_t req) const; void unsubscribe(afb_req_t req) const; int emit_volume_changed(const std::string& role, int volume) const; @@ -72,5 +77,3 @@ public: void audiorole(afb_req_t req); int parse_roles_config(json_object* o); }; - - |