voicemeeter_api_ruby 2.0.4 → 3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: feb89f841882b2ece4f1bc959c8a5a728a738b054798635d2937ff9dceacf37c
4
- data.tar.gz: 382ba6af1cde36e8b450d0549e383f9e6c68040d8385923ec8b2c413ddfc3d1b
3
+ metadata.gz: 74364d7c7210a1b080f7903862f4a1811105a3b7cb69fb572cbc729325e577ca
4
+ data.tar.gz: 87289218250b0177ed6064777edf199f02d40c69d84458185d6cff5f798d2fe0
5
5
  SHA512:
6
- metadata.gz: 719e6d87cf5514dc7d759bdf15bf75ae32a533686894c172e4c1d4151dc2b7c480e8967a0d0d41a4187a0df2ff7f4094a3bc9520f86cf7f75c0604f00b711b7e
7
- data.tar.gz: 728b8458b2897592282c24b944a0d1a3dca0af14791c0c3c73a1d1eb474a9462f4f24eecd5aa3caad2fec024f111998dedac8e057b5d092f727a763feda6ab5e
6
+ metadata.gz: be94880faab9294919932abc5b1dc61177798f60deb2847c7672e6be0e7ca6dcc770e0a70983ab003ca098d8b08705b397ca3db3062b0756534dc881e5ed5725
7
+ data.tar.gz: 46f0cc75b33f53a4b35ac4f72064ac75f88dca55437b8c5727ae44c615bc0207546c9af8b9d83846750b777e186dc364008033b19c6688dfc55743ed73da2f9d
data/CHANGELOG.md ADDED
@@ -0,0 +1,271 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ Before any major/minor/patch is released all test units will be run to verify they pass.
9
+
10
+ ## [Unreleased] - These changes have not been added to RubyGems yet
11
+
12
+ - [ ] Update Readme for version 3 changes.
13
+
14
+ ## [3.0.0] - 2022-01-24
15
+
16
+ ### Added
17
+
18
+ - Added strip_levels, bus_levels to base class. They return the entire level array (before math conversion).
19
+ - Added fadeto, fadeby methods for strips/buses.
20
+ - Added appgain, appmute methods to Virtualstrip class
21
+ - Bus modes added to bus class.
22
+ - Gainlayers added to strip class.
23
+ - Added pre-commit.ps1 for git hook
24
+ - cdll proc object added to base class. This is now used to call a c dll function.
25
+ - hide method added to command class
26
+
27
+ ### Changed
28
+
29
+ - Kinds, Profiles moved into their own modules.
30
+ - Kind maps now defined as structs.
31
+ - Randomised unit tests. A single run may test any kind.
32
+ - Polling paramters now defined as single line endless functions
33
+ - Major version bump due to backwards incompatible changes. Ruby required version changed.
34
+
35
+ ### Fixed
36
+
37
+ - Minor delay added before logout, allow a final operation to complete.
38
+ - Polling function sped up, sync kwarg added.
39
+
40
+ ### Removed
41
+
42
+ - Removed bounds checking for certain strip/bus properties.
43
+
44
+ ## [2.0.4] - 2022-01-24
45
+
46
+ ### Added
47
+
48
+ - Ability to load config files in TOML format
49
+ - Add option to pass keyword arguments to Remote class.
50
+ - Voicemeeter.start added for starting voicemeeter independently of Remote class
51
+
52
+ ### Changed
53
+
54
+ - Use of VBVMR_RunVoicemeeter instead of open3 when starting voicemeeter.
55
+ - Functions in low level modules set to private.
56
+ - version 2.0.4 added to RubyGems.
57
+
58
+ ### Fixed
59
+
60
+ - Fix timing issue affecting macrobutton multi_set
61
+
62
+ ## [2.0.3] - 2022-01-20
63
+
64
+ ### Added
65
+
66
+ - runmany.ps1 added. easy access to many test runs with logging and summary file.
67
+ - link to official documentation in readme.
68
+ - section regarding lower level functions, setters, getters and polling functions added to readme.
69
+
70
+ ### Changed
71
+
72
+ - Adjustment to polling function, now accepts getter logic as a block. Param caching
73
+ now done in polling function
74
+ - Small delay added to setters, except for set_parameter_multi function.
75
+ - Added initialize to Remote class, building of class objects done now done in Remote.
76
+ - version 2.0.3 added to RubyGems.
77
+
78
+ ### Fixed
79
+
80
+ - Fixed an issue with the action type property meta function in Command class.
81
+ - Added ensure logout if block passed to run, will logout regardless of exception raised.
82
+
83
+ ## [2.0.2] - 2022-01-18
84
+
85
+ ### IMPORTANT
86
+
87
+ The code for this wrapper has been revised and reworked from the ground up. Earlier versions
88
+ are still available for download on RubyGems.org but that version will not be updated further.
89
+ Most of the updates documented here do not apply to version 2.0 onwards but will be kept for
90
+ reference use only.
91
+
92
+ All of the core features including strip, bus, macrobutton, recorder, vban and command classes
93
+ work exactly the same. An effort has been made to include every property previously available,
94
+ for each of those classes.
95
+
96
+ README is up to date with version 2.0.2 onwards.
97
+
98
+ ### Added
99
+
100
+ - Special command lock added
101
+ - showvbanchat chat is now a boolean function.
102
+ - Functions vmr.vban.enable and vmr.vban.disable for toggling VBAN now added.
103
+
104
+ ### Changed
105
+
106
+ - Each class for each of the core features has been put into its own module. Classes such as
107
+ strip, bus and vban are now subclassed into physical/virtual and instream/outstream respectively.
108
+ - Error classes have been simplified into a smaller number of classes.
109
+ - remote class is now callable through Voicemeeter module. It is also now a factory function that
110
+ returns a Remote class for the kind of Voicemeeter specified by the user.
111
+ - Rake tests now simplified and reduced. They are now organised into higher and lower tests.
112
+
113
+ ### Fixed
114
+
115
+ - Writer validation logic has been moved into meta module. There is a base module for generic
116
+ meta functions but where appropriate this is mixed in with a submodule.
117
+ - set_multi function for setting many parameters at once now uses tokens for hash keys.
118
+ - Polling dirty parameters works similarly but the cache is purged upon successful fetch.
119
+
120
+ ---
121
+
122
+ ## [1.0.10] - 2021-05-12
123
+
124
+ ### Added
125
+
126
+ - More settable commands for VBAN parameters
127
+
128
+ ### Changed
129
+
130
+ - Update unit tests to reflect changes
131
+ - Updated README to reflect changes.
132
+ - define_types moved into utils.rb since it defines types for channels,
133
+ macrobuttons and vban
134
+ - number set int and real_number added to utils.rb to better define different
135
+ value types.
136
+
137
+ ### Fixed
138
+
139
+ - Alias functions that accept boolean values now return true or false
140
+ - Bug in boundary test fixed by resetting match attributes m1,m2,m3 if no current match found
141
+
142
+ ## [1.0.9] - 2021-04-30
143
+
144
+ ### Added
145
+
146
+ - Support for other types of parameters in multi_set
147
+ - Automate running of every test for every version
148
+ - Settable delay before logout to avoid race condition on last command
149
+ - Delay for save/load special commands is now settable.
150
+ - Delay for shutdown special command is now settable.
151
+
152
+ ### Changed
153
+
154
+ - Remote subclass moved into 'voicemeeter.rb'.
155
+ - All tests updated to reflect changes.
156
+ - Updated README to reflect changes.
157
+
158
+ ## [1.0.8] - 2021-04-18
159
+
160
+ ### Added
161
+
162
+ - Several attributes that define delays within the wrapper are now settable. This includes:
163
+ setdelay - A delay between each call to a setter
164
+ getdelay - A delay between each call to a getter
165
+ rundelay - A delay after the function runvb. (which starts Voicemeeter if a type is passed to Remote as an argument)
166
+ - Constants now define default values for delays:
167
+ ACCESSOR_DELAY = 0.001
168
+ RUNDELAY = 1
169
+
170
+ ## [1.0.7] - 2021-04-18
171
+
172
+ ### Added
173
+
174
+ - Added base0 test units for alias functions. This includes:
175
+ SetParamMultiBase0
176
+ MacroButtonStatusWithAliasBase0
177
+ SetParamMultiWithAliasBase0
178
+ -Added test/<vbtype>/minitest_helper_base0.rb to call multiple parameters with base0 index.
179
+
180
+ ### Changed
181
+
182
+ -Test types multi, base0 can now be isolated. Params added to runmany to call these tests.
183
+
184
+ ## [1.0.6] - 2021-04-18
185
+
186
+ ### Added
187
+
188
+ - Base0 test units for each type.
189
+ - README updated to demonstrate set_multi, Macrobutton commands,
190
+ Special commands and a brief description on how to run tests.
191
+
192
+ ### Changed
193
+
194
+ - Validate moved into Utils module. Since this no longer exclusively boundary tests params pertaining to strips/buses it seems appropriate to move this to a more generic module.
195
+
196
+ ### Fixed
197
+
198
+ - Fixed an error in unit tests that prevented potato:macros from passing due
199
+ to loading different minitest_helpers from base0 tests. Test unit files that match
200
+ macrobutton_status\*.rb are now isolated.
201
+ - Blueprint layout :composite and :patch_insert absolute values fixed.
202
+
203
+ ## [1.0.5] - 2021-04-17
204
+
205
+ ### Added
206
+
207
+ - VBAN commands:
208
+ vban - Turn vban on/off
209
+ vban.enable - Turn off an instream/oustream
210
+ - Output channels settable for recorder commands eg:
211
+ recorder.A1
212
+ recorder.B3
213
+
214
+ ## [1.0.4] - 2021-04-17
215
+
216
+ ### Added
217
+
218
+ - test/<vbtype>/errors/errors_minitest.rb test unit files added to test
219
+ custom error classes for each type of voicemeeter. Errors tests:
220
+ APIError
221
+ LoginError
222
+ LogoutError
223
+ VBTypeError
224
+ BoundsError
225
+ CommandError
226
+ ValueTypeError
227
+
228
+ ### Changed
229
+
230
+ - Print outs for raised errors modified to include error.class as well
231
+ as the calling function. In the case of APIError the caller of the caller
232
+ is printed.
233
+
234
+ ## [1.0.3] - 2021-04-16
235
+
236
+ ### Added
237
+
238
+ - set_multi alias function for setting many parameters at once.
239
+ - test/other/set_multi.rb to demonstrate set_multi
240
+ - keyword arguments for setting various parameters on wrapper intialization
241
+
242
+ ### Changed
243
+
244
+ - spec.metadata github source code url added to gemspec
245
+
246
+ ## [1.0.1] - 2021-04-16
247
+
248
+ ### Added
249
+
250
+ - gemspec
251
+ - release on rubygems
252
+ - Special commands:
253
+ command.shutdown - Close application
254
+ command.show - Bring Voicemeeter to foreground
255
+ command.restart - Restart audio engine
256
+ command.eject - Eject file form Recorder
257
+ command.reset - Reset prams to initial state
258
+ command.save - Save a config file in xml format
259
+ command.load - Load a config file in xml format
260
+ command.showvbanchat - Bring vban chatroom to foreground
261
+
262
+ - test/other/special.rb to demonstrate a special command
263
+
264
+ ## [0.0.1] - 2021-04-16
265
+
266
+ ### Added
267
+
268
+ - Initial Commit
269
+ - Core of API
270
+ - Test units
271
+ - README.md
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Onyx and Iris
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,308 @@
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
+ [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/plugin-ruby)
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
+
5
+ # Ruby Wrapper for Voicemeeter API
6
+
7
+ This gem offers a Ruby interface for the Voicemeeter Remote C API.
8
+
9
+ For an outline of past/future changes refer to: [CHANGELOG](CHANGELOG.md)
10
+
11
+ ## Tested against
12
+
13
+ - Basic 1.0.8.2
14
+ - Banana 2.0.6.2
15
+ - Potato 3.0.2.2
16
+
17
+ ## Requirements
18
+
19
+ - [Voicemeeter](https://voicemeeter.com/)
20
+ - Ruby 3.0 or greater
21
+
22
+ ## Installation
23
+
24
+ ### Gem
25
+
26
+ Install voicemeeter_api_ruby gem from your console
27
+
28
+ `gem install voicemeeter_api_ruby`
29
+
30
+ ### Bundler
31
+
32
+ Put this in your Gemfile:
33
+
34
+ `gem 'voicemeeter_api_ruby', require: false`
35
+
36
+ or use bundlers built in git functionality:
37
+
38
+ `gem "voicemeeter_api_ruby", :git => "git://github.com/onyx-and-iris/voicemeeter-api-ruby"`
39
+
40
+ ## `Use`
41
+
42
+ Simplest use case, request a Remote class of a kind, then pass a block to run:
43
+
44
+ as gem:
45
+ `ruby .\main.rb`
46
+ with bundler:
47
+ `bundle exec ruby .\main.rb`
48
+
49
+ ```ruby
50
+ require 'voicemeeter'
51
+
52
+ kind_id = 'banana'
53
+
54
+ # start Voicemeeter GUI
55
+ Voicemeeter.start(kind_id)
56
+
57
+ vmr = Voicemeeter.remote(kind_id)
58
+
59
+ # vmr.run accepts a block
60
+ vmr.run do
61
+ # mute the leftmost strip
62
+ vmr.strip[0].mute = true
63
+ puts vmr.strip[0].mute
64
+
65
+ # disable eq for second from left bus
66
+ vmr.bus[1].eq = false
67
+ puts vmr.bus[1].eq
68
+ end
69
+ ```
70
+
71
+ Login and logout are handled for you in this scenario.
72
+
73
+ ## `kind_id`
74
+
75
+ Pass the kind of Voicemeeter as an argument. kind_id may be:
76
+
77
+ - `basic`
78
+ - `banana`
79
+ - `potato`
80
+
81
+ ## `Available commands`
82
+
83
+ ### Channels (strip/bus)
84
+
85
+ The following properties exist for audio channels.
86
+
87
+ - `mono`: boolean
88
+ - `mute`: boolean
89
+ - `gain`: float, from -60 to 12
90
+ - `mc`, `k`: boolean
91
+ - `comp`, `gate`: float, from 0 to 10
92
+ - `limit`: int, from -40 to 12
93
+ - `A1 - A5`, `B1 - B3`: boolean
94
+ - `eq`: boolean
95
+ - `label`: string
96
+ - `device`: string
97
+ - `sr`: int
98
+
99
+ example:
100
+
101
+ ```ruby
102
+ vmr.strip[3].gain = 3.7
103
+ puts strip[0].label
104
+
105
+ vmr.bus[4].mono = true
106
+ ```
107
+
108
+ ### Macrobuttons
109
+
110
+ Three modes defined: state, stateonly and trigger.
111
+
112
+ - `state`: boolean
113
+ - `stateonly`: boolean
114
+ - `trigger`: boolean
115
+
116
+ example:
117
+
118
+ ```ruby
119
+ vmr.button[37].state = true
120
+ vmr.button[55].trigger = false
121
+ ```
122
+
123
+ ### Recorder
124
+
125
+ The following methods are Available
126
+
127
+ - `play`
128
+ - `stop`
129
+ - `pause`
130
+ - `record`
131
+ - `ff`
132
+ - `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
139
+
140
+ example:
141
+
142
+ ```ruby
143
+ vmr.recorder.play
144
+ vmr.recorder.stop
145
+
146
+ # Enable loop play
147
+ vmr.recorder.loop = True
148
+
149
+ # Disable recorder out channel B2
150
+ vmr.recorder.B2 = False
151
+
152
+ # filepath as string
153
+ vmr.recorder.load('C:\music\mytune.mp3')
154
+ ```
155
+
156
+ ### VBAN
157
+
158
+ - `vmr.vban.enable` `vmr.vban.disable` Turn VBAN on or off
159
+
160
+ For each vban in/out stream the following properties are defined:
161
+
162
+ - `on`: boolean
163
+ - `name`: string
164
+ - `ip`: string
165
+ - `port`: int, range from 1024 to 65535
166
+ - `sr`: int, (11025, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000)
167
+ - `channel`: int, from 1 to 8
168
+ - `bit`: int, 16 or 24
169
+ - `quality`: int, from 0 to 4
170
+ - `route`: int, from 0 to 8
171
+
172
+ SR, channel and bit are defined as readonly for instreams. Attempting to write to those parameters will throw an error. They are read and write for outstreams.
173
+
174
+ example:
175
+
176
+ ```ruby
177
+ # turn VBAN on
178
+ vmr.vban.enable
179
+
180
+ # turn on vban instream 0
181
+ vmr.vban.instream[0].on = True
182
+
183
+ # set bit property for outstream 3 to 24
184
+ vmr.vban.outstream[3].bit = 24
185
+ ```
186
+
187
+ ### Command
188
+
189
+ Certain 'special' commands are defined by the API as performing actions rather than setting values. The following methods are available:
190
+
191
+ - `show` : Bring Voiceemeter GUI to the front
192
+ - `shutdown` : Shuts down the GUI
193
+ - `restart` : Restart the audio engine
194
+
195
+ The following properties are write only and accept boolean values.
196
+
197
+ - `showvbanchat`: boolean
198
+ - `lock`: boolean
199
+
200
+ example:
201
+
202
+ ```ruby
203
+ vmr.command.restart
204
+ vmr.command.showvbanchat = true
205
+ ```
206
+
207
+ ### Multiple parameters
208
+
209
+ - `set_multi`
210
+ Set many strip/bus/macrobutton/vban parameters at once, for example:
211
+
212
+ ```ruby
213
+ vmr.set_multi(
214
+ {
215
+ strip_0: {
216
+ mute: true,
217
+ gain: 3.2,
218
+ A1: true,
219
+ },
220
+ bus_3: {
221
+ gain: -3.2,
222
+ eq: true,
223
+ },
224
+ button_39: {
225
+ stateonly: true,
226
+ },
227
+ vban_outstream_3: {
228
+ on: true,
229
+ bit: 24,
230
+ },
231
+ },
232
+ )
233
+ ```
234
+
235
+ Or for each class you may do:
236
+
237
+ ```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)
240
+ ```
241
+
242
+ ## `Voicemeeter Module`
243
+
244
+ ### Remote class
245
+
246
+ Access to lower level Getters and Setters are provided with these functions:
247
+
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.
250
+
251
+ Access to lower level polling functions are provided with these functions:
252
+
253
+ - `vmr.pdirty?`: Returns true if a parameter has been updated.
254
+ - `vmr.mdirty?`: Returns true if a macrobutton has been updated.
255
+
256
+ example:
257
+
258
+ ```ruby
259
+ vmr.get('Strip[2].Mute')
260
+ vmr.set('Strip[4].Label', 'stripname')
261
+ vmr.set('Strip[0].Gain', -3.6)
262
+ ```
263
+
264
+ #### Voicemeeter::start
265
+
266
+ Use this function to start Voicemeeter of a kind independently of Remote class.
267
+ for example:
268
+
269
+ ```ruby
270
+ require 'voicemeeter'
271
+ Voicemeeter.start('banana')
272
+ ```
273
+
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
+ ### Run tests
293
+
294
+ To run all tests:
295
+
296
+ ```
297
+ Bundle exec rspec
298
+ ```
299
+
300
+ You can use tags to run only certain tests, for example:
301
+
302
+ ```
303
+ Bundle exec rspec --tag 'higher'
304
+ ```
305
+
306
+ ### Official Documentation
307
+
308
+ - [Voicemeeter Remote C API](https://forum.vb-audio.com/viewtopic.php?f=8&t=346)