예제 #1
0
        public EditorLogic(IVideoEditor editor, IVideoPlayer videoPlayer)
        {
            this.editor = editor;
            this.videoPlayer = videoPlayer;
            Proj = new VidkaProj();
            Dimdim = new ProjectDimensions(Proj);
            UiObjects = new VidkaUiStateObjects();
            previewLauncher = new PreviewThreadLauncher(videoPlayer, this);
            ioOps = new VidkaIO();
            Proj_forOriginalPlayback = new VidkaProj();
            IsFileChanged = false;

            EditOpsAll = new EditOperationAbstract[] {
                new EditOperationTrimVideo(this, UiObjects, Dimdim, editor, videoPlayer, TrimDirection.Left, ProjectDimensionsTimelineType.Main),
                new EditOperationTrimVideo(this, UiObjects, Dimdim, editor, videoPlayer, TrimDirection.Right, ProjectDimensionsTimelineType.Main),
                new EditOperationTrimVideo(this, UiObjects, Dimdim, editor, videoPlayer, TrimDirection.Left, ProjectDimensionsTimelineType.Original),
                new EditOperationTrimVideo(this, UiObjects, Dimdim, editor, videoPlayer, TrimDirection.Right, ProjectDimensionsTimelineType.Original),
                new EditOperationMoveVideo(this, UiObjects, Dimdim, editor, videoPlayer),
                new EditOperationSelectOriginalSegment(this, UiObjects, Dimdim, editor, videoPlayer),
            };
            setProjToAllEditOps(Proj);

            FileMapping = Settings.Default.DataNearProject
                ? (VidkaFileMapping)new VidkaFileMapping_proj()
                : (VidkaFileMapping)new VidkaFileMapping_resource();
            dragAndDropMan = new DragAndDropManager(editor, Proj, FileMapping);
            dragAndDropMan.MetaReadyForDraggy += dragAndDropMan_MetaReadyForDraggy;
            dragAndDropMan.MetaReadyForOutstandingVideo += dragAndDropMan_MetaReadyForOutstandingVideo;
            dragAndDropMan.MetaReadyForOutstandingAudio += dragAndDropMan_MetaReadyForOutstandingAudio;
            dragAndDropMan.ThumbOrWaveReady += dragAndDropMan_ThumbOrWaveReady;
        }
예제 #2
0
        private void LoadEditionJob(EditionJob job)
        {
            videoEditor = multimediaToolkit.GetVideoEditor();
            videoEditor.EncodingSettings = job.EncodingSettings;
            videoEditor.Progress        += OnProgress;

            foreach (PlayListPlay segment in job.Playlist)
            {
                if (!ProcessSegment(segment))
                {
                    continue;
                }
            }

            try {
                videoEditor.Start();
            }
            catch (Exception ex) {
                videoEditor.Cancel();
                job.State = JobState.Error;
                Log.Exception(ex);
                Log.Error("Error rendering job: ", job.Name);
                guiToolkit.ErrorMessage(Catalog.GetString("Error rendering job: ") + ex.Message);
            }
        }
예제 #3
0
        private void StartNextJob()
        {
            if (pendingJobs.Count == 0)
            {
                ResetGui();
                return;
            }

            videoEditor           = factory.getVideoEditor();
            videoEditor.Progress += OnProgress;
            currentJob            = pendingJobs[0];
            LoadJob(currentJob);

            try {
                videoEditor.EncodingSettings = currentJob.EncodingSettings;
                videoEditor.EnableTitle      = currentJob.OverlayTitle;
                videoEditor.EnableAudio      = currentJob.EnableAudio;
                videoEditor.Start();
            }
            catch (Exception ex) {
                Log.Exception(ex);
                Log.Error("Error redering job: ", currentJob.Name);
                currentJob.State = JobState.Error;
            }
        }
예제 #4
0
        void LoadEditionJob(EditionJob job)
        {
            videoEditor = App.Current.MultimediaToolkit.GetVideoEditor();
            videoEditor.EncodingSettings = job.EncodingSettings;
            videoEditor.Progress        += OnProgress;
            videoEditor.Error           += OnError;

            foreach (IPlaylistElement segment in job.Playlist.Elements)
            {
                if (segment is PlaylistPlayElement)
                {
                    ProcessPlay(segment as PlaylistPlayElement);
                }
                else if (segment is PlaylistVideo)
                {
                    ProcessVideo(segment as PlaylistVideo);
                }
                else if (segment is PlaylistImage)
                {
                    ProcessImage(segment as PlaylistImage);
                }
                else if (segment is PlaylistDrawing)
                {
                    ProcessDrawing(segment as PlaylistDrawing);
                }
            }
            videoEditor.Start();
        }
        public EditOperationSelectOriginalSegment(ISomeCommonEditorOperations iEditor,
			VidkaUiStateObjects uiObjects,
			ProjectDimensions dimdim,
			IVideoEditor editor,
			IVideoPlayer videoPlayer)
            : base(iEditor, uiObjects, dimdim, editor, videoPlayer)
        {
            keyboardMode = false;
            isStarted = false;
        }
