Show
Ignore:
Timestamp:
08/29/07 02:19:04 (15 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/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();