use 'and' control flow operator

add debug log message if caller was login method
This commit is contained in:
onyx-and-iris 2023-07-31 15:16:19 +01:00
parent af55e8ce1f
commit 2c5783b1a1

View File

@ -40,7 +40,7 @@ module Voicemeeter
end end
def login def login
run_voicemeeter(kind.name) if CBindings.call(:bind_login, ok: [0, 1]) == 1 CBindings.call(:bind_login, ok: [0, 1]) == 1 and run_voicemeeter(kind.name)
clear_dirty clear_dirty
logger.info "Successfully logged into #{self} version #{version}" logger.info "Successfully logged into #{self} version #{version}"
end end
@ -78,6 +78,9 @@ module Voicemeeter
banana: Kinds::KindEnum::BANANA, banana: Kinds::KindEnum::BANANA,
potato: (Install::OS_BITS == 64) ? Kinds::KindEnum::POTATOX64 : Kinds::KindEnum::POTATO potato: (Install::OS_BITS == 64) ? Kinds::KindEnum::POTATOX64 : Kinds::KindEnum::POTATO
} }
if caller(1..1).first[/`(.*)'/, 1] == "login"
logger.debug("Voicemeeter engine running but the GUI appears to be down... launching.")
end
CBindings.call(:bind_run_voicemeeter, kinds[kind_id]) CBindings.call(:bind_run_voicemeeter, kinds[kind_id])
sleep(1) sleep(1)
end end