Changeset 5987:9630ae9e55f4 in roaraudio


Ignore:
Timestamp:
02/24/14 13:48:34 (5 years ago)
Author:
phi
Branch:
default
Message:

corrected filter name and added support to set channel and event using para list

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/universal/filter-slfi-alternative.c

    r5986 r5987  
    4444static int __init(struct roar_slfi_inst * inst, const struct roar_keyval * para, ssize_t paralen) { 
    4545 struct slfi_alternative * self = roar_mm_malloc(sizeof(struct slfi_alternative)); 
     46 const struct roar_keyval * kv; 
     47 ssize_t i; 
    4648 
    4749 (void)para, (void)paralen; 
     
    5557 self->event      = ROAR_ROARDMX_EVENT_STEP; 
    5658 inst->userdata = self; 
     59 
     60 for (i = 0; i < paralen; i++) { 
     61  kv = &(para[i]); 
     62  if ( kv->key == NULL || kv->value == NULL ) 
     63   continue; 
     64  if ( !strcmp(kv->key, "channel") ) { 
     65   self->channel = atoi(kv->value); 
     66  } else if ( !strcmp(kv->key, "event") ) { 
     67   self->event = roar_roardmx_str2event(kv->value); 
     68  } else { 
     69   ROAR_WARN("__init(*): Unknown parameter: %s", kv->key); 
     70  } 
     71 } 
    5772 
    5873 return 0; 
     
    127142static const struct roar_slfi_filter filter[1] = { 
    128143 { 
    129   .name = "chain", 
    130   .description = "Chain SLFI filter", 
     144  .name = "alternative", 
     145  .description = "Alternative SLFI filter", 
    131146  .flags = ROAR_SLFI_FLAG_NONE, 
    132147  .init = __init, 
Note: See TracChangeset for help on using the changeset viewer.