aboutsummaryrefslogtreecommitdiffstats
path: root/sound/oss/emu10k1/cardwo.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /sound/oss/emu10k1/cardwo.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'sound/oss/emu10k1/cardwo.h')
-rw-r--r--sound/oss/emu10k1/cardwo.h90
1 files changed, 90 insertions, 0 deletions
diff --git a/sound/oss/emu10k1/cardwo.h b/sound/oss/emu10k1/cardwo.h
new file mode 100644
index 000000000000..1dece8853e5c
--- /dev/null
+++ b/sound/oss/emu10k1/cardwo.h
@@ -0,0 +1,90 @@
1/*
2 **********************************************************************
3 * cardwo.h -- header file for card wave out functions
4 * Copyright 1999, 2000 Creative Labs, Inc.
5 *
6 **********************************************************************
7 *
8 * Date Author Summary of changes
9 * ---- ------ ------------------
10 * October 20, 1999 Bertrand Lee base code release
11 *
12 **********************************************************************
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public
25 * License along with this program; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
27 * USA.
28 *
29 **********************************************************************
30 */
31
32#ifndef _CARDWO_H
33#define _CARDWO_H
34
35#include "icardwav.h"
36#include "audio.h"
37#include "voicemgr.h"
38#include "timer.h"
39
40/* setting this to other than a power of two may break some applications */
41#define WAVEOUT_MAXBUFSIZE MAXBUFSIZE
42
43#define WAVEOUT_DEFAULTFRAGLEN 20 /* Time to play a fragment in ms (latency) */
44#define WAVEOUT_DEFAULTBUFLEN 500 /* Time to play the entire buffer in ms */
45
46#define WAVEOUT_MINFRAGSHIFT 6 /* Minimum fragment size in bytes is 2^6 */
47#define WAVEOUT_MINFRAGS 3 /* _don't_ go bellow 3, it would break silence filling */
48#define WAVEOUT_MAXVOICES 6
49
50struct waveout_buffer {
51 u16 ossfragshift;
52 u32 numfrags;
53 u32 fragment_size; /* in bytes units */
54 u32 size; /* in bytes units */
55 u32 pages; /* buffer size in page units*/
56 u32 silence_pos; /* software cursor position (including silence bytes) */
57 u32 hw_pos; /* hardware cursor position */
58 u32 free_bytes; /* free bytes available on the buffer (not including silence bytes) */
59 u8 fill_silence;
60 u32 silence_bytes; /* silence bytes on the buffer */
61};
62
63struct woinst
64{
65 u8 state;
66 u8 num_voices;
67 struct emu_voice voice[WAVEOUT_MAXVOICES];
68 struct emu_timer timer;
69 struct wave_format format;
70 struct waveout_buffer buffer;
71 wait_queue_head_t wait_queue;
72 u8 mmapped;
73 u32 total_copied; /* total number of bytes written() to the buffer (excluding silence) */
74 u32 total_played; /* total number of bytes played including silence */
75 u32 blocks;
76 u8 device;
77 spinlock_t lock;
78};
79
80int emu10k1_waveout_open(struct emu10k1_wavedevice *);
81void emu10k1_waveout_close(struct emu10k1_wavedevice *);
82void emu10k1_waveout_start(struct emu10k1_wavedevice *);
83void emu10k1_waveout_stop(struct emu10k1_wavedevice *);
84void emu10k1_waveout_getxfersize(struct woinst*, u32 *);
85void emu10k1_waveout_xferdata(struct woinst*, u8 __user *, u32 *);
86void emu10k1_waveout_fillsilence(struct woinst*);
87int emu10k1_waveout_setformat(struct emu10k1_wavedevice*, struct wave_format*);
88void emu10k1_waveout_update(struct woinst*);
89
90#endif /* _CARDWO_H */