taglib-ruby 0.7.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGES.md +7 -0
  3. data/README.md +25 -10
  4. data/Rakefile +11 -1
  5. data/docs/taglib/aiff.rb +35 -3
  6. data/docs/taglib/base.rb +8 -1
  7. data/docs/taglib/flac.rb +60 -4
  8. data/docs/taglib/id3v1.rb +29 -0
  9. data/docs/taglib/id3v2.rb +1 -1
  10. data/docs/taglib/mp4.rb +124 -13
  11. data/docs/taglib/mpeg.rb +30 -1
  12. data/docs/taglib/ogg.rb +47 -5
  13. data/docs/taglib/vorbis.rb +1 -1
  14. data/docs/taglib/wav.rb +56 -3
  15. data/ext/extconf_common.rb +9 -2
  16. data/ext/taglib_aiff/taglib_aiff.i +16 -0
  17. data/ext/taglib_aiff/taglib_aiff_wrap.cxx +228 -58
  18. data/ext/taglib_base/includes.i +4 -4
  19. data/ext/taglib_base/taglib_base.i +24 -2
  20. data/ext/taglib_base/taglib_base_wrap.cxx +76 -51
  21. data/ext/taglib_flac/taglib_flac.i +14 -18
  22. data/ext/taglib_flac/taglib_flac_wrap.cxx +341 -799
  23. data/ext/taglib_flac_picture/extconf.rb +4 -0
  24. data/ext/taglib_flac_picture/includes.i +15 -0
  25. data/ext/taglib_flac_picture/taglib_flac_picture.i +15 -0
  26. data/ext/taglib_flac_picture/taglib_flac_picture_wrap.cxx +3087 -0
  27. data/ext/taglib_id3v1/taglib_id3v1.i +19 -0
  28. data/ext/taglib_id3v1/taglib_id3v1_wrap.cxx +241 -58
  29. data/ext/taglib_id3v2/taglib_id3v2.i +52 -1
  30. data/ext/taglib_id3v2/taglib_id3v2_wrap.cxx +152 -155
  31. data/ext/taglib_mp4/taglib_mp4.i +100 -19
  32. data/ext/taglib_mp4/taglib_mp4_wrap.cxx +939 -148
  33. data/ext/taglib_mpeg/taglib_mpeg.i +11 -16
  34. data/ext/taglib_mpeg/taglib_mpeg_wrap.cxx +522 -208
  35. data/ext/taglib_ogg/taglib_ogg.i +11 -0
  36. data/ext/taglib_ogg/taglib_ogg_wrap.cxx +328 -57
  37. data/ext/taglib_vorbis/taglib_vorbis.i +8 -0
  38. data/ext/taglib_vorbis/taglib_vorbis_wrap.cxx +53 -22
  39. data/ext/taglib_wav/taglib_wav.i +24 -0
  40. data/ext/taglib_wav/taglib_wav_wrap.cxx +543 -198
  41. data/lib/taglib/mp4.rb +2 -1
  42. data/lib/taglib/version.rb +3 -3
  43. data/lib/taglib/wav.rb +4 -0
  44. data/taglib-ruby.gemspec +15 -9
  45. data/tasks/ext.rake +36 -15
  46. data/tasks/swig.rake +26 -2
  47. data/test/aiff_examples_test.rb +1 -1
  48. data/test/aiff_file_test.rb +12 -3
  49. data/test/data/vorbis-create.cpp +20 -1
  50. data/test/data/vorbis.oga +0 -0
  51. data/test/fileref_properties_test.rb +1 -1
  52. data/test/flac_file_test.rb +45 -30
  53. data/test/id3v1_genres_test.rb +23 -0
  54. data/test/id3v1_tag_test.rb +1 -0
  55. data/test/id3v2_tag_test.rb +6 -6
  56. data/test/id3v2_write_test.rb +10 -13
  57. data/test/mp4_file_test.rb +33 -4
  58. data/test/mp4_file_write_test.rb +5 -5
  59. data/test/mp4_items_test.rb +83 -29
  60. data/test/mpeg_file_test.rb +120 -7
  61. data/test/vorbis_file_test.rb +2 -2
  62. data/test/vorbis_tag_test.rb +61 -7
  63. data/test/wav_examples_test.rb +1 -1
  64. data/test/wav_file_test.rb +53 -41
  65. data/test/wav_file_write_test.rb +25 -0
  66. metadata +19 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ce29a8851b17cdd725f415e66caa729bc6bc318f
