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

Revision 624, 3.0 kB (checked in by ppalmers, 15 years ago)

some more experiments regarding setting the samplerate on the 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_DEVICE_H
26 #define BEBOB_FOCUSRITE_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 SaffireProDevice;
37
38 class BinaryControl
39     : public Control::Discrete
40 {
41 public:
42     BinaryControl(SaffireProDevice& parent, int id);
43     BinaryControl(SaffireProDevice& 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     SaffireProDevice&       m_Parent;
51     unsigned int            m_cmd_id;
52 };
53
54 class VolumeControl
55     : public Control::Discrete
56 {
57 public:
58     VolumeControl(SaffireProDevice& parent, int id);
59     VolumeControl(SaffireProDevice& 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     SaffireProDevice&       m_Parent;
67     unsigned int            m_cmd_id;
68 };
69
70
71 class SaffireProDevice : public BeBoB::AvDevice {
72 public:
73     SaffireProDevice( Ieee1394Service& ieee1394Service,
74               std::auto_ptr<ConfigRom>( configRom ));
75     virtual ~SaffireProDevice();
76
77     virtual void showDevice();
78     virtual void setVerboseLevel(int l);
79
80     virtual bool setSamplingFrequency( int );
81     virtual int getSamplingFrequency( );
82
83 public:
84     bool setSpecificValue(uint32_t id, uint32_t v);
85     bool getSpecificValue(uint32_t id, uint32_t *v);
86
87 private:
88     virtual bool setSamplingFrequencyDo( int );
89     virtual int getSamplingFrequencyMirror( );
90     int convertDefToSr( uint32_t def );
91     uint32_t convertSrToDef( int sr );
92
93     BinaryControl * m_Phantom1;
94     BinaryControl * m_Phantom2;
95    
96     BinaryControl * m_Insert1;
97     BinaryControl * m_Insert2;
98     BinaryControl * m_AC3pass;
99     BinaryControl * m_MidiTru;
100    
101     VolumeControl * m_Output12[4];
102     VolumeControl * m_Output34[6];
103     VolumeControl * m_Output56[6];
104     VolumeControl * m_Output78[6];
105     VolumeControl * m_Output910[6];
106    
107 };
108
109 } // namespace Focusrite
110 } // namespace BeBoB
111
112 #endif
Note: See TracBrowser for help on using the browser.