Ejemplo n.º 1
0
def init():
    global has_validate
    try:
        from gi.repository import GstValidate
        GstValidate.init()
        has_validate = GES.validate_register_action_types()
        GstValidate.register_action_type(
            "stop", "pitivi", stop, None,
            "Pitivi override for the stop action",
            GstValidate.ActionTypeFlags.NONE)
    except ImportError:
        has_validate = False
Ejemplo n.º 2
0
def init():
    global has_validate
    try:
        from gi.repository import GstValidate
        GstValidate.init()
        has_validate = GES.validate_register_action_types()
        GstValidate.register_action_type("stop", "pitivi",
                                         stop, None,
                                         "Pitivi override for the stop action",
                                         GstValidate.ActionTypeFlags.NONE)
    except ImportError:
        has_validate = False
Ejemplo n.º 3
0
def init():
    Gst.init(None)
    GstValidate.init()

    args = parse_options()
    if not args.scenario:
        args.scenario = os.environ.get('GST_VALIDATE_SCENARIO', None)
    # if we have both manual scenario creation and env, then the scenario
    # is executed twice...
    if 'GST_VALIDATE_SCENARIO' in os.environ:
        del os.environ['GST_VALIDATE_SCENARIO']
    if not args.scenario:
        raise ValueError("No scenario file provided")
    if not args.server:
        raise ValueError("No server location provided")
    if not args.peer_id:
        raise ValueError("No peer id provided")
    if not args.html_source:
        raise ValueError("No HTML page provided")
    if not args.browser:
        raise ValueError("No Browser provided")

    return args
Ejemplo n.º 4
0
def init():
    global has_validate
    try:
        from gi.repository import GstValidate
        GstValidate.init()
        has_validate = GES.validate_register_action_types()
        GstValidate.register_action_type("stop", "pitivi",
                                         stop, None,
                                         "Pitivi override for the stop action",
                                         GstValidate.ActionTypeFlags.NONE)

        GstValidate.register_action_type("seek", "pitivi",
                                         seek, None,
                                         "Pitivi override for the seek action",
                                         GstValidate.ActionTypeFlags.NONE)

        GstValidate.register_action_type("pause", "pitivi",
                                         set_state, None,
                                         "Pitivi override for the pause action",
                                         GstValidate.ActionTypeFlags.NONE)

        GstValidate.register_action_type("play", "pitivi",
                                         set_state, None,
                                         "Pitivi override for the pause action",
                                         GstValidate.ActionTypeFlags.NONE)

        GstValidate.register_action_type("set-state", "pitivi",
                                         set_state, None,
                                         "Pitivi override for the set-state action",
                                         GstValidate.ActionTypeFlags.NONE)

        GstValidate.register_action_type("edit-container", "pitivi",
                                         editContainer, None,
                                         "Start dragging a clip in the timeline",
                                         GstValidate.ActionTypeFlags.NONE)

        GstValidate.register_action_type("split-clip", "pitivi",
                                         split_clip, None,
                                         "Split a clip",
                                         GstValidate.ActionTypeFlags.NONE)

        GstValidate.register_action_type("add-layer", "pitivi",
                                         add_layer, None,
                                         "Add layer",
                                         GstValidate.ActionTypeFlags.NONE)

        GstValidate.register_action_type("remove-clip", "pitivi",
                                         remove_clip, None,
                                         "Remove clip",
                                         GstValidate.ActionTypeFlags.NONE)
        GstValidate.register_action_type("select-clips", "pitivi",
                                         select_clips, [Parametter("clip-name",
                                                                   "The name of the clip to select",
                                                                   True, None, "str")],
                                         "Select clips",
                                         GstValidate.ActionTypeFlags.NONE)

        for z in ["zoom-fit", "zoom-out", "zoom-in"]:
            GstValidate.register_action_type(z, "pitivi", zoom, None, z,
                                             GstValidate.ActionTypeFlags.NO_EXECUTION_NOT_FATAL)
        GstValidate.register_action_type('set-zoom-level', "pitivi", setZoomLevel, None, z,
                                         GstValidate.ActionTypeFlags.NO_EXECUTION_NOT_FATAL)

        Gst.info("Adding pitivi::wrong-window-creation")
        GstValidate.Issue.register(GstValidate.Issue.new(
                                   GLib.quark_from_string("pitivi::wrong-window-creation"),
                                   "A new window for the sink has wrongly been created",
                                   "All sink should display their images in an embedded "
                                   "widget and thus not create a new window",
                                   GstValidate.ReportLevel.CRITICAL))
        return True
    except ImportError:
        has_validate = False
        return False