diff options
author | wm4 <wm4@nowhere> | 2013-11-18 14:16:08 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-11-18 14:21:01 +0100 |
commit | 5594718b6bda3a230e2e2c3cb06d2837c5a02688 (patch) | |
tree | dca02cab9bde6d50d148a62b20ec99aa8601b847 /audio/filter/af_pan.c | |
parent | 93852b08f37f630b994d126751b4b9740a13219f (diff) | |
download | mpv-5594718b6bda3a230e2e2c3cb06d2837c5a02688.tar.bz2 mpv-5594718b6bda3a230e2e2c3cb06d2837c5a02688.tar.xz |
audio/filter: remove unneeded AF_CONTROLs, convert to enum
The AF control commands used an elaborate and unnecessary organization
for the command constants. Get rid of all that and convert the
definitions to a simple enum. Also remove the control commands that
were not really needed, because they were not used outside of the
filters that implemented them.
Diffstat (limited to 'audio/filter/af_pan.c')
-rw-r--r-- | audio/filter/af_pan.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/audio/filter/af_pan.c b/audio/filter/af_pan.c index 29d38c3860..f1bc63b73a 100644 --- a/audio/filter/af_pan.c +++ b/audio/filter/af_pan.c @@ -71,7 +71,7 @@ static int control(struct af_instance* af, int cmd, void* arg) int j,k; // Read number of outputs sscanf((char*)arg,"%i%n", &nch,&n); - if(AF_OK != control(af,AF_CONTROL_PAN_NOUT | AF_CONTROL_SET, &nch)) + if(AF_OK != control(af,AF_CONTROL_SET_PAN_NOUT, &nch)) return AF_ERROR; // Read pan values @@ -90,7 +90,7 @@ static int control(struct af_instance* af, int cmd, void* arg) } return AF_OK; } - case AF_CONTROL_PAN_LEVEL | AF_CONTROL_SET:{ + case AF_CONTROL_SET_PAN_LEVEL:{ int i; int ch = ((af_control_ext_t*)arg)->ch; float* level = ((af_control_ext_t*)arg)->arg; @@ -100,17 +100,7 @@ static int control(struct af_instance* af, int cmd, void* arg) s->level[ch][i] = level[i]; return AF_OK; } - case AF_CONTROL_PAN_LEVEL | AF_CONTROL_GET:{ - int i; - int ch = ((af_control_ext_t*)arg)->ch; - float* level = ((af_control_ext_t*)arg)->arg; - if (ch >= AF_NCH) - return AF_FALSE; - for(i=0;i<AF_NCH;i++) - level[i] = s->level[ch][i]; - return AF_OK; - } - case AF_CONTROL_PAN_NOUT | AF_CONTROL_SET: + case AF_CONTROL_SET_PAN_NOUT: // Reinit must be called after this function has been called // Sanity check @@ -121,7 +111,7 @@ static int control(struct af_instance* af, int cmd, void* arg) } s->nch=((int*)arg)[0]; return AF_OK; - case AF_CONTROL_PAN_BALANCE | AF_CONTROL_SET:{ + case AF_CONTROL_SET_PAN_BALANCE:{ float val = *(float*)arg; if (s->nch) return AF_ERROR; @@ -133,7 +123,7 @@ static int control(struct af_instance* af, int cmd, void* arg) } return AF_OK; } - case AF_CONTROL_PAN_BALANCE | AF_CONTROL_GET: + case AF_CONTROL_GET_PAN_BALANCE: if (s->nch) return AF_ERROR; *(float*)arg = s->level[0][1] - s->level[1][0]; |