本文整理匯總了Python中gi.repository.GstValidate.print_action方法的典型用法代碼示例。如果您正苦於以下問題:Python GstValidate.print_action方法的具體用法?Python GstValidate.print_action怎麽用?Python GstValidate.print_action使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類gi.repository.GstValidate
的用法示例。
在下文中一共展示了GstValidate.print_action方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: stop
# 需要導入模塊: from gi.repository import GstValidate [as 別名]
# 或者: from gi.repository.GstValidate import print_action [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
示例2: add_layer
# 需要導入模塊: from gi.repository import GstValidate [as 別名]
# 或者: from gi.repository.GstValidate import print_action [as 別名]
def add_layer(scenario, action):
timeline = get_pipeline(scenario).props.timeline
if len(timeline.get_layers()) == 0:
GstValidate.print_action(action, "Adding first layer\n")
timeline.append_layer()
else:
GstValidate.print_action(action, "Not adding layer, should be done by pitivi itself\n")
return True
示例3: zoom
# 需要導入模塊: from gi.repository import GstValidate [as 別名]
# 或者: from gi.repository.GstValidate import print_action [as 別名]
def zoom(scenario, action):
timeline = get_pipeline(scenario).props.timeline
GstValidate.print_action(action, action.type.replace('-', ' ') + "\n")
{"zoom-fit": timeline.ui.set_best_zoom_ratio,
"zoom-out": Zoomable.zoomOut,
"zoom-in": Zoomable.zoomIn}[action.type]()
return True
示例4: zoom
# 需要導入模塊: from gi.repository import GstValidate [as 別名]
# 或者: from gi.repository.GstValidate import print_action [as 別名]
def zoom(scenario, action):
timeline = scenario.pipeline.props.timeline.ui
GstValidate.print_action(action, action.type.replace('-', ' ') + "\n")
{"zoom-fit": timeline.parent.zoomFit,
"zoom-out": timelineUtils.Zoomable.zoomOut,
"zoom-in": timelineUtils.Zoomable.zoomIn}[action.type]()
return True
示例5: remove_clip
# 需要導入模塊: from gi.repository import GstValidate [as 別名]
# 或者: from gi.repository.GstValidate import print_action [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)
示例6: editContainer
# 需要導入模塊: from gi.repository import GstValidate [as 別名]
# 或者: from gi.repository.GstValidate import print_action [as 別名]
def editContainer(scenario, action):
timeline = get_pipeline(scenario).props.timeline
container = timeline.get_element(action.structure["container-name"])
if container is None:
for layer in timeline.get_layers():
for clip in layer.get_clips():
Gst.info("Exisiting clip: %s" % clip.get_name())
scenario.report_simple(GLib.quark_from_string("scenario::execution-error"),
"Could not find container: %s"
% action.structure["container-name"])
return 1
res, position = GstValidate.action_get_clocktime(scenario, action, "position")
layer_prio = action.structure["new-layer-priority"]
if res is False:
return 0
edge = get_edge(action.structure)
container_ui = container.ui
setEditingMode(timeline, scenario, action)
y = 21 - container_ui.translate_coordinates(timeline.ui, 0, 0)[1]
if container.get_layer().get_priority() != layer_prio and layer_prio != -1:
try:
layer = timeline.get_layers()[layer_prio]
Gst.info("Y is: %s Realized?? %s Priori: %s layer prio: %s"
% (layer.ui.get_allocation().y,
container_ui.get_realized(),
container.get_layer().get_priority(),
layer_prio))
y = layer.ui.get_allocation().y - container_ui.translate_coordinates(timeline.ui, 0, 0)[1]
if y < 0:
y += 21
elif y > 0:
y -= 21
except IndexError:
if layer_prio == -1:
y = -5
else:
layer = timeline.get_layers()[-1]
alloc = layer.ui.get_allocation()
y = alloc.y + alloc.height + 10 - container_ui.translate_coordinates(timeline.ui, 0, 0)[1]
if not hasattr(scenario, "last_edge"):
scenario.last_edge = edge
if not hasattr(scenario, "dragging") or scenario.dragging is False \
or scenario.last_edge != edge:
event_widget = container.ui
if isinstance(container, GES.SourceClip):
if edge == GES.Edge.EDGE_START:
event_widget = container.ui.leftHandle
elif edge == GES.Edge.EDGE_END:
event_widget = container.ui.rightHandle
scenario.dragging = True
event = Event(Gdk.EventType.BUTTON_PRESS, button=1, y=y)
with mock.patch.object(Gtk, "get_event_widget") as get_event_widget:
get_event_widget.return_value = event_widget
timeline.ui._button_press_event_cb(event_widget, event)
event = Event(Gdk.EventType.MOTION_NOTIFY, button=1,
x=Zoomable.nsToPixelAccurate(position) -
container_ui.translate_coordinates(timeline.ui.layout.layers_vbox, 0, 0)[0],
y=y, state=Gdk.ModifierType.BUTTON1_MASK)
with mock.patch.object(Gtk, "get_event_widget") as get_event_widget:
get_event_widget.return_value = container.ui
timeline.ui._motion_notify_event_cb(None, event)
GstValidate.print_action(action, "Editing %s to %s in %s mode, edge: %s "
"with new layer prio: %d\n" % (action.structure["container-name"],
Gst.TIME_ARGS(position),
scenario.last_mode,
edge,
layer_prio))
_releaseButtonIfNeeded(scenario, action, timeline, container, edge, layer_prio,
position, y)
scenario.last_edge = edge
return 1