root/trunk/libffado/src/rme/fireface_settings_ctrls.h

Revision 2038, 4.4 kB (checked in by jwoithe, 9 years ago)

rme: various information panes are now active in ffado-mixer: sync check, autosync reference, spdif freqency and system clock. The function of these in the presence of actual external sync sources is yet to be confirmed. The system clock information has been confirmed to update when the clock mode and/or sample rate controls are altered.

Line 
1 /*
2  * Copyright (C) 2009 by Jonathan Woithe
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 #include "debugmodule/debugmodule.h"
25
26 #include "libcontrol/BasicElements.h"
27 #include "libcontrol/MatrixMixer.h"
28
29 namespace Rme {
30
31 /* Control types for an RmeSettingsCtrl object */
32 #define RME_CTRL_NONE                  0x0000
33 #define RME_CTRL_PHANTOM_SW            0x0001
34 #define RME_CTRL_SPDIF_INPUT_MODE      0x0002
35 #define RME_CTRL_SPDIF_OUTPUT_OPTICAL  0x0003
36 #define RME_CTRL_SPDIF_OUTPUT_PRO      0x0004
37 #define RME_CTRL_SPDIF_OUTPUT_EMPHASIS 0x0005
38 #define RME_CTRL_SPDIF_OUTPUT_NONAUDIO 0x0006
39 #define RME_CTRL_CLOCK_MODE            0x0007
40 #define RME_CTRL_SYNC_REF              0x0008
41 #define RME_CTRL_DEV_OPTIONS           0x0009
42 #define RME_CTRL_LIMIT_BANDWIDTH       0x000a
43 #define RME_CTRL_INPUT_LEVEL           0x000b
44 #define RME_CTRL_OUTPUT_LEVEL          0x000c
45 #define RME_CTRL_INSTRUMENT_OPTIONS    0x000d
46 #define RME_CTRL_WCLK_SINGLE_SPEED     0x000e
47 #define RME_CTRL_PHONES_LEVEL          0x000f
48 #define RME_CTRL_INPUT0_OPTIONS        0x0010
49 #define RME_CTRL_INPUT1_OPTIONS        0x0011
50 #define RME_CTRL_INPUT2_OPTIONS        0x0012
51 #define RME_CTRL_FF400_PAD_SW          0x0013
52 #define RME_CTRL_FF400_INSTR_SW        0x0014
53
54 #define RME_CTRL_INFO_MODEL            0x0100
55 #define RME_CTRL_INFO_TCO_PRESENT      0x0200
56 #define RME_CTRL_INFO_SYSCLOCK_MODE    0x0300
57 #define RME_CTRL_INFO_SYSCLOCK_FREQ    0x0301
58 #define RME_CTRL_INFO_AUTOSYNC_FREQ    0x0310
59 #define RME_CTRL_INFO_AUTOSYNC_SRC     0x0311
60 #define RME_CTRL_INFO_SYNC_STATUS      0x0312
61 #define RME_CTRL_INFO_SPDIF_FREQ       0x0313
62
63 /* Control types for an RmeSettingsMatrixCtrl object */
64 #define RME_MATRIXCTRL_NONE            0x0000
65 #define RME_MATRIXCTRL_GAINS           0x0001
66 #define RME_MATRIXCTRL_INPUT_FADER     0x0002
67 #define RME_MATRIXCTRL_PLAYBACK_FADER  0x0003
68 #define RME_MATRIXCTRL_OUTPUT_FADER    0x0004
69 #define RME_MATRIXCTRL_INPUT_MUTE      0x0005
70 #define RME_MATRIXCTRL_PLAYBACK_MUTE   0x0006
71 #define RME_MATRIXCTRL_OUTPUT_MUTE     0x0007
72 #define RME_MATRIXCTRL_INPUT_INVERT    0x0008
73 #define RME_MATRIXCTRL_PLAYBACK_INVERT 0x0009
74
75
76 class Device;
77
78 class RmeSettingsCtrl
79     : public Control::Discrete
80 {
81 public:
82     RmeSettingsCtrl(Device &parent, unsigned int type, unsigned int info);
83     RmeSettingsCtrl(Device &parent, unsigned int type, unsigned int info,
84         std::string name, std::string label, std::string descr);
85     virtual bool setValue(int v);
86     virtual int getValue();
87
88     virtual bool setValue(int idx, int v) { return setValue(v); };
89     virtual int getValue(int idx) { return getValue(); };
90     virtual int getMinimum() {return 0; };
91     virtual int getMaximum() {return 0; };
92
93 protected:
94     Device &m_parent;
95     unsigned int m_type;
96     unsigned int m_value, m_info;
97
98 };
99
100 class RmeSettingsMatrixCtrl
101     : public Control::MatrixMixer
102 {
103 public:
104     RmeSettingsMatrixCtrl(Device &parent, unsigned int type);
105     RmeSettingsMatrixCtrl(Device &parent, unsigned int type,
106         std::string name);
107
108     virtual void show();
109
110     bool hasNames() const { return true; }
111     bool canConnect() const { return false; }
112
113     virtual std::string getRowName(const int row);
114     virtual std::string getColName(const int col);
115     virtual int canWrite( const int, const int ) { return true; }
116     virtual int getRowCount();
117     virtual int getColCount();
118
119     virtual double setValue(const int row, const int col, const double val);
120     virtual double getValue(const int row, const int col);
121
122     // functions to access the entire coefficient map at once
123     virtual bool getCoefficientMap(int &) {return false;};
124     virtual bool storeCoefficientMap(int &) {return false;};
125
126 protected:
127     Device &m_parent;
128     unsigned int m_type;
129 };
130
131 }
Note: See TracBrowser for help on using the browser.