root/trunk/libffado/src/bebob/bebob_mixer.h

Revision 864, 2.7 kB (checked in by ppalmers, 16 years ago)

update license to GPLv2 or GPLv3 instead of GPLv2 or any later version. Update copyrights to reflect the new year

Line 
1 /*
2  * Copyright (C) 2005-2008 by Pieter Palmers
3  *
4  * This file is part of FFADO
5  * FFADO = Free Firewire (pro-)audio drivers for linux
6  *
7  * FFADO is based upon FreeBoB
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 2 of the License, or
12  * (at your option) version 3 of the License.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21  *
22  */
23
24 #ifndef __FFAD0_BEBOB_MIXER__
25 #define __FFAD0_BEBOB_MIXER__
26
27 #include "src/debugmodule/debugmodule.h"
28
29 #include "libcontrol/BasicElements.h"
30
31 #include <vector>
32
33 namespace BeBoB {
34
35 class AvDevice;
36 class FunctionBlock;
37 class FunctionBlockFeature;
38 class FunctionBlockSelector;
39 class FunctionBlockEnhancedMixer;
40
41 class Mixer
42     : public Control::Container
43 {
44 public:
45     Mixer(AvDevice &d);
46     virtual ~Mixer();
47
48     virtual std::string getName()
49         { return "Mixer"; };
50     virtual bool setName( std::string n )
51         { return false; };
52
53     bool addElementForFunctionBlock(FunctionBlock& b);
54     bool addElementForAllFunctionBlocks();
55
56     // manipulation of the contained elements
57     bool addElement(Control::Element *)
58         {debugWarning("not allowed"); return false;};
59     bool deleteElement(Control::Element *);
60     bool clearElements();
61
62     AvDevice& getParent()
63         {return m_device;};
64
65 protected:
66     AvDevice&            m_device;
67 protected:
68     DECLARE_DEBUG_MODULE;
69 };
70
71 class MixerFBFeature
72     : public Control::Continuous
73 {
74 public:
75     MixerFBFeature(Mixer& parent, FunctionBlockFeature&);
76    
77     virtual bool setValue(double v);
78     virtual double getValue();
79    
80 private:
81     Mixer&                  m_Parent;
82     FunctionBlockFeature&   m_Slave;
83 };
84
85 class EnhancedMixerFBFeature
86     : public Control::Continuous
87 {
88 public:
89     EnhancedMixerFBFeature(Mixer& parent, FunctionBlockEnhancedMixer&);
90    
91     virtual bool setValue(double v);
92     virtual double getValue();
93    
94 private:
95     Mixer&                      m_Parent;
96     FunctionBlockEnhancedMixer& m_Slave;
97 };
98
99 class MixerFBSelector
100     : public Control::Discrete
101 {
102 public:
103     MixerFBSelector(Mixer& parent, FunctionBlockSelector&);
104    
105     virtual bool setValue(int v);
106     virtual int getValue();
107    
108 private:
109     Mixer&                  m_Parent;
110     FunctionBlockSelector&  m_Slave;
111 };
112
113 } // end of namespace BeBoB
114
115 #endif /* __FFAD0_BEBOB_MIXER__ */
116
117
Note: See TracBrowser for help on using the browser.