Beispiel #1
0
        /// <summary>
        /// Save
        /// </summary>
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            if (File.Exists(Path.Combine(VM.PathsView.Config_Text, "mupen64plus.cfg")))
            {
                // Save to mupen64plus.cfg
                Configure.ConigFile cfg = null;

                try
                {
                    cfg = new Configure.ConigFile(Path.Combine(VM.PathsView.Config_Text, "mupen64plus.cfg"));

                    // Version
                    cfg.Write("Rsp-HLE", "Version", VM.Plugins_RSP_RSPHLE_View.Version_Text);

                    // RSP Fallback
                    cfg.Write("Rsp-HLE", "RspFallback", "\"" + VM.Plugins_RSP_RSPHLE_View.RSPFallback_Text + "\"");

                    // Display List To Graphics Plugin
                    if (VM.Plugins_RSP_RSPHLE_View.DisplayListToGraphicsPlugin_IsChecked == true)
                    {
                        cfg.Write("Rsp-HLE", "DisplayListToGraphicsPlugin", "True");
                    }
                    else if (VM.Plugins_RSP_RSPHLE_View.DisplayListToGraphicsPlugin_IsChecked == false)
                    {
                        cfg.Write("Rsp-HLE", "DisplayListToGraphicsPlugin", "False");
                    }

                    //  Audio List To Audio Plugin
                    if (VM.Plugins_RSP_RSPHLE_View.AudioListToAudioPlugin_IsChecked == true)
                    {
                        cfg.Write("Rsp-HLE", "AudioListToAudioPlugin", "True");
                    }
                    else if (VM.Plugins_RSP_RSPHLE_View.AudioListToAudioPlugin_IsChecked == false)
                    {
                        cfg.Write("Rsp-HLE", "AudioListToAudioPlugin", "False");
                    }


                    // -------------------------
                    // Save Complete
                    // -------------------------
                    VM.Plugins_RSP_RSPHLE_View.Save_Text = "✓";
                }
                // Error
                catch
                {
                    VM.Plugins_RSP_RSPHLE_View.Save_Text = "Error";

                    MessageBox.Show("Could not save to mupen64plus.cfg.",
                                    "Write Error",
                                    MessageBoxButton.OK,
                                    MessageBoxImage.Error);
                }
            }
        }
