示例#1
0
        private void CheckPlayTime()
        {
            var seconds = ViewTimeline.Position.TotalSeconds;

            Canvas.SetLeft(CurrentTime, seconds);
            for (var i = Model.MediaTracks.Count - 1; i >= 0; i--)
            {
                if (InPatchSection(Model.MediaTracks[i], seconds))
                {
                    if (currentPatch == Model.MediaTracks[i])
                    {
                        return;
                    }

                    currentPatch       = Model.MediaTracks[i];
                    PatchWindow.Source = Model.MediaTracks[i].Path;

                    var shift    = currentPatch.LeftShift;
                    var position = seconds - (shift);
                    PatchWindow.Position = TimeSpan.FromSeconds(position);
                    PatchWindow.Play();

                    ViewTimeline.Volume     = 0;
                    ViewTimeline.Visibility = System.Windows.Visibility.Collapsed;

                    return;
                }
            }
            PatchWindow.Pause();
            ViewTimeline.Volume     = volume;
            ViewTimeline.Visibility = System.Windows.Visibility.Visible;
            currentPatch            = null;
        }
示例#2
0
        private void CheckPlayTime()
        {
            if (Model.WindowState.isPlaying)
            {
                Model.WindowState.TimeSet += 0.1;
            }
            var pixelsRelativeToSeconds = Model.WindowState.TimeSet * Model.Scale;

            CheckSubtitle(pixelsRelativeToSeconds);
            for (var i = Model.MediaTracks.Count - 1; i >= 0; i--)
            {
                if (InPatchSection(Model.MediaTracks[i], pixelsRelativeToSeconds))
                {
                    ViewTimeline.Pause();
                    Canvas.SetLeft(CurrentTime, Model.WindowState.TimeSet * Model.Scale);
                    if (Model.WindowState.currentPatch == Model.MediaTracks[i])
                    {
                        return;
                    }

                    Model.WindowState.currentPatch = Model.MediaTracks[i];
                    PatchWindow.Source             = Model.MediaTracks[i].Path;

                    var shift    = Model.WindowState.currentPatch.LeftShiftInPixels;
                    var position = pixelsRelativeToSeconds - shift + Model.WindowState.currentPatch.StartPixel;
                    PatchWindow.Position = TimeSpan.FromSeconds(position / Model.Scale);
                    if (Model.WindowState.isPlaying)
                    {
                        PatchWindow.Play();
                    }

                    ViewTimeline.Volume     = 0;
                    ViewTimeline.Visibility = System.Windows.Visibility.Hidden;
                    PatchWindow.Visibility  = System.Windows.Visibility.Visible;
                    Canvas.SetLeft(CurrentTime, Model.WindowState.TimeSet * Model.Scale);
                    return;
                }
            }
            PatchWindow.Pause();
            if (Model.WindowState.isPlaying)
            {
                ViewTimeline.Play();
            }
            PatchWindow.Visibility         = System.Windows.Visibility.Collapsed;
            ViewTimeline.Volume            = Model.WindowState.volume;
            ViewTimeline.Visibility        = System.Windows.Visibility.Visible;
            Model.WindowState.currentPatch = null;
            Canvas.SetLeft(CurrentTime, Model.WindowState.TimeSet * Model.Scale);
        }
示例#3
0
        private void RangeSlider_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var pos    = e.GetPosition(Tracks).X;
            var slider = (RangeSlider)sender;
            var tr     = slider.DataContext as TrackInfo;

            if (tr is MediaTrack)
            {
                Model.MediaTracks.Remove((MediaTrack)tr);
                PatchWindow.Stop();
                PatchWindow.Source = null;
            }
            else
            {
                Model.Subtitles.Remove((Subtitle)tr);
            }
        }
        void Awake()
        {
            try
            {
                HarmonyInstance harmony = HarmonyInstance.Create("com.Albeoris.Encased.NuclearEdition.Patches");

                PatchGameModeProcessor.Patch(harmony);
                PatchAutoInputProcessor.Patch(harmony);
                PatchOpenContainerAbilityHandler.Patch(harmony);
                PatchSearchAbilityHandler.Patch(harmony);
                PatchWindow.Patch(harmony);

                Debug.Log("[Encased.NuclearEdition] Successfully patched via Harmony.");
            }
            catch (Exception ex)
            {
                Debug.Log($"[Encased.NuclearEdition] Failed to patch via Harmony. Error: {ex}");
            }
        }
