root/trunk/libffado/src/bebob/focusrite/focusrite_generic.h

Revision 661, 2.5 kB (checked in by ppalmers, 16 years ago)

- Implement more complete mixer support for the saffire pro
- fix some cleanup issues with control elements

Line 
1 /*
2  * Copyright (C) 2005-2007 by Daniel Wagner
3  * Copyright (C) 2005-2007 by Pieter Palmers
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 library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License version 2.1, as published by the Free Software Foundation;
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22  * MA 02110-1301 USA
23  */
24
25 #ifndef BEBOB_FOCUSRITE_GENERIC_DEVICE_H
26 #define BEBOB_FOCUSRITE_GENERIC_DEVICE_H
27
28 #include "debugmodule/debugmodule.h"
29 #include "bebob/bebob_avdevice.h"
30
31 #include "libcontrol/BasicElements.h"
32
33 namespace BeBoB {
34 namespace Focusrite {
35
36 class FocusriteDevice;
37
38 class BinaryControl
39     : public Control::Discrete
40 {
41 public:
42     BinaryControl(FocusriteDevice& parent, int id, int bit);
43     BinaryControl(FocusriteDevice& parent, int id, int bit,
44                   std::string name, std::string label, std::string descr);
45    
46     virtual bool setValue(int v);
47     virtual int getValue();
48    
49 private:
50     FocusriteDevice&       m_Parent;
51     unsigned int            m_cmd_id;
52     unsigned int            m_cmd_bit;
53 };
54
55 class VolumeControl
56     : public Control::Discrete
57 {
58 public:
59     VolumeControl(FocusriteDevice& parent, int id);
60     VolumeControl(FocusriteDevice& parent, int id,
61                   std::string name, std::string label, std::string descr);
62    
63     virtual bool setValue(int v);
64     virtual int getValue();
65    
66 private:
67     FocusriteDevice&       m_Parent;
68     unsigned int            m_cmd_id;
69 };
70
71
72 class FocusriteDevice : public BeBoB::AvDevice {
73 public:
74     FocusriteDevice( Ieee1394Service& ieee1394Service,
75               std::auto_ptr<ConfigRom>( configRom ));
76     virtual ~FocusriteDevice() {};
77
78     virtual void showDevice();
79     virtual void setVerboseLevel(int l);
80
81 public:
82     bool setSpecificValue(uint32_t id, uint32_t v);
83     bool getSpecificValue(uint32_t id, uint32_t *v);
84
85 protected:
86     int convertDefToSr( uint32_t def );
87     uint32_t convertSrToDef( int sr );
88 };
89
90 } // namespace Focusrite
91 } // namespace BeBoB
92
93 #endif
Note: See TracBrowser for help on using the browser.