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