taglib-ruby 1.1.3 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,6 +4,7 @@
4
4
  #define TAGLIB_EXPORT
5
5
  #define TAGLIB_IGNORE_MISSING_DESTRUCTOR
6
6
  #define TAGLIB_DEPRECATED
7
+ #define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
7
8
 
8
9
  // Replaces the typemap from swigtype.swg and just adds the line
9
10
  // SWIG_RubyUnlinkObjects. This is done to be safe in the case when a
@@ -36,34 +37,26 @@
36
37
  #endif
37
38
 
38
39
  VALUE taglib_bytevector_to_ruby_string(const TagLib::ByteVector &byteVector) {
39
- if (byteVector.isNull()) {
40
- return Qnil;
41
- } else {
42
- return rb_str_new(byteVector.data(), byteVector.size());
43
- }
40
+ return rb_str_new(byteVector.data(), byteVector.size());
44
41
  }
45
42
 
46
43
  TagLib::ByteVector ruby_string_to_taglib_bytevector(VALUE s) {
47
44
  if (NIL_P(s)) {
48
- return TagLib::ByteVector::null;
45
+ return TagLib::ByteVector();
49
46
  } else {
50
47
  return TagLib::ByteVector(RSTRING_PTR(StringValue(s)), RSTRING_LEN(s));
51
48
  }
52
49
  }
53
50
 
54
51
  VALUE taglib_string_to_ruby_string(const TagLib::String & string) {
55
- if (string.isNull()) {
56
- return Qnil;
57
- } else {
58
- VALUE result = rb_str_new2(string.toCString(true));
59
- ASSOCIATE_UTF8_ENCODING(result);
60
- return result;
61
- }
52
+ VALUE result = rb_str_new2(string.toCString(true));
53
+ ASSOCIATE_UTF8_ENCODING(result);
54
+ return result;
62
55
  }
63
56
 
64
57
  TagLib::String ruby_string_to_taglib_string(VALUE s) {
65
58
  if (NIL_P(s)) {
66
- return TagLib::String::null;
59
+ return TagLib::String();
67
60
  } else {
68
61
  return TagLib::String(RSTRING_PTR(CONVERT_TO_UTF8(StringValue(s))), TagLib::String::UTF8);
69
62
  }
@@ -152,6 +145,13 @@ TagLib::FileName ruby_string_to_taglib_filename(VALUE s) {
152
145
  #endif
153
146
  }
154
147
 
148
+ VALUE taglib_offset_t_to_ruby_int(TagLib::offset_t off) {
149
+ #ifdef _WIN32
150
+ return LL2NUM(off);
151
+ #else
152
+ return OFFT2NUM(off);
153
+ #endif
154
+ }
155
155
  %}
156
156
 
157
157
  // vim: set filetype=cpp sw=2 ts=2 expandtab:
@@ -26,6 +26,7 @@ namespace TagLib {
26
26
  typedef unsigned char uchar;
27
27
  typedef unsigned int uint;
28
28
  typedef unsigned long ulong;
29
+ using offset_t = long long;
29
30
  }
30
31
 
31
32
  %constant int TAGLIB_MAJOR_VERSION = TAGLIB_MAJOR_VERSION;
@@ -125,6 +126,10 @@ namespace TagLib {
125
126
  %typemap(typecheck) TagLib::FileName = char *;
126
127
  %feature("valuewrapper") TagLib::FileName;
127
128
 
129
+ %typemap(out) TagLib::offset_t {
130
+ $result = taglib_offset_t_to_ruby_int($1);
131
+ }
132
+
128
133
  %ignore TagLib::List::operator[];
129
134
  %ignore TagLib::List::operator=;
130
135
  %ignore TagLib::List::operator!=;
@@ -135,6 +140,10 @@ namespace TagLib {
135
140
  %ignore TagLib::Tag::setProperties;
136
141
  %ignore TagLib::Tag::removeUnsupportedProperties;
137
142
 
143
+ %ignore TagLib::Tag::complexProperties;
144
+ %ignore TagLib::Tag::setComplexProperties;
145
+ %ignore TagLib::Tag::complexPropertyKeys;
146
+
138
147
  %include <taglib/tag.h>
139
148
 
140
149
  %ignore TagLib::AudioProperties::length; // Deprecated.
@@ -147,8 +156,20 @@ namespace TagLib {
147
156
  %ignore TagLib::File::setProperties;
148
157
  %ignore TagLib::File::removeUnsupportedProperties;
149
158
 
159
+ %ignore TagLib::File::complexProperties;
160
+ %ignore TagLib::File::setComplexProperties;
161
+ %ignore TagLib::File::complexPropertyKeys;
162
+
150
163
  %include <taglib/tfile.h>
151
164
 
165
+ %ignore TagLib::FileRef::properties;
166
+ %ignore TagLib::FileRef::setProperties;
167
+ %ignore TagLib::FileRef::removeUnsupportedProperties;
168
+
169
+ %ignore TagLib::FileRef::complexProperties;
170
+ %ignore TagLib::FileRef::setComplexProperties;
171
+ %ignore TagLib::FileRef::complexPropertyKeys;
172
+
152
173
  // Ignore IOStream and all the constructors using it.
153
174
  %ignore IOStream;
154
175
  %ignore TagLib::FileRef::FileRef(IOStream*, bool, AudioProperties::ReadStyle);