Changeset 665:3fea6696e14b in roaraudio


Ignore:
Timestamp:
08/26/08 19:37:39 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added roardsp_filter_str2id(), roardsp_filter_id2str() and added _roardsp_filterlist[]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroardsp/filter.c

    r663 r665  
    2424 
    2525#include "libroardsp.h" 
     26 
     27struct _roardsp_filterlist { 
     28 int id; 
     29 char * name; 
     30 void (*  init      )(struct roardsp_filter * filter, struct roar_stream * stream, int id); 
     31 void (*uninit      )(struct roardsp_filter * filter); 
     32 void (*calc  [5][3])(struct roardsp_filter * filter, void * data, size_t samples); 
     33} _roardsp_filterlist[] = { 
     34 {-1, NULL, NULL, NULL, {{NULL, NULL, NULL},{NULL, NULL, NULL},{NULL, NULL, NULL},{NULL, NULL, NULL},{NULL, NULL, NULL}}} 
     35}; 
     36 
     37int    roardsp_filter_str2id(char * str) { 
     38 struct _roardsp_filterlist * l = _roardsp_filterlist; 
     39 
     40 while ( l->id != -1 ) { 
     41  if ( strcasecmp(l->name, str) == 0 ) 
     42   return l->id; 
     43 } 
     44 
     45 return -1; 
     46} 
     47 
     48char * roardsp_filter_id2str(int id) { 
     49 struct _roardsp_filterlist * l = _roardsp_filterlist; 
     50 
     51 while ( l->id != -1 ) { 
     52  if ( l->id == id ) 
     53   return l->name; 
     54 } 
     55 
     56 return NULL; 
     57} 
    2658 
    2759int roardsp_filter_init  (struct roardsp_filter * filter, struct roar_stream * stream, int id) { 
Note: See TracChangeset for help on using the changeset viewer.