예제 #1
0
def script_properties():
    props = obs.obs_properties_create()

    obs.obs_properties_add_path(props, "filetowatch", "File to Watch",
                                obs.OBS_PATH_FILE, '*.txt', "")
    obs.obs_properties_add_path(props, "images_path", "Images Folder",
                                obs.OBS_PATH_DIRECTORY, '', "")
    obs.obs_properties_add_int(props, "interval", "Update Interval (seconds)",
                               1, 3600, 1)

    p = obs.obs_properties_add_list(props, "source", "Image Source",
                                    obs.OBS_COMBO_TYPE_EDITABLE,
                                    obs.OBS_COMBO_FORMAT_STRING)
    sources = obs.obs_enum_sources()
    if sources is not None:
        for source in sources:
            source_id = obs.obs_source_get_id(source)
            #if source_id == "Image":
            name = obs.obs_source_get_name(source)
            obs.obs_property_list_add_string(p, name, name)

        obs.source_list_release(sources)

    obs.obs_properties_add_button(props, "button", "Refresh", refresh_pressed)
    return props
def script_properties():
    print('script_properties')
    props = obs.obs_properties_create()

    obs.obs_properties_add_text(props, "stream_url", "Stream URL",
                                obs.OBS_TEXT_DEFAULT)
    obs.obs_properties_add_int(props, "interval",
                               "Update Interval (milliseconds)", 1, 500, 1)

    p = obs.obs_properties_add_list(props, "source", "Media Source",
                                    obs.OBS_COMBO_TYPE_EDITABLE,
                                    obs.OBS_COMBO_FORMAT_STRING)
    sources = obs.obs_enum_sources()
    if sources is not None:
        for source in sources:
            source_id = obs.obs_source_get_id(source)
            if source_id == "ffmpeg_source":
                name = obs.obs_source_get_name(source)
                obs.obs_property_list_add_string(p, name, name)
            elif source_id == "vlc_source":
                name = obs.obs_source_get_name(source)
                obs.obs_property_list_add_string(p, name, name)

        obs.source_list_release(sources)

    obs.obs_properties_add_button(props, "button", "Refresh", refresh_pressed)
    return props
예제 #3
0
def script_properties():
    properties = obs.obs_properties_create()

    obs.obs_properties_add_text(properties, "api_base",
                                "Biliomi's Api base url", obs.OBS_TEXT_DEFAULT)
    obs.obs_properties_add_text(properties, "username", "Username",
                                obs.OBS_TEXT_DEFAULT)
    obs.obs_properties_add_text(properties, "password", "Password",
                                obs.OBS_TEXT_PASSWORD)
    obs.obs_properties_add_int(properties, "update_interval",
                               "Update Interval (seconds)", 30, 3600, 1)

    follower_source = obs.obs_properties_add_list(properties,
                                                  "latest_follower_source",
                                                  "Latest Follower Source",
                                                  obs.OBS_COMBO_TYPE_EDITABLE,
                                                  obs.OBS_COMBO_FORMAT_STRING)

    obs.obs_properties_add_text(properties, "prefix", "Prefix",
                                obs.OBS_TEXT_DEFAULT)

    sources = obs.obs_enum_sources()
    if sources is not None:
        for source in sources:
            source_id = obs.obs_source_get_id(source)
            if source_id == "text_gdiplus" or source_id == "text_ft2_source":
                name = obs.obs_source_get_name(source)
                obs.obs_property_list_add_string(follower_source, name, name)

        obs.source_list_release(sources)

    return properties
예제 #4
0
def script_properties():
    props = obs.obs_properties_create()

    obs.obs_properties_add_text(props, "strftime", "时间格式", obs.OBS_TEXT_DEFAULT)

    obs.obs_properties_add_text(props, "prefix", "前缀", obs.OBS_TEXT_DEFAULT)

    obs.obs_properties_add_text(props, "suffix", "后缀", obs.OBS_TEXT_DEFAULT)

    obs.obs_properties_add_float(props, "interval", "刷新间隔 (秒)", 0, 3600, 0.5)

    obs.obs_properties_add_float(props, "time_offset", "时间偏移 (小时)", -24, 24, 1)

    p = obs.obs_properties_add_list(props, "source", "文本源", obs.OBS_COMBO_TYPE_EDITABLE,
                                    obs.OBS_COMBO_FORMAT_STRING)
    sources = obs.obs_enum_sources()
    if sources is not None:
        for source in sources:
            source_id = obs.obs_source_get_id(source)
            if source_id.startswith("text"):
                name = obs.obs_source_get_name(source)
                obs.obs_property_list_add_string(p, name, name)

        obs.source_list_release(sources)

    obs.obs_properties_add_button(props, "button", "刷新", refresh_pressed)
    return props
