Changeset 42 for trunk/freebob/src/avdevice.cpp
- Timestamp:
- 12/05/04 14:36:17 (19 years ago)
- Files:
-
- trunk/freebob/src/avdevice.cpp (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/freebob/src/avdevice.cpp
r40 r42 27 27 #include "avdevicemusicsubunit.h" 28 28 29 AvDevice::AvDevice( int port, int node)29 AvDevice::AvDevice(octlet_t oGuid) 30 30 { 31 iNodeId=node; 32 m_iPort=port; 33 34 // check to see if a device is really present? 35 36 // probably initialisation would be better done here 37 38 // Port and node id are not distinct. The node id 39 // can change after a bus reset, therefore the 40 // device id has to be taken for identifiction. 31 m_oGuid = oGuid; 41 32 } 42 33 43 34 FBReturnCodes 44 AvDevice::Initialize() { 45 46 if (!m_bInitialised) { 47 48 m_handle = raw1394_new_handle(); 35 AvDevice::initialize() { 36 if (!m_bInitialised) { 37 m_handle = raw1394_new_handle(); 49 38 if ( !m_handle ) { 50 39 if ( !errno ) { … … 161 150 tmpAvDeviceSubunit->unReserve(); 162 151 //setDebugLevel(DEBUG_LEVEL_MODERATE); 163 152 164 153 165 154 } else { … … 208 197 unsigned char *request_pos; 209 198 unsigned int i; 210 response = avc1394_transaction_block(m_handle, iNodeId, request, request_len, 2);199 response = avc1394_transaction_block(m_handle, m_iNodeId, request, request_len, 2); 211 200 if (request != NULL) { 212 201 debugPrint (DEBUG_LEVEL_TRANSFERS, "------- TRANSACTION START -------\n"); … … 275 264 response = avcExecuteTransaction(request, 2, 2); 276 265 if (response != NULL) { 277 278 } 279 266 267 } 268 return eFBRC_Success; 280 269 } 281 270 … … 292 281 *fdf=response[1]& 0x00FFFFFF; 293 282 } 294 295 } 283 return eFBRC_Success; 284 } 285 296 286 FBReturnCodes AvDevice::setOutputPlugSignalFormat(unsigned char plug, unsigned char fmt, quadlet_t fdf) { 297 287 quadlet_t request[6]; … … 303 293 response = avcExecuteTransaction(request, 2, 2); 304 294 if (response != NULL) { 305 306 } 307 295 296 } 297 return eFBRC_Success; 308 298 } 309 299 … … 320 310 *fdf=response[1]& 0x00FFFFFF; 321 311 } 322 312 return eFBRC_Success; 323 313 } 324 314 … … 340 330 quadlet_t *response; 341 331 //setDebugLevel(DEBUG_LEVEL_ALL); 342 343 debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: ISO source connections:\n"); 332 333 debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: ISO source connections:\n"); 344 334 345 335 for (unsigned int i=0;i<getNbIsoSourcePlugs();i++) { … … 347 337 | AVC1394_COMMAND_SIGNAL_SOURCE | 0xFF; 348 338 request[1]=0xFFFEFF00 | ((i & 0xFF)); 349 339 350 340 response = avcExecuteTransaction(request, 2, 2); 351 341 352 342 if (response != NULL) { 353 343 unsigned char output_status=(response[0]&0xE0) >> 5; 354 344 unsigned char conv=(response[0]&0x10) >> 4; 355 345 unsigned char signal_status=(response[0]&0x0F); 356 346 357 347 unsigned int signal_source=((response[1]>>16)&0xFFFF); 358 348 359 349 unsigned char source_subunit_type=(signal_source>>11)&0x1F; 360 350 unsigned char source_subunit_id=(signal_source>>8)&0x07; 361 351 unsigned char source_plug=signal_source&0xFF; 362 352 363 353 debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: OPCR 0x%02X <- subunit: 0x%02X/0x%02X, plug: 0x%02X (0x%02X / %d / 0x%02X)\n",i, source_subunit_type,source_subunit_id,source_plug,output_status,conv,signal_status); 364 // find the subunit this plug is connected to 354 // find the subunit this plug is connected to 365 355 AvDeviceSubunit *tmpSubunit=getSubunit(source_subunit_type,source_subunit_id); 366 356 if(tmpSubunit) { 367 357 tmpSubunit->printSourcePlugConnections(source_plug); 368 358 } 369 370 } 371 } 372 373 debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: External source connections:\n"); 359 360 } 361 } 362 363 debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: External source connections:\n"); 374 364 375 365 for (unsigned int i=0;i<getNbExtSourcePlugs();i++) { … … 377 367 | AVC1394_COMMAND_SIGNAL_SOURCE | 0xFF; 378 368 request[1]=0xFFFEFF00 | ((i & 0xFF)|0x80); 379 369 380 370 response = avcExecuteTransaction(request, 2, 2); 381 371 382 372 if (response != NULL) { 383 373 unsigned char output_status=(response[0]&0xE0) >> 5; 384 374 unsigned char conv=(response[0]&0x10) >> 4; 385 375 unsigned char signal_status=(response[0]&0x0F); 386 376 387 377 unsigned int signal_source=((response[1]>>16)&0xFFFF); 388 378 389 379 unsigned char source_subunit_type=(signal_source>>11)&0x1F; 390 380 unsigned char source_subunit_id=(signal_source>>8)&0x07; 391 381 unsigned char source_plug=signal_source&0xFF; 392 393 debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: EXTOUT 0x%02X <- subunit: 0x%02X/0x%02X, plug: 0x%02X (0x%02X / %d / 0x%02X)\n",i, source_subunit_type,source_subunit_id,source_plug,output_status,conv,signal_status); 394 395 // find the subunit this plug is connected to 382 383 debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: EXTOUT 0x%02X <- subunit: 0x%02X/0x%02X, plug: 0x%02X (0x%02X / %d / 0x%02X)\n",i, source_subunit_type,source_subunit_id,source_plug,output_status,conv,signal_status); 384 385 // find the subunit this plug is connected to 396 386 AvDeviceSubunit *tmpSubunit=getSubunit(source_subunit_type,source_subunit_id); 397 387 if(tmpSubunit) { 398 388 tmpSubunit->printSourcePlugConnections(source_plug); 399 } 400 } 401 } 402 403 debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: ISO sink connections:\n"); 389 } 390 } 391 } 392 393 debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: ISO sink connections:\n"); 404 394 405 395 for (unsigned int i=0;i<getNbIsoDestinationPlugs();i++) { … … 407 397 | AVC1394_COMMAND_SIGNAL_SOURCE | 0xFF; 408 398 request[1]=0xFFFEFF00 | ((i & 0xFF)); 409 399 410 400 response = avcExecuteTransaction(request, 2, 2); 411 401 412 402 if (response != NULL) { 413 403 unsigned char output_status=(response[0]&0xE0) >> 5; 414 404 unsigned char conv=(response[0]&0x10) >> 4; 415 405 unsigned char signal_status=(response[0]&0x0F); 416 406 417 407 unsigned int signal_source=((response[1]>>16)&0xFFFF); 418 408 419 409 unsigned char source_subunit_type=(signal_source>>11)&0x1F; 420 410 unsigned char source_subunit_id=(signal_source>>8)&0x07; 421 411 unsigned char source_plug=signal_source&0xFF; 422 412 423 413 debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: OPCR 0x%02X <- subunit: 0x%02X/0x%02X, plug: 0x%02X (0x%02X / %d / 0x%02X)\n",i, source_subunit_type,source_subunit_id,source_plug,output_status,conv,signal_status); 424 // find the subunit this plug is connected to 414 // find the subunit this plug is connected to 425 415 AvDeviceSubunit *tmpSubunit=getSubunit(source_subunit_type,source_subunit_id); 426 416 if(tmpSubunit) { 427 417 //tmpSubunit->printDestinationPlugConnections(source_plug); 428 418 } 429 430 } 431 } 432 433 debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: External sink connections:\n"); 419 420 } 421 } 422 423 debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: External sink connections:\n"); 434 424 435 425 for (unsigned int i=0;i<getNbExtDestinationPlugs();i++) { … … 437 427 | AVC1394_COMMAND_SIGNAL_SOURCE | 0xFF; 438 428 request[1]=0xFFFEFF00 | ((i & 0xFF)|0x80); 439 429 440 430 response = avcExecuteTransaction(request, 2, 2); 441 431 442 432 if (response != NULL) { 443 433 unsigned char output_status=(response[0]&0xE0) >> 5; 444 434 unsigned char conv=(response[0]&0x10) >> 4; 445 435 unsigned char signal_status=(response[0]&0x0F); 446 436 447 437 unsigned int signal_source=((response[1]>>16)&0xFFFF); 448 438 449 439 unsigned char source_subunit_type=(signal_source>>11)&0x1F; 450 440 unsigned char source_subunit_id=(signal_source>>8)&0x07; 451 441 unsigned char source_plug=signal_source&0xFF; 452 453 debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: EXTOUT 0x%02X <- subunit: 0x%02X/0x%02X, plug: 0x%02X (0x%02X / %d / 0x%02X)\n",i, source_subunit_type,source_subunit_id,source_plug,output_status,conv,signal_status); 454 455 // find the subunit this plug is connected to 442 443 debugPrint (DEBUG_LEVEL_DEVICE,"AvDevice: EXTOUT 0x%02X <- subunit: 0x%02X/0x%02X, plug: 0x%02X (0x%02X / %d / 0x%02X)\n",i, source_subunit_type,source_subunit_id,source_plug,output_status,conv,signal_status); 444 445 // find the subunit this plug is connected to 456 446 AvDeviceSubunit *tmpSubunit=getSubunit(source_subunit_type,source_subunit_id); 457 447 if(tmpSubunit) { 458 448 //tmpSubunit->printDestinationPlugConnections(source_plug); 459 } 460 } 461 } 462 463 } 449 } 450 } 451 } 452 453 }