rocksky 0.11.1 → 0.12.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6285f01e3baa73b2791e6b64a2d4d331aa750abe5f50d1e4cafe6263073bf9ad
4
- data.tar.gz: 1668269cb59db82bfaf6455e66e493f7dfd9a1c97c5037d9b3eac959a60dd3cf
3
+ metadata.gz: 1c936595ae468fd702c1e78cb1ad3db497ae10bded7672754909c6b014c163bd
4
+ data.tar.gz: 869b8de2f3e067e3e11cd114bcd40f3cdd6efac0930a477858b009d1b476e608
5
5
  SHA512:
6
- metadata.gz: 50c4b9e1f82ce55ea8b9370946461dc8fd9bc6c87ce108ac304cf2835a66b0e6474c7cd07cd1c5a77c6794800cc7082a63abb1e45cc8395dfb8b7a07e82d3aed
7
- data.tar.gz: 57b4fd741109bd4cc218d68520b22fef8f5dc5bfa2f1494ac7439722e892d5e60112eb026bb9cc65f8aaa784a537bbacf9078c939b27b859d646b854b85d1993
6
+ metadata.gz: 7005add14ac829814cef5c34a78feb52878c97bd50218041408e46da223115b0f19c64a2d3710f75f3b389e5ef880cfcee3957047dfe2c181b239414c5cf512a
7
+ data.tar.gz: 579dbe27c678f7460d13c0f75495afc8ea7216abe262bb0ca8069268232d1452b546e18dce29ea3d3918c8965e7215536c7a31364e55c4ec6247952fb2371b78
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rocksky
4
+ # app.rocksky.equalizer.* — saved EQ presets (app.rocksky.equalizer records
5
+ # in the caller's repo).
6
+ #
7
+ # Units are rockbox's internal ones: band frequency in Hz, gain in tenths of
8
+ # dB (30 = +3.0 dB), q × 10 (7 = Q 0.7); precut in tenths of dB (-240..0).
9
+ module Equalizer
10
+ module_function
11
+
12
+ # An actor's presets ({ "presets" => [...] }). Omit +actor+ for the
13
+ # authenticated viewer's own — that read is auth-gated, so pass +token+.
14
+ def presets(actor: nil, token: nil, base: nil)
15
+ params = {}
16
+ params[:did] = actor if actor
17
+ Rocksky.get("app.rocksky.equalizer.listPresets", params, base: base, token: token)
18
+ end
19
+
20
+ # Create or update a preset; the rkey is +name+ slugified, so an existing
21
+ # name overwrites that preset. +bands+ is an array of
22
+ # { frequency:, gain:, q: } hashes. Returns the saved preset view.
23
+ def put_preset(name, bands, token:, precut: nil, base: nil)
24
+ body = { name: name, bands: bands }
25
+ body[:precut] = precut if precut
26
+ # putPreset's input is a JSON body, so it rides the body-carrying native
27
+ # call rather than the query-string Rocksky.post.
28
+ Rocksky.unwrap(C.rocksky_library_post(base.to_s, token.to_s,
29
+ "app.rocksky.equalizer.putPreset",
30
+ JSON.generate(body)))
31
+ end
32
+
33
+ # Delete a preset by rkey. Empty response.
34
+ def delete_preset(rkey, token:, base: nil)
35
+ Rocksky.post("app.rocksky.equalizer.deletePreset", { rkey: rkey }, base: base, token: token)
36
+ end
37
+ end
38
+ end
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "repo": "tsirysndr/rocksky",
3
- "tag": "bindings-v0.10.0",
3
+ "tag": "bindings-v0.12.0",
4
4
  "checksums": {
5
- "aarch64-apple-darwin": "36607cf75cc05b79f93570efae0047dfe58f4beff38033f59e9c8c9e03c0e62e",
6
- "aarch64-linux-gnu": "d5fcf8a3ca7acba5eaf45db0478360ade6ebfcea7f1dab582ff10696ec77c24e",
7
- "x86_64-apple-darwin": "a19daa282e01fa68cb279da28bba52198c928c7771770d4e0a5e10e922a51aa9",
8
- "x86_64-linux-gnu": "a6751be73f81d32639b85f3a1f2c6420b7a2346acbc59a5fd534156915d2f918",
9
- "x86_64-unknown-freebsd": "e811d322e14ce51498928616c02f0c6228ea765a7f67efef00963a1bbe0c172e",
10
- "x86_64-unknown-netbsd": "ce8e555d3ef6caee7dd7c7302feb14b73268ae46dcc9c517d8370c57c93624c6"
5
+ "aarch64-apple-darwin": "b23d327021f00c260fb0ed2ca8792ef4cf6c98054da36b98ca4175bd1f774450",
6
+ "aarch64-linux-gnu": "714609a9eedc63f31a651d7eb0d5092f43de229ad4045c1e3fa1725a6734c28a",
7
+ "x86_64-apple-darwin": "bf86e4404adb3116f36e58f714eb4a6726b9612e3c3703f4c8b3444daa6fc4e5",
8
+ "x86_64-linux-gnu": "c6c17133b0a734fc9d31a1a793932d9f11476384f103a4dbc193c7b2176ba10e",
9
+ "x86_64-unknown-freebsd": "80a91622d51272f9c20cd85dd4acde3c95d4001614ad051982f86024266fd9c5",
10
+ "x86_64-unknown-netbsd": "ffa478d378c39b1ba8381ffd3e7c874022bbda688208c498f048a41221d20daf"
11
11
  }