예제 #5
0
def script_properties():
    props = obs.obs_properties_create()

    obs.obs_properties_add_text(props, "host", "MPD Host Address",
                                obs.OBS_TEXT_DEFAULT)
    obs.obs_properties_add_int(props, "port", "Port", 0, 65535, 1)
    obs.obs_properties_add_text(props, "password", "Password",
                                obs.OBS_TEXT_PASSWORD)
    obs.obs_properties_add_int(props, "interval",
                               "Update Interval (milliseconds)", 1, 30000, 1)

    p = obs.obs_properties_add_list(props, "source", "Text Source",
                                    obs.OBS_COMBO_TYPE_EDITABLE,
                                    obs.OBS_COMBO_FORMAT_STRING)
    sources = obs.obs_enum_sources()
    if sources is not None:
        for source in sources:
            source_id = obs.obs_source_get_id(source)
            if source_id == "text_gdiplus" or source_id == "text_ft2_source":
                name = obs.obs_source_get_name(source)
                obs.obs_property_list_add_string(p, name, name)

        obs.source_list_release(sources)

    obs.obs_properties_add_button(props, "refresh_button", "Refresh",
                                  refresh_pressed)

    return props
예제 #6
0
def script_properties():
    #global props
    props = obs.obs_properties_create()

    text1 = obs.obs_properties_add_list(props, "source 1", "Text Source 1", obs.OBS_COMBO_TYPE_LIST, obs.OBS_COMBO_FORMAT_STRING)
    text2 = obs.obs_properties_add_list(props, "source 2", "Text Source 2", obs.OBS_COMBO_TYPE_LIST, obs.OBS_COMBO_FORMAT_STRING)

    background = obs.obs_properties_add_list(props, "background", "Background for Transition", obs.OBS_COMBO_TYPE_LIST, obs.OBS_COMBO_FORMAT_STRING)

    obs.obs_property_list_add_string(text1, "None", "")
    obs.obs_property_list_add_string(text2, "None", "")
    obs.obs_property_list_add_string(background, "None", "")

    sources = obs.obs_enum_sources()
    if sources is not None:
        for source in sources:
            source_id = obs.obs_source_get_id(source)
            if source_id == "text_gdiplus" or source_id == "text_ft2_source" or source_id == "text_gdiplus_v2":
                name = obs.obs_source_get_name(source)
                obs.obs_property_list_add_string(text1, name, name)
                obs.obs_property_list_add_string(text2, name, name)
            if source_id == "color_source":
                name = obs.obs_source_get_name(source)
                obs.obs_property_list_add_string(background, name, name)
    obs.source_list_release(sources)

    obs.obs_properties_add_float_slider(props, "transition_time", "Transition time (S)", 0.1, 5.0, 0.1)

    obs.obs_properties_add_text(props, "host", "Host ip", obs.OBS_TEXT_DEFAULT)
    obs.obs_properties_add_int(props, "port", "Port", 1, 100000, 1)
    obs.obs_properties_add_text(props, "password", "Password", obs.OBS_TEXT_PASSWORD)
    obs.obs_properties_add_button(props, "connect_button", "Connect to server", connect_button_clicked)
    obs.obs_properties_add_bool(props, "autoconnect", "Automatically try to (re)connect to server")

    return props
예제 #7
0
def script_properties():
    props = obs.obs_properties_create()
    obs.obs_properties_add_text(props, "url", "Stream URL",
                                obs.OBS_TEXT_DEFAULT)

    p = obs.obs_properties_add_list(props, "source", "Media Source",
                                    obs.OBS_COMBO_TYPE_EDITABLE,
                                    obs.OBS_COMBO_FORMAT_STRING)
    sources = obs.obs_enum_sources()
    if sources is not None:
        for source in sources:
            source_id = obs.obs_source_get_id(source)
            if source_id == "ffmpeg_source" or source_id == "vlc_source":
                name = obs.obs_source_get_name(source)
                obs.obs_property_list_add_string(p, name, name)

    obs.source_list_release(sources)

    r = obs.obs_properties_add_list(props, "res", "Preferred Resolution",
                                    obs.OBS_COMBO_TYPE_LIST,
                                    obs.OBS_COMBO_FORMAT_STRING)
    obs.obs_property_list_add_string(r, "best", "best")
    obs.obs_property_list_add_string(r, "1080p", "1080p")
    obs.obs_property_list_add_string(r, "720p", "720p")
    obs.obs_property_list_add_string(r, "480p", "480p")
    obs.obs_property_list_add_string(r, "360p", "360p")
    obs.obs_property_list_add_string(r, "160p", "160p")
    obs.obs_property_list_add_string(r, "worst", "worst")

    obs.obs_properties_add_button(props, "set", "Open Stream in Media Source",
                                  open_source)

    return props
