示例#1
0
 //サーバー上のテキストファイルの内容をStreamReaderとして出力します
 public StreamReader GetFileRead(string From_File, bool IsErrorLogMode = false)
 {
     if (!IsConnected)
     {
         return(new StreamReader(new MemoryStream()));
     }
     else if (SFTP_Server != null && !SFTP_Server.IsConnected)
     {
         SFTP_Server.Connect();
     }
     try
     {
         if (SFTP_Server.Exists(From_File))
         {
             return(SFTP_Server.OpenText(From_File));
         }
         else
         {
             return(new StreamReader(new MemoryStream()));
         }
     }
     catch (Exception e)
     {
         if (IsErrorLogMode)
         {
             Sub_Code.Error_Log_Write(e.Message);
         }
         return(new StreamReader(new MemoryStream()));
     }
 }
 //.bnkファイルから.wemファイルを抽出(1つのみ)
 public bool Wwise_Extract_To_WEM_File(int Index, string To_File, bool IsOverWrite)
 {
     if (File.Exists(To_File) && !IsOverWrite)
     {
         return(false);
     }
     if (WEML.Count <= Index || IsClear)
     {
         return(false);
     }
     try
     {
         LoLSoundBankManager.WEMFile File_Index = WEML[Index];
         using (FileStream ms = new FileStream(To_File, FileMode.Create))
         {
             using (BinaryWriter bw = new BinaryWriter(ms))
             {
                 bw.Write(LOL.GetFileData(File_Index.ID));
             }
         }
         return(true);
     }
     catch (Exception e)
     {
         Sub_Code.Error_Log_Write(e.Message);
         return(false);
     }
 }
 //↑が1つのみになったバージョン
 public bool Wwise_Extract_To_Ogg_File(int Index, string To_File, bool IsOverWrite)
 {
     if (IsClear)
     {
         return(false);
     }
     if (File.Exists(To_File) && !IsOverWrite)
     {
         return(false);
     }
     try
     {
         if (Wwise_Extract_To_WEM_File(Index, To_File + ".wem", true))
         {
             if (Sub_Code.WEM_To_File(To_File + ".wem", To_File, "ogg", true))
             {
                 return(true);
             }
         }
         return(false);
     }
     catch (Exception e)
     {
         Sub_Code.Error_Log_Write(e.Message);
         return(false);
     }
 }
示例#4
0
 //.pckファイルから.wemファイルを抽出し、oggに変換(1つのみ)
 public bool Wwise_Extract_To_Ogg_File(int Index, string To_File, bool IsOverWrite, string Format = "ogg")
 {
     if (Sounds.Count <= Index || !IsPCKSelected)
     {
         return(false);
     }
     if (File.Exists(To_File) && !IsOverWrite)
     {
         return(false);
     }
     try
     {
         if (Wwise_Extract_To_WEM_File(Index, To_File + ".wem", true))
         {
             if (Sub_Code.WEM_To_File(To_File + ".wem", To_File, Format, true))
             {
                 return(true);
             }
         }
         return(false);
     }
     catch (Exception e)
     {
         Sub_Code.Error_Log_Write(e.Message);
         return(false);
     }
 }
示例#5
0
 public bool Wwise_Extract_To_WAV_Directory(string To_Dir, bool IsCountUpMode = false)
 {
     if (!IsPCKSelected)
     {
         return(false);
     }
     try
     {
         if (!Directory.Exists(To_Dir))
         {
             Directory.CreateDirectory(To_Dir);
         }
         for (int Number = 0; Number < Sounds.Count; Number++)
         {
             int Number_01 = Sub_Code.r.Next(0, 1000);
             if (IsCountUpMode)
             {
                 Number_01 = Number + 1;
             }
             if (Wwise_Extract_To_WEM_File(Number, To_Dir + "\\" + Number_01 + ".wem", true))
             {
                 Sub_Code.WEM_To_File(To_Dir + "\\" + Number_01 + ".wem", To_Dir + "\\" + Number_01 + ".wav", "wav", true);
             }
         }
         return(true);
     }
     catch (Exception e)
     {
         Sub_Code.Error_Log_Write(e.Message);
         return(false);
     }
 }
