voicemeeter_api_ruby 3.0.0 → 4.1.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: 74364d7c7210a1b080f7903862f4a1811105a3b7cb69fb572cbc729325e577ca
4
- data.tar.gz: 87289218250b0177ed6064777edf199f02d40c69d84458185d6cff5f798d2fe0
3
+ metadata.gz: e456329651c6151ed9756893125b802c099733fcefe64db8259f933539ee0587
4
+ data.tar.gz: 2d93a67a6f476d2ec173a267f479ecf5be9c6e333ead5a891e0f5ac1fbc74541
5
5
  SHA512:
6
- metadata.gz: be94880faab9294919932abc5b1dc61177798f60deb2847c7672e6be0e7ca6dcc770e0a70983ab003ca098d8b08705b397ca3db3062b0756534dc881e5ed5725
7
- data.tar.gz: 46f0cc75b33f53a4b35ac4f72064ac75f88dca55437b8c5727ae44c615bc0207546c9af8b9d83846750b777e186dc364008033b19c6688dfc55743ed73da2f9d
6
+ metadata.gz: dd26be5c5387a6c0ac1ca97d9c99e943205e05c76418e041d776e5fef6268a6a488bf98d63c10fc886e82469b5df140c5e0e8ea563b5ef955be878859b0f92b5
7
+ data.tar.gz: 5b04f810179c775e861b6ee1e79415d960ef9a7aac2cab490bd1b21019169b950cba869a9e0dc6a363fa9d9ceeb01dd27e93335b325aeeb934336f5f0700472c
data/CHANGELOG.md CHANGED
@@ -5,13 +5,51 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- Before any major/minor/patch is released all test units will be run to verify they pass.
8
+ Before any major/minor/patch is released all unit tests will be run to verify they pass.
9
9
 
10
10
  ## [Unreleased] - These changes have not been added to RubyGems yet
11
11
 
12
- - [ ] Update Readme for version 3 changes.
12
+ - [ ] add xy parameters to strip/bus
13
13
 
14
- ## [3.0.0] - 2022-01-24
14
+ ## [4.1.0] - 2022-07-19
15
+
16
+ ### Added
17
+
18
+ - Conversion module in meta
19
+ - strip/bus levels implemented, ldirty added to notifications.
20
+
21
+ ### Changed
22
+
23
+ - 1, 0 switched for true false in example configs
24
+ - observer example updated.
25
+ - minor version bump
26
+
27
+ ### Removed
28
+
29
+ - Boolean class monkey patch
30
+ - type checks
31
+
32
+ ## [4.0.0] - 2022-06-27
33
+
34
+ ### Added
35
+
36
+ - type, version added to base class
37
+ - device class implemented
38
+ - TOMLStrBuilder added to config, builds a default reset config
39
+ - support for observers to subscribe to updates
40
+ - observer example added
41
+ - device, sr, sel added to bus
42
+ - audibility, bass, mid, treble added to strip
43
+
44
+ ### Changed
45
+
46
+ - common interface iremote defined
47
+ - configs reworked. configs are now loaded lazily.
48
+ - command.reset now applies reset config from toml parser.
49
+ - profiles dir renamed to configs
50
+ - major version bump due to non-backwards compatible changes
51
+
52
+ ## [3.0.0] - 2022-05-03
15
53
 
16
54
  ### Added
17
55
 
@@ -171,7 +209,7 @@ README is up to date with version 2.0.2 onwards.
171
209
 
172
210
  ### Added
173
211
 
174
- - Added base0 test units for alias functions. This includes:
212
+ - Added base0 unit tests for alias functions. This includes:
175
213
  SetParamMultiBase0
176
214
  MacroButtonStatusWithAliasBase0
177
215
  SetParamMultiWithAliasBase0
@@ -185,7 +223,7 @@ README is up to date with version 2.0.2 onwards.
185
223
 
186
224
  ### Added
187
225
 
188
- - Base0 test units for each type.
226
+ - Base0 unit tests for each type.
189
227
  - README updated to demonstrate set_multi, Macrobutton commands,
190
228
  Special commands and a brief description on how to run tests.
191
229
 
@@ -215,7 +253,7 @@ README is up to date with version 2.0.2 onwards.
215
253
 
