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_INPUT_SOURCE 0x0010 |
---|
49 |
#define RME_CTRL_FF400_PAD_SW 0x0013 |
---|
50 |
#define RME_CTRL_FF400_INSTR_SW 0x0014 |
---|
51 |
|
---|
52 |
#define RME_CTRL_FLASH 0x0050 |
---|
53 |
#define RME_CTRL_MIXER_PRESET 0x0051 |
---|
54 |
|
---|
55 |
#define RME_CTRL_INFO_MODEL 0x0100 |
---|
56 |
#define RME_CTRL_INFO_TCO_PRESENT 0x0200 |
---|
57 |
#define RME_CTRL_INFO_SYSCLOCK_MODE 0x0300 |
---|
58 |
#define RME_CTRL_INFO_SYSCLOCK_FREQ 0x0301 |
---|
59 |
#define RME_CTRL_INFO_AUTOSYNC_FREQ 0x0310 |
---|
60 |
#define RME_CTRL_INFO_AUTOSYNC_SRC 0x0311 |
---|
61 |
#define RME_CTRL_INFO_SYNC_STATUS 0x0312 |
---|
62 |
#define RME_CTRL_INFO_SPDIF_FREQ 0x0313 |
---|
63 |
|
---|
64 |
#define RME_CTRL_TCO_FIRST 0x0400 |
---|
65 |
#define RME_CTRL_TCO_LTC_IN 0x0400 |
---|
66 |
#define RME_CTRL_TCO_INPUT_LTC_VALID 0x0401 |
---|
67 |
#define RME_CTRL_TCO_INPUT_LTC_FPS 0x0402 |
---|
68 |
#define RME_CTRL_TCO_INPUT_LTC_DROPFRAME 0x0403 |
---|
69 |
#define RME_CTRL_TCO_INPUT_VIDEO_TYPE 0x0404 |
---|
70 |
#define RME_CTRL_TCO_INPUT_WORD_CLK 0x0405 |
---|
71 |
#define RME_CTRL_TCO_INPUT_LOCK 0x0406 |
---|
72 |
#define RME_CTRL_TCO_SYNC_SRC 0x0407 |
---|
73 |
#define RME_CTRL_TCO_VIDEO_IN_TERM 0x0408 |
---|
74 |
#define RME_CTRL_TCO_FREQ 0x0409 |
---|
75 |
#define RME_CTRL_TCO_FRAME_RATE 0x040a |
---|
76 |
#define RME_CTRL_TCO_SAMPLE_RATE 0x040b |
---|
77 |
#define RME_CTRL_TCO_SAMPLE_RATE_OFS 0x040c |
---|
78 |
#define RME_CTRL_TCO_WORD_CLK_CONV 0x040d |
---|
79 |
#define RME_CTRL_TCO_LAST 0x040d |
---|
80 |
|
---|
81 |
/* Control types for an RmeSettingsMatrixCtrl object */ |
---|
82 |
#define RME_MATRIXCTRL_NONE 0x0000 |
---|
83 |
#define RME_MATRIXCTRL_GAINS 0x0001 |
---|
84 |
#define RME_MATRIXCTRL_INPUT_FADER 0x0002 |
---|
85 |
#define RME_MATRIXCTRL_PLAYBACK_FADER 0x0003 |
---|
86 |
#define RME_MATRIXCTRL_OUTPUT_FADER 0x0004 |
---|
87 |
#define RME_MATRIXCTRL_INPUT_MUTE 0x0005 |
---|
88 |
#define RME_MATRIXCTRL_PLAYBACK_MUTE 0x0006 |
---|
89 |
#define RME_MATRIXCTRL_OUTPUT_MUTE 0x0007 |
---|
90 |
#define RME_MATRIXCTRL_INPUT_INVERT 0x0008 |
---|
91 |
#define RME_MATRIXCTRL_PLAYBACK_INVERT 0x0009 |
---|
92 |
|
---|
93 |
/* Commands sent via RME_CTRL_FLASH values */ |
---|
94 |
#define RME_CTRL_FLASH_SETTINGS_LOAD 0x0000 |
---|
95 |
#define RME_CTRL_FLASH_SETTINGS_SAVE 0x0001 |
---|
96 |
#define RME_CTRL_FLASH_MIXER_LOAD 0x0002 |
---|
97 |
#define RME_CTRL_FLASH_MIXER_SAVE 0x0003 |
---|
98 |
|
---|
99 |
|
---|
100 |
class Device; |
---|
101 |
|
---|
102 |
class RmeSettingsCtrl |
---|
103 |
: public Control::Discrete |
---|
104 |
{ |
---|
105 |
public: |
---|
106 |
RmeSettingsCtrl(Device &parent, unsigned int type, unsigned int info); |
---|
107 |
RmeSettingsCtrl(Device &parent, unsigned int type, unsigned int info, |
---|
108 |
std::string name, std::string label, std::string descr); |
---|
109 |
virtual bool setValue(int v); |
---|
110 |
virtual int getValue(); |
---|
111 |
|
---|
112 |
virtual bool setValue(int idx, int v) { return setValue(v); }; |
---|
113 |
virtual int getValue(int idx) { return getValue(); }; |
---|
114 |
virtual int getMinimum() {return 0; }; |
---|
115 |
virtual int getMaximum() {return 0; }; |
---|
116 |
|
---|
117 |
protected: |
---|
118 |
Device &m_parent; |
---|
119 |
unsigned int m_type; |
---|
120 |
unsigned int m_value, m_info; |
---|
121 |
|
---|
122 |
}; |
---|
123 |
|
---|
124 |
class RmeSettingsMatrixCtrl |
---|
125 |
: public Control::MatrixMixer |
---|
126 |
{ |
---|
127 |
public: |
---|
128 |
RmeSettingsMatrixCtrl(Device &parent, unsigned int type); |
---|
129 |
RmeSettingsMatrixCtrl(Device &parent, unsigned int type, |
---|
130 |
std::string name); |
---|
131 |
|
---|
132 |
virtual void show(); |
---|
133 |
|
---|
134 |
bool hasNames() const { return true; } |
---|
135 |
bool canConnect() const { return false; } |
---|
136 |
|
---|
137 |
virtual std::string getRowName(const int row); |
---|
138 |
virtual std::string getColName(const int col); |
---|
139 |
virtual int canWrite( const int, const int ) { return true; } |
---|
140 |
virtual int getRowCount(); |
---|
141 |
virtual int getColCount(); |
---|
142 |
|
---|
143 |
virtual double setValue(const int row, const int col, const double val); |
---|
144 |
virtual double getValue(const int row, const int col); |
---|
145 |
|
---|
146 |
// functions to access the entire coefficient map at once |
---|
147 |
virtual bool getCoefficientMap(int &) {return false;}; |
---|
148 |
virtual bool storeCoefficientMap(int &) {return false;}; |
---|
149 |
|
---|
150 |
protected: |
---|
151 |
Device &m_parent; |
---|
152 |
unsigned int m_type; |
---|
153 |
}; |
---|
154 |
|
---|
155 |
} |
---|