Changeset 1790

Show
Ignore:
Timestamp:
01/16/10 12:10:22 (11 years ago)
Author:
arnonym
Message:

If a channel is only named 'MIDI', add a 'IN' or 'OUT' to indicate the direction. Otherwise only one channel gets registered at jack when jack doesn't add P_ and C_ before the names (and there is no reason it should).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/genericavc/avc_avdevice.cpp

    r1771 r1790  
    690690            std::ostringstream portname; 
    691691 
    692             portname << id << "_" << channelInfo->m_name; 
     692            portname << id << "_"; 
     693            if ( channelInfo->m_name.compare(0, 5, "MIDI ") == 0 ) { 
     694                debugWarning("Midi channel simply named 'MIDI', will add a direction to make it unique!\n"); 
     695                portname << "MIDI "; 
     696                if (direction == Streaming::Port::E_Playback) 
     697                    portname << "IN "; 
     698                else 
     699                    portname << "OUT "; 
     700                portname << channelInfo->m_name.substr(5); 
     701            } else { 
     702                portname << channelInfo->m_name; 
     703            } 
    693704 
    694705            Streaming::Port *p=NULL; 
     
    712723 
    713724            case AVC::ExtendedPlugInfoClusterInfoSpecificData::ePT_MIDI: 
    714                 debugOutput(DEBUG_LEVEL_VERBOSE, " Adding MIDI channel %s (pos=0x%02X, loc=0x%02X)\n", 
    715                     channelInfo->m_name.c_str(), channelInfo->m_streamPosition, processor->getPortCount(Streaming::Port::E_Midi)); 
     725                debugOutput(DEBUG_LEVEL_VERBOSE, " Adding MIDI channel '%s' (pos=0x%02X, loc=0x%02X)\n", 
     726                    portname.str().c_str() /*channelInfo->m_name.c_str()*/, 
     727                    channelInfo->m_streamPosition, processor->getPortCount(Streaming::Port::E_Midi)); 
    716728                p=new Streaming::AmdtpMidiPort( 
    717729                        *processor,