summaryrefslogtreecommitdiffstats
path: root/src/ahl-interface.h
diff options
context:
space:
mode:
authorTai Vuong <tvuong@audiokinetic.com>2017-10-30 15:18:33 -0400
committerTai Vuong <tvuong@audiokinetic.com>2017-10-30 15:18:33 -0400
commitc46955de2731563d1991691cd1a7986f05f019e3 (patch)
treee0375428c2c9ad60bbfb8cc7f53f157770232ea6 /src/ahl-interface.h
parent53aea8f073c5b4ad859c39f903fdbcaccd2fc5b8 (diff)
parent8a584f01b46d251fdc5de8b071eff755d99f0090 (diff)
isolate structure use in policy util from HLB
Diffstat (limited to 'src/ahl-interface.h')
-rw-r--r--src/ahl-interface.h131
1 files changed, 78 insertions, 53 deletions
diff --git a/src/ahl-interface.h b/src/ahl-interface.h
index 781bb05..0488e96 100644
--- a/src/ahl-interface.h
+++ b/src/ahl-interface.h
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2017 "Audiokinetic Inc"
- * Author Francois Thibault <fthibault@audiokinetic.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,57 +17,83 @@
#ifndef AHL_INTERFACE_INCLUDE
#define AHL_INTERFACE_INCLUDE
-#define UNDEFINED_ID -1
-
-typedef int endpointID_t;
-typedef int streamID_t;
-
-typedef enum EndpointType {
- ENDPOINTTYPE_SOURCE = 0, // source devices
- ENDPOINTTYPE_SINK, // sink devices
- ENDPOINTTYPE_MAXVALUE // Enum count, keep at the end
-} EndpointTypeT;
-
-// Standardized name for common audio roles (not enforced in any way, just helps system being more compatible)
-#define AUDIOROLE_WARNING "warning" // Safety-relevant or critical alerts/alarms
-#define AUDIOROLE_GUIDANCE "guidance" // Important user information where user action is expected (e.g. navigation instruction)
-#define AUDIOROLE_NOTIFICATION "notification" // HMI or else notifications (e.g. touchscreen events, speech recognition on/off,...)
-#define AUDIOROLE_COMMUNICATION "communications" // Voice communications (e.g. handsfree, speech recognition)
-#define AUDIOROLE_ENTERTAINMENT "entertainment" // Multimedia content (e.g. tuner, media player, etc.)
-#define AUDIOROLE_SYSTEM "system" // System level content or development
-#define AUDIOROLE_STARTUP "startup" // Early (startup) sound
-#define AUDIOROLE_SHUTDOWN "shutdown" // Late (shutdown) sound
-#define AUDIOROLE_NONE "none" // Non-assigned / legacy applications
-
-typedef enum DeviceURIType {
- DEVICEURITYPE_ALSA_HW = 0, // Alsa hardware device URI
- DEVICEURITYPE_ALSA_DMIX, // Alsa Dmix device URI (only for playback devices)
- DEVICEURITYPE_ALSA_DSNOOP, // Alsa DSnoop device URI (only for capture devices)
- DEVICEURITYPE_ALSA_SOFTVOL, // Alsa softvol device URI
- DEVICEURITYPE_ALSA_OTHER, // Alsa domain URI device of unspecified type
- DEVICEURITYPE_PULSE, // Pulse device URI
- DEVICEURITYPE_GSTREAMER, // GStreamer device URI
- DEVICEURITYPE_EXTERNAL, // Device URI for external ECU device
- DEVICEURITYPE_MAXVALUE // Enum count, keep at the end
-} DeviceURITypeT;
-
-// Standardized list of properties (string used for extensibility)
-#define AUDIOHL_PROPERTY_BALANCE "balance"
-#define AUDIOHL_PROPERTY_FADE "fade"
-#define AUDIOHL_PROPERTY_EQ_LOW "eq_low"
-#define AUDIOHL_PROPERTY_EQ_MID "eq_mid"
-#define AUDIOHL_PROPERTY_EQ_HIGH "eq_high"
-
-// Standardized list of state names/values (string used for extensibility)
-#define AUDIOHL_STATE_NAME_ACTIVE "active"
-#define AUDIOHL_STATE_NAME_MUTE "mute"
-#define AUDIOHL_STATE_VALUE_ON "on"
-#define AUDIOHL_STATE_VALUE_OFF "off"
-
-// Known audio domain string definitions (for configuration file format)
-#define AUDIOHL_DOMAIN_ALSA "Alsa"
-#define AUDIOHL_DOMAIN_PULSE "Pulse"
-#define AUDIOHL_DOMAIN_GSTREAMER "GStreamer"
-#define AUDIOHL_DOMAIN_EXTERNAL "External"
+///// API /////
+
+// Endpoint types
+#define AHL_ENDPOINTTYPE_SOURCE "source" // source devices
+#define AHL_ENDPOINTTYPE_SINK "sink" // sink devices
+
+// Stream state
+#define AHL_STREAM_STATE_IDLE "idle" // Stream is inactive
+#define AHL_STREAM_STATE_RUNNING "running" // Stream is active and running
+#define AHL_STREAM_STATE_PAUSED "paused" // Stream is active but paused
+
+// Stream mute state
+#define AHL_STREAM_UNMUTED "off" // Stream is not muted
+#define AHL_STREAM_MUTED "on" // Stream is muted
+
+// Property/Volume/Action events
+#define AHL_ENDPOINT_PROPERTY_EVENT "ahl_endpoint_property_event"
+#define AHL_ENDPOINT_VOLUME_EVENT "ahl_endpoint_volume_event"
+#define AHL_ENDPOINT_INIT_EVENT "ahl_endpoint_init_event"
+#define AHL_POST_ACTION_EVENT "ahl_post_action"
+#define AHL_STREAM_STATE_EVENT "ahl_stream_state_event"
+#define AHL_ENDPOINT_INIT_EVENT "ahl_endpoint_init_event"
+
+
+// Stream state event types
+#define AHL_STREAM_EVENT_START "start" // Stream is inactive
+#define AHL_STREAM_EVENT_STOP "stop" // Stream is running
+#define AHL_STREAM_EVENT_PAUSE "pause" // Audio stream paused
+#define AHL_STREAM_EVENT_RESUME "resume" // Audio stream resumed
+#define AHL_STREAM_EVENT_MUTE "mute" // Audio stream muted
+#define AHL_STREAM_EVENT_UNMUTE "unmute" // Audio stream unmuted
+
+///// Interpret returned or configuration information /////
+
+// Known audio domain string definitions (for configuration file format and device URI interpretation)
+#define AHL_DOMAIN_ALSA "alsa"
+#define AHL_DOMAIN_PULSE "pulse"
+#define AHL_DOMAIN_GSTREAMER "gstreamer"
+#define AHL_DOMAIN_EXTERNAL "external"
+
+// ALSA Device URI type
+#define AHL_DEVICEURITYPE_ALSA_HW "hw" // Alsa hardware device URI
+#define AHL_DEVICEURITYPE_ALSA_DMIX "dmix" // Alsa Dmix device URI (only for playback devices)
+#define AHL_DEVICEURITYPE_ALSA_DSNOOP "dsnoop" // Alsa DSnoop device URI (only for capture devices)
+#define AHL_DEVICEURITYPE_ALSA_SOFTVOL "softvol" // Alsa softvol device URI
+#define AHL_DEVICEURITYPE_ALSA_PLUG "plug" // Alsa plug device URI
+#define AHL_DEVICEURITYPE_ALSA_OTHER "other" // Alsa domain URI device of unspecified type
+#define AHL_DEVICEURITYPE_NOT_ALSA "nonalsa"
+
+// Define default behavior of audio role when interrupting lower priority sources (in configuration)
+#define AHL_INTERRUPTBEHAVIOR_CONTINUE "continue" // Continue to play when interrupted (e.g. media may be ducked)
+#define AHL_INTERRUPTBEHAVIOR_CANCEL "cancel" // Abort playback when interrupted (e.g. non-important HMI feedback that does not make sense later)
+#define AHL_INTERRUPTBEHAVIOR_PAUSE "pause" // Pause source when interrupted, to be resumed afterwards (e.g. non-temporal guidance)
+
+///// Naming convention /////
+
+// Standardized name for common audio roles (not enforced in any way, just helps compatibility)
+#define AHL_ROLE_WARNING "warning" // Safety-relevant or critical alerts/alarms
+#define AHL_ROLE_GUIDANCE "guidance" // Important user information where user action is expected (e.g. navigation instruction)
+#define AHL_ROLE_NOTIFICATION "notification" // HMI or else notifications (e.g. touchscreen events, speech recognition on/off,...)
+#define AHL_ROLE_COMMUNICATION "communication" // Voice communications (e.g. handsfree, speech recognition)
+#define AHL_ROLE_ENTERTAINMENT "entertainment" // Multimedia content (e.g. tuner, media player, etc.)
+#define AHL_ROLE_SYSTEM "system" // System level content or development
+#define AHL_ROLE_STARTUP "startup" // Early (startup) sound
+#define AHL_ROLE_SHUTDOWN "shutdown" // Late (shutdown) sound
+#define AHL_ROLE_NONE "none" // Non-assigned / legacy applications
+
+// Standardized list of properties (not enforced in any way, just helps compatibility)
+#define AHL_PROPERTY_BALANCE "balance"
+#define AHL_PROPERTY_FADE "fade"
+#define AHL_PROPERTY_EQ_LOW "eq_bass"
+#define AHL_PROPERTY_EQ_MID "eq_mid"
+#define AHL_PROPERTY_EQ_HIGH "eq_treble"
+
+// Standardized list of events (not enforced in any way, just helps compatibility)
+#define AHL_EVENTS_PLAYSOUND "play_sound"
+#define AHL_EVENTS_ECHOCANCEL_ENABLE "echocancel_enable"
+#define AHL_EVENTS_ECHOCANCEL_DISABLE "echocancel_disable"
#endif // AHL_INTERFACE_INCLUDE