Merge lp:~nagos/openshot/nagos into lp:openshot/1.4

Proposed by Vladimir Yakovlev
Status: Needs review
Proposed branch: lp:~nagos/openshot/nagos
Merge into: lp:openshot/1.4
Diff against target: 218 lines (+89/-18)
5 files modified
openshot/classes/clip.py (+27/-0)
openshot/classes/track.py (+7/-8)
openshot/windows/MainGTK.py (+36/-0)
openshot/windows/glade/Main.glade (+14/-0)
openshot/windows/preferences.py (+5/-10)
To merge this branch: bzr merge lp:~nagos/openshot/nagos
Reviewer Review Type Date Requested Status
Jonathan Thomas Pending
Review via email: mp+20318@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Vladimir Yakovlev (nagos) wrote :

New feature to remove empty spaces in project. Space removed from all tracks without destroying transitions and relative position of clips.
Now it in project menu.

Plus proper clips compare thru __cmp__ without compare_clip. All sort/min/max work simply like sort([clip1,clip2])

Snap of razor. If you click in 10 pixels away from playhead, clip will be divided in playhead position. Snap button enable/disable this feature.

BUG:518504 Tabs in preferences can't be switched in localised version.

Enable/disable audio/video buttons now can be clicked only with arrow cursor. Without it clit divided in two with disabled audio.

Minor localisation strings.

lp:~nagos/openshot/nagos updated
209. By Vladimir Yakovlev

Bug with overlaying clips

210. By Vladimir Yakovlev

Last changes from main branch

Unmerged revisions

210. By Vladimir Yakovlev

Last changes from main branch

209. By Vladimir Yakovlev

Bug with overlaying clips

208. By Vladimir Yakovlev

New feature to remove empty spaces in project. Space removed from all tracks without destroying transitions and relative position of clips.
Now it in project menu.

Plus proper clips compare thry __cmp__ without compare_clip. All sort/min/max work simply like sort([clip1,clip2])

207. By Vladimir Yakovlev

Snap razor position only if Snap kep enabled

206. By Vladimir Yakovlev

Enable/Disable of video/audio now work only with arrow key. Now you can slice clip in position of audio button.

205. By Vladimir Yakovlev

openshot/openshot_render.py now executable

204. By Vladimir Yakovlev

Rounding splitting position.
Split track on video position if clicked in 10 pixels around.

203. By Vladimir Yakovlev

Some more av format translations

202. By Vladimir Yakovlev

No need to compare categories by name in on_icvCategories_selection_changed, left icon list is not sortable.

201. By Vladimir Yakovlev

