update example in readme

This commit is contained in:
onyx-and-iris 2023-07-14 17:08:23 +01:00
parent cccc348378
commit 07c1c20aec

View File

@ -1,4 +1,4 @@
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/onyx-and-iris/voicemeeter-rb/blob/dev/LICENSE) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)][license]
[![Ruby Code Style](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/standardrb/standard) [![Ruby Code Style](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/standardrb/standard)
# Ruby Wrapper for Voicemeeter API # Ruby Wrapper for Voicemeeter API
@ -42,25 +42,24 @@ Login and logout are handled for you in this scenario.
```ruby ```ruby
require "voicemeeter" require "voicemeeter"
vm = Voicemeeter.remote(:banana) Voicemeeter::Remote
.new(:banana)
# vm.run accepts a block .run do |vm|
vm.run do
# mute the leftmost strip # mute the leftmost strip
vm.strip[0].mute = true vm.strip[0].mute = true
puts vm.strip[0].mute puts vm.strip[0].mute
# disable eq for second from left bus # disable eq for second from left bus
vm.bus[1].eq = false vm.bus[1].eq.on = false
puts vm.bus[1].eq puts vm.bus[1].eq.on
end end
``` ```
Otherwise you must remember to call `vm.login` `vm.logout` at the start/end of your code. Otherwise you must remember to call `vm.login` `vm.logout` at the start/end of your code.
## `kind_id` ## `KIND_ID`
Pass the kind of Voicemeeter as an argument. kind_id may be: Pass the kind of Voicemeeter as an argument. KIND_ID may be:
- `:basic` - `:basic`
- `:banana` - `:banana`
@ -557,3 +556,5 @@ Bundle exec rspec --tag 'higher'
### Official Documentation ### Official Documentation
- [Voicemeeter Remote C API](https://github.com/onyx-and-iris/Voicemeeter-SDK/blob/main/VoicemeeterRemoteAPI.pdf) - [Voicemeeter Remote C API](https://github.com/onyx-and-iris/Voicemeeter-SDK/blob/main/VoicemeeterRemoteAPI.pdf)
[license]: https://github.com/onyx-and-iris/voicemeeter-rb/blob/dev/LICENSE