예제 #6
0
        private bool isStarted;         // TODO: future plan to only initialize draggy when drag index is different... will avoid flickering... however there is no information about this index without the draggy

        public EditOperationMoveVideo(ISomeCommonEditorOperations iEditor,
                                      VidkaUiStateObjects uiObjects,
                                      ProjectDimensions dimdim,
                                      IVideoEditor editor,
                                      IVideoPlayer videoPlayer)
            : base(iEditor, uiObjects, dimdim, editor, videoPlayer)
        {
            copyMode     = false;
            keyboardMode = false;
        }
예제 #7
0
        public EditOperationMoveVideo(ISomeCommonEditorOperations iEditor,
			VidkaUiStateObjects uiObjects,
			ProjectDimensions dimdim,
			IVideoEditor editor,
			IVideoPlayer videoPlayer)
            : base(iEditor, uiObjects, dimdim, editor, videoPlayer)
        {
            copyMode = false;
            keyboardMode = false;
        }
 public EditOperationSelectOriginalSegment(ISomeCommonEditorOperations iEditor,
                                           VidkaUiStateObjects uiObjects,
                                           ProjectDimensions dimdim,
                                           IVideoEditor editor,
                                           IVideoPlayer videoPlayer)
     : base(iEditor, uiObjects, dimdim, editor, videoPlayer)
 {
     keyboardMode = false;
     isStarted    = false;
 }
예제 #9
0
        public EditOperationTrimVideo(ISomeCommonEditorOperations iEditor,
			VidkaUiStateObjects uiObjects,
			ProjectDimensions dimdim,
			IVideoEditor editor,
			IVideoPlayer videoPlayer,
			TrimDirection side,
			ProjectDimensionsTimelineType timeline)
            : base(iEditor, uiObjects, dimdim, editor, videoPlayer)
        {
            this.side = side;
            this.timeline = timeline;
            keyboardMode = false;
        }
 public EditOperationTrimVideo(ISomeCommonEditorOperations iEditor,
                               VidkaUiStateObjects uiObjects,
                               ProjectDimensions dimdim,
                               IVideoEditor editor,
                               IVideoPlayer videoPlayer,
                               TrimDirection side,
                               ProjectDimensionsTimelineType timeline)
     : base(iEditor, uiObjects, dimdim, editor, videoPlayer)
 {
     this.side     = side;
     this.timeline = timeline;
     keyboardMode  = false;
 }
예제 #11
0
 public EditOperationAbstract(
     ISomeCommonEditorOperations iEditor,
     VidkaUiStateObjects uiObjects,
     ProjectDimensions dimdim,
     IVideoEditor editor,
     IVideoPlayer videoPlayer)
 {
     this.iEditor     = iEditor;
     this.uiObjects   = uiObjects;
     this.dimdim      = dimdim;
     this.editor      = editor;
     this.videoPlayer = videoPlayer;
 }
예제 #12
0
        public EditOperationAbstract(
			ISomeCommonEditorOperations iEditor,
			VidkaUiStateObjects uiObjects,
			ProjectDimensions dimdim,
			IVideoEditor editor,
			IVideoPlayer videoPlayer)
        {
            this.iEditor = iEditor;
            this.uiObjects = uiObjects;
            this.dimdim = dimdim;
            this.editor = editor;
            this.videoPlayer = videoPlayer;
        }
예제 #13
0
        void CleanVideoEditor(bool cancel = false)
        {
            if (videoEditor == null)
            {
                return;
            }

            videoEditor.Progress -= OnProgress;
            videoEditor.Error    -= OnError;
            if (cancel)
            {
                videoEditor.Cancel();
            }
            videoEditor = null;
        }
예제 #14
0
        void LoadConversionJob(ConversionJob job)
        {
            videoEditor = App.Current.MultimediaToolkit.GetVideoEditor();
            videoEditor.EncodingSettings = job.EncodingSettings;
            videoEditor.Progress        += OnProgress;
            videoEditor.Error           += OnError;

            foreach (MediaFile file in job.InputFiles)
            {
                PlaylistVideo video = new PlaylistVideo(file);
                Log.Debug("Convert video " + video.File.FilePath);
                videoEditor.AddSegment(video.File.FilePath, 0, -1, 1, "", video.File.HasAudio, new Area());
            }

            videoEditor.Start();
        }
