Changeset 4622:74ea2f012bb1 in roaraudio


Ignore:
Timestamp:
11/24/10 02:43:16 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added roar_vs_ctl() for some very advanced controling of VS object

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • include/libroar/vs.h

    r4605 r4622  
    228228int     roar_vs_run           (roar_vs_t * vss, int * error); 
    229229 
     230/* Misc controls. 
     231 */ 
     232 
     233enum roar_vs_ctlcmd { 
     234 ROAR_VS_CMD_NOOP      = 0, 
     235 ROAR_VS_CMD_SET_MIXER, 
     236 ROAR_VS_CMD_GET_MIXER, 
     237 ROAR_VS_CMD_SET_FIRST_PRIM, 
     238 ROAR_VS_CMD_GET_FIRST_PRIM, 
     239}; 
     240 
     241typedef enum roar_vs_ctlcmd roar_vs_ctlcmd; 
     242 
     243int     roar_vs_ctl           (roar_vs_t * vss, roar_vs_ctlcmd cmd, void * argp, int * error); 
     244 
    230245/* Get used connection object 
    231246 * This may be useful if you want to use functions from the main API. 
  • libroar/vs.c

    r4618 r4622  
    173173 
    174174 if ( roar_stream_get_info(vss->con, &(vss->stream), &sinfo) != -1 ) { 
     175  // TODO: fix this: 
     176  // as we currently do not support to select mixer we just check if we hit the 
     177  // right one. 
     178  if ( vss->mixerid != -1 && vss->mixerid != sinfo.mixer ) { 
     179   _seterr(ROAR_ERROR_INVAL); // TODO: should we maybe use a diffrent value? 
     180   roar_vio_close(&(vss->vio)); 
     181   return -1; 
     182  } 
     183 
    175184  vss->mixerid = sinfo.mixer; 
    176185  _roar_vs_find_first_prim(vss); 
     
    11071116} 
    11081117 
     1118int     roar_vs_ctl           (roar_vs_t * vss, roar_vs_ctlcmd cmd, void * argp, int * error) { 
     1119 _ckvss(-1); 
     1120 
     1121 switch (cmd) { 
     1122  case ROAR_VS_CMD_NOOP: 
     1123   break; 
     1124  case ROAR_VS_CMD_SET_MIXER: 
     1125    vss->mixerid = *(int*)argp; 
     1126   break; 
     1127  case ROAR_VS_CMD_GET_MIXER: 
     1128    *(int*)argp = vss->mixerid; 
     1129   break; 
     1130  case ROAR_VS_CMD_SET_FIRST_PRIM: 
     1131    vss->first_primid = *(int*)argp; 
     1132   break; 
     1133  case ROAR_VS_CMD_GET_FIRST_PRIM: 
     1134    *(int*)argp = vss->first_primid; 
     1135   break; 
     1136 } 
     1137 
     1138 return 0; 
     1139} 
    11091140 
    11101141struct roar_connection * roar_vs_connection_obj(roar_vs_t * vss, int * error) { 
Note: See TracChangeset for help on using the changeset viewer.