1 /*
2     Musical Spectrum plugin for the DeaDBeeF audio player
3 
4     Copyright (C) 2015 Christian Boxdörfer <christian.boxdoerfer@posteo.de>
5 
6     Based on DeaDBeeFs stock spectrum.
7     Copyright (c) 2009-2015 Alexey Yakovenko <waker@users.sourceforge.net>
8     Copyright (c) 2011 William Pitcock <nenolod@dereferenced.org>
9 
10     This program is free software; you can redistribute it and/or
11     modify it under the terms of the GNU General Public License
12     as published by the Free Software Foundation; either version 2
13     of the License, or (at your option) any later version.
14 
15     This program is distributed in the hope that it will be useful,
16     but WITHOUT ANY WARRANTY; without even the implied warranty of
17     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18     GNU General Public License for more details.
19 
20     You should have received a copy of the GNU General Public License
21     along with this program; if not, write to the Free Software
22     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
23 */
24 
25 #ifndef UTILS_HEADER
26 #define UTILS_HEADER
27 
28 #include <gtk/gtk.h>
29 
30 extern int CALCULATED_NUM_BARS;
31 
32 void
33 _memset_pattern (char *data, const void* pattern, size_t data_len, size_t pattern_len);
34 
35 void
36 update_num_bars (gpointer user_data);
37 
38 int
39 get_num_bars ();
40 
41 void
42 create_gradient_table (uint32_t *dest, GdkColor *colors, int num_colors);
43 
44 void
45 create_window_table (gpointer user_data);
46 
47 void
48 create_frequency_table (gpointer user_data);
49 
50 float
51 linear_interpolate (float y1, float y2, float mu);
52 
53 float
54 lagrange_interpolate (float y0, float y1, float y2, float y3, float x);
55 #endif
56