root/trunk/libffado/src/dice/focusrite/saffire_pro14.h

Revision 2803, 4.4 kB (checked in by jwoithe, 3 years ago)

Cosmetic: capitalise "L" in "Linux".

"Linux" is a proper noun so it should start with a capital letter. These
changes are almost all within comments.

This patch was originally proposed by pander on the ffado-devel mailing
list. It has been expanded to cover all similar cases to maintain
consistency throughout the source tree.

Line 
1 /*
2  * Copyright (C) 2009 by Pieter Palmers
3  * Copyright (C) 2012 by Philippe Carriere
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_PRO14_H
26 #define DICE_FOCUSRITE_SAFFIRE_PRO14_H
27
28 #include "dice/dice_avdevice.h"
29
30 #include "libieee1394/configrom.h"
31
32 #include "focusrite_eap.h"
33
34 /**
35  *  Saffire Pro14 application space
36  *    Informations kindly provided by Focusrite support
37  */
38 // Versioning registers
39 #define SAFFIRE_PRO14_REGISTER_APP_VERSION 0x00
40 #define SAFFIRE_PRO14_REGISTER_APP_RELEASE 0x04
41 #define SAFFIRE_PRO14_REGISTER_APP_BUILDNR 0x08
42
43 // Nickname register
44 #define SAFFIRE_PRO14_REGISTER_APP_NICK_NAME 0x44
45 // NOTE: in bytes
46 #define SAFFIRE_PRO14_APP_NICK_NAME_SIZE 16
47
48 // Global monitor registers (application space)
49 #define SAFFIRE_PRO14_REGISTER_APP_GLOBAL_MUTE_SWITCH 0x10
50 #define SAFFIRE_PRO14_REGISTER_APP_GLOBAL_DIM_SWITCH  0x14
51 #define SAFFIRE_PRO14_REGISTER_APP_GLOBAL_DIM_VOLUME 0x58
52 #define SAFFIRE_PRO14_REGISTER_APP_GLOBAL_MONITOR_VOLUME 0x54
53
54 // Per line/out monitor volume and switches: registers are expected to be one after the other
55 //  each register controlling two output lines
56 // This is indeed the number of analog output controlled by the monitor
57 #define SAFFIRE_PRO14_APP_STEREO_LINEOUT_SIZE 2
58
59 // Volume and switch monitor register
60 #define SAFFIRE_PRO14_REGISTER_APP_LINEOUT_MONITOR_VOLUME 0x18
61 #define SAFFIRE_PRO14_REGISTER_APP_LINEOUT_MONITOR_SWITCH 0x2C
62
63 // Switch control (per line/out mute, dim and mono)
64 #define SAFFIRE_PRO14_REGISTER_APP_LINEOUT_SWITCH_CONTROL 0x40
65
66 // Message set
67 //   The location of the message register and the values for each setting
68 #define SAFFIRE_PRO14_REGISTER_APP_MESSAGE_SET 0x0C
69 #define SAFFIRE_PRO14_MESSAGE_SET_NO_MESSAGE 0
70 #define SAFFIRE_PRO14_MESSAGE_SET_LINEOUT_MONITOR_VOLUME 1
71 #define SAFFIRE_PRO14_MESSAGE_SET_GLOBAL_DIM_MUTE_SWITCH 2
72 #define SAFFIRE_PRO14_MESSAGE_SET_LINEOUT_SWITCH_CONTROL 3
73 #define SAFFIRE_PRO14_MESSAGE_SET_INSTLINE 4
74 #define SAFFIRE_PRO14_MESSAGE_SET_MESSAGE_END 5
75
76 // Standalone
77 #define SAFFIRE_PRO14_REGISTER_STANDALONE_SWITCH 0x64
78 #define SAFFIRE_PRO14_REGISTER_STANDALONE_SRC_SMPL 0x68 // Automatically stored
79
80 // Inst/Line and Hi/Lo gain control
81 //  each register controls two (mono) output lines
82 #define SAFFIRE_PRO14_REGISTER_APP_LINEOUT_INST_SWITCH 0x5C
83 #define SAFFIRE_PRO14_LINEOUT_SWITCH_INST_NUMBER 1
84 #define SAFFIRE_PRO14_LINEOUT_SWITCH_INST_VALUE 2
85 #define SAFFIRE_PRO14_REGISTER_APP_LINEOUT_GAIN_SWITCH 0x60
86 #define SAFFIRE_PRO14_LINEOUT_SWITCH_GAIN_NUMBER 1
87 #define SAFFIRE_PRO14_LINEOUT_SWITCH_GAIN_VALUE 1
88
89 namespace Dice {
90 namespace Focusrite {
91
92 class SaffirePro14 : public Dice::Device {
93 public:
94     SaffirePro14( DeviceManager& d,
95                   ffado_smartptr<ConfigRom>( configRom ));
96     virtual ~SaffirePro14();
97
98     bool discover();
99
100     virtual void showDevice();
101
102     bool canChangeNickname() { return true; }
103     bool setNickname(std::string);
104     std::string getNickname();
105
106 private:
107
108     class SaffirePro14EAP : public FocusriteEAP
109     {
110     public:
111         SaffirePro14EAP(Dice::Device& dev) : FocusriteEAP(dev) {
112         }
113
114         void setupSources_low();
115         void setupDestinations_low();
116         void setupSources_mid();
117         void setupDestinations_mid();
118         void setupSources_high();
119         void setupDestinations_high();
120         void setupDefaultRouterConfig_low();
121         void setupDefaultRouterConfig_mid();
122         void setupDefaultRouterConfig_high();
123
124         class MonitorSection : public Control::Container
125         {
126         public:
127           MonitorSection(Dice::Focusrite::FocusriteEAP*, std::string);
128         private:
129           Dice::Focusrite::FocusriteEAP* m_eap;
130         };
131     };
132     Dice::EAP* createEAP();
133
134 };
135
136 }
137 }
138
139 #endif
140 // vim: et
Note: See TracBrowser for help on using the browser.