Example #1
0
 public void SaveUserSettings()
 {
     try
     {
         Properties.Settings settings = Properties.Settings.Default;
         settings.WINDOW_STATE       = WindowState;
         settings.VLC_DLL_PATH       = SettingsControlObject.TextBox_VLCPath.Text;
         settings.WINDOW_LOCATION    = new Rect(Left, Top, Width, Height);
         settings.REFVIDEO_PATH      = FilesControlObject.TextBox_RefPath.Text;
         settings.LIST_OF_FILES      = FilesControlObject.ListOfPathsFilsInGrid;
         settings.PLAYBACK_MODE      = Helper.CurrentPlaybackMode.ToString();
         settings.PLAYBACK_TECHNIQUE = Helper.CurrentPlaybackScale.ToString();
         settings.RATING_DELAY       = Helper.RatingDelay;
         settings.Save();
     }
     catch { }
 }
Example #2
0
        public async Task LoadUserSettings()
        {
            if (Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift))
            {
                return;
            }

            try
            {
                Properties.Settings settings = Properties.Settings.Default;

                //Check if saved VLC Path is valid
                await Task.Run(() =>
                {
                    Dispatcher.Invoke(() =>
                    {
                        //Window Location and State
                        if (settings.WINDOW_LOCATION.Top < SystemParameters.WorkArea.Height && settings.WINDOW_LOCATION.Left < SystemParameters.WorkArea.Width)
                        {
                            Top    = settings.WINDOW_LOCATION.Top;
                            Left   = settings.WINDOW_LOCATION.Left;
                            Width  = settings.WINDOW_LOCATION.Width;
                            Height = settings.WINDOW_LOCATION.Height;
                        }

                        WindowState = settings.WINDOW_STATE;

                        //Reference video path
                        if (File.Exists(settings.REFVIDEO_PATH))
                        {
                            FilesControlObject.TextBox_RefPath.Text = settings.REFVIDEO_PATH;
                        }

                        //RatingDelay
                        Helper.RatingDelay = settings.RATING_DELAY;
                        SettingsControlObject.CheckVLCFolderDLLs(settings.VLC_DLL_PATH);


                        //Fill DataGrid with all files
                        FilesControlObject.FileDataToGrid(settings.LIST_OF_FILES.ToArray());


                        //PlaybackScale
                        switch (settings.PLAYBACK_TECHNIQUE.ToLower())
                        {
                        case "acr":
                            Helper.CurrentPlaybackScale = Helper.PlaybackScaleEnum.ACR;
                            break;

                        case "dcr":
                            Helper.CurrentPlaybackScale = Helper.PlaybackScaleEnum.DCR;
                            break;
                        }

                        //PlaybackMode
                        switch (settings.PLAYBACK_MODE.ToLower())
                        {
                        case "ascending":
                            Helper.CurrentPlaybackMode = Helper.PlaybackModeEnum.Ascending;
                            break;

                        case "descending":
                            Helper.CurrentPlaybackMode = Helper.PlaybackModeEnum.Descending;
                            break;

                        case "random":
                            Helper.CurrentPlaybackMode = Helper.PlaybackModeEnum.Random;
                            break;

                        case "convex":
                            Helper.CurrentPlaybackMode = Helper.PlaybackModeEnum.Convex;
                            break;

                        case "concave":
                            Helper.CurrentPlaybackMode = Helper.PlaybackModeEnum.Concave;
                            break;
                        }

                        //Set different controls propeties from settings
                        SettingsControlObject.HelperPlaybackPropetiesToControls();
                    });
                });
            }
            catch { }
        }