/// <summary> /// Save the current movie out to a new file /// </summary> private void mnuSaveAs_Click(object sender, EventArgs e) { if (FrameData.Format != MovieType.None) { frmSaveAs frm = new frmSaveAs(ref Movie, ref FrameData, "new-"); frm.ShowDialog(); frm.Dispose(); } }
/// <summary> /// Perform the splice /// </summary> private void btnSplice_Click(object sender, EventArgs e) { // exit if not enough movies are opened if (Movies.Length < 2) { MessageBox.Show(frmMain.frm, "At least two (2) movies must be loaded for splicing to be performed", "Movie Count Too Low", MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1); return; } // ensure all loaded movies are of the same type for (int i = 0; i < Movies.Length - 1; i++) { if (Movies[i].MovieType != Movies[i + 1].MovieType) { MessageBox.Show(frmMain.frm, "Movies aren't all of the same type", "Type Mismatch", MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1); return; } } TASMovieInput[] spliced = new TASMovieInput[0]; for (int i = 0; i < Movies.Length; i++) { // handle zeroes if (Movies[i].End == 0) { Movies[i].End = Movies[i].Movie.Header.FrameCount; } // NOTE::increase VBM by 1 frame since we enumerate from zero if (Movies[i].MovieType == MovieType.VBM) { Movies[i].End++; } spliced = TASMovieInput.Splice(ref spliced, ref Movies[i].Movie.Input.FrameData, 0, spliced.Length, Movies[i].Start, Movies[i].End); } TASMovieInputCollection temp = new TASMovieInputCollection(); temp.Format = Movies[0].MovieType; temp.Input = spliced; frmSaveAs frm = new frmSaveAs(ref Movies[0].Movie, ref temp, "spliced-"); frm.ShowDialog(); frm.Dispose(); }
/// <summary> /// Perform the splice /// </summary> private void btnSplice_Click(object sender, EventArgs e) { // exit if not enough movies are opened if (Movies.Length < 2) { MessageBox.Show(frmMain.frm, "At least two (2) movies must be loaded for splicing to be performed", "Movie Count Too Low", MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1); return; } // ensure all loaded movies are of the same type for (int i = 0; i < Movies.Length - 1; i++) { if (Movies[i].MovieType != Movies[i + 1].MovieType) { MessageBox.Show(frmMain.frm, "Movies aren't all of the same type", "Type Mismatch", MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1); return; } } TASMovieInput[] spliced = new TASMovieInput[0]; for (int i = 0; i < Movies.Length; i++) { // handle zeroes if (Movies[i].End == 0) Movies[i].End = Movies[i].Movie.Header.FrameCount; // NOTE::increase VBM by 1 frame since we enumerate from zero if (Movies[i].MovieType == MovieType.VBM) Movies[i].End++; spliced = TASMovieInput.Splice(ref spliced, ref Movies[i].Movie.Input.FrameData, 0, spliced.Length, Movies[i].Start, Movies[i].End); } TASMovieInputCollection temp = new TASMovieInputCollection(); temp.Format = Movies[0].MovieType; temp.Input = spliced; frmSaveAs frm = new frmSaveAs(ref Movies[0].Movie, ref temp, "spliced-"); frm.ShowDialog(); frm.Dispose(); }