rtaglib 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt ADDED
@@ -0,0 +1,13 @@
1
+ === 0.1.2 / 2008-06-23
2
+
3
+ * Bug fix release : Fixed gem and extconf.rb
4
+
5
+ === 0.1.1 / 2006-01-11
6
+
7
+ * Bug fix release : genre= doesn't works
8
+
9
+ === 0.1.0 / 2005-12-31
10
+
11
+ * First version. All the methods operational, except close (does nothing)
12
+
13
+
data/Manifest.txt ADDED
@@ -0,0 +1,10 @@
1
+ History.txt
2
+ Manifest.txt
3
+ README.txt
4
+ Rakefile
5
+ ext/Makefile
6
+ ext/extconf.rb
7
+ ext/rtaglib.c
8
+ test/data/saw.mp3
9
+ test/test_read.rb
10
+ test/test_write.rb
data/README.txt ADDED
@@ -0,0 +1,47 @@
1
+ = rtaglib
2
+
3
+ http://rtaglib.rubyforge.org/
4
+
5
+ == DESCRIPTION:
6
+
7
+ A pure C binding for taglib (http://developer.kde.org/~wheeler/taglib.html), a library for reading and editing the meta-data of several popular audio formats. This extension uses the same interface of http://www.hakubi.us/ruby-taglib/.
8
+
9
+ == FEATURES/PROBLEMS:
10
+
11
+ Reports problem to clbustos _AT_ gmail.com
12
+
13
+ == SYNOPSIS:
14
+
15
+ irb(main):001:0> require 'rtaglib'
16
+ => true
17
+ irb(main):002:0> tag=TagFile::File.new('saw.mp3')
18
+ => #<TagFile::File:0xb796d61c>
19
+ irb(main):003:0> tag.title
20
+ => "Saw"
21
+ irb(main):004:0> tag.artist
22
+ => "Claudio Bustos"
23
+ irb(main):005:0> tag.album
24
+ => "Catori"
25
+ irb(main):006:0> tag.genre
26
+ => "Lo-Fi"
27
+ irb(main):007:0> tag.track
28
+ => 1
29
+ irb(main):008:0> tag.year
30
+ => 2005
31
+ irb(main):009:0> tag.comment
32
+ => "Test for catori"
33
+ irb(main):010:0>
34
+
35
+ == REQUIREMENTS:
36
+
37
+ * taglib >= 1.4
38
+
39
+ URL: http://developer.kde.org/~wheeler/taglib.html
40
+
41
+ == INSTALL:
42
+
43
+ sudo gem install rtaglib
44
+
45
+ == LICENSE:
46
+
47
+ GPL V2
data/Rakefile ADDED
@@ -0,0 +1,24 @@
1
+ # -*- ruby -*-
2
+
3
+ require 'rubygems'
4
+ require 'hoe'
5
+ require './ext/rtaglib'
6
+
7
+ Hoe.new('rtaglib', TagFile::VERSION) do |p|
8
+ p.developer('cdx', 'clbustos@surnet.cl')
9
+ p.author="Claudio Bustos"
10
+ p.summary="Bindings for taglib"
11
+ p.description= <<-EOF
12
+ Rtaglib is a C based binding for Taglib's library (http://developer.kde.org/~wheeler/taglib.html). Uses the same interface of ruby-taglib, but creates a true ruby extension.
13
+ EOF
14
+ #p.requirements << "libtag >=1.4"
15
+ # s.required_ruby_version = '>= 1.8.0'
16
+ # s.platform = Gem::Platform::RUBY
17
+ p.url = "http://rtaglib.rubyforge.org/"
18
+ p.remote_rdoc_dir = '' # Release to root
19
+ #p.clean_globs = ['ext/*.log','ext/*.o','ext/*.so']
20
+ #p.platform = Gem::Platform::RUBY
21
+ p.spec_extras= {'requirements'=>'libtag >=1.4', 'autorequire'=>'rtaglib', 'extensions'=>['ext/extconf.rb']}
22
+ end
23
+
24
+ # vim: syntax=Ruby
data/ext/Makefile ADDED
@@ -0,0 +1,149 @@
1
+
2
+ SHELL = /bin/sh
3
+
4
+ #### Start of system configuration section. ####
5
+
6
+ srcdir = .
7
+ topdir = /usr/lib/ruby/1.8/x86_64-linux
8
+ hdrdir = $(topdir)
9
+ VPATH = $(srcdir):$(topdir):$(hdrdir)
10
+ prefix = $(DESTDIR)/usr
11
+ exec_prefix = $(prefix)
12
+ sitedir = $(DESTDIR)/usr/local/lib/site_ruby
13
+ rubylibdir = $(libdir)/ruby/$(ruby_version)
14
+ docdir = $(datarootdir)/doc/$(PACKAGE)
15
+ dvidir = $(docdir)
16
+ datarootdir = $(prefix)/share
17
+ archdir = $(rubylibdir)/$(arch)
18
+ sbindir = $(exec_prefix)/sbin
19
+ psdir = $(docdir)
20
+ localedir = $(datarootdir)/locale
21
+ htmldir = $(docdir)
22
+ datadir = $(datarootdir)
23
+ includedir = $(prefix)/include
24
+ infodir = $(prefix)/share/info
25
+ sysconfdir = $(DESTDIR)/etc
26
+ mandir = $(prefix)/share/man
27
+ libdir = $(exec_prefix)/lib
28
+ sharedstatedir = $(prefix)/com
29
+ oldincludedir = $(DESTDIR)/usr/include
30
+ pdfdir = $(docdir)
31
+ sitearchdir = $(sitelibdir)/$(sitearch)
32
+ bindir = $(exec_prefix)/bin
33
+ localstatedir = $(DESTDIR)/var
34
+ sitelibdir = $(sitedir)/$(ruby_version)
35
+ libexecdir = $(prefix)/lib/ruby1.8
36
+
37
+ CC = cc
38
+ LIBRUBY = $(LIBRUBY_SO)
39
+ LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
40
+ LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
41
+ LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
42
+
43
+ RUBY_EXTCONF_H =
44
+ CFLAGS = -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -Wall
45
+ INCFLAGS = -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I.
46
+ CPPFLAGS = -DHAVE_TAGLIB_TAG_C_H
47
+ CXXFLAGS = $(CFLAGS)
48
+ DLDFLAGS = -L. -rdynamic -Wl,-export-dynamic
49
+ LDSHARED = $(CC) -shared
50
+ AR = ar
51
+ EXEEXT =
52
+
53
+ RUBY_INSTALL_NAME = ruby1.8
54
+ RUBY_SO_NAME = ruby1.8
55
+ arch = x86_64-linux
56
+ sitearch = x86_64-linux
57
+ ruby_version = 1.8
58
+ ruby = /usr/bin/ruby1.8
59
+ RUBY = $(ruby)
60
+ RM = rm -f
61
+ MAKEDIRS = mkdir -p
62
+ INSTALL = /usr/bin/install -c
63
+ INSTALL_PROG = $(INSTALL) -m 0755
64
+ INSTALL_DATA = $(INSTALL) -m 644
65
+ COPY = cp
66
+
67
+ #### End of system configuration section. ####
68
+
69
+ preload =
70
+
71
+ libpath = . $(libdir)
72
+ LIBPATH = -L"." -L"$(libdir)"
73
+ DEFFILE =
74
+
75
+ CLEANFILES = mkmf.log
76
+ DISTCLEANFILES =
77
+
78
+ extout =
79
+ extout_prefix =
80
+ target_prefix =
81
+ LOCAL_LIBS =
82
+ LIBS = $(LIBRUBYARG_SHARED) -ltag_c -lpthread -ldl -lcrypt -lm -lc
83
+ SRCS = rtaglib.c
84
+ OBJS = rtaglib.o
85
+ TARGET = rtaglib
86
+ DLLIB = $(TARGET).so
87
+ EXTSTATIC =
88
+ STATIC_LIB =
89
+
90
+ RUBYCOMMONDIR = $(sitedir)$(target_prefix)
91
+ RUBYLIBDIR = $(sitelibdir)$(target_prefix)
92
+ RUBYARCHDIR = $(sitearchdir)$(target_prefix)
93
+
94
+ TARGET_SO = $(DLLIB)
95
+ CLEANLIBS = $(TARGET).so $(TARGET).il? $(TARGET).tds $(TARGET).map
96
+ CLEANOBJS = *.o *.a *.s[ol] *.pdb *.exp *.bak
97
+
98
+ all: $(DLLIB)
99
+ static: $(STATIC_LIB)
100
+
101
+ clean:
102
+ @-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
103
+
104
+ distclean: clean
105
+ @-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
106
+ @-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
107
+
108
+ realclean: distclean
109
+ install: install-so install-rb
110
+
111
+ install-so: $(RUBYARCHDIR)
112
+ install-so: $(RUBYARCHDIR)/$(DLLIB)
113
+ $(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
114
+ $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
115
+ install-rb: pre-install-rb install-rb-default
116
+ install-rb-default: pre-install-rb-default
117
+ pre-install-rb: Makefile
118
+ pre-install-rb-default: Makefile
119
+ $(RUBYARCHDIR):
120
+ $(MAKEDIRS) $@
121
+
122
+ site-install: site-install-so site-install-rb
123
+ site-install-so: install-so
124
+ site-install-rb: install-rb
125
+
126
+ .SUFFIXES: .c .m .cc .cxx .cpp .C .o
127
+
128
+ .cc.o:
129
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
130
+
131
+ .cxx.o:
132
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
133
+
134
+ .cpp.o:
135
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
136
+
137
+ .C.o:
138
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
139
+
140
+ .c.o:
141
+ $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) -c $<
142
+
143
+ $(DLLIB): $(OBJS)
144
+ @-$(RM) $@
145
+ $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
146
+
147
+
148
+
149
+ $(OBJS): ruby.h defines.h
data/ext/extconf.rb CHANGED
@@ -1,8 +1,7 @@
1
1
  require "mkmf"
2
- $CFLAGS+=" -WAll "
2
+ $CFLAGS+=" -Wall "
3
3
  dir_config("tag_c")
4
4
  if have_library("tag_c") and have_header("taglib/tag_c.h")
5
- $CFLAGS+=`pkg-config --cflags taglib`
6
5
  create_makefile("rtaglib")
7
6
  else
8
7
  print "*** ERROR: Need taglib library\n"
data/ext/rtaglib.c CHANGED
@@ -12,6 +12,8 @@ Data_Get_Struct(self, taglib_t, tl); \
12
12
  if(NULL==tl->file || tl->open==0) {tl_closed();} \
13
13
  TagLib_File *file=tl->file;
14
14
 
15
+ #define VERSION "0.1.2"
16
+
15
17
  typedef struct {
16
18
  TagLib_File *file;
17
19
  TagLib_Tag *tag;
@@ -116,6 +118,7 @@ Init_rtaglib()
116
118
  }
117
119
  rb_define_attr(cTagFileFile, "path", 1, 0);
118
120
  rb_define_attr(cTagFileFile, "file_type", 1, 0);
121
+ rb_define_const(mTagFile, "VERSION", rb_str_new2(VERSION));
119
122
  rb_define_const(mTagFile, "MPEG", INT2FIX(TagLib_File_MPEG));
120
123
  rb_define_const(mTagFile, "OggVorbis", INT2FIX(TagLib_File_OggVorbis));
121
124
  rb_define_const(mTagFile, "FLAC", INT2FIX(TagLib_File_FLAC));
@@ -211,7 +214,6 @@ _get_uint(VALUE self, unsigned int (*func) ())
211
214
  VALUE
212
215
  _get_audio_int(VALUE self, int (*func) ())
213
216
  {
214
- VALUE string;
215
217
  taglib_t *tl;
216
218
  Data_Get_Struct(self, taglib_t, tl);
217
219
  if (NULL == tl->file) {
@@ -226,7 +228,6 @@ VALUE
226
228
  _set_string(VALUE self, void (*func) (TagLib_Tag *, const char *),
227
229
  VALUE texto)
228
230
  {
229
- VALUE string;
230
231
  taglib_t *tl;
231
232
  Data_Get_Struct(self, taglib_t, tl);
232
233
  if (NULL == tl) {
@@ -242,7 +243,6 @@ VALUE
242
243
  _set_uint(VALUE self, void (*func) (TagLib_Tag *, unsigned int),
243
244
  VALUE numero)
244
245
  {
245
- VALUE string;
246
246
  taglib_t *tl;
247
247
  Data_Get_Struct(self, taglib_t, tl);
248
248
  if (NULL == tl) {
File without changes
@@ -1,12 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'rubygems'
3
- require_gem 'rtaglib'
3
+ require 'rtaglib'
4
4
  require 'test/unit'
5
5
  class RtaglibTestCase < Test::Unit::TestCase
6
- def initialize(*args)
7
- super
8
- @file=::TagFile::File.new(File.dirname(__FILE__)+"/saw.mp3")
9
-
6
+ def setup
7
+ @file=::TagFile::File.new(File.dirname(__FILE__)+"/data/saw.mp3")
10
8
  end
11
9
  def test_title()
12
10
  assert_equal("Saw",@file.title)
@@ -29,6 +27,18 @@ class RtaglibTestCase < Test::Unit::TestCase
29
27
  def test_comment()
30
28
  assert_equal("Test for catori",@file.comment)
31
29
  end
30
+ def test_length()
31
+ assert_equal(1,@file.length)
32
+ end
33
+ def test_bitrate()
34
+ assert_equal(128,@file.bitrate)
35
+ end
36
+ def test_samplerate()
37
+ assert_equal(44100,@file.samplerate)
38
+ end
39
+ def test_channels()
40
+ assert_equal(2,@file.channels)
41
+ end
32
42
  end
33
43
 
34
44
  # arch-tag: test
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'ftools'
3
3
  require 'rubygems'
4
- require_gem 'rtaglib'
4
+ require 'rtaglib'
5
5
  require 'test/unit'
6
6
  class RtaglibTestCase < Test::Unit::TestCase
7
7
  def initialize(*args)
8
- super
9
- @original=File.dirname(__FILE__)+"/saw.mp3"
8
+ super
10
9
  end
11
10
  def setup
11
+ @original=File.dirname(__FILE__)+"/data/saw.mp3"
12
12
  @copy="/tmp/test_"+sprintf("%06d",rand(10000))+".mp3"
13
13
  File.copy(@original,@copy)
14
14
  @file=::TagFile::File.new(@copy)
metadata CHANGED
@@ -1,59 +1,68 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.11
2
+ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: rtaglib
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.1
7
- date: 2006-01-11 00:00:00 -03:00
6
+ version: 0.1.2
7
+ date: 2008-06-23 00:00:00 -04:00
8
8
  summary: Bindings for taglib
9
9
  require_paths:
10
- - lib
10
+ - ext
11
11
  email:
12
- homepage: http://rtaglib.rubyforge.org
12
+ - clbustos@surnet.cl
13
+ homepage: http://rtaglib.rubyforge.org/
13
14
  rubyforge_project: rtaglib
14
- description: "Rtaglib is a C based binding for Taglib's library
15
- (http://developer.kde.org/~wheeler/taglib.html). Uses the same interface of
16
- ruby-taglib, but creates a true ruby extension."
15
+ description: Rtaglib is a C based binding for Taglib's library (http://developer.kde.org/~wheeler/taglib.html). Uses the same interface of ruby-taglib, but creates a true ruby extension.
17
16
  autorequire: rtaglib
18
17
  default_executable:
19
18
  bindir: bin
20
- has_rdoc: false
19
+ has_rdoc: true
21
20
  required_ruby_version: !ruby/object:Gem::Version::Requirement
22
21
  requirements:
23
- -
24
- - ">="
25
- - !ruby/object:Gem::Version
26
- version: 1.8.0
22
+ - - ">"
23
+ - !ruby/object:Gem::Version
24
+ version: 0.0.0
27
25
  version:
28
26
  platform: ruby
29
27
  signing_key:
30
28
  cert_chain:
29
+ post_install_message:
31
30
  authors:
32
- - Claudio Bustos
31
+ - Claudio Bustos
33
32
  files:
34
- - "./ext"
35
- - "./tests"
36
- - "./svn-commit.tmp"
37
- - "./ext/test.rb"
38
- - "./ext/rtaglib.c"
39
- - "./ext/extconf.rb"
40
- - "./ext/mkmf.log"
41
- - "./tests/test_read.rb"
42
- - "./tests/saw.mp3"
43
- - "./tests/test_write.rb"
44
- - tests/test_read.rb
45
- - tests/saw.mp3
46
- - tests/test_write.rb
47
- - ext/test.rb
48
- - ext/rtaglib.c
49
- - ext/extconf.rb
50
- - ext/mkmf.log
51
- test_files: []
52
- rdoc_options: []
53
- extra_rdoc_files: []
33
+ - History.txt
34
+ - Manifest.txt
35
+ - README.txt
36
+ - Rakefile
37
+ - ext/Makefile
38
+ - ext/extconf.rb
39
+ - ext/rtaglib.c
40
+ - test/data/saw.mp3
41
+ - test/test_read.rb
42
+ - test/test_write.rb
43
+ test_files:
44
+ - test/test_write.rb
45
+ - test/test_read.rb
46
+ rdoc_options:
47
+ - --main
48
+ - README.txt
49
+ extra_rdoc_files:
50
+ - History.txt
51
+ - Manifest.txt
52
+ - README.txt
54
53
  executables: []
54
+
55
55
  extensions:
56
- - ext/extconf.rb
56
+ - ext/extconf.rb
57
57
  requirements:
58
- - libtag >=1.4
59
- dependencies: []
58
+ - libtag >=1.4
59
+ dependencies:
60
+ - !ruby/object:Gem::Dependency
61
+ name: hoe
62
+ version_requirement:
63
+ version_requirements: !ruby/object:Gem::Version::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: 1.5.1
68
+ version:
data/ext/mkmf.log DELETED
@@ -1,23 +0,0 @@
1
- have_library: checking for main() in -ltag_c... -------------------- yes
2
-
3
- "i686-pc-linux-gnu-gcc -o conftest -I/home/cdx/ruby/rtaglib/ext -I/usr/lib/ruby/1.8/i686-linux -O2 -march=athlon-xp -m3dnow -msse -mfpmath=sse -mmmx -pipe -ffast-math -fPIC -WAll conftest.c -L'/usr/lib' -Wl,-R'/usr/lib' -lruby18-static -ltag_c -ldl -lcrypt -lm -lc"
4
- checked program was:
5
- /* begin */
6
-
7
- /*top*/
8
- int main() { return 0; }
9
- int t() { main(); return 0; }
10
- /* end */
11
-
12
- --------------------
13
-
14
- have_header: checking for taglib/tag_c.h... -------------------- yes
15
-
16
- "i686-pc-linux-gnu-gcc -E -I/home/cdx/ruby/rtaglib/ext -I/usr/lib/ruby/1.8/i686-linux -O2 -march=athlon-xp -m3dnow -msse -mfpmath=sse -mmmx -pipe -ffast-math -fPIC -WAll conftest.c -o conftest.i"
17
- checked program was:
18
- /* begin */
19
- #include <taglib/tag_c.h>
20
- /* end */
21
-
22
- --------------------
23
-
data/ext/test.rb DELETED
@@ -1,13 +0,0 @@
1
- #!/bin/env ruby
2
- require 'ftools'
3
- require 'rubygems'
4
- require 'rtaglib'
5
- temp="/tmp/test.mp3"
6
- File.copy("../tests/saw.mp3",temp)
7
- tag=::TagFile::File.new(temp)
8
- tag.genre="Rock"
9
- tag.save
10
- p tag.genre
11
- File.delete(temp)
12
-
13
-
data/svn-commit.tmp DELETED
@@ -1,4 +0,0 @@
1
- First version of rtaglib on rubyforge
2
- --Esta línea y las que están debajo serán ignoradas--
3
-
4
- A .