AV Formats localization

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openshot/classes/clip.py'
2--- openshot/classes/clip.py 2010-02-27 19:51:35 +0000
3+++ openshot/classes/clip.py 2010-04-06 18:25:42 +0000
4@@ -74,6 +74,17 @@
5 # end_time = 25.0
6 # position_on_track = 3.0
7
8+ def __cmp__(self, other):
9+ return cmp(self.position_on_track, other.position_on_track)
10+
11+ def __eq__(self, other):
12+ if type(self)<>type(other): return False
13+ if self.position_on_track == other.position_on_track: return True
14+ else: return False
15+
16+ def __ne__(self,other):
17+ if type(self)<>type(other): return False
18+ return self.position_on_track <> other.position_on_track
19
20 def length(self):
21 # calculate the length of this clip (in decimal seconds)
22@@ -1640,6 +1651,14 @@
23 seconds_for_x = x / pixels_per_second
24 original_clip_length = self.length()
25 original_end_time = self.end_time
26+
27+ #split in video position if clicked not far from it
28+ (isArrow, isRazor, isSnap, isResize) = self.parent.parent.project.form.get_toolbar_options()
29+ if isSnap:
30+ video_frame = self.parent.parent.project.form.MyVideo.p.position()
31+ video_position = video_frame / self.parent.parent.project.fps()
32+ video_pixel = video_position*pixels_per_second
33+ if abs(video_pixel - x) < 10: seconds_for_x = video_position
34
35 # remove clip from goocanvas
36 parent = canvas_item.get_parent()
37@@ -1884,6 +1903,10 @@
38
39
40 def on_visible_click (self, item, target, event):
41+ #work only with arrow cursor
42+ (isArrow, isRazor, isSnap, isResize) = self.parent.parent.project.form.get_toolbar_options()
43+ if not isArrow: return
44+
45 # get a reference to the 2 main canvas objects & theme
46 theme = self.parent.parent.project.theme
47
48@@ -1915,6 +1938,10 @@
49
50
51 def on_audio_click (self, item, target, event):
52+ #work only with arrow cursor
53+ (isArrow, isRazor, isSnap, isResize) = self.parent.parent.project.form.get_toolbar_options()
54+ if not isArrow: return
55+
56 # get a reference to the 2 main canvas objects & theme
57 theme = self.parent.parent.project.theme
58
59
60=== modified file 'openshot/classes/track.py'
61--- openshot/classes/track.py 2010-01-31 22:50:27 +0000
62+++ openshot/classes/track.py 2010-04-06 18:25:42 +0000
63@@ -19,6 +19,7 @@
64 import uuid
65 import gtk, goocanvas
66 from classes import clip, files, transition
67+import warnings
68
69 # init the foreign language
70 from language import Language_Init
71@@ -320,16 +321,14 @@
72
73 def reorder_clips(self):
74 # get a list of all clips on this track
75- self.clips.sort(self.compare_clip)
76+ self.clips.sort()
77
78
79 def compare_clip(self, MyClip1, MyClip2):
80- if MyClip1.position_on_track > MyClip2.position_on_track:
81- return 1
82- elif MyClip1.position_on_track == MyClip2.position_on_track:
83- return 0
84- else:
85- return -1
86+ warnings.warn('compare_clip not need more.'
87+ ' Just use clip1==clip2 or sorted([clip1,clip2])',
88+ DeprecationWarning,2)
89+ return cmp(MyClip1,MyClip2)
90
91
92 def reorder_transitions(self):
93@@ -343,4 +342,4 @@
94 elif MyClip1.position_on_track == MyClip2.position_on_track:
95 return 0
96 else:
97- return -1
98\ No newline at end of file
99+ return -1
100
101=== modified file 'openshot/openshot_render.py' (properties changed: -x to +x)
102=== modified file 'openshot/windows/MainGTK.py'
103--- openshot/windows/MainGTK.py 2010-03-30 04:23:04 +0000
104+++ openshot/windows/MainGTK.py 2010-04-06 18:25:42 +0000
105@@ -1177,6 +1177,42 @@
106 print "on_mnuNewTitle_activate called with self.%s" % widget.get_name()
107 Titles.frmNewTitle(form=self, project=self.project)
108
109+ def on_mnuClearSpace_activate(self, widget, *args):
110+ print "on_mnuClearSpace_activate called with self.%s" % widget.get_name()
111+
112+ def moveClips(pos,length):
113+ for clip in all_clips:
114+ if clip.position_on_track>=pos:
115+ clip.position_on_track-=length
116+ ph = self.project.sequences[0].play_head_position
117+ if ph >= pos:
118+ self.project.sequences[0].move_play_head(ph-length)
119+ self.project.sequences[0].update_video()
120+ for trans in self.project.sequences[0].tracks[0].transitions:
121+ if trans.position_on_track>=pos:
122+ trans.position_on_track-=length
123+
124+ #create large clip pool
125+ all_clips=[]
126+ for track in self.project.sequences[0].tracks:
127+ for clip in track.clips: all_clips.append(clip)
128+
129+ all_clips = sorted(all_clips)
130+ for clip in all_clips:
131+ index = all_clips.index(clip)
132+ space = 0
133+ if index == 0 :
134+ space = clip.position_on_track
135+ elif index > 0:
136+ prevs=filter(lambda x: x.position_on_track < clip.position_on_track, all_clips)
137+ prev = max(prevs,key=lambda x: x.position_on_track+x.length())
138+ space = clip.position_on_track - \
139+ (prev.position_on_track+prev.length())
140+ if space > 0: moveClips(clip.position_on_track,space)
141+
142+ self.project.sequences[0].Render()
143+ self.project.sequences[0].RenderPlayHead()
144+ self.project.set_project_modified(is_modified=True, refresh_xml=True, type = _("Space Cleared"))
145
146 def on_mnuNewSequence_activate(self, widget, *args):
147 print "on_mnuNewSequence_activate called with self.%s" % widget.get_name()
148
149=== modified file 'openshot/windows/glade/Main.glade'
150--- openshot/windows/glade/Main.glade 2010-03-11 07:13:31 +0000
151+++ openshot/windows/glade/Main.glade 2010-04-06 18:25:42 +0000
152@@ -244,6 +244,20 @@
153 </widget>
154 </child>
155 <child>
156+ <widget class="GtkImageMenuItem" id="mnuClearSpace">
157+ <property name="visible">True</property>
158+ <property name="label" translatable="yes">Clear Space</property>
159+ <property name="use_underline">True</property>
160+ <signal name="activate" handler="on_mnuClearSpace_activate"/>
161+ <child internal-child="image">
162+ <widget class="GtkImage" id="menu-item-image30">
163+ <property name="visible">True</property>
164+ <property name="stock">gtk-new</property>
165+ </widget>
166+ </child>
167+ </widget>
168+ </child>
169+ <child>
170 <widget class="GtkImageMenuItem" id="mnuNewSequence">
171 <property name="label" translatable="yes">New Sequence...</property>
172 <property name="use_underline">True</property>
173
174=== modified file 'openshot/windows/preferences.py'
175--- openshot/windows/preferences.py 2010-02-19 06:26:14 +0000
176+++ openshot/windows/preferences.py 2010-04-06 18:25:42 +0000
177@@ -90,14 +90,17 @@
178
179 self.VCodecList = gtk.ListStore(str)
180 self.tvVCodecs.set_model(self.VCodecList)
181+
182 tree.treeviewAddGeneralTextColumn(self.tvVCodecs,_('Video Codecs'),0)
183
184 self.ACodecList = gtk.ListStore(str)
185 self.tvACodecs.set_model(self.ACodecList)
186+
187 tree.treeviewAddGeneralTextColumn(self.tvACodecs,_('Audio Codecs'),0)
188
189 self.FormatsList = gtk.ListStore(str)
190 self.tvFormats.set_model(self.FormatsList)
191+
192 tree.treeviewAddGeneralTextColumn(self.tvFormats,_('Formats'),0)
193
194 self.populate_codecs()
195@@ -200,15 +203,7 @@
196 selected = icon_view.get_selected_items()
197 if len(selected) == 0: return
198 i = selected[0][0]
199- category = self.model[i][0]
200- if category == _("General"):
201- self.nbPrefPages.set_current_page(0)
202- #When adding extra categories,
203- #include them in this 'If' statement
204- elif category == _("AV Formats"):
205- self.nbPrefPages.set_current_page(1)
206- elif category == _("Profiles"):
207- self.nbPrefPages.set_current_page(2)
208+ self.nbPrefPages.set_current_page(i)
209
210 def on_btnManageProfiles_clicked(self, widget, *args):
211 print "on_btnManageProfiles_clicked"
212@@ -395,4 +390,4 @@
213 frm_titles.run()
214
215 if __name__ == "__main__":
216- main()
217\ No newline at end of file
218+ main()

Subscribers

People subscribed via source and target branches

to status/vote changes: