Changeset 5935:fc010238c494 in roaraudio for roard/light.c


Ignore:
Timestamp:
09/11/13 21:55:37 (11 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added some more aux functions for plugin access to DMX data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/light.c

    r5920 r5935  
    242242} 
    243243 
     244ssize_t light_dmxchannel_num(void) { 
     245 if ( g_light_state.state == NULL ) { 
     246  roar_err_set(ROAR_ERROR_BADSTATE); 
     247  return -1; 
     248 } 
     249 
     250 return g_light_state.channels; 
     251} 
     252 
     253int     light_dmxchannel_swap_universe(uint8_t * universe, size_t len) { 
     254 uint8_t c; 
     255 size_t i; 
     256 
     257 if ( g_light_state.state == NULL ) { 
     258  roar_err_set(ROAR_ERROR_BADSTATE); 
     259  return -1; 
     260 } 
     261 
     262 if ( g_light_state.channels != len ) { 
     263  roar_err_set(ROAR_ERROR_FAULT); 
     264  return -1; 
     265 } 
     266 
     267 for (i = 0; i < len; i++) { 
     268  c = g_light_state.state[i]; 
     269  __set_channel(i, universe[i]); 
     270  universe[i] = c; 
     271 } 
     272 
     273 return 0; 
     274} 
     275 
    244276int light_dmxevent_add(const uint8_t * events, size_t len) { 
    245277 size_t i; 
Note: See TracChangeset for help on using the changeset viewer.