[pitivi] render: Connect to video-size-changed to be notified of project size
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] render: Connect to video-size-changed to be notified of project size
- Date: Mon, 3 May 2021 21:29:00 +0000 (UTC)
commit 2efc19e3211a66d69dc4957ef465c1ffcdf7a186
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Wed Apr 28 02:01:19 2021 +0200
render: Connect to video-size-changed to be notified of project size
Practically it's the same thing, whenever we emit
"rendering-settings-changed" for width/height we also emit
"video-size-changed", or at least we should (see
`set_video_properties` which fails to emit "rendering-settings-changed").
Since "rendering-settings-changed" is not used anymore it has been
removed.
pitivi/project.py | 23 +++++++++--------------
pitivi/render.py | 5 ++---
2 files changed, 11 insertions(+), 17 deletions(-)
---
diff --git a/pitivi/project.py b/pitivi/project.py
index a16e51c7c..101a5375d 100644
--- a/pitivi/project.py
+++ b/pitivi/project.py
@@ -633,8 +633,6 @@ class Project(Loggable, GES.Project):
(object,)),
"start-importing": (GObject.SignalFlags.RUN_LAST, None, ()),
"project-changed": (GObject.SignalFlags.RUN_LAST, None, ()),
- "rendering-settings-changed": (GObject.SignalFlags.RUN_LAST, None,
- (GObject.TYPE_PYOBJECT,)),
"settings-set-from-imported-asset": (GObject.SignalFlags.RUN_LAST, None,
(GES.Asset,)),
"video-size-changed": (GObject.SignalFlags.RUN_LAST, None, ()),
@@ -1010,7 +1008,7 @@ class Project(Loggable, GES.Project):
def videowidth(self, value):
if self._set_video_restriction("width", int(value)):
self.update_restriction_caps()
- self._emit_change("width")
+ self.set_modification_state(True)
@property
def videoheight(self):
@@ -1020,7 +1018,7 @@ class Project(Loggable, GES.Project):
def videoheight(self, value):
if self._set_video_restriction("height", int(value)):
self.update_restriction_caps()
- self._emit_change("height")
+ self.set_modification_state(True)
@property
def videorate(self):
@@ -1030,7 +1028,7 @@ class Project(Loggable, GES.Project):
def videorate(self, value):
if self._set_video_restriction("framerate", value):
self.update_restriction_caps()
- self._emit_change("videorate")
+ self.set_modification_state(True)
def set_video_properties(self, width, height, framerate):
"""Sets the video properties in one operation.
@@ -1048,6 +1046,7 @@ class Project(Loggable, GES.Project):
self._set_video_restriction("framerate", framerate)])
if changed:
self.update_restriction_caps()
+ self.set_modification_state(True)
@property
def audiochannels(self):
@@ -1056,7 +1055,7 @@ class Project(Loggable, GES.Project):
@audiochannels.setter
def audiochannels(self, value):
if self._set_audio_restriction("channels", int(value)):
- self._emit_change("channels")
+ self.set_modification_state(True)
@property
def audiorate(self):
@@ -1068,7 +1067,7 @@ class Project(Loggable, GES.Project):
@audiorate.setter
def audiorate(self, value):
if self._set_audio_restriction("rate", int(value)):
- self._emit_change("rate")
+ self.set_modification_state(True)
@property
def aencoder(self):
@@ -1077,7 +1076,7 @@ class Project(Loggable, GES.Project):
@aencoder.setter
def aencoder(self, preset_factory_name):
if self._update_encoding_profile(self.audio_profile, preset_factory_name):
- self._emit_change("aencoder")
+ self.set_modification_state(True)
@property
def vencoder(self):
@@ -1086,7 +1085,7 @@ class Project(Loggable, GES.Project):
@vencoder.setter
def vencoder(self, preset_factory_name):
if self._update_encoding_profile(self.video_profile, preset_factory_name):
- self._emit_change("vencoder")
+ self.set_modification_state(True)
@property
def muxer(self):
@@ -1095,7 +1094,7 @@ class Project(Loggable, GES.Project):
@muxer.setter
def muxer(self, preset_factory_name):
if self._update_encoding_profile(self.container_profile, preset_factory_name):
- self._emit_change("muxer")
+ self.set_modification_state(True)
def _update_encoding_profile(self, profile, preset_factory_name):
"""Updates the specified encoding profile.
@@ -2135,10 +2134,6 @@ class Project(Loggable, GES.Project):
if emit:
self.emit("settings-set-from-imported-asset", asset)
- def _emit_change(self, key):
- self.emit("rendering-settings-changed", key)
- self.set_modification_state(True)
-
def get_element_factory_name(self, profile):
"""Finds a factory for an element compatible with the specified profile.
diff --git a/pitivi/render.py b/pitivi/render.py
index b7ed75356..d34549e97 100644
--- a/pitivi/render.py
+++ b/pitivi/render.py
@@ -838,8 +838,7 @@ class RenderDialog(Loggable):
self._display_render_settings()
self.window.connect("delete-event", self._delete_event_cb)
- self.project.connect("rendering-settings-changed",
- self._rendering_settings_changed_cb)
+ self.project.connect("video-size-changed", self._project_video_size_changed_cb)
self.presets_manager.connect("profile-updated", self._presets_manager_profile_updated_cb)
@@ -1035,7 +1034,7 @@ class RenderDialog(Loggable):
def _preset_selection_menubutton_clicked_cb(self, button):
self.preset_popover.show_all()
- def _rendering_settings_changed_cb(self, unused_project, unused_item):
+ def _project_video_size_changed_cb(self, project):
"""Handles Project metadata changes."""
self.update_resolution()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]