codegen: Use get_local_cvalue to unref local variables
[vala-lang.git] / vapi / taglib_c.vapi
blob19db6ed5dc563574b03f681c63fadcb3117b2d6d
1 /* taglib_c.vapi
2  *
3  * Copyright (C) 2009 Andreas Brauchli
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
18  *
19  * Author:
20  *      Andreas Brauchli <a.brauchli@elementarea.net>
21  */
23 [CCode (cprefix = "TagLib_", lower_case_cprefix = "taglib_", cheader_filename = "tag_c.h")]
24 namespace TagLib
26         public static void set_strings_unicode (bool unicode);
27         /* TagLib can keep track of strings that are created when outputting tag values
28          * and clear them using taglib_tag_clear_strings().  This is enabled by default.
29          * However if you wish to do more fine grained management of strings, you can do
30          * so by setting a management to FALSE.
31          */
32         public static void set_string_management_enabled (bool management);
34         [CCode (free_function = "taglib_file_free")]
35         [Compact]
36         public class File
37         {
38                 public File (string filename);
39                 public File.type (string filename, FileType type);
41                 public bool is_valid ();
42                 public unowned Tag tag {
43                         [CCode (cname = "taglib_file_tag")]
44                         get;
45                 }
46                 public unowned AudioProperties audioproperties {
47                         [CCode (cname = "taglib_file_audioproperties")]
48                         get;
49                 }
50                 public bool save ();
51         }
53         [CCode (free_function = "")]
54         [Compact]
55         public class Tag
56         {
57                 public unowned string title {
58                         [CCode (cname = "taglib_tag_title")]
59                         get;
60                         set;
61                 }
62                 public unowned string artist {
63                         [CCode (cname = "taglib_tag_artist")]
64                         get;
65                         set;
66                 }
67                 public unowned string album {
68                         [CCode (cname = "taglib_tag_album")]
69                         get;
70                         set;
71                 }
72                 public unowned string comment {
73                         [CCode (cname = "taglib_tag_comment")]
74                         get;
75                         set;
76                 }
77                 public unowned string genre {
78                         [CCode (cname = "taglib_tag_genre")]
79                         get;
80                         set;
81                 }
82                 public uint year {
83                         [CCode (cname = "taglib_tag_year")]
84                         get;
85                         set;
86                 }
87                 public uint track {
88                         [CCode (cname = "taglib_tag_track")]
89                         get;
90                         set;
91                 }
93                 public static void free_strings ();
94         }
96         [CCode (free_function = "", cname = "TagLib_AudioProperties")]
97         [Compact]
98         [Immutable]
99         public class AudioProperties
100         {
101                 public int length {
102                         [CCode (cname = "taglib_audioproperties_length")]
103                         get;
104                 }
105                 public int bitrate {
106                         [CCode (cname = "taglib_audioproperties_bitrate")]
107                         get;
108                 }
109                 public int samplerate {
110                         [CCode (cname = "taglib_audioproperties_samplerate")]
111                         get;
112                 }
113                 public int channels {
114                         [CCode (cname = "taglib_audioproperties_channels")]
115                         get;
116                 }
117         }
119         [CCode (cname = "TagLib_File_Type", cprefix = "TagLib_File_")]
120         public enum FileType
121         {
122                 MPEG,
123                 OggVorbis,
124                 FLAC,
125                 MPC,
126                 OggFlac,
127                 WavPack,
128                 Speex,
129                 TrueAudio
130         }
132         namespace ID3v2 {
133                 [CCode (cname = "taglib_id3v2_set_default_text_encoding")]
134                 public void set_default_text_encoding (Encoding encoding);
136                 [CCode (cname = "TagLib_ID3v2_Encoding", cprefix = "TagLib_ID3v2_")]
137                 public enum Encoding {
138                         Latin1,
139                         UTF16,
140                         UTF16BE,
141                         UTF8
142                 }
143         }