Exemplo n.º 1
0
def script_load(settings):
    signal_handler = obs.obs_get_signal_handler()
    obs.signal_handler_connect(signal_handler, "source_activate",
                               signal_receiver)
    obs.signal_handler_connect(signal_handler, "source_deactivate",
                               signal_receiver)
    update_text()
Exemplo n.º 2
0
def connect_handler():
    global signal_handler

    disconnect_handler()

    signal_handler = obs.obs_get_signal_handler()
    obs.signal_handler_connect(signal_handler, "source_activate",
                               source_activated)
def script_load(settings):
    """
    Connect hotkey and activation/deactivation signal callbacks
    """

    _sh = obs.obs_get_signal_handler()
    obs.signal_handler_connect(_sh, "source_activate", source_activated)
    obs.signal_handler_connect(_sh, "source_deactivate", source_deactivated)

    _hotkey_id = obs.obs_hotkey_register_frontend("reset_timer_thingy",
                                                  "Reset Timer", reset)

    _hotkey_save_array = obs.obs_data_get_array(settings, "reset_hotkey")
    obs.obs_hotkey_load(_hotkey_id, _hotkey_save_array)
    obs.obs_data_array_release(_hotkey_save_array)
Exemplo n.º 4
0
def script_load(settings_):
    global settings

    settings = settings_

    # monitor all shown sources on load
    sources = obs.obs_enum_sources()
    for source in sources:
        if obs.obs_source_showing(source) and obs.obs_source_get_type(
                source) == obs.OBS_SOURCE_TYPE_INPUT:
            monitor_source(source)
    obs.source_list_release(sources)

    # connect to 'source_show' event to monitor all added sources when shown
    obs.signal_handler_connect(obs.obs_get_signal_handler(), 'source_show',
                               monitor_source_callback)
def script_load(settings):
    script_update(settings)
    sig = obs.obs_get_signal_handler()
    obs.signal_handler_connect(sig, "source_activate", source_activated)
    obs.signal_handler_connect(sig, "source_deactivate", source_deactivated)
Exemplo n.º 6
0
        src_name, src_obj = src_item
        src_volume = obspython.obs_source_get_volume(src_obj)
        client.send_message(f"/obs/audio/label/num/{i+1}/visible", 1)
        client.send_message(f"/obs/audio/label/num/{i+1}", src_name)
        client.send_message(f"/obs/audio/fader/num/{i+1}/visible", 1)
        client.send_message(f"/obs/audio/fader/num/{i+1}",
                            src_volume**(1. / 3))


# +======== OBS CALLBACKS ========+
def on_source_create_callback(calldata):
    refresh_scenes()
    refresh_audio_faders()


signal_handler = obspython.obs_get_signal_handler()
obspython.signal_handler_connect(signal_handler, "source_create",
                                 on_source_create_callback)


# +======== OSC HANDLERS ========+
def scene_handler(address, *args):
    print(f"{address}: {args}")
    control, id_type, i_str = address.split("/")[3:6]

    if control == "button":
        i = int(i_str) - 1
        scn = obspython.obs_frontend_get_scenes()[i]
        obspython.obs_frontend_set_current_scene(scn)

Exemplo n.º 7
0
def script_load(settings):
    sh = obs.obs_get_signal_handler()

    obs.signal_handler_connect(sh, 'source_activate', enabled)
    obs.signal_handler_connect(sh, 'source_deactivate', disabled)
Exemplo n.º 8
0
def script_load(settings):
    global dispatcher
    
    sh = obs.obs_get_signal_handler()
    obs.signal_handler_connect(sh, "source_activate", source_activated)