# Changeset 510

- Timestamp:
- 07/29/07 12:25:24 (14 years ago)
- Files:

### Legend:

- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved

## branches/echoaudio/src/libavc/general/avc_unit.cpp

r509 r510 326 326 template <typename T, typename VT> bool deserializeVector( Glib::ustring path, 327 327 Util::IODeserialize& deser, 328 Unit& ~~avDevice~~,328 Unit& unit, 329 329 VT& vec ) 330 330 { … … 336 336 T* ptr = T::deserialize( strstrm.str(), 337 337 deser, 338 ~~avDevice~~);338 unit ); 339 339 if ( ptr ) { 340 340 vec.push_back( ptr ); … … 378 378 Unit::deserializeSyncInfoVector( Glib::ustring basePath, 379 379 Util::IODeserialize& deser, 380 Unit& ~~avDevice~~,380 Unit& unit, 381 381 SyncInfoVector& vec ) 382 382 { … … 398 398 if ( result ) { 399 399 SyncInfo syncInfo; 400 syncInfo.m_source = ~~avDevice~~.getPlugManager().getPlug( sourceId );401 syncInfo.m_destination = ~~avDevice~~.getPlugManager().getPlug( destinationId );400 syncInfo.m_source = unit.getPlugManager().getPlug( sourceId ); 401 syncInfo.m_destination = unit.getPlugManager().getPlug( destinationId ); 402 402 syncInfo.m_description = description; 403 403 … … 439 439 result &= serializeVector( basePath + "Subunit", ser, m_subunits ); 440 440 result &= serializeSyncInfoVector( basePath + "SyncInfo", ser, m_syncInfos ); 441 441 442 442 int i = 0; 443 443 for ( SyncInfoVector::const_iterator it = m_syncInfos.begin(); … … 462 462 Ieee1394Service& ieee1394Service ) 463 463 { 464 465 if ( pDev ) { 466 bool result; 467 468 int verboseLevel; 469 result = deser.read( basePath + "m_verboseLevel_unit", verboseLevel ); 470 setDebugLevel( verboseLevel ); 471 472 if (pDev->m_pPlugManager) delete pDev->m_pPlugManager; 473 pDev->m_pPlugManager = PlugManager::deserialize( basePath + "Plug", deser, *pDev ); 474 if ( !pDev->m_pPlugManager ) { 475 delete pDev; 476 return 0; 477 } 478 result &= deserializePlugUpdateConnections( basePath + "Plug", deser, pDev->m_pcrPlugs ); 479 result &= deserializePlugUpdateConnections( basePath + "Plug", deser, pDev->m_externalPlugs ); 480 result &= deserializeVector<PlugConnection>( basePath + "PlugConnnection", deser, *pDev, pDev->m_plugConnections ); 481 result &= deserializeVector<Subunit>( basePath + "Subunit", deser, *pDev, pDev->m_subunits ); 482 result &= deserializeSyncInfoVector( basePath + "SyncInfo", deser, *pDev, pDev->m_syncInfos ); 483 484 unsigned int i; 485 result &= deser.read( basePath + "m_activeSyncInfo", i ); 486 487 if ( result ) { 488 if ( i < pDev->m_syncInfos.size() ) { 489 pDev->m_activeSyncInfo = &pDev->m_syncInfos[i]; 490 } 491 } 492 493 } 494 495 return pDev; 464 bool result; 465 466 int verboseLevel; 467 result = deser.read( basePath + "m_verboseLevel_unit", verboseLevel ); 468 setDebugLevel( verboseLevel ); 469 470 if (pDev->m_pPlugManager) delete pDev->m_pPlugManager; 471 pDev->m_pPlugManager = PlugManager::deserialize( basePath + "Plug", deser, *pDev ); 472 if ( !pDev->m_pPlugManager ) { 473 return false; 474 } 475 476 result &= deserializePlugUpdateConnections( basePath + "Plug", deser, pDev->m_pcrPlugs ); 477 result &= deserializePlugUpdateConnections( basePath + "Plug", deser, pDev->m_externalPlugs ); 478 result &= deserializeVector<PlugConnection>( basePath + "PlugConnnection", deser, *pDev, pDev->m_plugConnections ); 479 result &= deserializeVector<Subunit>( basePath + "Subunit", deser, *pDev, pDev->m_subunits ); 480 result &= deserializeSyncInfoVector( basePath + "SyncInfo", deser, *pDev, pDev->m_syncInfos ); 481 482 unsigned int i; 483 result &= deser.read( basePath + "m_activeSyncInfo", i ); 484 485 if ( result ) { 486 if ( i < pDev->m_syncInfos.size() ) { 487 pDev->m_activeSyncInfo = &pDev->m_syncInfos[i]; 488 } 489 } 490 491 return true; 496 492 } 497 493