1 /* junklib -- library for reading tags from various audio files for deadbeef player
2   http://deadbeef.sourceforge.net
3 
4   Copyright (C) 2009-2013 Alexey Yakovenko
5 
6   This software is provided 'as-is', without any express or implied
7   warranty.  In no event will the authors be held liable for any damages
8   arising from the use of this software.
9 
10   Permission is granted to anyone to use this software for any purpose,
11   including commercial applications, and to alter it and redistribute it
12   freely, subject to the following restrictions:
13 
14   1. The origin of this software must not be misrepresented; you must not
15      claim that you wrote the original software. If you use this software
16      in a product, an acknowledgment in the product documentation would be
17      appreciated but is not required.
18   2. Altered source versions must be plainly marked as such, and must not be
19      misrepresented as being the original software.
20   3. This notice may not be removed or altered from any source distribution.
21 
22   Alexey Yakovenko waker@users.sourceforge.net
23 */
24 #ifndef __JUNKLIB_H
25 #define __JUNKLIB_H
26 
27 #include <stdio.h>
28 #include "deadbeef.h"
29 
30 struct playItem_s;
31 
32 extern const char *ddb_internal_rg_keys[];
33 
34 int
35 junk_id3v1_read (struct playItem_s *it, DB_FILE *fp);
36 
37 int
38 junk_id3v1_find (DB_FILE *fp);
39 
40 int
41 junk_id3v1_write (FILE *fp, struct playItem_s *it, const char *enc);
42 
43 int
44 junk_id3v2_find (DB_FILE *fp, int *psize);
45 
46 int
47 junk_id3v2_read_full (struct playItem_s *it, DB_id3v2_tag_t *tag, DB_FILE *fp);
48 
49 int
50 junk_id3v2_convert_24_to_23 (DB_id3v2_tag_t *tag24, DB_id3v2_tag_t *tag23);
51 
52 int
53 junk_id3v2_convert_23_to_24 (DB_id3v2_tag_t *tag23, DB_id3v2_tag_t *tag24);
54 
55 int
56 junk_id3v2_convert_22_to_24 (DB_id3v2_tag_t *tag22, DB_id3v2_tag_t *tag24);
57 
58 int
59 junk_id3v2_convert_apev2_to_24 (DB_apev2_tag_t *ape, DB_id3v2_tag_t *tag24);
60 
61 DB_id3v2_frame_t *
62 junk_id3v2_add_text_frame (DB_id3v2_tag_t *tag, const char *frame_id, const char *value);
63 
64 int
65 junk_id3v2_remove_frames (DB_id3v2_tag_t *tag, const char *frame_id);
66 
67 int
68 junk_id3v2_write (FILE *file, DB_id3v2_tag_t *tag);
69 
70 void
71 junk_id3v2_free (DB_id3v2_tag_t *tag);
72 
73 int
74 junk_id3v2_read (struct playItem_s *it, DB_FILE *fp);
75 
76 int
77 junk_apev2_read_full (struct playItem_s *it, DB_apev2_tag_t *tag_store, DB_FILE *fp);
78 
79 int
80 junk_apev2_read_full_mem (struct playItem_s *it, DB_apev2_tag_t *tag_store, char *mem, int memsize);
81 
82 int
83 junk_apev2_read (struct playItem_s *it, DB_FILE *fp);
84 
85 int
86 junk_apev2_read_mem (struct playItem_s *it, char *mem, int size);
87 
88 int
89 junk_apev2_find (DB_FILE *fp, int32_t *psize, uint32_t *pflags, uint32_t *pnumitems);
90 
91 DB_apev2_frame_t *
92 junk_apev2_add_text_frame (DB_apev2_tag_t *tag, const char *frame_id, const char *value);
93 
94 int
95 junk_apev2_remove_frames (DB_apev2_tag_t *tag, const char *frame_id);
96 
97 void
98 junk_apev2_free (DB_apev2_tag_t *tag);
99 
100 int
101 junk_apev2_write (FILE *fp, DB_apev2_tag_t *tag, int write_header, int write_footer);
102 
103 int
104 junk_get_leading_size_stdio (FILE *fp);
105 
106 int
107 junk_get_leading_size (DB_FILE *fp);
108 
109 const char *
110 junk_detect_charset (const char *s);
111 
112 int
113 junk_iconv (const char *in, int inlen, char *out, int outlen, const char *cs_in, const char *cs_out);
114 
115 int
116 junk_recode (const char *in, int inlen, char *out, int outlen, const char *cs);
117 
118 int
119 junk_rewrite_tags (struct playItem_s *it, uint32_t junk_flags, int id3v2_version, const char *id3v1_encoding);
120 
121 void
122 junk_enable_cp1251_detection (int enable);
123 
124 void
125 junk_configchanged (void);
126 
127 void
128 junk_enable_cp936_detection (int enable);
129 
130 const char *
131 junk_detect_charset_len (const char *s, int len);
132 
133 #endif // __JUNKLIB_H
134