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