xref: /haiku/src/add-ons/kernel/drivers/audio/echo/generic/CLayla24DspCommObject.h (revision 51978af14a173e7fae0563b562be5603bc652aeb)
1 // ****************************************************************************
2 //
3 //		CLayla24DspCommObject.H
4 //
5 //		Include file for EchoGals generic driver Layla24 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	_LAYLA24DSPCOMMOBJECT_
43 #define	_LAYLA24DSPCOMMOBJECT_
44 
45 #include "CGMLDspCommObject.h"
46 
47 class CLayla24DspCommObject : public CGMLDspCommObject
48 {
49 protected:
50 
51 public:
52 	//
53 	//	Construction/destruction
54 	//
55 	CLayla24DspCommObject( PDWORD pdwRegBase, PCOsSupport pOsSupport );
56 	virtual ~CLayla24DspCommObject();
57 
58 	//
59 	//	Set the DSP sample rate.
60 	//	Return rate that was set, -1 if error
61 	//
62 	virtual DWORD SetSampleRate( DWORD dwNewSampleRate );
63 	//
64 	//	Send current setting to DSP & return what it is
65 	//
66 	virtual DWORD SetSampleRate()
67 		{ return( SetSampleRate( GetSampleRate() ) ); }
68 	//
69 	//	Set digital mode
70 	//
71 	virtual ECHOSTATUS SetDigitalMode
72 	(
73 		BYTE	byNewMode
74 	);
75 	//
76 	//	Get mask of all supported digital modes
77 	//	(See ECHOCAPS_HAS_DIGITAL_MODE_??? defines in EchoGalsXface.h)
78 	//
79 	virtual DWORD GetDigitalModes()
80 		{ return( ECHOCAPS_HAS_DIGITAL_MODE_SPDIF_RCA	  |
81 					 ECHOCAPS_HAS_DIGITAL_MODE_SPDIF_OPTICAL |
82 					 ECHOCAPS_HAS_DIGITAL_MODE_ADAT			); }
83 
84 	//
85 	//	Card information
86 	//
87 	virtual WORD GetCardType()
88 		{ return( LAYLA24 ); }
89 
90 	virtual BOOL IsMidiOutActive();
91 
92 protected:
93 
94 	virtual BOOL LoadASIC();
95 
96 	//
97 	//	Switch the external ASIC if not already loaded.
98 	//	Mute monitors during this operation
99 	//
100 	BOOL SwitchAsic
101 	(
102 		BYTE *	pbyAsicNeeded,
103 		DWORD		dwAsicSize
104 	);
105 
106 	//
107 	//	Set input clock
108 	//
109 	virtual ECHOSTATUS SetInputClock(WORD wClock);
110 
111 	BYTE *	m_pbyAsic;					// Current ASIC code
112 
113 };		// class CLayla24DspCommObject
114 
115 typedef CLayla24DspCommObject * PCLayla24DspCommObject;
116 
117 #endif
118 
119 // **** Layla2424DspCommObject.h ****
120