示例#6
0
        public void Change_Rotate_Texture(Texture_Info TexInfo, int Init_Index)
        {
            Texture_Image_Info Info = TexInfo.Texture_Image;
            int Minus_X             = Math.Min(Info.Left_UP_Position.X, Info.Left_Down_Position.X);
            int Minus_Y             = Math.Min(Info.Left_UP_Position.Y, Info.Right_UP_Position.Y);

            System.Drawing.Point Left_UP   = new System.Drawing.Point(Info.Left_UP_Position.X - Minus_X, Info.Left_UP_Position.Y - Minus_Y);
            System.Drawing.Point Right_UP  = new System.Drawing.Point(Info.Right_UP_Position.X + Info.Width - Minus_X, Info.Right_UP_Position.Y - Minus_Y);
            System.Drawing.Point Left_Down = new System.Drawing.Point(Info.Left_Down_Position.X - Minus_X, Info.Left_Down_Position.Y + Info.Height - Minus_Y);
            int      New_Width             = Info.Width + Info.Right_UP_Position.X - Info.Left_UP_Position.X;
            int      New_Height            = Info.Height + Info.Left_Down_Position.Y - Info.Left_UP_Position.Y;
            Bitmap   canvas = new Bitmap(New_Width, New_Height);
            Graphics g      = Graphics.FromImage(canvas);
            Bitmap   img    = new Bitmap(TexInfo.Texture_Image.Texture_Main);

            System.Drawing.Point[] destinationPoints = new System.Drawing.Point[] { Left_UP, Right_UP, Left_Down };
            g.DrawImage(img, destinationPoints);
            g.Dispose();
            img.Dispose();
            TexInfo.Texture_Image.Texture_Change       = canvas;
            TexInfo.Texture_Image.Texture_Image.Source = Sub_Code.Bitmap_To_BitmapImage(TexInfo.Texture_Image.Texture_Change);
            Matrix matrix = TexInfo.Texture_Image.Texture_Image.RenderTransform.Value;

            matrix.Translate(-Minus_X * Zoom, -Minus_Y * Zoom);
            TexInfo.Texture_Image.Texture_Image.RenderTransform = new MatrixTransform(matrix);
        }
示例#7
0
 //マルチスレッドで.mp3や.oggを.wav形式にエンコード
 //拡張子とファイル内容が異なっていた場合実行されない(ファイル拡張子が.mp3なのに実際は.oggだった場合など)
 public static async Task Convert_To_Wav(List <string> Files, List <string> ToFilePath, List <Music_Play_Time> Time = null, bool IsFromFileDelete = false)
 {
     try
     {
         From_Files.Clear();
         From_Files.AddRange(Files);
         var tasks = new List <Task>();
         for (int i = 0; i < From_Files.Count; i++)
         {
             if (Time != null)
             {
                 tasks.Add(To_WAV(i, ToFilePath[i], Time[i], IsFromFileDelete));
             }
             else
             {
                 tasks.Add(To_WAV(i, ToFilePath[i], IsFromFileDelete, false, true));
             }
         }
         await Task.WhenAll(tasks);
     }
     catch (Exception e)
     {
         Sub_Code.Error_Log_Write(e.Message);
     }
     From_Files.Clear();
 }
