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 #include <stdio.h> 28 #include <string.h> 29 #include <stdlib.h> 30 #include <string.h> 31 #include <assert.h> 32 #include <math.h> 33 #include <fcntl.h> 34 #include <sqlite3.h> 35 36 void 37 waveform_db_open (); 38 39 void 40 waveform_db_close (); 41 42 void 43 waveform_db_init (char const *fname); 44 45 int 46 waveform_db_cached (char const *fname); 47 48 int 49 waveform_db_delete (char const *fname); 50 51 int 52 waveform_db_read (char const *fname, short *buffer, int buffer_len, int *channels); 53 54 void 55 waveform_db_write (char const *fname, short *buffer, int buffer_len, int channels, int compression); 56