audiopanorama: move the enum to the header and use instead of gint

Move the enum for the processing method to the header so that we can use the
type for the instance struct.
This commit is contained in:
Stefan Sauer 2013-06-09 20:29:09 +02:00
parent 1602f50195
commit 4ef27eb0f9
2 changed files with 8 additions and 18 deletions

View file

@ -51,12 +51,6 @@
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT); GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
/* Filter signals and args */ /* Filter signals and args */
enum
{
/* FILL ME */
LAST_SIGNAL
};
enum enum
{ {
PROP_0, PROP_0,
@ -64,13 +58,6 @@ enum
PROP_METHOD PROP_METHOD
}; };
enum
{
METHOD_PSYCHOACOUSTIC = 0,
METHOD_SIMPLE,
NUM_METHODS
};
#define GST_TYPE_AUDIO_PANORAMA_METHOD (gst_audio_panorama_method_get_type ()) #define GST_TYPE_AUDIO_PANORAMA_METHOD (gst_audio_panorama_method_get_type ())
static GType static GType
gst_audio_panorama_method_get_type (void) gst_audio_panorama_method_get_type (void)
@ -249,10 +236,7 @@ gst_audio_panorama_set_process_function (GstAudioPanorama * filter,
} }
format_index = GST_AUDIO_FORMAT_INFO_IS_FLOAT (finfo) ? 1 : 0; format_index = GST_AUDIO_FORMAT_INFO_IS_FLOAT (finfo) ? 1 : 0;
method_index = filter->method; method_index = filter->method;
if (method_index >= NUM_METHODS || method_index < 0)
method_index = METHOD_PSYCHOACOUSTIC;
filter->process = filter->process =
panorama_process_functions[channel_index][format_index][method_index]; panorama_process_functions[channel_index][format_index][method_index];

View file

@ -39,16 +39,22 @@ typedef struct _GstAudioPanoramaClass GstAudioPanoramaClass;
typedef void (*GstAudioPanoramaProcessFunc)(GstAudioPanorama*, guint8*, guint8*, guint); typedef void (*GstAudioPanoramaProcessFunc)(GstAudioPanorama*, guint8*, guint8*, guint);
typedef enum
{
METHOD_PSYCHOACOUSTIC = 0,
METHOD_SIMPLE
} GstAudioPanoramaMethod;
struct _GstAudioPanorama { struct _GstAudioPanorama {
GstBaseTransform element; GstBaseTransform element;
/* properties */
gfloat panorama; gfloat panorama;
GstAudioPanoramaMethod method;
/* < private > */ /* < private > */
GstAudioPanoramaProcessFunc process; GstAudioPanoramaProcessFunc process;
GstAudioInfo info; GstAudioInfo info;
gint method;
}; };
struct _GstAudioPanoramaClass { struct _GstAudioPanoramaClass {