xref: /haiku/src/add-ons/kernel/drivers/audio/echo/generic/CGdDspCommObject.h (revision 4afae676ad98b8f1e219f704dfc9c8507bce106e)
1 // ****************************************************************************
2 //
3 //		CGdDspCommObject.H
4 //
5 //		Darla20 and Gina20 are very similar; this class is used for both.
6 //		CGinaDspCommObject and CDarlaDspCommObject dervie from this class, in
7 //		turn.
8 //
9 // ----------------------------------------------------------------------------
10 //
11 //		Copyright Echo Digital Audio Corporation (c) 1998 - 2002
12 //		All rights reserved
13 //		www.echoaudio.com
14 //
15 //		Permission is hereby granted, free of charge, to any person obtaining a
16 //		copy of this software and associated documentation files (the
17 //		"Software"), to deal with the Software without restriction, including
18 //		without limitation the rights to use, copy, modify, merge, publish,
19 //		distribute, sublicense, and/or sell copies of the Software, and to
20 //		permit persons to whom the Software is furnished to do so, subject to
21 //		the following conditions:
22 //
23 //		- Redistributions of source code must retain the above copyright
24 //		notice, this list of conditions and the following disclaimers.
25 //
26 //		- Redistributions in binary form must reproduce the above copyright
27 //		notice, this list of conditions and the following disclaimers in the
28 //		documentation and/or other materials provided with the distribution.
29 //
30 //		- Neither the name of Echo Digital Audio, nor the names of its
31 //		contributors may be used to endorse or promote products derived from
32 //		this Software without specific prior written permission.
33 //
34 //		THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35 //		EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
36 //		MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
37 //		IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR
38 //		ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
39 //		TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
40 //		SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
41 //
42 // ****************************************************************************
43 
44 #ifndef	_GDDSPCOMMOBJECT_
45 #define	_GDDSPCOMMOBJECT_
46 
47 #include "CDspCommObject.h"
48 
49 
50 class CGdDspCommObject : public CDspCommObject
51 {
52 public:
53 	//
54 	//	Construction/destruction
55 	//
56 	CGdDspCommObject( PDWORD pdwRegBase, PCOsSupport pOsSupport  );
57 	virtual ~CGdDspCommObject();
58 
59 	//
60 	//	Set the DSP sample rate.
61 	//	Return rate that was set, -1 if error
62 	//
63 	virtual DWORD SetSampleRate( DWORD dwNewSampleRate );
64 	//
65 	//	Send current setting to DSP & return what it is
66 	//
67 	virtual DWORD SetSampleRate()
68 	{ return SetSampleRate( GetSampleRate() ); }
69 
70 protected:
71 	BYTE 	m_byGDCurrentSpdifStatus;
72 	BYTE 	m_byGDCurrentClockState;
73 
74 	//
75 	//	Called after load firmware to restore old gains, meters on, monitors, etc.
76 	//	No error checking is done here.
77 	//
78 	virtual void RestoreDspSettings();
79 
80 	// SelectGinaDarlaSpdifStatus
81 	BYTE SelectGinaDarlaSpdifStatus( DWORD dwNewSampleRate );
82 
83 };		// class CGdDspCommObject
84 
85 typedef CGdDspCommObject * PCGdDspCommObject;
86 
87 #endif
88 
89 // **** GdDspCommObject.h ****
90