channel_if.m revision 70134
1#
2# Copyright (c) 2000 Cameron Grant <cg@freebsd.org>
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions
7# are met:
8# 1. Redistributions of source code must retain the above copyright
9#    notice, this list of conditions and the following disclaimer.
10# 2. Redistributions in binary form must reproduce the above copyright
11#    notice, this list of conditions and the following disclaimer in the
12#    documentation and/or other materials provided with the distribution.
13#
14# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24# SUCH DAMAGE.
25#
26# $FreeBSD: head/sys/dev/sound/pcm/channel_if.m 70134 2000-12-18 01:36:41Z cg $
27#
28
29#include <dev/sound/pcm/sound.h>
30
31INTERFACE channel;
32
33CODE {
34
35	static int
36	channel_nosetdir(kobj_t obj, void *data, int dir)
37	{
38		return 0;
39	}
40
41	static int
42	channel_noreset(kobj_t obj, void *data)
43	{
44		return 0;
45	}
46
47	static int
48	channel_noresetdone(kobj_t obj, void *data)
49	{
50		return 0;
51	}
52
53	static int
54	channel_nofree(kobj_t obj, void *data)
55	{
56		return 1;
57	}
58
59};
60
61METHOD void* init {
62	kobj_t obj;
63	void *devinfo;
64	snd_dbuf *b;
65	pcm_channel *c;
66	int dir;
67};
68
69METHOD int free {
70	kobj_t obj;
71	void *data;
72} DEFAULT channel_nofree;
73
74METHOD int reset {
75	kobj_t obj;
76	void *data;
77} DEFAULT channel_noreset;
78
79METHOD int resetdone {
80	kobj_t obj;
81	void *data;
82} DEFAULT channel_noresetdone;
83
84METHOD int setdir {
85	kobj_t obj;
86	void *data;
87	int dir;
88} DEFAULT channel_nosetdir;
89
90METHOD u_int32_t setformat {
91	kobj_t obj;
92	void *data;
93	u_int32_t format;
94};
95
96METHOD u_int32_t setspeed {
97	kobj_t obj;
98	void *data;
99	u_int32_t speed;
100};
101
102METHOD u_int32_t setblocksize {
103	kobj_t obj;
104	void *data;
105	u_int32_t blocksize;
106};
107
108METHOD int trigger {
109	kobj_t obj;
110	void *data;
111	int go;
112};
113
114METHOD u_int32_t getptr {
115	kobj_t obj;
116	void *data;
117};
118
119METHOD pcmchan_caps* getcaps {
120	kobj_t obj;
121	void *data;
122};
123
124