root/trunk/libffado/src/dice/presonus/firestudio_mobile.cpp

Revision 2803, 5.1 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  * Copyright (C) 2014 by Philippe Carriere
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 "firestudio_mobile.h"
27
28 namespace Dice {
29 namespace Presonus {
30
31 //
32 // Firestudio Mobile has
33 //  - 2 mic/inst inputs
34 //  - 6 line inputs
35 //  - 2 SPDIF inputs
36 //  - 6 ieee1394 inputs
37 //  - 18 mixer inputs
38 //
39 //  - 4 analogic line outputs (stereo main, stereo phone)
40 //  - 2 SPDIF outputs
41 //  - 10 ieee1394 outputs
42 //  - 16 mixer outputs
43 //
44 void FirestudioMobile::FirestudioMobileEAP::setupSources_low() {
45     addSource("SPDIF/In",  2,  2, eRS_AES, 1);
46     addSource("Mic/Inst/In", 0,  2, eRS_InS0, 1);
47     addSource("Lin/In", 2,  6, eRS_InS0, 3);
48     addSource("Mixer/Out",  0, 16, eRS_Mixer, 1);
49     addSource("1394/In",   0, 6, eRS_ARX0, 1);
50     addSource("Mute",   0,  1, eRS_Muted);
51 }
52
53 void FirestudioMobile::FirestudioMobileEAP::setupDestinations_low() {
54     addDestination("SPDIF/Out",  2,  2, eRD_AES, 1);
55     addDestination("Line/Out", 0,  4, eRD_InS0, 1);
56     addDestination("Mixer/In",  0, 16, eRD_Mixer0, 1);
57     addDestination("Mixer/In",  0,  2, eRD_Mixer1, 17);
58     addDestination("1394/Out",   0, 10, eRD_ATX0, 1);
59 // Is a Mute destination useful ?
60 //    addDestination("Mute",   0,  1, eRD_Muted);
61 }
62
63 //
64 // Independent of samplerate
65 void FirestudioMobile::FirestudioMobileEAP::setupSources_mid() {
66     setupSources_low();
67 }
68
69 void FirestudioMobile::FirestudioMobileEAP::setupDestinations_mid() {
70     setupDestinations_low();
71 }
72
73 //
74 // 192 kHz is not supported
75 //
76 void FirestudioMobile::FirestudioMobileEAP::setupSources_high() {
77     printMessage("High (192 kHz) sample rate not supported by Firestudio Tube\n");
78 }
79
80 void FirestudioMobile::FirestudioMobileEAP::setupDestinations_high() {
81     printMessage("High (192 kHz) sample rate not supported by Firestudio Tube\n");
82 }
83
84 /**
85  * The default configuration for the Firestudio Mobile.
86  * 82 destinations; each "group" every 32 registers
87  **FIXME What follows is extracted from a listing of an existing router configuration.
88  *       However, the origin of such a router configuration was unknown.
89  */
90 void
91 FirestudioMobile::FirestudioMobileEAP::setupDefaultRouterConfig_low() {
92     unsigned int i;
93     // the 1394 stream receivers
94     for (i=0; i<8; i++) {
95         addRoute(eRS_InS0, i, eRD_ATX0, i);
96     }
97     for (i=0; i<2; i++) {
98         addRoute(eRS_AES, i+2, eRD_ATX0, i+8);
99     }
100     // Then 22 muted destinations
101     for (i=0; i<22; i++) {
102         addRoute(eRS_Muted, 0, eRD_Muted, 0);
103     }
104    
105     // the Mixer inputs
106     for (i=0; i<8; i++) {
107         addRoute(eRS_InS0, i, eRD_Mixer0, i);
108     }
109     for (i=0; i<2; i++) {
110         addRoute(eRS_AES, i+2, eRD_Mixer0, i+8);
111     }
112     for (i=0; i<6; i++) {
113         addRoute(eRS_ARX0, i, eRD_Mixer0, i+10);
114     }
115     // Then 16 muted destinations
116     for (i=0; i<16; i++) {
117         addRoute(eRS_Muted, 0, eRD_Muted, 0);
118     }
119
120     // The audio ports
121     // Ensure that audio port are not muted
122     for (i=0; i<4; i++) {
123         addRoute(eRS_Mixer, i, eRD_InS0, i);
124     }
125     // The SPDIF ports
126     for (i=0; i<2; i++) {
127         addRoute(eRS_Mixer, i+4, eRD_AES, i+2);
128     }
129     // Then 12 muted destinations
130     for (i=0; i<12; i++) {
131         addRoute(eRS_Muted, 0, eRD_Muted, 0);
132     } 
133 }
134
135 /**
136  *  Identical to mid-rate
137  */
138 void
139 FirestudioMobile::FirestudioMobileEAP::setupDefaultRouterConfig_mid() {
140     setupDefaultRouterConfig_low();
141 }
142
143 /**
144  *  High rate not supported
145  */
146 void
147 FirestudioMobile::FirestudioMobileEAP::setupDefaultRouterConfig_high() {
148     printMessage("High (192 kHz) sample rate not supported by Firestudio Mobile\n");
149 }
150
151
152 /**
153   Device
154 */
155 FirestudioMobile::FirestudioMobile( DeviceManager& d,
156                                     ffado_smartptr<ConfigRom>( configRom ))
157     : Dice::Device( d , configRom)
158 {
159     debugOutput( DEBUG_LEVEL_VERBOSE, "Created Dice::Presonus::FirestudioMobile (NodeID %d)\n",
160                  getConfigRom().getNodeId() );
161 }
162
163 FirestudioMobile::~FirestudioMobile()
164 {
165     getEAP()->storeFlashConfig();
166 }
167
168 bool FirestudioMobile::discover() {
169     if (Dice::Device::discover()) {
170         debugOutput(DEBUG_LEVEL_VERBOSE, "Discovering Dice::Presonus::FirestudioMobile\n");
171         return true;
172     }
173     return false;
174 }
175
176 void
177 FirestudioMobile::showDevice()
178 {
179     debugOutput(DEBUG_LEVEL_VERBOSE, "This is a Dice::Presonus::FirestudioMobile\n");
180     Dice::Device::showDevice();
181 }
182
183 Dice::EAP* FirestudioMobile::createEAP() {
184     return new FirestudioMobileEAP(*this);
185 }
186
187 }
188 }
189 // vim: et
Note: See TracBrowser for help on using the browser.