Changeset 5983:377909b17ccb in roaraudio for roard


Ignore:
Timestamp:
02/23/14 22:16:20 (10 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added support to *add* RoarDMX events in SLFI filters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/light.c

    r5982 r5983  
    2828#ifndef ROAR_WITHOUT_DCOMP_LIGHT 
    2929 
     30static uint8_t nextcycle_events[MAX_EVENTS_PER_CYCLE]; 
     31static size_t nextcycle_eventsqueuelen; 
     32static int __cb_event_add(struct roar_slfi_inst * inst, void * userdata, uint8_t event); 
     33 
    3034// declared 'extern' 
    3135struct light_state g_light_state; 
     
    148152 
    149153 g_light_state.eventsqueuelen = 0; 
     154 
     155 if ( nextcycle_eventsqueuelen ) { 
     156  light_dmxevent_add(nextcycle_events, nextcycle_eventsqueuelen); 
     157  nextcycle_eventsqueuelen = 0; 
     158 } 
    150159 
    151160 return 0; 
     
    298307 
    299308 if ( primary ) { 
     309  roar_slfi_cb_set_event_add(filter, __cb_event_add, NULL); 
    300310  g_light_state.filter = filter; 
    301311  return 0; 
     
    395405} 
    396406 
     407static int __cb_event_add(struct roar_slfi_inst * inst, void * userdata, uint8_t event) { 
     408 size_t i; 
     409 
     410 if ( nextcycle_eventsqueuelen == MAX_EVENTS_PER_CYCLE ) { 
     411  roar_err_set(ROAR_ERROR_NOSPC); 
     412  return -1; 
     413 } 
     414 
     415 nextcycle_events[nextcycle_eventsqueuelen++] = event; 
     416 
     417 return 0; 
     418} 
     419 
    397420#endif 
    398421 
Note: See TracChangeset for help on using the changeset viewer.