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

Revision 649, 2.4 kB (checked in by ppalmers, 16 years ago)

split up the saffirepro device into a generic focusrite part and a saffirepro part. Add a class for the original saffire.

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);
43     BinaryControl(FocusriteDevice& parent, int id,
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 };
53
54 class VolumeControl
55     : public Control::Discrete
56 {
57 public:
58     VolumeControl(FocusriteDevice& parent, int id);
59     VolumeControl(FocusriteDevice& parent, int id,
60                   std::string name, std::string label, std::string descr);
61    
62     virtual bool setValue(int v);
63     virtual int getValue();
64    
65 private:
66     FocusriteDevice&       m_Parent;
67     unsigned int            m_cmd_id;
68 };
69
70
71 class FocusriteDevice : public BeBoB::AvDevice {
72 public:
73     FocusriteDevice( Ieee1394Service& ieee1394Service,
74               std::auto_ptr<ConfigRom>( configRom ));
75     virtual ~FocusriteDevice() {};
76
77     virtual void showDevice();
78     virtual void setVerboseLevel(int l);
79
80 public:
81     bool setSpecificValue(uint32_t id, uint32_t v);
82     bool getSpecificValue(uint32_t id, uint32_t *v);
83
84 protected:
85     int convertDefToSr( uint32_t def );
86     uint32_t convertSrToDef( int sr );
87 };
88
89 } // namespace Focusrite
90 } // namespace BeBoB
91
92 #endif
Note: See TracBrowser for help on using the browser.