コード例 #1
0
        /// <summary>
        /// Launch an OpenFileDialog an populate the TASMovieInputCollection object
        /// according to the type of movie file that's selected
        /// </summary>
        private string loadMovie(ref TASMovieInputCollection location)
        {
            openDlg        = new OpenFileDialog();
            openDlg.Filter = TAS_FILTER;
            openDlg.ShowDialog();
            string filename = openDlg.FileName;

            openDlg.Dispose();

            if (filename.Length == 0)
            {
                return(null);
            }

            TASMovie movie = new TASMovie();

            location        = new TASMovieInputCollection();
            location.Format = IsValid(filename);

            // load the movie object up with the correct format
            switch (location.Format)
            {
            case MovieType.SMV: movie = new SNES9x(filename); break;

            case MovieType.FCM: movie = new FCEU(filename); break;

            case MovieType.GMV: movie = new Gens(filename); break;

            case MovieType.FMV: movie = new Famtasia(filename); break;

            case MovieType.VBM: movie = new VisualBoyAdvance(filename); break;

            case MovieType.M64: movie = new Mupen64(filename); break;

            case MovieType.MMV: movie = new Dega(filename); break;

            case MovieType.PXM: movie = new PCSX(filename); break;      // shares with PJM

            case MovieType.PJM: movie = new PCSX(filename); break;      // shares with PXM
            }
            location.Input       = movie.Input.FrameData;
            location.Controllers = movie.Input.ControllerCount;

            return(filename);
        }
コード例 #2
0
ファイル: PopulateMovieInfo.cs プロジェクト: KaMa4/tas-editor
        /// <summary>
        /// Populate an SNES9x movie file's header information
        /// </summary>
        public static void SMV(ref TreeView tv, ref TASMovie smv)
        {
            SNES9x movie = (SNES9x)smv;

            tv.Nodes.Clear();

            tv.Nodes.Add("Header");
            tv.Nodes[0].Nodes.Add("Signature:      " + movie.Header.Signature);
            tv.Nodes[0].Nodes.Add("Version:        " + movie.Header.Version.ToString());
            tv.Nodes[0].Nodes.Add("UID:            " + movie.Header.UID);
            tv.Nodes[0].Nodes.Add("Frame Count:    " + String.Format("{0:0,0}", movie.Header.FrameCount));
            tv.Nodes[0].Nodes.Add("Rerecord Count: " + String.Format("{0:0,0}", movie.Header.RerecordCount));

            tv.Nodes.Add("Options");
            tv.Nodes[1].Nodes.Add("Movie Start:  " + movie.Options.MovieStart);
            tv.Nodes[1].Nodes.Add("Movie Timing: " + movie.Options.MovieTiming);

            tv.Nodes[1].Nodes.Add("Sync Options");
            tv.Nodes[1].Nodes[2].Nodes.Add("FAKEMUTE:   " + movie.SMVSpecific.FAKEMUTE.ToString());
            tv.Nodes[1].Nodes[2].Nodes.Add("LEFTRIGHT:  " + movie.SMVSpecific.LEFTRIGHT.ToString());
            tv.Nodes[1].Nodes[2].Nodes.Add("SYNCSOUND:  " + movie.SMVSpecific.SYNCSOUND.ToString());
            tv.Nodes[1].Nodes[2].Nodes.Add("VOLUMEENVX: " + movie.SMVSpecific.VOLUMEENVX.ToString());
            tv.Nodes[1].Nodes[2].Nodes.Add("WIP1TIMING: " + movie.SMVSpecific.WIP1TIMING.ToString());
            tv.Nodes[1].Nodes[2].Nodes.Add("SPEEDHACKS: " + (!movie.SMVSpecific.NOCPUSHUTDOWN).ToString());

            tv.Nodes.Add("Metadata");
            tv.Nodes[2].Nodes.Add("Author: " + movie.Extra.Author);

            tv.Nodes.Add("ROM Information");
            tv.Nodes[3].Nodes.Add("ROM Title: " + movie.Extra.ROM);
            tv.Nodes[3].Nodes.Add("ROM CRC:   " + movie.Extra.CRC);

            tv.Nodes.Add("Controllers");
            tv.Nodes[4].Nodes.Add("Controller 1 Present: " + movie.Input.Controllers[0].ToString());
            tv.Nodes[4].Nodes.Add("Controller 2 Present: " + movie.Input.Controllers[1].ToString());
            tv.Nodes[4].Nodes.Add("Controller 3 Present: " + movie.Input.Controllers[2].ToString());
            tv.Nodes[4].Nodes.Add("Controller 4 Present: " + movie.Input.Controllers[3].ToString());
            tv.Nodes[4].Nodes.Add("Controller 5 Present: " + movie.Input.Controllers[4].ToString());

            movie = null; tv.ExpandAll(); tv.Nodes[0].EnsureVisible();
        }