obs={utils={}};utils={properties_names={}};__settings__=nil __LIST_SCENE_ITEMS__={};__active_tbs_ctr__={} -- function print_source_settings(source_name) -- local sor= obslua.obs_get_source_by_name(source_name) -- local source_settings= obslua.obs_source_get_settings(sor) -- local settings_json=obslua.obs_data_get_json_pretty(source_settings) -- print("[SETTINGS]") -- print("SOURCE-ID-TYPE: " .. tostring(obslua.obs_source_get_unversioned_id(sor))) -- print(settings_json) -- print("==============") -- obslua.obs_source_release(sor) -- obslua.obs_data_release(source_settings) -- end local __START_HOTKEY_ID= obslua.OBS_INVALID_HOTKEY_ID local __STOP_HOTKEY_ID= obslua.OBS_INVALID_HOTKEY_ID function script_load(settings) -- print("LOAD") -- obslua.obs_source_valid(nil) -- print("IS OK!") __settings__= PairStack(settings, nil, true); --print_source_settings("test_label") __START_HOTKEY_ID = obslua.obs_hotkey_register_frontend(script_path() .. "_start_hotkey","[Nxup] START", start) __STOP_HOTKEY_ID = obslua.obs_hotkey_register_frontend(script_path() .. "_stop_hotkey","[Nxup] STOP", Eterminate) local start_name_id=script_path() .. "_start_hotkey" local stop_name_id=script_path() .. "_stop_hotkey" local hotkey_start_arr_t= __settings__.get_arr(start_name_id) local hotkey_stop_arr_t= __settings__.get_arr(stop_name_id) if hotkey_start_arr_t and hotkey_start_arr_t.data then obslua.obs_hotkey_load(__START_HOTKEY_ID, hotkey_start_arr_t.data) hotkey_start_arr_t.free() end if hotkey_stop_arr_t and hotkey_stop_arr_t.data then obslua.obs_hotkey_load(__STOP_HOTKEY_ID, hotkey_stop_arr_t.data) hotkey_stop_arr_t.free() end obslua.obs_frontend_add_event_callback(ftHandlerWF) end function script_save(settings) --print("[SCRIPT-SAVE]") __settings__= PairStack(settings, nil, true); local start_hotkey_id= script_path() .. "_start_hotkey" local stop_hotkey_id = script_path() .. "_stop_hotkey" local hotkey_start_arr_t= obslua.obs_hotkey_save(__START_HOTKEY_ID) local hotkey_stop_arr_t= obslua.obs_hotkey_save(__STOP_HOTKEY_ID) if hotkey_start_arr_t then __settings__.arr(start_hotkey_id, hotkey_start_arr_t) obslua.obs_data_array_release(hotkey_start_arr_t) end if hotkey_stop_arr_t then __settings__.arr(stop_hotkey_id, hotkey_stop_arr_t) obslua.obs_data_array_release(hotkey_stop_arr_t) end end function script_unload() Eterminate() end function script_defaults(settings) --Eterminate() __settings__= PairStack(settings, nil, true); local scene_name=obs.utils:get_current_scene_name() __settings__.int("add_form_exec", 0, true) __settings__.str("add_form_id", "", true) __settings__.str("add_form_type", "", true) __settings__.str("add_form_title", "", true) __settings__.str("add_form_dur", "", true) __settings__.bul("add_form_auto_init", false) __settings__.str("add_form_style_type","") __settings__.str("add_form_placement_type","") local coll=__settings__.get_arr("nxup-collection-arr-".. tostring(scene_name)) if coll == nil or coll.data == nil then coll= ArrayStack() __settings__.arr("nxup-collection-arr-"..tostring(scene_name), coll.data) end coll.free() end function script_properties() local scene_name=obs.utils:get_current_scene_name() local p= obs.create(); local add_new= obs.button(p, "add_new","➕",function(_p,_pp, settings) OpenNewForm(p, settings) return true end) -- [[ SCENE SEPEIFIC ]] local scene_op= obs.create() local scene_op_gp= obs.group(p, "scene_op_group", scene_name, obslua.OBS_GROUP_NORMAL, scene_op) -- [[ ADD FORM ]] local form_op= obs.create() local view_op= obs.create() local add_form= obs.group(p, "addform", "ADD EVENT", obslua.OBS_GROUP_NORMAL , form_op) local add_form_exec= obs.list(form_op, "add_form_exec","exec:", obslua.OBS_COMBO_TYPE_LIST, obslua.OBS_COMBO_FORMAT_STRING); add_form_exec.add_str("", "default") local add_form_id= obs.text(form_op, "add_form_id", "unique ID: ", obslua.OBS_TEXT_DEFAULT) add_form_id.hint("(required) Create a unique id that will be used to refer back to this event can be anything from A-z 0-9_$@#") local add_form_type= obs.list(form_op, "add_form_type","type:", obslua.OBS_COMBO_TYPE_LIST, obslua.OBS_COMBO_FORMAT_STRING ); add_form_type.add_str("