xref: /haiku/src/add-ons/kernel/drivers/audio/echo/generic/CLaylaDspCommObject.h (revision f2ced752a08ff5d2618826bcd3ae3976c9f3e92e)
1 // ****************************************************************************
2 //
3 //		CLaylaDspCommObject.H
4 //
5 //		Include file for EchoGals generic driver Layla DSP interface class.
6 //
7 // ----------------------------------------------------------------------------
8 //
9 //		Copyright Echo Digital Audio Corporation (c) 1998 - 2002
10 //		All rights reserved
11 //		www.echoaudio.com
12 //
13 //		Permission is hereby granted, free of charge, to any person obtaining a
14 //		copy of this software and associated documentation files (the
15 //		"Software"), to deal with the Software without restriction, including
16 //		without limitation the rights to use, copy, modify, merge, publish,
17 //		distribute, sublicense, and/or sell copies of the Software, and to
18 //		permit persons to whom the Software is furnished to do so, subject to
19 //		the following conditions:
20 //
21 //		- Redistributions of source code must retain the above copyright
22 //		notice, this list of conditions and the following disclaimers.
23 //
24 //		- Redistributions in binary form must reproduce the above copyright
25 //		notice, this list of conditions and the following disclaimers in the
26 //		documentation and/or other materials provided with the distribution.
27 //
28 //		- Neither the name of Echo Digital Audio, nor the names of its
29 //		contributors may be used to endorse or promote products derived from
30 //		this Software without specific prior written permission.
31 //
32 //		THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
33 //		EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
34 //		MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
35 //		IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR
36 //		ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
37 //		TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
38 //		SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
39 //
40 // ****************************************************************************
41 
42 #ifndef	_LAYLADSPCOMMOBJECT_
43 #define	_LAYLADSPCOMMOBJECT_
44 
45 #include "CDspCommObject.h"
46 
47 //*****************************************************************************
48 //
49 // Layla clock numbers to send to DSP
50 //
51 //*****************************************************************************
52 
53 #define LAYLA20_CLOCK_INTERNAL			0
54 #define LAYLA20_CLOCK_SPDIF				1
55 #define LAYLA20_CLOCK_WORD					2
56 #define LAYLA20_CLOCK_SUPER				3
57 
58 
59 //*****************************************************************************
60 //
61 // CLaylaDspCommObject
62 //
63 //*****************************************************************************
64 
65 
66 class CLaylaDspCommObject : public CDspCommObject
67 {
68 protected:
69 
70 	BYTE			m_byInputTrims[8];	// Input trims for Layla20's 8 analog
71 												// inputs
72 
73 public:
74 	//
75 	//	Construction/destruction
76 	//
77 	CLaylaDspCommObject( PDWORD pdwRegBase, PCOsSupport pOsSupport );
78 	virtual ~CLaylaDspCommObject();
79 
80 	//
81 	//	Set the DSP sample rate
82 	//	Return rate that was set, -1 if error
83 	//
84 	virtual DWORD SetSampleRate( DWORD dwNewSampleRate );
85 	//
86 	//	Send current setting to DSP & return what it is
87 	//
88 	virtual DWORD SetSampleRate()
89 	{ return( SetSampleRate( GetSampleRate() ) ); }
90 
91 	//
92 	//	Card information
93 	//
94 	virtual WORD GetCardType()
95 		{ return( LAYLA ); }
96 
97 	//
98 	//	Set clocks
99 	//
100 	virtual ECHOSTATUS SetOutputClock(WORD wClock);
101 	virtual ECHOSTATUS SetInputClock(WORD wClock);
102 
103 	//
104 	//	Input gain
105 	//
106 	virtual ECHOSTATUS SetBusInGain(WORD wBusIn,int iGain);
107 	virtual ECHOSTATUS GetBusInGain(WORD wBusIn,int &iGain);
108 	virtual ECHOSTATUS SetNominalLevel( WORD wBus, BOOL bState );
109 
110 	virtual BOOL IsMidiOutActive();
111 
112 protected:
113 
114 	virtual BOOL LoadASIC();
115 
116 };		// class CLaylaDspCommObject
117 
118 typedef CLaylaDspCommObject * PCLaylaDspCommObject;
119 
120 #endif
121 
122 // **** LaylaDspCommObject.h ****
123