File: taglib_c.vapi

package info (click to toggle)
vala 0.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 13,756 kB
  • ctags: 12,353
  • sloc: ansic: 116,516; sh: 9,897; yacc: 1,218; makefile: 837; xml: 657; lex: 285
file content (102 lines) | stat: -rw-r--r-- 3,231 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/* taglib_c.vapi
 *
 * Copyright (C) 2008 Andreas Brauchli
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.

 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	Andreas Brauchli <a.brauchli@elementarea.net>
 */

[CCode (cprefix = "TagLib_", lower_case_cprefix = "taglib_", cheader_filename = "tag_c.h")]
namespace TagLib
{
	[CCode (free_function = "taglib_file_free", lower_case_cprefix = "taglib_file_")]
	[Compact]
	public class File
	{
		[CCode (cname = "taglib_file_new")]
		public File (string filename);

		[CCode (cname = "taglib_file_new_type")]
		public File.type (string filename, FileType type);

		public Tag tag();
		public AudioProperties audioproperties(); //FIXME: should be assigned to a const TagLib_Audio_Properties*
		public int save();
	}

	[CCode (free_function = "", lower_case_cprefix = "taglib_tag_")]
	[Compact]
	public class Tag
	{
		public weak string title();
		public weak string artist();
		public weak string album();
		public weak string comment();
		public weak string genre();
		public uint year();
		public uint track();

		public void set_title(string title);
		public void set_artist(string artist);
		public void set_album(string album);
		public void set_comment(string comment);
		public void set_genre(string genre);
		public void set_year(uint year);
		public void set_track(uint track);
	}

	[CCode (free_function = "", cname = "TagLib_AudioProperties", cprefix = "taglib_audioproperties_")]
	[Compact]
	public class AudioProperties
	{
		public int length ();
		public int bitrate ();
		public int samplerate ();
		public int channels ();
	}

	namespace TagLib
	{
		/* By default all strings coming into or out of TagLib's C API are in UTF8.
		 * However, it may be desirable for TagLib to operate on Latin1 (ISO-8859-1)
		 * strings in which case this should be set to FALSE.
		 */
		[CCode (cname = "taglib_set_strings_unicode")]
		public static void set_strings_unicode (int unicode);

		/* TagLib can keep track of strings that are created when outputting tag values
		 * and clear them using taglib_tag_clear_strings().  This is enabled by default.
		 * However if you wish to do more fine grained management of strings, you can do
		 * so by setting a management to FALSE.
		 */
		[CCode (cname = "taglib_set_string_management_enabled")]
		public static void set_string_management_enabled (int management);

		[CCode (cname = "taglib_tag_free_strings")]
		public static void free_strings ();
	}

	[CCode (cname = "TagLib_File_Type", cprefix = "TagLib_File_")]
	public enum FileType
	{
		MPEG,
		OggVorbis,
		FLAC,
		MPC
	}
}