root/trunk/libffado/src/fireworks/fireworks_control.h

Revision 666, 3.9 kB (checked in by ppalmers, 13 years ago)

add omitted files

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 FIREWORKS_MATRIX_CONTROL_H
26 #define FIREWORKS_MATRIX_CONTROL_H
27
28 #include "debugmodule/debugmodule.h"
29
30 #include "efc/efc_cmd.h"
31 #include "efc/efc_cmds_hardware.h"
32 #include "efc/efc_cmds_mixer.h"
33 #include "efc/efc_cmds_monitor.h"
34 #include "efc/efc_cmds_ioconfig.h"
35
36 #include "libcontrol/BasicElements.h"
37 #include "libcontrol/MatrixMixer.h"
38
39 #include <pthread.h>
40
41 class ConfigRom;
42 class Ieee1394Service;
43
44 namespace FireWorks {
45
46 class MonitorControl : public Control::MatrixMixer
47 {
48 public:
49     enum eMonitorControl {
50         eMC_Gain,
51         eMC_Solo,
52         eMC_Mute,
53         eMC_Pan,
54     };
55
56 public:
57     MonitorControl(FireWorks::Device& parent, enum eMonitorControl);
58     MonitorControl(FireWorks::Device& parent, enum eMonitorControl, std::string n);
59     virtual ~MonitorControl() {};
60
61     virtual void show();
62
63     virtual std::string getRowName( const int );
64     virtual std::string getColName( const int );
65     virtual int canWrite( const int, const int );
66     virtual double setValue( const int, const int, const double );
67     virtual double getValue( const int, const int );
68     virtual int getRowCount( );
69     virtual int getColCount( );
70
71 protected:
72     enum eMonitorControl        m_control;
73     FireWorks::Device&          m_Parent;
74 };
75
76
77 class SimpleControl : public Control::Continuous
78 {
79
80 public:
81     SimpleControl(FireWorks::Device& parent,
82                   enum eMixerTarget, enum eMixerCommand,
83                   int channel);
84     SimpleControl(FireWorks::Device& parent,
85                   enum eMixerTarget, enum eMixerCommand,
86                   int channel, std::string n);
87     virtual ~SimpleControl();
88
89     virtual void show();
90
91     virtual bool setValue( const double );
92     virtual double getValue( );
93
94 protected:
95     EfcGenericMixerCmd*         m_Slave;
96     FireWorks::Device&          m_Parent;
97 };
98
99 // for on-off type of controls
100
101 class BinaryControl : public Control::Discrete
102 {
103
104 public:
105     BinaryControl(FireWorks::Device& parent,
106                   enum eMixerTarget, enum eMixerCommand,
107                   int channel, int bit);
108     BinaryControl(FireWorks::Device& parent,
109                   enum eMixerTarget, enum eMixerCommand,
110                   int channel, int bit, std::string n);
111     virtual ~BinaryControl();
112
113     virtual void show();
114
115     virtual bool setValue( const int );
116     virtual int getValue( );
117
118 protected:
119     int                         m_bit;
120     EfcGenericMixerCmd*         m_Slave;
121     FireWorks::Device&          m_Parent;
122 };
123
124 // for on-off type of controls
125
126 class IOConfigControl : public Control::Discrete
127 {
128
129 public:
130     IOConfigControl(FireWorks::Device& parent,
131                     enum eIOConfigRegister);
132     IOConfigControl(FireWorks::Device& parent,
133                     enum eIOConfigRegister,
134                     std::string n);
135     virtual ~IOConfigControl();
136
137     virtual void show();
138
139     virtual bool setValue( const int );
140     virtual int getValue( );
141
142 protected:
143     int                         m_bit;
144     EfcGenericIOConfigCmd*      m_Slave;
145     FireWorks::Device&          m_Parent;
146 };
147
148 } // namespace FireWorks
149
150 #endif
Note: See TracBrowser for help on using the browser.