Changeset 1965:3a0678019008 in roaraudio


Ignore:
Timestamp:
06/11/09 17:40:20 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added input support for roardmx code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/light.c

    r1925 r1965  
    7070 struct roar_stream        *   s; 
    7171 struct roar_stream_server *  ss; 
     72 struct roar_roardmx_message  mes; 
    7273 char buf[512]; 
    73  int i; 
     74 int i, c; 
     75 uint16_t      channel; 
     76 unsigned char value; 
    7477 
    7578 if ( g_streams[id] == NULL ) 
     
    100103 
    101104    return 0; 
     105   break; 
     106  case ROAR_CODEC_ROARDMX: 
     107    if ( roar_roardmx_message_recv(&mes, &(ss->vio)) == -1 ) { 
     108     streams_delete(id); // because we don't know at the moment... 
     109     return -1; 
     110    } 
     111 
     112    // we ignore errors here at the moment as 0 not < -1 
     113    c = roar_roardmx_message_numchannels(&mes); 
     114 
     115    for (i = 0; i < c; i++) { 
     116     if ( roar_roardmx_message_get_chanval(&mes, &channel, &value, i) == -1 ) 
     117      return -1; 
     118 
     119     if ( g_light_state.channels < channel ) { 
     120      ROAR_WARN("light_check_stream(id=%i): Writing on non extisting DMX channel %u", id, channel); 
     121      continue; 
     122     } else { 
     123      g_light_state.state[channel] = value; 
     124     } 
     125    } 
    102126   break; 
    103127  default: 
Note: See TracChangeset for help on using the changeset viewer.