예제 #8
0
def script_properties():
    """
    Called to define user properties associated with the script. These
    properties are used to define how to show settings properties to a user.
    """
    props = obs.obs_properties_create()

    mh = obs.obs_properties_add_bool(props, "match_history",
                                     "Show Match History")

    p = obs.obs_properties_add_list(props, "source", "Text Source",
                                    obs.OBS_COMBO_TYPE_EDITABLE,
                                    obs.OBS_COMBO_FORMAT_STRING)

    sources = obs.obs_enum_sources()
    if sources is not None:
        for source in sources:
            source_id = obs.obs_source_get_id(source)
            if source_id == "text_gdiplus" or source_id == "text_ft2_source":
                name = obs.obs_source_get_name(source)
                obs.obs_property_list_add_string(p, name, name)

        obs.source_list_release(sources)

    obs.obs_properties_add_int(props, "blink_rate", "Blink Rate(ms)", 1000,
                               10000, 1)
    obs.obs_properties_add_button(props, "button", "Reset Match History",
                                  refresh_pressed)

    return props
예제 #9
0
def script_properties():
	props = obs.obs_properties_create()

	obs.obs_properties_add_button(props, "button1", "Start", start_pressed)
	
	obs.obs_properties_add_button(props, "button2", "Clip Now", clip_pressed)

	obs.obs_properties_add_button(props, "button3", "Edit Last Clip", clipedit_pressed)

	p = obs.obs_properties_add_list(props, "source", "CC Text Source", obs.OBS_COMBO_TYPE_EDITABLE, obs.OBS_COMBO_FORMAT_STRING)
	sources = obs.obs_enum_sources()
	if sources is not None:
		for source in sources:
			source_id = obs.obs_source_get_id(source)
			if source_id == "text_gdiplus" or source_id == "text_ft2_source":
				name = obs.obs_source_get_name(source)
				obs.obs_property_list_add_string(p, name, name)

		obs.source_list_release(sources)

	obs.obs_properties_add_text(props, "twitchUsername", "Twitch Username", obs.OBS_TEXT_DEFAULT)

	obs.obs_properties_add_text(props, "apiClientID", "API Client ID", obs.OBS_TEXT_DEFAULT)

	obs.obs_properties_add_text(props, "chromeDriverPath", "Chrome Driver Path", obs.OBS_TEXT_DEFAULT)

	obs.obs_properties_add_text(props, "chromeProfilePath", "Chrome Profile Path", obs.OBS_TEXT_DEFAULT)


	return props
예제 #10
0
def script_properties():
    props = obs.obs_properties_create()

    # True/False checkbox (checked == True)
    obs.obs_properties_add_bool(props, "clock_24hr", "Use 24-hour clock")

    # Text field entry
    obs.obs_properties_add_text(props, "timezone_text", "Timezone (optional)",
                                obs.OBS_TEXT_DEFAULT)

    # Drop down menu of Text sources
    p = obs.obs_properties_add_list(props, "source_name", "Text Source",
                                    obs.OBS_COMBO_TYPE_EDITABLE,
                                    obs.OBS_COMBO_FORMAT_STRING)
    sources = obs.obs_enum_sources()
    if sources is not None:
        for source in sources:
            source_id = obs.obs_source_get_id(source)
            if source_id == "text_gdiplus" or source_id == "text_ft2_source":
                name = obs.obs_source_get_name(source)
                obs.obs_property_list_add_string(p, name, name)

        obs.source_list_release(sources)

    # Button in OBS script menu to interact with script
    obs.obs_properties_add_button(props, "button", "Refresh", refresh_pressed)

    return props
