Changeset 583 for trunk/libffado

Show
Ignore:
Timestamp:
08/29/07 02:19:04 (16 years ago)
Author:
ppalmers
Message:

- Clean up the FFADODevice constructor to remove the nodeid that

can be retrieved from the configrom.

- Implement new method of creating devices: a device is supposed

to implement the createDevice static method that should return
an instance of itself or a subclass of itself. This should ease
support for manufacturer specific customizations since we don't
have to put them into the device manager class.

Files:

Legend:

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

    r580 r583  
    8282}; 
    8383 
    84 AvDevice::AvDevice( std::auto_ptr< ConfigRom >( configRom ), 
    85                     Ieee1394Service& ieee1394service, 
    86                     int nodeId ) 
    87     : GenericAVC::AvDevice( configRom, ieee1394service, nodeId ) 
     84AvDevice::AvDevice( Ieee1394Service& ieee1394service, 
     85                    std::auto_ptr< ConfigRom >( configRom ) ) 
     86    : GenericAVC::AvDevice( ieee1394service, configRom ) 
    8887    , m_Mixer ( NULL ) 
    8988{ 
    9089    debugOutput( DEBUG_LEVEL_VERBOSE, "Created BeBoB::AvDevice (NodeID %d)\n", 
    91                  nodeId ); 
     90                 configRom->getNodeId() ); 
    9291} 
    9392 
     
    171170} 
    172171 
     172FFADODevice * 
     173AvDevice::createDevice( Ieee1394Service& ieee1394Service, 
     174                        std::auto_ptr<ConfigRom>( configRom )) 
     175{ 
     176    return new AvDevice(ieee1394Service, configRom ); 
     177} 
     178 
    173179bool 
    174180AvDevice::discover() 
     
    240246    ExtendedStreamFormatCmd extStreamFormatCmd( *m_p1394Service ); 
    241247    UnitPlugAddress unitPlugAddress( UnitPlugAddress::ePT_PCR, 
    242                                      m_nodeId ); 
     248                                     getNodeId() ); 
    243249    extStreamFormatCmd.setPlugAddress( PlugAddress( PlugAddress::ePD_Input, 
    244250                                                    PlugAddress::ePAM_Unit, 
    245251                                                    unitPlugAddress ) ); 
    246252 
    247     extStreamFormatCmd.setNodeId( m_nodeId ); 
     253    extStreamFormatCmd.setNodeId( getNodeId() ); 
    248254    extStreamFormatCmd.setCommandType( AVCCommand::eCT_Status ); 
    249255    extStreamFormatCmd.setVerbose( true ); 
     
    274280    ExtendedPlugInfoCmd extPlugInfoCmd( *m_p1394Service ); 
    275281    UnitPlugAddress unitPlugAddress( UnitPlugAddress::ePT_PCR, 
    276                                      m_nodeId ); 
     282                                     getNodeId() ); 
    277283    extPlugInfoCmd.setPlugAddress( PlugAddress( ePlugDirection, 
    278284                                                PlugAddress::ePAM_Unit, 
    279285                                                unitPlugAddress ) ); 
    280     extPlugInfoCmd.setNodeId( m_nodeId ); 
     286    extPlugInfoCmd.setNodeId( getNodeId() ); 
    281287    extPlugInfoCmd.setCommandType( AVCCommand::eCT_Status ); 
    282288    extPlugInfoCmd.setVerbose( true ); 
     
    311317    signalUnitAddr.m_plugId = 0x01; 
    312318    signalSourceCmd.setSignalDestination( signalUnitAddr ); 
    313     signalSourceCmd.setNodeId( m_nodeId ); 
     319    signalSourceCmd.setNodeId( getNodeId() ); 
    314320    signalSourceCmd.setSubunitType( eST_Unit  ); 
    315321    signalSourceCmd.setSubunitId( 0xff ); 
  • trunk/libffado/src/bebob/bebob_avdevice.h

    r580 r583  
    5858class AvDevice : public GenericAVC::AvDevice { 
    5959public: 
    60     AvDevice( std::auto_ptr<ConfigRom>( configRom ), 
    61               Ieee1394Service& ieee1394Service, 
    62               int nodeId ); 
     60    AvDevice( Ieee1394Service& ieee1394Service, 
     61              std::auto_ptr<ConfigRom>( configRom )); 
    6362    virtual ~AvDevice(); 
    6463 
     
    6766    virtual bool saveCache(); 
    6867    virtual bool discover(); 
     68 
     69    static FFADODevice * createDevice( Ieee1394Service& ieee1394Service, 
     70                                        std::auto_ptr<ConfigRom>( configRom )); 
    6971 
    7072    virtual AVC::Subunit* createSubunit(AVC::Unit& unit, 
  • trunk/libffado/src/bounce/bounce_avdevice.cpp

    r554 r583  
    5252}; 
    5353 
    54 BounceDevice::BounceDevice( std::auto_ptr< ConfigRom >( configRom ), 
    55                             Ieee1394Service& ieee1394service, 
    56                             int nodeId ) 
    57     : FFADODevice( configRom, ieee1394service, nodeId ) 
     54BounceDevice::BounceDevice( Ieee1394Service& ieee1394Service, 
     55                            std::auto_ptr<ConfigRom>( configRom )) 
     56    : FFADODevice( ieee1394Service, configRom ) 
    5857    , m_samplerate (44100) 
    5958    , m_model( NULL ) 
     
    6160{ 
    6261    debugOutput( DEBUG_LEVEL_VERBOSE, "Created Bounce::BounceDevice (NodeID %d)\n", 
    63                  nodeId ); 
     62                 configRom->getNodeId() ); 
    6463    addOption(Util::OptionContainer::Option("snoopMode",false)); 
    6564} 
     
    9796} 
    9897 
     98FFADODevice * 
     99BounceDevice::createDevice( Ieee1394Service& ieee1394Service, 
     100                            std::auto_ptr<ConfigRom>( configRom )) 
     101{ 
     102    return new BounceDevice(ieee1394Service, configRom ); 
     103} 
     104 
    99105bool 
    100106BounceDevice::discover() 
    101107{ 
    102108    debugOutput( DEBUG_LEVEL_VERBOSE, "discovering BounceDevice (NodeID %d)\n", 
    103                  m_nodeId ); 
     109                 getNodeId() ); 
    104110 
    105111//     unsigned int vendorId = m_pConfigRom->getNodeVendorId(); 
     
    165171    debugOutput(DEBUG_LEVEL_NORMAL, "Vendor Name       :  %s\n", m_model->vendor_name); 
    166172    debugOutput(DEBUG_LEVEL_NORMAL, "Model Name        :  %s\n", m_model->model_name); 
    167     debugOutput(DEBUG_LEVEL_NORMAL, "Node              :  %d\n", m_nodeId); 
     173    debugOutput(DEBUG_LEVEL_NORMAL, "Node              :  %d\n", getNodeId()); 
    168174    debugOutput(DEBUG_LEVEL_NORMAL, "GUID              :  0x%016llX\n", m_pConfigRom->getGuid()); 
    169175    debugOutput(DEBUG_LEVEL_NORMAL, "\n" ); 
     
    525531 
    526532    fb_nodeaddr_t addr=BOUNCE_REGISTER_BASE + offset; 
    527     fb_nodeid_t nodeId=m_nodeId | 0xFFC0; 
     533    fb_nodeid_t nodeId=getNodeId() | 0xFFC0; 
    528534 
    529535    if(!m_p1394Service->read_quadlet( nodeId, addr, result ) ) { 
     
    547553 
    548554    fb_nodeaddr_t addr=BOUNCE_REGISTER_BASE + offset; 
    549     fb_nodeid_t nodeId=m_nodeId | 0xFFC0; 
     555    fb_nodeid_t nodeId=getNodeId() | 0xFFC0; 
    550556 
    551557    if(!m_p1394Service->write_quadlet( nodeId, addr, data ) ) { 
     
    567573 
    568574    fb_nodeaddr_t addr=BOUNCE_REGISTER_BASE + offset; 
    569     fb_nodeid_t nodeId=m_nodeId | 0xFFC0; 
     575    fb_nodeid_t nodeId=getNodeId() | 0xFFC0; 
    570576 
    571577    if(!m_p1394Service->read( nodeId, addr, length, data ) ) { 
     
    587593 
    588594    fb_nodeaddr_t addr=BOUNCE_REGISTER_BASE + offset; 
    589     fb_nodeid_t nodeId=m_nodeId | 0xFFC0; 
     595    fb_nodeid_t nodeId=getNodeId() | 0xFFC0; 
    590596 
    591597    if(!m_p1394Service->write( nodeId, addr, length, data ) ) { 
  • trunk/libffado/src/bounce/bounce_avdevice.h

    r554 r583  
    6969    class BounceNotifier; 
    7070public: 
    71     BounceDevice( std::auto_ptr<ConfigRom>( configRom ), 
    72           Ieee1394Service& ieee1394Service, 
    73           int nodeId ); 
     71    BounceDevice( Ieee1394Service& ieee1394Service, 
     72                  std::auto_ptr<ConfigRom>( configRom )); 
    7473    virtual ~BounceDevice(); 
    7574 
    7675    static bool probe( ConfigRom& configRom ); 
     76    static FFADODevice * createDevice( Ieee1394Service& ieee1394Service, 
     77                                        std::auto_ptr<ConfigRom>( configRom )); 
    7778    static int getConfigurationId( ); 
    7879    virtual bool discover(); 
  • trunk/libffado/src/bounce/bounce_slave_avdevice.cpp

    r445 r583  
    4141}; 
    4242 
    43 BounceSlaveDevice::BounceSlaveDevice( std::auto_ptr< ConfigRom >( configRom ), 
    44                             Ieee1394Service& ieee1394service ) 
    45     : BounceDevice( configRom, 
    46                     ieee1394service, 
    47                     ieee1394service.getLocalNodeId() ) 
     43BounceSlaveDevice::BounceSlaveDevice( Ieee1394Service& ieee1394Service, 
     44                                      std::auto_ptr<ConfigRom>( configRom )) 
     45    : BounceDevice( ieee1394Service, configRom ) 
    4846{ 
    4947    addOption(Util::OptionContainer::Option("isoTimeoutSecs",(int64_t)120)); 
     
    5957    // we are always capable of constructing a slave device 
    6058    return true; 
     59} 
     60 
     61FFADODevice * 
     62BounceSlaveDevice::createDevice( Ieee1394Service& ieee1394Service, 
     63                            std::auto_ptr<ConfigRom>( configRom )) 
     64{ 
     65    return new BounceSlaveDevice(ieee1394Service, configRom ); 
    6166} 
    6267 
     
    104109        // This should be handled more carefuly. 
    105110        debugError( "Could not reread config rom from device (node id %d).\n", 
    106                      m_nodeId ); 
     111                     getNodeId() ); 
    107112        return false; 
    108113    } 
     
    119124BounceSlaveDevice::lock() { 
    120125    debugOutput(DEBUG_LEVEL_VERBOSE, "Locking %s %s at node %d\n", 
    121         m_model->vendor_name, m_model->model_name, m_nodeId); 
     126        m_model->vendor_name, m_model->model_name, getNodeId()); 
    122127 
    123128    // get a notifier to handle device notifications 
  • trunk/libffado/src/bounce/bounce_slave_avdevice.h

    r445 r583  
    4545public: 
    4646 
    47     BounceSlaveDevice( std::auto_ptr<ConfigRom>( configRom )
    48           Ieee1394Service& ieee1394Service ); 
     47    BounceSlaveDevice( Ieee1394Service& ieee1394Service
     48                       std::auto_ptr<ConfigRom>( configRom )); 
    4949    virtual ~BounceSlaveDevice(); 
    5050 
    5151    static bool probe( ConfigRom& configRom ); 
     52    static FFADODevice * createDevice( Ieee1394Service& ieee1394Service, 
     53                                        std::auto_ptr<ConfigRom>( configRom )); 
    5254    bool discover(); 
    5355    bool prepare(); 
  • trunk/libffado/src/devicemanager.cpp

    r581 r583  
    330330    debugOutput( DEBUG_LEVEL_VERBOSE, "Trying BeBoB...\n" ); 
    331331    if ( BeBoB::AvDevice::probe( *configRom.get() ) ) { 
    332         return new BeBoB::AvDevice( configRom, *m_1394Service, id ); 
     332        return BeBoB::AvDevice::createDevice( *m_1394Service, configRom ); 
    333333    } 
    334334#endif 
     
    337337    debugOutput( DEBUG_LEVEL_VERBOSE, "Trying Generic AV/C...\n" ); 
    338338    if ( GenericAVC::AvDevice::probe( *configRom.get() ) ) { 
    339         return new GenericAVC::AvDevice( configRom, *m_1394Service, id ); 
     339        return GenericAVC::AvDevice::createDevice( *m_1394Service, configRom ); 
    340340    } 
    341341#endif 
     
    344344    debugOutput( DEBUG_LEVEL_VERBOSE, "Trying M-Audio...\n" ); 
    345345    if ( MAudio::AvDevice::probe( *configRom.get() ) ) { 
    346         return new MAudio::AvDevice( configRom, *m_1394Service, id ); 
     346        return MAudio::AvDevice::createDevice( *m_1394Service, configRom ); 
    347347    } 
    348348#endif 
     
    351351    debugOutput( DEBUG_LEVEL_VERBOSE, "Trying Motu...\n" ); 
    352352    if ( Motu::MotuDevice::probe( *configRom.get() ) ) { 
    353         return new Motu::MotuDevice( configRom, *m_1394Service, id ); 
     353        return Motu::MotuDevice::createDevice( *m_1394Service, configRom ); 
    354354    } 
    355355#endif 
     
    358358    debugOutput( DEBUG_LEVEL_VERBOSE, "Trying Dice...\n" ); 
    359359    if ( Dice::DiceAvDevice::probe( *configRom.get() ) ) { 
    360         return new Dice::DiceAvDevice( configRom, *m_1394Service, id ); 
     360        return Dice::DiceAvDevice::createDevice( *m_1394Service, configRom ); 
    361361    } 
    362362#endif 
     
    365365    debugOutput( DEBUG_LEVEL_VERBOSE, "Trying Metric Halo...\n" ); 
    366366    if ( MetricHalo::MHAvDevice::probe( *configRom.get() ) ) { 
    367         return new MetricHalo::MHAvDevice( configRom, *m_1394Service, id ); 
     367        return MetricHalo::MHAvDevice::createDevice( *m_1394Service, configRom ); 
    368368    } 
    369369#endif 
     
    372372    debugOutput( DEBUG_LEVEL_VERBOSE, "Trying RME...\n" ); 
    373373    if ( Rme::RmeDevice::probe( *configRom.get() ) ) { 
    374         return new Rme::RmeDevice( configRom, *m_1394Service, id ); 
     374        return Rme::RmeDevice::createDevice( *m_1394Service, configRom ); 
    375375    } 
    376376#endif 
     
    379379    debugOutput( DEBUG_LEVEL_VERBOSE, "Trying Bounce...\n" ); 
    380380    if ( Bounce::BounceDevice::probe( *configRom.get() ) ) { 
    381         return new Bounce::BounceDevice( configRom, *m_1394Service, id ); 
     381        return Bounce::BounceDevice::createDevice( *m_1394Service, configRom ); 
    382382    } 
    383383#endif 
     
    392392#ifdef ENABLE_BOUNCE 
    393393    if ( Bounce::BounceSlaveDevice::probe( *configRom.get() ) ) { 
    394         return new Bounce::BounceSlaveDevice( configRom, *m_1394Service ); 
     394        return Bounce::BounceSlaveDevice::createDevice( *m_1394Service, configRom ); 
    395395    } 
    396396#endif 
  • trunk/libffado/src/dice/dice_avdevice.cpp

    r554 r583  
    5151}; 
    5252 
    53 DiceAvDevice::DiceAvDevice( std::auto_ptr< ConfigRom >( configRom ), 
    54                     Ieee1394Service& ieee1394service, 
    55                     int nodeId ) 
    56     : FFADODevice( configRom, ieee1394service, nodeId ) 
     53DiceAvDevice::DiceAvDevice( Ieee1394Service& ieee1394Service, 
     54                            std::auto_ptr<ConfigRom>( configRom )) 
     55    : FFADODevice( ieee1394Service, configRom ) 
    5756    , m_model( NULL ) 
    5857    , m_global_reg_offset (0xFFFFFFFFLU) 
     
    7372{ 
    7473    debugOutput( DEBUG_LEVEL_VERBOSE, "Created Dice::DiceAvDevice (NodeID %d)\n", 
    75                  nodeId ); 
     74                 configRom->getNodeId() ); 
    7675 
    7776} 
     
    105104 
    106105    return false; 
     106} 
     107 
     108FFADODevice * 
     109DiceAvDevice::createDevice( Ieee1394Service& ieee1394Service, 
     110                            std::auto_ptr<ConfigRom>( configRom )) 
     111{ 
     112    return new DiceAvDevice(ieee1394Service, configRom ); 
    107113} 
    108114 
     
    282288    debugOutput(DEBUG_LEVEL_VERBOSE, 
    283289        "%s %s at node %d\n", m_model->vendor_name, m_model->model_name, 
    284         m_nodeId); 
     290        getNodeId()); 
    285291 
    286292    debugOutput(DEBUG_LEVEL_VERBOSE," DICE Parameter Space info:\n"); 
     
    666672 
    667673    debugOutput(DEBUG_LEVEL_VERBOSE, "Locking %s %s at node %d\n", 
    668         m_model->vendor_name, m_model->model_name, m_nodeId); 
     674        m_model->vendor_name, m_model->model_name, getNodeId()); 
    669675 
    670676    // get a notifier to handle device notifications 
     
    710716    swap_value |= m_notifier->getStart(); 
    711717 
    712     if (!m_p1394Service->lockCompareSwap64(  m_nodeId | 0xFFC0, addr, DICE_OWNER_NO_OWNER, 
     718    if (!m_p1394Service->lockCompareSwap64(  getNodeId() | 0xFFC0, addr, DICE_OWNER_NO_OWNER, 
    713719                                       swap_value, &result )) { 
    714720        debugWarning("Could not register ourselves as device owner\n"); 
     
    747753    compare_value |= m_notifier->getStart(); 
    748754 
    749     if (!m_p1394Service->lockCompareSwap64(  m_nodeId | 0xFFC0, addr, compare_value, 
     755    if (!m_p1394Service->lockCompareSwap64(  getNodeId() | 0xFFC0, addr, compare_value, 
    750756                                       DICE_OWNER_NO_OWNER, &result )) { 
    751757        debugWarning("Could not unregister ourselves as device owner\n"); 
     
    12021208 
    12031209    fb_nodeaddr_t addr=DICE_REGISTER_BASE + offset; 
    1204     fb_nodeid_t nodeId=m_nodeId | 0xFFC0; 
     1210    fb_nodeid_t nodeId=getNodeId() | 0xFFC0; 
    12051211 
    12061212    if(!m_p1394Service->read_quadlet( nodeId, addr, result ) ) { 
     
    12271233 
    12281234    fb_nodeaddr_t addr=DICE_REGISTER_BASE + offset; 
    1229     fb_nodeid_t nodeId=m_nodeId | 0xFFC0; 
     1235    fb_nodeid_t nodeId=getNodeId() | 0xFFC0; 
    12301236 
    12311237    if(!m_p1394Service->write_quadlet( nodeId, addr, htonl(data) ) ) { 
     
    12471253 
    12481254    fb_nodeaddr_t addr=DICE_REGISTER_BASE + offset; 
    1249     fb_nodeid_t nodeId=m_nodeId | 0xFFC0; 
     1255    fb_nodeid_t nodeId=getNodeId() | 0xFFC0; 
    12501256 
    12511257    if(!m_p1394Service->read( nodeId, addr, length/4, data ) ) { 
     
    12721278 
    12731279    fb_nodeaddr_t addr=DICE_REGISTER_BASE + offset; 
    1274     fb_nodeid_t nodeId=m_nodeId | 0xFFC0; 
     1280    fb_nodeid_t nodeId=getNodeId() | 0xFFC0; 
    12751281 
    12761282    fb_quadlet_t data_out[length/4]; 
  • trunk/libffado/src/dice/dice_avdevice.h

    r554 r583  
    5656    class DiceNotifier; 
    5757public: 
    58     DiceAvDevice( std::auto_ptr<ConfigRom>( configRom ), 
    59                   Ieee1394Service& ieee1394Service, 
    60                   int nodeId); 
     58    DiceAvDevice( Ieee1394Service& ieee1394Service, 
     59                  std::auto_ptr<ConfigRom>( configRom )); 
    6160    ~DiceAvDevice(); 
    6261 
    6362    static bool probe( ConfigRom& configRom ); 
     63    static FFADODevice * createDevice( Ieee1394Service& ieee1394Service, 
     64                                        std::auto_ptr<ConfigRom>( configRom )); 
     65    virtual bool discover(); 
     66 
    6467    static int getConfigurationId( ); 
    65     virtual bool discover(); 
    6668 
    6769    virtual void showDevice(); 
  • trunk/libffado/src/ffadodevice.cpp

    r581 r583  
    3535IMPL_DEBUG_MODULE( FFADODevice, FFADODevice, DEBUG_LEVEL_NORMAL ); 
    3636 
    37 FFADODevice::FFADODevice( std::auto_ptr< ConfigRom >( configRom ), 
    38                     Ieee1394Service& ieee1394service, 
    39                     int nodeId ) 
     37FFADODevice::FFADODevice( Ieee1394Service& ieee1394Service, 
     38                    std::auto_ptr<ConfigRom>( configRom )) 
    4039    : Control::Container() 
    4140    , m_pConfigRom( configRom ) 
    42     , m_p1394Service( &ieee1394service ) 
    43     , m_nodeId ( nodeId ) 
     41    , m_p1394Service( &ieee1394Service ) 
    4442{ 
    4543    addOption(Util::OptionContainer::Option("id",std::string("dev?"))); 
    4644 
    4745    std::ostringstream nodestr; 
    48     nodestr << "node" << nodeId; 
     46    nodestr << "node" << m_pConfigRom->getNodeId(); 
     47     
    4948//     setOscBase(nodestr.str()); 
    50     ConfigRom& c = getConfigRom(); 
     49//     ConfigRom& c = getConfigRom(); 
     50//     addChildOscNode(&c); 
     51
    5152 
    52 //     addChildOscNode(&c); 
     53FFADODevice * 
     54FFADODevice::createDevice( Ieee1394Service& , 
     55                           std::auto_ptr<ConfigRom>( x )) 
     56
     57    // re-implement this!! 
     58    assert(0); 
     59    return NULL; 
    5360} 
    5461 
     
    5764{ 
    5865    return getConfigRom().getGuidString(); 
     66} 
     67 
     68int 
     69FFADODevice::getNodeId() 
     70{ 
     71    return getConfigRom().getNodeId(); 
    5972} 
    6073 
  • trunk/libffado/src/ffadodevice.h

    r581 r583  
    4848{ 
    4949public: 
    50     FFADODevice( std::auto_ptr< ConfigRom >( configRom ), 
    51                     Ieee1394Service& ieee1394service, 
    52                     int nodeId ); 
     50    FFADODevice( Ieee1394Service& ieee1394service, 
     51                 std::auto_ptr< ConfigRom >( configRom ) ); 
    5352 
    5453    virtual ~FFADODevice() {}; 
     
    9796 
    9897    /** 
     98     * @brief This is called by the DeviceManager to create an instance of the device 
     99     * 
     100     * This function enables the FFADODevice to return a subclass of itself should that 
     101     * be needed. If we don't do this we'd need to know about the subclasses in the  
     102     * devicemanager, whilst now we don't. 
     103     *  
     104     * The function should return an instance of either the class itself or a subclass 
     105     * of itself. 
     106     * 
     107     * This should be overridden in any subclass. 
     108     * 
     109     * @return a new instance of the AvDevice type, NULL when unsuccessful 
     110     */ 
     111    static FFADODevice * createDevice( Ieee1394Service& , 
     112                                        std::auto_ptr<ConfigRom>( x )); 
     113 
     114    /** 
    99115     * @brief This is called by the DeviceManager to discover & configure the device 
    100116     * 
     
    286302     * @return the node id 
    287303     */ 
    288     int getNodeId() { return m_nodeId;}
     304    int getNodeId()
    289305 
    290306    // the Control::Container functions 
     
    297313    std::auto_ptr<ConfigRom>( m_pConfigRom ); 
    298314    Ieee1394Service*          m_p1394Service; 
    299     int                       m_nodeId; 
    300315 
    301316    DECLARE_DEBUG_MODULE; 
  • trunk/libffado/src/genericavc/avc_avdevice.cpp

    r560 r583  
    5656}; 
    5757 
    58 AvDevice::AvDevice( std::auto_ptr< ConfigRom >( configRom ), 
    59                     Ieee1394Service& ieee1394service, 
    60                     int nodeId ) 
    61     :  FFADODevice( configRom, ieee1394service, nodeId ) 
     58AvDevice::AvDevice( Ieee1394Service& ieee1394Service, 
     59                    std::auto_ptr<ConfigRom>( configRom )) 
     60    : FFADODevice( ieee1394Service, configRom ) 
    6261    , m_model( NULL ) 
    6362 
    6463{ 
    6564    debugOutput( DEBUG_LEVEL_VERBOSE, "Created GenericAVC::AvDevice (NodeID %d)\n", 
    66                  nodeId ); 
     65                 configRom->getNodeId() ); 
    6766    addOption(Util::OptionContainer::Option("snoopMode",false)); 
    6867} 
     
    9291 
    9392    return false; 
     93} 
     94 
     95FFADODevice * 
     96AvDevice::createDevice( Ieee1394Service& ieee1394Service, 
     97                        std::auto_ptr<ConfigRom>( configRom )) 
     98{ 
     99    return new AvDevice(ieee1394Service, configRom ); 
    94100} 
    95101 
  • trunk/libffado/src/genericavc/avc_avdevice.h

    r557 r583  
    4747class AvDevice : public FFADODevice, public AVC::Unit { 
    4848public: 
    49     AvDevice( std::auto_ptr<ConfigRom>( configRom ), 
    50           Ieee1394Service& ieee1394Service, 
    51           int nodeId ); 
     49    AvDevice( Ieee1394Service& ieee1394Service, 
     50              std::auto_ptr<ConfigRom>( configRom )); 
    5251    virtual ~AvDevice(); 
    5352 
    5453    static bool probe( ConfigRom& configRom ); 
    5554    virtual bool discover(); 
     55    static FFADODevice * createDevice( Ieee1394Service& ieee1394Service, 
     56                                        std::auto_ptr<ConfigRom>( configRom )); 
    5657     
    5758    virtual void setVerboseLevel(int l); 
  • trunk/libffado/src/maudio/maudio_avdevice.cpp

    r554 r583  
    4040namespace MAudio { 
    4141 
    42 AvDevice::AvDevice( std::auto_ptr< ConfigRom >( configRom ), 
    43                     Ieee1394Service& ieee1394service, 
    44                     int iNodeId ) 
    45     : BeBoB::AvDevice( configRom, 
    46                     ieee1394service, 
    47                     iNodeId ) 
     42AvDevice::AvDevice( Ieee1394Service& ieee1394Service, 
     43                    std::auto_ptr<ConfigRom>( configRom )) 
     44    : BeBoB::AvDevice( ieee1394Service, configRom) 
    4845    , m_model ( NULL ) 
    4946{ 
    5047    debugOutput( DEBUG_LEVEL_VERBOSE, "Created MAudio::AvDevice (NodeID %d)\n", 
    51                  iNodeId ); 
     48                 configRom->getNodeId() ); 
    5249} 
    5350 
     
    8279    } 
    8380    return false; 
     81} 
     82 
     83FFADODevice * 
     84AvDevice::createDevice( Ieee1394Service& ieee1394Service, 
     85                        std::auto_ptr<ConfigRom>( configRom )) 
     86{ 
     87    return new AvDevice(ieee1394Service, configRom ); 
    8488} 
    8589 
  • trunk/libffado/src/maudio/maudio_avdevice.h

    r554 r583  
    5353class AvDevice : public BeBoB::AvDevice { 
    5454public: 
    55     AvDevice( std::auto_ptr<ConfigRom>( configRom ), 
    56           Ieee1394Service& ieee1394Service, 
    57               int nodeId ); 
     55    AvDevice( Ieee1394Service& ieee1394Service, 
     56              std::auto_ptr<ConfigRom>( configRom )); 
    5857    virtual ~AvDevice(); 
    5958 
    6059    static bool probe( ConfigRom& configRom ); 
    61     static int getConfigurationId( ); 
     60    static FFADODevice * createDevice( Ieee1394Service& ieee1394Service, 
     61                                        std::auto_ptr<ConfigRom>( configRom )); 
    6262    virtual bool discover(); 
    6363 
     64    static int getConfigurationId( ); 
     65     
    6466    virtual void showDevice(); 
    6567 
  • trunk/libffado/src/metrichalo/mh_avdevice.cpp

    r554 r583  
    5050}; 
    5151 
    52 MHAvDevice::MHAvDevice( std::auto_ptr< ConfigRom >( configRom ), 
    53                     Ieee1394Service& ieee1394service, 
    54                     int nodeId ) 
    55     :  FFADODevice( configRom, ieee1394service, nodeId ) 
     52MHAvDevice::MHAvDevice( Ieee1394Service& ieee1394Service, 
     53                        std::auto_ptr<ConfigRom>( configRom )) 
     54    : FFADODevice( ieee1394Service, configRom ) 
    5655    , m_model( NULL ) 
    5756 
    5857{ 
    5958    debugOutput( DEBUG_LEVEL_VERBOSE, "Created MetricHalo::MHAvDevice (NodeID %d)\n", 
    60                  nodeId ); 
     59                 configRom->getNodeId() ); 
    6160} 
    6261 
     
    8584 
    8685    return false; 
     86} 
     87 
     88FFADODevice * 
     89MHAvDevice::createDevice( Ieee1394Service& ieee1394Service, 
     90                          std::auto_ptr<ConfigRom>( configRom )) 
     91{ 
     92    return new MHAvDevice(ieee1394Service, configRom ); 
    8793} 
    8894 
     
    149155    debugOutput(DEBUG_LEVEL_VERBOSE, 
    150156        "%s %s at node %d\n", m_model->vendor_name, m_model->model_name, 
    151         m_nodeId); 
     157        getNodeId()); 
    152158} 
    153159 
  • trunk/libffado/src/metrichalo/mh_avdevice.h

    r554 r583  
    4747class MHAvDevice : public FFADODevice { 
    4848public: 
    49     MHAvDevice( std::auto_ptr<ConfigRom>( configRom ), 
    50           Ieee1394Service& ieee1394Service, 
    51           int nodeId ); 
     49    MHAvDevice( Ieee1394Service& ieee1394Service, 
     50                std::auto_ptr<ConfigRom>( configRom )); 
    5251    virtual ~MHAvDevice(); 
    5352 
    5453    static bool probe( ConfigRom& configRom ); 
     54    static FFADODevice * createDevice( Ieee1394Service& ieee1394Service, 
     55                                        std::auto_ptr<ConfigRom>( configRom )); 
    5556    static int getConfigurationId(); 
    5657    virtual bool discover(); 
  • trunk/libffado/src/motu/motu_avdevice.cpp

    r554 r583  
    5656}; 
    5757 
    58 MotuDevice::MotuDevice( std::auto_ptr< ConfigRom >( configRom ), 
    59                     Ieee1394Service& ieee1394service, 
    60                     int nodeId) 
    61     : FFADODevice( configRom, ieee1394service, nodeId ) 
     58MotuDevice::MotuDevice( Ieee1394Service& ieee1394Service, 
     59                        std::auto_ptr<ConfigRom>( configRom )) 
     60    : FFADODevice( ieee1394Service, configRom ) 
    6261    , m_motu_model( MOTUFW_MODEL_NONE ) 
    6362    , m_iso_recv_channel ( -1 ) 
     
    6968{ 
    7069    debugOutput( DEBUG_LEVEL_VERBOSE, "Created Motu::MotuDevice (NodeID %d)\n", 
    71                  nodeId ); 
     70                 configRom->getNodeId() ); 
    7271 
    7372} 
     
    109108 
    110109    return false; 
     110} 
     111 
     112FFADODevice * 
     113MotuDevice::createDevice( Ieee1394Service& ieee1394Service, 
     114                          std::auto_ptr<ConfigRom>( configRom )) 
     115{ 
     116    return new MotuDevice(ieee1394Service, configRom ); 
    111117} 
    112118 
     
    316322    debugOutput(DEBUG_LEVEL_VERBOSE, 
    317323        "%s %s at node %d\n", m_model->vendor_name, m_model->model_name, 
    318         m_nodeId); 
     324        getNodeId()); 
    319325} 
    320326 
     
    866872  quadlet = 0; 
    867873  // Note: 1394Service::read() expects a physical ID, not the node id 
    868   if (m_p1394Service->read(0xffc0 | m_nodeId, MOTUFW_BASE_ADDR+reg, 1, &quadlet) < 0) { 
     874  if (m_p1394Service->read(0xffc0 | getNodeId(), MOTUFW_BASE_ADDR+reg, 1, &quadlet) < 0) { 
    869875    debugError("Error doing motu read from register 0x%06x\n",reg); 
    870876  } 
     
    882888 
    883889  // Note: 1394Service::write() expects a physical ID, not the node id 
    884   if (m_p1394Service->write(0xffc0 | m_nodeId, MOTUFW_BASE_ADDR+reg, 1, &data) < 0) { 
     890  if (m_p1394Service->write(0xffc0 | getNodeId(), MOTUFW_BASE_ADDR+reg, 1, &data) < 0) { 
    885891    err = 1; 
    886892    debugError("Error doing motu write to register 0x%06x\n",reg); 
  • trunk/libffado/src/motu/motu_avdevice.h

    r554 r583  
    9494public: 
    9595 
    96     MotuDevice( std::auto_ptr<ConfigRom>( configRom ), 
    97           Ieee1394Service& ieee1394Service, 
    98           int nodeId ); 
     96    MotuDevice( Ieee1394Service& ieee1394Service, 
     97                std::auto_ptr<ConfigRom>( configRom )); 
    9998    virtual ~MotuDevice(); 
    10099 
    101100    static bool probe( ConfigRom& configRom ); 
     101    static FFADODevice * createDevice( Ieee1394Service& ieee1394Service, 
     102                                        std::auto_ptr<ConfigRom>( configRom )); 
    102103    static int getConfigurationId( ); 
    103104    virtual bool discover(); 
  • trunk/libffado/src/rme/rme_avdevice.cpp

    r554 r583  
    5050}; 
    5151 
    52 RmeDevice::RmeDevice( std::auto_ptr< ConfigRom >( configRom ), 
    53                     Ieee1394Service& ieee1394service, 
    54                     int nodeId ) 
    55     : FFADODevice( configRom, ieee1394service, nodeId ) 
     52RmeDevice::RmeDevice( Ieee1394Service& ieee1394Service, 
     53                      std::auto_ptr<ConfigRom>( configRom )) 
     54    : FFADODevice( ieee1394Service, configRom ) 
    5655    , m_model( NULL ) 
    5756{ 
    5857    debugOutput( DEBUG_LEVEL_VERBOSE, "Created Rme::RmeDevice (NodeID %d)\n", 
    59                  nodeId ); 
     58                 configRom->getNodeId() ); 
    6059} 
    6160 
     
    8483 
    8584    return false; 
     85} 
     86 
     87FFADODevice * 
     88RmeDevice::createDevice( Ieee1394Service& ieee1394Service, 
     89                         std::auto_ptr<ConfigRom>( configRom )) 
     90{ 
     91    return new RmeDevice(ieee1394Service, configRom ); 
    8692} 
    8793 
     
    156162        debugOutput(DEBUG_LEVEL_VERBOSE, 
    157163                "%s %s at node %d\n", m_model->vendor_name, m_model->model_name, 
    158                 m_nodeId); 
     164                getNodeId()); 
    159165} 
    160166 
  • trunk/libffado/src/rme/rme_avdevice.h

    r554 r583  
    4949public: 
    5050 
    51     RmeDevice( std::auto_ptr<ConfigRom>( configRom ), 
    52               Ieee1394Service& ieee1394Service, 
    53                   int nodeId ); 
     51    RmeDevice( Ieee1394Service& ieee1394Service, 
     52               std::auto_ptr<ConfigRom>( configRom )); 
    5453    virtual ~RmeDevice(); 
    5554 
    5655    static bool probe( ConfigRom& configRom ); 
     56    static FFADODevice * createDevice( Ieee1394Service& ieee1394Service, 
     57                                        std::auto_ptr<ConfigRom>( configRom )); 
    5758    static int getConfigurationId( ); 
    5859    virtual bool discover();