示例#5
0
 private void PausedChanged()
 {
     if (Model.WindowState.isPlaying)
     {
         ViewTimeline.Pause();
         PatchWindow.Pause();
         Model.WindowState.isPlaying = false;
         return;
     }
     else if (!Model.WindowState.isLoaded)
     {
         doInitialLoad();
         return;
     }
     else
     {
         ViewTimeline.Play(); PatchWindow.Play(); Model.WindowState.isPlaying = true;
     }
 }
示例#6
0
        private void addTrack(string path, bool isTutoPatch, int episodeNumber, EditorModel model)
        {
            var seconds = Model.WindowState.TimeSet;
            var track   = new MediaTrack(path, Model.ScaleInfo, isTutoPatch);

            track.ModelHash          = model == null ? "" : model.Montage.RawVideoHash;
            track.EpisodeNumber      = episodeNumber;
            track.LeftShiftInSeconds = seconds;
            track.TopShift           = Top;
            track.DurationInPixels   = 10;
            Model.PropertyChanged   += (s, a) => track.NotifyScaleChanged();
            Model.MediaTracks.Add(track);
            PatchWindow.MediaOpened += SetPatchDuration;
            PatchWindow.Stop();
            PatchWindow.Source = null;
            PatchWindow.Source = new Uri(path);
            PatchWindow.Play(); //need to fire event to get duration
            PatchWindow.Pause();
        }
示例#7
0
        public AudimatWindow()
        {
            settings = new Settings();          //read prog settings in from config file

            InitializeComponent();

            //control panel goes just below menubar
            controlPanel = new ControlPanel(this);
            this.Controls.Add(controlPanel);
            controlPanel.Location = new Point(this.ClientRectangle.Left, AudimatMenu.Bottom);
            this.Controls.Add(controlPanel);

            //rack control fills up entire client area between control panel & status bar
            rack          = new VSTRack(this);
            rack.Location = new Point(this.ClientRectangle.Left, controlPanel.Bottom);
            this.Controls.Add(rack);
            controlPanel.Width = rack.Width;

            //set initial sizes
            minHeight = this.AudimatMenu.Height + controlPanel.Height + this.AudimatStatus.Height;
            int rackHeight = settings.rackHeight;

            this.ClientSize  = new System.Drawing.Size(rack.Size.Width, rackHeight + minHeight);
            this.MinimumSize = new System.Drawing.Size(this.Size.Width, this.Size.Height - rackHeight);
            this.MaximumSize = new System.Drawing.Size(this.Size.Width, Int32.MaxValue);
            this.Location    = new Point(settings.rackPosX, settings.rackPosY);
            curRackHeight    = rack.Height;

            controlPanel.newRig();              //initial empty rig

            //child windows
            keyboardWnd              = new KeyboardWnd(controlPanel);
            keyboardWnd.Icon         = this.Icon;
            keyboardWnd.FormClosing += new FormClosingEventHandler(keyboardWindow_FormClosing);
            keyboardWnd.Location     = new Point(settings.keyWndPosX, settings.keyWndPosY);
            keyboardWnd.Hide();

            mixerWnd = new MixerWnd(this);
            patchWin = new PatchWindow(this);

            mainShutdown = false;
            rackhidden   = false;
        }
示例#8
0
        private void addTrack(string path)
        {
            var seconds = ViewTimeline.Position.TotalSeconds;

            var track = new TrackInfo(path);

            track.LeftShift         = seconds;
            track.TopShift          = prevoiusTop;
            track.DurationInSeconds = 10;

            Model.MediaTracks.Add(track);

            PatchWindow.MediaOpened += SetPatchDuration;
            PatchWindow.Stop();
            PatchWindow.Source = null;
            PatchWindow.Source = new Uri(path);
            PatchWindow.Play(); //need to fire event to get duration
            PatchWindow.Pause();

            //prevoiusTop += 30;
            //TimeScroll.Height += trackHeight;
            //mainwindow.Height += trackHeight;
            //CurrentTime.Height += trackHeight;
        }