示例#8
0
        public static async Task Convert_To_Wav(string From_Dir, string To_Dir, bool IsFromFileDelete)
        {
            try
            {
                if (!Directory.Exists(To_Dir))
                {
                    Directory.CreateDirectory(To_Dir);
                }
                From_Files.Clear();
                string[] Ex = new string[] { ".mp3", ".aac", ".ogg", ".flac", ".wma", ".wav" };
                From_Files.AddRange(DirectoryEx.GetFiles(From_Dir, SearchOption.TopDirectoryOnly, Ex));
                var tasks = new List <Task>();
                for (int i = 0; i < From_Files.Count; i++)
                {
                    tasks.Add(To_WAV(i, To_Dir, IsFromFileDelete));
                }
                await Task.WhenAll(tasks);

                From_Files.Clear();
            }
            catch (Exception ex)
            {
                From_Files.Clear();
                Sub_Code.Error_Log_Write(ex.Message);
            }
        }
 void Configs_Save()
 {
     try
     {
         StreamWriter stw = File.CreateText(Voice_Set.Special_Path + "/Configs/Sound_Editor_Setting.tmp");
         stw.WriteLine(Save_Dir);
         stw.WriteLine(Save_File_Name_T.Text);
         stw.WriteLine(Save_File_Mode_C.SelectedIndex);
         stw.WriteLine(Save_Ex_C.SelectedIndex);
         stw.WriteLine(Cut_ShortCut_C.IsChecked.Value);
         stw.WriteLine(Cut_Volume_C.IsChecked.Value);
         stw.WriteLine(Save_Track_Delete_C.IsChecked.Value);
         stw.WriteLine(Save_Once_C.IsChecked.Value);
         stw.WriteLine(Cut_Pos_C.IsChecked.Value);
         stw.WriteLine(Framerate_C.SelectedIndex);
         stw.WriteLine(Volume_S.Value);
         stw.WriteLine(Cut_Volume_Sync_C.IsChecked.Value);
         stw.WriteLine(Set_Speed_Mode_C.IsChecked.Value);
         stw.WriteLine(Set_Loop_Mode_C.IsChecked.Value);
         stw.Write(All_Volume_S.Value);
         stw.Close();
         Sub_Code.File_Encrypt(Voice_Set.Special_Path + "/Configs/Sound_Editor_Setting.tmp", Voice_Set.Special_Path + "/Configs/Sound_Editor_Setting.conf", "Sound_Editor_Setting_Configs_Save", true);
     }
     catch (Exception e)
     {
         Sub_Code.Error_Log_Write(e.Message);
     }
 }
示例#10
0
 //サーバーにあるファイルを削除します
 public bool DeleteFile(string To_File, bool IsErrorLogMode = false)
 {
     if (!IsConnected)
     {
         return(false);
     }
     else if (!SFTP_Server.IsConnected)
     {
         SFTP_Server.Connect();
     }
     try
     {
         if (!SFTP_Server.Exists(To_File))
         {
             return(false);
         }
         SFTP_Server.DeleteFile(To_File);
         return(true);
     }
     catch (Exception e)
     {
         if (IsErrorLogMode)
         {
             Sub_Code.Error_Log_Write(e.Message);
         }
         return(false);
     }
 }
示例#11
0
        private async void Sound_L_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (Sound_L.SelectedIndex == -1 || IsClosing || IsBusy)
            {
                return;
            }
            Bass.BASS_ChannelStop(Stream);
            Bass.BASS_StreamFree(Stream);
            Message_T.Text = "ファイルを変換しています...";
            await Task.Delay(50);

            string To_File = Voice_Set.Special_Path + "/Wwise/BNK_WAV_Special/" + Sound_L.Items[Sound_L.SelectedIndex];

            if (IsPCKMode)
            {
                Wwise_PCK.Wwise_Extract_To_Ogg_File(uint.Parse(Sound_L.Items[Sound_L.SelectedIndex].ToString()), To_File + ".ogg", true);
            }
            else
            {
                Wwise_BNK.Wwise_Extract_To_Ogg_File(uint.Parse(Sound_L.Items[Sound_L.SelectedIndex].ToString()), To_File + ".ogg", true);
            }
            Message_T.Text = "";
            string File_Name = Sub_Code.File_Get_FileName_No_Extension(To_File);

            Load_Sound(File_Name);
            Bass.BASS_ChannelPlay(Stream, false);
            IsPaused = false;
        }
