Beispiel #1
0
        private void mnuFile_DropDownOpening(object sender, EventArgs e)
        {
            mnuExportMovie.DropDownItems.Clear();

            List <UInt32> segments     = new List <UInt32>(HistoryViewerApi.HistoryViewerGetSegments());
            UInt32        segmentStart = 0;

            segments.Add(HistoryViewerApi.HistoryViewerGetHistoryLength() / 60);

            for (int i = 0; i < segments.Count; i++)
            {
                if (segments[i] - segmentStart > 2)
                {
                    //Only list segments that are at least 2 seconds long
                    UInt32   segStart = segmentStart;
                    UInt32   segEnd   = segments[i];
                    TimeSpan start    = new TimeSpan(0, 0, (int)(segmentStart));
                    TimeSpan end      = new TimeSpan(0, 0, (int)(segEnd));

                    string            segmentName = ResourceHelper.GetMessage("MovieSegment", (mnuExportMovie.DropDownItems.Count + 1).ToString());
                    ToolStripMenuItem segmentItem = new ToolStripMenuItem(segmentName + ", " + start.ToString() + " - " + end.ToString());

                    ToolStripMenuItem exportFull = new ToolStripMenuItem(ResourceHelper.GetMessage("MovieExportEntireSegment"));
                    exportFull.Click += (s, evt) => {
                        ExportMovie(segStart, segEnd);
                    };

                    ToolStripMenuItem exportCustomRange = new ToolStripMenuItem(ResourceHelper.GetMessage("MovieExportSpecificRange"));
                    exportCustomRange.Click += (s, evt) => {
                        using (frmSelectExportRange frm = new frmSelectExportRange(segStart, segEnd)) {
                            if (frm.ShowDialog(this) == DialogResult.OK)
                            {
                                ExportMovie(frm.ExportStart, frm.ExportEnd);
                            }
                        }
                    };

                    segmentItem.DropDown.Items.Add(exportFull);
                    segmentItem.DropDown.Items.Add(exportCustomRange);
                    mnuExportMovie.DropDownItems.Add(segmentItem);
                }
                segmentStart = segments[i] + 1;
            }

            mnuImportMovie.Visible = false;
            mnuExportMovie.Enabled = mnuExportMovie.HasDropDownItems;
        }
Beispiel #2
0
        protected override void OnShown(EventArgs e)
        {
            base.OnShown(e);

            HistoryViewerApi.HistoryViewerInitialize(this.Handle, ctrlRenderer.Handle);
            trkPosition.Maximum = (int)(HistoryViewerApi.HistoryViewerGetHistoryLength() / 60);
            UpdatePositionLabel(0);
            EmuApi.Resume(EmuApi.ConsoleId.HistoryViewer);
            tmrUpdatePosition.Start();
            trkVolume.Value = ConfigManager.Config.HistoryViewer.Volume;
            btnPausePlay.Focus();

            UpdateScale();
            this.Resize += (s, evt) => {
                UpdateScale();
            };
        }