4
- data.tar.gz: 6e74b0b44a29c8fdc70d34d507ab1e831a2275e3
2
+ SHA256:
3
+ metadata.gz: 2e071c43695cf3898de6224fefa308e83dcb4e8b1e8f09c7e348a53a5a4a34bc
4
+ data.tar.gz: 9247a84147c330e268897940a08cebbe124e92e81741ab64a2eaea07962a9f36
5
5
  SHA512:
6
- metadata.gz: 30a434b42ed99ce408216039a9f9c8aad3aa295d95e7bd76d3bfdbcecac0d08f5b39ebb386c0b825e6ba4b20df067f3f0ea2aa7d6b8d30ee97aff50f56d55f8e
7
- data.tar.gz: 3f6a1b4e58673c87f02ca79703ed7664682d43df1e874ef12131ac10507588006fa1499d9fca76725430f471dbc248c5a6b934fe480082536d7c17c8224babf2
6
+ metadata.gz: '0986da0ee118c9062c6f167d6e0b2d20c03dc029f34ec50ad7ecdc85668fc9814a9a71656059a72abf5f2dab65895f02f425ce4dd3cd5b4729dd72b09f4e2006'
7
+ data.tar.gz: 6343921b422e32260edf5f3c5e79b487369a4ee7da5a3a53fcfc9812d1534d9d0351a34e2b4e8233a5483718671ecf4b05d1d7c1df8f66602adc0a9f044ef3aa
data/CHANGES.md CHANGED
@@ -1,6 +1,13 @@
1
1
  Changes in Releases of taglib-ruby
2
2
  ==================================
3
3
 
