當前位置: 首頁>>代碼示例>>Python>>正文


Python GstValidate.get_action_type方法代碼示例

本文整理匯總了Python中gi.repository.GstValidate.get_action_type方法的典型用法代碼示例。如果您正苦於以下問題:Python GstValidate.get_action_type方法的具體用法?Python GstValidate.get_action_type怎麽用?Python GstValidate.get_action_type使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gi.repository.GstValidate的用法示例。


在下文中一共展示了GstValidate.get_action_type方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: stop

# 需要導入模塊: from gi.repository import GstValidate [as 別名]
# 或者: from gi.repository.GstValidate import get_action_type [as 別名]
def stop(scenario, action):
    global monitor

    if monitor:
        monitor.checkWrongWindow()

    if action.structure.get_boolean("force")[0]:
        GstValidate.execute_action(GstValidate.get_action_type(action.type).overriden_type,
                                   action)

        timeline = get_pipeline(scenario).props.timeline
        project = timeline.get_asset()

        if project:
            project.setModificationState(False)
            GstValidate.print_action(action, "Force quiting, ignoring any"

                                     " changes in the project\n")
        timeline.ui.app.shutdown()

        return 1

    GstValidate.print_action(action, "STOP: not doing anything in pitivi\n")

    return 1
開發者ID:jubayed,項目名稱:pitivi,代碼行數:27,代碼來源:validate.py

示例2: set_state

# 需要導入模塊: from gi.repository import GstValidate [as 別名]
# 或者: from gi.repository.GstValidate import get_action_type [as 別名]
def set_state(scenario, action):
    wanted_state = action.structure["state"]
    if wanted_state is None:
        wanted_state = action.structure.get_name()
        if wanted_state == "play":
            wanted_state = "playing"
        elif wanted_state == "pause":
            wanted_state = "paused"

    if wanted_state == "paused":
        if scenario.__dict__.get("started", None) is None:

            return 1

    return GstValidate.execute_action(GstValidate.get_action_type(action.type).overriden_type,
                                      action)
開發者ID:jubayed,項目名稱:pitivi,代碼行數:18,代碼來源:validate.py

示例3: remove_clip

# 需要導入模塊: from gi.repository import GstValidate [as 別名]
# 或者: from gi.repository.GstValidate import get_action_type [as 別名]
def remove_clip(scenario, action):
    try:
        next_action = scenario.get_actions()[1]
    except KeyError:
        next_action = None

    if next_action and next_action.type == "add-clip":
        if next_action.structure["element-name"] == action.structure["element-name"]:
            scenario.no_next_add_element = True
            GstValidate.print_action(action,
                                     "Just moving %s between layers, not removing it\n"
                                     % action.structure["element-name"])
            return True

    action_type = GstValidate.get_action_type(action.type)

    return GstValidate.execute_action(action_type.overriden_type, action)
開發者ID:jubayed,項目名稱:pitivi,代碼行數:19,代碼來源:validate.py


注:本文中的gi.repository.GstValidate.get_action_type方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。