예제 #11
0
def script_properties():
    props = obs.obs_properties_create()

    obs.obs_properties_add_text(
        props, "username", "Showdown Username", obs.OBS_TEXT_DEFAULT)
    obs.obs_properties_add_int(
        props, "interval", "Update interval (seconds)", 5, 3600, 1)

    p = obs.obs_properties_add_list(
        props, "source", "Text Source", obs.OBS_COMBO_TYPE_EDITABLE, obs.OBS_COMBO_FORMAT_STRING)
    sources = obs.obs_enum_sources()
    if sources is not None:
        for source in sources:
            source_id = obs.obs_source_get_id(source)
            if source_id == "text_gdiplus" or source_id == "text_gdiplus_v2" or source_id == "text_ft2_source":
                name = obs.obs_source_get_name(source)
                obs.obs_property_list_add_string(p, name, name)

        obs.source_list_release(sources)

    obs.obs_properties_add_text(
        props, "format", "Format (OU, UU etc.)", obs.OBS_TEXT_DEFAULT)
    obs.obs_properties_add_text(
        props, "str_format", "Text format (see website for details)", obs.OBS_TEXT_DEFAULT)
    return props
예제 #12
0
def script_properties():
    props = obs.obs_properties_create()

    obs.obs_properties_add_color(props, "tally^IdleColor", "Idle Color")
    obs.obs_properties_add_int_slider(props, "tally^IdleBrightness",
                                      "Idle Brightness", 0, 10, 1)
    obs.obs_properties_add_color(props, "tally^PreviewColor", "Queued Color")
    obs.obs_properties_add_int_slider(props, "tally^PreviewBrightness",
                                      "Queued Brightness", 0, 10, 1)
    obs.obs_properties_add_color(props, "tally^ProgramColor", "Live Color")
    obs.obs_properties_add_int_slider(props, "tally^ProgramBrightness",
                                      "Live Brightness", 0, 10, 1)

    sources = obs.obs_enum_sources()
    if sources is not None:
        for source in sources:
            source_id = obs.obs_source_get_id(source)
            if source_id == 'av_capture_input':
                source_name = obs.obs_source_get_name(source)
                obs.script_log(obs.LOG_INFO, "Found source: " + source_name)
                obs.obs_properties_add_text(props, source_name,
                                            source_name + " light addr:",
                                            obs.OBS_TEXT_DEFAULT)

    obs.source_list_release(sources)

    return props
def update_match_video():
    global last_video_path

    print('update_match_video')

    # TODO: actually set the video starting at the start of the game, rather
    # than the slot. Also involves ensuring that our timings are in step with
    # the compbox.

    path = video_path.get()
    if last_video_path == path:
        print(f"{path!r} has already played")
        return

    # TODO: can we pull the current video from the source? I tried this but
    # couldn't work out how.
    last_video_path = path
    print(f"Updating to {path!r}")

    source = obs.obs_get_source_by_name(source_name)
    if source != None:
        print('got source')

        settings = obs.obs_data_create()
        source_id = obs.obs_source_get_id(source)
        if source_id == "ffmpeg_source":

            obs.obs_data_set_string(settings, "local_file", path)
            obs.obs_data_set_bool(settings, "is_local_file", True)

            # updating will automatically cause the source to
            # refresh if the source is currently active
            obs.obs_source_update(source, settings)

            # TODO: this ends up resetting the size of the video within OBS. Can
            # we inspect the source beforehand and preserve the apparent size?
            # Might be moot if all our videos are the same size and we're
            # showing them at 100% scale, but would be good to sort properly.

        elif source_id == "vlc_source":
            # "playlist"
            array = obs.obs_data_array_create()
            item = obs.obs_data_create()
            obs.obs_data_set_string(item, "value", path)
            obs.obs_data_array_push_back(array, item)
            obs.obs_data_set_array(settings, "playlist", array)

            # updating will automatically cause the source to
            # refresh if the source is currently active
            obs.obs_source_update(source, settings)
            obs.obs_data_release(item)
            obs.obs_data_array_release(array)

        obs.obs_data_release(settings)
        obs.obs_source_release(source)

    print('update_match_video done')
예제 #14
0
 def _add_sources(source_type, prop):
     sources = obs.obs_enum_sources()
     if sources is not None:
         for source in sources:
             source_id = obs.obs_source_get_id(source)
             if source_id == source_type:
                 name = obs.obs_source_get_name(source)
                 obs.obs_property_list_add_string(prop, name, name)
     obs.source_list_release(sources)
예제 #15
0
파일: mute.py 프로젝트: casey-c/obs_mute
def list_image_sources():
	image_sources = []
	sources = obs.obs_enum_sources()

	for source in sources:
		source_id = obs.obs_source_get_id(source)
		print(source_id)
		if source_id == "image_source":
			image_sources.append(obs.obs_source_get_name(source))

	obs.source_list_release(sources)
	return image_sources
