Beispiel #1
0
        private void CheckIfCanPort()
        {
            if (cmb_TargetDriver.SelectedItem != null)
            {
                string          targetDriver = cmb_TargetDriver.SelectedItem.ToString();
                VoiceFileFormat targetFormat = (VoiceFileFormat)cmb_TargetFormat.SelectedIndex;

                if (targetFormat == VoiceFileFormat.BARS)
                {
                    if (File.Exists(GlobalDirectory.driverParamsDirectory + targetDriver + "_param.bin")) // if target has param.bin
                    {
                        canPort             = true;
                        btn_Port.Foreground = Brushes.Black;

                        btn_ExtractParams.Visibility = Visibility.Collapsed;
                        Thickness margin = lbl_Message.Margin;
                        margin.Top         = 35;
                        lbl_Message.Margin = margin;
                    }
                    else
                    {
                        canPort             = false;
                        btn_Port.Foreground = Brushes.Red;

                        btn_ExtractParams.Visibility = Visibility.Visible;
                        Thickness margin = lbl_Message.Margin;
                        margin.Top         = 60;
                        lbl_Message.Margin = margin;
                        return;
                    }
                }
            }
        }
        public static void Port(string targetDriverFile, VoiceFileFormat format)
        {
            foreach (string file in Directory.GetFiles(GlobalDirectory.outputFolder))
            {
                File.Delete(file);
            }

            GlobalDirectory.ClearTempFolders();

            switch (format)
            {
            case VoiceFileFormat.BARS:
                PortToBARS(targetDriverFile);
                break;

            case VoiceFileFormat.BFWAV:
                PortToBFWAV(targetDriverFile);
                break;

            case VoiceFileFormat.BFWAV_Friendly:
                PortToFriendlyBFWAV(targetDriverFile);
                break;

            case VoiceFileFormat.WAV_Friendly:
                PortToFriendlyWAV(targetDriverFile);
                break;

            default:
                PortToBARS(targetDriverFile);
                break;
            }
            GlobalDirectory.ClearTempFolders();

            System.Windows.MessageBox.Show($"Complete");
            //NOTES
            //If there are conflicts (U uses the same sound for some actions) then warn the user
            // For targets that reuse the same sound for multiple actions, ask the user which sound they want to use
        }