コード例 #1
0
        private void mnuLoad_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog {
                Filter = "XML-File|*.xml"
            };

            if (dialog.ShowDialog(this) != true)
            {
                return;
            }

            BeatProject project = BeatProject.Load(dialog.FileName);

            if (project.VideoFile != VideoPlayer.OpenedFile)
            {
                VideoPlayer.Open(project.VideoFile);
            }

            timePanel.Children.Clear();

            foreach (var beatSegment in project.Segments)
            {
                BeatContainer container = new BeatContainer();
                container.SetBeatSegment(beatSegment);

                timePanel.Children.Add(container);
            }
        }
コード例 #2
0
        private void mnuLoadProject_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog {
                Filter = "Beat Projects|*.bproj"
            };

            if (dialog.ShowDialog(this) != true)
            {
                return;
            }

            BeatProject project = BeatProject.Load(dialog.FileName);

            if (File.Exists(project.VideoFile))
            {
                OpenVideo(project.VideoFile, true, false);
            }
            else
            {
                string otherPath = ChangePath(dialog.FileName, project.VideoFile);
                OpenVideo(otherPath, true, false);
            }

            SetCondition(project.SampleCondition);
            BeatBarDuration = TimeSpan.FromSeconds(project.BeatBarDuration);
            BeatBarCenter   = project.BeatBarMidpoint;
            Beats           = new BeatCollection(project.Beats.Select(TimeSpan.FromTicks));
            Bookmarks       = project.Bookmarks.Select(TimeSpan.FromTicks).ToList();

            _projectFile = dialog.FileName;
        }
コード例 #3
0
        private void mnuSaveProject_Click(object sender, RoutedEventArgs e)
        {
            if (String.IsNullOrWhiteSpace(_openFile))
            {
                return;
            }

            SaveFileDialog dialog = new SaveFileDialog {
                Filter = "Beat Projects|*.bproj"
            };

            dialog.FileName = Path.ChangeExtension(_openFile, ".bproj");

            if (dialog.ShowDialog(this) != true)
            {
                return;
            }

            BeatProject project = new BeatProject
            {
                VideoFile       = _openFile,
                SampleCondition = _condition,
                BeatBarDuration = BeatBar.TotalDisplayedDuration,
                BeatBarMidpoint = BeatBar.Midpoint,
                Beats           = Beats.Select(b => b.Ticks).ToList(),
                Bookmarks       = Bookmarks.Select(b => b.Ticks).ToList()
            };

            project.Save(dialog.FileName);
        }
コード例 #4
0
        private void SaveProjectAs(string filename)
        {
            BeatProject project = new BeatProject
            {
                VideoFile       = _videoFile,
                SampleCondition = _condition,
                BeatBarDuration = BeatBar.TotalDisplayedDuration.TotalSeconds,
                BeatBarMidpoint = BeatBar.Midpoint,
                Beats           = Beats.Select(b => b.Ticks).ToList(),
                Bookmarks       = Bookmarks.Select(b => b.Ticks).ToList()
            };

            project.Save(filename);
            _projectFile = filename;

            SaveAsFunscript(Path.ChangeExtension(_videoFile, "funscript"));
            SaveAsBeatsFile(Path.ChangeExtension(_videoFile, "txt"));
        }
コード例 #5
0
        private void mnuLoadProject_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog {
                Filter = "Beat Projects|*.bproj"
            };

            if (dialog.ShowDialog(this) != true)
            {
                return;
            }

            BeatProject project = BeatProject.Load(dialog.FileName);

            OpenVideo(project.VideoFile);
            SetCondition(project.SampleCondition);
            BeatBarDuration = project.BeatBarDuration;
            BeatBarCenter   = project.BeatBarMidpoint;
            Beats           = new BeatCollection(project.Beats.Select(TimeSpan.FromTicks));
            Bookmarks       = project.Bookmarks.Select(TimeSpan.FromTicks).ToList();
        }
コード例 #6
0
        private void mnuSave_Click(object sender, RoutedEventArgs e)
        {
            SaveFileDialog dialog = new SaveFileDialog {
                Filter = "XML-File|*.xml"
            };

            if (dialog.ShowDialog(this) != true)
            {
                return;
            }

            BeatProject project = new BeatProject();

            project.VideoFile = VideoPlayer.OpenedFile;

            foreach (BeatContainer container in timePanel.Children)
            {
                project.Segments.Add(container.GetBeatSegment());
            }

            project.Save(dialog.FileName);
        }