comparison libao2/ao_plugin.c @ 4859:c72b386debb4

Adding SW volume control
author anders
date Mon, 25 Feb 2002 13:31:26 +0000
parents 118ae69769be
children 120027e44f80
comparison
equal deleted inserted replaced
4858:65730cea02e7 4859:c72b386debb4
34 } ao_plugin_local_data_t; 34 } ao_plugin_local_data_t;
35 35
36 static ao_plugin_local_data_t ao_plugin_local_data={NULL,0,0.0,NULL,NULL,AO_PLUGINS}; 36 static ao_plugin_local_data_t ao_plugin_local_data={NULL,0,0.0,NULL,NULL,AO_PLUGINS};
37 37
38 // global data 38 // global data
39 volatile ao_plugin_data_t ao_plugin_data; // Data used by the plugins 39 ao_plugin_data_t ao_plugin_data; // Data used by the plugins
40 volatile ao_plugin_cfg_t ao_plugin_cfg=CFG_DEFAULTS; // Set in cfg-mplayer.h 40 ao_plugin_cfg_t ao_plugin_cfg=CFG_DEFAULTS; // Set in cfg-mplayer.h
41 41
42 // to set/get/query special features/parameters 42 // to set/get/query special features/parameters
43 static int control(int cmd,int arg){ 43 static int control(int cmd,int arg){
44 switch(cmd){ 44 switch(cmd){
45 case AOCONTROL_SET_PLUGIN_DRIVER: 45 case AOCONTROL_SET_PLUGIN_DRIVER:
46 ao_plugin_local_data.driver=(ao_functions_t*)arg; 46 ao_plugin_local_data.driver=(ao_functions_t*)arg;
47 return CONTROL_OK; 47 return CONTROL_OK;
48 case AOCONTROL_GET_VOLUME:
49 case AOCONTROL_SET_VOLUME:
50 {
51 int r=audio_plugin_volume.control(cmd,arg);
52 if(CONTROL_OK != r)
53 return driver()->control(cmd,arg);
54 else
55 return r;
56 }
48 default: 57 default:
49 return driver()->control(cmd,arg); 58 return driver()->control(cmd,arg);
50 } 59 }
51 return CONTROL_UNKNOWN; 60 return CONTROL_UNKNOWN;
52 } 61 }