root/trunk/libffado/src/libcontrol/BasicElements.cpp

Revision 581, 2.1 kB (checked in by ppalmers, 13 years ago)

- First attempt at mixer control (still disfunctional)
- moved vendor specific code in bebob/*

Line 
1 /*
2  * Copyright (C) 2007 by Pieter Palmers
3  *
4  * This file is part of FFADO
5  * FFADO = Free Firewire (pro-)audio drivers for linux
6  *
7  * FFADO is based upon FreeBoB
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License version 2.1, as published by the Free Software Foundation;
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21  * MA 02110-1301 USA
22  */
23
24 #include "BasicElements.h"
25
26 namespace Control {
27
28 Continuous::Continuous()
29 : Element()
30 , m_Value( 0.0 )
31 {
32 }
33
34 Continuous::Continuous(std::string n)
35 : Element(n)
36 , m_Value( 0.0 )
37 {
38 }
39
40 void
41 Continuous::show()
42 {
43     debugOutput( DEBUG_LEVEL_NORMAL, "Continuous Element %s, value=%lf\n",
44         getName().c_str(), m_Value);
45 }
46
47 bool
48 Continuous::setValue(double v)
49 {
50     debugOutput( DEBUG_LEVEL_VERBOSE, "%s setValue(%lf)\n",
51         getName().c_str(), v);
52    
53     m_Value=v;
54     return true;
55 }
56
57 double
58 Continuous::getValue()
59 {
60     debugOutput( DEBUG_LEVEL_VERBOSE, "%s getValue()=%lf\n",
61         getName().c_str(), m_Value);
62    
63     return m_Value;
64 }
65
66 //// ---
67
68 Discrete::Discrete()
69 : Element()
70 , m_Value( 0 )
71 {
72 }
73
74 Discrete::Discrete(std::string n)
75 : Element(n)
76 , m_Value( 0 )
77 {
78 }
79
80 void
81 Discrete::show()
82 {
83     debugOutput( DEBUG_LEVEL_NORMAL, "Discrete Element %s, value=%d\n",
84         getName().c_str(), m_Value);
85 }
86
87 bool
88 Discrete::setValue(int v)
89 {
90     debugOutput( DEBUG_LEVEL_VERBOSE, "%s setValue(%d)\n",
91         getName().c_str(), v);
92    
93     m_Value=v;
94     return true;
95 }
96
97 int
98 Discrete::getValue()
99 {
100     debugOutput( DEBUG_LEVEL_VERBOSE, "%s getValue()=%d\n",
101         getName().c_str(), m_Value);
102    
103     return m_Value;
104 }
105
106 } // namespace Control
Note: See TracBrowser for help on using the browser.