Example #1
0
def script_update(settings):	
	global g
	g.settings = settings

	global slide_scene
	slide_scene = obs.obs_data_get_string(settings, "slide_scene")

	global monitors
	monitors = []
	for hMonitor, hdcMonitor, pyRect in win32api.EnumDisplayMonitors():
		monitors.append(Monitor(hMonitor, hdcMonitor, pyRect, win32api.GetMonitorInfo(hMonitor)["Device"])) 

	global monitor
	monitor = obs.obs_data_get_int(settings, "monitor")

	global screen_sourcename
	screen_sourcename = obs.obs_data_get_string(settings, "screen_sourcename")

	global slide_visible_duration
	slide_visible_duration = obs.obs_data_get_int(settings, "slide_visible_duration")

	global fadeout_duration
	fadeout_duration = obs.obs_data_get_double(settings, "fadeout_duration")

	global refresh_interval
	refresh_interval = obs.obs_data_get_double(settings, "refresh_interval")

	global camera_sourcename
	camera_sourcename = obs.obs_data_get_string(settings, "camera_sourcename")
def script_update(settings):
    zoom.refresh_rate = obs.obs_data_get_int(settings, "interval")
    zoom.source_name = obs.obs_data_get_string(settings, "source")
    zoom.zoom_w = obs.obs_data_get_int(settings, "Width")
    zoom.zoom_h = obs.obs_data_get_int(settings, "Height")
    zoom.active_border = obs.obs_data_get_double(settings, "Border")
    zoom.max_speed = obs.obs_data_get_int(settings, "Speed")
    zoom.smooth = obs.obs_data_get_double(settings, "Smooth")
    zoom.zoom_d = obs.obs_data_get_double(settings, "Zoom")
    zoom.switch_to_monitor(obs.obs_data_get_string(settings, "Monitor"))
    zoom.d_w_override = obs.obs_data_get_int(settings, "Manual Monitor Width")
    zoom.d_h_override = obs.obs_data_get_int(settings, "Manual Monitor Height")
    def updateSettings(self, settings):
        """
        Update the settings with the given obs_data_t settings object.
        """

        # Update the owl source name
        newOwlName = obs.obs_data_get_string(settings, PROP_ID_OWL_SOURCE)
        if self.owlSourceName != newOwlName:
            for item in self.iterSceneItemsByName(newOwlName):
                pos = obs.vec2()
                obs.obs_sceneitem_get_pos(item, pos)
                self.owlBaseY = pos.y
                break
        self.owlSourceName = newOwlName

        # Update the label and counter source names
        self.labelSourceName = obs.obs_data_get_string(settings,
                                                       PROP_ID_LABEL_SOURCE)
        newCounterSourceName = obs.obs_data_get_string(settings,
                                                       PROP_ID_COUNTER_SOURCE)
        if self.counterSourceName != newCounterSourceName:
            with getSourceByName(newCounterSourceName) as source:
                if source is not None:
                    with getSourceSettings(source) as settings:
                        text = obs.obs_data_get_string(settings, 'text')
                        try:
                            self.textColor, self.outlineColor = \
                                colorsForNum(int(text))
                            self.setSourceTextColorByName(
                                newCounterSourceName, self.textColor,
                                self.outlineColor)
                        except ValueError:
                            pass
        self.counterSourceName = newCounterSourceName

        # Update the ding source names
        self.ding1SourceName = obs.obs_data_get_string(settings,
                                                       PROP_ID_DING1_SOURCE)
        self.ding10SourceName = obs.obs_data_get_string(
            settings, PROP_ID_DING10_SOURCE)
        self.ding50SourceName = obs.obs_data_get_string(
            settings, PROP_ID_DING50_SOURCE)

        # Update the owl Y position and movement distance
        self.owlBaseX = obs.obs_data_get_double(settings, PROP_ID_OWL_X_POS)
        self.owlBaseY = obs.obs_data_get_double(settings, PROP_ID_OWL_Y_POS)
        self.owlXDistance = obs.obs_data_get_double(settings,
                                                    PROP_ID_OWL_X_DISTANCE)
        self.owlYDistance = obs.obs_data_get_double(settings,
                                                    PROP_ID_OWL_Y_DISTANCE)
Example #4
0
def script_update(settings):
    global delay
    global end_delay
    global auto_record
    global files_path
    global league_folder
    global league_file

    files_path = obs.obs_data_get_string(settings, "files_path")
    league_folder = obs.obs_data_get_string(settings, "league_folder")
    league_file = os.path.join(league_folder, 'current_match.json',)

    delay = obs.obs_data_get_double(settings, "delay")
    end_delay = obs.obs_data_get_double(settings, "end_delay")
    auto_record = obs.obs_data_get_bool(settings, "auto_record")