예제 #16
0
def source_volume(src, volume):
    #n_scene = nextScene()
    sources = obs.obs_enum_sources()
    found = None
    if sources is not None:
        for source in sources:
            source_id = obs.obs_source_get_id(source)
            name = obs.obs_source_get_name(source)
            if name == src:
                found = source
    if found != None:
        obs.obs_source_set_volume(found, float(volume))
예제 #17
0
파일: discrop.py 프로젝트: UnaiM/discrop
def populate_sources(props, p=None, _settings=None):
    p = obs.obs_properties_get(props, 'discord_source')
    obs.obs_property_list_clear(p)
    obs.obs_property_list_add_string(p, '(none)', '')
    sources = obs.obs_enum_sources()
    labels = {}
    for src in sources:
        n = obs.obs_source_get_name(src)
        labels[n] = n + ' (' + obs.obs_source_get_display_name(
            obs.obs_source_get_id(src)) + ')'
    obs.source_list_release(sources)
    for n in sorted(labels, key=lambda x: x.lower()):
        obs.obs_property_list_add_string(p, labels[n], n)
    return True
예제 #18
0
def change(s, enabled):
    source = obs.calldata_source(s, 'source')

    if source is not None:
        source_type = obs.obs_source_get_id(source)
        name = obs.obs_source_get_name(source)

        print('detected change in ' + name + ' (' + source_type + ')')

        if len(config.source_types) == 0 or source_type in config.source_types:
            print('informing')
            requests.put(config.server + '/change', json={
                'enabled': [name],
            })
예제 #19
0
    def setSourceTextColorByName(self, sourceName, color, outline=None):
        """
        Sets the color of the given text source by name. The color
        should be an int, in OBS color format. The outline color can
        either be None (meaning no outline) or an int in OBS color
        format.
        """
        with getSourceByName(sourceName) as source:
            if source is None: return

            with createObsData() as settings:
                if obs.obs_source_get_id(source) == 'text_ft2_source':
                    obs.obs_data_set_int(settings, 'color1', color)
                    obs.obs_data_set_int(settings, 'color2', color)

                    # FreeType2 currently doesn't support setting
                    # outline colors. We *could* turn the outline on,
                    # but that's probably not what whoever specified an
                    # outline wanted. So we just won't.

                elif obs.obs_source_get_id(source) == 'text_gdiplus':
                    colorRGB = rgbaToColor(*colorToRgba(color)[:3])
                    colorA = int(colorToRgba(color)[3] * 100 / 255)
                    obs.obs_data_set_int(settings, 'color', colorRGB)
                    obs.obs_data_set_int(settings, 'opacity', colorA)

                    obs.obs_data_set_bool(settings, 'outline', outline
                                          is not None)
                    if outline is not None:
                        outlineRGB = rgbaToColor(*colorToRgba(outline)[:3])
                        outlineA = int(colorToRgba(outline)[3] * 100 / 255)
                        obs.obs_data_set_int(settings, 'outline_color',
                                             outlineRGB)
                        obs.obs_data_set_int(settings, 'outline_opacity',
                                             outlineA)

                obs.obs_source_update(source, settings)
예제 #20
0
def script_properties():
    props = obs.obs_properties_create()

    obs.obs_properties_add_text(props, "url", "Channel URL",
                                obs.OBS_TEXT_DEFAULT)
    obs.obs_properties_add_int(props, "interval", "Update Interval (seconds)",
                               5, 3600, 1)

    p = obs.obs_properties_add_list(props, "source", "Text Source",
                                    obs.OBS_COMBO_TYPE_EDITABLE,
                                    obs.OBS_COMBO_FORMAT_STRING)
    sources = obs.obs_enum_sources()
    if sources is not None:
        for source in sources:
            source_id = obs.obs_source_get_id(source)
            if source_id == "text_gdiplus" or source_id == "text_ft2_source":
                name = obs.obs_source_get_name(source)
                obs.obs_property_list_add_string(p, name, name)

        obs.source_list_release(sources)

    q = obs.obs_properties_add_list(props, "sourceb", "Browser Source",
                                    obs.OBS_COMBO_TYPE_EDITABLE,
                                    obs.OBS_COMBO_FORMAT_STRING)
    sourcesb = obs.obs_enum_sources()
    if sourcesb is not None:
        for sourceb in sourcesb:
            source_id = obs.obs_source_get_id(sourceb)
            if source_id == "browser_source":
                nameb = obs.obs_source_get_name(sourceb)
                obs.obs_property_list_add_string(q, nameb, nameb)

        obs.source_list_release(sourcesb)

    obs.obs_properties_add_button(props, "button", "Refresh", refresh_pressed)
    return props
