add a new method for retrieving feeder parameters

This commit is contained in:
Cameron Grant 2001-05-27 14:49:14 +00:00
parent fc60109d91
commit 4dce85407c
3 changed files with 39 additions and 4 deletions

View File

@ -70,9 +70,10 @@ SYSINIT(feeder, SI_SUB_DRIVERS, SI_ORDER_MIDDLE, feeder_register, &feeder ## _cl
#define FEEDER_ROOT 1
#define FEEDER_FMT 2
#define FEEDER_RATE 3
#define FEEDER_FILTER 4
#define FEEDER_VOLUME 5
#define FEEDER_MIXER 3
#define FEEDER_RATE 4
#define FEEDER_FILTER 5
#define FEEDER_VOLUME 6
#define FEEDER_LAST FEEDER_VOLUME
#define FEEDRATE_SRC 1

View File

@ -45,6 +45,18 @@ CODE {
return 0;
}
static int
feeder_noset(struct pcm_feeder* feeder, int what, int value)
{
return -1;
}
static int
feeder_noget(struct pcm_feeder* feeder, int what)
{
return -1;
}
};
METHOD int init {
@ -59,7 +71,12 @@ METHOD int set {
struct pcm_feeder* feeder;
int what;
int value;
};
} DEFAULT feeder_noset;
METHOD int get {
struct pcm_feeder* feeder;
int what;
} DEFAULT feeder_noget;
METHOD int feed {
struct pcm_feeder* feeder;

View File

@ -71,6 +71,22 @@ feed_rate_set(struct pcm_feeder *f, int what, int value)
return feed_rate_setup(f);
}
static int
feed_rate_get(struct pcm_feeder *f, int what)
{
struct feed_rate_info *info = f->data;
switch(what) {
case FEEDRATE_SRC:
return info->src;
case FEEDRATE_DST:
return info->dst;
default:
return -1;
}
return -1;
}
static int
feed_rate_init(struct pcm_feeder *f)
{
@ -167,6 +183,7 @@ static kobj_method_t feeder_rate_methods[] = {
KOBJMETHOD(feeder_init, feed_rate_init),
KOBJMETHOD(feeder_free, feed_rate_free),
KOBJMETHOD(feeder_set, feed_rate_set),
KOBJMETHOD(feeder_get, feed_rate_get),
KOBJMETHOD(feeder_feed, feed_rate),
{ 0, 0 }
};