コード例 #1
0
 def OnPreviewVideo(self, evt):
     h = TrackList.background_size()['height']
     max_height = 480
     scale = min(1, max_height / (h or max_height))
     wx.GetApp().RunInBackground(mix.preview_thread,
                                 TrackList.all_tracks(),
                                 **TrackList.background_size(),
                                 scale=scale)
コード例 #2
0
 def _updateLayout(self, tracks, force=False):
     old_tracks = set(self.m_layoutPreview.GetTrackNames())
     needs_layout = set(old_tracks) != set(t['path'] for t in tracks)
     # Update the layout preview
     self.m_layoutPreview.SetTracks(tracks)
     self.m_layoutPreview.SetBackgroundSize(**TrackList.background_size())
     # New tracks means run the layout again
     if tracks and (needs_layout or force):
         layout = TrackList.as_layout(self.video_width / self.video_height,
                                      self.video_height)
         TrackList.update_from_layout(layout, self.video_width,
                                      self.video_height)
コード例 #3
0
 def OnExportShotcut(self, evt):
     file = dialogs.file_dialog(self, message="Save a file",
                                wildcard="Shotcut Files (*.mlt)|.mlt",
                                style=wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT)
     if file:
         tracks = TrackList.as_mlt_tracks()
         # Folks usually include an image for the background, so add a blank track
         # to make that possible
         tracks.append({'blank_track': True})
         # Shotcut puts the first track at the bottom, so reverse the order
         tracks.reverse()
         with open(file, 'w') as f:
             f.write(mlt.xml.write_file(tracks, **TrackList.background_size()))
コード例 #4
0
 def OnPreviewAudio(self, evt):
     wx.GetApp().RunInBackground(mix.preview_thread,
                                 TrackList.all_tracks(),
                                 **TrackList.background_size(),
                                 audio_only=True)