id3lib-ruby 0.4.1-mswin32 → 0.5.0-mswin32

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,5 +1,18 @@
1
1
  = id3lib-ruby changes
2
2
 
3
+ === 0.5.0 (2006-12-16)
4
+
5
+ * Warn when encountering nil field instead of raising exception (bug 6446).
6
+ * Corrected allowed fields - they are now generated from id3lib's source.
7
+ * Renamed :id field to :identifier because of confusion with frame ID.
8
+ * Added INSTALL document for installation instructions.
9
+ * Fixed memory leak in extension, where iterator was never released.
10
+ According to tests, there is no memory leak anymore.
11
+ * Added two patches for id3lib in mswin32 gem:
12
+ * unicode16: fixes Unicode writing bug
13
+ * convert_i-leak: fixes memory leak in Unicode conversion function
14
+ * Updated to SWIG 1.3.31.
15
+
3
16
  === 0.4.1 (r53)
4
17
 
5
18
  * Added :description to the allowed fields of :TXXX frames (patch 5484).
data/INSTALL ADDED
@@ -0,0 +1,57 @@
1
+ = id3lib-ruby installation instructions
2
+
3
+ == Binary package (Windows)
4
+
5
+ There are precompiled binary gems available for Windows, so the installation
6
+ is as simple as typing the following and selecting the newest mswin32 gem:
7
+
8
+ gem install id3lib-ruby
9
+
10
+ == Source package
11
+
12
+ For other systems, there is a RubyGems package or a compressed archive.
13
+
14
+ === Prerequisites
15
+
16
+ Before installing id3lib-ruby, you need to install the underlying id3lib
17
+ library and, depending on your system, set CONFIGURE_ARGS.
18
+
19
+ ==== Debian
20
+
21
+ Install libid3-dev and be sure to have ruby1.8-dev installed, otherwise you
22
+ won't be able to build Ruby extensions.
23
+
24
+ sudo aptitude install libid3-dev
25
+
26
+ ==== Gentoo
27
+
28
+ sudo emerge -n id3lib
29
+
30
+ ==== OS X with Fink
31
+
32
+ Install id3lib4-dev:
33
+
34
+ sudo apt-get install id3lib4-dev
35
+
36
+ Fink puts the library and header files in /sw. In order to enable the
37
+ id3lib-ruby install program to find them, do:
38
+
39
+ export CONFIGURE_ARGS="--with-opt-dir=/sw"
40
+
41
+ ==== Manual compilation
42
+
43
+ Download, compile and install id3lib. When installing in /usr/local, you
44
+ have to set CONFIGURE_ARGS:
45
+
46
+ export CONFIGURE_ARGS="--with-opt-dir=/usr/local"
47
+
48
+ === Installing id3lib-ruby
49
+
50
+ Now you're ready to install id3lib-ruby. If you use RubyGems, run the
51
+ following and select the newest version marked "ruby":
52
+
53
+ sudo gem install id3lib-ruby
54
+
55
+ Or if you install from the archive, unpack it and do:
56
+
57
+ sudo ruby setup.rb
data/README CHANGED
@@ -21,23 +21,14 @@ See TODO for planned features.
21
21
  The CHANGES file contains a list of changes between versions.
22
22
 
23
23
 
24
- == Online Information
25
-
26
- The home of id3lib-ruby is http://id3lib-ruby.rubyforge.org
27
-
28
-
29
24
  == Installation
30
25
 
31
- Note that id3lib has to be installed before running any of the following
32
- commands, unless you use the Windows binary gem.
33
-
34
- Installation through RubyGems:
26
+ See INSTALL.
35
27
 
36
- gem install id3lib-ruby
37
28
 
38
- Manual installation:
29
+ == Online Information
39
30
 
40
- ruby setup.rb
31
+ The home of id3lib-ruby is http://id3lib-ruby.rubyforge.org
41
32
 
42
33
 
43
34
  == Usage
data/Rakefile CHANGED
@@ -10,8 +10,6 @@ require 'rake/testtask'
10
10
  require 'rake/rdoctask'
11
11
 
12
12
 
