Changeset 3313:24bb2b78bb91 in roaraudio


Ignore:
Timestamp:
02/03/10 14:10:34 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

support registered dstr types

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/vio_dstr.c

    r3312 r3313  
    462462 
    463463int     roar_vio_dstr_set_defaults(struct roar_vio_dstr_chain * chain, int len, struct roar_vio_defaults * def, int dnum) { 
     464 struct _roar_vio_dstr_type * type; 
    464465 struct roar_vio_dstr_chain * c, * next; 
    465466 int i; 
     
    684685    break; 
    685686   default: 
    686     // TODO: FIXME: add code to use functions from type struct 
    687     _roar_vio_dstr_init_otherlibs(); 
    688     return -1; 
     687     if ( (type = roar_vio_dstr_get_by_type(c->type)) == NULL ) { 
     688      return -1; 
     689     } 
     690 
     691     if ( type->setdef == NULL ) 
     692      _roar_vio_dstr_init_otherlibs(); 
     693 
     694     if ( type->setdef == NULL ) { 
     695      return -1; 
     696     } 
     697 
     698     if ( type->setdef(c, next) == -1 ) { 
     699      return -1; 
     700     } 
    689701  } 
    690702 
     
    713725int     roar_vio_dstr_build_chain(struct roar_vio_dstr_chain * chain, struct roar_vio_calls * calls, 
    714726                                  struct roar_vio_calls * vio) { 
     727 struct _roar_vio_dstr_type * type; 
    715728 struct roar_vio_dstr_chain * c; 
    716729 struct roar_vio_defaults   * def; 
     
    840853     break; 
    841854    default: 
    842       // TODO: FIXME: add code to use functions from type struct 
    843       _roar_vio_dstr_init_otherlibs(); 
    844       _ret(-1); 
     855      if ( (type = roar_vio_dstr_get_by_type(c->type)) == NULL ) { 
     856       _ret(-1); 
     857      } 
     858 
     859      if ( type->openvio == NULL ) 
     860       _roar_vio_dstr_init_otherlibs(); 
     861 
     862      if ( type->openvio == NULL ) { 
     863       _ret(-1); 
     864      } 
     865 
     866      if ( type->openvio(tc, prev, c) == -1 ) { 
     867       _ret(-1); 
     868      } 
    845869   } 
    846870 
Note: See TracChangeset for help on using the changeset viewer.