summaryrefslogtreecommitdiffstats
path: root/docs/high-level-api/kickstart.md
blob: 15e1874aa30fb14f37a555b9559bd0b382fff8d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Kickstart

As an application developer, when you play audio, you have to use a device URI.
Instead of using the default one, guessing one by listing them or even
hardcoding it, you should call **ahl-4a/[role]** with **open** as action.

The role to open should be defined in a configuration file or hardcoded. If you
hardcode it, please consider to at least define it at one known place so that it
can be easily changed.

As opening a role may fail, you should test if it returns a success and a device
URI. Both of them should be tested because it's perfectly fine to have a role
without a device URI from 4a point of view (no device is bound to the role thus
no audio can be played in this case).

Once you have finished to play audio, you should call **ahl-4a/[role]** with
**close** as action. This is important to allow other applications to use the
role when you are not using it.

You may also want to handle events of the window manager to know if you
application is displayed or not, and open/close accordingly the role you are
using.