예제 #21
0
파일: rectest.py 프로젝트: kgudger/RSVP
def script_properties():
    props = obs.obs_properties_create()

    p = obs.obs_properties_add_list(props, "source", "Text Source",
                                    obs.OBS_COMBO_TYPE_EDITABLE,
                                    obs.OBS_COMBO_FORMAT_STRING)
    sources = obs.obs_enum_sources()
    if sources is not None:
        for source in sources:
            source_id = obs.obs_source_get_id(source)
            if source_id == "text_gdiplus" or source_id == "text_ft2_source":
                name = obs.obs_source_get_name(source)
                obs.obs_property_list_add_string(p, name, name)

        obs.source_list_release(sources)

    return props
def script_properties():
    props = obs.obs_properties_create()
    p = obs.obs_properties_add_list(props, "source", "Microphone",
                                    obs.OBS_COMBO_TYPE_LIST,
                                    obs.OBS_COMBO_FORMAT_STRING)
    obs.obs_properties_add_int_slider(props, "update_interval",
                                      "Update Interval (s):", min_slider_value,
                                      max_slider_value, slider_inverval)
    sources = obs.obs_enum_sources()
    if sources:
        for source in sources:
            source_id = obs.obs_source_get_id(source)
            print(f"Device type found: {source_id}.")
            if source_id in mic_types:
                name = obs.obs_source_get_name(source)
                obs.obs_property_list_add_string(p, name, name)
    obs.source_list_release(sources)
    return props
예제 #23
0
def script_properties():
    props = obs.obs_properties_create()

    obs.obs_properties_add_int(props, "interval", "Update Interval (seconds)", 1, 3600, 1)

    p = obs.obs_properties_add_list(props, "source", "Text Source", obs.OBS_COMBO_TYPE_EDITABLE, obs.OBS_COMBO_FORMAT_STRING)
    sources = obs.obs_enum_sources()
    if sources is not None:
        for source in sources:
            source_id = obs.obs_source_get_id(source)
            if source_id == "text_gdiplus" or source_id == "text_ft2_source":
                name = obs.obs_source_get_name(source)
                obs.obs_property_list_add_string(p, name, name)

        obs.source_list_release(sources)

    obs.obs_properties_add_button(props, "button", "Refresh", refresh_pressed)
    return props
예제 #24
0
def change_input():
    global globSettings
    url = obs.obs_data_get_string(globSettings, "url")
    source = obs.obs_data_get_string(globSettings, "source")
    qual = obs.obs_data_get_string(globSettings, "res")
    if url != None and source != None:
        sourceObj = obs.obs_get_source_by_name(source)
        try:
            streamUrl = ""
            stream = streamlink.streams(url)

            if qual in stream:
                streamUrl = stream[qual].url
            elif qual + "60" in stream:
                streamUrl = stream[qual + "60"].url
            elif qual + "_alt" in stream:
                streamUrl = stream[qual + "_alt"].url
            elif qual + "60_alt" in stream:
                streamUrl = stream[qual + "60_alt"].url
            elif "best" in stream:
                streamUrl = stream["best"].url

            if streamUrl != "" and sourceObj != None:
                source_id = obs.obs_source_get_id(sourceObj)
                settings = obs.obs_data_create()
                if source_id == "ffmpeg_source":
                    obs.obs_data_set_string(settings, "input", streamUrl)
                    obs.obs_data_set_bool(settings, "is_local_file", False)
                    obs.obs_source_update(sourceObj, settings)
                else:
                    array = obs.obs_data_array_create()
                    data = obs.obs_data_create()
                    obs.obs_data_set_string(data, "name", streamUrl)
                    obs.obs_data_set_string(data, "value", streamUrl)
                    obs.obs_data_array_push_back(array, data)
                    obs.obs_data_release(data)
                    obs.obs_data_set_array(settings, "playlist", array)
                    obs.obs_source_update(sourceObj, settings)
                    obs.obs_data_array_release(array)

                obs.obs_data_release(settings)
        except streamlink.StreamlinkError:
            pass
        obs.obs_source_release(sourceObj)
