1 /* EasyTAG - tag editor for audio files
2  * Copyright (C) 2014 David King <amigadave@amigadave.com>
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the Free
6  * Software Foundation; either version 2 of the License, or (at your option)
7  * any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc., 51
16  * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  */
18 
19 #ifndef ET_WAVPACK_PRIVATE_H_
20 #define ET_WAVPACK_PRIVATE_H_
21 
22 #include "config.h"
23 
24 #ifdef ENABLE_WAVPACK
25 
26 #include <gio/gio.h>
27 #include <wavpack/wavpack.h>
28 
29 G_BEGIN_DECLS
30 
31 typedef struct
32 {
33     GFileInputStream *istream;
34     GSeekable *seekable;
35     GError *error;
36 } EtWavpackState;
37 
38 typedef struct
39 {
40     /* Start fields copied from EtWavpackState. */
41     GFileInputStream *istream;
42     GSeekable *seekable;
43     GError *error;
44     /* End fields copied from EtWavpackState. */
45     GFileIOStream *iostream;
46     GFileOutputStream *ostream;
47 } EtWavpackWriteState;
48 
49 int32_t wavpack_read_bytes (void *id, void *data, int32_t bcount);
50 uint32_t wavpack_get_pos (void *id);
51 int wavpack_set_pos_abs (void *id, uint32_t pos);
52 int wavpack_set_pos_rel (void *id, int32_t delta, int mode);
53 int wavpack_push_back_byte (void *id, int c);
54 uint32_t wavpack_get_length (void *id);
55 int wavpack_can_seek (void *id);
56 
57 /* Only use this with EtWavpackWriteState. */
58 int32_t wavpack_write_bytes (void *id, void *data, int32_t bcount);
59 
60 G_END_DECLS
61 
62 #endif /* ENABLE_WAVPACK */
63 
64 #endif /* ET_WAVPACK_PRIVATE_H_ */
65