root/branches/ppalmers-streaming/support/dbus/controlserver.h

Revision 730, 4.1 kB (checked in by ppalmers, 13 years ago)

- Remove OSC related code
- create DBus server application
- add "scons debian" target that builds a debian package

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 #include "libieee1394/configrom.h"
36
37 namespace Control {
38     class MatrixMixer;
39 };
40
41 namespace DBusControl {
42
43 class Element
44 : public org::ffado::Control::Element::Element
45 , public DBus::IntrospectableAdaptor
46 , public DBus::ObjectAdaptor
47 {
48 public:
49
50     Element( DBus::Connection& connection,
51              std::string p,
52              Control::Element &slave );
53
54     DBus::UInt64 getId( );
55     DBus::String getName( );
56     DBus::String getLabel( );
57     DBus::String getDescription( );
58
59 private:
60     Control::Element &m_Slave;
61
62 protected:
63     DECLARE_DEBUG_MODULE;
64 };
65 typedef std::vector<Element *> ElementVector;
66 typedef std::vector<Element *>::iterator ElementVectorIterator;
67 typedef std::vector<Element *>::const_iterator ConstElementVectorIterator;
68
69 class Container
70 : public org::ffado::Control::Element::Container
71 , public Element
72 {
73 public:
74     Container( DBus::Connection& connection,
75                   std::string p,
76                   Control::Container &slave );
77     virtual ~Container();
78    
79     Element *createHandler(Control::Element& e);
80
81     DBus::Int32 getNbElements( );
82     DBus::String getElementName( const DBus::Int32& );
83
84 private:
85     Control::Container &m_Slave;
86     ElementVector m_Children;
87 };
88
89 class Continuous
90 : public org::ffado::Control::Element::Continuous
91 , public Element
92 {
93 public:
94     Continuous( DBus::Connection& connection,
95                   std::string p,
96                   Control::Continuous &slave );
97    
98     DBus::Double setValue( const DBus::Double & value );
99     DBus::Double getValue( );
100
101 private:
102     Control::Continuous &m_Slave;
103 };
104
105 class Discrete
106 : public org::ffado::Control::Element::Discrete
107 , public Element
108 {
109 public:
110     Discrete( DBus::Connection& connection,
111                   std::string p,
112                   Control::Discrete &slave );
113    
114     DBus::Int32 setValue( const DBus::Int32 & value );
115     DBus::Int32 getValue( );
116
117 private:
118     Control::Discrete &m_Slave;
119 };
120
121 // FIXME: to change this to a normal ConfigRom class name we have to
122 // put the 1394 config rom class into a separate namespace.
123 class ConfigRomX
124 : public org::ffado::Control::Element::ConfigRomX
125 , public Element
126 {
127 public:
128     ConfigRomX( DBus::Connection& connection,
129                   std::string p,
130                   ConfigRom &slave );
131
132     DBus::String getGUID( );
133     DBus::String getVendorName( );
134     DBus::String getModelName( );
135     DBus::Int32 getVendorId( );
136     DBus::Int32 getModelId( );
137
138 private:
139     ConfigRom &m_Slave;
140 };
141
142 class MatrixMixer
143 : public org::ffado::Control::Element::MatrixMixer
144 , public Element
145 {
146 public:
147     MatrixMixer(  DBus::Connection& connection,
148                   std::string p,
149                   Control::MatrixMixer &slave );
150
151     DBus::String getRowName( const DBus::Int32& );
152     DBus::String getColName( const DBus::Int32& );
153     DBus::Int32 canWrite( const DBus::Int32&, const DBus::Int32& );
154     DBus::Double setValue( const DBus::Int32&, const DBus::Int32&, const DBus::Double& );
155     DBus::Double getValue( const DBus::Int32&, const DBus::Int32& );
156     DBus::Int32 getRowCount( );
157     DBus::Int32 getColCount( );
158
159 private:
160     Control::MatrixMixer &m_Slave;
161 };
162
163 }
164
165 #endif // CONTROLSERVER_H
Note: See TracBrowser for help on using the browser.