414 | | // example of adding an midi port: |
---|
415 | | // asprintf(&buff,"dev%d_cap_%s",m_id,"myportnamehere"); |
---|
416 | | // p=new FreebobStreaming::MotuMidiPort( |
---|
417 | | // buff, |
---|
418 | | // FreebobStreaming::Port::E_Capture, |
---|
419 | | // 0 // you can add all other port specific stuff you |
---|
420 | | // // need to pass by extending MotuXXXPort and MotuPortInfo |
---|
421 | | // ); |
---|
422 | | // free(buff); |
---|
423 | | // |
---|
424 | | // if (!p) { |
---|
425 | | // debugOutput(DEBUG_LEVEL_VERBOSE, "Skipped port %s\n",buff); |
---|
426 | | // } else { |
---|
427 | | // if (!m_receiveProcessor->addPort(p)) { |
---|
428 | | // debugWarning("Could not register port with stream processor\n"); |
---|
429 | | // return false; |
---|
430 | | // } else { |
---|
431 | | // debugOutput(DEBUG_LEVEL_VERBOSE, "Added port %s\n",buff); |
---|
432 | | // } |
---|
433 | | // } |
---|
434 | | |
---|
| 413 | // Add MIDI port. The MOTU only has one MIDI input port, with each |
---|
| 414 | // MIDI byte sent using a 3 byte sequence starting at byte 4 of the |
---|
| 415 | // event data. |
---|
| 416 | asprintf(&buff,"dev%d_cap_MIDI0",m_id); |
---|
| 417 | p = new FreebobStreaming::MotuMidiPort(buff, |
---|
| 418 | FreebobStreaming::Port::E_Capture, 4); |
---|
| 419 | if (!p) { |
---|
| 420 | debugOutput(DEBUG_LEVEL_VERBOSE, "Skipped port %s\n", buff); |
---|
| 421 | } else { |
---|
| 422 | if (!m_receiveProcessor->addPort(p)) { |
---|
| 423 | debugWarning("Could not register port with stream processor\n"); |
---|
| 424 | free(buff); |
---|
| 425 | return false; |
---|
| 426 | } else { |
---|
| 427 | debugOutput(DEBUG_LEVEL_VERBOSE, "Added port %s\n", buff); |
---|
| 428 | } |
---|
| 429 | } |
---|
| 430 | free(buff); |
---|
| 431 | |
---|
480 | | // // example of adding an midi port: |
---|
481 | | // asprintf(&buff,"dev%d_pbk_%s",m_id,"myportnamehere"); |
---|
482 | | // |
---|
483 | | // p=new FreebobStreaming::MotuMidiPort( |
---|
484 | | // buff, |
---|
485 | | // FreebobStreaming::Port::E_Playback, |
---|
486 | | // 0 // you can add all other port specific stuff you |
---|
487 | | // // need to pass by extending MotuXXXPort and MotuPortInfo |
---|
488 | | // ); |
---|
489 | | // free(buff); |
---|
490 | | // |
---|
491 | | // if (!p) { |
---|
492 | | // debugOutput(DEBUG_LEVEL_VERBOSE, "Skipped port %s\n",buff); |
---|
493 | | // } else { |
---|
494 | | // if (!m_transmitProcessor->addPort(p)) { |
---|
495 | | // debugWarning("Could not register port with stream processor\n"); |
---|
496 | | // return false; |
---|
497 | | // } else { |
---|
498 | | // debugOutput(DEBUG_LEVEL_VERBOSE, "Added port %s\n",buff); |
---|
499 | | // } |
---|
500 | | // } |
---|
501 | | |
---|
| 477 | // Add MIDI port. The MOTU only has one output MIDI port, with each |
---|
| 478 | // MIDI byte transmitted using a 3 byte sequence starting at byte 4 |
---|
| 479 | // of the event data. |
---|
| 480 | asprintf(&buff,"dev%d_pbk_MIDI0",m_id); |
---|
| 481 | p = new FreebobStreaming::MotuMidiPort(buff, |
---|
| 482 | FreebobStreaming::Port::E_Capture, 4); |
---|
| 483 | if (!p) { |
---|
| 484 | debugOutput(DEBUG_LEVEL_VERBOSE, "Skipped port %s\n", buff); |
---|
| 485 | } else { |
---|
| 486 | if (!m_receiveProcessor->addPort(p)) { |
---|
| 487 | debugWarning("Could not register port with stream processor\n"); |
---|
| 488 | free(buff); |
---|
| 489 | return false; |
---|
| 490 | } else { |
---|
| 491 | debugOutput(DEBUG_LEVEL_VERBOSE, "Added port %s\n", buff); |
---|
| 492 | } |
---|
| 493 | } |
---|
| 494 | free(buff); |
---|
| 495 | |
---|