Changeset 1141:37c25717fca0 in roaraudio for libroardsp/filter_clip.c


Ignore:
Timestamp:
01/21/09 22:51:58 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added support to reset filters, some cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroardsp/filter_clip.c

    r987 r1141  
    2424 
    2525#include "libroardsp.h" 
    26  
    27 int roardsp_clip_init  (struct roardsp_filter * filter, struct roar_stream * stream, int id) { 
    28  int n = 64; 
    29  
    30  roardsp_amp_ctl(filter, ROARDSP_FCTL_N, &n); 
    31  
    32  return 0; 
    33 } 
    3426 
    3527int roardsp_clip_calc16  (struct roardsp_filter * filter, void * data, size_t samples) { 
     
    6759} 
    6860 
     61int roardsp_clip_reset (struct roardsp_filter * filter, int what) { 
     62 int32_t n = 16384; 
     63 
     64 if ( filter == NULL ) 
     65  return -1; 
     66 
     67 switch (what) { 
     68  case ROARDSP_RESET_NONE: 
     69  case ROARDSP_RESET_STATE: 
     70    return  0; 
     71   break; 
     72  case ROARDSP_RESET_FULL: 
     73    roardsp_clip_ctl(filter, ROARDSP_FCTL_LIMIT, &n); 
     74    return  0; 
     75   break; 
     76  default: 
     77    return -1; 
     78 } 
     79 
     80 return -1; 
     81} 
     82 
    6983//ll 
Note: See TracChangeset for help on using the changeset viewer.