1 #ifndef foopulsetimesmootherhfoo
2 #define foopulsetimesmootherhfoo
5 This file is part of PulseAudio.
7 Copyright 2007 Lennart Poettering
9 PulseAudio is free software; you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as
11 published by the Free Software Foundation; either version 2.1 of the
12 License, or (at your option) any later version.
14 PulseAudio is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
19 You should have received a copy of the GNU Lesser General Public
20 License along with PulseAudio; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 #include <pulsecore/macro.h>
26 #include <pulse/sample.h>
28 typedef struct pa_smoother pa_smoother;
30 pa_smoother* pa_smoother_new(pa_usec_t x_adjust_time, pa_usec_t x_history_time, pa_bool_t monotonic, unsigned min_history);
31 void pa_smoother_free(pa_smoother* s);
33 /* Adds a new value to our dataset. x = local/system time, y = remote time */
34 void pa_smoother_put(pa_smoother *s, pa_usec_t x, pa_usec_t y);
36 /* Returns an interpolated value based on the dataset. x = local/system time, return value = remote time */
37 pa_usec_t pa_smoother_get(pa_smoother *s, pa_usec_t x);
39 /* Translates a time span from the remote time domain to the local one. x = local/system time when to estimate, y_delay = remote time span */
40 pa_usec_t pa_smoother_translate(pa_smoother *s, pa_usec_t x, pa_usec_t y_delay);
42 void pa_smoother_set_time_offset(pa_smoother *s, pa_usec_t x_offset);
44 void pa_smoother_pause(pa_smoother *s, pa_usec_t x);
45 void pa_smoother_resume(pa_smoother *s, pa_usec_t x);
47 void pa_smoother_reset(pa_smoother *s);