12
12
  }
@@ -47,7 +47,8 @@ module Rocksky
47
47
  end
48
48
 
49
49
  # Register a handler for a command action, one of +:play+, +:pause+, +:next+,
50
- # +:previous+, +:seek+, +:queue_jump+, +:queue_remove+, +:enqueue+. The block
50
+ # +:previous+, +:seek+, +:queue_jump+, +:queue_remove+, +:queue_move+,
51
+ # +:enqueue+, +:shuffle+, +:repeat+, +:volume+, +:audio_settings+. The block
51
52
  # receives the full symbol-keyed command Hash (e.g. +{ action: "seek",
52
53
  # position: 42000 }+). Returns +self+ for chaining.
53
54
  def on(action, &block)
@@ -241,6 +242,37 @@ module Rocksky
241
242
  Rocksky.unwrap(C.rocksky_remote_controller_queue_remove(@ptr, target.to_s, index))
242
243
  end
243
244
 
245
+ # Move queue item +from+ to position +to+ on the target device (arrayMove
246
+ # semantics; empty target broadcasts).
247
+ def queue_move(target, from, to)
248
+ Rocksky.unwrap(C.rocksky_remote_controller_queue_move(@ptr, target.to_s, from, to))
249
+ end
250
+
251
+ # Turn queue shuffle on/off (empty target broadcasts). A player without
252
+ # shuffle ignores it.
253
+ def set_shuffle(target, enabled)
254
+ Rocksky.unwrap(C.rocksky_remote_controller_set_shuffle(@ptr, target.to_s, enabled ? 1 : 0))
255
+ end
256
+
257
+ # Set the queue repeat mode: "off" | "all" | "one" (empty target
258
+ # broadcasts). A player without repeat ignores it.
259
+ def set_repeat(target, mode)
260
+ Rocksky.unwrap(C.rocksky_remote_controller_set_repeat(@ptr, target.to_s, mode.to_s))
261
+ end
262
+
263
+ # Set output volume 0.0..=1.0 (empty target broadcasts). A player without
264
+ # volume control ignores it.
265
+ def set_volume(target, volume)
266
+ Rocksky.unwrap(C.rocksky_remote_controller_set_volume(@ptr, target.to_s, volume.to_f.clamp(0.0, 1.0)))
267
+ end
268
+
269
+ # Apply a partial audio-settings document — +settings_json+ is the JSON of
270
+ # the protocol's +audio_settings+ args (PROTOCOL.md §6.1). Raises on
271
+ # invalid JSON rather than silently sending nothing.
272
+ def set_audio_settings(target, settings_json)
273
+ Rocksky.unwrap(C.rocksky_remote_controller_set_audio_settings(@ptr, target.to_s, settings_json.to_s))
274
+ end
275
+
244
276
  # Enqueue +tracks+ (array of camelCase queue-item Hashes) on +target+. +mode+
245
277
  # is "now" | "next" | "last"; nil target = broadcast.
246
278
  def enqueue(target, tracks, mode: "now", shuffle: false, start_index: 0)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rocksky
4
- VERSION = "0.11.1"
4
+ VERSION = "0.12.1"
5
5
  end
data/lib/rocksky.rb CHANGED
@@ -65,6 +65,11 @@ module Rocksky
65
65
  "char* rocksky_remote_controller_seek(void*, const char*, unsigned long long)",
66
66
  "char* rocksky_remote_controller_queue_jump(void*, const char*, unsigned int)",
67
67
  "char* rocksky_remote_controller_queue_remove(void*, const char*, unsigned int)",
68
+ "char* rocksky_remote_controller_queue_move(void*, const char*, unsigned int, unsigned int)",
69
+ "char* rocksky_remote_controller_set_shuffle(void*, const char*, char)",
70
+ "char* rocksky_remote_controller_set_repeat(void*, const char*, const char*)",
71
+ "char* rocksky_remote_controller_set_volume(void*, const char*, float)",
72
+ "char* rocksky_remote_controller_set_audio_settings(void*, const char*, const char*)",
68
73
  "char* rocksky_remote_controller_enqueue(void*, const char*, const char*, const char*, char, unsigned int)",
69
74
  "char* rocksky_remote_controller_disconnect(void*)",
70
75
  "void rocksky_remote_controller_free(void*)"
@@ -357,6 +362,7 @@ module Rocksky
357
362
  end
358
363
  end
359
364
 
365
+ require_relative "rocksky/equalizer"
360
366
  require_relative "rocksky/filter"
361
367
  require_relative "rocksky/library"
362
368
  require_relative "rocksky/playlist"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rocksky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rocksky
@@ -80,6 +80,7 @@ files:
80
80
  - README.md
81
81
  - exe/rocksky-console
82
82
  - lib/rocksky.rb
83
+ - lib/rocksky/equalizer.rb
83
84
  - lib/rocksky/filter.rb
84
85
  - lib/rocksky/library.rb
85
86
  - lib/rocksky/manifest.json