2022-10-25 00:05:12 +01:00
|
|
|
require "obsws"
|
2023-07-19 15:13:26 +01:00
|
|
|
require "yaml"
|
2022-10-25 00:05:12 +01:00
|
|
|
|
|
|
|
OBSWS::LOGGER.info!
|
|
|
|
|
2023-07-19 15:13:26 +01:00
|
|
|
def conn_from_yaml
|
|
|
|
YAML.load_file("obs.yml", symbolize_names: true)[:connection]
|
2022-10-25 00:05:12 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def main
|
2023-07-19 15:13:26 +01:00
|
|
|
OBSWS::Requests::Client.new(**conn_from_yaml).run do |client|
|
|
|
|
resp = client.get_scene_list
|
|
|
|
resp.scenes.reverse_each do |scene|
|
|
|
|
puts "Switching to scene #{scene[:sceneName]}"
|
|
|
|
client.set_current_program_scene(scene[:sceneName])
|
2022-10-25 00:05:12 +01:00
|
|
|
sleep(0.5)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
main if $0 == __FILE__
|