root/trunk/libffado/tests/controlserver.h

Revision 582, 2.8 kB (checked in by ppalmers, 15 years ago)

see prev commit

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  * FFADO 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) any later version.
13  * FFADO 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
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with FFADO; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21  * MA 02111-1307 USA.
22  *
23  */
24
25 #ifndef CONTROLSERVER_H
26 #define CONTROLSERVER_H
27
28 #include "debugmodule/debugmodule.h"
29
30 #include <dbus-c++/dbus.h>
31
32 #include "controlserver-glue.h"
33
34 #include "libcontrol/BasicElements.h"
35
36 namespace DBusControl {
37
38 class Element
39 : public org::ffado::Control::Element::Element
40 , public DBus::IntrospectableAdaptor
41 , public DBus::ObjectAdaptor
42 {
43 public:
44
45     Element( DBus::Connection& connection,
46              std::string p,
47              Control::Element &slave );
48
49     DBus::UInt64 getId( );
50     DBus::String getName( );
51     DBus::String getLabel( );
52     DBus::String getDescription( );
53
54 private:
55     Control::Element &m_Slave;
56
57 protected:
58     DECLARE_DEBUG_MODULE;
59 };
60 typedef std::vector<Element *> ElementVector;
61 typedef std::vector<Element *>::iterator ElementVectorIterator;
62 typedef std::vector<Element *>::const_iterator ConstElementVectorIterator;
63
64 class Container
65 : public org::ffado::Control::Element::Container
66 , public Element
67 {
68 public:
69     Container( DBus::Connection& connection,
70                   std::string p,
71                   Control::Container &slave );
72     virtual ~Container();
73    
74     Element *createHandler(Control::Element& e);
75 private:
76     Control::Container &m_Slave;
77     ElementVector m_Children;
78 };
79
80 class Continuous
81 : public org::ffado::Control::Element::Continuous
82 , public Element
83 {
84 public:
85     Continuous( DBus::Connection& connection,
86                   std::string p,
87                   Control::Continuous &slave );
88    
89     DBus::Double setValue( const DBus::Double & value );
90     DBus::Double getValue( );
91
92 private:
93     Control::Continuous &m_Slave;
94 };
95
96 class Discrete
97 : public org::ffado::Control::Element::Discrete
98 , public Element
99 {
100 public:
101     Discrete( DBus::Connection& connection,
102                   std::string p,
103                   Control::Discrete &slave );
104    
105     DBus::Int32 setValue( const DBus::Int32 & value );
106     DBus::Int32 getValue( );
107
108 private:
109     Control::Discrete &m_Slave;
110 };
111
112
113 }
114
115 #endif // CONTROLSERVER_H
Note: See TracBrowser for help on using the browser.