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

Revision 575, 1.5 kB (checked in by ppalmers, 17 years ago)

- Fixed bug in dbus c++ bindings
- First attempt at a decoupled control interface. [WIP]


The src/libcontrol/* elements are the ones that should be
subclassed to implement control elements on the FFADODevice
side.

The tests/controlserver.* files contain some code that
interfaces the DBus calls to these libcontrol elements. The
DBus classes allow for introspection and path discovery,
such that we don't have to care about that anymore.

In the end it should be fairly easy to write another 'backend'
to replace the current DBus one, e.g. to implement OSC support
or MIDI support. (Should we ever want that)

Note that there is no connection between ffado and dbus yet,
this code is merely to experiment with the Control/DBus infra-
structure. Once that is sort-of working, connecting ffado to
this infrastructure is a matter of subclassing the Control::*
classes, creating them on discovery and putting them into one
Container::* that is passed on to the DBus handlers.

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 Contignous::Contignous()
29 : Element()
30 , m_Value( 0.0 )
31 {
32 }
33
34 Contignous::Contignous(std::string n)
35 : Element(n)
36 , m_Value( 0.0 )
37 {
38 }
39
40 void
41 Contignous::show()
42 {
43     debugOutput( DEBUG_LEVEL_NORMAL, "Contignous Element %s, value=%lf\n",
44         getName().c_str(), m_Value);
45 }
46
47 bool
48 Contignous::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 Contignous::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 } // namespace Control
Note: See TracBrowser for help on using the browser.