| 1 | /* $Id: cardwo.h 142 2000-04-23 14:55:46Z ktk $ */
|
|---|
| 2 |
|
|---|
| 3 | /*
|
|---|
| 4 | **********************************************************************
|
|---|
| 5 | * cardwo.h -- header file for card wave out functions
|
|---|
| 6 | * Copyright 1999, 2000 Creative Labs, Inc.
|
|---|
| 7 | *
|
|---|
| 8 | **********************************************************************
|
|---|
| 9 | *
|
|---|
| 10 | * Date Author Summary of changes
|
|---|
| 11 | * ---- ------ ------------------
|
|---|
| 12 | * October 20, 1999 Bertrand Lee base code release
|
|---|
| 13 | *
|
|---|
| 14 | **********************************************************************
|
|---|
| 15 | *
|
|---|
| 16 | * This program is free software; you can redistribute it and/or
|
|---|
| 17 | * modify it under the terms of the GNU General Public License as
|
|---|
| 18 | * published by the Free Software Foundation; either version 2 of
|
|---|
| 19 | * the License, or (at your option) any later version.
|
|---|
| 20 | *
|
|---|
| 21 | * This program is distributed in the hope that it will be useful,
|
|---|
| 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 24 | * GNU General Public License for more details.
|
|---|
| 25 | *
|
|---|
| 26 | * You should have received a copy of the GNU General Public
|
|---|
| 27 | * License along with this program; if not, write to the Free
|
|---|
| 28 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
|
|---|
| 29 | * USA.
|
|---|
| 30 | *
|
|---|
| 31 | **********************************************************************
|
|---|
| 32 | */
|
|---|
| 33 |
|
|---|
| 34 | #ifndef _CARDWO_H
|
|---|
| 35 | #define _CARDWO_H
|
|---|
| 36 |
|
|---|
| 37 | #include "icardwav.h"
|
|---|
| 38 |
|
|---|
| 39 | struct wave_xferbuf
|
|---|
| 40 | {
|
|---|
| 41 | u32 xferpos; /* where to write() next */
|
|---|
| 42 | u32 silence_xferpos; /* where to xx_fillsilence() next */
|
|---|
| 43 | u32 xferbufsize; /* transfer buffer size */
|
|---|
| 44 | u32 numpages; /* number of pages in transfer buffer */
|
|---|
| 45 | void **xferbuffer; /* pointer to the transfer buffer */
|
|---|
| 46 | int is_stereo;
|
|---|
| 47 | int is_16bit;
|
|---|
| 48 | int bytespersample;
|
|---|
| 49 | u32 stopposition;
|
|---|
| 50 | };
|
|---|
| 51 |
|
|---|
| 52 | struct wave_out
|
|---|
| 53 | {
|
|---|
| 54 | u32 state;
|
|---|
| 55 | struct emu_voice *voice;
|
|---|
| 56 | int emupageindex;
|
|---|
| 57 | struct emu_timer *timer;
|
|---|
| 58 | struct wave_xferbuf *wavexferbuf;
|
|---|
| 59 | void **pagetable;
|
|---|
| 60 | u32 callbacksize;
|
|---|
| 61 | u32 localvol;
|
|---|
| 62 | u32 localreverb;
|
|---|
| 63 | u32 localchorus;
|
|---|
| 64 | u32 globalvolFactor;
|
|---|
| 65 | u32 globalreverbFactor;
|
|---|
| 66 | u32 globalchorusFactor;
|
|---|
| 67 | int setpos;
|
|---|
| 68 | u32 position;
|
|---|
| 69 | struct wave_format wave_fmt;
|
|---|
| 70 | int fill_silence;
|
|---|
| 71 | };
|
|---|
| 72 |
|
|---|
| 73 | /* setting this to other than a power of two
|
|---|
| 74 | may break some applications */
|
|---|
| 75 | #define WAVEOUT_MAXBUFSIZE 32768
|
|---|
| 76 | #define WAVEOUT_MINBUFSIZE 64
|
|---|
| 77 |
|
|---|
| 78 | #define WAVEOUT_DEFAULTFRAGLEN 100 /* Time to play a fragment in ms (latency) */
|
|---|
| 79 | #define WAVEOUT_DEFAULTBUFLEN 1000 /* Time to play the entire buffer in ms */
|
|---|
| 80 |
|
|---|
| 81 | #define WAVEOUT_MINFRAGSHIFT 4
|
|---|
| 82 |
|
|---|
| 83 | struct woinst
|
|---|
| 84 | {
|
|---|
| 85 | struct wave_out *wave_out;
|
|---|
| 86 | struct wave_format wave_fmt;
|
|---|
| 87 | u16 ossfragshift;
|
|---|
| 88 | u32 fragment_size;
|
|---|
| 89 | u32 numfrags;
|
|---|
| 90 | wait_queue_head_t wait_queue;
|
|---|
| 91 | int mapped;
|
|---|
| 92 | u32 total_copied; /* total number of bytes written() to the buffer (excluding silence) */
|
|---|
| 93 | u32 total_played; /* total number of bytes played including silence */
|
|---|
| 94 | u32 silence_bytes; /* total number of bytes xx_fillsilence() to the buffer */
|
|---|
| 95 | u32 blocks;
|
|---|
| 96 | u32 curpos; /* hardware cursor position */
|
|---|
| 97 | u32 device;
|
|---|
| 98 | spinlock_t lock;
|
|---|
| 99 | };
|
|---|
| 100 |
|
|---|
| 101 | struct emu10k1_waveout
|
|---|
| 102 | {
|
|---|
| 103 | u32 globalvol;
|
|---|
| 104 | u32 mute;
|
|---|
| 105 | u32 left;
|
|---|
| 106 | u32 right;
|
|---|
| 107 | u32 globalreverb;
|
|---|
| 108 | u32 globalchorus;
|
|---|
| 109 | };
|
|---|
| 110 |
|
|---|
| 111 | int emu10k1_waveout_open(struct emu10k1_wavedevice *);
|
|---|
| 112 | void emu10k1_waveout_close(struct emu10k1_wavedevice *);
|
|---|
| 113 | int emu10k1_waveout_start(struct emu10k1_wavedevice *);
|
|---|
| 114 | void emu10k1_waveout_stop(struct emu10k1_wavedevice *);
|
|---|
| 115 | void emu10k1_waveout_getxfersize(struct woinst*, u32 *);
|
|---|
| 116 | void emu10k1_waveout_xferdata(struct woinst*, u8*, u32 *);
|
|---|
| 117 | void emu10k1_waveout_fillsilence(struct woinst*);
|
|---|
| 118 | int emu10k1_waveout_setformat(struct emu10k1_wavedevice*);
|
|---|
| 119 | void emu10k1_waveout_update(struct woinst*);
|
|---|
| 120 |
|
|---|
| 121 | #endif /* _CARDWO_H */
|
|---|