Show
Ignore:
Timestamp:
10/02/06 16:41:21 (17 years ago)
Author:
jwoithe
Message:

MOTU: fix xrun recovery glitches inadvertantly introduced in r309.
MOTU: preliminary MIDI port support. Rate control still needs to be added so it probably won't work in its current form yet. MIDI has not yet been tested.
MOTU: tweaks to receive/transmit missed cycle detection.
jack driver: during driver shutdown don't try to free NULL ports created for non-audio ports during initialisation to preserve device port index locations.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/libfreebob-2.0/src/motu/motu_avdevice.cpp

    r311 r312  
    404404         
    405405        char *buff; 
    406         unsigned int i; 
    407406        FreebobStreaming::Port *p=NULL; 
    408407 
     
    412411        } 
    413412 
    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 
    435432        // example of adding an control port: 
    436433//    asprintf(&buff,"dev%d_cap_%s",m_id,"myportnamehere"); 
     
    478475        } 
    479476 
    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 
    502496        // example of adding an control port: 
    503497//    asprintf(&buff,"dev%d_pbk_%s",m_id,"myportnamehere");