示例#12
0
 public bool DownloadFile(string From_File, string To_File, bool IsErrorLogMode = false)
 {
     if (!IsConnected)
     {
         return(false);
     }
     else if (!SFTP_Server.IsConnected)
     {
         SFTP_Server.Connect();
     }
     try
     {
         IsDownloading = true;
         using (Stream fs = File.OpenWrite(To_File))
             SFTP_Server.DownloadFile(From_File, fs, (ulong upSize) =>
             {
                 if (!IsDownloading)
                 {
                     fs.Close();
                 }
             });
         IsDownloading = false;
         return(true);
     }
     catch (Exception e)
     {
         if (IsErrorLogMode)
         {
             Sub_Code.Error_Log_Write(e.Message);
         }
         IsDownloading = false;
         return(false);
     }
 }
示例#13
0
 //サーバーにファイルをアップロードします
 public bool UploadFile(string From_File, string To_File, bool IsErrorLogMode = false)
 {
     if (!IsConnected)
     {
         return(false);
     }
     else if (!SFTP_Server.IsConnected)
     {
         SFTP_Server.Connect();
     }
     try
     {
         using (Stream fs = File.OpenRead(From_File))
             SFTP_Server.UploadFile(fs, To_File, true);
         return(true);
     }
     catch (Exception e)
     {
         if (IsErrorLogMode)
         {
             Sub_Code.Error_Log_Write(e.Message);
         }
         return(false);
     }
 }
示例#14
0
 //サーバー上にフォルダを作成
 public bool Directory_Create(string To_Dir, bool IsErrorLogMode = false)
 {
     if (!IsConnected)
     {
         return(false);
     }
     else if (!SFTP_Server.IsConnected)
     {
         SFTP_Server.Connect();
     }
     try
     {
         if (SFTP_Server.Exists(To_Dir))
         {
             return(false);
         }
         SFTP_Server.CreateDirectory(To_Dir);
         return(true);
     }
     catch (Exception e)
     {
         if (IsErrorLogMode)
         {
             Sub_Code.Error_Log_Write(e.Message);
         }
         return(false);
     }
 }
 private void File_Open_B_Click(object sender, RoutedEventArgs e)
 {
     if (IsClosing)
     {
         return;
     }
     System.Windows.Forms.OpenFileDialog ofd = new System.Windows.Forms.OpenFileDialog()
     {
         Title       = "画像ファイルを選択してください。",
         Multiselect = false,
         Filter      = "画像ファイル(*.png;*.jpg;*.jpeg;*.bmp;*.gif;*.tiff;*.exif)|*.png;*.jpg;*.jpeg;*.bmp;*.gif;*.tiff;*.exif"
     };
     if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         try
         {
             if (Path.GetExtension(ofd.FileName) == ".dds")
             {
                 //DDS_Main_Image.Source = Sub_Code.Bitmap_To_BitmapImage(DDS_Format.Load_To_Bitmap(ofd.FileName));
             }
             else
             {
                 DDS_Main_Image.Source = Sub_Code.Bitmap_To_BitmapImage(new Bitmap(ofd.FileName));
             }
             File_Select_T.Text = Path.GetFileName(ofd.FileName);
             Select_File        = ofd.FileName;
         }
         catch (Exception e1)
         {
             Message_Feed_Out("画像ファイルを読み込めませんでした。");
             Sub_Code.Error_Log_Write(e1.Message);
         }
     }
 }
        void Save_Text_Change()
        {
            if (!IsLoaded)
            {
                return;
            }
            string Mode = "";

            if (Save_File_Mode_C.SelectedIndex == 0)
            {
                Mode = "001";
            }
            else if (Save_File_Mode_C.SelectedIndex == 1)
            {
                Mode = "01";
            }
            else if (Save_File_Mode_C.SelectedIndex == 2)
            {
                Mode = "1";
            }
            else if (Save_File_Mode_C.SelectedIndex == 3)
            {
                Mode = DateTime.Now.Hour.ToString() + DateTime.Now.Minute + DateTime.Now.Second;
            }
            else if (Save_File_Mode_C.SelectedIndex == 4)
            {
                Mode = Sub_Code.Generate_Random_String(2, 6);
            }
            Save_File_View_T.Text = "保存先のファイル名:" + Save_File_Name_T.Text + Mode + Save_Ex_C.Items[Save_Ex_C.SelectedIndex];
        }