Beispiel #2
0
        /// <summary>
        ///  Save
        /// </summary>
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            // Check if Paths Config TextBox is Empty
            if (MainWindow.IsValidPath(VM.PathsView.Config_Text))
            {
                // Check if Cfg File Exists
                if (File.Exists(Path.Combine(VM.PathsView.Config_Text, "mupen64plus.cfg")))
                {
                    // Save to mupen64plus.cfg
                    Configure.ConigFile cfg = null;

                    try
                    {
                        cfg = new Configure.ConigFile(Path.Combine(VM.PathsView.Config_Text, "mupen64plus.cfg"));

                        // -------------------------
                        // [Audio-SDL]
                        // -------------------------
                        // Version
                        cfg.Write("Audio-SDL", "Version", VM.Plugins_Audio_AudioSDL_View.Version_Text);

                        // Default Frequency
                        cfg.Write("Audio-SDL", "DEFAULT_FREQUENCY", VM.Plugins_Audio_AudioSDL_View.DefaultFrequency_Text);

                        // Swap Channels
                        if (VM.Plugins_Audio_AudioSDL_View.SwapChannels_IsChecked == true)
                        {
                            cfg.Write("Audio-SDL", "SWAP_CHANNELS", "True");
                        }
                        else if (VM.Plugins_Audio_AudioSDL_View.SwapChannels_IsChecked == false)
                        {
                            cfg.Write("Audio-SDL", "SWAP_CHANNELS", "False");
                        }

                        // Primary Buffer Size
                        cfg.Write("Audio-SDL", "PRIMARY_BUFFER_SIZE", VM.Plugins_Audio_AudioSDL_View.PrimaryBufferSize_Text);

                        // Primary Buffer Target
                        cfg.Write("Audio-SDL", "PRIMARY_BUFFER_TARGET", VM.Plugins_Audio_AudioSDL_View.PrimaryBufferTarget_Text);

                        // Secondary Buffer Size
                        cfg.Write("Audio-SDL", "SECONDARY_BUFFER_SIZE", VM.Plugins_Audio_AudioSDL_View.SecondaryBufferSize_Text);

                        // Resample
                        cfg.Write("Audio-SDL", "RESAMPLE", "\"" + VM.Plugins_Audio_AudioSDL_View.Resample_SelectedItem + "\"");

                        // Volume Control Type
                        if (VM.Plugins_Audio_AudioSDL_View.VolumeControlType_SelectedItem == "SDL")
                        {
                            cfg.Write("Audio-SDL", "VOLUME_CONTROL_TYPE", "1");
                        }
                        else if (VM.Plugins_Audio_AudioSDL_View.VolumeControlType_SelectedItem == "OSS mixer")
                        {
                            cfg.Write("Audio-SDL", "VOLUME_CONTROL_TYPE", "2");
                        }

                        // Volume Adjust
                        cfg.Write("Audio-SDL", "VOLUME_ADJUST", VM.Plugins_Audio_AudioSDL_View.VolumeAdjust_Text);

                        // Volume Default
                        cfg.Write("Audio-SDL", "VOLUME_DEFAULT", VM.Plugins_Audio_AudioSDL_View.VolumeDefault_Text);

                        // Audio Sync
                        if (VM.Plugins_Audio_AudioSDL_View.AudioSync_IsChecked == true)
                        {
                            cfg.Write("Audio-SDL", "AUDIO_SYNC", "True");
                        }
                        else if (VM.Plugins_Audio_AudioSDL_View.AudioSync_IsChecked == false)
                        {
                            cfg.Write("Audio-SDL", "AUDIO_SYNC", "False");
                        }


                        // -------------------------
                        // Save Complete
                        // -------------------------
                        VM.Plugins_Audio_AudioSDL_View.Save_Text = "✓";
                    }
                    // Error
                    catch
                    {
                        VM.Plugins_Audio_AudioSDL_View.Save_Text = "Error";

                        MessageBox.Show("Could not save to mupen64plus.cfg.",
                                        "Write Error",
                                        MessageBoxButton.OK,
                                        MessageBoxImage.Error);
                    }
                }
            }
            // Path not found
            else
            {
                MessageBox.Show("Config Path is empty.",
                                "Notice",
                                MessageBoxButton.OK,
                                MessageBoxImage.Warning);
            }
        }
        /// <summary>
        /// Save
        /// </summary>
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            if (File.Exists(Path.Combine(VM.PathsView.Config_Text, "mupen64plus.cfg")))
            {
                // Save to mupen64plus.cfg
                Configure.ConigFile cfg = null;

                try
                {
                    cfg = new Configure.ConigFile(Path.Combine(VM.PathsView.Config_Text, "mupen64plus.cfg"));

                    // Version
                    cfg.Write("rsp-cxd4", "Version", VM.Plugins_RSP_cxd4SSE2_View.Version_Text);

                    // Display List To Graphics Plugin
                    if (VM.Plugins_RSP_cxd4SSE2_View.DisplayListToGraphicsPlugin_IsChecked == true)
                    {
                        cfg.Write("rsp-cxd4", "DisplayListToGraphicsPlugin", "True");
                    }
                    else if (VM.Plugins_RSP_cxd4SSE2_View.DisplayListToGraphicsPlugin_IsChecked == false)
                    {
                        cfg.Write("rsp-cxd4", "DisplayListToGraphicsPlugin", "False");
                    }

                    //  Audio List To Audio Plugin
                    if (VM.Plugins_RSP_cxd4SSE2_View.AudioListToAudioPlugin_IsChecked == true)
                    {
                        cfg.Write("rsp-cxd4", "AudioListToAudioPlugin", "True");
                    }
                    else if (VM.Plugins_RSP_cxd4SSE2_View.AudioListToAudioPlugin_IsChecked == false)
                    {
                        cfg.Write("rsp-cxd4", "AudioListToAudioPlugin", "False");
                    }

                    //  WaitForCPUHost
                    if (VM.Plugins_RSP_cxd4SSE2_View.WaitForCPUHost_IsChecked == true)
                    {
                        cfg.Write("rsp-cxd4", "WaitForCPUHost", "True");
                    }
                    else if (VM.Plugins_RSP_cxd4SSE2_View.WaitForCPUHost_IsChecked == false)
                    {
                        cfg.Write("rsp-cxd4", "WaitForCPUHost", "False");
                    }

                    //  SupportCPUSemaphoreLock
                    if (VM.Plugins_RSP_cxd4SSE2_View.SupportCPUSemaphoreLock_IsChecked == true)
                    {
                        cfg.Write("rsp-cxd4", "SupportCPUSemaphoreLock", "True");
                    }
                    else if (VM.Plugins_RSP_cxd4SSE2_View.SupportCPUSemaphoreLock_IsChecked == false)
                    {
                        cfg.Write("rsp-cxd4", "SupportCPUSemaphoreLock", "False");
                    }

                    // -------------------------
                    // Save Complete
                    // -------------------------
                    VM.Plugins_RSP_cxd4SSE2_View.Save_Text = "✓";
                }
                // Error
                catch
                {
                    VM.Plugins_RSP_cxd4SSE2_View.Save_Text = "Error";

                    MessageBox.Show("Could not save to mupen64plus.cfg.",
                                    "Write Error",
                                    MessageBoxButton.OK,
                                    MessageBoxImage.Error);
                }
            }
        }
        /// <summary>
        /// Save
        /// </summary>
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            // Check if Paths Config TextBox is Empty
            if (MainWindow.IsValidPath(VM.PathsView.Config_Text))
            {
                // Check if Cfg File Exists
                if (File.Exists(Path.Combine(VM.PathsView.Config_Text, "mupen64plus.cfg")))
                {
                    // Save to mupen64plus.cfg
                    Configure.ConigFile cfg = null;

                    try
                    {
                        cfg = new Configure.ConigFile(Path.Combine(VM.PathsView.Config_Text, "mupen64plus.cfg"));

                        // --------------------------------------------------
                        // [Video-Angrylion-Plus]
                        // --------------------------------------------------
                        // Parallel
                        // # Distribute rendering between multiple processors if True
                        if (VM.Plugins_Video_AngrylionPlus_View.Parallel_IsChecked == true)
                        {
                            cfg.Write("Video-Angrylion-Plus", "Parallel", "True");
                        }
                        else if (VM.Plugins_Video_AngrylionPlus_View.Parallel_IsChecked == false)
                        {
                            cfg.Write("Video-Angrylion-Plus", "Parallel", "False");
                        }

                        // NumWorkers
                        // Rendering Workers (0=Use all logical processors)
                        if (VM.Plugins_Video_AngrylionPlus_View.NumWorkers_SelectedItem == "All")
                        {
                            cfg.Write("Video-Angrylion-Plus", "NumWorkers", "0");
                        }
                        else
                        {
                            cfg.Write("Video-Angrylion-Plus", "NumWorkers", VM.Plugins_Video_AngrylionPlus_View.NumWorkers_SelectedItem);
                        }


                        // ViMode
                        // (0=Filtered, 1=Unfiltered, 2=Depth, 3=Coverage)
                        switch (VM.Plugins_Video_AngrylionPlus_View.ViMode_SelectedItem)
                        {
                        case "Filtered":
                            cfg.Write("Video-Angrylion-Plus", "ViMode", "0");
                            break;

                        case "Unfiltered":
                            cfg.Write("Video-Angrylion-Plus", "ViMode", "1");
                            break;

                        case "Depth":
                            cfg.Write("Video-Angrylion-Plus", "ViMode", "2");
                            break;

                        case "Coverage":
                            cfg.Write("Video-Angrylion-Plus", "ViMode", "3");
                            break;
                        }

                        // ViInterpolation
                        // Scaling interpolation type (0=NN, 1=Linear)
                        switch (VM.Plugins_Video_AngrylionPlus_View.ViInterpolation_SelectedItem)
                        {
                        case "Nearest Neighbor":
                            cfg.Write("Video-Angrylion-Plus", "ViInterpolation", "0");
                            break;

                        case "Linear":
                            cfg.Write("Video-Angrylion-Plus", "ViInterpolation", "1");
                            break;
                        }

                        // ViWidescreen
                        // # Use anamorphic 16:9 output mode if True
                        if (VM.Plugins_Video_AngrylionPlus_View.ViWidescreen_IsChecked == true)
                        {
                            cfg.Write("Video-Angrylion-Plus", "ViWidescreen", "True");
                        }
                        else if (VM.Plugins_Video_AngrylionPlus_View.ViWidescreen_IsChecked == false)
                        {
                            cfg.Write("Video-Angrylion-Plus", "ViWidescreen", "False");
                        }

                        // ViHideOverscan
                        // # Hide overscan area in filteded mode if True
                        if (VM.Plugins_Video_AngrylionPlus_View.ViHideOverscan_IsChecked == true)
                        {
                            cfg.Write("Video-Angrylion-Plus", "ViHideOverscan", "True");
                        }
                        else if (VM.Plugins_Video_AngrylionPlus_View.ViHideOverscan_IsChecked == false)
                        {
                            cfg.Write("Video-Angrylion-Plus", "ViHideOverscan", "False");
                        }

                        // DpCompat
                        // Compatibility mode (0=Fast 1=Moderate 2=Slow)
                        switch (VM.Plugins_Video_AngrylionPlus_View.DpCompat_SelectedItem)
                        {
                        case "Fast":
                            cfg.Write("Video-Angrylion-Plus", "DpCompat", "0");
                            break;

                        case "Moderate":
                            cfg.Write("Video-Angrylion-Plus", "DpCompat", "1");
                            break;

                        case "Slow":
                            cfg.Write("Video-Angrylion-Plus", "DpCompat", "2");
                            break;
                        }

                        // -------------------------
                        // Save Complete
                        // -------------------------
                        VM.Plugins_Video_AngrylionPlus_View.Save_Text = "✓";
                    }
                    // Error
                    catch
                    {
                        VM.Plugins_Video_AngrylionPlus_View.Save_Text = "Error";

                        MessageBox.Show("Could not save to mupen64plus.cfg.",
                                        "Write Error",
                                        MessageBoxButton.OK,
                                        MessageBoxImage.Error);
                    }
                }
                // Error
                else
                {
                    MessageBox.Show("Could not find mupen64plus.cfg.",
                                    "Write Error",
                                    MessageBoxButton.OK,
                                    MessageBoxImage.Error);
                }
            }
            // Path not found
            else
            {
                MessageBox.Show("Config Path is empty.",
                                "Notice",
                                MessageBoxButton.OK,
                                MessageBoxImage.Warning);
            }
        }