Revert "codegen: Don't implicitly initialize local variables with an initializer"
[vala-gnome.git] / vapi / alsa.vapi
blobc7ef4e09e6f7f0f553ba48477fc9222cb2a76bde
1 /* asound.vapi
2  *
3  * Copyright (C) 2009-2011 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
18  *
19  */
21 [CCode (lower_case_cprefix = "snd_", cheader_filename = "alsa/asoundlib.h")]
22 namespace Alsa {
24     public unowned string strerror (int error);
26     [CCode (cname = "snd_aes_iec958_t", destroy_function = "")]
27     public struct AesIec958
28     {
29         public uchar[] status;
30         public uchar[] subcode;
31         public uchar pad;
32         public uchar[] dig_subframe;
33     }
35     [CCode (cprefix = "SND_CTL_", cheader_filename = "alsa/control.h")]
36     public enum CardOpenType
37     {
38         NONBLOCK,
39         ASYNC,
40         READONLY
41     }
43     [Compact]
44     [CCode (cprefix = "snd_ctl_card_info_", cname = "snd_ctl_card_info_t", free_function = "snd_ctl_card_info_free")]
45     public class CardInfo
46     {
47         [CCode (cname = "snd_ctl_card_info_malloc")]
48         public static int alloc (out CardInfo info);
50         public unowned string get_id();
51         public unowned string get_longname();
53         public unowned string get_mixername();
54         public unowned string get_components();
55     }
57     [Compact]
58     [CCode (cprefix = "snd_ctl_", cname = "snd_ctl_t", free_function = "snd_ctl_close")]
59     public class Card
60     {
61         public static int open (out Card card, string name = "default", CardOpenType t = 0);
63         public int card_info (CardInfo info);
64         public int elem_list (ElemList list);
65         public int elem_info (ElemInfo info);
66         public int elem_read (ElemValue value);
67         public int elem_write (ElemValue value);
69         public int get_dB_range (ElemId eid, out long min, out long max);
70         public int convert_to_dB (ElemId eid, long volume, out long gain);
71         public int convert_from_dB (ElemId eid, long gain, out long value, int xdir);
72     }
74     [Compact]
75     [CCode (cprefix = "snd_ctl_elem_id_", cname = "snd_ctl_elem_id_t", free_function = "snd_ctl_elem_id_free")]
76     public class ElemId
77     {
78         [CCode (cname = "snd_ctl_elem_id_malloc")]
79         public static int alloc (out ElemId eid);
81         public unowned string get_name();
82         public uint get_numid();
83         public uint get_index();
84         public uint get_device();
85         public uint get_subdevice();
86     }
88     [Compact]
89     [CCode (cprefix = "snd_ctl_elem_info_", cname = "snd_ctl_elem_info_t", free_function = "snd_ctl_elem_info_free")]
90     public class ElemInfo
91     {
92         [CCode (cname = "snd_ctl_elem_info_malloc")]
93         public static int alloc (out ElemInfo t);
95         public void set_id (ElemId eid);
96         public void set_numid (uint n);
98         public uint get_count ();
99         public ElemType get_type ();
100     }
102     [CCode (cprefix = "SND_CTL_ELEM_IFACE_", cname = "snd_ctl_elem_iface_t")]
103     public enum ElemInterface
104     {
105         CARD,
106         HWDEP,
107         MIXER,
108         PCM,
109         RAWMIDI,
110         TIMER,
111         SEQUENCER
112     }
114     [CCode (cprefix = "SND_CTL_ELEM_TYPE_", cname = "snd_ctl_elem_type_t")]
115     public enum ElemType
116     {
117         NONE,
118         BOOLEAN,
119         INTEGER,
120         ENUMERATED,
121         BYTES,
122         IEC958,
123         INTEGER64,
124     }
126     [Compact]
127     [CCode (cprefix = "snd_ctl_elem_value_", cname = "snd_ctl_elem_value_t", free_function = "snd_ctl_elem_value_free")]
128     public class ElemValue
129     {
130         [CCode (cname = "snd_ctl_elem_value_malloc")]
131         public static int alloc (out ElemValue t);
133         public void set_id (ElemId eid);
135         public bool get_boolean (uint idx);
136         public long get_integer (uint idx);
137         public int64 get_integer64 (uint idx);
138         public uint get_enumerated (uint idx);
139         public uchar get_byte (uint idx);
140         public void get_iec958 (AesIec958 val);
142         public void set_boolean (uint idx, bool b);
143         public void set_integer (uint idx, long l);
144         public void set_integer64 (uint idx, int64 i);
145         public void set_enumerated (uint idx, uint val);
146         public void set_byte (uint idx, uchar val);
147         public void set_iec958 (AesIec958 val);
148     }
150     [Compact]
151     [CCode (cprefix = "snd_ctl_elem_list_", cname = "snd_ctl_elem_list_t", free_function = "snd_ctl_elem_list_free")]
152     public class ElemList
153     {
154         [CCode (cname = "snd_ctl_elem_list_malloc")]
155         public static int alloc (out ElemList list);
156         public int alloc_space (uint entries);
157         public uint get_count();
158         public uint get_used();
159         public void free_space ();
160         public void set_offset (uint offset);
162         public void get_id (uint n, ElemId eid);
163     }
165     [CCode (cname = "snd_spcm_latency_t", cprefix = "SND_SPCM_LATENCY_", has_type_id = false)]
166     public enum PcmSimpleLatency
167     {
168         STANDARD,
169         MEDIUM,
170         REALTIME
171     }
173     [CCode (cname = "snd_spcm_xrun_type_t", cprefix = "SND_SPCM_XRUN_", has_type_id = false)]
174     public enum PcmSimpleXrunType
175     {
176         IGNORE,
177         STOP,
178     }
180     [CCode (cname = "snd_spcm_duplex_t", cprefix = "SND_SPCM_DUPLEX_", has_type_id = false)]
181     public enum PcmSimpleDuplex {
182             LIBERAL,
183             PEDANTIC,
184     }
186     [CCode (cname = "snd_pcm_access_t", cprefix = "SND_PCM_ACCESS_", has_type_id = false)]
187     public enum PcmAccess
188     {
189         MMAP_INTERLEAVED,
190         MMAP_NONINTERLEAVED,
191         MMAP_COMPLEX,
192         RW_INTERLEAVED,
193         RW_NONINTERLEAVED,
194         LAST,
195     }
197     [CCode (cname = "snd_pcm_class_t", cprefix = "SND_PCM_CLASS_", has_type_id = false)]
198     public enum PcmClass
199     {
200         GENERIC,
201         MULTI,
202         MODEM,
203         DIGITIZER,
204         LAST,
205     }
207     [CCode (cname = "snd_pcm_format_t", cprefix = "SND_PCM_FORMAT_", has_type_id = false)]
208     public enum PcmFormat
209     {
210         UNKNOWN,
211         S8,
212         U8,
213         S16_LE,
214         S16_BE,
215         U16_LE,
216         U16_BE,
217         S24_LE,
218         S24_BE,
219         U24_LE,
220         U24_BE,
221         S32_LE,
222         S32_BE,
223         U32_LE,
224         U32_BE,
225         FLOAT_LE,
226         FLOAT_BE,
227         FLOAT64_LE,
228         FLOAT64_BE,
229         IEC958_SUBFRAME_LE,
230         IEC958_SUBFRAME_BE,
231         MU_LAW,
232         A_LAW,
233         IMA_ADPCM,
234         MPEG,
235         GSM,
236         SPECIAL,
237         S24_3LE,
238         S24_3BE,
239         U24_3LE,
240         U24_3BE,
241         S20_3LE,
242         S20_3BE,
243         U20_3LE,
244         U20_3BE,
245         S18_3LE,
246         S18_3BE,
247         U18_3LE,
248         U18_3BE,
249         LAST,
250         S16,
251         U16,
252         S24,
253         U24,
254         S32,
255         U32,
256         FLOAT,
257         FLOAT64,
258         IEC958_SUBFRAME,
259     }
261     [CCode (cname = "gint", cprefix = "SND_PCM_", has_type_id = false)]
262     public enum PcmMode
263     {
264         NONBLOCK,
265         ASYNC,
266         NO_AUTO_RESAMPLE,
267         NO_AUTO_CHANNELS,
268         NO_AUTO_FORMAT,
269         NO_SOFTVOL,
270     }
272     [CCode (cname = "snd_pcm_start_t", cprefix = "SND_PCM_START_", has_type_id = false)]
273     public enum PcmStart
274     {
275         DATA,
276         EXPLICIT,
277         LAST,
278     }
280     [CCode (cname = "snd_pcm_state_t", cprefix = "", has_type_id = false)]
281     public enum PcmState
282     {
283         OPEN,
284         SETUP,
285         PREPARED,
286         RUNNING,
287         XRUN,
288         DRAINING,
289         PAUSED,
290         SUSPENDED,
291         DISCONNECTED,
292         LAST,
293     }
295     [CCode (cname = "snd_pcm_stream_t", cprefix = "SND_PCM_STREAM_", has_type_id = false)]
296     public enum PcmStream
297     {
298         PLAYBACK,
299         CAPTURE,
300         LAST,
301     }
303     [CCode (cname = "snd_pcm_subclass_t", cprefix = "SND_PCM_SUBCLASS_", has_type_id = false)]
304     public enum PcmSubclass
305     {
306         GENERIC_MIX,
307         MULTI_MIX,
308         LAST,
309     }
311     [CCode (cname = "snd_pcm_subformat_t", cprefix = "SND_PCM_SUBFORMAT_", has_type_id = false)]
312     public enum PcmSubformat
313     {
314         STD,
315         LAST,
316     }
318     [CCode (cname = "snd_pcm_tstamp_t", cprefix = "SND_PCM_TSTAMP_", has_type_id = false)]
319     public enum PcmTimestamp
320     {
321         NONE,
322         ENABLE,
323         MMAP,
324         LAST,
325     }
327     [CCode (cname = "snd_pcm_type_t", cprefix = "SND_PCM_TYPE_", has_type_id = false)]
328     public enum PcmType
329     {
330         HW,
331         HOOKS,
332         MULTI,
333         FILE,
334         NULL,
335         SHM,
336         INET,
337         COPY,
338         LINEAR,
339         ALAW,
340         MULAW,
341         ADPCM,
342         RATE,
343         ROUTE,
344         PLUG,
345         SHARE,
346         METER,
347         MIX,
348         DROUTE,
349         LBSERVER,
350         LINEAR_FLOAT,
351         LADSPA,
352         DMIX,
353         JACK,
354         DSNOOP,
355         DSHARE,
356         IEC958,
357         SOFTVOL,
358         IOPLUG,
359         MMAP_EMUL,
360         LAST,
361     }
363     [CCode (cname = "snd_pcm_xrun_t", cprefix = "SND_PCM_XRUN_", has_type_id = false)]
364     public enum PcmXrun
365     {
366         NONE,
367         STOP,
368         LAST,
369     }
371     [SimpleType]
372     [CCode (cname = "snd_pcm_access_mask_t")]
373     public struct PcmAccessMask
374     {
375     }
377     [SimpleType]
378     [CCode (cname = "snd_pcm_format_mask_t")]
379     public struct PcmFormatMask
380     {
381     }
383     [SimpleType]
384     [CCode (cname = "snd_pcm_subformat_mask_t")]
385     public struct PcmSubformatMask
386     {
387     }
389     [SimpleType]
390     [CCode (cname = "snd_pcm_timestamp_t")]
391     public struct PcmSoftwareTimestamp
392     {
393     }
395     [SimpleType]
396     [CCode (cname = "snd_pcm_htimestamp_t")]
397     public struct PcmHardwareTimestamp
398     {
399     }
401     [Compact]
402     [CCode (cname = "snd_pcm_info_t", cprefix = "snd_pcm_info_")]
403     public class PcmInfo
404     {
405         public static int alloca( out PcmInfo info );
406         public static int malloc( out PcmInfo info );
407         public void free();
408         public void copy( PcmInfo source );
409         public uint get_device();
410         public uint get_subdevice();
411         public PcmStream get_stream();
412         public int get_card();
413         public string get_id();
414         public string get_name();
415         public string get_subdevice_name();
416         public PcmClass get_class();
417         public PcmSubclass get_subclass();
418         public uint get_subdevices_count();
419         public uint get_subdevices_avail();
420         public PcmSyncId get_sync();
421         public void set_device( uint val );
422         public void set_subdevice( uint val );
423         public void set_stream( PcmStream val );
424     }
426     [Compact]
427     [CCode (cname = "snd_pcm_hw_params_t", cprefix = "snd_pcm_hw_params_", free_function = "snd_pcm_hw_params_free")]
428     public class PcmHardwareParams
429     {
430         public static int alloca( out PcmHardwareParams params );
431         public static int malloc( out PcmHardwareParams params );
432         public void free();
433         public void copy( PcmHardwareParams source );
434         public int get_access( PcmAccess access );
435         public int get_access_mask( PcmAccessMask mask );
436         public int get_format( PcmFormat format );
437         public void get_format_mask( PcmFormatMask mask );
438         public int get_subformat( PcmSubformat subformat );
439         public void get_subformat_mask( PcmSubformatMask mask );
440         public int get_channels( out int val );
441         public int get_channels_min( out int val );
442         public int get_channels_max( out int val );
443         public int get_rate( out int val, out int dir );
444         public int get_rate_min( out int val, out int dir );
445         public int get_rate_max( out int val, out int dir );
446         public int get_period_time( out int val, out int dir );
447         public int get_period_time_min( out int val, out int dir );
448         public int get_period_time_max( out int val, out int dir );
449         public int get_period_size( out PcmUnsignedFrames frames, out int dir );
450         public int get_period_size_min( out PcmUnsignedFrames frames, out int dir );
451         public int get_period_size_max( out PcmUnsignedFrames frames, out int dir );
452         public int get_periods( out int val, out int dir );
453         public int get_periods_min( out int val, out int dir );
454         public int get_periods_max( out int val, out int dir );
455         public int get_buffer_time( out int val, out int dir );
456         public int get_buffer_time_min( out int val, out int dir );
457         public int get_buffer_time_max( out int val, out int dir );
458         public int get_buffer_size( out PcmUnsignedFrames frames );
459         public int get_buffer_size_min( out PcmUnsignedFrames frames );
460         public int get_buffer_size_max( out PcmUnsignedFrames frames );
461         public int get_min_align( out PcmUnsignedFrames frames );
463         public int can_mmap_sample_resolution();
464         public int is_double();
465         public int is_batch();
466         public int is_block_transfer();
467         public int is_monotonic();
468         public int can_overrange();
469         public int can_pause();
470         public int can_resume();
471         public int is_half_duplex();
472         public int is_joint_duplex();
473         public int can_sync_start();
474         public int can_disable_period_wakeup();
475         public int get_rate_numden( out uint rate_num, out uint rate_den );
476         public int get_sbits();
477         public int get_fifo_size();
478     }
480     [Compact]
481     [CCode (cname = "snd_pcm_sw_params_t")]
482     public class PcmSoftwareParams
483     {
484     }
486     [SimpleType]
487     [CCode (cname = "snd_pcm_uframes_t")]
488     [IntegerType (rank = 9)]
489     public struct PcmUnsignedFrames
490     {
491     }
493     [SimpleType]
494     [CCode (cname = "snd_pcm_sframes_t")]
495     [IntegerType (rank = 8)]
496     public struct PcmSignedFrames
497     {
498     }
500     [Compact]
501     [CCode (cname = "snd_pcm_channel_area_t", free_function = "")]
502     public struct PcmChannelArea
503     {
504         public void *addr;
505         public uint first;
506         public uint step;
507     }
509     [Compact]
510     [CCode (cname = "snd_pcm_sync_id_t", free_function = "")]
511     public struct PcmSyncId
512     {
513         public uchar id[16];
514         public ushort id16[8];
515         public uint id32[4];
516     }
518     [Compact]
519     [CCode (cname = "snd_pcm_t", cprefix = "snd_pcm_", free_function = "")]
520     public class PcmDevice
521     {
522         public static int open( out PcmDevice pcm, string name, PcmStream stream, PcmMode mode = 0 );
524         public int close();
525         [CCode (cname = "snd_pcm_name")]
526         public string get_name();
527         [CCode (cname = "snd_pcm_type")]
528         public PcmType get_type();
529         [CCode (cname = "snd_pcm_stream")]
530         public PcmStream get_stream();
531         [CCode (cname = "snd_pcm_poll_descriptors_count")]
532         public int get_poll_descriptors_count();
533         [CCode (cname = "snd_pcm_poll_descriptors")]
534         public int set_poll_descriptors( Posix.pollfd[] pfds );
535         [CCode (cname = "snd_pcm_poll_descriptors_revents")]
536         public int set_poll_descriptors_revents( Posix.pollfd[] pfds, ushort[] revents );
537         [CCode (cname = "snd_pcm_nonblock")]
538         public int set_nonblock( bool nonblock );
540         //public int snd_async_add_pcm_handler( snd_async_handler_t **handler, snd_pcm_t *pcm, snd_async_callback_t callback, void *private_data );
541         //public PcmDevice async_handler_get_pcm( snd_async_handler_t *handler );
542         public int info( PcmInfo info );
543         public int sw_params_current( out PcmSoftwareParams params );
544         public int sw_params( PcmSoftwareParams params );
545         public int hw_free();
546         public int prepare();
547         public int reset();
548         [CCode (cname = "snd_pcm_status")]
549         public int set_status( PcmState status );
550         public int start();
551         public int drop();
552         public int drain();
553         public int pause( bool enable );
554         public PcmState state();
555         public int hwsync();
556         public int delay( PcmSignedFrames delayp );
557         public int resume();
558         public int htimestamp( PcmUnsignedFrames avail, PcmHardwareTimestamp tstamp );
559         public PcmSignedFrames avail();
560         public PcmSignedFrames avail_update();
561         public int avail_delay( out PcmSignedFrames availp, out PcmSignedFrames delayp );
562         public PcmSignedFrames rewindable();
563         public PcmSignedFrames rewind( PcmUnsignedFrames frames );
564         public PcmSignedFrames forwardable();
565         public PcmSignedFrames forward( PcmUnsignedFrames frames );
566         public PcmSignedFrames writei( [CCode (array_length = false)] uint8[] buffer, PcmUnsignedFrames size );
567         public PcmSignedFrames writen( [CCode (array_length = false)] uint8*[] buffer, PcmUnsignedFrames size );
568         public PcmSignedFrames readi( [CCode (array_length = false)] uint8[] buffer, PcmUnsignedFrames size );
569         public PcmSignedFrames readn( [CCode (array_length = false)] uint8*[] buffer, PcmUnsignedFrames size );
570         public int wait( int timeout );
571         public int link( PcmDevice otherDevice );
572         public int unlink();
574         // high level API
575         public int recover( int err, int silent );
576         public int set_params( PcmFormat format, PcmAccess access, uint channels, uint rate, int soft_resample, uint latency );
577         public int get_params( out PcmUnsignedFrames buffer_size, out PcmUnsignedFrames period_size );
579         // simple setup
580         [CCode (cname = "snd_spcm_init")]
581         public int simple_init( uint rate, uint channels, PcmFormat format, PcmSubformat subformat, PcmSimpleLatency latency, PcmAccess access, PcmSimpleXrunType xrun );
582         [CCode (cname = "snd_spcm_init_duplex")]
583         public static int simple_init_duplex( PcmDevice playback, PcmDevice capture, uint rate, uint channels, PcmFormat format, PcmSubformat subformat, PcmSimpleLatency latency, PcmAccess access, PcmSimpleXrunType xrun, PcmSimpleDuplex duplex );
584         [CCode (cname = "snd_spcm_get_params")]
585         public int simple_get_params( out uint rate, out PcmUnsignedFrames buffer_size, out PcmUnsignedFrames period_size );
587         // HW params API
588         public int hw_params_current( out PcmHardwareParams params );
589         public int hw_params( PcmHardwareParams params );
590         public int hw_params_any( PcmHardwareParams params );
591         public int hw_params_test_access( PcmHardwareParams params, PcmAccess access );
592         public int hw_params_set_access( PcmHardwareParams params, PcmAccess access );
593         public int hw_params_set_access_first( PcmHardwareParams params, out PcmAccess access );
594         public int hw_params_set_access_last( PcmHardwareParams params, out PcmAccess access );
595         public int hw_params_set_access_mask( PcmHardwareParams params, out PcmAccessMask mask );
596         public int hw_params_test_format( PcmHardwareParams params, PcmFormat format );
597         public int hw_params_set_format( PcmHardwareParams params, PcmFormat format );
598         public int hw_params_set_format_first( PcmHardwareParams params, out PcmFormat format );
599         public int hw_params_set_format_last( PcmHardwareParams params, out PcmFormat format );
600         public int hw_params_set_format_mask( PcmHardwareParams params, out PcmFormatMask mask );
601         public int hw_params_test_subformat( PcmHardwareParams params, PcmSubformat subformat );
602         public int hw_params_set_subformat( PcmHardwareParams params, PcmSubformat subformat );
603         public int hw_params_set_subformat_first( PcmHardwareParams params, out PcmSubformat subformat );
604         public int hw_params_set_subformat_last( PcmHardwareParams params, out PcmSubformat subformat );
605         public int hw_params_set_subformat_mask( PcmHardwareParams params, out PcmSubformatMask mask );
606         public int hw_params_test_channels( PcmHardwareParams params, uint val );
607         public int hw_params_set_channels( PcmHardwareParams params, uint val );
608         public int hw_params_set_channels_min( PcmHardwareParams params, out int val );
609         public int hw_params_set_channels_max( PcmHardwareParams params, out int val );
610         public int hw_params_set_channels_minmax( PcmHardwareParams params, out uint min, out int max );
611         public int hw_params_set_channels_near( PcmHardwareParams params, out int val );
612         public int hw_params_set_channels_first( PcmHardwareParams params, out int val );
613         public int hw_params_set_channels_last( PcmHardwareParams params, out int val );
614         public int hw_params_test_rate( PcmHardwareParams params, uint val, int dir );
615         public int hw_params_set_rate( PcmHardwareParams params, uint val, int dir );
616         public int hw_params_set_rate_min( PcmHardwareParams params, out int val, out int dir );
617         public int hw_params_set_rate_max( PcmHardwareParams params, out int val, out int dir );
618         public int hw_params_set_rate_minmax( PcmHardwareParams params, out uint min, out int mindir, out int max, out int maxdir );
619         public int hw_params_set_rate_near( PcmHardwareParams params, ref int val, int dir );
620         public int hw_params_set_rate_first( PcmHardwareParams params, out int val, out int dir );
621         public int hw_params_set_rate_last( PcmHardwareParams params, out int val, out int dir );
622         public int hw_params_set_rate_resample( PcmHardwareParams params, uint val );
623         public int hw_params_get_rate_resample( PcmHardwareParams params, out int val );
624         public int hw_params_set_export_buffer( PcmHardwareParams params, uint val );
625         public int hw_params_get_export_buffer( PcmHardwareParams params, out int val );
626         public int hw_params_set_period_wakeup( PcmHardwareParams params, uint val );
627         public int hw_params_get_period_wakeup( PcmHardwareParams params, out int val );
628         public int hw_params_test_period_time( PcmHardwareParams params, uint val, int dir );
629         public int hw_params_set_period_time( PcmHardwareParams params, uint val, int dir );
630         public int hw_params_set_period_time_min( PcmHardwareParams params, out int val, out int dir );
631         public int hw_params_set_period_time_max( PcmHardwareParams params, out int val, out int dir );
632         public int hw_params_set_period_time_minmax( PcmHardwareParams params, out uint min, out int mindir, out int max, out int maxdir );
633         public int hw_params_set_period_time_near( PcmHardwareParams params, out int val, out int dir );
634         public int hw_params_set_period_time_first( PcmHardwareParams params, out int val, out int dir );
635         public int hw_params_set_period_time_last( PcmHardwareParams params, out int val, out int dir );
636         public int hw_params_test_period_size( PcmHardwareParams params, PcmUnsignedFrames frames, int dir );
637         public int hw_params_set_period_size( PcmHardwareParams params, PcmUnsignedFrames frames, int dir );
638         public int hw_params_set_period_size_min( PcmHardwareParams params, out PcmUnsignedFrames frames, out int dir );
639         public int hw_params_set_period_size_max( PcmHardwareParams params, out PcmUnsignedFrames frames, out int dir );
640         public int hw_params_set_period_size_minmax( PcmHardwareParams params, out PcmUnsignedFrames min, out int mindir, out PcmUnsignedFrames max, out int maxdir );
641         public int hw_params_set_period_size_near( PcmHardwareParams params, out PcmUnsignedFrames frames, out int dir );
642         public int hw_params_set_period_size_first( PcmHardwareParams params, out PcmUnsignedFrames frames, out int dir );
643         public int hw_params_set_period_size_last( PcmHardwareParams params, out PcmUnsignedFrames frames, out int dir );
644         public int hw_params_set_period_size_integer( PcmHardwareParams params );
645         public int hw_params_test_periods( PcmHardwareParams params, uint val, int dir );
646         public int hw_params_set_periods( PcmHardwareParams params, uint val, int dir );
647         public int hw_params_set_periods_min( PcmHardwareParams params, out int val, out int dir );
648         public int hw_params_set_periods_max( PcmHardwareParams params, out int val, out int dir );
649         public int hw_params_set_periods_minmax( PcmHardwareParams params, out uint min, out int mindir, out int max, out int maxdir );
650         public int hw_params_set_periods_near( PcmHardwareParams params, out int val, out int dir );
651         public int hw_params_set_periods_first( PcmHardwareParams params, out int val, out int dir );
652         public int hw_params_set_periods_last( PcmHardwareParams params, out int val, out int dir );
653         public int hw_params_set_periods_integer( PcmHardwareParams params );
654         public int hw_params_test_buffer_time( PcmHardwareParams params, uint val, int dir );
655         public int hw_params_set_buffer_time( PcmHardwareParams params, uint val, int dir );
656         public int hw_params_set_buffer_time_min( PcmHardwareParams params, out int val, out int dir );
657         public int hw_params_set_buffer_time_max( PcmHardwareParams params, out int val, out int dir );
658         public int hw_params_set_buffer_time_minmax( PcmHardwareParams params, out uint min, out int mindir, out int max, out int maxdir );
659         public int hw_params_set_buffer_time_near( PcmHardwareParams params, out int val, out int dir );
660         public int hw_params_set_buffer_time_first( PcmHardwareParams params, out int val, out int dir );
661         public int hw_params_set_buffer_time_last( PcmHardwareParams params, out int val, out int dir );
662         public int hw_params_test_buffer_size( PcmHardwareParams params, PcmUnsignedFrames frames );
663         public int hw_params_set_buffer_size( PcmHardwareParams params, PcmUnsignedFrames frames );
664         public int hw_params_set_buffer_size_min( PcmHardwareParams params, out PcmUnsignedFrames frames );
665         public int hw_params_set_buffer_size_max( PcmHardwareParams params, out PcmUnsignedFrames frames );
666         public int hw_params_set_buffer_size_minmax( PcmHardwareParams params, out PcmUnsignedFrames min, out PcmUnsignedFrames max );
667         public int hw_params_set_buffer_size_near( PcmHardwareParams params, out PcmUnsignedFrames frames );
668         public int hw_params_set_buffer_size_first( PcmHardwareParams params, out PcmUnsignedFrames frames );
669         public int hw_params_set_buffer_size_last( PcmHardwareParams params, out PcmUnsignedFrames frames );
671         // format conversion
672         public PcmSignedFrames bytes_to_frames( ssize_t bytes );
673         public ssize_t frames_to_bytes( PcmSignedFrames frames );
674         public long bytes_to_samples( ssize_t bytes );
675         public ssize_t samples_to_bytes( long samples );
676     }
678     [CCode (cprefix = "SND_MIXER_SABSTRACT_", cname = "snd_mixer_selem_regopt_abstract")]
679     public enum MixerAbstractionLevel
680     {
681         NONE,
682         BASIC
683     }
685     [CCode (cname = "struct snd_mixer_selem_regopt", destroy_function = "", cheader_filename = "alsa/mixer.h")]
686     public struct MixerRegistrationOptions
687     {
688         public int ver;
689         public MixerAbstractionLevel @abstract;
690         public string device;
691         public PcmDevice playback_pcm;
692         public PcmDevice capture_pcm;
693     }
695     [Compact]
696     [CCode (cprefix = "snd_mixer_class_", cname = "snd_mixer_class_t", free_function = "snd_mixer_class_close", cheader_filename = "alsa/mixer.h")]
697     public class MixerClass
698     {
699     }
701     [Compact]
702     [CCode (cprefix = "snd_mixer_", cname = "snd_mixer_t", free_function = "snd_mixer_close")]
703     public class Mixer
704     {
705         public static int open (out Mixer mixer, int t = 0 /* MixerOpenType t = 0 */ );
706         public int attach (string card = "default");
707         public int detach (string card = "default");
708         public uint get_count ();
709         public int load ();
711         [CCode (cname = "snd_mixer_selem_register")]
712         public int register (MixerRegistrationOptions? options = null, out MixerClass classp = null );
714         public MixerElement first_elem ();
715         public MixerElement last_elem ();
716     }
718     [Compact]
719     [CCode (cprefix = "snd_mixer_selem_", cname = "snd_mixer_elem_t", free_function = "")]
720     public class MixerElement
721     {
722         [CCode (cname = "snd_mixer_elem_next")]
723         public MixerElement next ();
724         [CCode (cname = "snd_mixer_elem_prev")]
725         public MixerElement prev ();
727         public void get_id (SimpleElementId eid);
728         public bool is_active ();
729         public bool is_playback_mono ();
730         public bool has_playback_channel (SimpleChannelId channel);
731         public bool is_capture_mono ();
732         public bool has_capture_channel (SimpleChannelId channel);
733         public int  get_capture_group ();
734         public bool has_common_volume ();
735         public bool has_playback_volume ();
736         public bool has_playback_volume_joined ();
737         public bool has_capture_volume ();
738         public bool has_capture_volume_joined ();
739         public bool has_common_switch ();
740         public bool has_playback_switch ();
741         public bool has_playback_switch_joined ();
742         public bool has_capture_switch ();
743         public bool has_capture_switch_joined ();
744         public bool has_capture_switch_exclusive ();
746         public int ask_playback_vol_dB (long val, out long dBval);
747         public int ask_capture_vol_dB (long val, out long dBval);
748         public int ask_playback_dB_vol (long dBval, int dir, out long val);
749         public int ask_capture_dB_vol (long dBval, int dir, out long val);
750         public int get_playback_volume (SimpleChannelId channel, out long val);
751         public int get_capture_volume (SimpleChannelId channel, out long val);
752         public int get_playback_dB (SimpleChannelId channel, out long val);
753         public int get_capture_dB (SimpleChannelId channel, out long val);
754         public int get_playback_switch (SimpleChannelId channel, out int val);
755         public int get_capture_switch (SimpleChannelId channel, out int val);
756         public int set_playback_volume (SimpleChannelId channel, long val);
757         public int set_capture_volume (SimpleChannelId channel, long val);
758         public int set_playback_dB (SimpleChannelId channel, long val, int dir);
759         public int set_capture_dB (SimpleChannelId channel, long val, int dir);
760         public int set_playback_volume_all (long val);
761         public int set_capture_volume_all (long val);
762         public int set_playback_dB_all (long val, int dir);
763         public int set_capture_dB_all (long val, int dir);
764         public int set_playback_switch (SimpleChannelId channel, int val);
765         public int set_capture_switch (SimpleChannelId channel, int val);
766         public int set_playback_switch_all (int val);
767         public int set_capture_switch_all (int val);
768         public int get_playback_volume_range (out long min, out long max);
769         public int get_playback_dB_range (out long min, out long max);
770         public int set_playback_volume_range (long min, long max);
771         public int get_capture_volume_range (out long min, out long max);
772         public int get_capture_dB_range (out long min, out long max);
773         public int set_capture_volume_range (long min, long max);
774         public int is_enumerated ();
775         public int is_enum_playback ();
776         public int is_enum_capture ();
777         public int get_enum_items ();
778         public int get_enum_item_name (uint idx, size_t maxlen, out string str);
779         public int get_enum_item (SimpleChannelId channel, out uint idxp);
780         public int set_enum_item (SimpleChannelId channel, uint idx);
781     }
783     [CCode (cprefix = "SND_MIXER_SCHN_", cname = "snd_mixer_selem_channel_id_t")]
784     public enum SimpleChannelId
785     {
786         UNKNOWN,
787         MONO,
788         FRONT_LEFT,
789         FRONT_RIGHT,
790         REAR_LEFT,
791         REAR_RIGHT,
792         FRONT_CENTER,
793         WOOFER,
794         SIDE_LEFT,
795         SIDE_RIGHT,
796         REAR_CENTER,
797         LAST
798     }
800     [Compact]
801     [CCode (cprefix = "snd_mixer_selem_id_", cname = "snd_mixer_selem_id_t", free_function = "")]
802     public class SimpleElementId
803     {
804         [CCode (cname = "snd_mixer_selem_id_malloc")]
805         public static int alloc (out SimpleElementId eid);
807         public unowned string get_name();
808         public uint get_index();
809     }