File: mp3tag.3

package info (click to toggle)
libmp3tag-ruby 1.0-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 76 kB
  • ctags: 52
  • sloc: ruby: 352; makefile: 6
file content (185 lines) | stat: -rw-r--r-- 2,848 bytes parent folder | download | duplicates (8)
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
.\" DO NOT MODIFY THIS FILE! it was generated by rd2
.TH mp3tag.rb 1 "July 2001"
.SH Synopsis
.PP
Read the tag from a file or create and Mp3Tag instance for saving tag to
mp3 file later:
.nf
\&    tag = Mp3Tag.new(filename)
.fi
Examining tags:
.nf
\&    tag.songname
\&    tag.artist
\&    tag.album
\&    tag.year
\&    tag.comment
\&    tag.tracknum
\&    tag.genre_id
\&    tag.genre
.fi
Setting tags:
.nf
\&    tag.songname = "My Song"
\&    tag.artist = "Me"
\&    tag.album = "My Album"
\&    tag.year = "2001"
\&    tag.comment = "No Comment"
\&    tag.tracknum = 3
\&    
\&    tag.genre_id = 23
\&    tag.genre = "Drum Solo"
.fi
genre_id's should exist in Mp3Tag::Genres. Elements in Mp3Tag::Genres
can be assigned using tag.genre= and the id will be looked up
automatically.
Saving tag to mp3:
.nf
\&    tag.commit
.fi
Checking if a file has a tag:
.nf
\&    Mp3Tag.hastag?(filename)
.fi
.SH Class Methods
.PP

.TP
.fi
.B
Mp3Tag.new(path)
Creates a new Mp3Tag object for the file give by path.

.TP
.fi
.B
Mp3Tag.hastag?(filename)
Tests if filename has a ID3V1.0 or ID3V1.1 tag. Returns a boolean values giving the result of the test.

.TP
.fi
.B
Mp3Tag.removetag(filename)
Removes an ID3v1 tag from the MP3 file filename
.SH Instance Methods
.PP

.TP
.fi
.B
songname

.TP
.fi
.B
artist

.TP
.fi
.B
album

.TP
.fi
.B
comment
Return the song name, artist, album, or comment from the tag as a String object. Will return empty strings if file did not have a tag.


.TP
.fi
.B
tracknum
Returns the track number from the tag. Will return 0 if the track number was not set in the tag when loaded, or if the file had no tag.


.TP
.fi
.B
year
Returns the year from the tag. Will return 0 if the file had no tag.


.TP
.fi
.B
genre_id
Return the id number of the genre from the tag. Will return 255 if the file had no tag.


.TP
.fi
.B
genre
Returns the genre name. Will return "Unknown" if the file had no tag or the genre id was not in Mp3Tag::Genres


.TP
.fi
.B
path
Returns the full path name of the MP3 file.


.TP
.fi
.B
filename
Returns the filename without the directory part of the MP3 File.


.TP
.fi
.B
songname=(txt)

.TP
.fi
.B
artist=(txt)

.TP
.fi
.B
album=(txt)

.TP
.fi
.B
comment=(txt)
Sets the song name, atist, album, or comment for the tag to txt. txt should be a String object.


.TP
.fi
.B
tracknum=(num)
Sets the track number for the tag. Only values in the range (0..255) are allowed.


.TP
.fi
.B
year=(num)
Sets the year for the tag. Should be a four digit number.


.TP
.fi
.B
genre_id=(num)
Sets the the genre id for the tag. Only values in the range (0..255) are allowed.


.TP
.fi
.B
genre=(txt)
Sets the genre id for the tag to the index of txt in Mp3Tag::Genres. The genre id will be set to 255 if txt is not found in the list.

.TP
.fi
.B
commit
Saves the tag to the MP3 file. Will overwrite any existing tag.