voicemeeter 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 07bc7810c8539267babd1a0ac6c1dc929e37b237f8b65b96d60ee2d6a823a0b5
4
- data.tar.gz: 79c662a5e0b36a3787f4eb27d90892624a0990d3347165d7a6e036ee031ae9cc
3
+ metadata.gz: e3b54899e83b3462fbe37aeaf0650998d5071de096e10ffbab7175fe72ae8d7a
4
+ data.tar.gz: 6383c43139954ff774b74b8d1566c233ae4939021b99071422473765295d0c62
5
5
  SHA512:
6
- metadata.gz: 5819aac96ad967b7da5195b8ada670825be2720a57ff70a540718c53cde98814f51154aec79ffa903269f39a12e12f27a87bd682f83545946119320203b65c58
7
- data.tar.gz: 3c248695fcd6ab4f47582dc77c1bb2ad7d66dd08ef152261cdcacd268d7a65ed15c92749f3dafdf21256f044772b2a1dd90e767d9bf152edfee30c909afaf8ff
6
+ metadata.gz: 886a45d632d42562b743123c5f19b7127d7655aa49b708cb2f0aa748db8fea6367f78f9c5719b7c11a8a0acb9ddaea2b4d94442720897d536cb305c3fb1c03f9
7
+ data.tar.gz: '08de65bd94561a463f457eeefee2badf434b3720a5121f8123e6c709c9c60cab10a8ac75deca54f307bdd428c0d9f528b4abdf80b83b5793309d42a824ad26e3'
data/CHANGELOG.md CHANGED
@@ -11,6 +11,12 @@ Before any major/minor/patch is released all unit tests will be run to verify th
11
11
 
12
12
  - [ ]
13
13
 
14
+ ## [1.1.0] - 2023-06-28
15
+
16
+ ### Added
17
+
18
+ - Configurable kwarg `login_timeout`, defaults to 2s.
19
+
14
20
  ## [1.0.1] - 2023-09-14
15
21
 
16
22
  ### Added
data/README.md CHANGED
@@ -10,9 +10,9 @@ For an outline of past/future changes refer to: [CHANGELOG](CHANGELOG.md)
10
10
 
11
11
  ## Tested against
12
12
 
13
- - Basic 1.0.8.8
14
- - Banana 2.0.6.8
15
- - Potato 3.0.2.8
13
+ - Basic 1.1.1.1
14
+ - Banana 2.1.1.1
15
+ - Potato 3.1.1.1
16
16
 
17
17
  ## Requirements
18
18
 
@@ -630,7 +630,7 @@ vm.vban.outstream[0].apply(on: true, name: "streamname", bit: 24)
630
630
 
631
631
  `vm.apply_config(<configname>)`
632
632
 
633
- You may load config files in TOML format.
633
+ You may load config files in YAML format.
634
634
  Three example configs have been included with the package. Remember to save
635
635
  current settings before loading a config. To set one you may do:
636
636
 
@@ -639,7 +639,7 @@ require "voicemeeter"
639
639
  Voicemeeter::Remote.new(:banana).run { |vm| vm.apply_config(:example) }
