annotate libao2/ao_null.c @ 2038:9b5b1484c74f

orujje
author gabucino
date Mon, 01 Oct 2001 19:41:27 +0000
parents 6a39b29c5862
children 981a9e5118ce
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
1 #include <stdio.h>
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
2 #include <stdlib.h>
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
3
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
4 #include "audio_out.h"
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
5 #include "audio_out_internal.h"
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
6
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
7 static ao_info_t info =
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
8 {
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
9 "Null audio output",
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
10 "null",
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
11 "A'rpi",
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
12 ""
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
13 };
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
14
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
15 LIBAO_EXTERN(null)
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
16
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
17 // there are some globals:
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
18 // ao_samplerate
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
19 // ao_channels
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
20 // ao_format
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
21 // ao_bps
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
22 // ao_outburst
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
23 // ao_buffersize
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
24
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
25 // to set/get/query special features/parameters
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
26 static int control(int cmd,int arg){
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
27 return -1;
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
28 }
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
29
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
30 // open & setup audio device
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
31 // return: 1=success 0=fail
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
32 static int init(int rate,int channels,int format,int flags){
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
33
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
34 ao_outburst=4096;
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
35
1763
6a39b29c5862 fixed ehh.
arpi
parents: 1038
diff changeset
36 return 0;
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
37 }
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
38
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
39 // close audio device
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
40 static void uninit(){
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
41
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
42 }
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
43
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
44 // stop playing and empty buffers (for seeking/pause)
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
45 static void reset(){
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
46
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
47 }
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
48
1038
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1010
diff changeset
49 // stop playing, keep buffers (for pause)
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1010
diff changeset
50 static void audio_pause()
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1010
diff changeset
51 {
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1010
diff changeset
52 // for now, just call reset();
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1010
diff changeset
53 reset();
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1010
diff changeset
54 }
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1010
diff changeset
55
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1010
diff changeset
56 // resume playing, after audio_pause()
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1010
diff changeset
57 static void audio_resume()
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1010
diff changeset
58 {
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1010
diff changeset
59 }
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1010
diff changeset
60
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
61 // return: how many bytes can be played without blocking
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
62 static int get_space(){
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
63
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
64 return ao_outburst;
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
65 }
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
66
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
67 // plays 'len' bytes of 'data'
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
68 // it should round it down to outburst*n
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
69 // return: number of bytes played
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
70 static int play(void* data,int len,int flags){
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
71
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
72 return len;
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
73 }
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
74
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
75 // return: how many unplayed bytes are in the buffer
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
76 static int get_delay(){
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
77
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
78 return 0;
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
79 }
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
80
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
81
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
82
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
83
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
84
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
85