13
- PKG_VERSION = '0.4.1'
14
-
15
13
  FILES_COMMON = FileList[
16
14
  'lib/**/*.rb',
17
15
  'test/test_*.rb',
@@ -21,6 +19,10 @@ FILES_COMMON = FileList[
21
19
  '*.rb'
22
20
  ]
23
21
 
22
+ FILES_DOC = FileList[
23
+ 'README', 'INSTALL', 'TODO', 'CHANGES'
24
+ ]
25
+
24
26
  FILES_EXT = FileList[
25
27
  'ext/*.rb',
26
28
  'ext/*.cxx',
@@ -56,8 +58,8 @@ Rake::RDocTask.new :rdoc do |rdoc|
56
58
  rdoc.rdoc_dir = 'doc'
57
59
  rdoc.title = 'id3lib-ruby'
58
60
  rdoc.options = RDOC_OPTS
61
+ rdoc.rdoc_files.include(FILES_DOC)
59
62
  rdoc.rdoc_files.include('lib/**/*.rb')
60
- rdoc.rdoc_files.include('README', 'TODO', 'CHANGES')
61
63
  end
62
64
  task :doc => [:rdoc]
63
65
 
@@ -65,7 +67,7 @@ task :doc => [:rdoc]
65
67
  if defined? Gem
66
68
  spec = Gem::Specification.new do |s|
67
69
  s.name = 'id3lib-ruby'
68
- s.version = PKG_VERSION
70
+ s.version = File.read('lib/id3lib.rb')[/VERSION = '(.*)'/, 1]
69
71
  s.summary =
70
72
  'id3lib-ruby provides a Ruby interface to the id3lib C++ library for ' +
71
73
  'easily editing ID3 tags (v1 and v2) like with pyid3lib.'
@@ -74,7 +76,7 @@ if defined? Gem
74
76
  s.extensions = ['ext/extconf.rb']
75
77
  s.test_files = FileList['test/test_*.rb']
76
78
  s.has_rdoc = true
77
- s.extra_rdoc_files = FileList['README', 'CHANGES', 'TODO']
79
+ s.extra_rdoc_files = FILES_DOC
78
80
  s.rdoc_options = RDOC_OPTS
79
81
  s.author = 'Robin Stocker'
80
82
  s.email = 'robinstocker@rubyforge.org'
@@ -95,9 +97,9 @@ if defined? Gem
95
97
 
96
98
  desc "Build mswin32 gem."
97
99
  task :gem_mswin32 => [:ext_mswin32] do
98
- Gem::Builder.new(spec_mswin32).build
99
- mkdir_p "pkg"
100
- mv "id3lib-ruby-#{PKG_VERSION}-mswin32.gem", "pkg/"
100
+ gemfile = Gem::Builder.new(spec_mswin32).build
101
+ mkpath "pkg"
102
+ mv gemfile, "pkg/"
101
103
  end
102
104
 
103
105
  end # defined? Gem
@@ -105,7 +107,7 @@ end # defined? Gem
105
107
 
106
108
  task :web => [:web_doc] do
107
109
  puts "# Now execute the following:"
108
- puts "scp web/* robinstocker@rubyforge.org:/var/www/gforge-projects/id3lib-ruby/"
110
+ puts "scp web/index.html web/logo.png web/red.css robinstocker@rubyforge.org:/var/www/gforge-projects/id3lib-ruby/"
109
111
  puts "scp -r web/doc robinstocker@rubyforge.org:/var/www/gforge-projects/id3lib-ruby/"
110
112
  end
111
113
 
@@ -115,10 +117,11 @@ Rake::RDocTask.new :web_doc do |rdoc|
115
117
  rdoc.title = 'id3lib-ruby'
116
118
  rdoc.options = RDOC_OPTS.clone
117
119
  rdoc.options << '--main' << 'ID3Lib::Tag'
118
- rdoc.rdoc_files.include('README', 'TODO', 'CHANGES')
120
+ rdoc.rdoc_files.include(FILES_DOC)
119
121
  rdoc.rdoc_files.include('lib/**/*.rb')
120
122
  end
121
123
 
124
+ desc "Generate syntax-highlighted HTML of usage.rb."
122
125
  task :usage_html do
123
126
  require 'syntax/convertors/html'
124
127
  convertor = Syntax::Convertors::HTML.for_syntax('ruby')
Binary file
data/lib/id3lib/info.rb CHANGED
@@ -57,25 +57,29 @@ module ID3Lib
57
57
 
58
58
  #
59
59
  # Please note that these frames are not fully supported by id3lib:
60
- # AENC, ASPI, COMR, EQUA, ETCO, LINK, MLLT,
61
- # OWNE, POSS, RBUF, RVA2, RVAD, RVRB, SEEK
60
+ # AENC, COMR, EQUA, ETCO, MCDI, MLLT,
61
+ # OWNE, POSS, RBUF, RVAD, RVRB, SYTC
62
+ # And these are not supported at all (segfault on usage):
63
+ # ASPI, EQU2, RVA2, SEEK, SIGN, TDEN,
64
+ # TDOR, TDRC, TDRL, TDTG, TIPL, TMCL,
65
+ # TMOO, TPRO, TSOA, TSOP, TSOT, TSST
62
66
  #
63
67
  Frames = [
64
68
  # Special frames
65
69
  [0, :____, "No known frame", []],
66
- [1, :AENC, "Audio encryption", [:owner, :data]],
67
- [2, :APIC, "Attached picture", [:textenc, :mimetype, :picturetype, :description, :data]],
68
- [3, :ASPI, "Audio seek point index", [:data]],
70
+ [1, :AENC, "Audio encryption", [:data]],
71
+ [2, :APIC, "Attached picture", [:textenc, :imageformat, :mimetype, :picturetype, :description, :data]],
72
+ [3, :ASPI, "Audio seek point index", []],
69
73
  [4, :COMM, "Comments", [:textenc, :language, :description, :text]],
70
74
  [5, :COMR, "Commercial frame", [:data]],
71
- [6, :ENCR, "Encryption method registration", [:owner, :id, :data]],
72
- [7, :EQU2, "Equalisation (2)", [:id, :text]],
75
+ [6, :ENCR, "Encryption method registration", [:owner, :identifier, :data]],
76
+ [7, :EQU2, "Equalisation (2)", []],
73
77
  [8, :EQUA, "Equalization", [:data]],
74
78
  [9, :ETCO, "Event timing codes", [:data]],
75
79
  [10, :GEOB, "General encapsulated object", [:textenc, :mimetype, :filename, :description, :data]],
76
- [11, :GRID, "Group identification registration", [:owner, :id, :data]],
80
+ [11, :GRID, "Group identification registration", [:owner, :identifier, :data]],
77
81
  [12, :IPLS, "Involved people list", [:textenc, :text]],
78
- [13, :LINK, "Linked information", [:data]],
82
+ [13, :LINK, "Linked information", [:identifier, :url, :text]],
79
83
  [14, :MCDI, "Music CD identifier", [:data]],
80
84
  [15, :MLLT, "MPEG location lookup table", [:data]],
81
85
  [16, :OWNE, "Ownership frame", [:data]],
@@ -84,13 +88,13 @@ module ID3Lib
84
88
  [19, :POPM, "Popularimeter", [:email, :rating, :counter]],
85
89
  [20, :POSS, "Position synchronisation frame", [:data]],
86
90
  [21, :RBUF, "Recommended buffer size", [:data]],
87
- [22, :RVA2, "Relative volume adjustment (2)", [:data]],
91
+ [22, :RVA2, "Relative volume adjustment (2)", []],
88
92
  [23, :RVAD, "Relative volume adjustment", [:data]],
89
93
  [24, :RVRB, "Reverb", [:data]],
90
- [25, :SEEK, "Seek frame", [:data]],
91
- [26, :SIGN, "Signature frame", [:id, :data]],
94
+ [25, :SEEK, "Seek frame", []],
95
+ [26, :SIGN, "Signature frame", []],
92
96
  [27, :SYLT, "Synchronized lyric/text", [:textenc, :language, :timestampformat, :contenttype, :description, :data]],
93
- [28, :SYTC, "Synchronized tempo codes", [:timestampformat, :data]],
97
+ [28, :SYTC, "Synchronized tempo codes", [:data]],
94
98
  # Text information frames
95
99
  [29, :TALB, "Album/Movie/Show title", [:textenc, :text]],
96
100
  [30, :TBPM, "BPM (beats per minute)", [:textenc, :text]],
@@ -98,13 +102,13 @@ module ID3Lib
98
102
  [32, :TCON, "Content type", [:textenc, :text]],
99
103
  [33, :TCOP, "Copyright message", [:textenc, :text]],
100
104
  [34, :TDAT, "Date", [:textenc, :text]],
101
- [35, :TDEN, "Encoding time", [:textenc, :text]],
105
+ [35, :TDEN, "Encoding time", []],
102
106
  [36, :TDLY, "Playlist delay", [:textenc, :text]],
103
- [37, :TDOR, "Original release time", [:textenc, :text]],
104
- [38, :TDRC, "Recording time", [:textenc, :text]],
105
- [39, :TDRL, "Release time", [:textenc, :text]],
106
- [40, :TDTG, "Tagging time", [:textenc, :text]],
107
- [41, :TIPL, "Involved people list", [:textenc, :text]],
107
+ [37, :TDOR, "Original release time", []],
108
+ [38, :TDRC, "Recording time", []],
109
+ [39, :TDRL, "Release time", []],
110
+ [40, :TDTG, "Tagging time", []],
111
+ [41, :TIPL, "Involved people list", []],
108
112
  [42, :TENC, "Encoded by", [:textenc, :text]],
109
113
  [43, :TEXT, "Lyricist/Text writer", [:textenc, :text]],
110
114
  [44, :TFLT, "File type", [:textenc, :text]],
@@ -115,9 +119,9 @@ module ID3Lib
115
119
  [49, :TKEY, "Initial key", [:textenc, :text]],
116
120
  [50, :TLAN, "Language(s)", [:textenc, :text]],
117
121
  [51, :TLEN, "Length", [:textenc, :text]],
118
- [52, :TMCL, "Musician credits list", [:textenc, :text]],
122
+ [52, :TMCL, "Musician credits list", []],
119
123
  [53, :TMED, "Media type", [:textenc, :text]],
120
- [54, :TMOO, "Mood", [:textenc, :text]],
124
+ [54, :TMOO, "Mood", []],
121
125
  [55, :TOAL, "Original album/movie/show title", [:textenc, :text]],
122
126
  [56, :TOFN, "Original filename", [:textenc, :text]],
123
127
  [57, :TOLY, "Original lyricist(s)/text writer(s)", [:textenc, :text]],
@@ -129,19 +133,19 @@ module ID3Lib
129
133
  [63, :TPE3, "Conductor/performer refinement", [:textenc, :text]],
130
134
  [64, :TPE4, "Interpreted, remixed, or otherwise modified by", [:textenc, :text]],
131
135
  [65, :TPOS, "Part of a set", [:textenc, :text]],
132
- [66, :TPRO, "Produced notice", [:textenc, :text]],
136
+ [66, :TPRO, "Produced notice", []],
133
137
  [67, :TPUB, "Publisher", [:textenc, :text]],
134
138
  [68, :TRCK, "Track number/Position in set", [:textenc, :text]],
135
139
  [69, :TRDA, "Recording dates", [:textenc, :text]],
136
140
  [70, :TRSN, "Internet radio station name", [:textenc, :text]],
137
141
  [71, :TRSO, "Internet radio station owner", [:textenc, :text]],
138
142
  [72, :TSIZ, "Size", [:textenc, :text]],
139
- [73, :TSOA, "Album sort order", [:textenc, :text]],
140
- [74, :TSOP, "Performer sort order", [:textenc, :text]],
141
- [75, :TSOT, "Title sort order", [:textenc, :text]],
143
+ [73, :TSOA, "Album sort order", []],
144
+ [74, :TSOP, "Performer sort order", []],
145
+ [75, :TSOT, "Title sort order", []],
142
146
  [76, :TSRC, "ISRC (international standard recording code)", [:textenc, :text]],
143
147
  [77, :TSSE, "Software/Hardware and settings used for encoding", [:textenc, :text]],
144
- [78, :TSST, "Set subtitle", [:textenc, :text]],
148
+ [78, :TSST, "Set subtitle", []],
145
149
  [79, :TXXX, "User defined text information", [:textenc, :description, :text]],
146
150
  [80, :TYER, "Year", [:textenc, :text]],
147
151
  # Special frames again
@@ -149,15 +153,15 @@ module ID3Lib
149
153
  [82, :USER, "Terms of use", [:textenc, :language, :text]],
150
154
  [83, :USLT, "Unsynchronized lyric/text transcription", [:textenc, :language, :description, :text]],
151
155
  # URL link frames
152
- [84, :WCOM, "Commercial information", [:text]],
153
- [85, :WCOP, "Copyright/Legal infromation", [:text]],
154
- [86, :WOAF, "Official audio file webpage", [:text]],
155
- [87, :WOAR, "Official artist/performer webpage", [:text]],
156
- [88, :WOAS, "Official audio source webpage", [:text]],
157
- [89, :WORS, "Official internet radio station homepage", [:text]],
158
- [90, :WPAY, "Payment", [:text]],
159
- [91, :WPUB, "Official publisher webpage", [:text]],
160
- [92, :WXXX, "User defined URL link", [:textenc, :description, :url]],
156
+ [84, :WCOM, "Commercial information", [:url]],
157
+ [85, :WCOP, "Copyright/Legal infromation", [:url]],
158
+ [86, :WOAF, "Official audio file webpage", [:url]],
159
+ [87, :WOAR, "Official artist/performer webpage", [:url]],
160
+ [88, :WOAS, "Official audio source webpage", [:url]],
161
+ [89, :WORS, "Official internet radio station homepage", [:url]],
162
+ [90, :WPAY, "Payment", [:url]],
163
+ [91, :WPUB, "Official publisher webpage", [:url]],
164
+ [92, :WXXX, "User defined URL link", [:textenc, :description, :url]]
161
165
  ]
162
166
 
163
167
  FramesByID = {
@@ -272,7 +276,7 @@ module ID3Lib
272
276
  [12, :imageformat, "Image format field"],
273
277
  [13, :mimetype, "Mimetype field"],
274
278
  [14, :counter, "Counter field"],
275
- [15, :id, "Identifier/Symbol field"],
279
+ [15, :identifier, "Identifier/Symbol field"],
276
280
  [16, :volumeadj, "Volume adjustment field"],
277
281
  [17, :numbits, "Number of bits field"],
278
282
  [18, :volchgright, "Volume chage on the right channel"],
@@ -299,7 +303,7 @@ module ID3Lib
299
303
  :imageformat => Fields[12],
300
304
  :mimetype => Fields[13],
301
305
  :counter => Fields[14],
302
- :id => Fields[15],
306
+ :identifier => Fields[15],
303
307
  :volumeadj => Fields[16],
304
308
  :numbits => Fields[17],
305
309
  :volchgright => Fields[18],
data/lib/id3lib.rb CHANGED
@@ -9,6 +9,7 @@ require 'id3lib/accessors'
9
9
  # Have a look at ID3Lib::Tag for an introduction on how to use this library.
10
10
  #
11
11
  module ID3Lib
12
+ VERSION = '0.5.0'
12
13
 
13
14
  # ID3 version 1. All V constants can be used with the methods
14
15
  # new, update! or strip! of ID3Lib::Tag.
@@ -33,7 +34,7 @@ module ID3Lib
33
34
  #
34
35
  # === Example of use
35
36
  #
36
- # tag = ID3Lib::Tag.read('shy_boy.mp3')
37
+ # tag = ID3Lib::Tag.new('shy_boy.mp3')
37
38
  #
38
39
  # # Remove comments
39
40
  # tag.delete_if{ |frame| frame[:id] == :COMM }
@@ -314,8 +315,8 @@ module ID3Lib
314
315
  private
315
316
 
316
317
  def read_frames
317
- iterator = @tag.iterator_new
318
- while libframe = @tag.iterator_next_frame(iterator)
318
+ iterator = @tag.create_iterator
319
+ while libframe = iterator.get_next
319
320
  self << Frame.read(libframe)
320
321
  end
321
322
  end
@@ -332,6 +333,11 @@ module ID3Lib
332
333
 
333
334
  info[FIELDS].each do |field_id|
334
335
  libfield = field(libframe, field_id)
336
+ unless libfield
337
+ warn "id3lib-ruby: Invalid field #{field_id.inspect} in " \
338
+ "#{frame[:id].inspect}, please report this as a bug."
339
+ next
340
+ end
335
341
  frame[field_id] =
336
342
  case Info::FieldType[libfield.get_type]
337
343
  when :integer
@@ -363,6 +369,7 @@ module ID3Lib
363
369
  end
364
370
 
365
371
  libfield = field(libframe, field_id)
372
+ next unless libfield
366
373
  case Info::FieldType[libfield.get_type]
367
374
  when :integer
368
375
  libfield.set_integer(value)
data/test/test_writing.rb CHANGED
@@ -119,6 +119,7 @@ class TestWriting < Test::Unit::TestCase
119
119
  pic = {
120
120
  :id => :APIC,
121
121
  :mimetype => 'image/jpeg',
122
+ :imageformat => '',
122
123
  :picturetype => 3,
123
124
  :description => 'A pretty picture.',
124
125
  :textenc => 0,
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: id3lib-ruby
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.4.1
7
- date: 2006-08-24 00:00:00 +02:00
6
+ version: 0.5.0
7
+ date: 2006-12-16 00:00:00 +01:00
8
8
  summary: id3lib-ruby provides a Ruby interface to the id3lib C++ library for easily editing ID3 tags (v1 and v2) like with pyid3lib.
9
9
  require_paths:
10
10
  - lib
@@ -44,8 +44,9 @@ files:
44
44
  - setup.rb
45
45
  - ext/mswin32/id3lib_api.so
46
46
  - README
47
- - CHANGES
47
+ - INSTALL
48
48
  - TODO
49
+ - CHANGES
49
50
  test_files:
50
51
  - test/test_unicode.rb
51
52
  - test/test_writing.rb
@@ -57,8 +58,9 @@ rdoc_options:
57
58
  - README
58
59
  extra_rdoc_files:
59
60
  - README
60
- - CHANGES
61
+ - INSTALL
61
62
  - TODO
63
+ - CHANGES
62
64
  executables: []
63
65
 
64
66
  extensions: []