640
640
  ```
641
641
 
642
- will load a config file at mydir/configs/banana/example.toml for Voicemeeter Banana.
642
+ will load a config file at mydir/configs/banana/example.yml for Voicemeeter Banana.
643
643
 
644
644
  ## Events
645
645
 
@@ -750,7 +750,7 @@ vm.set("Strip[0].Gain", -3.6)
750
750
  - The following attributes are available:
751
751
  - `fn_name`: name of the C-API function that failed.
752
752
  - `code`: error code.
753
- - For a full list of error codes [check the VoicemeeterRemote header file][voicemeeter remote header].
753
+ - For a full list of error codes check the [VoicemeeterRemote header file][voicemeeter remote header].
754
754
 
755
755
  ### Logging
756
756
 
@@ -772,9 +772,9 @@ Bundle exec rake
772
772
 
773
773
  ### Official Documentation
774
774
 
775
- - [Voicemeeter Remote C API](https://github.com/onyx-and-iris/Voicemeeter-SDK/blob/update-docs/VoicemeeterRemoteAPI.pdf)
775
+ - [Voicemeeter Remote C API](https://github.com/onyx-and-iris/Voicemeeter-SDK/blob/main/VoicemeeterRemoteAPI.pdf)
776
776
 
777
777
  [license]: https://github.com/onyx-and-iris/voicemeeter-rb/blob/dev/LICENSE
778
- [voicemeeter remote header]: https://github.com/onyx-and-iris/Voicemeeter-SDK/blob/update-docs/VoicemeeterRemote.h
778
+ [voicemeeter remote header]: https://github.com/onyx-and-iris/Voicemeeter-SDK/blob/main/VoicemeeterRemote.h
779
779
  [code style]: https://img.shields.io/badge/code_style-standard-violet.svg
780
780
  [gem version]: https://badge.fury.io/rb/voicemeeter.svg
@@ -4,18 +4,21 @@ module Voicemeeter
4
4
  include Logging
5
5
  include Worker
6
6
  include Events::Director
7
+ prepend Util::Timeout
7
8
  prepend Util::Cache
8
9
 
9
10
  attr_reader :kind, :midi, :event, :delay, :cache
10
11
 
11
12
  RATELIMIT = 0.033
12
13
  DELAY = 0.001
14
+ LOGIN_TIMEOUT = 2
13
15
 
14
16
  def initialize(kind, **kwargs)
15
17
  @kind = kind
16
18
  @sync = kwargs[:sync] || false
17
19
  @ratelimit = kwargs[:ratelimit] || RATELIMIT
18
20
  @delay = kwargs[:delay] || DELAY
21
+ @login_timeout = kwargs[:login_timeout] || LOGIN_TIMEOUT
19
22
  @event =
20
23
  Events::Tracker.new(
21
24
  **(kwargs.select { |k, _| %i[pdirty mdirty ldirty midi].include? k })
@@ -30,8 +33,6 @@ module Voicemeeter
30
33
 
31
34
  def login
32
35
  CBindings.call(:bind_login, ok: [0, 1]) == 1 and run_voicemeeter(kind.name)
33
- clear_dirty
34
- logger.info "Successfully logged into #{self} version #{version}"
35
36
  end
36
37
 
37
38
  def logout
@@ -72,7 +73,6 @@ module Voicemeeter
72
73
  logger.debug "Voicemeeter engine running but the GUI appears to be down... launching."
73
74
  end
74
75
  CBindings.call(:bind_run_voicemeeter, kinds[kind_id])
75
- sleep(1)
76
76
  end
77
77
 
78
78
  def type
@@ -18,6 +18,26 @@ module Voicemeeter
18
18
  end
19
19
  end
20
20
 
21
+ module Timeout
22
+ def login
23
+ super
24
+
25
+ err = nil
26
+ start = Time.now
27
+ begin
28
+ sleep 0.1
29
+ logger.info "Successfully logged into #{self} version #{version}"
30
+ logger.debug "login time: #{(Time.now - start).round(2)}"
31
+ err = nil
32
+ rescue Errors::VMCAPIError => e
33
+ err = e
34
+ retry if Time.now < start + @login_timeout
35
+ end
36
+ raise Errors::VMError.new "Timeout logging into the api" if err
37
+ clear_dirty
38
+ end
39
+ end
40
+
21
41
  module Cache
22
42
  def get(name, is_string = false)
23
43
  return cache.delete(name) if cache.key? name
@@ -7,11 +7,11 @@ module Voicemeeter
7
7
  end
8
8
 
9
9
  def minor
10
- 0
10
+ 1
11
11
  end
12
12
 
13
13
  def patch
14
- 1
14
+ 0
15
15
  end
16
16
 
17
17
  def to_a
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: voicemeeter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - onyx_online
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-14 00:00:00.000000000 Z
11
+ date: 2024-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi