1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Access Flags</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Writing an ALSA Driver"><link rel="up" href="control-interface.html" title="Chapter&#160;6.&#160;Control Interface"><link rel="prev" href="control-interface-control-names.html" title="Control Names"><link rel="next" href="control-interface-callbacks.html" title="Callbacks"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Access Flags</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="control-interface-control-names.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;6.&#160;Control Interface</th><td width="20%" align="right">&#160;<a accesskey="n" href="control-interface-callbacks.html">Next</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="control-interface-access-flags"></a>Access Flags</h2></div></div></div><p>
2      The access flag is the bitmask which specifies the access type
3      of the given control.  The default access type is
4      <code class="constant">SNDRV_CTL_ELEM_ACCESS_READWRITE</code>, 
5      which means both read and write are allowed to this control.
6      When the access flag is omitted (i.e. = 0), it is
7      considered as <code class="constant">READWRITE</code> access as default. 
8      </p><p>
9      When the control is read-only, pass
10      <code class="constant">SNDRV_CTL_ELEM_ACCESS_READ</code> instead.
11      In this case, you don't have to define
12      the <em class="structfield"><code>put</code></em> callback.
13      Similarly, when the control is write-only (although it's a rare
14      case), you can use the <code class="constant">WRITE</code> flag instead, and
15      you don't need the <em class="structfield"><code>get</code></em> callback.
16      </p><p>
17      If the control value changes frequently (e.g. the VU meter),
18      <code class="constant">VOLATILE</code> flag should be given.  This means
19      that the control may be changed without
20      <a class="link" href="control-interface-change-notification.html" title="Change Notification"><em class="citetitle">
21      notification</em></a>. Applications should poll such
22      a control constantly.
23      </p><p>
24      When the control is inactive, set
25      the <code class="constant">INACTIVE</code> flag, too.
26      There are <code class="constant">LOCK</code> and
27      <code class="constant">OWNER</code> flags to change the write
28      permissions.
29      </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="control-interface-control-names.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="control-interface.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="control-interface-callbacks.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Control Names&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;Callbacks</td></tr></table></div></body></html>
30