summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-03-31 05:18:56 +0200
committerwm4 <wm4@nowhere>2013-05-12 20:55:50 +0200
commit1e37d35970398856e911487754056db9509f0c5a (patch)
tree1fe0d3807af13a8b96ee309ee2ce04af363b9364 /audio
parent071a8f50b96758ced05e1eef3aba5ce915a56479 (diff)
downloadmpv-1e37d35970398856e911487754056db9509f0c5a.tar.bz2
mpv-1e37d35970398856e911487754056db9509f0c5a.tar.xz
audio/filter: remove unused AF_CONTROLs
Was unused, has never been used.
Diffstat (limited to 'audio')
-rw-r--r--audio/filter/af_channels.c29
-rw-r--r--audio/filter/af_equalizer.c24
-rw-r--r--audio/filter/af_extrastereo.c6
-rw-r--r--audio/filter/af_pan.c5
-rw-r--r--audio/filter/af_sinesuppress.c12
-rw-r--r--audio/filter/af_volume.c16
-rw-r--r--audio/filter/control.h122
7 files changed, 1 insertions, 213 deletions
diff --git a/audio/filter/af_channels.c b/audio/filter/af_channels.c
index 8f676d8cfd..ac396a51cd 100644
--- a/audio/filter/af_channels.c
+++ b/audio/filter/af_channels.c
@@ -213,35 +213,6 @@ static int control(struct af_instance* af, int cmd, void* arg)
mp_msg(MSGT_AFILTER, MSGL_V, "[channels] Changing number of channels"
" to %i\n",af->data->nch);
return AF_OK;
- case AF_CONTROL_CHANNELS | AF_CONTROL_GET:
- *(int*)arg = af->data->nch;
- return AF_OK;
- case AF_CONTROL_CHANNELS_ROUTING | AF_CONTROL_SET:{
- int ch = ((af_control_ext_t*)arg)->ch;
- int* route = ((af_control_ext_t*)arg)->arg;
- s->route[ch][FR] = route[FR];
- s->route[ch][TO] = route[TO];
- return AF_OK;
- }
- case AF_CONTROL_CHANNELS_ROUTING | AF_CONTROL_GET:{
- int ch = ((af_control_ext_t*)arg)->ch;
- int* route = ((af_control_ext_t*)arg)->arg;
- route[FR] = s->route[ch][FR];
- route[TO] = s->route[ch][TO];
- return AF_OK;
- }
- case AF_CONTROL_CHANNELS_NR | AF_CONTROL_SET:
- s->nr = *(int*)arg;
- return AF_OK;
- case AF_CONTROL_CHANNELS_NR | AF_CONTROL_GET:
- *(int*)arg = s->nr;
- return AF_OK;
- case AF_CONTROL_CHANNELS_ROUTER | AF_CONTROL_SET:
- s->router = *(int*)arg;
- return AF_OK;
- case AF_CONTROL_CHANNELS_ROUTER | AF_CONTROL_GET:
- *(int*)arg = s->router;
- return AF_OK;
}
return AF_UNKNOWN;
}
diff --git a/audio/filter/af_equalizer.c b/audio/filter/af_equalizer.c
index c488ffaeaf..a05b2df399 100644
--- a/audio/filter/af_equalizer.c
+++ b/audio/filter/af_equalizer.c
@@ -150,30 +150,6 @@ static int control(struct af_instance* af, int cmd, void* arg)
}
return AF_OK;
}
- case AF_CONTROL_EQUALIZER_GAIN | AF_CONTROL_SET:{
- float* gain = ((af_control_ext_t*)arg)->arg;
- int ch = ((af_control_ext_t*)arg)->ch;
- int k;
- if(ch >= AF_NCH || ch < 0)
- return AF_ERROR;
-
- for(k = 0 ; k<KM ; k++)
- s->g[ch][k] = pow(10.0,clamp(gain[k],G_MIN,G_MAX)/20.0)-1.0;
-
- return AF_OK;
- }
- case AF_CONTROL_EQUALIZER_GAIN | AF_CONTROL_GET:{
- float* gain = ((af_control_ext_t*)arg)->arg;
- int ch = ((af_control_ext_t*)arg)->ch;
- int k;
- if(ch >= AF_NCH || ch < 0)
- return AF_ERROR;
-
- for(k = 0 ; k<KM ; k++)
- gain[k] = log10(s->g[ch][k]+1.0) * 20.0;
-
- return AF_OK;
- }
}
return AF_UNKNOWN;
}
diff --git a/audio/filter/af_extrastereo.c b/audio/filter/af_extrastereo.c
index 0f7fe36861..d9120fb8d9 100644
--- a/audio/filter/af_extrastereo.c
+++ b/audio/filter/af_extrastereo.c
@@ -69,12 +69,6 @@ static int control(struct af_instance* af, int cmd, void* arg)
s->mul = f;
return AF_OK;
}
- case AF_CONTROL_ES_MUL | AF_CONTROL_SET:
- s->mul = *(float*)arg;
- return AF_OK;
- case AF_CONTROL_ES_MUL | AF_CONTROL_GET:
- *(float*)arg = s->mul;
- return AF_OK;
}
return AF_UNKNOWN;
}
diff --git a/audio/filter/af_pan.c b/audio/filter/af_pan.c
index 8b1783ee84..6468d14042 100644
--- a/audio/filter/af_pan.c
+++ b/audio/filter/af_pan.c
@@ -109,14 +109,11 @@ static int control(struct af_instance* af, int cmd, void* arg)
// Sanity check
if(((int*)arg)[0] <= 0 || ((int*)arg)[0] > AF_NCH){
mp_msg(MSGT_AFILTER, MSGL_ERR, "[pan] The number of output channels must be"
- " between 1 and %i. Current value is %i\n",AF_NCH,((int*)arg)[0]);
+ " between 1 and %i. Current value is %i\n",AF_NCH,((int*)arg)[0]);
return AF_ERROR;
}
s->nch=((int*)arg)[0];
return AF_OK;
- case AF_CONTROL_PAN_NOUT | AF_CONTROL_GET:
- *(int*)arg = af->data->nch;
- return AF_OK;
case AF_CONTROL_PAN_BALANCE | AF_CONTROL_SET:{
float val = *(float*)arg;
if (s->nch)
diff --git a/audio/filter/af_sinesuppress.c b/audio/filter/af_sinesuppress.c
index 36f7189f00..c9a77ab498 100644
--- a/audio/filter/af_sinesuppress.c
+++ b/audio/filter/af_sinesuppress.c
@@ -79,18 +79,6 @@ static int control(struct af_instance* af, int cmd, void* arg)
s->decay = f2;
return AF_OK;
}
- case AF_CONTROL_SS_FREQ | AF_CONTROL_SET:
- s->freq = *(float*)arg;
- return AF_OK;
- case AF_CONTROL_SS_FREQ | AF_CONTROL_GET:
- *(float*)arg = s->freq;
- return AF_OK;
- case AF_CONTROL_SS_DECAY | AF_CONTROL_SET:
- s->decay = *(float*)arg;
- return AF_OK;
- case AF_CONTROL_SS_DECAY | AF_CONTROL_GET:
- *(float*)arg = s->decay;
- return AF_OK;
}
return AF_UNKNOWN;
}
diff --git a/audio/filter/af_volume.c b/audio/filter/af_volume.c
index 474ad72777..5664443f03 100644
--- a/audio/filter/af_volume.c
+++ b/audio/filter/af_volume.c
@@ -91,26 +91,10 @@ static int control(struct af_instance* af, int cmd, void* arg)
for(i=0;i<AF_NCH;i++) vol[i]=v;
return control(af,AF_CONTROL_VOLUME_LEVEL | AF_CONTROL_SET, vol);
}
- case AF_CONTROL_VOLUME_ON_OFF | AF_CONTROL_SET:
- memcpy(s->enable,(int*)arg,AF_NCH*sizeof(int));
- return AF_OK;
- case AF_CONTROL_VOLUME_ON_OFF | AF_CONTROL_GET:
- memcpy((int*)arg,s->enable,AF_NCH*sizeof(int));
- return AF_OK;
- case AF_CONTROL_VOLUME_SOFTCLIP | AF_CONTROL_SET:
- s->soft = *(int*)arg;
- return AF_OK;
- case AF_CONTROL_VOLUME_SOFTCLIP | AF_CONTROL_GET:
- *(int*)arg = s->soft;
- return AF_OK;
case AF_CONTROL_VOLUME_LEVEL | AF_CONTROL_SET:
return af_from_dB(AF_NCH,(float*)arg,s->level,20.0,-200.0,60.0);
case AF_CONTROL_VOLUME_LEVEL | AF_CONTROL_GET:
return af_to_dB(AF_NCH,s->level,(float*)arg,20.0);
- case AF_CONTROL_VOLUME_PROBE | AF_CONTROL_GET:
- return af_to_dB(AF_NCH,s->pow,(float*)arg,10.0);
- case AF_CONTROL_VOLUME_PROBE_MAX | AF_CONTROL_GET:
- return af_to_dB(AF_NCH,s->max,(float*)arg,10.0);
case AF_CONTROL_PRE_DESTROY:{
float m = 0.0;
int i;
diff --git a/audio/filter/control.h b/audio/filter/control.h
index 1342d5f299..aa1900d106 100644
--- a/audio/filter/control.h
+++ b/audio/filter/control.h
@@ -22,48 +22,6 @@
#include <sys/types.h>
/*********************************************
-// Control info struct.
-//
-// This struct is the argument in a info call to a filter.
-*/
-
-// Argument types
-#define AF_CONTROL_TYPE_BOOL (0x0<<0)
-#define AF_CONTROL_TYPE_CHAR (0x1<<0)
-#define AF_CONTROL_TYPE_INT (0x2<<0)
-#define AF_CONTROL_TYPE_FLOAT (0x3<<0)
-#define AF_CONTROL_TYPE_STRUCT (0x4<<0)
-#define AF_CONTROL_TYPE_SPECIAL (0x5<<0) // a pointer to a function for example
-#define AF_CONTROL_TYPE_MASK (0x7<<0)
-// Argument geometry
-#define AF_CONTROL_GEOM_SCALAR (0x0<<3)
-#define AF_CONTROL_GEOM_ARRAY (0x1<<3)
-#define AF_CONTROL_GEOM_MATRIX (0x2<<3)
-#define AF_CONTROL_GEOM_MASK (0x3<<3)
-// Argument properties
-#define AF_CONTROL_PROP_READ (0x0<<5) // The argument can be read
-#define AF_CONTROL_PROP_WRITE (0x1<<5) // The argument can be written
-#define AF_CONTROL_PROP_SAVE (0x2<<5) // Can be saved
-#define AF_CONTROL_PROP_RUNTIME (0x4<<5) // Acessable during execution
-#define AF_CONTROL_PROP_CHANNEL (0x8<<5) // Argument is set per channel
-#define AF_CONTROL_PROP_MASK (0xF<<5)
-
-typedef struct af_control_info_s{
- int def; // Control enumrification
- char* name; // Name of argument
- char* info; // Description of what it does
- int flags; // Flags as defined above
- float max; // Max and min value
- float min; // (only aplicable on float and int)
- int xdim; // 1st dimension
- int ydim; // 2nd dimension (=0 for everything except matrix)
- size_t sz; // Size of argument in bytes
- int ch; // Channel number (for future use)
- void* arg; // Data (for future use)
-}af_control_info_t;
-
-
-/*********************************************
// Extended control used with arguments that operates on only one
// channel at the time
*/
@@ -114,20 +72,12 @@ typedef struct af_control_ext_s{
#define AF_CONTROL_SET 0x00000000
// Get argument
#define AF_CONTROL_GET 0x00000001
-// Get info about the control, i.e fill in everything except argument
-#define AF_CONTROL_INFO 0x00000002
// Resample
// Set output rate in resample
#define AF_CONTROL_RESAMPLE_RATE 0x00000100 | AF_CONTROL_FILTER_SPECIFIC
-// Enable sloppy resampling
-#define AF_CONTROL_RESAMPLE_SLOPPY 0x00000200 | AF_CONTROL_FILTER_SPECIFIC
-
-// Set resampling accuracy
-#define AF_CONTROL_RESAMPLE_ACCURACY 0x00000300 | AF_CONTROL_FILTER_SPECIFIC
-
// Format
#define AF_CONTROL_FORMAT_FMT 0x00000400 | AF_CONTROL_FILTER_SPECIFIC
@@ -137,69 +87,11 @@ typedef struct af_control_ext_s{
// Set number of output channels in channels
#define AF_CONTROL_CHANNELS 0x00000600 | AF_CONTROL_FILTER_SPECIFIC
-// Set number of channel routes
-#define AF_CONTROL_CHANNELS_ROUTES 0x00000700 | AF_CONTROL_FILTER_SPECIFIC
-
-// Set channel routing pair, arg is int[2] and ch is used
-#define AF_CONTROL_CHANNELS_ROUTING 0x00000800 | AF_CONTROL_FILTER_SPECIFIC
-
-// Set nuber of channel routing pairs, arg is int*
-#define AF_CONTROL_CHANNELS_NR 0x00000900 | AF_CONTROL_FILTER_SPECIFIC
-
-// Set make af_channels into a router
-#define AF_CONTROL_CHANNELS_ROUTER 0x00000A00 | AF_CONTROL_FILTER_SPECIFIC
-
// Volume
-// Turn volume control on and off, arg is int*
-#define AF_CONTROL_VOLUME_ON_OFF 0x00000B00 | AF_CONTROL_FILTER_SPECIFIC
-
-// Turn soft clipping of the volume on and off, arg is binary
-#define AF_CONTROL_VOLUME_SOFTCLIP 0x00000C00 | AF_CONTROL_FILTER_SPECIFIC
-
// Set volume level, arg is a float* with the volume for all the channels
#define AF_CONTROL_VOLUME_LEVEL 0x00000D00 | AF_CONTROL_FILTER_SPECIFIC
-// Probed power level for all channels, arg is a float*
-#define AF_CONTROL_VOLUME_PROBE 0x00000E00 | AF_CONTROL_FILTER_SPECIFIC
-
-// Maximum probed power level for all channels, arg is a float*
-#define AF_CONTROL_VOLUME_PROBE_MAX 0x00000F00 | AF_CONTROL_FILTER_SPECIFIC
-
-// Compressor/expander
-
-// Turn compressor/expander on and off
-#define AF_CONTROL_COMP_ON_OFF 0x00001000 | AF_CONTROL_FILTER_SPECIFIC
-
-// Compression/expansion threshold [dB]
-#define AF_CONTROL_COMP_THRESH 0x00001100 | AF_CONTROL_FILTER_SPECIFIC
-
-// Compression/expansion attack time [ms]
-#define AF_CONTROL_COMP_ATTACK 0x00001200 | AF_CONTROL_FILTER_SPECIFIC
-
-// Compression/expansion release time [ms]
-#define AF_CONTROL_COMP_RELEASE 0x00001300 | AF_CONTROL_FILTER_SPECIFIC
-
-// Compression/expansion gain level [dB]
-#define AF_CONTROL_COMP_RATIO 0x00001400 | AF_CONTROL_FILTER_SPECIFIC
-
-// Noise gate
-
-// Turn noise gate on an off
-#define AF_CONTROL_GATE_ON_OFF 0x00001500 | AF_CONTROL_FILTER_SPECIFIC
-
-// Noise gate threshold [dB]
-#define AF_CONTROL_GATE_THRESH 0x00001600 | AF_CONTROL_FILTER_SPECIFIC
-
-// Noise gate attack time [ms]
-#define AF_CONTROL_GATE_ATTACK 0x00001700 | AF_CONTROL_FILTER_SPECIFIC
-
-// Noise gate release time [ms]
-#define AF_CONTROL_GATE_RELEASE 0x00001800 | AF_CONTROL_FILTER_SPECIFIC
-
-// Noise gate release range level [dB]
-#define AF_CONTROL_GATE_RANGE 0x00001900 | AF_CONTROL_FILTER_SPECIFIC
-
// Pan
// Pan levels, arg is a control_ext with a float*
@@ -211,9 +103,6 @@ typedef struct af_control_ext_s{
// Balance, arg is float*; range -1 (left) to 1 (right), 0 center
#define AF_CONTROL_PAN_BALANCE 0x00001C00 | AF_CONTROL_FILTER_SPECIFIC
-// Set equalizer gain, arg is a control_ext with a float*
-#define AF_CONTROL_EQUALIZER_GAIN 0x00001D00 | AF_CONTROL_FILTER_SPECIFIC
-
// Delay length in ms, arg is a control_ext with a float*
#define AF_CONTROL_DELAY_LEN 0x00001E00 | AF_CONTROL_FILTER_SPECIFIC
@@ -231,21 +120,10 @@ typedef struct af_control_ext_s{
// Export
#define AF_CONTROL_EXPORT_SZ 0x00003000 | AF_CONTROL_FILTER_SPECIFIC
-
-// ExtraStereo Multiplier
-#define AF_CONTROL_ES_MUL 0x00003100 | AF_CONTROL_FILTER_SPECIFIC
-
-
-// Center
-
// Channel number which to inster the filtered data, arg in int*
#define AF_CONTROL_CENTER_CH 0x00003200 | AF_CONTROL_FILTER_SPECIFIC
-// SineSuppress
-#define AF_CONTROL_SS_FREQ 0x00003300 | AF_CONTROL_FILTER_SPECIFIC
-#define AF_CONTROL_SS_DECAY 0x00003400 | AF_CONTROL_FILTER_SPECIFIC
-
#define AF_CONTROL_PLAYBACK_SPEED 0x00003500 | AF_CONTROL_FILTER_SPECIFIC
#define AF_CONTROL_SCALETEMPO_AMOUNT 0x00003600 | AF_CONTROL_FILTER_SPECIFIC