예제 #25
0
def script_properties():
	props = obs.obs_properties_create()

	obs.obs_properties_add_text(props, "url", "URL", obs.OBS_TEXT_DEFAULT)
	obs.obs_properties_add_int(props, "interval", "Update Interval (seconds)", 5, 3600, 1)

	p = obs.obs_properties_add_list(props, "source", "Text Source", obs.OBS_COMBO_TYPE_EDITABLE, obs.OBS_COMBO_FORMAT_STRING)
	sources = obs.obs_enum_sources()
	if sources is not None:
		for source in sources:
			source_id = obs.obs_source_get_id(source)
			if source_id == "text_gdiplus" or source_id == "text_ft2_source":
				name = obs.obs_source_get_name(source)
				obs.obs_property_list_add_string(p, name, name)

		obs.source_list_release(sources)

	obs.obs_properties_add_button(props, "button", "Refresh", refresh_pressed)
	return props
예제 #26
0
def script_properties():
    props = obs.obs_properties_create()

    obs.obs_properties_add_bool(props,
                                "enable",
                                "Enable this script")

    obs.obs_properties_add_text(
        props, "steamurl", "Steam Community URL", obs.OBS_TEXT_DEFAULT
    )

    p = obs.obs_properties_add_list(props, "source_name", "Target Source",
                                    obs.OBS_COMBO_TYPE_EDITABLE,
                                    obs.OBS_COMBO_FORMAT_STRING)
    sources = obs.obs_enum_sources()
    if sources is not None:
        for source in sources:
            source_id = obs.obs_source_get_id(source)
            if source_id == "game_capture":
                name = obs.obs_source_get_name(source)
                obs.obs_property_list_add_string(p, name, name)
    obs.source_list_release(sources)

    obs.obs_properties_add_int(props,
                               "interval",
                               "Check Interval (ms)",
                               MIN_INTERVAL,
                               MAX_INTERVAL,
                               1)
    obs.obs_properties_add_int(props,
                               "blink_speed",
                               "Blink Speed (ms)",
                               MIN_BLINK_SPEED,
                               MAX_BLINK_SPEED,
                               1)
    obs.obs_properties_add_bool(props,
                                "onlyruninql",
                                "Disable the script when Quake Live is not running")
    obs.obs_properties_add_bool(props,
                                "debug",
                                "Enable debug logging")
    return props
예제 #27
0
def script_properties():
    props = obs.obs_properties_create()
    obs.obs_properties_add_text(props, "hotkey", "Trigger Key (WIP)", obs.OBS_TEXT_DEFAULT)


    p = obs.obs_properties_add_list(props, "source", "Text Source", obs.OBS_COMBO_TYPE_EDITABLE, obs.OBS_COMBO_FORMAT_STRING)
    sources = obs.obs_enum_sources()
    if sources is not None:
        for source in sources:
            source_id = obs.obs_source_get_id(source)
            if source_id == "text_gdiplus" or source_id == "text_ft2_source":
                name = obs.obs_source_get_name(source)
                obs.obs_property_list_add_string(p, name, name)

        obs.source_list_release(sources)


    obs.obs_properties_add_button(props, "button", "Reload", refresh_pressed)
    
    return props
def script_properties():
  props = obs.obs_properties_create()
  
  winlist = obs.obs_properties_add_list( props,
    "windowlist", "Window ID", 
    obs.OBS_COMBO_TYPE_EDITABLE,
    obs.OBS_COMBO_FORMAT_STRING)
  
  obs.obs_properties_add_path(props,
    "title_end", "Suffix list",
    obs.OBS_PATH_FILE,
    "*.txt;;*.*", "~/")
  
  obs.obs_properties_add_int( props,
    "update", "Update (ms)",
    500, 60000, 10)
  
  for i in get_windows():
    hex_id = i[0]
    name = i[3]
    obs.obs_property_list_add_string(winlist, hex_id, hex_id)

  text_source = obs.obs_properties_add_list( props,
    "source", "Text Source",
    obs.OBS_COMBO_TYPE_EDITABLE,
    obs.OBS_COMBO_FORMAT_STRING)
    
  sources = obs.obs_enum_sources()
  if sources is not None:
    for source in sources:
      source_id = obs.obs_source_get_id(source)
      text_object = ( "text_gdiplus" , "text_ft2_source" )
      if source_id in text_object:
        name = obs.obs_source_get_name(source)
        obs.obs_property_list_add_string(
          text_source, name, name)
    obs.source_list_release(sources)
  
  obs.obs_properties_add_button(props,
  "btn_update", "Update", force_update)
  return props