示例#17
0
        private void Out_Dir_B_Click(object sender, RoutedEventArgs e)
        {
            if (IsClosing || IsBusy || IsOpenDialog)
            {
                return;
            }
            IsOpenDialog = true;
            IsBusy       = true;
            BetterFolderBrowser bfb = new BetterFolderBrowser()
            {
                Title       = "保存先のフォルダを選択してください。",
                RootFolder  = Sub_Code.Get_OpenDirectory_Path(),
                Multiselect = false,
            };

            if (bfb.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Sub_Code.Set_Directory_Path(bfb.SelectedFolder);
                if (!Sub_Code.CanDirectoryAccess(bfb.SelectedFolder))
                {
                    Message_Feed_Out("指定したフォルダにアクセス権限がありません。別のフォルダを選択してください。");
                    bfb.Dispose();
                    IsOpenDialog = false;
                    IsBusy       = false;
                    return;
                }
                Output_Dir     = bfb.SelectedFolder;
                Out_Dir_T.Text = Output_Dir + "\\";
                Configs_Save();
            }
            bfb.Dispose();
            IsOpenDialog = false;
            IsBusy       = false;
        }
        private void Save_Dir_B_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            if (IsClosing || IsOpenDialog)
            {
                return;
            }
            IsOpenDialog = true;
            BetterFolderBrowser bfb = new BetterFolderBrowser()
            {
                Title       = "保存先のフォルダを指定してください。",
                Multiselect = false,
                RootFolder  = Sub_Code.Get_OpenDirectory_Path()
            };

            if (bfb.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Sub_Code.Set_Directory_Path(bfb.SelectedFolder);
                if (Sub_Code.CanDirectoryAccess(bfb.SelectedFolder))
                {
                    Select_Dir_T.Text = bfb.SelectedFolder + "\\";
                    Save_Dir          = bfb.SelectedFolder;
                }
                else
                {
                    Message_Feed_Out("指定したフォルダのアクセス権がありませんでした。");
                }
            }
            bfb.Dispose();
            IsOpenDialog = false;
        }
示例#19
0
 public static async Task WAV_Gain(string[] Files, double Gain_Values)
 {
     try
     {
         From_Files.Clear();
         From_Files.AddRange(Files);
         From_Gains.Clear();
         for (int i = 0; i < From_Files.Count; i++)
         {
             From_Gains.Add(Gain_Values);
         }
         var tasks = new List <Task>();
         for (int i = 0; i < From_Files.Count; i++)
         {
             tasks.Add(Gain(i));
         }
         await Task.WhenAll(tasks);
     }
     catch (Exception ex)
     {
         Sub_Code.Error_Log_Write(ex.Message);
     }
     From_Files.Clear();
     From_Gains.Clear();
 }
示例#20
0
 public void Set_Sound_Name(string SoundbanksInfo, string Dir)
 {
     if (!File.Exists(SoundbanksInfo) || !Directory.Exists(Dir) || IsClear)
     {
         return;
     }
     string[] Lines = File.ReadAllLines(SoundbanksInfo);
     for (int Number = 0; Number < Lines.Length; Number++)
     {
         if (Lines[Number].Contains("\"Id\": \"") && Lines[Number + 2].Contains("\"ShortName\": \""))
         {
             string Temp_01 = Lines[Number].Substring(0, Lines[Number].LastIndexOf('\"'));
             string Temp_02 = Temp_01.Substring(Temp_01.LastIndexOf('\"') + 1);
             string Temp_03 = Lines[Number + 2].Substring(0, Lines[Number + 2].LastIndexOf('\"'));
             string Temp_04 = Temp_03.Substring(Temp_03.LastIndexOf('\"') + 1);
             if (Temp_04.Contains("\\"))
             {
                 Temp_04 = Temp_04.Substring(Temp_04.LastIndexOf('\\') + 1);
             }
             string Temp_05 = Temp_04.Substring(0, Temp_04.LastIndexOf('.'));
             Sub_Code.File_Move_V2(Dir + "\\" + Temp_02, Dir + "\\" + Temp_05, true);
             Number += 2;
         }
     }
 }
