xref: /haiku/src/add-ons/kernel/drivers/audio/echo/generic/C3g.h (revision dd2a1e350b303b855a50fd64e6cb55618be1ae6a)
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 	virtual void QuerySampleRateRange(DWORD &dwMinRate,DWORD &dwMaxRate);
85 
86 	//
87 	//	Start transport for several pipes at once
88 	//
89 	virtual ECHOSTATUS Start
90 	(
91 		PCChannelMask	pChannelMask
92 	);
93 	using CEchoGalsMTC::Start;
94 
95 	//
96 	// Get a bitmask of all the clocks the hardware is currently detecting
97 	//
98 	virtual ECHOSTATUS GetInputClockDetect(DWORD &dwClockDetectBits);
99 
100 	//
101 	// Phantom power on/off for Gina3G
102 	//
103 	virtual void GetPhantomPower(BOOL *pfPhantom);
104 	virtual void SetPhantomPower(BOOL fPhantom);
105 
106 	//
107 	//	Overload new & delete so memory for this object is allocated from
108 	//	non-paged memory.
109 	//
110 	PVOID operator new( size_t Size );
111 	VOID  operator delete( PVOID pVoid );
112 
113 protected:
114 	//
115 	//	Get access to the appropriate DSP comm object
116 	//
117 	PC3gDco GetDspCommObject()
118 		{ return( (PC3gDco) m_pDspCommObject ); }
119 
120 	BOOL	 m_fPhantomPower;
121 
122 };		// class CMia
123 
124 
125 typedef C3g * PC3g;
126 
127 #endif
128 
129 // *** C3g.H ***
130