OpenShot Video Editor  2.0.0
clip.py
Go to the documentation of this file.
1 ##
2 #
3 # @file
4 # @brief This file is for legacy support of OpenShot 1.x project files
5 # @author Jonathan Thomas <jonathan@openshot.org>
6 #
7 # @section LICENSE
8 #
9 # Copyright (c) 2008-2018 OpenShot Studios, LLC
10 # (http://www.openshotstudios.com). This file is part of
11 # OpenShot Video Editor (http://www.openshot.org), an open-source project
12 # dedicated to delivering high quality video editing and animation solutions
13 # to the world.
14 #
15 # OpenShot Video Editor is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU General Public License as published by
17 # the Free Software Foundation, either version 3 of the License, or
18 # (at your option) any later version.
19 #
20 # OpenShot Video Editor is distributed in the hope that it will be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 # GNU General Public License for more details.
24 #
25 # You should have received a copy of the GNU General Public License
26 # along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
27 #
28 
29 import uuid
30 from classes.legacy.openshot.classes import keyframe
31 
32 
33 ##
34 # This class represents a media clip on the timeline.
35 class clip:
36 
37  # ----------------------------------------------------------------------
38  ##
39  # Constructor
40  def __init__(self, clip_name, color, position_on_track, start_time, end_time, parent_track, file_object):
41 
42  # init variables for clip object
43  self.name = clip_name # the name of the clip
44  self.color = color # the color of the clip, used to organize clips
45  self.start_time = start_time # the time in seconds where we start playing a clip
46  self.end_time = end_time # the time in seconds where we stop playing a clip
47  self.speed = 1.0 # the rate of playback (this will change if you want to slow down or speed up the clip)
48  self.max_length = 0.0 # this is the max length of the clip in seconds
49  self.position_on_track = float(
50  position_on_track) # the time in seconds to start playing the clip relative to the track
51  self.play_video = True
52  self.play_audio = True
53  self.fill = True
54  self.distort = False
55  self.composite = True
56  self.halign = "centre"
57  self.valign = "centre"
58  self.reversed = False
59  self.volume = 100.0
60  self.audio_fade_in = False
61  self.audio_fade_out = False
64  self.video_fade_in = False
65  self.video_fade_out = False
68  self.parent = parent_track # the parent track this clip lives on
69  self.file_object = file_object # the file object that this clip is linked to
70  self.unique_id = str(uuid.uuid1())
71  self.rotation = 0.0
72  self.thumb_location = ""
73 
74  # init key-frame dictionary
75  self.keyframes = {"start": keyframe(0, 100.0, 100.0, 0.0, 0.0, 1.0),
76  "end": keyframe(-1, 100.0, 100.0, 0.0, 0.0, 1.0)}
77 
78  # init effects dictionary
79  self.effects = []
80 
81  # init vars for drag n drop
82  self.drag_x = 0.0
83  self.drag_y = 0.0
84  self.moved = False
85  self.is_timeline_scrolling = False
valign
Definition: clip.py:57
rotation
Definition: clip.py:71
composite
Definition: clip.py:55
file_object
Definition: clip.py:69
audio_fade_out
Definition: clip.py:61
drag_x
Definition: clip.py:82
color
Definition: clip.py:44
video_fade_out_amount
Definition: clip.py:67
unique_id
Definition: clip.py:70
parent
Definition: clip.py:68
name
Definition: clip.py:43
audio_fade_in
Definition: clip.py:60
volume
Definition: clip.py:59
end_time
Definition: clip.py:46
position_on_track
Definition: clip.py:49
def __init__
Constructor.
Definition: clip.py:40
effects
Definition: clip.py:79
speed
Definition: clip.py:47
play_audio
Definition: clip.py:52
thumb_location
Definition: clip.py:72
reversed
Definition: clip.py:58
play_video
Definition: clip.py:51
video_fade_in
Definition: clip.py:64
video_fade_in_amount
Definition: clip.py:66
fill
Definition: clip.py:53
audio_fade_in_amount
Definition: clip.py:62
moved
Definition: clip.py:84
halign
Definition: clip.py:56
keyframes
Definition: clip.py:75
max_length
Definition: clip.py:48
video_fade_out
Definition: clip.py:65
is_timeline_scrolling
Definition: clip.py:85
audio_fade_out_amount
Definition: clip.py:63
This class represents a media clip on the timeline.
Definition: clip.py:35
drag_y
Definition: clip.py:83
distort
Definition: clip.py:54
start_time
Definition: clip.py:45