1 |
/* |
---|
2 |
* Copyright (C) 2009 by Pieter Palmers |
---|
3 |
* Copyright (C) 2009 by Arnold Krille |
---|
4 |
* |
---|
5 |
* This file is part of FFADO |
---|
6 |
* FFADO = Free Firewire (pro-)audio drivers for linux |
---|
7 |
* |
---|
8 |
* FFADO is based upon FreeBoB. |
---|
9 |
* |
---|
10 |
* This program is free software: you can redistribute it and/or modify |
---|
11 |
* it under the terms of the GNU General Public License as published by |
---|
12 |
* the Free Software Foundation, either version 2 of the License, or |
---|
13 |
* (at your option) version 3 of the License. |
---|
14 |
* |
---|
15 |
* This program is distributed in the hope that it will be useful, |
---|
16 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
17 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
18 |
* GNU General Public License for more details. |
---|
19 |
* |
---|
20 |
* You should have received a copy of the GNU General Public License |
---|
21 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
22 |
* |
---|
23 |
*/ |
---|
24 |
|
---|
25 |
#ifndef DICE_FOCUSRITE_SAFFIRE_PRO24_H |
---|
26 |
#define DICE_FOCUSRITE_SAFFIRE_PRO24_H |
---|
27 |
|
---|
28 |
#include "dice/dice_avdevice.h" |
---|
29 |
|
---|
30 |
#include "libieee1394/configrom.h" |
---|
31 |
|
---|
32 |
#include "focusrite_eap.h" |
---|
33 |
|
---|
34 |
/** |
---|
35 |
* Saffire Pro24 application space |
---|
36 |
*/ |
---|
37 |
// Versioning registers |
---|
38 |
#define SAFFIRE_PRO24_REGISTER_APP_VERSION 0x00 |
---|
39 |
#define SAFFIRE_PRO24_REGISTER_APP_RELEASE 0x04 |
---|
40 |
#define SAFFIRE_PRO24_REGISTER_APP_BUILDNR 0x08 |
---|
41 |
|
---|
42 |
// Nickname register |
---|
43 |
#define SAFFIRE_PRO24_REGISTER_APP_NICK_NAME 0x40 |
---|
44 |
// NOTE: in bytes |
---|
45 |
#define SAFFIRE_PRO24_APP_NICK_NAME_SIZE 16 |
---|
46 |
|
---|
47 |
// Global monitor registers (application space) |
---|
48 |
#define SAFFIRE_PRO24_REGISTER_APP_GLOBAL_MUTE_SWITCH 0x0C |
---|
49 |
#define SAFFIRE_PRO24_REGISTER_APP_GLOBAL_DIM_SWITCH 0x10 |
---|
50 |
#define SAFFIRE_PRO24_REGISTER_APP_GLOBAL_DIM_VOLUME 0x54 |
---|
51 |
#define SAFFIRE_PRO24_REGISTER_APP_GLOBAL_MONITOR_VOLUME 0x50 |
---|
52 |
|
---|
53 |
// Per line/out monitor volume and switches: registers are expected to be one after the other |
---|
54 |
// each register controlling two output lines |
---|
55 |
// The whole number of physical analog output is thus 2*SAFFIRE_PRO24_APP_STEREO_LINEOUT_SIZE |
---|
56 |
#define SAFFIRE_PRO24_APP_STEREO_LINEOUT_SIZE 3 |
---|
57 |
|
---|
58 |
// Volume and switch monitor register |
---|
59 |
#define SAFFIRE_PRO24_REGISTER_APP_LINEOUT_MONITOR_VOLUME 0x14 |
---|
60 |
#define SAFFIRE_PRO24_REGISTER_APP_LINEOUT_MONITOR_SWITCH 0x28 |
---|
61 |
|
---|
62 |
// Switch control (per line/out mute, dim and mono) |
---|
63 |
#define SAFFIRE_PRO24_REGISTER_APP_LINEOUT_SWITCH_CONTROL 0x3C |
---|
64 |
|
---|
65 |
// Message set |
---|
66 |
// The location of the message register and the values for each setting |
---|
67 |
#define SAFFIRE_PRO24_REGISTER_APP_MESSAGE_SET 0x68 |
---|
68 |
#define SAFFIRE_PRO24_MESSAGE_SET_NO_MESSAGE 0 |
---|
69 |
#define SAFFIRE_PRO24_MESSAGE_SET_LINEOUT_MONITOR_VOLUME 1 |
---|
70 |
#define SAFFIRE_PRO24_MESSAGE_SET_GLOBAL_DIM_MUTE_SWITCH 2 |
---|
71 |
#define SAFFIRE_PRO24_MESSAGE_SET_LINEOUT_SWITCH_CONTROL 3 |
---|
72 |
#define SAFFIRE_PRO24_MESSAGE_SET_INSTLINE 4 |
---|
73 |
#define SAFFIRE_PRO24_MESSAGE_SET_MESSAGE_END 5 |
---|
74 |
|
---|
75 |
// Standalone |
---|
76 |
#define SAFFIRE_PRO24_REGISTER_STANDALONE_SWITCH 0x60 |
---|
77 |
#define SAFFIRE_PRO24_REGISTER_STANDALONE_SRC_SMPL 0x64 // Automatically stored |
---|
78 |
|
---|
79 |
// Inst/Line and Hi/Lo gain control |
---|
80 |
// each register controls two (mono) output lines |
---|
81 |
#define SAFFIRE_PRO24_REGISTER_APP_LINEOUT_INST_SWITCH 0x58 |
---|
82 |
#define SAFFIRE_PRO24_LINEOUT_SWITCH_INST_NUMBER 1 |
---|
83 |
#define SAFFIRE_PRO24_LINEOUT_SWITCH_INST_VALUE 2 |
---|
84 |
#define SAFFIRE_PRO24_REGISTER_APP_LINEOUT_GAIN_SWITCH 0x5C |
---|
85 |
#define SAFFIRE_PRO24_LINEOUT_SWITCH_GAIN_NUMBER 1 |
---|
86 |
#define SAFFIRE_PRO24_LINEOUT_SWITCH_GAIN_VALUE 1 |
---|
87 |
|
---|
88 |
namespace Dice { |
---|
89 |
namespace Focusrite { |
---|
90 |
|
---|
91 |
class SaffirePro24 : public Dice::Device { |
---|
92 |
public: |
---|
93 |
SaffirePro24( DeviceManager& d, |
---|
94 |
ffado_smartptr<ConfigRom>( configRom )); |
---|
95 |
~SaffirePro24(); |
---|
96 |
|
---|
97 |
bool discover(); |
---|
98 |
|
---|
99 |
void showDevice(); |
---|
100 |
|
---|
101 |
bool canChangeNickname() { return true; } |
---|
102 |
bool setNickname( std::string name ); |
---|
103 |
std::string getNickname(); |
---|
104 |
|
---|
105 |
private: |
---|
106 |
|
---|
107 |
class SaffirePro24EAP : public FocusriteEAP |
---|
108 |
{ |
---|
109 |
public: |
---|
110 |
SaffirePro24EAP(Dice::Device& dev) : FocusriteEAP(dev) { |
---|
111 |
} |
---|
112 |
|
---|
113 |
void setupSources_low(); |
---|
114 |
void setupDestinations_low(); |
---|
115 |
void setupSources_mid(); |
---|
116 |
void setupDestinations_mid(); |
---|
117 |
void setupSources_high(); |
---|
118 |
void setupDestinations_high(); |
---|
119 |
void setupDefaultRouterConfig_low(); |
---|
120 |
void setupDefaultRouterConfig_mid(); |
---|
121 |
void setupDefaultRouterConfig_high(); |
---|
122 |
|
---|
123 |
class MonitorSection : public Control::Container |
---|
124 |
{ |
---|
125 |
public: |
---|
126 |
MonitorSection(Dice::Focusrite::FocusriteEAP*, std::string); |
---|
127 |
private: |
---|
128 |
Dice::Focusrite::FocusriteEAP* m_eap; |
---|
129 |
}; |
---|
130 |
}; |
---|
131 |
Dice::EAP* createEAP(); |
---|
132 |
|
---|
133 |
}; |
---|
134 |
|
---|
135 |
} |
---|
136 |
} |
---|
137 |
|
---|
138 |
#endif |
---|
139 |
// vim: et |
---|