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, see <http://www.gnu.org/licenses/>.
23 #include <pulsecore/macro.h>
24 #include <pulse/sample.h>
26 typedef struct pa_smoother pa_smoother;
28 pa_smoother* pa_smoother_new(
29 pa_usec_t x_adjust_time,
30 pa_usec_t x_history_time,
37 void pa_smoother_free(pa_smoother* s);
39 /* Adds a new value to our dataset. x = local/system time, y = remote time */
40 void pa_smoother_put(pa_smoother *s, pa_usec_t x, pa_usec_t y);
42 /* Returns an interpolated value based on the dataset. x = local/system time, return value = remote time */
43 pa_usec_t pa_smoother_get(pa_smoother *s, pa_usec_t x);
45 /* 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 */
46 pa_usec_t pa_smoother_translate(pa_smoother *s, pa_usec_t x, pa_usec_t y_delay);
48 void pa_smoother_set_time_offset(pa_smoother *s, pa_usec_t x_offset);
50 void pa_smoother_pause(pa_smoother *s, pa_usec_t x);
51 void pa_smoother_resume(pa_smoother *s, pa_usec_t x, bool abrupt);
53 void pa_smoother_reset(pa_smoother *s, pa_usec_t time_offset, bool paused);
55 void pa_smoother_fix_now(pa_smoother *s);