peakdetector.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00027 #ifndef GAVL_PEAKDETECTORS_H_INCLUDED
00028 #define GAVL_PEAKDETECTORS_H_INCLUDED
00029
00030 #include <gavl/connectors.h>
00031
00032 #ifdef __cplusplus
00033 extern "C" {
00034 #endif
00035
00051 typedef struct gavl_peak_detector_s gavl_peak_detector_t;
00052
00053
00054
00065 typedef void (*gavl_update_peak_callback)(void * priv,
00066 int samples,
00067 double min, double max, double abs);
00068
00079 typedef void (*gavl_update_peaks_callback)(void * priv,
00080 int samples,
00081 const double * min,
00082 const double * max,
00083 const double * abs);
00084
00089 GAVL_PUBLIC
00090 gavl_peak_detector_t * gavl_peak_detector_create();
00091
00101 GAVL_PUBLIC
00102 void gavl_peak_detector_set_callbacks(gavl_peak_detector_t * pd,
00103 gavl_update_peak_callback peak_callback,
00104 gavl_update_peaks_callback peaks_callback,
00105 void * priv);
00106
00107
00112 GAVL_PUBLIC
00113 void gavl_peak_detector_destroy(gavl_peak_detector_t *pd);
00114
00123 GAVL_PUBLIC
00124 void gavl_peak_detector_set_format(gavl_peak_detector_t *pd,
00125 const gavl_audio_format_t * format);
00126
00134 GAVL_PUBLIC const gavl_audio_format_t *
00135 gavl_peak_detector_get_format(gavl_peak_detector_t * pd);
00136
00137
00143 GAVL_PUBLIC
00144 void gavl_peak_detector_update(gavl_peak_detector_t *pd,
00145 gavl_audio_frame_t * frame);
00146
00157 GAVL_PUBLIC
00158 gavl_audio_sink_t * gavl_peak_detector_get_sink(gavl_peak_detector_t *pd);
00159
00171 GAVL_PUBLIC
00172 void gavl_peak_detector_get_peak(gavl_peak_detector_t * pd,
00173 double * min, double * max,
00174 double * abs);
00175
00187 GAVL_PUBLIC
00188 void gavl_peak_detector_get_peaks(gavl_peak_detector_t * pd,
00189 double * min, double * max,
00190 double * abs);
00191
00196 GAVL_PUBLIC
00197 void gavl_peak_detector_reset(gavl_peak_detector_t * pd);
00198
00205 #ifdef __cplusplus
00206 }
00207 #endif
00208
00209 #endif // GAVL_PEAKDETECTORS_H_INCLUDED