Changeset 762

Show
Ignore:
Timestamp:
12/18/07 04:19:29 (15 years ago)
Author:
wagi
Message:

Bug fix for #53

Somehow there was a major fuckup. It didn't make any sense at all.
The deserializing code for the PcrPlug?, ExternalPlugs? and
m_inputConnections/m_outputConnections should now be consistend with
the serializing code.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/libavc/general/avc_plug.cpp

    r742 r762  
    16711671 
    16721672bool 
    1673 Plug::deserializeUpdate( Glib::ustring basePath, 
    1674                          Util::IODeserialize& deser ) 
     1673Plug::deserializeConnections( Glib::ustring basePath, 
     1674                              Util::IODeserialize& deser ) 
    16751675{ 
    16761676    bool result; 
    16771677 
    1678     result  = deserializePlugVector( basePath + "m_inputConnections", deser, 
     1678    result  = deserializePlugVector( basePath + "/m_inputConnections", deser, 
    16791679                                     m_unit->getPlugManager(), m_inputConnections ); 
    1680     result &= deserializePlugVector( basePath + "m_outputConnections", deser, 
     1680    result &= deserializePlugVector( basePath + "/m_outputConnections", deser, 
    16811681                                     m_unit->getPlugManager(), m_outputConnections ); 
    1682  
    16831682    return result; 
    16841683} 
     
    21842183 
    21852184bool 
    2186 PlugManager::deserializeUpdate() 
     2185PlugManager::deserializeUpdate( Glib::ustring basePath, 
     2186                                Util::IODeserialize& deser) 
    21872187{ 
    21882188    bool result = true; 
     
    21922192          ++it ) 
    21932193    { 
     2194 
    21942195        Plug* pPlug = *it; 
    21952196 
     2197        std::ostringstream strstrm; 
     2198        strstrm << basePath << "Plug" << pPlug->getGlobalId(); 
     2199 
     2200        result &= pPlug->deserializeConnections( strstrm.str(), deser ); 
    21962201        result &= pPlug->deserializeUpdateSubunit(); 
    21972202    } 
  • trunk/libffado/src/libavc/general/avc_plug.h

    r742 r762  
    160160                              Unit& avDevice, 
    161161                              PlugManager& plugManager ); 
    162  
    163     bool deserializeUpdate( Glib::ustring basePath, 
    164                             Util::IODeserialize& deser ); 
     162    bool deserializeConnections( Glib::ustring basePath,  
     163                                 Util::IODeserialize& deser ); 
    165164    bool deserializeUpdateSubunit(); 
    166165 
     
    344343    bool tidyPlugConnections(PlugConnectionVector&); 
    345344 
    346     bool deserializeUpdate(); 
     345    bool deserializeUpdate( Glib::ustring basePath,   
     346                            Util::IODeserialize& deser ); 
    347347 
    348348private: 
  • trunk/libffado/src/libavc/general/avc_unit.cpp

    r742 r762  
    951951} 
    952952 
    953 static bool 
    954 deserializePlugUpdateConnections( Glib::ustring path, 
    955                                   Util::IODeserialize& deser, 
    956                                   PlugVector& vec ) 
    957 { 
    958     bool result = true; 
    959     for ( PlugVector::iterator it = vec.begin(); 
    960           it != vec.end(); 
    961           ++it ) 
    962     { 
    963         Plug* pPlug = *it; 
    964         result &= pPlug->deserializeUpdate( path, deser ); 
    965     } 
    966     return result; 
    967 } 
    968  
    969953bool 
    970954Unit::serialize( Glib::ustring basePath, 
     
    1006990        delete m_pPlugManager; 
    1007991 
     992    // load all plugs 
    1008993    m_pPlugManager = PlugManager::deserialize( basePath + "Plug", deser, *this ); 
    1009994 
     
    1011996        return false; 
    1012997 
    1013     result &= deserializePlugVector( basePath + "PcrPlug", deser, getPlugManager(), m_pcrPlugs ); 
    1014     result &= deserializePlugVector( basePath + "ExternalPlug", deser, getPlugManager(), m_externalPlugs ); 
    1015     result &= deserializeVector<PlugConnection>( basePath + "PlugConnnection", deser, *this, m_plugConnections ); 
     998    // load path /PcrPlug0/global_id 
     999    result &= deserializePlugVector( basePath + "PcrPlug", deser, 
     1000                                     getPlugManager(), m_pcrPlugs ); 
     1001    // load path /ExternalPlug0/global_id 
     1002    result &= deserializePlugVector( basePath + "ExternalPlug", deser, 
     1003                                     getPlugManager(), m_externalPlugs ); 
     1004    result &= deserializeVector<PlugConnection>( basePath + "PlugConnnection", deser, 
     1005                                                 *this, m_plugConnections ); 
    10161006    result &= deserializeVector<Subunit>( basePath + "Subunit",  deser, *this, m_subunits ); 
    10171007    result &= deserializeSyncInfoVector( basePath + "SyncInfo", deser, m_syncInfos ); 
    10181008 
    1019     result &= deserializePlugUpdateConnections( basePath + "PcrPlug", deser, m_pcrPlugs ); 
    1020     result &= deserializePlugUpdateConnections( basePath + "ExternalPlug", deser, m_externalPlugs ); 
    1021     m_pPlugManager->deserializeUpdate(); 
     1009    // update connectsion between plugs (plug.m_inputConnections 
     1010    // and plug.m_outputConnnections list) 
     1011    m_pPlugManager->deserializeUpdate( basePath, deser ); 
    10221012 
    10231013    unsigned int i;