def script_properties():
    props = obs.obs_properties_create()

    obs.obs_properties_add_text(props, "calendar_url", "Calendar ID",
                                obs.OBS_TEXT_DEFAULT)
    obs.obs_properties_add_path(props, "client_secret_file",
                                "Client Secret File", obs.OBS_PATH_FILE,
                                '*.json', "")
    obs.obs_properties_add_path(props, "images_path", "Images Folder",
                                obs.OBS_PATH_DIRECTORY, '', "")
    obs.obs_properties_add_int(props, "interval", "Update Interval (seconds)",
                               5, 3600, 1)
    obs.obs_properties_add_int(props, "max_events", "Max Number of Events", 1,
                               15, 1)

    for x in range(0, max_events):
        p = obs.obs_properties_add_list(props, "source_{}".format(x),
                                        "Text Source {}".format(x + 1),
                                        obs.OBS_COMBO_TYPE_EDITABLE,
                                        obs.OBS_COMBO_FORMAT_STRING)

        img_p = obs.obs_properties_add_list(props, "img_source_{}".format(x),
                                            "Image Source {}".format(x + 1),
                                            obs.OBS_COMBO_TYPE_EDITABLE,
                                            obs.OBS_COMBO_FORMAT_STRING)

        sources = obs.obs_enum_sources()
        if sources is not None:
            for source in sources:
                source_id = obs.obs_source_get_id(source)
                if source_id == "text_gdiplus" or source_id == "text_ft2_source":
                    name = obs.obs_source_get_name(source)
                    obs.obs_property_list_add_string(p, name, name)
                if source_id == "image_source":
                    name = obs.obs_source_get_name(source)
                    obs.obs_property_list_add_string(img_p, name, name)
            obs.source_list_release(sources)

    obs.obs_properties_add_button(props, "button", "Refresh", refresh_pressed)
    return props
예제 #30
0
def script_properties():
    """
    Called to define user properties associated with the script. These
    properties are used to define how to show settings properties to a user.
    """
    props = obs.obs_properties_create()

    obs.obs_properties_add_text(props, "IRC Server", "IRC Server",
                                obs.OBS_TEXT_DEFAULT)
    obs.obs_properties_add_text(props, "IRC Channel", "IRC Channel",
                                obs.OBS_TEXT_DEFAULT)
    obs.obs_properties_add_int(props, "IRC Port", "Port", 0, 65535, 1)
    obs.obs_properties_add_text(props, "IRC Nickname", "Nickname",
                                obs.OBS_TEXT_DEFAULT)
    obs.obs_properties_add_text(props, "IRC Password", "Password",
                                obs.OBS_TEXT_PASSWORD)
    obs.obs_properties_add_button(props, "button1", "Connect", connect_pressed)
    obs.obs_properties_add_button(props, "button2", "Disconnect",
                                  disconnect_pressed)
    p = obs.obs_properties_add_list(props, "source", "Text Source",
                                    obs.OBS_COMBO_TYPE_EDITABLE,
                                    obs.OBS_COMBO_FORMAT_STRING)
    obs.obs_properties_add_text(props, "Command Prefix", "Command Prefix",
                                obs.OBS_TEXT_DEFAULT)
    obs.obs_properties_add_text(props, "Command Response",
                                "Command Response (example items: %Author%)",
                                obs.OBS_TEXT_DEFAULT)
    obs.obs_properties_add_button(props, "button", "Refresh Msg List",
                                  refresh_pressed)

    sources = obs.obs_enum_sources()
    if sources is not None:
        for source in sources:
            source_id = obs.obs_source_get_id(source)
            if source_id == "text_gdiplus" or source_id == "text_ft2_source":
                name = obs.obs_source_get_name(source)
                obs.obs_property_list_add_string(p, name, name)

        obs.source_list_release(sources)
    return props
예제 #31
0
def script_properties():
    props = obs.obs_properties_create()

    obs.obs_properties_add_int(props, "hour", "Hour (0-24)", 0, 24, 1)
    obs.obs_properties_add_int(props, "minute", "Minute (0-59)", 0, 59, 1)
    obs.obs_properties_add_int(props, "second", "Second (0-59)", 0, 59, 1)

    p = obs.obs_properties_add_list(props, "source_name", "Text source",
                                    obs.OBS_COMBO_TYPE_EDITABLE,
                                    obs.OBS_COMBO_FORMAT_STRING)
    sources = obs.obs_enum_sources()
    for source in sources:
        source_id = obs.obs_source_get_id(source)
        if source_id == "text_gdiplus" or source_id == "text_ft2_source" or source_id == "text_gdiplus_v2" or source_id == "text_ft2_source_v2":
            name = obs.obs_source_get_name(source)
            obs.obs_property_list_add_string(p, name, name)
    obs.source_list_release(sources)

    obs.obs_properties_add_text(props, "stop_text", "Countdown final text",
                                obs.OBS_TEXT_DEFAULT)

    return props