root/branches/libffado-2.0/support/dbus/controlserver.cpp

Revision 1385, 20.6 kB (checked in by ppalmers, 12 years ago)

Implement a mechanism to disable the samplerate and clock source controls while the device is streaming in order to avoid changes that could mess up jack. The saffire pro controls that cause a device reset to
happen are also disabled while streaming is active.

Line 
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 "controlserver.h"
25 #include "libcontrol/Element.h"
26 #include "libcontrol/BasicElements.h"
27 #include "libcontrol/MatrixMixer.h"
28 #include "libutil/Time.h"
29 #include "libutil/PosixMutex.h"
30
31 namespace DBusControl {
32
33 IMPL_DEBUG_MODULE( Element, Element, DEBUG_LEVEL_NORMAL );
34
35 // --- Element
36 Element::Element( DBus::Connection& connection, std::string p, Element* parent, Control::Element &slave)
37 : DBus::ObjectAdaptor(connection, p)
38 , m_Parent(parent)
39 , m_Slave(slave)
40 , m_UpdateLock( NULL )
41 {
42     debugOutput( DEBUG_LEVEL_VERBOSE, "Created Element on '%s'\n",
43                  path().c_str() );
44     // allocate a lock
45     if(parent == NULL) {
46         m_UpdateLock = new Util::PosixMutex("CTLSVEL");
47     } else {
48         m_UpdateLock = NULL;
49     }
50     // set verbose level AFTER allocating the lock
51     setVerboseLevel(m_Slave.getVerboseLevel());
52 }
53
54 void Element::setVerboseLevel( const DBus::Int32 &i)
55 {
56     setDebugLevel(i);
57     m_Slave.setVerboseLevel(i);
58     if(m_UpdateLock) m_UpdateLock->setVerboseLevel(i);
59 }
60
61 DBus::Int32 Element::getVerboseLevel()
62 {
63     return getDebugLevel();
64 }
65
66 DBus::Bool
67 Element::canChangeValue()
68 {
69     return m_Slave.canChangeValue();
70 }
71
72 void
73 Element::Lock()
74 {
75     if(m_Parent) {
76         m_Parent->Lock();
77     } else {
78         m_UpdateLock->Lock();
79     }
80 }
81
82 void
83 Element::Unlock()
84 {
85     if(m_Parent) {
86         m_Parent->Unlock();
87     } else {
88         m_UpdateLock->Unlock();
89     }
90 }
91
92 Util::Mutex*
93 Element::getLock()
94 {
95     if(m_Parent) {
96         return m_Parent->getLock();
97     } else {
98         return m_UpdateLock;
99     }
100 }
101
102 DBus::UInt64
103 Element::getId( )
104 {
105     return m_Slave.getId();
106 }
107
108 DBus::String
109 Element::getName( )
110 {
111     return DBus::String(m_Slave.getName());
112 }
113
114 DBus::String
115 Element::getLabel( )
116 {
117     return DBus::String(m_Slave.getLabel());
118 }
119
120 DBus::String
121 Element::getDescription( )
122 {
123     return DBus::String(m_Slave.getDescription());
124 }
125
126 // --- Container
127 Container::Container( DBus::Connection& connection, std::string p, Element* parent, Control::Container &slave)
128 : Element(connection, p, parent, slave)
129 , m_Slave(slave)
130 {
131     debugOutput( DEBUG_LEVEL_VERBOSE, "Created Container on '%s'\n",
132                  path().c_str() );
133
134     setDebugLevel(slave.getVerboseLevel());
135
136     // register an update signal handler
137     m_updateFunctor = new MemberSignalFunctor1< Container*,
138                       void (Container::*)(int) >
139                       ( this, &Container::updated, (int)Control::Container::eS_Updated );
140     if(m_updateFunctor) {
141         if(!slave.addSignalHandler(m_updateFunctor)) {
142             debugWarning("Could not add update signal functor\n");
143         }
144     } else {
145         debugWarning("Could not create update signal functor\n");
146     }
147
148     // build the initial tree
149     m_Slave = slave;
150     updateTree();
151 }
152
153 Container::~Container() {
154     debugOutput( DEBUG_LEVEL_VERBOSE, "Deleting Container on '%s'\n",
155                  path().c_str() );
156
157     Destroyed(); //send dbus signal
158
159     if(m_updateFunctor) {
160         if(!m_Slave.remSignalHandler(m_updateFunctor)) {
161             debugWarning("Could not remove update signal functor\n");
162         }
163     }
164     delete m_updateFunctor;
165
166     for ( ElementVectorIterator it = m_Children.begin();
167       it != m_Children.end();
168       ++it )
169     {
170         delete (*it);
171     }
172 }
173
174 void
175 Container::setVerboseLevel( const DBus::Int32 & i)
176 {
177     Element::setVerboseLevel(i);
178     for ( ElementVectorIterator it = m_Children.begin();
179       it != m_Children.end();
180       ++it )
181     {
182         (*it)->setVerboseLevel(i);
183     }
184 }
185
186 DBus::Int32
187 Container::getNbElements( ) {
188     return m_Slave.countElements();
189 }
190
191 DBus::String
192 Container::getElementName( const DBus::Int32& i ) {
193     int nbElements=m_Slave.countElements();
194     if (i<nbElements) {
195         m_Slave.lockControl();
196         const Control::ElementVector elements = m_Slave.getElementVector();
197         Control::Element *e = elements.at(i);
198         std::string name;
199         if(e) name = e->getName();
200         m_Slave.unlockControl();
201         return name;
202     } else return "";
203 }
204 //     Util::MutexLockHelper lock(*m_access_lock);
205
206 // NOTE: call with tree locked
207 void
208 Container::updateTree()
209 {
210     bool something_changed = false;
211     debugOutput( DEBUG_LEVEL_VERBOSE, "Updating tree...\n");
212     // send a pre update signal
213     PreUpdate();
214     debugOutput( DEBUG_LEVEL_VERBOSE, "Add handlers for elements...\n");
215     // add handlers for the slaves that don't have one yet
216     const Control::ElementVector elements = m_Slave.getElementVector();
217     for ( Control::ConstElementVectorIterator it = elements.begin();
218       it != elements.end();
219       ++it )
220     {
221         Element *e = findElementForControl((*it));
222         if(e == NULL) { // element not in tree
223             e = createHandler(this, *(*it));
224             if (e) {
225                 e->setVerboseLevel(getDebugLevel());
226                 m_Children.push_back(e);
227                 debugOutput( DEBUG_LEVEL_VERBOSE, "Created handler %p for Control::Element %s...\n",
228                             e, (*it)->getName().c_str());
229                 something_changed = true;
230             } else {
231                 debugWarning("Failed to create handler for Control::Element %s\n",
232                     (*it)->getName().c_str());
233             }
234         } else {
235             // element already present
236             debugOutput( DEBUG_LEVEL_VERBOSE, "Already have handler (%p) for Control::Element %s...\n",
237                          e, (*it)->getName().c_str());
238         }
239     }
240
241     debugOutput( DEBUG_LEVEL_VERBOSE, "Remove handlers without element...\n");
242     std::vector<Element *> to_remove;
243     // remove handlers that don't have a slave anymore
244     for ( ElementVectorIterator it = m_Children.begin();
245       it != m_Children.end();
246       ++it )
247     {
248         Element *e = *it;
249         bool found = false;
250         for ( Control::ConstElementVectorIterator it2 = elements.begin();
251               it2 != elements.end();
252               ++it2 )
253         {
254             if(&(e)->m_Slave == *it2) {
255                 found = true;
256                 debugOutput( DEBUG_LEVEL_VERBOSE, "Slave for handler %p at %s is present: Control::Element %s...\n",
257                             e, e->path().c_str(), (*it)->getName().c_str());
258                 break;
259             }
260         }
261
262         if (!found) {
263             debugOutput(DEBUG_LEVEL_VERBOSE,
264                         "going to remove handler %p on path %s since slave is gone\n",
265                         e, e->path().c_str());
266             // can't remove while iterating
267             to_remove.push_back(e);
268             something_changed = true;
269         }
270     }
271     // do the actual remove
272     while(to_remove.size()) {
273         Element * e = *(to_remove.begin());
274         removeElement(e);
275         to_remove.erase(to_remove.begin());
276     }
277
278     if(something_changed) {
279         debugOutput(DEBUG_LEVEL_VERBOSE,
280                     "send dbus signal for path %s since something changed\n",
281                     path().c_str());
282         // send a dbus signal
283         Updated();
284     }
285     // send a post update signal
286     PostUpdate();
287 }
288
289 void
290 Container::removeElement(Element *e)
291 {
292     debugOutput(DEBUG_LEVEL_VERBOSE,
293                 "removing handler %p on path %s\n",
294                 e, path().c_str());
295     for ( ElementVectorIterator it = m_Children.begin();
296       it != m_Children.end();
297       ++it )
298     {
299         if(*it == e) {
300             m_Children.erase(it);
301             delete e;
302             return;
303         }
304     }
305     debugError("BUG: Element %p not found!\n", e);
306 }
307
308 // NOTE: call with access lock held!
309 Element *
310 Container::findElementForControl(Control::Element *e)
311 {
312     for ( ElementVectorIterator it = m_Children.begin();
313       it != m_Children.end();
314       ++it )
315     {
316         if(&(*it)->m_Slave == e) return (*it);
317     }
318     return NULL;
319 }
320
321 void
322 Container::updated(int new_nb_elements)
323 {
324     debugOutput( DEBUG_LEVEL_VERBOSE, "Got updated signal, new count='%d'\n",
325                  new_nb_elements );
326     // we lock the tree first
327     Lock();
328
329     // also lock the slave tree
330     m_Slave.lockControl();
331
332     // update our tree
333     updateTree();
334
335     // now unlock the slave tree
336     m_Slave.unlockControl();
337
338     // and unlock the access
339     Unlock();
340 }
341
342 /**
343  * \brief create a correct DBusControl counterpart for a given Control::Element
344  */
345 Element *
346 Container::createHandler(Element *parent, Control::Element& e) {
347     debugOutput( DEBUG_LEVEL_VERBOSE, "Creating handler for '%s'\n",
348                  e.getName().c_str() );
349                  
350     if (dynamic_cast<Control::Container *>(&e) != NULL) {
351         debugOutput( DEBUG_LEVEL_VERBOSE, "Source is a Control::Container\n");
352        
353         return new Container(conn(), std::string(path()+"/"+e.getName()),
354             parent, *dynamic_cast<Control::Container *>(&e));
355     }
356    
357     if (dynamic_cast<Control::Continuous *>(&e) != NULL) {
358         debugOutput( DEBUG_LEVEL_VERBOSE, "Source is a Control::Continuous\n");
359        
360         return new Continuous(conn(), std::string(path()+"/"+e.getName()),
361             parent, *dynamic_cast<Control::Continuous *>(&e));
362     }
363    
364     if (dynamic_cast<Control::Discrete *>(&e) != NULL) {
365         debugOutput( DEBUG_LEVEL_VERBOSE, "Source is a Control::Discrete\n");
366        
367         return new Discrete(conn(), std::string(path()+"/"+e.getName()),
368             parent, *dynamic_cast<Control::Discrete *>(&e));
369     }
370    
371     if (dynamic_cast<Control::Text *>(&e) != NULL) {
372         debugOutput( DEBUG_LEVEL_VERBOSE, "Source is a Control::Text\n");
373        
374         return new Text(conn(), std::string(path()+"/"+e.getName()),
375             parent, *dynamic_cast<Control::Text *>(&e));
376     }
377
378     if (dynamic_cast<Control::Register *>(&e) != NULL) {
379         debugOutput( DEBUG_LEVEL_VERBOSE, "Source is a Control::Register\n");
380        
381         return new Register(conn(), std::string(path()+"/"+e.getName()),
382             parent, *dynamic_cast<Control::Register *>(&e));
383     }
384
385     // note that we have to check this before checking the Enum,
386     // since Enum is a base class
387     if (dynamic_cast<Control::AttributeEnum *>(&e) != NULL) {
388         debugOutput( DEBUG_LEVEL_VERBOSE, "Source is a Control::AttributeEnum\n");
389        
390         return new AttributeEnum(conn(), std::string(path()+"/"+e.getName()),
391             parent, *dynamic_cast<Control::AttributeEnum *>(&e));
392     }
393    
394     if (dynamic_cast<Control::Enum *>(&e) != NULL) {
395         debugOutput( DEBUG_LEVEL_VERBOSE, "Source is a Control::Enum\n");
396        
397         return new Enum(conn(), std::string(path()+"/"+e.getName()),
398             parent, *dynamic_cast<Control::Enum *>(&e));
399     }
400    
401     if (dynamic_cast<ConfigRom *>(&e) != NULL) {
402         debugOutput( DEBUG_LEVEL_VERBOSE, "Source is a ConfigRom\n");
403        
404         return new ConfigRomX(conn(), std::string(path()+"/"+e.getName()),
405             parent, *dynamic_cast<ConfigRom *>(&e));
406     }
407    
408     if (dynamic_cast<Control::MatrixMixer *>(&e) != NULL) {
409         debugOutput( DEBUG_LEVEL_VERBOSE, "Source is a Control::MatrixMixer\n");
410        
411         return new MatrixMixer(conn(), std::string(path()+"/"+e.getName()),
412             parent, *dynamic_cast<Control::MatrixMixer *>(&e));
413     }
414    
415     debugOutput( DEBUG_LEVEL_VERBOSE, "Source is a Control::Element\n");
416     return new Element(conn(), std::string(path()+"/"+e.getName()), parent, e);
417 }
418
419 // --- Continuous
420
421 Continuous::Continuous( DBus::Connection& connection, std::string p, Element* parent, Control::Continuous &slave)
422 : Element(connection, p, parent, slave)
423 , m_Slave(slave)
424 {
425     debugOutput( DEBUG_LEVEL_VERBOSE, "Created Continuous on '%s'\n",
426                  path().c_str() );
427 }
428
429 DBus::Double
430 Continuous::setValue( const DBus::Double& value )
431 {
432     m_Slave.setValue(value);
433 /*   
434     SleepRelativeUsec(1000*500);
435    
436     debugOutput( DEBUG_LEVEL_VERBOSE, "setValue(%lf) => %lf\n", value, m_Slave.getValue() );
437    
438     return m_Slave.getValue();*/
439     return value;
440 }
441
442 DBus::Double
443 Continuous::getValue(  )
444 {
445     double val = m_Slave.getValue();
446     debugOutput( DEBUG_LEVEL_VERBOSE, "getValue() => %lf\n", val );
447     return val;
448 }
449
450 DBus::Double
451 Continuous::setValueIdx( const DBus::Int32 & idx, const DBus::Double& value )
452 {
453     m_Slave.setValue(idx, value);
454 /*   
455     SleepRelativeUsec(1000*500);
456    
457     debugOutput( DEBUG_LEVEL_VERBOSE, "setValue(%lf) => %lf\n", value, m_Slave.getValue() );
458    
459     return m_Slave.getValue();*/
460     return value;
461 }
462
463 DBus::Double
464 Continuous::getValueIdx( const DBus::Int32 & idx )
465 {
466     double val = m_Slave.getValue(idx);
467     debugOutput( DEBUG_LEVEL_VERBOSE, "getValue(%d) => %lf\n", idx, val );
468     return val;
469 }
470
471 DBus::Double
472 Continuous::getMinimum()
473 {
474     double val = m_Slave.getMinimum();
475     debugOutput( DEBUG_LEVEL_VERBOSE, "getMinimum() => %lf\n", val );
476     return val;
477 }
478
479 DBus::Double
480 Continuous::getMaximum()
481 {
482     double val = m_Slave.getMaximum();
483     debugOutput( DEBUG_LEVEL_VERBOSE, "getMaximum() => %lf\n", val );
484     return val;
485 }
486
487 // --- Discrete
488
489 Discrete::Discrete( DBus::Connection& connection, std::string p, Element* parent, Control::Discrete &slave)
490 : Element(connection, p, parent, slave)
491 , m_Slave(slave)
492 {
493     debugOutput( DEBUG_LEVEL_VERBOSE, "Created Discrete on '%s'\n",
494                  path().c_str() );
495 }
496
497 DBus::Int32
498 Discrete::setValue( const DBus::Int32& value )
499 {
500     m_Slave.setValue(value);
501    
502 /*    SleepRelativeUsec(1000*500);
503     debugOutput( DEBUG_LEVEL_VERBOSE, "setValue(%d) => %d\n", value, m_Slave.getValue() );
504    
505     return m_Slave.getValue();*/
506     return value;
507 }
508
509 DBus::Int32
510 Discrete::getValue()
511 {
512     int32_t val = m_Slave.getValue();
513     debugOutput( DEBUG_LEVEL_VERBOSE, "getValue() => %d\n", val );
514     return val;
515 }
516
517 DBus::Int32
518 Discrete::setValueIdx( const DBus::Int32& idx, const DBus::Int32& value )
519 {
520     m_Slave.setValue(idx, value);
521    
522 /*    SleepRelativeUsec(1000*500);
523     debugOutput( DEBUG_LEVEL_VERBOSE, "setValue(%d) => %d\n", value, m_Slave.getValue() );
524    
525     return m_Slave.getValue();*/
526     return value;
527 }
528
529 DBus::Int32
530 Discrete::getValueIdx( const DBus::Int32& idx )
531 {
532     int32_t val = m_Slave.getValue(idx);
533     debugOutput( DEBUG_LEVEL_VERBOSE, "getValue(%d) => %d\n", idx, val );
534     return val;
535 }
536
537 // --- Text
538
539 Text::Text( DBus::Connection& connection, std::string p, Element* parent, Control::Text &slave)
540 : Element(connection, p, parent, slave)
541 , m_Slave(slave)
542 {
543     debugOutput( DEBUG_LEVEL_VERBOSE, "Created Text on '%s'\n",
544                  path().c_str() );
545 }
546
547 DBus::String
548 Text::setValue( const DBus::String& value )
549 {
550     m_Slave.setValue(value);
551    
552 /*    SleepRelativeUsec(1000*500);
553     debugOutput( DEBUG_LEVEL_VERBOSE, "setValue(%d) => %d\n", value, m_Slave.getValue() );
554    
555     return m_Slave.getValue();*/
556     return value;
557 }
558
559 DBus::String
560 Text::getValue()
561 {
562     std::string val = m_Slave.getValue();
563     debugOutput( DEBUG_LEVEL_VERBOSE, "getValue() => %s\n", val.c_str() );
564     return val;
565 }
566
567 // --- Register
568
569 Register::Register( DBus::Connection& connection, std::string p, Element* parent, Control::Register &slave)
570 : Element(connection, p, parent, slave)
571 , m_Slave(slave)
572 {
573     debugOutput( DEBUG_LEVEL_VERBOSE, "Created Register on '%s'\n",
574                  path().c_str() );
575 }
576
577 DBus::UInt64
578 Register::setValue( const DBus::UInt64& addr, const DBus::UInt64& value )
579 {
580     m_Slave.setValue(addr, value);
581    
582 /*    SleepRelativeUsec(1000*500);
583     debugOutput( DEBUG_LEVEL_VERBOSE, "setValue(%d) => %d\n", value, m_Slave.getValue() );
584    
585     return m_Slave.getValue();*/
586     return value;
587 }
588
589 DBus::UInt64
590 Register::getValue( const DBus::UInt64& addr )
591 {
592     DBus::UInt64 val = m_Slave.getValue(addr);
593     debugOutput( DEBUG_LEVEL_VERBOSE, "getValue(%lld) => %lld\n", addr, val );
594     return val;
595 }
596
597 // --- Enum
598
599 Enum::Enum( DBus::Connection& connection, std::string p, Element* parent, Control::Enum &slave)
600 : Element(connection, p, parent, slave)
601 , m_Slave(slave)
602 {
603     debugOutput( DEBUG_LEVEL_VERBOSE, "Created Enum on '%s'\n",
604                  path().c_str() );
605 }
606
607 DBus::Int32
608 Enum::select( const DBus::Int32& idx )
609 {
610     debugOutput( DEBUG_LEVEL_VERBOSE, "select(%d)\n", idx );
611     return  m_Slave.select(idx);
612 }
613
614 DBus::Int32
615 Enum::selected()
616 {
617     int retval = m_Slave.selected();
618     debugOutput( DEBUG_LEVEL_VERBOSE, "selected() => %d\n", retval );
619     return retval;
620 }
621
622 DBus::Int32
623 Enum::count()
624 {
625     int retval = m_Slave.count();
626     debugOutput( DEBUG_LEVEL_VERBOSE, "count() => %d\n", retval );
627     return retval;
628 }
629
630 DBus::String
631 Enum::getEnumLabel( const DBus::Int32 & idx )
632 {
633     std::string retval = m_Slave.getEnumLabel(idx);
634     debugOutput( DEBUG_LEVEL_VERBOSE, "getEnumLabel(%d) => %s\n", idx, retval.c_str() );
635     return retval;
636 }
637
638 // --- AttributeEnum
639 AttributeEnum::AttributeEnum( DBus::Connection& connection, std::string p, Element* parent, Control::AttributeEnum &slave)
640 : Element(connection, p, parent, slave)
641 , m_Slave(slave)
642 {
643     debugOutput( DEBUG_LEVEL_VERBOSE, "Created Enum on '%s'\n",
644                  path().c_str() );
645 }
646
647 DBus::Int32
648 AttributeEnum::select( const DBus::Int32& idx )
649 {
650     debugOutput( DEBUG_LEVEL_VERBOSE, "select(%d)\n", idx );
651     return  m_Slave.select(idx);
652 }
653
654 DBus::Int32
655 AttributeEnum::selected()
656 {
657     int retval = m_Slave.selected();
658     debugOutput( DEBUG_LEVEL_VERBOSE, "selected() => %d\n", retval );
659     return retval;
660 }
661
662 DBus::Int32
663 AttributeEnum::count()
664 {
665     int retval = m_Slave.count();
666     debugOutput( DEBUG_LEVEL_VERBOSE, "count() => %d\n", retval );
667     return retval;
668 }
669
670 DBus::Int32
671 AttributeEnum::attributeCount()
672 {
673     int retval = m_Slave.attributeCount();
674     debugOutput( DEBUG_LEVEL_VERBOSE, "attributeCount() => %d\n", retval );
675     return retval;
676 }
677
678 DBus::String
679 AttributeEnum::getEnumLabel( const DBus::Int32 & idx )
680 {
681     std::string retval = m_Slave.getEnumLabel(idx);
682     debugOutput( DEBUG_LEVEL_VERBOSE, "getEnumLabel(%d) => %s\n", idx, retval.c_str() );
683     return retval;
684 }
685
686 DBus::String
687 AttributeEnum::getAttributeValue( const DBus::Int32 & idx )
688 {
689     std::string retval = m_Slave.getAttributeValue(idx);
690     debugOutput( DEBUG_LEVEL_VERBOSE, "getAttributeValue(%d) => %s\n", idx, retval.c_str() );
691     return retval;
692 }
693
694 DBus::String
695 AttributeEnum::getAttributeName( const DBus::Int32 & idx )
696 {
697     std::string retval = m_Slave.getAttributeName(idx);
698     debugOutput( DEBUG_LEVEL_VERBOSE, "getAttributeName(%d) => %s\n", idx, retval.c_str() );
699     return retval;
700 }
701
702 // --- ConfigRom
703
704 ConfigRomX::ConfigRomX( DBus::Connection& connection, std::string p, Element* parent, ConfigRom &slave)
705 : Element(connection, p, parent, slave)
706 , m_Slave(slave)
707 {
708     debugOutput( DEBUG_LEVEL_VERBOSE, "Created ConfigRomX on '%s'\n",
709                  path().c_str() );
710 }
711
712 DBus::String
713 ConfigRomX::getGUID( )
714 {
715     return m_Slave.getGuidString();
716 }
717
718 DBus::String
719 ConfigRomX::getVendorName( )
720 {
721     return m_Slave.getVendorName();
722 }
723
724 DBus::String
725 ConfigRomX::getModelName( )
726 {
727     return m_Slave.getModelName();
728 }
729
730 DBus::Int32
731 ConfigRomX::getVendorId( )
732 {
733     return m_Slave.getNodeVendorId();
734 }
735
736 DBus::Int32
737 ConfigRomX::getModelId( )
738 {
739     return m_Slave.getModelId();
740 }
741
742 DBus::Int32
743 ConfigRomX::getUnitVersion( )
744 {
745     return m_Slave.getUnitVersion();
746 }
747
748 // --- MatrixMixer
749
750 MatrixMixer::MatrixMixer( DBus::Connection& connection, std::string p, Element* parent, Control::MatrixMixer &slave)
751 : Element(connection, p, parent, slave)
752 , m_Slave(slave)
753 {
754     debugOutput( DEBUG_LEVEL_VERBOSE, "Created MatrixMixer on '%s'\n",
755                  path().c_str() );
756 }
757
758 DBus::String
759 MatrixMixer::getRowName( const DBus::Int32& row) {
760     return m_Slave.getRowName(row);
761 }
762
763 DBus::String
764 MatrixMixer::getColName( const DBus::Int32& col) {
765     return m_Slave.getColName(col);
766 }
767
768 DBus::Int32
769 MatrixMixer::canWrite( const DBus::Int32& row, const DBus::Int32& col) {
770     return m_Slave.canWrite(row,col);
771 }
772
773 DBus::Double
774 MatrixMixer::setValue( const DBus::Int32& row, const DBus::Int32& col, const DBus::Double& val ) {
775     return m_Slave.setValue(row,col,val);
776 }
777
778 DBus::Double
779 MatrixMixer::getValue( const DBus::Int32& row, const DBus::Int32& col) {
780     return m_Slave.getValue(row,col);
781 }
782
783 DBus::Int32
784 MatrixMixer::getRowCount( ) {
785     return m_Slave.getRowCount();
786 }
787
788 DBus::Int32
789 MatrixMixer::getColCount( ) {
790     return m_Slave.getColCount();
791 }
792
793 } // end of namespace Control
Note: See TracBrowser for help on using the browser.