1 |
/* |
---|
2 |
* Copyright (C) 2005-2008 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 program is free software: you can redistribute it and/or modify |
---|
10 |
* it under the terms of the GNU General Public License as published by |
---|
11 |
* the Free Software Foundation, either version 2 of the License, or |
---|
12 |
* (at your option) version 3 of the License. |
---|
13 |
* |
---|
14 |
* This program 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 |
---|
17 |
* GNU General Public License for more details. |
---|
18 |
* |
---|
19 |
* You should have received a copy of the GNU General Public License |
---|
20 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
21 |
* |
---|
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 |
---|