示例#21
0
 //To_Fileは"/Android/data"や"/Download/"などから始める
 public void Upload_File(string From_File, string To_File)
 {
     if (!IsDeviceExsist || !File.Exists(From_File))
     {
         return;
     }
     try
     {
         string phoneDir           = "内部ストレージ" + To_File;
         PortableDeviceFolder root = Device.Root();
         foreach (PortableDeviceObject Name_Now in root.Files)
         {
             MessageBox.Show(Name_Now.Name);
         }
         PortableDeviceFolder result = root.FindDir(phoneDir);
         if (null == result)
         {
             result   = Device.Root().FindDir("Tablet" + To_File);
             phoneDir = "Tablet" + To_File;
             MessageBox.Show("");
         }
         if (null == result)
         {
             return;
         }
         Device.TransferContentToDevice(result, From_File);
     }
     catch (Exception ex)
     {
         Sub_Code.Error_Log_Write(ex.Message);
     }
 }
 void Preset_Save_File()
 {
     try
     {
         StreamWriter stw = File.CreateText(Voice_Set.Special_Path + "\\Configs\\SE_Change_Presets_Temp.dat");
         stw.WriteLine(Preset_Index);
         foreach (List <string> Preset_Now in Preset_List)
         {
             if (Preset_Now[0] == "標準")
             {
                 continue;
             }
             stw.WriteLine("!*---Preset_Start---*!");
             foreach (string Line in Preset_Now)
             {
                 stw.WriteLine(Line);
             }
         }
         stw.Close();
         stw.Dispose();
         Sub_Code.File_Encrypt(Voice_Set.Special_Path + "\\Configs\\SE_Change_Presets_Temp.dat", Voice_Set.Special_Path + "\\Configs\\SE_Change_Presets.dat", "Period_Lost-Words", true);
     }
     catch (Exception e)
     {
         Sub_Code.Error_Log_Write(e.Message);
         Message_Feed_Out("エラー:プリセットを保存できませんでした。");
     }
 }
示例#23
0
        public bool Wwise_Extract_To_Wav_File(uint ShortID, string To_File, bool IsOverWrite)
        {
            int Index = -1;

            for (int Number = 0; Number < Sounds.Count; Number++)
            {
                if (Sounds[Number].id == ShortID)
                {
                    Index = Number;
                }
            }
            if (Index == -1 || !IsPCKSelected)
            {
                return(false);
            }
            if (File.Exists(To_File) && !IsOverWrite)
            {
                return(false);
            }
            try
            {
                if (Wwise_Extract_To_WEM_File(Index, To_File + ".wem", true))
                {
                    if (Sub_Code.WEM_To_File(To_File + ".wem", To_File, "wav", true))
                    {
                        return(true);
                    }
                }
                return(false);
            }
            catch
            {
                return(false);
            }
        }
示例#24
0
 public async void Window_Show()
 {
     Opacity    = 0;
     Visibility = Visibility.Visible;
     if (File.Exists(Voice_Set.Special_Path + "/Configs/Blitz_To_WoT.conf"))
     {
         try
         {
             StreamReader str = Sub_Code.File_Decrypt_To_Stream(Voice_Set.Special_Path + "/Configs/Blitz_To_WoT.conf", "Blitz_To_WoT_Configs_Save");
             Volume_S.Value         = double.Parse(str.ReadLine());
             Volume_Set_C.IsChecked = bool.Parse(str.ReadLine());
             str.Close();
         }
         catch (Exception e)
         {
             System.Windows.MessageBox.Show("設定を読み込めませんでした。。\nエラー回避のため設定は削除されます。");
             File.Delete(Voice_Set.Special_Path + "/Configs/Blitz_To_WoT.conf");
             Sub_Code.Error_Log_Write(e.Message);
         }
     }
     Position_Change();
     while (Opacity < 1 && !IsClosing)
     {
         Opacity += Sub_Code.Window_Feed_Time;
         await Task.Delay(1000 / 60);
     }
 }
 //保存されたデータをもとに.bnkファイルをビルド(内容によって時間がかかります)
 public void Project_Build(string BankName, string OutputFilePath)
 {
     if (Project_Dir == "" || !Directory.Exists(Path.GetDirectoryName(OutputFilePath)))
     {
         return;
     }
     try
     {
         BankName = BankName.Replace(" ", "_");
         string       Project_File = Directory.GetFiles(Project_Dir, "*.wproj", SearchOption.TopDirectoryOnly)[0];
         StreamWriter stw          = File.CreateText(Voice_Set.Special_Path + "/Wwise/Project_Build.bat");
         stw.WriteLine("chcp 65001");
         stw.Write("\"" + Voice_Set.Special_Path + "/Wwise/x64/Release/bin/WwiseCLI.exe\" \"" + Project_File + "\" -GenerateSoundBanks -Language ja -Platform Windows ");
         stw.Write("-Bank " + BankName + " -ClearAudioFileCache");
         stw.Close();
         ProcessStartInfo processStartInfo = new ProcessStartInfo
         {
             FileName        = Voice_Set.Special_Path + "/Wwise/Project_Build.bat",
             CreateNoWindow  = true,
             UseShellExecute = false
         };
         Process p = Process.Start(processStartInfo);
         p.WaitForExit();
         File.Delete(Voice_Set.Special_Path + "/Wwise/Project_Build.bat");
         string GeneratedFile = Directory.GetFiles(Project_Dir + "/GeneratedSoundBanks/Windows", BankName + ".bnk", SearchOption.AllDirectories)[0];
         Sub_Code.File_Move(GeneratedFile, OutputFilePath, true);
     }
     catch (Exception e)
     {
         Sub_Code.Error_Log_Write(e.Message);
     }
 }
示例#26
0
        private void Content_L_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            if (Content_L.SelectedIndex == -1)
            {
                return;
            }
            if (IsModeChanging)
            {
                IsModeChanging = false;
                return;
            }
            Bass.BASS_ChannelStop(Stream);
            Bass.BASS_StreamFree(Stream);
            int Voice_Count = BNK_FSB_Voices[Voices_L.SelectedIndex].Count;

            if (Voice_Count == 0)
            {
                Location_S.Value   = 0;
                Location_S.Maximum = 0;
                Location_T.Text    = "00:00";
                return;
            }
            string Get_Number = BNK_FSB_Voices[Voices_L.SelectedIndex][Content_L.SelectedIndex];

            if (!File.Exists(Sub_Code.File_Get_FileName_No_Extension(Voice_Set.Special_Path + "/Wwise/BNK_WAV_WoT/" + Get_Number)))
            {
                Message_Feed_Out("ファイルが見つかりませんでした。");
                return;
            }
            Load_Sound(Sub_Code.File_Get_FileName_No_Extension(Voice_Set.Special_Path + "/Wwise/BNK_WAV_WoT/" + Get_Number));
        }
 //.bnkファイルからwemをすべて抽出しoggへエンコード
 public bool Wwise_Extract_To_Ogg_Directory(string To_Dir, int Name_Mode, ref List <string> File_Names)
 {
     if (IsClear)
     {
         return(false);
     }
     try
     {
         if (!Directory.Exists(To_Dir))
         {
             Directory.CreateDirectory(To_Dir);
         }
         File_Names.Clear();
         List <string> Temp = new List <string>();
         if (Wwise_Extract_To_WEM_Directory(To_Dir, Name_Mode, ref Temp))
         {
             foreach (string File_Now in Temp)
             {
                 Sub_Code.WEM_To_File(File_Now, File_Now.Replace(".wem", ".ogg"), "ogg", true);
                 File_Names.Add(File_Now.Replace(".wem", ".ogg"));
             }
         }
         return(true);
     }
     catch (Exception e)
     {
         Sub_Code.Error_Log_Write(e.Message);
         return(false);
     }
 }
示例#28
0
        //FSB内のファイル数を取得
        public static int FSB_GetLength(string FSB_File)
        {
            RESULT FModResult;

            FMOD_API.FMOD_System FModSystem = new FMOD_API.FMOD_System();
            FModResult = Factory.System_Create(ref FModSystem);
            FModResult = FModSystem.init(16, INITFLAGS.NORMAL, IntPtr.Zero);
            Sound FModSound = new Sound();

            FModResult = FModSystem.createSound(FSB_File, MODE.CREATESTREAM, ref FModSound);
            if (FModResult != RESULT.OK)
            {
                FModSound.release();
                FModSystem.release();
                Sub_Code.Error_Log_Write(Error.String(FModResult));
                return(0);
            }
            else
            {
                int NumSubSounds = 0;
                FModResult = FModSound.getNumSubSounds(ref NumSubSounds);
                FModSound.release();
                FModSystem.release();
                return(NumSubSounds);
            }
        }
示例#29
0
 //SoundbanksInfo.jsonを指定しない場合
 public static void Init()
 {
     //名前をランダムに生成
     //なるべく文字が被らないようにGenerate_Random_Stringの引数を(6~12)に設定(6~12文字のランダムな文字列を生成)
     for (int Number_01 = 0; Number_01 < BNK_Info.RTPC_Info.Count; Number_01++)
     {
         BNK_Info.RTPC_Info[Number_01].Name = Sub_Code.Generate_Random_String(6, 12);
     }
     for (int Number_01 = 0; Number_01 < Switch.Switch_Info.Count; Number_01++)
     {
         Switch.Switch_Info[Number_01].Name = Sub_Code.Generate_Random_String(6, 12);
         for (int Number_02 = 0; Number_02 < Switch.Switch_Info[Number_01].Children.Count; Number_02++)
         {
             Switch.Switch_Info[Number_01].Children[Number_02].Name = Sub_Code.Generate_Random_String(6, 12);
         }
     }
     for (int Number_01 = 0; Number_01 < Events.Event_Info.Count; Number_01++)
     {
         Events.Event_Info[Number_01].Name = Sub_Code.Generate_Random_String(6, 12);
     }
     for (int Number_01 = 0; Number_01 < State.State_All_Info.Count; Number_01++)
     {
         State.State_All_Info[Number_01].Name = Sub_Code.Generate_Random_String(6, 12);
         for (int Number_02 = 0; Number_02 < State.State_Child_Info.Count; Number_02++)
         {
             State.State_Child_Info[Number_02].Name = Sub_Code.Generate_Random_String(6, 12);
         }
     }
 }
示例#30
0
 //サーバー上のテキストファイルを1行読み取る
 public string GetFileLine(string From_File, bool IsErrorLogMode = false)
 {
     if (!IsConnected)
     {
         return("");
     }
     else if (!SFTP_Server.IsConnected)
     {
         SFTP_Server.Connect();
     }
     try
     {
         StreamReader str     = SFTP_Server.OpenText(From_File);
         string       GetLine = str.ReadLine();
         str.Dispose();
         return(GetLine);
     }
     catch (Exception e)
     {
         if (IsErrorLogMode)
         {
             Sub_Code.Error_Log_Write(e.Message);
         }
         return("");
     }
 }