Changeset 544

Show
Ignore:
Timestamp:
08/21/07 08:18:46 (16 years ago)
Author:
ppalmers
Message:

- fix midi related bug
- fix length bug (as in trunk)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/echoaudio/src/libstreaming/AmdtpStreamProcessor.cpp

    r445 r544  
    8282 
    8383    struct iec61883_packet *packet = (struct iec61883_packet *) data; 
    84     if (cycle<0) return RAW1394_ISO_OK; 
    85  
    86     m_last_cycle=cycle; 
    87  
     84     
     85    if (cycle<0) { 
     86        debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Xmit handler for cycle %d, (running=%d, enabled=%d,%d)\n", 
     87            cycle, m_running, m_disabled, m_is_disabled); 
     88         
     89        *tag = 0; 
     90        *sy = 0; 
     91        *length=0; 
     92        return RAW1394_ISO_OK; 
     93     
     94    } 
     95     
    8896    debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Xmit handler for cycle %d, (running=%d, enabled=%d,%d)\n", 
    8997        cycle, m_running, m_disabled, m_is_disabled); 
     98     
     99    m_last_cycle=cycle; 
    90100 
    91101#ifdef DEBUG 
     
    740750{ 
    741751    bool ok=true; 
    742     char byte; 
     752    quadlet_t byte; 
    743753 
    744754    quadlet_t *target_event=NULL; 
     
    772782 
    773783        for(j = (dbc & 0x07)+mp->getLocation(); j < nevents; j += 8) { 
    774  
     784             
     785            quadlet_t tmpval; 
     786             
    775787            target_event=(quadlet_t *)(data + ((j * m_dimension) + mp->getPosition())); 
    776  
     788             
    777789            if(mp->canRead()) { // we can send a byte 
    778790                mp->readEvent(&byte); 
    779                 *target_event=htonl( 
     791                byte &= 0xFF; 
     792                tmpval=htonl( 
    780793                    IEC61883_AM824_SET_LABEL((byte)<<16, 
    781794                                             IEC61883_AM824_LABEL_MIDI_1X)); 
     795 
     796                debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "MIDI port %s, pos=%d, loc=%d, dbc=%d, nevents=%d, dim=%d\n", 
     797                    mp->getName().c_str(), mp->getPosition(), mp->getLocation(), dbc, nevents, m_dimension); 
     798                debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "base=%p, target=%p, value=%08X\n", 
     799                    data, target_event, tmpval); 
     800                     
    782801            } else { 
    783802                // can't send a byte, either because there is no byte, 
    784803                // or because this would exceed the maximum rate 
    785                 *target_event=htonl( 
     804                tmpval=htonl( 
    786805                    IEC61883_AM824_SET_LABEL(0,IEC61883_AM824_LABEL_MIDI_NO_DATA)); 
    787806            } 
     807             
     808            *target_event=tmpval; 
    788809        } 
    789810