コード例 #1
0
ファイル: Wwise.cs プロジェクト: ElatedOwl/MacAutoConverter
        public static string GetWwisePath()
        {
            string wwisePath;

            // Audiokinect Wwise might not be installed in the default location ;<
            // added custom Wwise install path to toolkit configuration menu
            if (!String.IsNullOrEmpty(ConfigRepository.Instance()["general_wwisepath"]))
                wwisePath = ConfigRepository.Instance()["general_wwisepath"];
            else
                wwisePath = Environment.GetEnvironmentVariable("WWISEROOT");

            if (String.IsNullOrEmpty(wwisePath))
                throw new FileNotFoundException("Could not find Audiokinect Wwise installation." + Environment.NewLine + "Please confirm that Wwise v2013.2.x or v2014.1.x series are installed.");

            Selected = OggFile.WwiseVersion.None;
            var pathWwiseCli = Directory.EnumerateFiles(wwisePath, "WwiseCLI.exe", SearchOption.AllDirectories).FirstOrDefault();
            if (pathWwiseCli == null)
                throw new FileNotFoundException("Could not find WwiseCLI.exe in " + wwisePath + Environment.NewLine + "Please confirm that Wwise v2013.2.x or v2014.1.x series is installed.");

            var wwiseVersion = FileVersionInfo.GetVersionInfo(pathWwiseCli).ProductVersion;
            if (wwiseVersion.StartsWith("2013.2"))
                Selected = OggFile.WwiseVersion.Wwise2013;
            if (wwiseVersion.StartsWith("2014.1"))
                Selected = OggFile.WwiseVersion.Wwise2014;
            if (wwiseVersion.StartsWith("2015.1"))
                Selected = OggFile.WwiseVersion.Wwise2015;
            // No support for v2015.1.x yet, code is expandable
            if (Selected == OggFile.WwiseVersion.None)
               throw new FileNotFoundException("You have no compatible version of Audiokinect Wwise installed." +
               Environment.NewLine + "Install Wwise v2013.2.x or v2014.1.x or even v2015.1.x series if you would like to use" +
               Environment.NewLine + " the toolkit OGG/WAV audio to Wwise WEM audio auto convert features.");

            return pathWwiseCli;
        }
コード例 #2
0
        public static string GetWwisePath()
        {
            string wwisePath;

            // Audiokinetic Wwise might not be installed in the default location ;<
            // added custom Wwise install path to toolkit configuration menu
            if (!String.IsNullOrEmpty(ConfigRepository.Instance()["general_wwisepath"]))
            {
                wwisePath = ConfigRepository.Instance()["general_wwisepath"];
            }
            else
            {
                wwisePath = Environment.GetEnvironmentVariable("WWISEROOT");
            }

            if (String.IsNullOrEmpty(wwisePath))
            {
                throw new FileNotFoundException("Could not find Audiokinetic Wwise installation." + Environment.NewLine + "Please confirm that Wwise v2013.2.x v2014.1.x or 2015.1.x series is installed.");
            }

            Selected = OggFile.WwiseVersion.None;
            var pathWwiseCli = Directory.EnumerateFiles(wwisePath, "WwiseCLI.exe", SearchOption.AllDirectories).FirstOrDefault();

            if (pathWwiseCli == null)
            {
                throw new FileNotFoundException("Could not find WwiseCLI.exe in " + wwisePath + Environment.NewLine + "Please confirm that Wwise v2013.2.x v2014.1.x or 2015.1.x series is installed.");
            }

            var wwiseVersion = FileVersionInfo.GetVersionInfo(pathWwiseCli).ProductVersion;

            if (wwiseVersion.StartsWith("2013.2"))
            {
                Selected = OggFile.WwiseVersion.Wwise2013;
            }
            if (wwiseVersion.StartsWith("2014.1"))
            {
                Selected = OggFile.WwiseVersion.Wwise2014;
            }
            if (wwiseVersion.StartsWith("2015.1"))
            {
                Selected = OggFile.WwiseVersion.Wwise2015;
            }
            // add support for new versions here, code is expandable
            //if (wwiseVersion.StartsWith("201x.x"))
            //    Selected = OggFile.WwiseVersion.Wwise201x;
            if (Selected == OggFile.WwiseVersion.None)
            {
                throw new FileNotFoundException("You have no compatible version of Audiokinetic Wwise installed." +
                                                Environment.NewLine + "Install Wwise v2013.2.x or v2014.1.x or even v2015.1.x series if you would like to use" +
                                                Environment.NewLine + " the toolkit OGG/WAV audio to Wwise WEM audio auto convert features.");
            }

            return(pathWwiseCli);
        }