216
254
  ### Added
217
255
 
218
- - test/<vbtype>/errors/errors_minitest.rb test unit files added to test
256
+ - test/<vbtype>/errors/errors_minitest.rb unit test files added to test
219
257
  custom error classes for each type of voicemeeter. Errors tests:
220
258
  APIError
221
259
  LoginError
@@ -267,5 +305,5 @@ README is up to date with version 2.0.2 onwards.
267
305
 
268
306
  - Initial Commit
269
307
  - Core of API
270
- - Test units
308
+ - Unit tests
271
309
  - README.md
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/onyx-and-iris/voicemeeter-api-ruby/blob/dev/LICENSE)
2
2
  [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/plugin-ruby)
3
3
  ![tests: failed count](https://img.shields.io/badge/dynamic/json?color=blue&label=tests&query=summary.failure_count&suffix=%20failed&url=https%3A%2F%2Fraw.githubusercontent.com%2Fonyx-and-iris%2Fvoicemeeter-api-ruby%2Fdev%2Fspec%2Frspec.json)
4
+ [![Gem Version](https://badge.fury.io/rb/voicemeeter_api_ruby.svg)](https://badge.fury.io/rb/voicemeeter_api_ruby)
5
+ ![](https://ruby-gem-downloads-badge.herokuapp.com/voicemeeter_api_ruby?type=total&color=red)
4
6
 
5
7
  # Ruby Wrapper for Voicemeeter API
6
8
 
@@ -21,30 +23,25 @@ For an outline of past/future changes refer to: [CHANGELOG](CHANGELOG.md)
21
23
 
22
24
  ## Installation
23
25
 
24
- ### Gem
25
-
26
- Install voicemeeter_api_ruby gem from your console
27
-
28
- `gem install voicemeeter_api_ruby`
29
-
30
26
  ### Bundler
31
27
 
32
28
  Put this in your Gemfile:
33
29
 
34
- `gem 'voicemeeter_api_ruby', require: false`
30
+ `gem 'voicemeeter_api_ruby'`
31
+
32
+ ### Gem
35
33
 
36
- or use bundlers built in git functionality:
34
+ Install voicemeeter_api_ruby gem from your console
37
35
 
38
- `gem "voicemeeter_api_ruby", :git => "git://github.com/onyx-and-iris/voicemeeter-api-ruby"`
36
+ `gem install 'voicemeeter_api_ruby'`
39
37
 
40
38
  ## `Use`
41
39
 
42
- Simplest use case, request a Remote class of a kind, then pass a block to run:
40
+ Simplest use case, request a Remote class of a kind, then pass a block to run.
43
41
 
44
- as gem:
45
- `ruby .\main.rb`
46
- with bundler:
47
- `bundle exec ruby .\main.rb`
42
+ Login and logout are handled for you in this scenario.
43
+
44
+ #### `main.rb`
48
45
 
49
46
  ```ruby
50
47
  require 'voicemeeter'
@@ -54,21 +51,21 @@ kind_id = 'banana'
54
51
  # start Voicemeeter GUI
55
52
  Voicemeeter.start(kind_id)
56
53
 
57
- vmr = Voicemeeter.remote(kind_id)
54
+ vm = Voicemeeter.remote(kind_id)
58
55
 
59
- # vmr.run accepts a block
60
- vmr.run do
56
+ # vm.run accepts a block
57
+ vm.run do
61
58
  # mute the leftmost strip
62
- vmr.strip[0].mute = true
63
- puts vmr.strip[0].mute
59
+ vm.strip[0].mute = true
60
+ puts vm.strip[0].mute
64
61
 
65
62
  # disable eq for second from left bus
66
- vmr.bus[1].eq = false
67
- puts vmr.bus[1].eq
63
+ vm.bus[1].eq = false
64
+ puts vm.bus[1].eq
68
65
  end
69
66
  ```
70
67
 
71
- Login and logout are handled for you in this scenario.
68
+ Otherwise you must remember to call `vm.login` `vm.logout` at the start/end of your code.
72
69
 
73
70
  ## `kind_id`
74
71
 
@@ -80,18 +77,90 @@ Pass the kind of Voicemeeter as an argument. kind_id may be:
80
77
 
81
78
  ## `Available commands`
82
79
 
83
- ### Channels (strip/bus)
80
+ ### Strip
84
81
 
85
- The following properties exist for audio channels.
82
+ The following properties are available.
86
83
 
87
84
  - `mono`: boolean
85
+ - `solo`: boolean
88
86
  - `mute`: boolean
89
- - `gain`: float, from -60 to 12
90
- - `mc`, `k`: boolean
91
- - `comp`, `gate`: float, from 0 to 10
87
+ - `gain`: float, from -60.0 to 12.0
88
+ - `comp`: float, from 0.0 to 10.0
89
+ - `gate`: float, from 0.0 to 10.0
90
+ - `audibility`: float, from 0.0 to 10.0
92
91
  - `limit`: int, from -40 to 12
93
92
  - `A1 - A5`, `B1 - B3`: boolean
93
+ - `label`: string
94
+ - `device`: string
95
+ - `sr`: int
96
+ - `mc`: boolean
97
+ - `k`: int, from 0 to 4
98
+ - `bass`: float, from -12.0 to 12.0
99
+ - `mid`: float, from -12.0 to 12.0
100
+ - `treble`: float, from -12.0 to 12.0
101
+
102
+ example:
103
+
104
+ ```ruby
105
+ vm.strip[3].gain = 3.7
106
+ puts vm.strip[0].label
107
+ ```
108
+
109
+ The following methods are available.
110
+
111
+ - `appgain(name, value)`: string, float, from 0.0 to 1.0
112
+
113
+ Set the gain in db by value for the app matching name.
114
+
115
+ - `appmute(name, value)`: string, bool
116
+
117
+ Set mute state as value for the app matching name.
118
+
119
+ example:
120
+
121
+ ```ruby
122
+ vm.strip[5].appgain('Spotify', 0.5)
123
+ vm.strip[5].appmute('Spotify', true)
124
+ ```
125
+
126
+ ##### Gainlayers
127
+
128
+ - `gain`: float, from -60.0 to 12.0
129
+
130
+ example:
131
+
132
+ ```ruby
133
+ vm.strip[3].gainlayer[3].gain = 3.7
134
+ ```
135
+
136
+ Gainlayers are defined for potato version only.
137
+
138
+ ##### Levels
139
+
140
+ The following properties are available.
141
+
142
+ - `prefader`
143
+ - `postfader`
144
+ - `postmute`
145
+
146
+ example:
147
+
148
+ ```ruby
149
+ puts vm.strip[3].levels.prefader
150
+ ```
151
+
152
+ Level properties will return -200.0 if no audio detected.
153
+
154
+ ### Bus
155
+
156
+ The following properties are available.
157
+
158
+ - `mono`: boolean
159
+ - `mute`: boolean
94
160
  - `eq`: boolean
161
+ - `eq_ab`: boolean
162
+ - `sel`: boolean
163
+ - `gain`: float, from -60.0 to 12.0
95
164
  - `label`: string
96
165
  - `device`: string
97
166
  - `sr`: int
@@ -99,10 +168,60 @@ The following properties exist for audio channels.
99
168
  example:
100
169
 
101
170
  ```ruby
102
- vmr.strip[3].gain = 3.7
103
- puts strip[0].label
171
+ vm.bus[3].gain = 3.7
172
+ puts vm.bus[0].label
104
173
 
105
- vmr.bus[4].mono = true
174
+ vm.bus[4].mono = true
175
+ ```
176
+
177
+ ##### Modes
178
+
179
+ - `normal`: boolean
180
+ - `amix`: boolean
181
+ - `bmix`: boolean
182
+ - `composite`: boolean
183
+ - `tvmix`: boolean
184
+ - `upmix21`: boolean
185
+ - `upmix41`: boolean
186
+ - `upmix61`: boolean
187
+ - `centeronly`: boolean
188
+ - `lfeonly`: boolean
189
+ - `rearonly`: boolean
190
+
191
+ example:
192
+
193
+ ```ruby
194
+ vm.bus[4].mode.amix = true
195
+ ```
196
+
197
+ ##### Levels
198
+
199
+ The following properties are available.
200
+
201
+ - `all`
202
+
203
+ example:
204
+
205
+ ```ruby
206
+ puts vm.bus[0].levels.all
207
+ ```
208
+
209
+ `levels.all` will return -200.0 if no audio detected.
210
+
211
+ ### Strip | Bus
212
+
213
+ The following methods are Available
214
+
215
+ - `fadeto(amount, time)`: float, int
216
+ - `fadeby(amount, time)`: float, int
217
+
218
+ Modify gain to or by the selected amount in db over a time interval in ms.
219
+
220
+ example:
221
+
222
+ ```ruby
223
+ vm.strip[0].fadeto(-10.3, 1000)
224
+ vm.bus[3].fadeby(-5.6, 500)
106
225
  ```
107
226
 
108
227
  ### Macrobuttons
@@ -116,12 +235,18 @@ Three modes defined: state, stateonly and trigger.
116
235
  example:
117
236
 
118
237
  ```ruby
119
- vmr.button[37].state = true
120
- vmr.button[55].trigger = false
238
+ vm.button[37].state = true
239
+ vm.button[55].trigger = false
121
240
  ```
122
241
 
123
242
  ### Recorder
124
243
 
244
+ The following properties accept boolean values.
245
+
246
+ - `loop`: boolean
247
+ - `A1 - A5`: boolean
248
+ - `B1 - A3`: boolean
249
+
125
250
  The following methods are Available
126
251
 
127
252
  - `play`
@@ -130,34 +255,31 @@ The following methods are Available
130
255
  - `record`
131
256
  - `ff`
132
257
  - `rew`
133
- The following properties accept boolean values.
134
- - `loop`: boolean
135
- - `A1 - A5`: boolean
136
- - `B1 - A3`: boolean
137
- Load accepts a string:
138
- - `load`: string
258
+ - `load(filepath)`: string
139
259
 
140
260
  example:
141
261
 
142
262
  ```ruby
143
- vmr.recorder.play
144
- vmr.recorder.stop
263
+ vm.recorder.play
264
+ vm.recorder.stop
145
265
 
146
266
  # Enable loop play
147
- vmr.recorder.loop = True
267
+ vm.recorder.loop = True
148
268
 
149
269
  # Disable recorder out channel B2
150
- vmr.recorder.B2 = False
270
+ vm.recorder.B2 = False
151
271
 
152
272
  # filepath as string
153
- vmr.recorder.load('C:\music\mytune.mp3')
273
+ vm.recorder.load('C:\music\mytune.mp3')
154
274
  ```
155
275
 
156
276
  ### VBAN
157
277
 
158
- - `vmr.vban.enable` `vmr.vban.disable` Turn VBAN on or off
278
+ - `vm.vban.enable` `vm.vban.disable` Turn VBAN on or off
159
279
 
160
- For each vban in/out stream the following properties are defined:
280
+ ##### Instream | Outstream
281
+
282
+ The following properties are available.
161
283
 
162
284
  - `on`: boolean
163
285
  - `name`: string
@@ -175,13 +297,13 @@ example:
175
297
 
176
298
  ```ruby
177
299
  # turn VBAN on
178
- vmr.vban.enable
300
+ vm.vban.enable
179
301
 
180
302
  # turn on vban instream 0
181
- vmr.vban.instream[0].on = True
303
+ vm.vban.instream[0].on = True
182
304
 
183
305
  # set bit property for outstream 3 to 24
184
- vmr.vban.outstream[3].bit = 24
306
+ vm.vban.outstream[3].bit = 24
185
307
  ```
186
308
 
187
309
  ### Command
@@ -200,8 +322,19 @@ The following properties are write only and accept boolean values.
200
322
  example:
201
323
 
202
324
  ```ruby
203
- vmr.command.restart
204
- vmr.command.showvbanchat = true
325
+ vm.command.restart
326
+ vm.command.showvbanchat = true
327
+ ```
328
+
329
+ ### Device
330
+
331
+ - `ins` `outs` : Returns the number of input/output devices
332
+ - `input(i)` `output(i)` : Returns a hash of device properties for device[i]
333
+
334
+ example:
335
+
336
+ ```ruby
337
+ vm.run { (0...vm.device.ins).each { |i| puts vm.device.input(i) } }
205
338
  ```
206
339
 
207
340
  ### Multiple parameters
@@ -210,7 +343,7 @@ vmr.command.showvbanchat = true
210
343
  Set many strip/bus/macrobutton/vban parameters at once, for example:
211
344
 
212
345
  ```ruby
213
- vmr.set_multi(
346
+ vm.set_multi(
214
347
  {
215
348
  strip_0: {
216
349
  mute: true,
@@ -235,30 +368,46 @@ vmr.set_multi(
235
368
  Or for each class you may do:
236
369
 
237
370
  ```ruby
238
- vmr.strip[0].set_multi(mute: true, gain: 3.2, A1: true)
239
- vmr.vban.outstream[0].set_multi(on: true, name: 'streamname', bit: 24)
371
+ vm.strip[0].set_multi(mute: true, gain: 3.2, A1: true)
372
+ vm.vban.outstream[0].set_multi(on: true, name: 'streamname', bit: 24)
373
+ ```
374
+
375
+ ## Config Files
376
+
377
+ `vm.set_config(<configname>)`
378
+
379
+ You may load config files in TOML format.
380
+ Three example configs have been included with the package. Remember to save
381
+ current settings before loading a config. To set one you may do:
382
+
383
+ ```ruby
384
+ require 'voicemeeter'
385
+ vm = Voicemeeter.remote('banana')
386
+ vm.run { vm.set_config('example') }
240
387
  ```
241
388
 
389
+ will load a config file at configs/banana/example.toml for Voicemeeter Banana.
390
+
242
391
  ## `Voicemeeter Module`
243
392
 
244
393
  ### Remote class
245
394
 
246
395
  Access to lower level Getters and Setters are provided with these functions:
247
396
 
248
- - `vmr.get(param, string=false)`: For getting the value of any parameter. Set string to true if getting a property value expected to return a string.
249
- - `vmr.set(param, value)`: For setting the value of any parameter.
397
+ - `vm.get(param, string=false)`: For getting the value of any parameter. Set string to true if getting a property value expected to return a string.
398
+ - `vm.set(param, value)`: For setting the value of any parameter.
250
399
 
251
400
  Access to lower level polling functions are provided with these functions:
252
401
 
253
- - `vmr.pdirty?`: Returns true if a parameter has been updated.
254
- - `vmr.mdirty?`: Returns true if a macrobutton has been updated.
402
+ - `vm.pdirty?`: Returns true if a parameter has been updated.
403
+ - `vm.mdirty?`: Returns true if a macrobutton has been updated.
255
404
 
256
405
  example:
257
406
 
258
407
  ```ruby
259
- vmr.get('Strip[2].Mute')
260
- vmr.set('Strip[4].Label', 'stripname')
261
- vmr.set('Strip[0].Gain', -3.6)
408
+ vm.get('Strip[2].Mute')
409
+ vm.set('Strip[4].Label', 'stripname')
410
+ vm.set('Strip[0].Gain', -3.6)
262
411
  ```
263
412
 
264
413
  #### Voicemeeter::start
@@ -271,24 +420,6 @@ require 'voicemeeter'
271
420
  Voicemeeter.start('banana')
272
421
  ```
273
422
 
274
- ## Config Files
275
-
276
- `vmr.set_profile('config')`
277
-
278
- You may load config files in TOML format.
279
- Three example profiles have been included with the package. Remember to save
280
- current settings before loading a profile. To test them simply rename \_profiles
281
- directory to profiles. They will be loaded into memory but not set. To set one
282
- you may do:
283
-
284
- ```ruby
285
- require 'voicemeeter'
286
- vmr = Voicemeeter.remote('banana')
287
- vmr.run { vmr.set_profile('config') }
288
- ```
289
-
290
- will load a config file at profiles/banana/config.toml for Voicemeeter Banana.
291
-
292
423
  ### Run tests
293
424
 
294
425
  To run all tests:
@@ -305,4 +436,4 @@ Bundle exec rspec --tag 'higher'
305
436
 
306
437
  ### Official Documentation
307
438
 
308
- - [Voicemeeter Remote C API](https://forum.vb-audio.com/viewtopic.php?f=8&t=346)
439
+ - [Voicemeeter Remote C API](https://github.com/onyx-and-iris/Voicemeeter-SDK/blob/main/VoicemeeterRemoteAPI.pdf)