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

Revision 2802, 4.8 kB (checked in by jwoithe, 2 years ago)

Cosmetic: "Firewire" becomes "FireWire?".

Officially both the "F" and "W" were capitalised in the FireWire? name, so
reflect this throughout FFADO's source tree. This mostly affects comments.

This patch originated from pander on the ffado-devel mailing list. To
maintain consistency, the committed version has been expanded to include
files not originally included in the original patch.

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