コード例 #3
0
        public static string GetWwisePath()
        {
            // support for Wwise v2013.2.x v2014.1.x 2015.1.x or 2016.2.x series
            // Wwise may not be installed in the default location so use the Configuration Wwise Path if entered
            var wwiseRoot = ConfigRepository.Instance()["general_wwisepath"];

            // otherwise use the WWISEROOT Environmental Variable
            if (String.IsNullOrEmpty(ConfigRepository.Instance()["general_wwisepath"]))
            {
                wwiseRoot = Environment.GetEnvironmentVariable("WWISEROOT");
            }

            if (String.IsNullOrEmpty(wwiseRoot))
            {
                throw new ApplicationException("Could not find Audiokinetic Wwise installation." + new string(' ', 2) +
                                               "Download and install Wwise v2013.2.x from: http://ignition.customsforge.com/cfsm/wwise" + Environment.NewLine);
            }

            var wwiseCLIPath = Directory.EnumerateFiles(wwiseRoot, "WwiseCLI.exe", SearchOption.AllDirectories);

            if (!wwiseCLIPath.Any())
            {
                // Check for wwise root if user has bad custom path to wwise
                if (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("WWISEROOT")))
                {
                    wwiseCLIPath = Directory.EnumerateFiles(Environment.GetEnvironmentVariable("WWISEROOT"), "WwiseCLI.exe", SearchOption.AllDirectories);
                }
            }

            if (!wwiseCLIPath.Any())
            {
                throw new FileNotFoundException("Could not find 'WwiseCLI.exe' in " + wwiseRoot + " subfolders." + new string(' ', 2) +
                                                "Download and install Wwise v2013.2.x from: http://ignition.customsforge.com/cfsm/wwise" + Environment.NewLine);
            }

            //win32 = 32bit x64 = 64bit
            string wwiseCLIexe = wwiseCLIPath.AsParallel().SingleOrDefault(e => e.Contains("Authoring\\Win32"));

            // use the 64bit version if it is installed
            if (Environment.Is64BitOperatingSystem)
            {
                var etmp = wwiseCLIPath.AsParallel().FirstOrDefault(e => e.Contains("Authoring\\x64"));
                if (!String.IsNullOrEmpty(etmp))
                {
                    wwiseCLIexe = etmp;
                }
            }

            // a final error check
            var wwiseVersion = FileVersionInfo.GetVersionInfo(wwiseCLIexe).ProductVersion;

            if (wwiseVersion.StartsWith("2010.3"))
            {
                Selected = OggFile.WwiseVersion.Wwise2010;
            }
            else if (wwiseVersion.StartsWith("2013.2"))
            {
                Selected = OggFile.WwiseVersion.Wwise2013;
            }
            else if (wwiseVersion.StartsWith("2014.1"))
            {
                Selected = OggFile.WwiseVersion.Wwise2014;
            }
            else if (wwiseVersion.StartsWith("2015.1"))
            {
                Selected = OggFile.WwiseVersion.Wwise2015;
            }
            else if (wwiseVersion.StartsWith("2016.2"))
            {
                Selected = OggFile.WwiseVersion.Wwise2016;
            }
            else if (wwiseVersion.StartsWith("2017.1"))
            {
                Selected = OggFile.WwiseVersion.Wwise2017;
            }
            // add support for new versions here, code is expandable
            //else if (wwiseVersion.StartsWith("xxxx.x"))
            //    Selected = OggFile.WwiseVersion.WwiseXXXX;
            else
            {
                Selected = OggFile.WwiseVersion.None;
            }

            if (Selected == OggFile.WwiseVersion.None)
            {
                throw new ApplicationException("Could not find an installed compatible version of Audiokinetic Wwise." + new string(' ', 2) +
                                               "Download and install Wwise v2013.2.x from: http://ignition.customsforge.com/cfsm/wwise" + new string(' ', 5) +
                                               "Be sure to set the 'Wwise Path' in the General Config menu if you have a custom installation." + Environment.NewLine);
            }

            return(wwiseCLIexe);
        }
