source: cmedia/trunk/Drv16/waudio.hpp@ 577

Last change on this file since 577 was 354, checked in by stevenhl, 18 years ago

Import untested baseline cmedia sources, work products and binaries
Binaries and work products should be deleted from repository.
once new builds are verified to work.

File size: 4.4 KB
Line 
1/* $Id: waudio.hpp,v 1.2 2001/05/09 17:44:25 sandervl Exp $ */
2
3/* SCCSID = %W% %E% */
4/****************************************************************************
5 * *
6 * Copyright (c) IBM Corporation 1994 - 1997. *
7 * *
8 * The following IBM OS/2 source code is provided to you solely for the *
9 * the purpose of assisting you in your development of OS/2 device drivers. *
10 * You may use this code in accordance with the IBM License Agreement *
11 * provided in the IBM Device Driver Source Kit for OS/2. *
12 * *
13 ****************************************************************************/
14/**@internal %W%
15 * Defines, class definations and prototypes for
16 * @version %I%
17 * @context Unless otherwise noted, all interfaces are Ring-0, 16-bit,
18 * <stack context>.
19 * @history
20 *
21 */
22#ifndef WAUDIO_INCLUDED
23#define WAUDIO_INCLUDED
24
25#ifndef OS2_INCLUDED
26#define INCL_NOPMAPI
27#include <os2.h>
28#include <os2medef.h>
29#include <audio.h>
30#endif
31
32#include "audiohw.hpp"
33#include "irq.hpp"
34
35#include <daudio.h>
36
37// defines used to define the PCM, MULAW, and ALAW tables used by
38// virtual void DevCaps(PAUDIO_CAPS pCaps)
39#define NUMFREQS 4
40#define BPSTYPES 2
41#define MONOSTEREO 2
42
43#define DMA_BUFFER_SIZE (ULONG)0x4000
44
45// FREQ_TABLE_TYPE class is specific to CS4232 it holds a particular sample
46// rate and the calue that is required to be written into Clock select bits
47// indexed register 8 bits 0-3) but this class can be easly update for other
48// devices
49class FREQ_TABLE_TYPE {
50public:
51 ULONG freq;
52 UCHAR clock_select;
53};
54// The WaveConfigInfo Class
55// Built the the WAVESTREAM class, at Audio Ioctl Init time, the WaveConfigInfo
56// is used to suppply the WAVEAUDIO class with information about a particular
57// instance and the WAVEAUDIO calss also returns information to the WAVESTREAM
58// class it needs to calculate the stream time and keep the device quiet if
59// the stream runs out of data.. All values supplyed by the WAVESTREAM are
60// noted as Input and values returned by the WAVEAUDIO class are noted as
61// Output.
62class WaveConfigInfo {
63public:
64 ULONG ulSampleRate; // Samples Per Second Input
65 USHORT usBitsPerSample; // Number of Bits in a Sample Input
66 USHORT usNumChannels; // Number of Channels (mono or stereo) Input
67 USHORT usDataType; // type of data (PCM, MuLaw, ALaw etc) Input
68 USHORT usSilence; // Value that produces silence Output
69 ULONG ulPCMConsumeRate; // number of bytes consumed/produced per sec Output
70 ULONG ulBytesPerIRQ; // Number of bytes consumed/produced per IRQ Output
71};
72typedef WaveConfigInfo * PWAVECONFIGINFO;
73
74class STREAM;
75
76class WAVEAUDIO : public AUDIOHW {
77public:
78 virtual int Start(STREAM *stream); // Start the operation
79 virtual int Stop(STREAM *stream); // Stop the operation
80 virtual int Pause(STREAM *stream); // Pause the operation
81 virtual int Resume(STREAM *stream); // Resume the operation
82
83 // Report the Device Capabilities to MMPM/2
84 // This member function is called from
85 // IoctlAudioInit() (IOCTL.CPP) and is the
86 // only MMPM/2 specific call made into the
87 // WAUDIO Class.
88 virtual void DevCaps(PAUDIO_CAPS pCaps);
89 virtual void DevCaps(LPDAUDIO_CAPS pCaps);
90 // configure the device for an operation
91 virtual void ConfigDev(STREAM *stream, PWAVECONFIGINFO pConfigInfo);
92
93
94 WAVEAUDIO(USHORT devicetype) :
95 AUDIOHW(devicetype)
96 {};
97
98/*
99protected:
100 UCHAR _ucClockData; // The Clock Select Data on the CS4232 this data
101 // is written into bits 0-3 of the FS and Playback
102 // Data Format Reg (indexed reg 8)
103 UCHAR _ucFormatData; // The Data Format bits on the CS4232 this corresponds
104 // to bits 4-7 indexed registers 8 (playback) and
105 // 28 (capture)
106 USHORT _usCountData; // The count register data (indexed registers 14 and
107 // 15 or 30 and 31)
108 void _vSetup(void); // Common setup code called by both the WAVEPLAY and
109 // WAVEREC constructors
110*/
111
112private:
113 USHORT _usfind_matching_sample_rate(PULONG pulSampleRate);
114
115};
116typedef WAVEAUDIO *PWAVEAUDIO;
117
118#endif
Note: See TracBrowser for help on using the repository browser.