add bits kwarg, for overriding type of voicemeeter GUI launched

patch bump
This commit is contained in:
onyx-and-iris 2024-06-29 10:31:27 +01:00
parent 8469351dde
commit decb8f198c
2 changed files with 12 additions and 4 deletions

View File

@ -19,6 +19,11 @@ module Voicemeeter
@ratelimit = kwargs[:ratelimit] || RATELIMIT @ratelimit = kwargs[:ratelimit] || RATELIMIT
@delay = kwargs[:delay] || DELAY @delay = kwargs[:delay] || DELAY
@login_timeout = kwargs[:login_timeout] || LOGIN_TIMEOUT @login_timeout = kwargs[:login_timeout] || LOGIN_TIMEOUT
@bits = kwargs[:bits] || 64
if ![32, 64].include? @bits
logger.warn "kwarg bits got #{@bits}, expected either 32 or 64, defaulting to 64"
@bits = 64
end
@event = @event =
Events::Tracker.new( Events::Tracker.new(
**(kwargs.select { |k, _| %i[pdirty mdirty ldirty midi].include? k }) **(kwargs.select { |k, _| %i[pdirty mdirty ldirty midi].include? k })
@ -65,9 +70,12 @@ module Voicemeeter
def run_voicemeeter(kind_id) def run_voicemeeter(kind_id)
kinds = { kinds = {
basic: (Install::OS_BITS == 64) ? Kinds::KindEnum::BASICX64 : Kinds::KindEnum::BASIC, basic: ([Install::OS_BITS, @bits].all? { |v| v == 64 }) ?
banana: (Install::OS_BITS == 64) ? Kinds::KindEnum::BANANAX64 : Kinds::KindEnum::BANANA, Kinds::KindEnum::BASICX64 : Kinds::KindEnum::BASIC,
potato: (Install::OS_BITS == 64) ? Kinds::KindEnum::POTATOX64 : Kinds::KindEnum::POTATO banana: ([Install::OS_BITS, @bits].all? { |v| v == 64 }) ?
Kinds::KindEnum::BANANAX64 : Kinds::KindEnum::BANANA,
potato: ([Install::OS_BITS, @bits].all? { |v| v == 64 }) ?
Kinds::KindEnum::POTATOX64 : Kinds::KindEnum::POTATO
} }
if caller(1..1).first[/`(.*)'/, 1] == "login" if caller(1..1).first[/`(.*)'/, 1] == "login"
logger.debug "Voicemeeter engine running but the GUI appears to be down... launching." logger.debug "Voicemeeter engine running but the GUI appears to be down... launching."

View File

@ -11,7 +11,7 @@ module Voicemeeter
end end
def patch def patch
1 2
end end
def to_a def to_a