glyr 0.9.9.3 → 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.
- data/lib/glyr/c/functions.rb +1 -0
- data/lib/glyr/c/types.rb +9 -0
- data/lib/glyr/query.rb +9 -1
- data/lib/glyr/version.rb +1 -1
- metadata +2 -2
data/lib/glyr/c/functions.rb
CHANGED
@@ -60,6 +60,7 @@ attach_function :glyr_opt_lookup_db, [:pointer, :pointer], Error
|
|
60
60
|
attach_function :glyr_opt_db_autowrite, [:pointer, :bool], Error
|
61
61
|
attach_function :glyr_opt_db_autoread, [:pointer, :bool], Error
|
62
62
|
attach_function :glyr_opt_musictree_path, [:pointer, :string], Error
|
63
|
+
attach_function :glyr_opt_normalize, [:pointer, :int], Error
|
63
64
|
|
64
65
|
attach_function :glyr_download, [:string, :pointer], :pointer
|
65
66
|
attach_function :glyr_strerror, [Error], :string
|
data/lib/glyr/c/types.rb
CHANGED
@@ -68,6 +68,15 @@ DataType = FFI::Enum.new([
|
|
68
68
|
:backdrops
|
69
69
|
])
|
70
70
|
|
71
|
+
Normalization = Bitmap.new(
|
72
|
+
none: 1 << 0,
|
73
|
+
moderate: 1 << 1,
|
74
|
+
aggressive: 1 << 2,
|
75
|
+
artist: 1 << 3,
|
76
|
+
album: 1 << 4,
|
77
|
+
title: 1 << 5
|
78
|
+
)
|
79
|
+
|
71
80
|
FieldRequirement = Bitmap.new(
|
72
81
|
requires_artist: 1 << 0,
|
73
82
|
requires_album: 1 << 1,
|
data/lib/glyr/query.rb
CHANGED
@@ -246,12 +246,20 @@ class Query
|
|
246
246
|
|
247
247
|
def path (value = nil)
|
248
248
|
if value
|
249
|
-
raise_if_error C.glyr_opt_musictree_path(to_native,
|
249
|
+
raise_if_error C.glyr_opt_musictree_path(to_native, value)
|
250
250
|
else
|
251
251
|
to_native[:musictree_path]
|
252
252
|
end
|
253
253
|
end
|
254
254
|
|
255
|
+
def normalize (*args)
|
256
|
+
unless args.empty?
|
257
|
+
raise_if_error C.glyr_opt_normalize(to_native, Normalization[*args].to_i)
|
258
|
+
else
|
259
|
+
Normalization[to_native[:normalization]]
|
260
|
+
end
|
261
|
+
end
|
262
|
+
|
255
263
|
def force_utf8?
|
256
264
|
to_native[:force_utf8]
|
257
265
|
end
|
data/lib/glyr/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glyr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-08-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|