BPicture: Fix archive constructor.
[haiku.git] / src / add-ons / kernel / drivers / audio / echo / generic / CGinaDspCommObject.cpp
blob2fa6f55764a642b7f51ef4851986d86da4ad7768
1 // ****************************************************************************
2 //
3 // CGinaDspCommObject.cpp
4 //
5 // Implementation file Gina20 DSP interface class.
6 //
7 // ----------------------------------------------------------------------------
8 //
9 // This file is part of Echo Digital Audio's generic driver library.
10 // Copyright Echo Digital Audio Corporation (c) 1998 - 2005
11 // All rights reserved
12 // www.echoaudio.com
14 // This library is free software; you can redistribute it and/or
15 // modify it under the terms of the GNU Lesser General Public
16 // License as published by the Free Software Foundation; either
17 // version 2.1 of the License, or (at your option) any later version.
19 // This library is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 // Lesser General Public License for more details.
24 // You should have received a copy of the GNU Lesser General Public
25 // License along with this library; if not, write to the Free Software
26 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 // ****************************************************************************
30 #include "CEchoGals.h"
31 #include "CGinaDspCommObject.h"
33 #include "Gina20DSP.c"
36 /****************************************************************************
38 Construction and destruction
40 ****************************************************************************/
42 //===========================================================================
44 // Constructor
46 //===========================================================================
48 CGinaDspCommObject::CGinaDspCommObject
50 PDWORD pdwRegBase, // Virtual ptr to DSP registers
51 PCOsSupport pOsSupport
52 ) : CGdDspCommObject( pdwRegBase, pOsSupport )
54 strcpy( m_szCardName, "Gina" );
55 m_pdwDspRegBase = pdwRegBase; // Virtual addr DSP's register base
57 m_wNumPipesOut = 10;
58 m_wNumPipesIn = 4;
59 m_wNumBussesOut = 10;
60 m_wNumBussesIn = 4;
61 m_wFirstDigitalBusOut = 8;
62 m_wFirstDigitalBusIn = 2;
64 m_fHasVmixer = FALSE;
66 m_wNumMidiOut = 0; // # MIDI out channels
67 m_wNumMidiIn = 0; // # MIDI in channels
69 m_pwDspCodeToLoad = pwGina20DSP;
72 // Since this card has no ASIC, mark it as loaded so everything works OK
74 m_bASICLoaded = TRUE;
76 } // CGinaDspCommObject::CGinaDspCommObject( DWORD dwPhysRegBase )
79 //===========================================================================
81 // Destructor
83 //===========================================================================
85 CGinaDspCommObject::~CGinaDspCommObject()
87 } // CGinaDspCommObject::~CGinaDspCommObject()
92 /****************************************************************************
94 Hardware config
96 ****************************************************************************/
98 //===========================================================================
100 // Destructor
102 //===========================================================================
104 ECHOSTATUS CGinaDspCommObject::SetInputClock(WORD wClock)
106 ECHO_DEBUGPRINTF( ( "CGinaDspCommObject::SetInputClock:\n" ) );
108 switch ( wClock )
110 case ECHO_CLOCK_INTERNAL :
112 // Reset the audio state to unknown (just in case)
113 m_byGDCurrentClockState = GD_CLOCK_UNDEF;
114 m_byGDCurrentSpdifStatus = GD_SPDIF_STATUS_UNDEF;
116 SetSampleRate();
118 m_wInputClock = wClock;
120 ECHO_DEBUGPRINTF( ( "\tSet Gina clock to INTERNAL\n" ) );
121 break;
123 case ECHO_CLOCK_SPDIF :
124 m_pDspCommPage->byGDClockState = GD_CLOCK_SPDIFIN;
125 m_pDspCommPage->byGDSpdifStatus = GD_SPDIF_STATUS_NOCHANGE;
127 ClearHandshake();
128 SendVector( DSP_VC_SET_GD_AUDIO_STATE );
130 m_byGDCurrentClockState = GD_CLOCK_SPDIFIN;
132 ECHO_DEBUGPRINTF( ( "\tSet Gina clock to SPDIF\n" ) );
134 m_wInputClock = wClock;
135 break;
137 default :
138 return ECHOSTATUS_CLOCK_NOT_SUPPORTED;
140 } // switch ( wClock )
142 return ECHOSTATUS_OK;
144 } // ECHOSTATUS CGinaDspCommObject::SetInputClock()
147 // **** GinaDspCommObject.cpp ****