diff options
author | fulup <fulup.arfoll@iot.bzh> | 2017-08-03 12:00:41 +0200 |
---|---|---|
committer | fulup <fulup.arfoll@iot.bzh> | 2017-08-03 12:00:41 +0200 |
commit | 070ccac33d65c651c972dfab9c6148e43d8d5d8e (patch) | |
tree | 07b79faec9bcaacf14dcc7f8ed08cacf35557e7d /HAL-afb/HAL-interface/hal-interface.h | |
parent | 39384e722d9fd7d162012b682aed41b35d16d003 (diff) |
Initial Working Version on Alsa Policy-Policy-Hook
Diffstat (limited to 'HAL-afb/HAL-interface/hal-interface.h')
-rw-r--r-- | HAL-afb/HAL-interface/hal-interface.h | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/HAL-afb/HAL-interface/hal-interface.h b/HAL-afb/HAL-interface/hal-interface.h index 23944ad..a6310e7 100644 --- a/HAL-afb/HAL-interface/hal-interface.h +++ b/HAL-afb/HAL-interface/hal-interface.h @@ -24,22 +24,22 @@ #include "audio-interface.h" #include <systemd/sd-event.h> - typedef enum { - ACTION_SET, - ACTION_GET + ACTION_SET, + ACTION_GET } ActionSetGetT; // VolRamp Handle Store current status for a given VolRam CB set + typedef struct { - halRampEnumT mode; - halCtlsEnumT slave; - int delay; // delay between volset in us - int stepDown; // linear % - int stepUp; // linear % - int current; // current volume for slave ctl - int target; // target volume - sd_event_source *evtsrc; // event loop timer source + halRampEnumT mode; + halCtlsTagT slave; + int delay; // delay between volset in us + int stepDown; // linear % + int stepUp; // linear % + int current; // current volume for slave ctl + int target; // target volume + sd_event_source *evtsrc; // event loop timer source } halVolRampT; typedef struct { @@ -50,56 +50,56 @@ typedef struct { } alsaHalDBscaleT; typedef struct { - char* name; - int numid; - snd_ctl_elem_type_t type; - int count; - int minval; - int maxval; - int value; - int step; - char **enums; - alsaHalDBscaleT *dbscale; + char* name; + int numid; + snd_ctl_elem_type_t type; + int count; + int minval; + int maxval; + int value; + int step; + const char **enums; + alsaHalDBscaleT *dbscale; } alsaHalCtlMapT; + // avoid compiler warning [Jose does not like typedef :) ] typedef struct afb_service alsaHalServiceT; typedef struct { - void (*callback)(halCtlsEnumT tag, alsaHalCtlMapT *control, void* handle, json_object *valuesJ); - void* handle; + void (*callback)(halCtlsTagT tag, alsaHalCtlMapT *control, void* handle, json_object *valuesJ); + void* handle; } alsaHalCbMapT; typedef struct { - halCtlsEnumT tag; + halCtlsTagT tag; const char *label; alsaHalCtlMapT ctl; alsaHalCbMapT cb; char* info; } alsaHalMapT; -typedef struct { - const char *name; - const char *info; - alsaHalMapT *ctls; - const char *devid; - json_object* (*volumeCB)(ActionSetGetT action, const alsaHalCtlMapT *halCtls, json_object *valuesJ); +typedef struct { + const char *name; + const char *info; + alsaHalMapT *ctls; + const char *devid; + json_object* (*volumeCB)(ActionSetGetT action, const alsaHalCtlMapT *halCtls, json_object *valuesJ); } alsaHalSndCardT; // hal-interface.c extern afb_verb_v2 halServiceApi[]; -extern char *halVolRampModes[]; PUBLIC void halServiceEvent(const char *evtname, json_object *object); -PUBLIC int halServiceInit (const char *apiPrefix, alsaHalSndCardT *alsaHalSndCard); -PUBLIC json_object *halGetCtlByTag (halRampEnumT tag); -PUBLIC int halSetCtlByTag (halRampEnumT tag, int value); +PUBLIC int halServiceInit(const char *apiPrefix, alsaHalSndCardT *alsaHalSndCard); +PUBLIC json_object *halGetCtlByTag(halRampEnumT tag); +PUBLIC int halSetCtlByTag(halRampEnumT tag, int value); // hal-volramp.c -PUBLIC void volumeRamp (halCtlsEnumT halTag,alsaHalCtlMapT *control, void* handle, json_object *valJ); +PUBLIC void volumeRamp(halCtlsTagT halTag, alsaHalCtlMapT *control, void* handle, json_object *valJ); // hal-volume.c -PUBLIC json_object *volumeNormalise(ActionSetGetT action, const alsaHalCtlMapT *halCtls, json_object *valuesJ); +PUBLIC json_object *volumeNormalise(ActionSetGetT action, const alsaHalCtlMapT *halCtls, json_object *valuesJ); #endif /* SHAREHALLIB_H */ |