Changeset 5935:fc010238c494 in roaraudio


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

added some more aux functions for plugin access to DMX data

Location:
roard
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • roard/include/light.h

    r5920 r5935  
    5757 
    5858// for plugins: 
    59 int light_dmxchannel_get(size_t index); 
    60 int light_dmxchannel_set(size_t index, uint8_t val); 
     59int     light_dmxchannel_get(size_t index); 
     60int     light_dmxchannel_set(size_t index, uint8_t val); 
     61ssize_t light_dmxchannel_num(void); 
     62int     light_dmxchannel_swap_universe(uint8_t * universe, size_t len); 
    6163 
    6264int light_dmxevent_add(const uint8_t * events, size_t len); 
  • 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.