mirror of
https://github.com/onyx-and-iris/obsws-ruby.git
synced 2026-04-13 11:23:31 +00:00
Callbacks module extended
Now supports callback methods as well observer classes levels example now uses callback methods register,deregister now alias add/remove observer methods minor version bump
This commit is contained in:
@@ -21,11 +21,9 @@ class Main
|
||||
def infostring
|
||||
resp = @r_client.get_version
|
||||
[
|
||||
"Using obs version:",
|
||||
resp.obs_version,
|
||||
"With websocket version:",
|
||||
resp.obs_web_socket_version
|
||||
].join("\n")
|
||||
"Using obs version: #{resp.obs_version}.",
|
||||
"With websocket version: #{resp.obs_web_socket_version}"
|
||||
].join(" ")
|
||||
end
|
||||
|
||||
def on_current_program_scene_changed(data)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
require_relative "../../lib/obsws"
|
||||
require "yaml"
|
||||
|
||||
|
||||
module LevelTypes
|
||||
VU = 0
|
||||
POSTFADER = 1
|
||||
@@ -14,7 +13,12 @@ class Main
|
||||
def initialize(**kwargs)
|
||||
subs = OBSWS::Events::SUBS::LOW_VOLUME | OBSWS::Events::SUBS::INPUTVOLUMEMETERS
|
||||
@e_client = OBSWS::Events::Client.new(subs:, **kwargs)
|
||||
@e_client.add_observer(self)
|
||||
@e_client.register(
|
||||
[
|
||||
method(:on_input_mute_state_changed),
|
||||
method(:on_input_volume_meters)
|
||||
]
|
||||
)
|
||||
end
|
||||
|
||||
def run
|
||||
|
||||
Reference in New Issue
Block a user