BPicture: Fix archive constructor.
[haiku.git] / src / add-ons / kernel / drivers / audio / echo / generic / CLineLevel.h
blobe39be403aff8ab6ed0473a39554123a37f1be37d
1 // ****************************************************************************
2 //
3 // CLineLevel.h
4 //
5 // Include file for EchoGals generic driver line level state machine.
6 //
7 // Class for setting and getting mixer values for input and output busses.
8 //
9 // Implemented as a base class with 3 derived classes, one for
10 // each type of line.
12 // ----------------------------------------------------------------------------
14 // ----------------------------------------------------------------------------
16 // This file is part of Echo Digital Audio's generic driver library.
17 // Copyright Echo Digital Audio Corporation (c) 1998 - 2005
18 // All rights reserved
19 // www.echoaudio.com
21 // This library is free software; you can redistribute it and/or
22 // modify it under the terms of the GNU Lesser General Public
23 // License as published by the Free Software Foundation; either
24 // version 2.1 of the License, or (at your option) any later version.
26 // This library is distributed in the hope that it will be useful,
27 // but WITHOUT ANY WARRANTY; without even the implied warranty of
28 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
29 // Lesser General Public License for more details.
31 // You should have received a copy of the GNU Lesser General Public
32 // License along with this library; if not, write to the Free Software
33 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
35 // ****************************************************************************
37 #ifndef _CLineLevel_
38 #define _CLineLevel_
41 class CEchoGals;
44 /****************************************************************************
46 CLineLevel - Base class
48 ****************************************************************************/
50 class CLineLevel
52 protected :
54 INT32 m_iGain; // Current gain in dB X 256
55 BOOL m_fMuted;
56 CEchoGals * m_pEchoGals; // Ptr to our creator object
57 WORD m_wChannelIndex; // pipe index for this line
59 public:
62 // Construction/destruction
64 CLineLevel();
65 virtual ~CLineLevel();
68 // Initialization function for initializing arrays of this class
70 void Init
72 WORD wChannelIndex, // Which channel we represent
73 CEchoGals * pEchoGals, // For setting line levels
74 INT32 iGain = 0 // Initial gain setting
78 // Mute
80 virtual ECHOSTATUS SetMute( BOOL bOn );
81 BOOL IsMuteOn() { return m_fMuted; }
85 // Gain functions
87 INT32 GetGain() { return( m_iGain ); }
88 virtual ECHOSTATUS SetGain(
89 INT32 iGain,
90 BOOL fImmediate = TRUE
91 ) = NULL;
93 }; // class CLineLevel
95 typedef CLineLevel * PCLineLevel;
99 /****************************************************************************
101 CBusInLineLevel - Derived class for managing input bus gains
103 ****************************************************************************/
105 class CBusInLineLevel : public CLineLevel
107 protected :
109 public:
112 // Construction/destruction
114 CBusInLineLevel();
115 virtual ~CBusInLineLevel();
118 // Mute
120 virtual ECHOSTATUS SetMute( BOOL bOn );
123 // Gain functions
125 virtual ECHOSTATUS SetGain
127 INT32 iGain,
128 BOOL fImmediate = TRUE
132 }; // class CBusInLineLevel
134 typedef CBusInLineLevel * PCBusInLineLevel;
139 /****************************************************************************
141 CBusOutLineLevel - Derived class for managing output bus gains
143 ****************************************************************************/
145 class CBusOutLineLevel : public CLineLevel
147 protected :
149 public:
152 // Construction/destruction
154 CBusOutLineLevel();
155 virtual ~CBusOutLineLevel();
158 // Mute
160 virtual ECHOSTATUS SetMute( BOOL bOn );
163 // Gain functions
165 virtual ECHOSTATUS SetGain
167 INT32 iGain,
168 BOOL fImmediate = TRUE
172 }; // class CBusOutLineLevel
174 typedef CBusOutLineLevel * PCBusOutLineLevel;
176 #endif
178 // **** CLineLevel.h ****