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

Revision 628, 2.4 kB (checked in by ppalmers, 13 years ago)

some more fooling around with the bebob mixer support

Line 
1 /*
2  * Copyright (C) 2007 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 library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License version 2.1, as published by the Free Software Foundation;
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21  * MA 02110-1301 USA
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
40 class Mixer
41     : public Control::Container
42 {
43 public:
44     Mixer(AvDevice &d);
45     virtual ~Mixer();
46
47     virtual std::string getName()
48         { return "Mixer"; };
49     virtual bool setName( std::string n )
50         { return false; };
51
52     bool addElementForFunctionBlock(FunctionBlock& b);
53     bool addElementForAllFunctionBlocks();
54
55     // manipulation of the contained elements
56     bool addElement(Control::Element *)
57         {debugWarning("not allowed"); return false;};
58     bool deleteElement(Control::Element *);
59     bool clearElements();
60
61     AvDevice& getParent()
62         {return m_device;};
63
64 protected:
65     AvDevice&            m_device;
66 protected:
67     DECLARE_DEBUG_MODULE;
68 };
69
70 class MixerFBFeature
71     : public Control::Continuous
72 {
73 public:
74     MixerFBFeature(Mixer& parent, FunctionBlockFeature&);
75    
76     virtual bool setValue(double v);
77     virtual double getValue();
78    
79 private:
80     Mixer&                  m_Parent;
81     FunctionBlockFeature&   m_Slave;
82 };
83
84 class MixerFBSelector
85     : public Control::Discrete
86 {
87 public:
88     MixerFBSelector(Mixer& parent, FunctionBlockSelector&);
89    
90     virtual bool setValue(int v);
91     virtual int getValue();
92    
93 private:
94     Mixer&                  m_Parent;
95     FunctionBlockSelector&  m_Slave;
96 };
97
98 } // end of namespace BeBoB
99
100 #endif /* __FFAD0_BEBOB_MIXER__ */
101
102
Note: See TracBrowser for help on using the browser.