Added Harmonic Product Spectrum algorithm and "algorithm" property.
[tunertool] / src / gstpitch.h
index 4067c8f..d4a2e8a 100644 (file)
@@ -41,6 +41,19 @@ G_BEGIN_DECLS
 typedef struct _GstPitch GstPitch;
 typedef struct _GstPitchClass GstPitchClass;
 
+/**
+ * GstPitchAlgorithm:
+ * @GST_PITCH_ALGORITHM_FFT: simple FFT
+ * @GST_PITCH_ALGORITHM_HPS: Harmonic Product Spectrum
+ *
+ * Pitch detection algorithm.
+ */
+typedef enum 
+{
+       GST_PITCH_ALGORITHM_FFT,
+       GST_PITCH_ALGORITHM_HPS
+} GstPitchAlgorithm;
+
 struct _GstPitch
 {
   GstBaseTransform element;
@@ -50,22 +63,15 @@ struct _GstPitch
 
   /* properties */
   gboolean message;             /* whether or not to post messages */
-  gdouble interval;             /* how many seconds between emits */
   gint minfreq;                 /* initial frequency on scan for fundamental frequency */
   gint maxfreq;                 /* final frequency on scan for fundamental frequency */
-  gint nfft;                    /* number of samples taken for FFT */
-
-  /* <private> */
-  gint rate;                    /* caps variables */
-  gint width;
-  gint channels;
-
-  gint num_frames;              /* frame count (1 sample per channel) */
-  /* since last emit */
+  GstPitchAlgorithm algorithm; /* current pitch detection algorithm */
 
   kiss_fft_cfg fft_cfg;
   kiss_fft_cpx *signal;
   kiss_fft_cpx *spectrum;
+
+  gint * module;
 };
 
 struct _GstPitchClass