示例#1
0
        private PCMFileManager GetPCMFiles(Config config)
        {
            PCMFileManager filemanager = new PCMFileManager(config);

            foreach (string line in src)
            {
                string lin = line.Trim();
                if (string.IsNullOrEmpty(lin))
                {
                    continue;
                }
                if (lin[0] != '@')
                {
                    continue;
                }
                if (lin.Length > 1)
                {
                    continue;
                }

                filemanager.Add(lin.Substring(1));
            }

            return(filemanager);
        }
示例#2
0
        public byte[] Make()
        {
            Config         config;
            PCMFileManager fileManager;

            if (i == -1)
            {
                config      = GetConfig();
                fileManager = GetPCMFiles(config);
                return(Make(config, fileManager));
            }
            else
            {
                config = new Config();
                if (i == 0)
                {
                    config.FormatType = enmFormatType.mucom88;
                }
                else if (i == 1)
                {
                    config.FormatType = enmFormatType.mucomDotNET_OPNA_ADPCM;
                }
                else if (i == 2)
                {
                    config.FormatType = enmFormatType.mucomDotNET_OPNB_ADPCMB;
                }
                else if (i == 3)
                {
                    config.FormatType = enmFormatType.mucomDotNET_OPNB_ADPCMB;
                }
                else if (i == 4)
                {
                    config.FormatType = enmFormatType.mucomDotNET_OPNB_ADPCMA;
                }
                else if (i == 5)
                {
                    config.FormatType = enmFormatType.mucomDotNET_OPNB_ADPCMA;
                }
                fileManager = new PCMFileManager(config, appendFileReaderCallback);
                foreach (string line in list)
                {
                    string lin = line.Trim();
                    if (string.IsNullOrEmpty(lin))
                    {
                        continue;
                    }
                    lin = CutComment(lin).Trim();
                    if (string.IsNullOrEmpty(lin))
                    {
                        continue;
                    }

                    fileManager.Add(lin);
                }
                return(Make(config, fileManager));
            }
        }