Changeset 644

Show
Ignore:
Timestamp:
10/14/07 10:19:22 (15 years ago)
Author:
ppalmers
Message:

- Adapt the phase 88 mixer control application to the new DBUS control interface

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/bebob/bebob_mixer.cpp

    r628 r644  
    219219    fbCmd.m_pFBFeature->m_controlSelector=FunctionBlockFeature::eCSE_Feature_Volume; 
    220220    fbCmd.m_pFBFeature->m_pVolume->m_volume=volume; 
     221    fbCmd.setVerboseLevel( DEBUG_LEVEL_VERY_VERBOSE ); 
    221222 
    222223    if ( !fbCmd.fire() ) { 
     
    225226    } 
    226227 
    227     if ( getDebugLevel() >= DEBUG_LEVEL_NORMAL ) { 
    228         Util::CoutSerializer se; 
    229         fbCmd.serialize( se ); 
    230     } 
     228//     if ( getDebugLevel() >= DEBUG_LEVEL_NORMAL ) { 
     229//         Util::CoutSerializer se; 
     230//         fbCmd.serialize( se ); 
     231//     } 
    231232     
    232233    if((fbCmd.getResponse() != AVCCommand::eR_Accepted)) { 
     
    253254    fbCmd.m_pFBFeature->m_controlSelector=FunctionBlockFeature::eCSE_Feature_Volume; // FIXME 
    254255    fbCmd.m_pFBFeature->m_pVolume->m_volume=0; 
     256    fbCmd.setVerboseLevel( DEBUG_LEVEL_VERY_VERBOSE ); 
    255257 
    256258    if ( !fbCmd.fire() ) { 
     
    259261    } 
    260262     
    261     if ( getDebugLevel() >= DEBUG_LEVEL_NORMAL ) { 
    262         Util::CoutSerializer se; 
    263         fbCmd.serialize( se ); 
    264     } 
     263//     if ( getDebugLevel() >= DEBUG_LEVEL_NORMAL ) { 
     264//         Util::CoutSerializer se; 
     265//         fbCmd.serialize( se ); 
     266//     } 
    265267 
    266268    if((fbCmd.getResponse() != AVCCommand::eR_Implemented)) { 
     
    268270    } 
    269271     
    270     int volume=(int)(fbCmd.m_pFBFeature->m_pVolume->m_volume); 
     272    int16_t volume=(int16_t)(fbCmd.m_pFBFeature->m_pVolume->m_volume); 
    271273     
    272274    return volume; 
     
    308310    fbCmd.setCommandType( AVCCommand::eCT_Control ); 
    309311    fbCmd.m_pFBSelector->m_inputFbPlugNumber=(v & 0xFF); 
     312    fbCmd.setVerboseLevel( DEBUG_LEVEL_VERY_VERBOSE ); 
    310313 
    311314    if ( !fbCmd.fire() ) { 
     
    314317    } 
    315318 
    316     if ( getDebugLevel() >= DEBUG_LEVEL_NORMAL ) { 
    317         Util::CoutSerializer se; 
    318         fbCmd.serialize( se ); 
    319     } 
    320      
     319//     if ( getDebugLevel() >= DEBUG_LEVEL_NORMAL ) { 
     320//         Util::CoutSerializer se; 
     321//         fbCmd.serialize( se ); 
     322//     } 
     323//      
    321324    if((fbCmd.getResponse() != AVCCommand::eR_Accepted)) { 
    322325        debugWarning("fbCmd.getResponse() != AVCCommand::eR_Accepted\n"); 
     
    340343    fbCmd.setCommandType( AVCCommand::eCT_Status ); 
    341344    fbCmd.m_pFBSelector->m_inputFbPlugNumber=0; 
     345    fbCmd.setVerboseLevel( DEBUG_LEVEL_VERY_VERBOSE ); 
    342346 
    343347    if ( !fbCmd.fire() ) { 
     
    346350    } 
    347351     
    348     if ( getDebugLevel() >= DEBUG_LEVEL_NORMAL ) { 
    349         Util::CoutSerializer se; 
    350         fbCmd.serialize( se ); 
    351     } 
     352//     if ( getDebugLevel() >= DEBUG_LEVEL_NORMAL ) { 
     353//         Util::CoutSerializer se; 
     354//         fbCmd.serialize( se ); 
     355//     } 
    352356 
    353357    if((fbCmd.getResponse() != AVCCommand::eR_Implemented)) { 
  • trunk/libffado/src/ffadodevice.cpp

    r639 r644  
    4545    std::ostringstream nodestr; 
    4646    nodestr << "node" << getConfigRom().getNodeId(); 
    47      
    48 //     setOscBase(nodestr.str()); 
    49 //     ConfigRom& c = getConfigRom(); 
    50 //     addChildOscNode(&c); 
     47 
     48    if (!addElement(&getConfigRom())) { 
     49        debugWarning("failed to add ConfigRom to Control::Container\n"); 
     50    } 
    5151} 
    5252 
  • trunk/libffado/src/libavc/general/avc_generic.h

    r626 r644  
    103103 
    104104    bool setVerbose( int verboseLevel ); 
     105    bool setVerboseLevel( int verboseLevel ) 
     106        { return setVerbose(verboseLevel);}; 
     107 
    105108    int getVerboseLevel(); 
    106109 
  • trunk/libffado/src/libieee1394/configrom.cpp

    r560 r644  
    6161 
    6262ConfigRom::ConfigRom( Ieee1394Service& ieee1394service, fb_nodeid_t nodeId ) 
    63     : OscNode("ConfigRom") 
     63    : Control::Element("ConfigRom") 
    6464    , m_1394Service( &ieee1394service ) 
    6565    , m_nodeId( nodeId ) 
     
    8888 
    8989ConfigRom::ConfigRom() 
    90     : OscNode("ConfigRom") 
     90    : Control::Element("ConfigRom") 
    9191    , m_1394Service( 0 ) 
    9292    , m_nodeId( -1 ) 
     
    596596    return true; 
    597597} 
    598  
    599 OSC::OscResponse 
    600 ConfigRom::processOscMessage(OSC::OscMessage *m) { 
    601     OSC::OscResponse r=OSC::OscResponse(OSC::OscResponse::eUnhandled); 
    602  
    603     unsigned int nbArgs=m->nbArguments(); 
    604     if (nbArgs>=1) { 
    605         OSC::OscArgument arg0=m->getArgument(0); 
    606         if(arg0.isString()) { // commands 
    607             string cmd=arg0.getString(); 
    608  
    609             debugOutput( DEBUG_LEVEL_VERBOSE, "(%p) CMD? %s\n", this, cmd.c_str()); 
    610             if(cmd == "params") { 
    611                 debugOutput( DEBUG_LEVEL_VERBOSE, "Listing node params...\n"); 
    612                 OSC::OscMessage& rm=r.getMessage(); 
    613                 rm.addArgument("GUID"); 
    614                 rm.addArgument("VendorName"); 
    615                 rm.addArgument("ModelName"); 
    616                 r.setType(OSC::OscResponse::eMessage); 
    617             } 
    618             if(cmd == "get") { 
    619                 if(nbArgs != 2) { 
    620                     debugError("Erronous get command received, wrong nb of arguments\n"); 
    621                     m->print(); 
    622                 } else { 
    623                     OSC::OscArgument arg1=m->getArgument(1); 
    624                     if(arg1.isString()) { // commands 
    625                         string target=arg1.getString(); 
    626                         OSC::OscMessage& rm=r.getMessage(); 
    627                         if(target == "GUID") { 
    628                             // FIXME: this will only return the lower 32 bits 
    629                             rm.addArgument((int64_t)getGuid()); 
    630                         } else if(target == "VendorName") { 
    631                             rm.addArgument(getVendorName()); 
    632                         } else if(target == "ModelName") { 
    633                             rm.addArgument(getModelName()); 
    634                         } else { 
    635                             debugError("Erronous get command received, non-existant target\n"); 
    636                             m->print(); 
    637                         } 
    638                         r.setType(OSC::OscResponse::eMessage); 
    639                     } else { 
    640                         debugError("Erronous get command received, wrong argument type\n"); 
    641                         m->print(); 
    642                     } 
    643                 } 
    644             } 
    645         } 
    646     } 
    647  
    648     return r; 
    649  
    650 } 
  • trunk/libffado/src/libieee1394/configrom.h

    r560 r644  
    3333#include "debugmodule/debugmodule.h" 
    3434 
    35 #include "libosc/OscNode.h" 
     35#include "libcontrol/Element.h" 
    3636 
    3737#include <string> 
     
    4040 
    4141class ConfigRom 
    42     : public OSC::OscNode 
     42    : public Control::Element 
    4343{ 
    4444 public: 
     
    5757 
    5858    const unsigned int getModelId() const; 
     59    // FIXME: isn't this the same as getNodeVendorId? 
    5960    const unsigned int getVendorId() const; 
    6061    const unsigned int getUnitSpecifierId() const; 
     
    136137    struct csr1212_csr*    m_csr; 
    137138 
    138 protected: // OSC handling 
    139     OSC::OscResponse processOscMessage(OSC::OscMessage *m); 
    140  
    141139private: 
    142140    ConfigRom( const ConfigRom& ); // do not allow copy ctor 
  • trunk/libffado/support/mixer/mixer_phase88.py

    r459 r644  
    55from mixer_phase88ui import * 
    66import sys 
     7 
     8SupportedDevices=[ 
     9    [(0x000aac, 0x00000003),'Phase88Control'], 
     10    ] 
     11 
     12class ControlInterface: 
     13    def __init__(self, servername, basepath): 
     14        self.basepath=basepath 
     15        self.servername=servername 
     16        self.bus=dbus.SessionBus() 
     17             
     18    def setContignuous(self, subpath, v): 
     19        path = self.basepath + subpath 
     20        dev = self.bus.get_object(self.servername, path) 
     21        dev_cont = dbus.Interface(dev, dbus_interface='org.ffado.Control.Element.Continuous') 
     22        dev_cont.setValue(v) 
     23            
     24    def getContignuous(self, subpath): 
     25        path = self.basepath + subpath 
     26        dev = self.bus.get_object(self.servername, path) 
     27        dev_cont = dbus.Interface(dev, dbus_interface='org.ffado.Control.Element.Continuous') 
     28        return dev_cont.getValue()         
     29     
     30    def setDiscrete(self, subpath, v): 
     31        path = self.basepath + subpath 
     32        dev = self.bus.get_object(self.servername, path) 
     33        dev_cont = dbus.Interface(dev, dbus_interface='org.ffado.Control.Element.Discrete') 
     34        dev_cont.setValue(v) 
     35            
     36    def getDiscrete(self, subpath): 
     37        path = self.basepath + subpath 
     38        dev = self.bus.get_object(self.servername, path) 
     39        dev_cont = dbus.Interface(dev, dbus_interface='org.ffado.Control.Element.Discrete') 
     40        return dev_cont.getValue()         
     41 
     42class DeviceManagerInterface: 
     43    def __init__(self, servername, basepath): 
     44        self.basepath=basepath + '/DeviceManager' 
     45        self.servername=servername 
     46        self.bus=dbus.SessionBus() 
     47        self.dev = self.bus.get_object(self.servername, self.basepath) 
     48        self.iface = dbus.Interface(self.dev, dbus_interface='org.ffado.Control.Element.Container') 
     49             
     50    def getNbDevices(self): 
     51        return self.iface.getNbElements() 
     52    def getDeviceName(self, idx): 
     53        return self.iface.getElementName(idx)   
     54 
     55class ConfigRomInterface: 
     56    def __init__(self, servername, devicepath): 
     57        self.basepath=devicepath + '/ConfigRom' 
     58        self.servername=servername 
     59        self.bus=dbus.SessionBus() 
     60        self.dev = self.bus.get_object(self.servername, self.basepath) 
     61        self.iface = dbus.Interface(self.dev, dbus_interface='org.ffado.Control.Element.ConfigRomX') 
     62    def getGUID(self): 
     63        return self.iface.getGUID() 
     64    def getVendorName(self): 
     65        return self.iface.getVendorName() 
     66    def getModelName(self): 
     67        return self.iface.getModelName() 
     68    def getVendorId(self): 
     69        return self.iface.getVendorId() 
     70    def getModelId(self): 
     71        return self.iface.getModelId() 
     72    
     73 
    774if __name__ == "__main__": 
     75     
     76    server='org.ffado.Control' 
     77    basepath='/org/ffado/Control' 
     78     
    879    app = QApplication(sys.argv) 
    9     f = Phase88Control() 
    10     f.show() 
     80     
     81    devmgr=DeviceManagerInterface(server, basepath) 
     82    nbDevices=devmgr.getNbDevices() 
     83     
     84    for idx in range(nbDevices): 
     85        path=devmgr.getDeviceName(idx) 
     86        print "Found device %d: %s" % (idx, path) 
     87         
     88        cfgrom=ConfigRomInterface(server, basepath+'/DeviceManager/'+path) 
     89        vendorId=cfgrom.getVendorId() 
     90        modelId=cfgrom.getModelId() 
     91         
     92        print "Found (%X, %X) %s %s" % (vendorId, modelId, cfgrom.getVendorName() , cfgrom.getModelName()) 
     93         
     94        thisdev=(vendorId, modelId); 
     95         
     96        for dev in SupportedDevices: 
     97            if dev[0]==thisdev: 
     98                print dev[1] 
     99                exec('f='+dev[1]+'()') 
     100                f.hw=ControlInterface(server, basepath+'/DeviceManager/'+path) 
     101                f.initValues() 
     102                f.show() 
     103     
    11104    app.setMainWidget(f) 
    12105    app.exec_loop() 
  • trunk/libffado/support/mixer/mixer_phase88.ui

    r460 r644  
    22<class>Phase88Control</class> 
    33<comment>Python: 
    4 Python:# Import the OSC module 
    5 Python:import osc 
     4Python:# Import the DBUS module 
     5Python:import dbus 
    66</comment> 
    77<widget class="QDialog"> 
     
    707707    <slot>setVolumeWavePlay( int )</slot> 
    708708    <slot>setVolumeMaster( int )</slot> 
     709    <slot>setVolume( QString, int )</slot> 
     710    <slot>init()</slot> 
     711    <slot>initValues()</slot> 
     712    <slot>setSelector(QString, int)</slot> 
    709713</slots> 
    710714<layoutdefaults spacing="6" margin="11"/> 
  • trunk/libffado/support/mixer/mixer_phase88.ui.h

    r462 r644  
    1111*****************************************************************************/ 
    1212 
    13  
    1413void Phase88Control::switchFrontState( int ) 
    1514{ 
    16      
    17     if a0 == 0: 
    18         state=0 
    19     else : 
    20         state=1 
    21                          
    22     print "switching front/back state to %d" % state 
    23  
    24     osc.Message("/devicemanager/dev0/GenericMixer/Selector/10", ["set", "value", state]).sendlocal(17820)                         
     15    self.setSelector('frontback', a0) 
    2516} 
    2617 
    2718void Phase88Control::switchOutAssign( int ) 
    2819{ 
    29     print "switching out assign to %d" % a0 
    30     osc.Message("/devicemanager/dev0/GenericMixer/Selector/6", ["set", "value", a0]).sendlocal(17820) 
     20    self.setSelector('outassign', a0) 
    3121} 
    3222 
    3323void Phase88Control::switchWaveInAssign( int ) 
    3424{ 
    35     print "switching input assign to %d" % a0 
    36     osc.Message("/devicemanager/dev0/GenericMixer/Selector/7", ["set", "value", a0]).sendlocal(17820) 
     25    self.setSelector('inassign', a0) 
    3726} 
    3827 
    3928void Phase88Control::switchSyncSource( int ) 
    4029{ 
    41     print "switching sync source to %d" % a0 
    42     osc.Message("/devicemanager/dev0/GenericMixer/Selector/9", ["set", "value", a0]).sendlocal(17820) 
     30    self.setSelector('syncsource', a0) 
    4331} 
    4432 
    4533void Phase88Control::switchExtSyncSource( int ) 
    4634{ 
    47     print "switching external sync source to %d" % a0 
    48     osc.Message("/devicemanager/dev0/GenericMixer/Selector/8", ["set", "value", a0]).sendlocal(17820) 
     35    self.setSelector('externalsync', a0) 
    4936} 
    5037 
    5138void Phase88Control::setVolume12( int ) 
    5239{ 
    53     vol = -a0 
    54     print "setting volume for 1/2 to %d" % vol 
    55     osc.Message("/devicemanager/dev0/GenericMixer/Feature/2", ["set", "volume", 0, vol]).sendlocal(17820) 
     40    self.setVolume('line12', a0) 
    5641} 
    5742 
    5843void Phase88Control::setVolume34( int ) 
    5944{ 
    60     vol = -a0 
    61     print "setting volume for 3/4 to %d" % vol 
    62     osc.Message("/devicemanager/dev0/GenericMixer/Feature/3", ["set", "volume", 0, vol]).sendlocal(17820) 
     45    self.setVolume('line34', a0) 
    6346} 
    6447 
    6548void Phase88Control::setVolume56( int ) 
    6649{ 
    67     vol = -a0 
    68     print "setting volume for 5/6 to %d" % vol 
    69     osc.Message("/devicemanager/dev0/GenericMixer/Feature/4", ["set", "volume", 0, vol]).sendlocal(17820) 
     50    self.setVolume('line56', a0) 
    7051} 
    7152 
    7253void Phase88Control::setVolume78( int ) 
    7354{ 
    74     vol = -a0 
    75     print "setting volume for 7/8 to %d" % vol 
    76     osc.Message("/devicemanager/dev0/GenericMixer/Feature/5", ["set", "volume", 0, vol]).sendlocal(17820) 
     55    self.setVolume('line78', a0) 
    7756} 
    7857 
    7958void Phase88Control::setVolumeSPDIF( int ) 
    8059{ 
    81     vol = -a0 
    82     print "setting volume for S/PDIF to %d" % vol 
    83     osc.Message("/devicemanager/dev0/GenericMixer/Feature/6", ["set", "volume", 0, vol]).sendlocal(17820)    
     60    self.setVolume('spdif', a0) 
    8461} 
    8562 
    8663void Phase88Control::setVolumeWavePlay( int ) 
    8764{ 
    88     vol = -a0 
    89     print "setting volume for WavePlay to %d" % vol 
    90     osc.Message("/devicemanager/dev0/GenericMixer/Feature/7", ["set", "volume", 0, vol]).sendlocal(17820) 
     65    self.setVolume('waveplay', a0) 
    9166} 
    9267 
    9368void Phase88Control::setVolumeMaster( int ) 
    9469{ 
    95     vol = -a0 
    96     print "setting master volume to %d" % vol 
    97     osc.Message("/devicemanager/dev0/GenericMixer/Feature/1", ["set", "volume", 0, vol]).sendlocal(17820)     
     70    self.setVolume('master', a0) 
    9871} 
     72 
     73void Phase88Control::setVolume( QString, int ) 
     74{ 
     75    name=a0 
     76    vol = -a1 
     77     
     78    print "setting %s volume to %d" % (name, vol) 
     79    self.hw.setContignuous(self.VolumeControls[name][0], vol) 
     80} 
     81 
     82void Phase88Control::setSelector( QString, int ) 
     83{ 
     84    name=a0 
     85    state = a1 
     86     
     87    print "setting %s state to %d" % (name, state) 
     88    self.hw.setDiscrete(self.SelectorControls[name][0], state) 
     89} 
     90 
     91void Phase88Control::init() 
     92{ 
     93    print "Init Phase88 mixer window" 
     94 
     95    self.VolumeControls={ 
     96        'master':    ['/Mixer/Feature_1', self.sldInputMaster],  
     97        'line12' :   ['/Mixer/Feature_2', self.sldInput12], 
     98        'line34' :   ['/Mixer/Feature_3', self.sldInput34], 
     99        'line56' :   ['/Mixer/Feature_4', self.sldInput56], 
     100        'line78' :   ['/Mixer/Feature_5', self.sldInput78], 
     101        'spdif' :    ['/Mixer/Feature_6', self.sldInputSPDIF], 
     102        'waveplay' : ['/Mixer/Feature_7', self.sldInputWavePlay], 
     103        } 
     104 
     105    self.SelectorControls={ 
     106        'outassign':    ['/Mixer/Selector_6', self.comboOutAssign],  
     107        'inassign':     ['/Mixer/Selector_7', self.comboInAssign],  
     108        'externalsync': ['/Mixer/Selector_8', self.comboExtSync],  
     109        'syncsource':   ['/Mixer/Selector_9', self.comboSyncSource],  
     110        'frontback':    ['/Mixer/Selector_10', self.comboFrontBack],  
     111    } 
     112} 
     113 
     114void Phase88Control::initValues() 
     115{ 
     116    for name, ctrl in self.VolumeControls.iteritems(): 
     117        vol = self.hw.getContignuous(ctrl[0]) 
     118        print "%s volume is %d" % (name , vol) 
     119        ctrl[1].setValue(-vol) 
     120 
     121    for name, ctrl in self.SelectorControls.iteritems(): 
     122        state = self.hw.getDiscrete(ctrl[0]) 
     123        print "%s state is %d" % (name , state) 
     124        ctrl[1].setCurrentItem(state)     
     125} 
  • trunk/libffado/tests/control-interface.xml

    r586 r644  
    1616      </method> 
    1717  </interface> 
    18    
     18 
    1919  <interface name="org.ffado.Control.Element.Container"> 
     20      <method name="getNbElements"> 
     21          <arg type="i" name="count" direction="out"/> 
     22      </method> 
     23      <method name="getElementName"> 
     24          <arg type="i" name="id" direction="in"/> 
     25          <arg type="s" name="name" direction="out"/> 
     26      </method> 
    2027  </interface> 
    21    
     28 
     29  <interface name="org.ffado.Control.Element.ConfigRomX"> 
     30      <method name="getGUID"> 
     31          <arg type="s" name="guid" direction="out"/> 
     32      </method> 
     33      <method name="getVendorName"> 
     34          <arg type="s" name="vendorname" direction="out"/> 
     35      </method> 
     36      <method name="getModelName"> 
     37          <arg type="s" name="modelname" direction="out"/> 
     38      </method> 
     39      <method name="getVendorId"> 
     40          <arg type="i" name="vendorid" direction="out"/> 
     41      </method> 
     42      <method name="getModelId"> 
     43          <arg type="i" name="modelid" direction="out"/> 
     44      </method> 
     45  </interface> 
     46 
    2247  <interface name="org.ffado.Control.Element.Continuous"> 
    2348      <method name="setValue"> 
  • trunk/libffado/tests/controlserver.cpp

    r582 r644  
    9696} 
    9797 
     98DBus::Int32 
     99Container::getNbElements( ) { 
     100    return m_Slave.countElements(); 
     101} 
     102 
     103DBus::String 
     104Container::getElementName( const DBus::Int32& i ) { 
     105    int nbElements=m_Slave.countElements(); 
     106    if (i<nbElements) { 
     107        return m_Slave.getElements().at(i)->getName(); 
     108    } else return ""; 
     109} 
     110 
     111 
    98112/** 
    99113 * \brief create a correct DBusControl counterpart for a given Control::Element 
     
    125139    } 
    126140     
     141    if (dynamic_cast<ConfigRom *>(&e) != NULL) { 
     142        debugOutput( DEBUG_LEVEL_VERBOSE, "Source is a ConfigRom\n"); 
     143         
     144        return new ConfigRomX(conn(), std::string(path()+"/"+e.getName()), 
     145            *dynamic_cast<ConfigRom *>(&e)); 
     146    } 
     147     
    127148    debugOutput( DEBUG_LEVEL_VERBOSE, "Source is a Control::Element\n"); 
    128149    return new Element(conn(), std::string(path()+"/"+e.getName()), e); 
     
    143164{ 
    144165    m_Slave.setValue(value); 
     166/*     
     167    usleep(1000*500); 
     168     
    145169    debugOutput( DEBUG_LEVEL_VERBOSE, "setValue(%lf) => %lf\n", value, m_Slave.getValue() ); 
    146170     
    147     return m_Slave.getValue(); 
     171    return m_Slave.getValue();*/ 
     172    return value; 
    148173} 
    149174 
     
    169194{ 
    170195    m_Slave.setValue(value); 
     196     
     197/*    usleep(1000*500); 
    171198    debugOutput( DEBUG_LEVEL_VERBOSE, "setValue(%d) => %d\n", value, m_Slave.getValue() ); 
    172199     
    173     return m_Slave.getValue(); 
     200    return m_Slave.getValue();*/ 
     201    return value; 
    174202} 
    175203 
     
    181209} 
    182210 
     211// --- ConfigRom 
     212 
     213ConfigRomX::ConfigRomX( DBus::Connection& connection, std::string p, ConfigRom &slave) 
     214: Element(connection, p, slave) 
     215, m_Slave(slave) 
     216{ 
     217    debugOutput( DEBUG_LEVEL_VERBOSE, "Created ConfigRomX on '%s'\n", 
     218                 path().c_str() ); 
     219} 
     220 
     221DBus::String 
     222ConfigRomX::getGUID( ) 
     223{ 
     224    return m_Slave.getGuidString(); 
     225} 
     226 
     227DBus::String 
     228ConfigRomX::getVendorName( ) 
     229{ 
     230    return m_Slave.getVendorName(); 
     231} 
     232 
     233DBus::String 
     234ConfigRomX::getModelName( ) 
     235{ 
     236    return m_Slave.getModelName(); 
     237} 
     238 
     239DBus::Int32 
     240ConfigRomX::getVendorId( ) 
     241{ 
     242    return m_Slave.getNodeVendorId(); 
     243} 
     244 
     245DBus::Int32 
     246ConfigRomX::getModelId( ) 
     247{ 
     248    return m_Slave.getModelId(); 
     249} 
     250 
    183251} // end of namespace Control 
  • trunk/libffado/tests/controlserver.h

    r582 r644  
    3333 
    3434#include "libcontrol/BasicElements.h" 
     35#include "libieee1394/configrom.h" 
    3536 
    3637namespace DBusControl { 
     
    7374     
    7475    Element *createHandler(Control::Element& e); 
     76 
     77    DBus::Int32 getNbElements( ); 
     78    DBus::String getElementName( const DBus::Int32& ); 
     79 
    7580private: 
    7681    Control::Container &m_Slave; 
     
    110115}; 
    111116 
     117// FIXME: to change this to a normal ConfigRom class name we have to 
     118// put the 1394 config rom class into a separate namespace. 
     119class ConfigRomX 
     120: public org::ffado::Control::Element::ConfigRomX 
     121, public Element 
     122{ 
     123public: 
     124    ConfigRomX( DBus::Connection& connection, 
     125                  std::string p, 
     126                  ConfigRom &slave ); 
     127 
     128    DBus::String getGUID( ); 
     129    DBus::String getVendorName( ); 
     130    DBus::String getModelName( ); 
     131    DBus::Int32 getVendorId( ); 
     132    DBus::Int32 getModelId( ); 
     133 
     134private: 
     135    ConfigRom &m_Slave; 
     136}; 
     137 
    112138 
    113139}