Esempio n. 1
0
        //-----------------------------------------------------------------------------------------------
        //セーブする
        //-----------------------------------------------------------------------------------------------
        public void SaveSet()
        {
            string m_exePath = System.IO.Directory.GetCurrentDirectory();

            m_exePath = MainFunction.Add_EndPathSeparator(m_exePath);
            Program.m_data.settingSave(m_exePath + "option.txt");
            Program.m_data.SaveFavList();
        }
Esempio n. 2
0
 private void checkBox6_MouseDown(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Middle)
     {
         string exePath = System.IO.Directory.GetCurrentDirectory();//System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
         exePath = MainFunction.Add_EndPathSeparator(exePath);
         System.Diagnostics.Process p = System.Diagnostics.Process.Start(exePath + SEViewer.Program.m_data.txtPath[3]);
     }
 }
Esempio n. 3
0
        //-----------------------------------------------------------------------------------------------
        //オプション情報を保存する。
        //-----------------------------------------------------------------------------------------------
        public bool settingSave(string settingFilePath)
        {
            //ここから設定の書き込み
            for (int i = 0; i < MAX_CATEGORY; i++)
            {
                soundPath[i] = MainFunction.Add_EndPathSeparator(jsonData.音ファイルのパス[i]);

                jsonData.音リストテキストのパス[i] = txtPath[i];
            }

            for (int i = 0; i < copyStr.Count; i++)
            {
                jsonData.コピー文[i] = copyStr[i];
            }

            jsonData.汎用コピー文 = generalCopyStr;

            jsonData.画面分割幅 = m_splitSize;

            //window座標とか
            jsonData.ウインドウ座標[0] = m_left;
            jsonData.ウインドウ座標[1] = m_top;
            jsonData.ウインドウ座標[2] = m_width;
            jsonData.ウインドウ座標[3] = m_height;

            jsonData.音リストのカラム幅[0] = m_col1Size;
            jsonData.音リストのカラム幅[1] = m_col2Size;
            jsonData.音リストのカラム幅[2] = m_col3Size;
            jsonData.音リストのカラム幅[3] = m_col4Size;

            //ツールオプションのon/off
            for (int i = 0; i < jsonData.機能オプションONOFF.Count; i++)
            {
                jsonData.機能オプションONOFF[i] = (m_toolOption[i] == 1?true:false);;
            }

            var outputStr = JsonConvert.SerializeObject(jsonData);

            outputStr = format_json(outputStr);

            File.WriteAllText(settingFilePath, outputStr);

            return(true);
        }
Esempio n. 4
0
        static void Main()
        {
            string exePath = System.IO.Directory.GetCurrentDirectory();// System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);

            exePath = MainFunction.Add_EndPathSeparator(exePath);


            GetEncodeClass getEncoder = new GetEncodeClass();

            if (System.IO.File.Exists(exePath + "option.txt") && getEncoder.GetEncoding(exePath + "option.txt") != System.Text.Encoding.UTF8)
            {
                System.Windows.Forms.MessageBox.Show("設定ファイル(option.txt)の文字コードが UTF-8 以外で保存されています。option.txtの文字コードを変更してください。", "");
                return;
            }

            if (getEncoder.GetEncoding(exePath + "_option.txt") != System.Text.Encoding.UTF8)
            {
                System.Windows.Forms.MessageBox.Show("設定ファイル(_option.txt)の文字コードが UTF-8 以外で保存されています。option.txtの文字コードを変更してください。", "");
                return;
            }



            if (Program.m_data.settingLoad(exePath + "option.txt") == false)
            {
                if (Program.m_data.settingLoad(exePath + "_option.txt") == false)
                {
                    System.Windows.Forms.MessageBox.Show("設定ファイル(option.txt)が存在しないか、内容に問題があったため、ツールは自動的に終了します。\n設定ファイルがあるか、内容に問題がないか確認してください", "");
                    return;
                }
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
            Environment.Exit(0);
        }
Esempio n. 5
0
        //-----------------------------------------------------------------------------------------------
        //
        //-----------------------------------------------------------------------------------------------
        public bool settingLoad(string settingFilePath)
        {
            try{
                //ここから設定の読み込み

                jsonData = JsonConvert.DeserializeObject <readJsonType1>(File.ReadAllText(settingFilePath));


                for (int i = 0; i < MAX_CATEGORY; i++)
                {
                    soundPath[i] = MainFunction.Add_EndPathSeparator(jsonData.音ファイルのパス[i]);

                    txtPath[i] = jsonData.音リストテキストのパス[i];
                }

                copyStr = new List <string>();
                for (int i = 0; i < jsonData.コピー文.Count; i++)
                {
                    copyStr.Add(jsonData.コピー文[i]);
                }

                //window座標とか
                m_left   = 0;
                m_top    = 0;
                m_width  = 780;
                m_height = 480;

                m_col1Size = 200;
                m_col2Size = 80;
                m_col3Size = 80;
                m_col4Size = 400;

                m_splitSize = jsonData.画面分割幅;

                //window座標とか
                m_left   = jsonData.ウインドウ座標[0];
                m_top    = jsonData.ウインドウ座標[1];
                m_width  = jsonData.ウインドウ座標[2];
                m_height = jsonData.ウインドウ座標[3];

                m_col1Size = jsonData.音リストのカラム幅[0];
                m_col2Size = jsonData.音リストのカラム幅[1];
                m_col3Size = jsonData.音リストのカラム幅[2];
                m_col4Size = jsonData.音リストのカラム幅[3];

                //ツールオプションのon/off
                for (int i = 0; i < jsonData.機能オプションONOFF.Count; i++)
                {
                    m_toolOption.Add((jsonData.機能オプションONOFF[i] == true?1:0));
                }

                if (m_left < 0)
                {
                    m_left = 0;
                }
                if (m_top < 0)
                {
                    m_top = 0;
                }
                if (m_height < 100)
                {
                    m_height = 100;
                }
                if (m_width < 100)
                {
                    m_width = 100;
                }

                generalCopyStr = jsonData.汎用コピー文;
            }
            catch (System.Exception ex)
            {
                //	System.Windows.Forms.MessageBox.Show("設定ファイル(option.txt)が見つからない、または内容が正しくありません。\noption.txtの記述はjson形式となっています。");
                return(false);
            }
            //-----------------------------------------------------

            DataSet tmpData;
            Regex   regGeter  = new Regex("(.*),(.*)", RegexOptions.IgnoreCase);
            Regex   regGeter2 = new Regex("(.*),(.*),(.*)", RegexOptions.IgnoreCase);
            Regex   regIgnore = new Regex(@"//|^\n", RegexOptions.IgnoreCase);

            Regex regGenre   = new Regex("※(.*)");
            Regex regGenreEx = new Regex("※(.*),#(..)(..)(..)");

            string nowGenre = "未定ジャンル";
            string uniGenre = "";

            Match matcIgnoreResult = null;
            Match matchStringSplit = null;

            for (int i = 0; i < MAX_CATEGORY; i++)
            {
                nowGenre = "未定ジャンル";
                if (!(System.IO.File.Exists(txtPath[i])))
                {
                    //txtPath[i] = "";
                    continue;
                }

                //csvを読み込
                System.IO.StreamReader streamData = new System.IO.StreamReader(txtPath[i], System.Text.Encoding.Default);

                // 読み込んだ結果をすべて格納するための変数を宣言する
                string stResult = string.Empty;

                while (streamData.Peek() >= 0)
                {
                    string stBuffer = streamData.ReadLine();

                    matcIgnoreResult = regIgnore.Match(stBuffer);
                    if (matcIgnoreResult.Success == true)
                    {
                        continue;
                    }

                    uniGenre = "";

                    //まずジャンル色付きを読み込むか判別
                    matchStringSplit = regGenreEx.Match(stBuffer);
                    if (matchStringSplit.Success == true)
                    {
                        nowGenre = matchStringSplit.Groups[1].Value;
                        int   R          = System.Convert.ToInt32(matchStringSplit.Groups[2].Value, 16);
                        int   G          = System.Convert.ToInt32(matchStringSplit.Groups[3].Value, 16);
                        int   B          = System.Convert.ToInt32(matchStringSplit.Groups[4].Value, 16);
                        Color genreColor = Color.FromArgb(R, G, B);

                        m_genreList[i].Add(nowGenre);
                        m_genreColorList[i].Add(genreColor);
                    }
                    else
                    {
                        matchStringSplit = regGenre.Match(stBuffer);
                        if (matchStringSplit.Success == true)
                        {
                            nowGenre = matchStringSplit.Groups[1].Value;
                            m_genreList[i].Add(nowGenre);
                            m_genreColorList[i].Add(Color.Black);
                        }
                        else
                        {
                            matchStringSplit = regGeter2.Match(stBuffer);
                            if (matchStringSplit.Success == false)
                            {
                                matchStringSplit = regGeter.Match(stBuffer);
                                if (matchStringSplit.Success == false)
                                {
                                    continue;
                                }
                                else
                                {
                                    uniGenre = "";
                                }
                            }
                            else
                            {
                                uniGenre = matchStringSplit.Groups[3].ToString();
                                m_genreList2[i].Add(nowGenre + "∴" + uniGenre);
                            }

                            tmpData            = new DataSet();
                            tmpData.m_fileName = matchStringSplit.Groups[1].ToString();
                            tmpData.m_summary  = matchStringSplit.Groups[2].ToString();
                            tmpData.m_genre1   = nowGenre;
                            tmpData.m_genre2   = uniGenre;
                            tmpData.m_isExist  = false;

                            m_dataMaster[i][tmpData.m_fileName] = tmpData;
                        }
                    }
                }
                streamData.Close();
            }

            //-----------------------------------------------------

            return(true);
        }
Esempio n. 6
0
        //-----------------------------------------------------------------------------------------------
        //初期化
        //-----------------------------------------------------------------------------------------------
        public Form1()
        {
            InitializeComponent();

            m_soundPlayer = new soundPlayer(this);

            System.Math.Max(10, System.Math.Min(5, 8));

            //----------------------------------------------------------------
            m_exePath = System.IO.Directory.GetCurrentDirectory();            //System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            m_exePath = MainFunction.Add_EndPathSeparator(m_exePath);

            tabCategorySE.Text      = System.IO.Path.GetFileNameWithoutExtension(Program.m_data.txtPath[0]);
            tabCategoryBGM.Text     = System.IO.Path.GetFileNameWithoutExtension(Program.m_data.txtPath[1]);
            tabCategoryBGV.Text     = System.IO.Path.GetFileNameWithoutExtension(Program.m_data.txtPath[2]);
            tabCategoryUSEFULL.Text = System.IO.Path.GetFileNameWithoutExtension(Program.m_data.txtPath[3]);
            tabCategoryFAV.Text     = System.IO.Path.GetFileNameWithoutExtension(Program.m_data.txtPath[4]);

            //----------------------------------------------------------------

            string[] m_fileListTmpGet;

            for (int i = 0; i < DataSetManager.MAX_CATEGORY; i++)
            {
                //まずはフォルダ内のwavファイルを全て列挙
                m_fileListTmpGet = SEViewer.MainFunction.Get_PathFromDirectroy(Program.m_data.soundPath[i], "*.wav", true);

                foreach (string fileName in m_fileListTmpGet)
                {
                    m_fileList.Add(fileName);
                }

                //wavファイル情報をリストに入れておく
                Program.m_data.AddDictionary(m_fileList, i);
                m_fileList.Clear();

                //まずはフォルダ内のoggファイルを全て列挙
                m_fileListTmpGet = SEViewer.MainFunction.Get_PathFromDirectroy(Program.m_data.soundPath[i], "*.ogg", true);

                foreach (string fileName in m_fileListTmpGet)
                {
                    m_fileList.Add(fileName);
                }

                //oggをリストに入れてみる
                Program.m_data.AddDictionary(m_fileList, i);
                m_fileList.Clear();
            }
            //----------------------------------------------------------------

            UpdateGenreComboBox(0);
            UpdateGenreComboBox2(0);

            comboBox4.SelectedIndex = 0;
            NewCreateFileList();

            UpdateList("");

            copyStrSelect.SelectedIndex = 1;

            //----------------------------------------------------------------
            SetListViewItem();

            //ListViewItemComparerの作成と設定
            listViewItemSorter             = new ListViewItemComparer();
            listViewItemSorter.ColumnModes =
                new ListViewItemComparer.ComparerMode[]
            {
                ListViewItemComparer.ComparerMode.String,
                ListViewItemComparer.ComparerMode.String,
                ListViewItemComparer.ComparerMode.String
            };

            //ListViewItemSorterを指定する
            listView1.ListViewItemSorter = listViewItemSorter;

            SetTreeViewItem(0);
            GetFavGenre();
        }