1 /*
2 * audio-oss.h --
3 *
4 * FIXME: This file needs a description here.
5 *
6 * Copyright (c) 2000-2002 The Regents of the University of California.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 * A. Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 * B. Redistributions in binary form must reproduce the above copyright notice,
15 * this list of conditions and the following disclaimer in the documentation
16 * and/or other materials provided with the distribution.
17 * C. Neither the names of the copyright holders nor the names of its
18 * contributors may be used to endorse or promote products derived from this
19 * software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
22 * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
25 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
32 */
33 #ifndef MASH_AUDIO_OSS_H
34 #define MASH_AUDIO_OSS_H
35
36 #include "audio.h"
37
38 class OSSAudio : public Audio {
39 public:
40 OSSAudio();
41 virtual int FrameReady();
42 virtual u_char* Read();
43 virtual void Write(u_char *);
44 virtual void SetRGain(int);
45 virtual void SetPGain(int);
46 virtual void OutputPort(int);
47 virtual void InputPort(int);
48 virtual void Obtain();
49 virtual void Release();
50 virtual int getSampleRate() {return sample_rate;};
51 virtual int use16bits() {return use16RawPCM;};
52 virtual int inStereo() {return stereo;};
53 virtual int command(int, const char *const *);
54 protected:
55 u_char* readbuf; // captured pcmu data that's sent to mash
56 u_char* readCopyInPtr; // next position to read in data from soundcard
57 u_char* readCopyOutPtr; // next position to pass data back to mash
58 u_short *s16_buf; // playback data that's sent to audio board
59 int mixerfd;
60 int play_fmt, rec_fmt ; /* the sb16 has split format... */
61 int vol_device;
62 int played;
63 int playedDuringLast;
64 int use16RawPCM; // flag to set if you want to use 16 bit raw PCM samples instead of 8 bit mulaw
65 int sample_rate; // the sample rate at which to capture or output on the soundcard
66 int stereo; // flag to set if you want to use stereo 16 bit linear PCM... interleaves samples
67 };
68
69 #endif
70
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.