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/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);