Changeset 1727

Show
Ignore:
Timestamp:
11/23/09 13:38:45 (14 years ago)
Author:
arnonym
Message:

Introduce a virtual factory function. That way subclasses can have subclassed EAPs created. Like EAPs dealing with the special Focusrite extensions...

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/dice/dice_avdevice.cpp

    r1712 r1727  
    164164    bool supports_eap = Device::EAP::supportsEAP(*this); 
    165165    if (supports_eap) { // FIXME: move to buildMixer() ?? 
    166         m_eap = new Device::EAP(*this); 
     166        m_eap = createEAP(); 
    167167        if(m_eap == NULL) { 
    168168            debugError("Failed to allocate EAP.\n"); 
     
    182182    } 
    183183    return true; 
     184} 
     185 
     186Device::EAP* 
     187Device::createEAP() { 
     188    return new Device::EAP(*this); 
    184189} 
    185190 
  • trunk/libffado/src/dice/dice_avdevice.h

    r1719 r1727  
    549549private: 
    550550    EAP*         m_eap; 
     551protected: 
     552    virtual EAP* createEAP(); 
    551553public: 
    552554    EAP* getEAP() {return m_eap;};