rtaglib 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/swig/taglib.i CHANGED
@@ -576,7 +576,13 @@ class File {
576
576
  };
577
577
  }
578
578
  namespace ID3v1 {
579
+
579
580
  typedef Map<TagLib::String,int> GenreMap;
581
+ %rename (ID3v1_genre) genre(int index);
582
+ %rename (ID3v1_genreIndex) genreIndex(const String &name);
583
+ %rename (ID3v1_genreList) genreList();
584
+ %rename (ID3v1_genreMap) genreMap();
585
+
580
586
  String genre(int index);
581
587
  int genreIndex(const String &name);
582
588
  StringList genreList();
@@ -597,7 +603,7 @@ class File {
597
603
  %rename(ID3v2_Header) Header;
598
604
  %rename(ID3v2_CommentsFrame) CommentsFrame;
599
605
  %rename(ID3v2_FrameFactory) FrameFactory;
600
-
606
+ %rename(ID3v2_GeneralEncapsulatedObjectFrame) GeneralEncapsulatedObjectFrame;
601
607
  typedef List< Frame * >FrameList;
602
608
  typedef Map < ByteVector, FrameList > FrameListMap;
603
609
  class AttachedPictureFrame {
@@ -641,6 +647,22 @@ class File {
641
647
  String::Type textEncoding () const;
642
648
  void setTextEncoding (String::Type encoding);
643
649
  };
650
+ class GeneralEncapsulatedObjectFrame {
651
+ GeneralEncapsulatedObjectFrame ();
652
+ GeneralEncapsulatedObjectFrame (const ByteVector &data);
653
+ virtual ~GeneralEncapsulatedObjectFrame ();
654
+ virtual String toString ();
655
+ String::Type textEncoding ();
656
+ void setTextEncoding (String::Type encoding);
657
+ String mimeType ();
658
+ void setMimeType (const String &type);
659
+ String fileName ();
660
+ void setFileName (const String &name);
661
+ String description ();
662
+ void setDescription (const String &desc);
663
+ ByteVector object ();
664
+ void setObject (const ByteVector &object);
665
+ };
644
666
  class FrameFactory {
645
667
  FrameFactory();
646
668
  ~FrameFactory();
data/swig/test.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/ruby
2
+ require 'tmpdir'
2
3
  if File.exists? File.dirname(__FILE__)+"/TagLib.so"
3
4
  require File.dirname(__FILE__)+'/TagLib'
4
5
  BASE_DATA=File.dirname(__FILE__)+"/../test/data/"
@@ -11,21 +12,26 @@ require 'test/unit'
11
12
  class RtaglibReadTestCase < Test::Unit::TestCase
12
13
  def setup
13
14
  @data_dir=BASE_DATA
14
- @temp_dir="/tmp/rtaglib"
15
+ @temp_dir=Dir::tmpdir+"/rtaglib"
15
16
  FileUtils.mkdir(@temp_dir) if !File.exists? @temp_dir
16
-
17
+ FileUtils.chmod(0777, @temp_dir)
17
18
  end
18
19
  def teardown
20
+ begin
19
21
  Dir.glob(@temp_dir+"/*").each{|f|
20
22
  FileUtils.rm(f)
21
23
  }
24
+ rescue Exception
25
+ end
22
26
  end
23
27
  def get_copy(original)
24
28
  original=~/.*\.(.+)/
25
29
  ext=$1
26
30
  copy=@temp_dir+"/test_"+sprintf("%06d",rand(10000))+"."+ext
27
- FileUtils.copy(original, copy)
28
- copy
31
+
32
+ FileUtils.copy(original, copy)
33
+ FileUtils.chmod(0777, copy)
34
+ copy
29
35
  end
30
36
  # TagLib::File test for
31
37
  # - writable?
@@ -193,46 +199,48 @@ class RtaglibReadTestCase < Test::Unit::TestCase
193
199
 
194
200
 
195
201
  end
196
- # BAD: strip doesn't work
197
- def _test_mpc
202
+ # Note: strip doesn't work on APE tags on TagLib
203
+ def test_mpc
198
204
  original=@data_dir+"440Hz-5sec.mpc"
199
205
  copy=get_copy(original)
200
206
  fr=TagLib::FileRef.new(copy)
201
207
  fr.tag.title="440Hz Sine Wave"
202
208
  fr.save
203
- mpc=TagLib::MPEG_File.new(copy)
209
+ mpc=TagLib::MPC::File.new(copy)
204
210
  %w{tag APETag}.each {|f|
205
211
  assert_equal("440Hz Sine Wave",mpc.send(f).title, "#{f} tag")
206
212
  }
213
+ mpc=TagLib::MPC::File.new(copy)
214
+ mpc.ID3v1Tag(true).title="440Hz Sine Wave - id3"
215
+ mpc.save
216
+ mpc=nil
217
+ mpc=TagLib::MPC::File.new(copy)
218
+ assert_equal("440Hz Sine Wave - id3",mpc.ID3v1Tag(false).title)
219
+
220
+ mpc=nil
207
221
  # file
208
222
  # strip only id3v1
209
- mpc.strip(TagLib::MPC_File::ID3v1)
223
+ mpc=TagLib::MPC::File.new(copy)
224
+ mpc.strip(TagLib::MPC::File::ID3v1)
210
225
  mpc.save
211
- mpc1=TagLib::MPEG_File.new(copy)
226
+ mpc1=TagLib::MPC::File.new(copy)
212
227
 
213
- # assert_nil(mpc1.ID3v1Tag)
228
+ assert_nil(mpc1.ID3v1Tag)
214
229
  assert_not_nil(mpc1.APETag)
215
230
  copy=get_copy(original)
216
- mpc=TagLib::MPC_File.new(copy)
231
+ mpc=TagLib::MPC::File.new(copy)
217
232
  # strip all
218
233
  mpc.strip()
219
234
  mpc.save
220
- mpc1=TagLib::MPEG_File.new(copy)
235
+ mpc1=TagLib::MPC::File.new(copy)
221
236
 
222
- # assert_nil(mpc1.ID3v1Tag)
223
- assert_nil(mpc1.APETag)
237
+ assert_nil(mpc1.ID3v1Tag)
238
+ # Bug on TagLib
239
+ # assert_nil(mpc1.APETag)
224
240
 
225
241
  # properties
226
242
 
227
- assert_equal(0,mp3.audioProperties.version)
228
- assert_equal(3,mp3.audioProperties.layer)
229
- assert(!mp3.audioProperties.protectionEnabled)
230
- assert_equal(TagLib::MPEG_Header::SingleChannel, mp3.audioProperties.channelMode)
231
- assert(!mp3.audioProperties.isCopyrighted)
232
- assert(mp3.audioProperties.isOriginal)
233
-
234
-
235
-
243
+ assert_equal(7,mpc.audioProperties.mpcVersion)
236
244
  end
237
245
 
238
246
 
data/test/test_taglib.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/ruby
2
+ require 'tmpdir'
2
3
  if File.exists? File.dirname(__FILE__)+"/TagLib.so"
3
4
  require File.dirname(__FILE__)+'/TagLib'
4
5
  BASE_DATA=File.dirname(__FILE__)+"/../test/data/"
@@ -11,21 +12,26 @@ require 'test/unit'
11
12
  class RtaglibReadTestCase < Test::Unit::TestCase
12
13
  def setup
13
14
  @data_dir=BASE_DATA
14
- @temp_dir="/tmp/rtaglib"
15
+ @temp_dir=Dir::tmpdir+"/rtaglib"
15
16
  FileUtils.mkdir(@temp_dir) if !File.exists? @temp_dir
16
-
17
+ FileUtils.chmod(0777, @temp_dir)
17
18
  end
18
19
  def teardown
20
+ begin
19
21
  Dir.glob(@temp_dir+"/*").each{|f|
20
22
  FileUtils.rm(f)
21
23
  }
24
+ rescue Exception
25
+ end
22
26
  end
23
27
  def get_copy(original)
24
28
  original=~/.*\.(.+)/
25
29
  ext=$1
26
30
  copy=@temp_dir+"/test_"+sprintf("%06d",rand(10000))+"."+ext
27
- FileUtils.copy(original, copy)
28
- copy
31
+
32
+ FileUtils.copy(original, copy)
33
+ FileUtils.chmod(0777, copy)
34
+ copy
29
35
  end
30
36
  # TagLib::File test for
31
37
  # - writable?
@@ -193,46 +199,48 @@ class RtaglibReadTestCase < Test::Unit::TestCase
193
199
 
194
200
 
195
201
  end
196
- # BAD: strip doesn't work
197
- def _test_mpc
202
+ # Note: strip doesn't work on APE tags on TagLib
203
+ def test_mpc
198
204
  original=@data_dir+"440Hz-5sec.mpc"
199
205
  copy=get_copy(original)
200
206
  fr=TagLib::FileRef.new(copy)
201
207
  fr.tag.title="440Hz Sine Wave"
202
208
  fr.save
203
- mpc=TagLib::MPEG_File.new(copy)
209
+ mpc=TagLib::MPC::File.new(copy)
204
210
  %w{tag APETag}.each {|f|
205
211
  assert_equal("440Hz Sine Wave",mpc.send(f).title, "#{f} tag")
206
212
  }
213
+ mpc=TagLib::MPC::File.new(copy)
214
+ mpc.ID3v1Tag(true).title="440Hz Sine Wave - id3"
215
+ mpc.save
216
+ mpc=nil
217
+ mpc=TagLib::MPC::File.new(copy)
218
+ assert_equal("440Hz Sine Wave - id3",mpc.ID3v1Tag(false).title)
219
+
220
+ mpc=nil
207
221
  # file
208
222
  # strip only id3v1
209
- mpc.strip(TagLib::MPC_File::ID3v1)
223
+ mpc=TagLib::MPC::File.new(copy)
224
+ mpc.strip(TagLib::MPC::File::ID3v1)
210
225
  mpc.save
211
- mpc1=TagLib::MPEG_File.new(copy)
226
+ mpc1=TagLib::MPC::File.new(copy)
212
227
 
213
- # assert_nil(mpc1.ID3v1Tag)
228
+ assert_nil(mpc1.ID3v1Tag)
214
229
  assert_not_nil(mpc1.APETag)
215
230
  copy=get_copy(original)
216
- mpc=TagLib::MPC_File.new(copy)
231
+ mpc=TagLib::MPC::File.new(copy)
217
232
  # strip all
218
233
  mpc.strip()
219
234
  mpc.save
220
- mpc1=TagLib::MPEG_File.new(copy)
235
+ mpc1=TagLib::MPC::File.new(copy)
221
236
 
222
- # assert_nil(mpc1.ID3v1Tag)
223
- assert_nil(mpc1.APETag)
237
+ assert_nil(mpc1.ID3v1Tag)
238
+ # Bug on TagLib
239
+ # assert_nil(mpc1.APETag)
224
240
 
225
241
  # properties
226
242
 
227
- assert_equal(0,mp3.audioProperties.version)
228
- assert_equal(3,mp3.audioProperties.layer)
229
- assert(!mp3.audioProperties.protectionEnabled)
230
- assert_equal(TagLib::MPEG_Header::SingleChannel, mp3.audioProperties.channelMode)
231
- assert(!mp3.audioProperties.isCopyrighted)
232
- assert(mp3.audioProperties.isOriginal)
233
-
234
-
235
-
243
+ assert_equal(7,mpc.audioProperties.mpcVersion)
236
244
  end
237
245
 
238
246
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rtaglib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Bustos
@@ -9,7 +9,7 @@ autorequire: ""
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-11 00:00:00 -04:00
12
+ date: 2009-04-26 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -45,6 +45,7 @@ files:
45
45
  - ext/taglib/taglib.cxx
46
46
  - lib/TagLib.rb
47
47
  - lib/TagLib_doc.rb
48
+ - swig/Doxyfile
48
49
  - swig/Rakefile
49
50
  - swig/extconf.rb
50
51
  - swig/make_doc.rb
@@ -81,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
82
  version: "0"
82
83
  version:
83
84
  requirements:
84
- - libtag >=1.4
85
+ - libtag >=1.5
85
86
  rubyforge_project: rtaglib
86
87
  rubygems_version: 1.3.0
87
88
  signing_key: