1 |
/* |
---|
2 |
* Copyright (C) 2005-2008 by Daniel Wagner |
---|
3 |
* Copyright (C) 2005-2008 by Pieter Palmers |
---|
4 |
* Copyright (C) 2008 by Jonathan Woithe |
---|
5 |
* |
---|
6 |
* This file is part of FFADO |
---|
7 |
* FFADO = Free Firewire (pro-)audio drivers for linux |
---|
8 |
* |
---|
9 |
* FFADO is based upon FreeBoB. |
---|
10 |
* |
---|
11 |
* This program is free software: you can redistribute it and/or modify |
---|
12 |
* it under the terms of the GNU General Public License as published by |
---|
13 |
* the Free Software Foundation, either version 2 of the License, or |
---|
14 |
* (at your option) version 3 of the License. |
---|
15 |
* |
---|
16 |
* This program is distributed in the hope that it will be useful, |
---|
17 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
18 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
19 |
* GNU General Public License for more details. |
---|
20 |
* |
---|
21 |
* You should have received a copy of the GNU General Public License |
---|
22 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
23 |
* |
---|
24 |
*/ |
---|
25 |
|
---|
26 |
#include "debugmodule/debugmodule.h" |
---|
27 |
|
---|
28 |
#include "libcontrol/BasicElements.h" |
---|
29 |
#include "libcontrol/MatrixMixer.h" |
---|
30 |
|
---|
31 |
namespace Motu { |
---|
32 |
|
---|
33 |
class MotuDevice; |
---|
34 |
|
---|
35 |
#define MOTU_CTRL_CHANNEL_FADER 0x0001 |
---|
36 |
#define MOTU_CTRL_CHANNEL_PAN 0x0002 |
---|
37 |
#define MOTU_CTRL_CHANNEL_SOLO 0x0004 |
---|
38 |
#define MOTU_CTRL_CHANNEL_MUTE 0x0008 |
---|
39 |
#define MOTU_CTRL_MIX_FADER 0x0100 |
---|
40 |
#define MOTU_CTRL_MIX_MUTE 0x0200 |
---|
41 |
#define MOTU_CTRL_MIX_DEST 0x0400 |
---|
42 |
|
---|
43 |
#define MOTU_CTRL_STD_CHANNEL \ |
---|
44 |
(MOTU_CTRL_CHANNEL_FADER|MOTU_CTRL_CHANNEL_PAN|\ |
---|
45 |
MOTU_CTRL_CHANNEL_SOLO|MOTU_CTRL_CHANNEL_MUTE) |
---|
46 |
|
---|
47 |
#define MOTU_CTRL_STD_MIX \ |
---|
48 |
(MOTU_CTRL_MIX_FADER|MOTU_CTRL_MIX_MUTE|\ |
---|
49 |
MOTU_CTRL_MIX_DEST) |
---|
50 |
|
---|
51 |
class MotuDiscreteCtrl |
---|
52 |
: public Control::Discrete |
---|
53 |
{ |
---|
54 |
public: |
---|
55 |
MotuDiscreteCtrl(MotuDevice &parent, unsigned int dev_reg); |
---|
56 |
MotuDiscreteCtrl(MotuDevice &parent, unsigned int dev_reg, |
---|
57 |
std::string name, std::string label, std::string descr); |
---|
58 |
|
---|
59 |
protected: |
---|
60 |
MotuDevice &m_parent; |
---|
61 |
unsigned int m_register; |
---|
62 |
}; |
---|
63 |
|
---|
64 |
class ChannelFader |
---|
65 |
: public MotuDiscreteCtrl |
---|
66 |
{ |
---|
67 |
public: |
---|
68 |
ChannelFader(MotuDevice &parent, unsigned int dev_reg); |
---|
69 |
ChannelFader(MotuDevice &parent, unsigned int dev_reg, |
---|
70 |
std::string name, std::string label, std::string descr); |
---|
71 |
|
---|
72 |
virtual bool setValue(int v); |
---|
73 |
virtual int getValue(); |
---|
74 |
}; |
---|
75 |
|
---|
76 |
class ChannelPan |
---|
77 |
: public MotuDiscreteCtrl |
---|
78 |
{ |
---|
79 |
public: |
---|
80 |
ChannelPan(MotuDevice &parent, unsigned int dev_reg); |
---|
81 |
ChannelPan(MotuDevice &parent, unsigned int dev_reg, |
---|
82 |
std::string name, std::string label, std::string descr); |
---|
83 |
|
---|
84 |
virtual bool setValue(int v); |
---|
85 |
virtual int getValue(); |
---|
86 |
}; |
---|
87 |
|
---|
88 |
class ChannelMute |
---|
89 |
: public MotuDiscreteCtrl |
---|
90 |
{ |
---|
91 |
public: |
---|
92 |
ChannelMute(MotuDevice &parent, unsigned int dev_reg); |
---|
93 |
ChannelMute(MotuDevice &parent, unsigned int dev_reg, |
---|
94 |
std::string name, std::string label, std::string descr); |
---|
95 |
|
---|
96 |
virtual bool setValue(int v); |
---|
97 |
virtual int getValue(); |
---|
98 |
}; |
---|
99 |
|
---|
100 |
class ChannelSolo |
---|
101 |
: public MotuDiscreteCtrl |
---|
102 |
{ |
---|
103 |
public: |
---|
104 |
ChannelSolo(MotuDevice &parent, unsigned int dev_reg); |
---|
105 |
ChannelSolo(MotuDevice &parent, unsigned int dev_reg, |
---|
106 |
std::string name, std::string label, std::string descr); |
---|
107 |
|
---|
108 |
virtual bool setValue(int v); |
---|
109 |
virtual int getValue(); |
---|
110 |
}; |
---|
111 |
|
---|
112 |
class MixFader |
---|
113 |
: public MotuDiscreteCtrl |
---|
114 |
{ |
---|
115 |
public: |
---|
116 |
MixFader(MotuDevice &parent, unsigned int dev_reg); |
---|
117 |
MixFader(MotuDevice &parent, unsigned int dev_reg, |
---|
118 |
std::string name, std::string label, std::string descr); |
---|
119 |
|
---|
120 |
virtual bool setValue(int v); |
---|
121 |
virtual int getValue(); |
---|
122 |
}; |
---|
123 |
|
---|
124 |
class MixMute |
---|
125 |
: public MotuDiscreteCtrl |
---|
126 |
{ |
---|
127 |
public: |
---|
128 |
MixMute(MotuDevice &parent, unsigned int dev_reg); |
---|
129 |
MixMute(MotuDevice &parent, unsigned int dev_reg, |
---|
130 |
std::string name, std::string label, std::string descr); |
---|
131 |
|
---|
132 |
virtual bool setValue(int v); |
---|
133 |
virtual int getValue(); |
---|
134 |
}; |
---|
135 |
|
---|
136 |
class MixDest |
---|
137 |
: public MotuDiscreteCtrl |
---|
138 |
{ |
---|
139 |
public: |
---|
140 |
MixDest(MotuDevice &parent, unsigned int dev_reg); |
---|
141 |
MixDest(MotuDevice &parent, unsigned int dev_reg, |
---|
142 |
std::string name, std::string label, std::string descr); |
---|
143 |
|
---|
144 |
virtual bool setValue(int v); |
---|
145 |
virtual int getValue(); |
---|
146 |
}; |
---|
147 |
|
---|
148 |
} |
---|