Show
Ignore:
Timestamp:
08/05/07 04:39:58 (17 years ago)
Author:
ppalmers
Message:

- renumber the midi location parameters to fix bogus values returned

by AV/C discovery

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/libfreebob-1.0/src/libfreebobstreaming/freebob_connections.c

    r328 r513  
    197197                 
    198198        err=0; 
     199        int midi_channel=0; 
    199200        for (s=0;s<connection->nb_streams;s++) { 
    200201                err=freebob_streaming_init_stream(dev,&connection->streams[s],connection->spec.stream_info->streams[s]); 
  • branches/libfreebob-1.0/src/libfreebobstreaming/freebob_streaming.c

    r431 r513  
    226226        dev->connections=calloc(dev->nb_connections_playback+dev->nb_connections_capture, sizeof(freebob_connection_t)); 
    227227         
    228          
    229228        for (c=0;c<dev->nb_connections_capture;c++) { 
    230229                memcpy(&dev->connections[c].spec, libfreebob_capture_connections->connections[c], sizeof(freebob_connection_spec_t)); 
     
    236235        } 
    237236         
     237        // In order to correct for bogus midi channel numbers 
     238        // we redefine the location parameter to the order the  
     239        // channels appear in the specification 
     240        int midichannel=0; 
     241        for (c=0;c<dev->nb_connections_capture;c++) { 
     242                midichannel=0; 
     243                int s; 
     244                freebob_connection_t *connection= &(dev->connections[c]); 
     245                for (s=0;s<connection->spec.stream_info->nb_streams;s++) { 
     246                        if(connection->spec.stream_info->streams[s]->format == IEC61883_STREAM_TYPE_MIDI) { 
     247                                connection->spec.stream_info->streams[s]->location=midichannel++; 
     248                        } 
     249                } 
     250        } 
     251        for (c=0;c<dev->nb_connections_playback;c++) { 
     252                midichannel=0; 
     253                int s; 
     254                freebob_connection_t *connection= &(dev->connections[c+dev->nb_connections_capture]); 
     255                for (s=0;s<connection->spec.stream_info->nb_streams;s++) { 
     256                        if(connection->spec.stream_info->streams[s]->format == IEC61883_STREAM_TYPE_MIDI) { 
     257                                connection->spec.stream_info->streams[s]->location=midichannel++; 
     258                        } 
     259                } 
     260        } 
     261 
    238262        /* Figure out a master connection. 
    239263         * Either it is given in the spec libfreebob