def script_update(settings):
    global source_1_name
    global source_2_name
    global background_name
    global transition_time
    global host
    global port
    global password
    global autoconnect
    global thread_running

    source_1_name = obs.obs_data_get_string(settings, "source 1")
    create_colorcorrection_filter(source_1_name, COLOR_FILTER_NAME)
    source_2_name = obs.obs_data_get_string(settings, "source 2")
    create_colorcorrection_filter(source_2_name, COLOR_FILTER_NAME)
    background_name = obs.obs_data_get_string(settings, "background")
    create_colorcorrection_filter(background_name, COLOR_FILTER_NAME)

    transition_time = obs.obs_data_get_double(settings, "transition_time")

    host = obs.obs_data_get_string(settings, "host")
    port = obs.obs_data_get_int(settings, "port")
    password = obs.obs_data_get_string(settings, "password")

    tmpAutoconnect = obs.obs_data_get_bool(settings, "autoconnect")
    if not autoconnect and tmpAutoconnect:
        autoconnect = tmpAutoconnect
        if not thread_running:
            t = threading.Thread(target=connect)
            t.daemon = True
            t.start()
            q.put(0)
            thread_running = True
    else:
        autoconnect = tmpAutoconnect
Example #6
0
 def _get(self, data):
     if self.type is float:
         v = _obs.obs_data_get_double(data, self.name)
     elif self.type is int:
         v = _obs.obs_data_get_int(data, self.name)
     else:
         v = _obs.obs_data_get_string(data, self.name)
     return {self.name: v}
Example #7
0
def script_update(settings):
    zoom.refresh_rate = obs.obs_data_get_int(settings, "interval")
    zoom.source_name = obs.obs_data_get_string(settings, "source")
    zoom.zoom_w = obs.obs_data_get_int(settings, "Width")
    zoom.zoom_h = obs.obs_data_get_int(settings, "Height")
    zoom.active_border = obs.obs_data_get_double(settings, "Border")
    zoom.max_speed = obs.obs_data_get_int(settings, "Speed")
    zoom.smooth = obs.obs_data_get_double(settings, "Smooth")
    zoom.zoom_d = obs.obs_data_get_double(settings, "Zoom")
    zoom.switch_to_monitor(obs.obs_data_get_string(settings, "Monitor"))
    zoom.d_w = obs.obs_data_get_int(settings, "Manual Monitor Width")
    zoom.d_h = obs.obs_data_get_int(settings, "Manual Monitor Height")
    if not obs.obs_data_get_int(settings, "Manual Monitor Height"):
        zoom.override_monitor_size = False
    else:
        zoom.override_monitor_size = True
    zoom.output_w = obs.obs_data_get_int(settings, "Output Resolution Width")
    zoom.output_h = obs.obs_data_get_int(settings, "Output Resolution Height")
Example #8
0
def script_update(settings):
    global interval
    global source_name
    global strftime
    global prefix
    global suffix
    global time_offset

    interval = obs.obs_data_get_double(settings, "interval")
    source_name = obs.obs_data_get_string(settings, "source")
    strftime = obs.obs_data_get_string(settings, "strftime")
    prefix = obs.obs_data_get_string(settings, "prefix")
    suffix = obs.obs_data_get_string(settings, "suffix")
    time_offset = obs.obs_data_get_double(settings, "time_offset")

    obs.timer_remove(update_text)

    if source_name != "":
        obs.timer_add(update_text, int(max(interval * 1000, 1)))
def script_update(settings):
    global source_1_name
    global source_2_name
    global transition_time
    global host
    global port
    global password
    global autoconnect
    #global props

    source_1_name = obs.obs_data_get_string(settings, "source 1")
    source_2_name = obs.obs_data_get_string(settings, "source 2")
    # list1 = obs.obs_properties_get(props, "source 2")
    # obs.obs_property_list_item_disable(list1, 2, True)
    transition_time = obs.obs_data_get_double(settings, "transition_time")

    host = obs.obs_data_get_string(settings, "host")
    port = obs.obs_data_get_int(settings, "port")
    password = obs.obs_data_get_string(settings, "password")
    autoconnect = obs.obs_data_get_bool(settings, "autoconnect")
Example #10
0
def script_update(settings):
  global source_name, frequency, amplitude
  restore_sceneitem_after_shake()
  source_name = obs.obs_data_get_string(settings, "source_name")
  frequency = obs.obs_data_get_double(settings, "frequency")
  amplitude = obs.obs_data_get_int(settings, "amplitude")