xref: /haiku/src/add-ons/kernel/drivers/audio/echo/generic/C3g.h (revision 1d9d47fc72028bb71b5f232a877231e59cfe2438)
1 // ****************************************************************************
2 //
3 //		C3g.H
4 //
5 //		Include file for interfacing with the 3G generic driver class
6 //		Set editor tabs to 3 for your viewing pleasure.
7 //
8 // ----------------------------------------------------------------------------
9 //
10 // ----------------------------------------------------------------------------
11 //
12 // This file is part of Echo Digital Audio's generic driver library.
13 // Copyright Echo Digital Audio Corporation (c) 1998 - 2005
14 // All rights reserved
15 // www.echoaudio.com
16 //
17 // This library is free software; you can redistribute it and/or
18 // modify it under the terms of the GNU Lesser General Public
19 // License as published by the Free Software Foundation; either
20 // version 2.1 of the License, or (at your option) any later version.
21 //
22 // This library is distributed in the hope that it will be useful,
23 // but WITHOUT ANY WARRANTY; without even the implied warranty of
24 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
25 // Lesser General Public License for more details.
26 //
27 // You should have received a copy of the GNU Lesser General Public
28 // License along with this library; if not, write to the Free Software
29 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
30 //
31 // ****************************************************************************
32 
33 //	Prevent problems with multiple includes
34 #ifndef _3GOBJECT_
35 #define _3GOBJECT_
36 
37 #include "CEchoGalsMTC.h"
38 #include "C3gDco.h"
39 
40 //
41 //	Class used for interfacing with the 3G audio card.
42 //
43 class C3g : public CEchoGalsMTC
44 {
45 public:
46 	//
47 	//	Construction/destruction
48 	//
49 	C3g( PCOsSupport pOsSupport );
50 	virtual ~C3g();
51 
52 	//
53 	// Setup & initialization methods
54 	//
55 	virtual ECHOSTATUS InitHw();
56 
57 	//
58 	//	Return the capabilities of this card; card type, card name,
59 	//	# analog inputs, # analog outputs, # digital channels,
60 	//	# MIDI ports and supported clocks.
61 	//	See ECHOGALS_CAPS definition above.
62 	//
63 	virtual ECHOSTATUS GetCapabilities
64 	(
65 		PECHOGALS_CAPS	pCapabilities
66 	);
67 
68 	void Get3gBoxType(DWORD *pOriginalBoxType,DWORD *pCurrentBoxType);
69 	char *Get3gBoxName();
70 
71 	//
72 	// Get the audio latency for a single pipe
73 	//
74 	virtual void GetAudioLatency(ECHO_AUDIO_LATENCY *pLatency);
75 
76 	//
77 	//	Audio Interface methods
78 	//
79 	virtual ECHOSTATUS QueryAudioSampleRate
80 	(
81 		DWORD		dwSampleRate
82 	);
83 
84 	//
85 	//	Start transport for several pipes at once
86 	//
87 	virtual ECHOSTATUS Start
88 	(
89 		PCChannelMask	pChannelMask
90 	);
91 
92 	//
93 	// Get a bitmask of all the clocks the hardware is currently detecting
94 	//
95 	virtual ECHOSTATUS GetInputClockDetect(DWORD &dwClockDetectBits);
96 
97 	//
98 	// Phantom power on/off for Gina3G
99 	//
100 	virtual void GetPhantomPower(BOOL *pfPhantom);
101 	virtual void SetPhantomPower(BOOL fPhantom);
102 
103 	//
104 	//	Overload new & delete so memory for this object is allocated from
105 	//	non-paged memory.
106 	//
107 	PVOID operator new( size_t Size );
108 	VOID  operator delete( PVOID pVoid );
109 
110 protected:
111 	//
112 	//	Get access to the appropriate DSP comm object
113 	//
114 	PC3gDco GetDspCommObject()
115 		{ return( (PC3gDco) m_pDspCommObject ); }
116 
117 	BOOL	 m_fPhantomPower;
118 
119 };		// class CMia
120 
121 
122 typedef C3g * PC3g;
123 
124 #endif
125 
126 // *** C3g.H ***
127