コード例 #4
0
        public static string GetWwisePath()
        {
            string wwiseRoot;

            // Audiokinetic Wwise might not be installed in the default location ;<
            if (String.IsNullOrEmpty(ConfigRepository.Instance()["general_wwisepath"]))
            {
                wwiseRoot = Environment.GetEnvironmentVariable("WWISEROOT");
            }
            else
            {
                wwiseRoot = ConfigRepository.Instance()["general_wwisepath"]; //could point to wrong dir, so chech back again.
            }
            if (String.IsNullOrEmpty(wwiseRoot))
            {
                throw new FileNotFoundException("Could not find Audiokinetic Wwise installation." + Environment.NewLine +
                                                "Please confirm that either Wwise v2013.2.x v2014.1.x 2015.1.x or 2016.2.x series is installed.");
            }

            var wwiseCLIPath = Directory.EnumerateFiles(wwiseRoot, "WwiseCLI.exe", SearchOption.AllDirectories);

            if (!wwiseCLIPath.Any())
            {
                // Check for wwise root if user has bad custom path to wwise
                if (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("WWISEROOT")))
                {
                    wwiseCLIPath = Directory.EnumerateFiles(Environment.GetEnvironmentVariable("WWISEROOT"), "WwiseCLI.exe", SearchOption.AllDirectories);
                }
            }

            if (!wwiseCLIPath.Any())
            {
                throw new FileNotFoundException("Could not find WwiseCLI.exe in " + wwiseRoot + Environment.NewLine +
                                                "Please confirm that either Wwise v2013.2.x v2014.1.x 2015.1.x or 2016.2.x series is installed.");
            }

            //win32 = 32bit x64 = 64bit
            string wwiseCLIexe = wwiseCLIPath.AsParallel().SingleOrDefault(e => e.Contains("Authoring\\Win32"));

            // use the 64bit version if it is installed
            if (Environment.Is64BitOperatingSystem)
            {
                var etmp = wwiseCLIPath.AsParallel().FirstOrDefault(e => e.Contains("Authoring\\x64"));
                if (!String.IsNullOrEmpty(etmp))
                {
                    wwiseCLIexe = etmp;
                }
            }

            // a final error check
            var wwiseVersion = FileVersionInfo.GetVersionInfo(wwiseCLIexe).ProductVersion;

            if (wwiseVersion.StartsWith("2013.2"))
            {
                Selected = OggFile.WwiseVersion.Wwise2013;
            }
            else if (wwiseVersion.StartsWith("2014.1"))
            {
                Selected = OggFile.WwiseVersion.Wwise2014;
            }
            else if (wwiseVersion.StartsWith("2015.1"))
            {
                Selected = OggFile.WwiseVersion.Wwise2015;
            }
            else if (wwiseVersion.StartsWith("2016.2"))
            {
                Selected = OggFile.WwiseVersion.Wwise2016;
            }
            else if (wwiseVersion.StartsWith("2017.1"))
            {
                Selected = OggFile.WwiseVersion.Wwise2017;
            }
            // add support for new versions here, code is expandable
            //else if (wwiseVersion.StartsWith("xxxx.x"))
            //    Selected = OggFile.WwiseVersion.WwiseXXXX;
            else
            {
                Selected = OggFile.WwiseVersion.None;
            }

            if (Selected == OggFile.WwiseVersion.None)
            {
                throw new FileNotFoundException("You have no compatible version of Audiokinetic Wwise installed." + Environment.NewLine +
                                                "Install supportend Wwise version, which are v2013.2.x || v2014.1.x || v2015.1.x || v2016.2.x series  " + Environment.NewLine +
                                                "if you would like to use toolkit's Wwise autoconvert feature.   Did you remember to set the Wwise" + Environment.NewLine +
                                                "installation path in the toolkit General Config menu?");
            }

            return(wwiseCLIexe);
        }