mirror of
https://github.com/onyx-and-iris/voicemeeter-rb.git
synced 2024-11-15 15:00:46 +00:00
adds running? method
returns producer thread alive state fixes bug in strip/bus classes
This commit is contained in:
parent
81f277260a
commit
b2194c7aa3
@ -102,7 +102,7 @@ module Voicemeeter
|
||||
def getter(mode)
|
||||
convert = ->(x) { (x > 0) ? (20 * Math.log(x, 10)).round(1) : -200.0 }
|
||||
|
||||
vals = if @remote.running && @remote.event.ldirty
|
||||
vals = if @remote.running? && @remote.event.ldirty
|
||||
@remote.cache[:bus_level][@init, @offset]
|
||||
else
|
||||
(@init...@init + @offset).map { |i| @remote.get_level(mode, i) }
|
||||
|
@ -232,7 +232,7 @@ module Voicemeeter
|
||||
convert = ->(x) { (x > 0) ? (20 * Math.log(x, 10)).round(1) : -200.0 }
|
||||
|
||||
@remote.cache[:strip_mode] = mode
|
||||
vals = if @remote.running && @remote.event.ldirty
|
||||
vals = if @remote.running? && @remote.event.ldirty
|
||||
@remote.cache[:strip_level][@init, @offset]
|
||||
else
|
||||
(@init...@init + @offset).map { |i| @remote.get_level(mode, i) }
|
||||
|
@ -49,13 +49,17 @@ module Voicemeeter
|
||||
|
||||
public
|
||||
|
||||
def running?
|
||||
@producer&.alive? # safe navigation
|
||||
end
|
||||
|
||||
def init_event_threads
|
||||
que = Queue.new
|
||||
init_worker(que) and init_producer(que)
|
||||
end
|
||||
|
||||
def end_event_threads
|
||||
if @producer&.alive? # safe navigation
|
||||
if running
|
||||
@producer[:running] = false
|
||||
@producer.join
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user