1 /* 2 Waveform seekbar plugin for the DeaDBeeF audio player 3 4 Copyright (C) 2014 Christian Boxdörfer <christian.boxdoerfer@posteo.de> 5 6 Based on sndfile-tools waveform by Erik de Castro Lopo. 7 waveform.c - v1.04 8 Copyright (C) 2007-2012 Erik de Castro Lopo <erikd@mega-nerd.com> 9 Copyright (C) 2012 Robin Gareus <robin@gareus.org> 10 Copyright (C) 2013 driedfruit <driedfruit@mindloop.net> 11 12 This program is free software; you can redistribute it and/or 13 modify it under the terms of the GNU General Public License 14 as published by the Free Software Foundation; either version 2 15 of the License, or (at your option) any later version. 16 17 This program is distributed in the hope that it will be useful, 18 but WITHOUT ANY WARRANTY; without even the implied warranty of 19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 GNU General Public License for more details. 21 22 You should have received a copy of the GNU General Public License 23 along with this program; if not, write to the Free Software 24 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 25 */ 26 27 #ifndef CONFIG_HEADER 28 #define CONFIG_HEADER 29 30 #include <sys/types.h> 31 #include <sys/stat.h> 32 #include <stdlib.h> 33 #include <string.h> 34 #include <assert.h> 35 #include <math.h> 36 #include <fcntl.h> 37 #include <gtk/gtk.h> 38 39 #include <deadbeef/deadbeef.h> 40 #include <deadbeef/gtkui_api.h> 41 #include "cache.h" 42 43 #define CONFSTR_WF_LOG_ENABLED "waveform.log_enabled" 44 #define CONFSTR_WF_MIX_TO_MONO "waveform.mix_to_mono" 45 #define CONFSTR_WF_DISPLAY_RMS "waveform.display_rms" 46 #define CONFSTR_WF_DISPLAY_RULER "waveform.display_ruler" 47 #define CONFSTR_WF_RENDER_METHOD "waveform.render_method" 48 #define CONFSTR_WF_FILL_WAVEFORM "waveform.fill_waveform" 49 #define CONFSTR_WF_SOUNDCLOUD_STYLE "waveform.soundcloud_style" 50 #define CONFSTR_WF_SHADE_WAVEFORM "waveform.shade_waveform" 51 #define CONFSTR_WF_BG_COLOR_R "waveform.bg_color_r" 52 #define CONFSTR_WF_BG_COLOR_G "waveform.bg_color_g" 53 #define CONFSTR_WF_BG_COLOR_B "waveform.bg_color_b" 54 #define CONFSTR_WF_BG_ALPHA "waveform.bg_alpha" 55 #define CONFSTR_WF_FG_COLOR_R "waveform.fg_color_r" 56 #define CONFSTR_WF_FG_COLOR_G "waveform.fg_color_g" 57 #define CONFSTR_WF_FG_COLOR_B "waveform.fg_color_b" 58 #define CONFSTR_WF_FG_ALPHA "waveform.fg_alpha" 59 #define CONFSTR_WF_PB_COLOR_R "waveform.pb_color_r" 60 #define CONFSTR_WF_PB_COLOR_G "waveform.pb_color_g" 61 #define CONFSTR_WF_PB_COLOR_B "waveform.pb_color_b" 62 #define CONFSTR_WF_PB_ALPHA "waveform.pb_alpha" 63 #define CONFSTR_WF_FG_RMS_COLOR_R "waveform.fg_rms_color_r" 64 #define CONFSTR_WF_FG_RMS_COLOR_G "waveform.fg_rms_color_g" 65 #define CONFSTR_WF_FG_RMS_COLOR_B "waveform.fg_rms_color_b" 66 #define CONFSTR_WF_FG_RMS_ALPHA "waveform.fg_rms_alpha" 67 68 #define CONFSTR_WF_REFRESH_INTERVAL "waveform.refresh_interval" 69 #define CONFSTR_WF_BORDER_WIDTH "waveform.border_width" 70 #define CONFSTR_WF_CURSOR_WIDTH "waveform.cursor_width" 71 #define CONFSTR_WF_FONT_SIZE "waveform.font_size" 72 #define CONFSTR_WF_MAX_FILE_LENGTH "waveform.max_file_length" 73 #define CONFSTR_WF_CACHE_ENABLED "waveform.cache_enabled" 74 #define CONFSTR_WF_SCROLL_ENABLED "waveform.scroll_enabled" 75 #define CONFSTR_WF_NUM_SAMPLES "waveform.num_samples" 76 77 extern gboolean CONFIG_LOG_ENABLED; 78 extern gboolean CONFIG_MIX_TO_MONO; 79 extern gboolean CONFIG_CACHE_ENABLED; 80 extern gboolean CONFIG_SCROLL_ENABLED; 81 extern gboolean CONFIG_DISPLAY_RMS; 82 extern gboolean CONFIG_DISPLAY_RULER; 83 extern gboolean CONFIG_SHADE_WAVEFORM; 84 extern gboolean CONFIG_SOUNDCLOUD_STYLE; 85 extern GdkColor CONFIG_BG_COLOR; 86 extern GdkColor CONFIG_FG_COLOR; 87 extern GdkColor CONFIG_PB_COLOR; 88 extern GdkColor CONFIG_FG_RMS_COLOR; 89 extern guint16 CONFIG_BG_ALPHA; 90 extern guint16 CONFIG_FG_ALPHA; 91 extern guint16 CONFIG_PB_ALPHA; 92 extern guint16 CONFIG_FG_RMS_ALPHA; 93 extern gint CONFIG_RENDER_METHOD; 94 extern gint CONFIG_FILL_WAVEFORM; 95 extern gint CONFIG_BORDER_WIDTH; 96 extern gint CONFIG_CURSOR_WIDTH; 97 extern gint CONFIG_FONT_SIZE; 98 extern gint CONFIG_MAX_FILE_LENGTH; 99 extern gint CONFIG_NUM_SAMPLES; 100 extern gint CONFIG_REFRESH_INTERVAL; 101 102 103 void 104 save_config (void); 105 106 void 107 load_config (void); 108 109 #endif 110