4
+ ## 1.0.0 (2020-01-07)
5
+
6
+ * Support for TagLib >= 1.11.1 (drop support for earlier versions) (#83)
7
+ * This includes a lot of new APIs and some changed APIs, see
8
+ `@since 1.0.0` in the docs
9
+ * Stop using tainted strings to fix warnings with Ruby 2.7 (#86)
10
+
4
11
  ## 0.7.1 (2015-12-28)
5
12
 
6
13
  * Fix compile error during gem installation on Ruby 2.3 (MRI) (#67)
data/README.md CHANGED
@@ -21,16 +21,14 @@ Contributions for more coverage of the library are very welcome.
21
21
  [![Gem version][gem-img]][gem-link]
22
22
  [![Build status][travis-img]][travis-link]
23
23
 
24
- [![flattr this project][flattr-img]][flattr-link]
25
-
26
24
  Installation
27
25
  ------------
28
26
 
29
- Before you install the gem, make sure to have [taglib][taglib] installed
27
+ Before you install the gem, make sure to have [taglib 1.11.1 or higher][taglib] installed
30
28
  with header files (and a C++ compiler of course):
31
29
 
32
30
  * Debian/Ubuntu: `sudo apt-get install libtag1-dev`
33
- * Fedora/RHEL: `sudo yum install taglib-devel`
31
+ * Fedora/RHEL: `sudo dnf install taglib-devel`
34
32
  * Brew: `brew install taglib`
35
33
  * MacPorts: `sudo port install taglib`
36
34
 
@@ -42,7 +40,7 @@ Then do:
42
40
 
43
41
  Not all versions of TagLib get along with `clang++`, the default C++ compiler
44
42
  on OS X. To compile taglib-ruby's C++ extensions with a different compiler
45
- during installation, set the `TAGLIB_RUBY_CXX` environement variable.
43
+ during installation, set the `TAGLIB_RUBY_CXX` environment variable.
46
44
 
47
45
  TAGLIB_RUBY_CXX=g++-4.2 gem install taglib-ruby
48
46
 
@@ -62,6 +60,12 @@ See {file:CHANGES.md}.
62
60
  Contributing
63
61
  ------------
64
62
 
63
+ ### Dependencies
64
+
65
+ Fedora:
66
+
67
+ sudo dnf install taglib-devel ruby-devel gcc-c++ redhat-rpm-config swig
68
+
65
69
  ### Building
66
70
 
67
71
  Install dependencies (uses bundler, install it via `gem install bundler`
@@ -69,8 +73,7 @@ if you don't have it):
69
73
 
70
74
  bundle install
71
75
 
72
- Regenerate SWIG wrappers if you made changes in `.i` files (use at least
73
- version 2.0.5 of SWIG):
76
+ Regenerate SWIG wrappers if you made changes in `.i` files (use version 3.0.7 of SWIG):
74
77
 
75
78
  rake swig
76
79
 
@@ -95,6 +98,20 @@ Build and install gem into system gems:
95
98
 
96
99
  rake install
97
100
 
101
+ Build a specific version of Taglib:
102
+
103
+ PLATFORM=x86_64-linux TAGLIB_VERSION=1.11.1 rake vendor
104
+
105
+ The above command will automatically download Taglib 1.11.1, build it and install it in `tmp/x86_64-linux/taglib-1.11.1`.
106
+
107
+ The `swig` and `compile` tasks can then be executed against that specific version of Taglib by setting the `TAGLIB_DIR` environment variable to `$PWD/tmp/x86_64-linux/taglib-1.11.1` (it is assumed that taglib headers are located at `$TAGLIB_DIR/include` and taglib libraries at `$TAGLIB_DIR/lib`).
108
+
109
+ The `test` task can then be run for that version of Taglib by adding `$PWD/tmp/x86_64-linux/taglib-1.11.1/lib` to the `LD_LIBRARY_PATH` environment variable.
110
+
111
+ To do everything in one command:
112
+
113
+ PLATFORM=x86_64-linux TAGLIB_VERSION=1.11.1 TAGLIB_DIR=$PWD/tmp/x86_64-linux/taglib-1.11.1 LD_LIBRARY_PATH=$PWD/tmp/x86_64-linux/taglib-1.11.1/lib rake vendor compile test
114
+
98
115
  ### Workflow
99
116
 
100
117
  * Check out the latest master to make sure the feature hasn't been
@@ -114,7 +131,7 @@ Build and install gem into system gems:
114
131
  License
115
132
  -------
116
133
 
117
- Copyright (c) 2010-2014 Robin Stocker and others, see Git history.
134
+ Copyright (c) 2010-2020 Robin Stocker and others, see Git history.
118
135
 
119
136
  taglib-ruby is distributed under the MIT License,
120
137
  see LICENSE.txt for details.
@@ -128,5 +145,3 @@ version 2.1 (LGPL) and Mozilla Public License (MPL).
128
145
  [gem-link]: https://rubygems.org/gems/taglib-ruby
129
146
  [travis-img]: https://api.travis-ci.org/robinst/taglib-ruby.png
130
147
  [travis-link]: https://travis-ci.org/robinst/taglib-ruby
131
- [flattr-img]: https://api.flattr.com/button/flattr-badge-large.png
132
- [flattr-link]: https://flattr.com/submit/auto?user_id=robinst&url=https://github.com/robinst/taglib-ruby&title=taglib-ruby&tags=github&category=software
data/Rakefile CHANGED
@@ -25,4 +25,14 @@ end
25
25
 
26
26
  $gemspec = Bundler::GemHelper.gemspec
27
27
 
28
- FileList['tasks/**/*.rake'].each { |task| import task }
28
+ import 'tasks/docs_coverage.rake'
29
+ import 'tasks/ext.rake'
30
+ import 'tasks/gemspec_check.rake'
31
+
32
+ # When importing swig.rake, the *_wrap.cxx files depend on being generated
33
+ # by Swig. Since the ExtensionTasks depend on the *_wrap.cxx files,
34
+ # compiling the extensions will trigger Swig, which is not desired as
35
+ # those files have already been generated and there's no reason to make
36
+ # Swig a variable of the CI. To prevent those dependencies, do not import
37
+ # swig.rake when running in Travis.
38
+ import 'tasks/swig.rake' unless ENV['TRAVIS'] == 'true'
data/docs/taglib/aiff.rb CHANGED
@@ -24,7 +24,7 @@ module TagLib::RIFF::AIFF
24
24
  # @see ID3v2::Tag ID3v2 examples.
25
25
  #
26
26
  class File < TagLib::File
27
- # {include:TagLib::FileRef.open}
27
+ # {include:::TagLib::FileRef.open}
28
28
  #
29
29
  # @param (see #initialize)
30
30
  # @yield [file] the {File} object, as obtained by {#initialize}
@@ -53,11 +53,43 @@ module TagLib::RIFF::AIFF
53
53
  def audio_properties
54
54
  end
55
55
 
56
+ # @return [Boolean] Whether or not the file on disk actually has an ID3v2 tag.
57
+ #
58
+ # @since 1.0.0
59
+ def id3v2_tag?
60
+ end
61
+
56
62
  end
57
63
 
58
64
  class Properties < TagLib::AudioProperties
59
- # @return [Integer] Sample width
60
- attr_reader :sample_width
65
+ # @return [Integer] Number of bits per audio sample.
66
+ #
67
+ # @since 1.0.0
68
+ attr_reader :bits_per_sample
69
+
70
+ # @return [Integer] Number of sample frames.
71
+ #
72
+ # @since 1.0.0
73
+ attr_reader :sample_frames
74
+
75
+ # @return [String] The compression type of the AIFF-C file.
76
+ # For example, "NONE" for not compressed, "ACE2" for ACE 2-to-1.
77
+ # If the file is in AIFF format, always returns an empty string.
78
+ #
79
+ # @since 1.0.0
80
+ attr_reader :compression_type
81
+
82
+ # @return [String] Returns the concrete compression name of the AIFF-C file.
83
+ # If the file is in AIFF format, always returns an empty string.
84
+ #
85
+ # @since 1.0.0
86
+ attr_reader :compression_name
87
+
88
+ # @return [Boolean] True if the file is in AIFF-C format, false if AIFF format.
89
+ #
90
+ # @since 1.0.0
91
+ def aiff_c?
92
+ end
61
93
  end
62
94
 
63
95
  end
data/docs/taglib/base.rb CHANGED
@@ -247,7 +247,14 @@ module TagLib
247
247
  Accurate = 2
248
248
 
249
249
  # @return [Integer] length of the file in seconds
250
- attr_reader :length
250
+ #
251
+ # @since 1.0.0
252
+ attr_reader :length_in_seconds
253
+
254
+ # @return [Integer] length of the file in milliseconds
255
+ #
256
+ # @since 1.0.0
257
+ attr_reader :length_in_milliseconds
251
258
 
252
259
  # @return [Integer] bit rate in kb/s (kilobit per second)
253
260
  attr_reader :bitrate
data/docs/taglib/flac.rb CHANGED
@@ -30,7 +30,14 @@ module TagLib::FLAC
30
30
  # file.save
31
31
  # end
32
32
  class File < TagLib::File
33
- # {include:TagLib::FileRef.open}
33
+
34
+ NoTags = 0x0000
35
+ XiphComment = 0x0001
36
+ ID3v1 = 0x0002
37
+ ID3v2 = 0x0004
38
+ AllTags = 0xffff
39
+
40
+ # {include:::TagLib::FileRef.open}
34
41
  #
35
42
  # @param (see #initialize)
36
43
  # @yield [file] the {File} object, as obtained by {#initialize}
@@ -82,6 +89,14 @@ module TagLib::FLAC
82
89
  def picture_list
83
90
  end
84
91
 
92
+ # Remove the specified picture.
93
+ #
94
+ # @param [TagLib::FLAC::Picture] picture
95
+ #
96
+ # @since 1.0.0
97
+ def remove_picture(picture)
98
+ end
99
+
85
100
  # Remove all pictures.
86
101
  #
87
102
  # @return [void]
@@ -94,12 +109,46 @@ module TagLib::FLAC
94
109
  # @return [void]
95
110
  def add_picture(picture)
96
111
  end
112
+
113
+ # Remove the tags matching the specified OR-ed types.
114
+ #
115
+ # @param [int] tags The types of tags to remove.
116
+ # @return [void]
117
+ #
118
+ # @since 1.0.0
119
+ def strip(tags=TagLib::FLAC::File::AllTags)
120
+ end
121
+
122
+ # @return [Boolean] Whether or not the file on disk actually has a XiphComment.
123
+ #
124
+ # @since 1.0.0
125
+ def xiph_comment?
126
+ end
127
+
128
+ # @return [Boolean] Whether or not the file on disk actually has an ID3v1 tag.
129
+ #
130
+ # @since 1.0.0
131
+ def id3v1_tag?
132
+ end
133
+
134
+ # @return [Boolean] Whether or not the file on disk actually has an ID3v2 tag.
135
+ #
136
+ # @since 1.0.0
137
+ def id3v2_tag?
138
+ end
97
139
  end
98
140
 
99
141
  # FLAC audio properties.
100
142
  class Properties < TagLib::AudioProperties
101
- # @return [Integer] Sample width
102
- attr_reader :sample_width
143
+ # @return [Integer] Number of bits per audio sample.
144
+ #
145
+ # @since 1.0.0
146
+ attr_reader :bits_per_sample
147
+
148
+ # @return [Integer] Number of sample frames.
149
+ #
150
+ # @since 1.0.0
151
+ attr_reader :sample_frames
103
152
 
104
153
  # @return [binary String] MD5 signature of uncompressed audio stream
105
154
  # (binary data)
@@ -172,5 +221,12 @@ module TagLib::FLAC
172
221
  #
173
222
  # @return [binary String]
174
223
  attr_accessor :data
224
+
225
+ # Parse the picture data in the FLAC picture block format.
226
+ # @return [Boolean] True if the data has been parsed successfully, false otherwise.
227
+ #
228
+ # @since 1.0.0
229
+ def parse(rawdata)
230
+ end
175
231
  end
176
- end
232
+ end
data/docs/taglib/id3v1.rb CHANGED
@@ -1,5 +1,34 @@
1
1
  module TagLib::ID3v1
2
2
  # An ID3v1 tag.
3
3
  class Tag < TagLib::Tag
4
+ # @return [Integer] the genre as a number
5
+ # @return [255] if not present
6
+ #
7
+ # @since 1.0.0
8
+ attr_accessor :genre_number
9
+ end
10
+
11
+ # @return [Array<String>] the ID3v1 genre list.
12
+ #
13
+ # @since 1.0.0
14
+ def genre_list
15
+ end
16
+
17
+ # @return [Map<String, int>] the map associating a genre to its index.
18
+ #
19
+ # @since 1.0.0
20
+ def genre_map
21
+ end
22
+
23
+ # @return [String] the name of genre at `index` in the ID3v1 genre list.
24
+ #
25
+ # @since 1.0.0
26
+ def genre(index)
27
+ end
28
+
29
+ # @return [String] the genre index for the (case sensitive) genre `name`.
30
+ #
31
+ # @since 1.0.0
32
+ def genre_index(name)
4
33
  end
5
34
  end
data/docs/taglib/id3v2.rb CHANGED
@@ -478,7 +478,7 @@ module TagLib::ID3v2
478
478
  # @param [String] value simple text to set
479
479
  attr_writer :text
480
480
 
481
- # @param [String] value URL
481
+ # @return [String] the URL
482
482
  attr_accessor :url
483
483
  end
484
484
 
data/docs/taglib/mp4.rb CHANGED
@@ -54,7 +54,7 @@ module TagLib::MP4
54
54
  # # #<TagLib::MP4::Item:0x007f9bab61d818 @__swigtype__="_p_TagLib__MP4__Item">]]
55
55
  class File < TagLib::File
56
56
 
57
- # {include:TagLib::FileRef.open}
57
+ # {include:::TagLib::FileRef.open}
58
58
  #
59
59
  # @param (see #initialize)
60
60
  # @yield [file] the {File} object, as obtained by {#initialize}
@@ -82,12 +82,48 @@ module TagLib::MP4
82
82
  # @return [TagLib::MP4::Properties]
83
83
  def audio_properties
84
84
  end
85
+
86
+ # @return [Boolean] Returns whether or not the file actually has an MP4 tag, or the
87
+ # file has a Metadata Item List (ilst) atom.
88
+ #
89
+ # @since 1.0.0
90
+ def mp4_tag?
91
+ end
85
92
  end
86
93
 
87
94
  class Tag < TagLib::Tag
88
- # Returns the map containing all the items in the tag
89
- # @return [TagLib::MP4::ItemListMap]
90
- def item_list_map
95
+ # @return [TagLib::MP4::ItemMap] The map containing all the items in the tag.
96
+ #
97
+ # @since 1.0.0
98
+ def item_map
99
+ end
100
+
101
+ # @return [TagLib::MP4::Item] The Item associated to `key` (will be invalid in `key` does not exists).
102
+ #
103
+ # @since 1.0.0
104
+ def [](key)
105
+ end
106
+
107
+ # Associate the `value` Item to `key`, overwriting any previous value.
108
+ # @param key [String]
109
+ # @param value [TagLib::MP4::Item]
110
+ # @return [nil]
111
+ #
112
+ # @since 1.0.0
113
+ def []=(key, value)
114
+ end
115
+
116
+ # Remove the [TagLib::MP4::Item] associated to `key`.
117
+ # @return [nil]
118
+ #
119
+ # @since 1.0.0
120
+ def remove_item(key)
121
+ end
122
+
123
+ # @return True if the tag has an entry for `key`, false otherwise.
124
+ #
125
+ # @since 1.0.0
126
+ def contains(key)
91
127
  end
92
128
  end
93
129
 
@@ -109,11 +145,32 @@ module TagLib::MP4
109
145
  def self.from_bool(value)
110
146
  end
111
147
 
148
+ # @param [Fixnum] value
149
+ # @return [TagLib::MP4::Item]
150
+ #
151
+ # @since 1.0.0
152
+ def self.from_byte(value)
153
+ end
154
+
155
+ # @param [Boolean] value
156
+ # @return [TagLib::MP4::Item]
157
+ #
158
+ # @since 1.0.0
159
+ def self.from_uint(value)
160
+ end
161
+
112
162
  # @param [Fixnum] number
113
163
  # @return [TagLib::MP4::Item]
114
164
  def self.from_int(number)
115
165
  end
116
166
 
167
+ # @param [Fixnum] number
168
+ # @return [TagLib::MP4::Item]
169
+ #
170
+ # @since 1.0.0
171
+ def self.from_long_long(number)
172
+ end
173
+
117
174
  # @example
118
175
  # TagLib::MP4::Item.from_int_pair([4, 11])
119
176
  # @param [Array<Fixnum, Fixnum>] integer_pair
@@ -126,18 +183,43 @@ module TagLib::MP4
126
183
  def self.from_string_list(string_array)
127
184
  end
128
185
 
186
+ # @param [TagLib::ByteVectorList] list
187
+ # @return [TagLib::MP4::Item]
188
+ #
189
+ # @since 1.0.0
190
+ def self.from_byte_vector_list(list)
191
+ end
192
+
129
193
  # @return [Boolean]
130
194
  def to_bool
131
195
  end
132
196
 
133
- # @return [Array<TagLib::MP4::CoverArt>]
134
- def to_cover_art_list
197
+ # @return [Fixnum]
198
+ #
199
+ # @since 1.0.0
200
+ def to_byte
201
+ end
202
+
203
+ # @return [Fixnum]
204
+ #
205
+ # @since 1.0.0
206
+ def to_uint
135
207
  end
136
208
 
137
209
  # @return [Fixnum]
138
210
  def to_int
139
211
  end
140
212
 
213
+ # @return [Fixnum]
214
+ #
215
+ # @since 1.0.0
216
+ def to_long_long
217
+ end
218
+
219
+ # @return [Array<TagLib::MP4::CoverArt>]
220
+ def to_cover_art_list
221
+ end
222
+
141
223
  # @return [Array<Fixnum, Fixnum>]
142
224
  def to_int_pair
143
225
  end
@@ -146,19 +228,25 @@ module TagLib::MP4
146
228
  def to_string_list
147
229
  end
148
230
 
231
+ # @return [TagLib::ByteVectorList]
232
+ #
233
+ # @since 1.0.0
234
+ def to_byte_vector_list
235
+ end
236
+
149
237
  # @return [Boolean]
150
238
  def valid?
151
239
  end
152
240
  end
153
241
 
154
- # The underlying C++-structure of `ItemListMap` inherits from `std::map`.
155
- # Consequently, `ItemListMap` behaves differently from a Ruby hash in a few
156
- # places: the C++ memory management strategies of ItemListMap can lead to
242
+ # The underlying C++-structure of `ItemMap` inherits from `std::map`.
243
+ # Consequently, `ItemMap` behaves differently from a Ruby hash in a few
244
+ # places: the C++ memory management strategies of ItemMap can lead to
157
245
  # a situation where a Ruby object refers to a location in memory that was
158
246
  # freed by C++. To prevent Ruby from crashing on us with a segmentation
159
247
  # fault, we raise an `ObjectPreviouslyDeleted` exception when we try to access
160
248
  # data that is no longer available.
161
- class ItemListMap
249
+ class ItemMap
162
250
  # Return the Item under `key`, or `nil` if no Item is present.
163
251
  # @param [String] key
164
252
  # @return [TagLib::MP4::Item]
@@ -235,10 +323,30 @@ module TagLib::MP4
235
323
  # @return [Array<Array<String, TagLib::MP4::Item>>]
236
324
  def to_a
237
325
  end
326
+
327
+ # Convert self into an hash.
328
+ # @return [Hash<String, TagLib::MP4::Item>]
329
+ #
330
+ # @since 1.0.0
331
+ def to_h
332
+ end
238
333
  end
239
334
  #
240
335
  class Properties < TagLib::AudioProperties
241
- attr_reader :bits_per_sample, :encrypted?
336
+ Unknown = 0
337
+ AAC = 1
338
+ ALAC = 2
339
+
340
+ # @return [Integer] The number of bits per audio sample.
341
+ attr_reader :bits_per_sample
342
+
343
+ # @return [Boolean] Whether or not the file is encrypted.
344
+ attr_reader :encrypted?
345
+
346
+ # @return [Integer] The codec used in the file.
347
+ #
348
+ # @since 1.0.0
349
+ attr_reader :codec
242
350
  end
243
351
 
244
352
  # The `CoverArt` class is used to embed cover art images in MP4 tags.
@@ -247,8 +355,11 @@ module TagLib::MP4
247
355
  # image_data = File.open('cover_art.jpeg', 'rb') { |f| f.read }
248
356
  # cover_art = TagLib::MP4::CoverArt.new(TagLib::MP4::CoverArt::JPEG, image_data)
249
357
  class CoverArt
250
- JPEG = 0x0D
251
- PNG = 0x0E
358
+ Unknown = 0x00
359
+ JPEG = 0x0D
360
+ PNG = 0x0E
361
+ BMP = 0x1B
362
+ GIF = 0x0C # Deprecated
252
363
 
253
364
  # Returns the format of the image data: `JPEG` or `PNG`.
254
365
  # @return [Fixnum]