Changeset 734 for trunk/libffado/src/bebob
- Timestamp:
- 11/28/07 05:03:31 (16 years ago)
- Files:
-
- trunk/libffado/src/bebob/bebob_avdevice.h (modified) (1 diff)
- trunk/libffado/src/bebob/bebob_avdevice_subunit.cpp (modified) (5 diffs)
- trunk/libffado/src/bebob/bebob_functionblock.cpp (modified) (3 diffs)
- trunk/libffado/src/bebob/bebob_functionblock.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/src/bebob/bebob_avdevice.h
r661 r734 42 42 #include "bebob/bebob_mixer.h" 43 43 44 #include "libstreaming/AmdtpStreamProcessor.h" 45 #include "libstreaming/AmdtpPort.h" 46 #include "libstreaming/AmdtpPortInfo.h" 44 #include "libstreaming/amdtp/AmdtpReceiveStreamProcessor.h" 45 #include "libstreaming/amdtp/AmdtpTransmitStreamProcessor.h" 46 #include "libstreaming/amdtp/AmdtpPort.h" 47 #include "libstreaming/amdtp/AmdtpPortInfo.h" 47 48 48 49 #include "libutil/serialize.h" trunk/libffado/src/bebob/bebob_avdevice_subunit.cpp
r716 r734 82 82 { 83 83 debugOutput(DEBUG_LEVEL_NORMAL, "Discovering %s...\n", getName()); 84 84 85 85 // discover the AV/C generic part 86 86 if ( !AVC::SubunitAudio::discover() ) { … … 160 160 #ifdef DEBUG 161 161 if ((int)getDebugLevel() >= DEBUG_LEVEL_NORMAL) { 162 162 163 163 for ( FunctionBlockVector::iterator it = m_functions.begin(); 164 164 it != m_functions.end(); … … 340 340 bool 341 341 BeBoB::SubunitAudio::serializeChild( Glib::ustring basePath, 342 Util::IOSerialize& ser ) const342 Util::IOSerialize& ser ) const 343 343 { 344 344 bool result = true; … … 363 363 bool 364 364 BeBoB::SubunitAudio::deserializeChild( Glib::ustring basePath, 365 Util::IODeserialize& deser,366 AVC::Unit& avDevice )365 Util::IODeserialize& deser, 366 AVC::Unit& avDevice ) 367 367 { 368 368 int i = 0; … … 426 426 { 427 427 debugOutput(DEBUG_LEVEL_NORMAL, "Discovering %s...\n", getName()); 428 428 429 429 // discover the AV/C generic part 430 430 if ( !AVC::SubunitMusic::discover() ) { trunk/libffado/src/bebob/bebob_functionblock.cpp
r716 r734 160 160 161 161 bool 162 serializePlugVector( Glib::ustring basePath, 163 Util::IOSerialize& ser, 164 const PlugVector& vec ) 165 { 166 bool result = true; 167 int i = 0; 168 for ( PlugVector::const_iterator it = vec.begin(); 169 it != vec.end(); 170 ++it ) 171 { 172 std::ostringstream strstrm; 173 strstrm << basePath << i; 174 result &= ser.write( strstrm.str(), ( *it )->getGlobalId() ); 175 i++; 176 } 177 return result; 178 } 179 180 bool 181 deserializePlugVector( Glib::ustring basePath, 182 Util::IODeserialize& deser, 183 AVC::Unit& unit, 184 PlugVector& vec ) 185 { 186 int i = 0; 187 bool bFinished = false; 188 bool result = true; 189 do { 190 plug_id_t plugId; 191 std::ostringstream strstrm; 192 strstrm << basePath << i; 193 194 if ( deser.isExisting( strstrm.str() ) ) { 195 result &= deser.read( strstrm.str(), plugId ); 196 AVC::Plug* pPlug = unit.getPlugManager().getPlug( plugId ); 197 198 if ( result && pPlug ) { 199 vec.push_back( pPlug ); 200 i++; 201 } else { 202 bFinished = true; 203 } 204 } else { 205 bFinished = true; 206 } 207 } while ( !bFinished ); 208 209 return result; 210 } 211 212 bool 162 213 FunctionBlock::serialize( Glib::ustring basePath, Util::IOSerialize& ser ) const 163 214 { … … 178 229 FunctionBlock* 179 230 FunctionBlock::deserialize( Glib::ustring basePath, 180 Util::IODeserialize& deser,181 AVC::Unit& unit,182 AVC::Subunit& subunit )231 Util::IODeserialize& deser, 232 AVC::Unit& unit, 233 AVC::Subunit& subunit ) 183 234 { 184 235 bool result; … … 227 278 result &= deser.read( basePath + "m_nrOfOutputPlugs", pFB->m_nrOfOutputPlugs ); 228 279 result &= deser.read( basePath + "m_verbose", pFB->m_verbose ); 229 result &= deserializePlugVector( basePath + "m_plugs", deser, 230 unit.getPlugManager(), pFB->m_plugs ); 280 result &= deserializePlugVector( basePath + "m_plugs", deser, unit, pFB->m_plugs ); 231 281 232 282 return 0; trunk/libffado/src/bebob/bebob_functionblock.h
r716 r734 69 69 70 70 virtual const char* getName() = 0; 71 71 72 72 AVC::function_block_type_t getType() {return m_type;}; 73 73 AVC::function_block_type_t getSubtype() {return m_subtype;}; 74 74 AVC::function_block_id_t getId() {return m_id;}; 75 75 76 76 AVC::no_of_input_plugs_t getNrOfInputPlugs() {return m_nrOfInputPlugs;}; 77 77 AVC::no_of_output_plugs_t getNrOfOutputPlugs() {return m_nrOfOutputPlugs;}; 78 78 79 79 bool serialize( Glib::ustring basePath, Util::IOSerialize& ser ) const; 80 81 80 static FunctionBlock* deserialize( Glib::ustring basePath, 82 81 Util::IODeserialize& deser, … … 145 144 146 145 virtual const char* getName(); 147 146 148 147 // FIXME: this is not pretty! 149 148 enum EControlSelectorEncoding {