예제 #15
0
 public DragAndDropManager(IVideoEditor editor, VidkaProj proj, VidkaFileMapping fileMapping)
 {
     this.editor = editor;
     Proj = proj;
     Mode = DragAndDropManagerMode.None;
     _draggies = new List<DragAndDropMediaFile>();
     outstandingVideo = new List<VidkaClipVideo>();
     outstandingAudio = new List<VidkaClipAudio>();
     EXT_video = Settings.Default.FileExtensionsVideo.Split('|');
     EXT_audio = Settings.Default.FileExtensionsAudio.Split('|');
     metaGenerator = new MetaGeneratorInOtherThread(fileMapping);
     //metaGenerator.OneItemFinished += metaGenerator_OneItemFinished;
     //metaGenerator.MetaGeneratorDone += metaGenerator_MetaGeneratorDone;
     metaGenerator.HereIsSomeTextForConsole += genericListener_AppendToConsole;
     metaGenerator.MetaReady += metaGenerator_MetaReady;
     metaGenerator.ThumbnailsReady += metaGenerator_ThumbReady;
     metaGenerator.WaveformReady += metaGenerator_WaveReady;
 }
 public DragAndDropManager(IVideoEditor editor, VidkaProj proj, VidkaFileMapping fileMapping)
 {
     this.editor      = editor;
     Proj             = proj;
     Mode             = DragAndDropManagerMode.None;
     _draggies        = new List <DragAndDropMediaFile>();
     outstandingVideo = new List <VidkaClipVideo>();
     outstandingAudio = new List <VidkaClipAudio>();
     EXT_video        = Settings.Default.FileExtensionsVideo.Split('|');
     EXT_audio        = Settings.Default.FileExtensionsAudio.Split('|');
     metaGenerator    = new MetaGeneratorInOtherThread(fileMapping);
     //metaGenerator.OneItemFinished += metaGenerator_OneItemFinished;
     //metaGenerator.MetaGeneratorDone += metaGenerator_MetaGeneratorDone;
     metaGenerator.HereIsSomeTextForConsole += genericListener_AppendToConsole;
     metaGenerator.MetaReady       += metaGenerator_MetaReady;
     metaGenerator.ThumbnailsReady += metaGenerator_ThumbReady;
     metaGenerator.WaveformReady   += metaGenerator_WaveReady;
 }
예제 #17
0
        private void LoadEditionJob(EditionJob job)
        {
            videoEditor = multimediaToolkit.GetVideoEditor();
            videoEditor.EncodingSettings = job.EncodingSettings;
            videoEditor.Progress        += OnProgress;
            videoEditor.Error           += OnError;

            foreach (IPlaylistElement segment in job.Playlist.Elements)
            {
                if (segment is PlaylistPlayElement)
                {
                    ProcessPlay(segment as PlaylistPlayElement);
                }
                else if (segment is PlaylistVideo)
                {
                    ProcessVideo(segment as PlaylistVideo);
                }
                else if (segment is PlaylistImage)
                {
                    ProcessImage(segment as PlaylistImage);
                }
                else if (segment is PlaylistDrawing)
                {
                    ProcessDrawing(segment as PlaylistDrawing);
                }
            }

            try {
                videoEditor.Start();
            } catch (Exception ex) {
                videoEditor.Cancel();
                job.State = JobState.Error;
                Log.Exception(ex);
                Log.Error("Error rendering job: ", job.Name);
                guiToolkit.ErrorMessage(Catalog.GetString("Error rendering job: ") + ex.Message);
            }
        }
        private void StartNextJob()
        {
            if (pendingJobs.Count == 0) {
                ResetGui();
                return;
            }

            videoEditor = multimediaToolkit.GetVideoEditor();
            videoEditor.Progress += OnProgress;
            currentJob = pendingJobs[0];
            LoadJob(currentJob);

            try {
                videoEditor.EncodingSettings = currentJob.EncodingSettings;
                videoEditor.EnableTitle = currentJob.OverlayTitle;
                videoEditor.EnableAudio = currentJob.EnableAudio;
                videoEditor.Start();
            }
            catch(Exception ex) {
                Log.Exception(ex);
                Log.Error("Error redering job: ", currentJob.Name);
                currentJob.State = JobState.Error;
            }
        }
예제 #19
0
        private void LoadEditionJob(EditionJob job)
        {
            videoEditor = multimediaToolkit.GetVideoEditor ();
            videoEditor.EncodingSettings = job.EncodingSettings;
            videoEditor.Progress += OnProgress;
            videoEditor.Error += OnError;

            foreach (IPlaylistElement segment in job.Playlist.Elements) {
                if (segment is PlaylistPlayElement) {
                    ProcessPlay (segment as PlaylistPlayElement);
                } else if (segment is PlaylistVideo) {
                    ProcessVideo (segment as PlaylistVideo);
                } else if (segment is PlaylistImage) {
                    ProcessImage (segment as PlaylistImage);
                } else if (segment is PlaylistDrawing) {
                    ProcessDrawing (segment as PlaylistDrawing);
                }
            }

            try {
                videoEditor.Start ();
            } catch (Exception ex) {
                videoEditor.Cancel ();
                job.State = JobState.Error;
                Log.Exception (ex);
                Log.Error ("Error rendering job: ", job.Name);
                guiToolkit.ErrorMessage (Catalog.GetString ("Error rendering job: ") + ex.Message);
            }
        }