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 |
virtual bool setValue(int idx, double v); |
---|
80 |
virtual double getValue(int idx); |
---|
81 |
|
---|
82 |
private: |
---|
83 |
Mixer& m_Parent; |
---|
84 |
FunctionBlockFeature& m_Slave; |
---|
85 |
}; |
---|
86 |
|
---|
87 |
class EnhancedMixerFBFeature |
---|
88 |
: public Control::Continuous |
---|
89 |
{ |
---|
90 |
public: |
---|
91 |
EnhancedMixerFBFeature(Mixer& parent, FunctionBlockEnhancedMixer&); |
---|
92 |
|
---|
93 |
virtual bool setValue(double v); |
---|
94 |
virtual double getValue(); |
---|
95 |
|
---|
96 |
private: |
---|
97 |
Mixer& m_Parent; |
---|
98 |
FunctionBlockEnhancedMixer& m_Slave; |
---|
99 |
}; |
---|
100 |
|
---|
101 |
class MixerFBSelector |
---|
102 |
: public Control::Discrete |
---|
103 |
{ |
---|
104 |
public: |
---|
105 |
MixerFBSelector(Mixer& parent, FunctionBlockSelector&); |
---|
106 |
|
---|
107 |
virtual bool setValue(int v); |
---|
108 |
virtual int getValue(); |
---|
109 |
|
---|
110 |
private: |
---|
111 |
Mixer& m_Parent; |
---|
112 |
FunctionBlockSelector& m_Slave; |
---|
113 |
}; |
---|
114 |
|
---|
115 |
} // end of namespace BeBoB |
---|
116 |
|
---|
117 |
#endif /* __FFAD0_BEBOB_MIXER__ */ |
---|
118 |
|
---|
119 |
|
---|