Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
pitivi
Commits
d205a510
Commit
d205a510
authored
Jul 17, 2012
by
Matas Brazdeikis
Committed by
Jeff Fortin Tam
Jul 17, 2012
Browse files
Add a preference for the default duration of image clips in the timeline
Fixes bug #679779
parent
9626708b
Changes
1
Hide whitespace changes
Inline
Side-by-side
pitivi/timeline/timeline.py
View file @
d205a510
...
...
@@ -73,6 +73,18 @@ PreferencesDialog.addNumericPreference('edgeSnapDeadband',
"when dragging or trimming."
),
lower
=
0
)
GlobalSettings
.
addConfigOption
(
'imageClipLength'
,
section
=
"user-interface"
,
key
=
"image-clip-length"
,
default
=
1000
,
notify
=
True
)
PreferencesDialog
.
addNumericPreference
(
'imageClipLength'
,
section
=
_
(
"Behavior"
),
label
=
_
(
"Image clip duration"
),
description
=
_
(
"Default clip length (in miliseconds) of images when inserting on the timeline."
),
lower
=
1
)
# cursors to be used for resizing objects
ARROW
=
gtk
.
gdk
.
Cursor
(
gtk
.
gdk
.
ARROW
)
...
...
@@ -1033,6 +1045,10 @@ class Timeline(gtk.Table, Loggable, Zoomable):
for
info
in
infos
:
src
=
ges
.
TimelineFileSource
(
info
.
get_uri
())
src
.
props
.
start
=
duration
# Set image duration
# FIXME: after GES Materials are merged, check if image instead
if
src
.
props
.
duration
==
0
:
src
.
set_duration
(
long
(
self
.
_settings
.
imageClipLength
)
*
gst
.
SECOND
/
1000
)
duration
+=
info
.
get_duration
()
layer
.
add_object
(
src
)
id
=
src
.
connect
(
"track-object-added"
,
self
.
_trackObjectsCreatedCb
,
src
,
x
,
y
)
...
...
@@ -1043,6 +1059,8 @@ class Timeline(gtk.Table, Loggable, Zoomable):
# are created. We concider that the time between the different
# TrackObject-s creation is short enough so we are all good when the
# first TrackObject is added to the TimelineObject
if
tlobj
.
is_image
():
tlobj
.
set_duration
(
long
(
self
.
_settings
.
imageClipLength
)
*
gst
.
SECOND
/
1000
)
self
.
_temp_objects
.
insert
(
0
,
tlobj
)
tlobj
.
disconnect
(
self
.
_creating_tckobjs_sigid
[
tlobj
])
del
self
.
_creating_tckobjs_sigid
[
tlobj
]
...
...
@@ -1555,6 +1573,10 @@ class Timeline(gtk.Table, Loggable, Zoomable):
timeline
=
self
.
app
.
current
.
timeline
layer
=
timeline
.
get_layers
()[
0
]
# FIXME Get the longest layer
# Set the duration of the clip if it is an image
if
source
.
is_image
():
source
.
set_duration
(
long
(
self
.
_settings
.
imageClipLength
)
*
gst
.
SECOND
/
1000
)
# Handle the case where we just inserted the first clip
if
len
(
layer
.
get_objects
())
==
1
:
source
.
props
.
start
=
0
...
...
Bugzilla
💬
@bugzilla-migration
mentioned in issue
#1248 (closed)
·
Feb 23, 2018
mentioned in issue
#1248 (closed)
mentioned in issue #1248
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment