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

Revision 1726, 2.5 kB (checked in by arnonym, 14 years ago)

Access more switches of the pro24. Dim and Mute work, Mono-monitoring somehow doesn't (yet).

Line 
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 namespace Dice {
33 namespace Focusrite {
34
35 class SaffirePro24 : public Dice::Device {
36 public:
37     SaffirePro24( DeviceManager& d,
38                   std::auto_ptr<ConfigRom>( configRom ));
39     ~SaffirePro24();
40
41     bool discover();
42
43     void showDevice();
44
45     bool canChangeNickname() { return true; }
46     bool setNickName( std::string name );
47     std::string getNickName();
48
49     /**
50      * @brief A standard-switch for boolean.
51      *
52      * If you don't like True and False for the labels, subclass and return your own.
53     */
54     class Switch : public Control::Boolean
55     {
56     protected:
57         friend class Dice::Focusrite::SaffirePro24;
58
59         Switch(Dice::Device::EAP*, std::string name, size_t offset, int activevalue);
60     public:
61         bool selected();
62         bool select(bool);
63     private:
64         Dice::Device::EAP* m_eap;
65         bool m_selected;
66         size_t m_offset;
67         int m_activevalue;
68         fb_quadlet_t m_state_tmp;
69     };
70
71     class MonitorSection : public Control::Container
72     {
73     protected:
74         friend class Dice::Focusrite::SaffirePro24;
75
76         MonitorSection(Dice::Device::EAP*, std::string name);
77     private:
78         Dice::Device::EAP* m_eap;
79         Switch *m_mute, *m_dim;
80         std::vector<Switch*> m_mute_affected;
81         std::vector<Switch*> m_dim_affected;
82         std::vector<Switch*> m_mono;
83     };
84 private:
85     class LineInstSwitch;
86     LineInstSwitch *m_ch1, *m_ch2;
87     class LevelSwitch;
88     LevelSwitch *m_ch3, *m_ch4;
89     MonitorSection *m_monitor;
90 };
91
92 }
93 }
94
95 #endif
96 // vim: et
Note: See TracBrowser for help on using the browser.