OSDN Git Service

設定ダイアログで音声ファイルを設定するUIを変更する
authorKazuhiro Fujieda <fujieda@users.sourceforge.jp>
Mon, 13 Oct 2014 16:33:49 +0000 (01:33 +0900)
committerKazuhiro Fujieda <fujieda@users.sourceforge.jp>
Mon, 13 Oct 2014 16:39:54 +0000 (01:39 +0900)
KancolleSniffer/Config.cs
KancolleSniffer/ConfigDialog.Designer.cs
KancolleSniffer/ConfigDialog.cs
KancolleSniffer/MainForm.cs

index ca8a0a8..1e836af 100644 (file)
@@ -56,6 +56,8 @@ namespace KancolleSniffer
         public string KDockSoundFile { get; set; }\r
         public string MaxShipsSoundFile { get; set; }\r
         public string DamagedShipSoundFile { get; set; }\r
+        public string Akashi20MinSoundFile { get; set; }\r
+        public string AkashiProgressSoundFile { get; set; }\r
         public bool Logging { get; set; }\r
         public string LogFile { get; set; }\r
         public ProxyConfig Proxy { get; set; }\r
@@ -74,6 +76,8 @@ namespace KancolleSniffer
             KDockSoundFile = Path.Combine(dir, "kenzou.mp3");\r
             MaxShipsSoundFile = Path.Combine(dir, "kanmusu.mp3");\r
             DamagedShipSoundFile = Path.Combine(dir, "taiha.mp3");\r
+            Akashi20MinSoundFile = Path.Combine(dir, "20min.mp3");\r
+            AkashiProgressSoundFile = Path.Combine(dir, "syuuri.mp3");\r
             LogFile = Path.Combine(dir, "log.txt");\r
 // ReSharper restore AssignNullToNotNullAttribute\r
             Proxy = new ProxyConfig();\r
index 3803662..073fb3a 100644 (file)
@@ -54,23 +54,12 @@ namespace KancolleSniffer
             this.checkBoxBalloon = new System.Windows.Forms.CheckBox();\r
             this.checkBoxFlash = new System.Windows.Forms.CheckBox();\r
             this.groupBoxSound = new System.Windows.Forms.GroupBox();\r
-            this.buttonDamagedShipOpenFile = new System.Windows.Forms.Button();\r
-            this.textBoxDamagedShipSoundFile = new System.Windows.Forms.TextBox();\r
-            this.label9 = new System.Windows.Forms.Label();\r
+            this.buttonPlay = new System.Windows.Forms.Button();\r
+            this.listBoxSoundFile = new System.Windows.Forms.ListBox();\r
+            this.buttonOpenFile = new System.Windows.Forms.Button();\r
+            this.textBoxSoundFile = new System.Windows.Forms.TextBox();\r
             this.numericUpDownSoundVolume = new System.Windows.Forms.NumericUpDown();\r
             this.label3 = new System.Windows.Forms.Label();\r
-            this.buttonMaxShipsOpenFile = new System.Windows.Forms.Button();\r
-            this.textBoxMaxShipsSoundFile = new System.Windows.Forms.TextBox();\r
-            this.label7 = new System.Windows.Forms.Label();\r
-            this.buttonKDockOpenFile = new System.Windows.Forms.Button();\r
-            this.textBoxKDockSoundFile = new System.Windows.Forms.TextBox();\r
-            this.label6 = new System.Windows.Forms.Label();\r
-            this.buttonNDockOpenFile = new System.Windows.Forms.Button();\r
-            this.textBoxNDockSoundFile = new System.Windows.Forms.TextBox();\r
-            this.label5 = new System.Windows.Forms.Label();\r
-            this.buttonMissionOpenFile = new System.Windows.Forms.Button();\r
-            this.textBoxMissionSoundFile = new System.Windows.Forms.TextBox();\r
-            this.label4 = new System.Windows.Forms.Label();\r
             this.buttonOk = new System.Windows.Forms.Button();\r
             this.buttonCancel = new System.Windows.Forms.Button();\r
             this.openFileDialog = new System.Windows.Forms.OpenFileDialog();\r
@@ -175,55 +164,56 @@ namespace KancolleSniffer
             // \r
             // groupBoxSound\r
             // \r
-            this.groupBoxSound.Controls.Add(this.buttonDamagedShipOpenFile);\r
-            this.groupBoxSound.Controls.Add(this.textBoxDamagedShipSoundFile);\r
-            this.groupBoxSound.Controls.Add(this.label9);\r
+            this.groupBoxSound.Controls.Add(this.buttonPlay);\r
+            this.groupBoxSound.Controls.Add(this.listBoxSoundFile);\r
+            this.groupBoxSound.Controls.Add(this.buttonOpenFile);\r
+            this.groupBoxSound.Controls.Add(this.textBoxSoundFile);\r
             this.groupBoxSound.Controls.Add(this.numericUpDownSoundVolume);\r
             this.groupBoxSound.Controls.Add(this.label3);\r
-            this.groupBoxSound.Controls.Add(this.buttonMaxShipsOpenFile);\r
-            this.groupBoxSound.Controls.Add(this.textBoxMaxShipsSoundFile);\r
-            this.groupBoxSound.Controls.Add(this.label7);\r
-            this.groupBoxSound.Controls.Add(this.buttonKDockOpenFile);\r
-            this.groupBoxSound.Controls.Add(this.textBoxKDockSoundFile);\r
-            this.groupBoxSound.Controls.Add(this.label6);\r
-            this.groupBoxSound.Controls.Add(this.buttonNDockOpenFile);\r
-            this.groupBoxSound.Controls.Add(this.textBoxNDockSoundFile);\r
-            this.groupBoxSound.Controls.Add(this.label5);\r
-            this.groupBoxSound.Controls.Add(this.buttonMissionOpenFile);\r
-            this.groupBoxSound.Controls.Add(this.textBoxMissionSoundFile);\r
-            this.groupBoxSound.Controls.Add(this.label4);\r
             this.groupBoxSound.Location = new System.Drawing.Point(6, 208);\r
             this.groupBoxSound.Name = "groupBoxSound";\r
-            this.groupBoxSound.Size = new System.Drawing.Size(240, 165);\r
+            this.groupBoxSound.Size = new System.Drawing.Size(240, 138);\r
             this.groupBoxSound.TabIndex = 1;\r
             this.groupBoxSound.TabStop = false;\r
             this.groupBoxSound.Text = "サウンド";\r
             // \r
-            // buttonDamagedShipOpenFile\r
+            // buttonPlay\r
             // \r
-            this.buttonDamagedShipOpenFile.Location = new System.Drawing.Point(191, 135);\r
-            this.buttonDamagedShipOpenFile.Name = "buttonDamagedShipOpenFile";\r
-            this.buttonDamagedShipOpenFile.Size = new System.Drawing.Size(41, 23);\r
-            this.buttonDamagedShipOpenFile.TabIndex = 16;\r
-            this.buttonDamagedShipOpenFile.Text = "参照";\r
-            this.buttonDamagedShipOpenFile.UseVisualStyleBackColor = true;\r
-            this.buttonDamagedShipOpenFile.Click += new System.EventHandler(this.buttonDamagedShipOpenFile_Click);\r
+            this.buttonPlay.Location = new System.Drawing.Point(91, 13);\r
+            this.buttonPlay.Name = "buttonPlay";\r
+            this.buttonPlay.Size = new System.Drawing.Size(37, 23);\r
+            this.buttonPlay.TabIndex = 18;\r
+            this.buttonPlay.Text = "再生";\r
+            this.buttonPlay.UseVisualStyleBackColor = true;\r
+            this.buttonPlay.Click += new System.EventHandler(this.buttonPlay_Click);\r
             // \r
-            // textBoxDamagedShipSoundFile\r
+            // listBoxSoundFile\r
             // \r
-            this.textBoxDamagedShipSoundFile.Location = new System.Drawing.Point(41, 137);\r
-            this.textBoxDamagedShipSoundFile.Name = "textBoxDamagedShipSoundFile";\r
-            this.textBoxDamagedShipSoundFile.Size = new System.Drawing.Size(144, 19);\r
-            this.textBoxDamagedShipSoundFile.TabIndex = 15;\r
+            this.listBoxSoundFile.FormattingEnabled = true;\r
+            this.listBoxSoundFile.ItemHeight = 12;\r
+            this.listBoxSoundFile.Location = new System.Drawing.Point(6, 41);\r
+            this.listBoxSoundFile.Name = "listBoxSoundFile";\r
+            this.listBoxSoundFile.Size = new System.Drawing.Size(228, 64);\r
+            this.listBoxSoundFile.TabIndex = 17;\r
+            this.listBoxSoundFile.SelectedIndexChanged += new System.EventHandler(this.listBoxSoundFile_SelectedIndexChanged);\r
             // \r
-            // label9\r
+            // buttonOpenFile\r
             // \r
-            this.label9.AutoSize = true;\r
-            this.label9.Location = new System.Drawing.Point(6, 140);\r
-            this.label9.Name = "label9";\r
-            this.label9.Size = new System.Drawing.Size(29, 12);\r
-            this.label9.TabIndex = 14;\r
-            this.label9.Text = "大破";\r
+            this.buttonOpenFile.Location = new System.Drawing.Point(189, 109);\r
+            this.buttonOpenFile.Name = "buttonOpenFile";\r
+            this.buttonOpenFile.Size = new System.Drawing.Size(45, 23);\r
+            this.buttonOpenFile.TabIndex = 16;\r
+            this.buttonOpenFile.Text = "参照...";\r
+            this.buttonOpenFile.UseVisualStyleBackColor = true;\r
+            this.buttonOpenFile.Click += new System.EventHandler(this.buttonOpenFile_Click);\r
+            // \r
+            // textBoxSoundFile\r
+            // \r
+            this.textBoxSoundFile.Location = new System.Drawing.Point(6, 111);\r
+            this.textBoxSoundFile.Name = "textBoxSoundFile";\r
+            this.textBoxSoundFile.Size = new System.Drawing.Size(179, 19);\r
+            this.textBoxSoundFile.TabIndex = 15;\r
+            this.textBoxSoundFile.TextChanged += new System.EventHandler(this.textBoxSoundFile_TextChanged);\r
             // \r
             // numericUpDownSoundVolume\r
             // \r
@@ -243,114 +233,10 @@ namespace KancolleSniffer
             this.label3.TabIndex = 0;\r
             this.label3.Text = "音量";\r
             // \r
-            // buttonMaxShipsOpenFile\r
-            // \r
-            this.buttonMaxShipsOpenFile.Location = new System.Drawing.Point(191, 111);\r
-            this.buttonMaxShipsOpenFile.Name = "buttonMaxShipsOpenFile";\r
-            this.buttonMaxShipsOpenFile.Size = new System.Drawing.Size(41, 23);\r
-            this.buttonMaxShipsOpenFile.TabIndex = 13;\r
-            this.buttonMaxShipsOpenFile.Text = "参照";\r
-            this.buttonMaxShipsOpenFile.UseVisualStyleBackColor = true;\r
-            this.buttonMaxShipsOpenFile.Click += new System.EventHandler(this.buttonMaxShipsOpenFile_Click);\r
-            // \r
-            // textBoxMaxShipsSoundFile\r
-            // \r
-            this.textBoxMaxShipsSoundFile.Location = new System.Drawing.Point(41, 113);\r
-            this.textBoxMaxShipsSoundFile.Name = "textBoxMaxShipsSoundFile";\r
-            this.textBoxMaxShipsSoundFile.Size = new System.Drawing.Size(144, 19);\r
-            this.textBoxMaxShipsSoundFile.TabIndex = 12;\r
-            // \r
-            // label7\r
-            // \r
-            this.label7.AutoSize = true;\r
-            this.label7.Location = new System.Drawing.Point(6, 116);\r
-            this.label7.Name = "label7";\r
-            this.label7.Size = new System.Drawing.Size(29, 12);\r
-            this.label7.TabIndex = 11;\r
-            this.label7.Text = "艦数";\r
-            // \r
-            // buttonKDockOpenFile\r
-            // \r
-            this.buttonKDockOpenFile.Location = new System.Drawing.Point(191, 87);\r
-            this.buttonKDockOpenFile.Name = "buttonKDockOpenFile";\r
-            this.buttonKDockOpenFile.Size = new System.Drawing.Size(41, 23);\r
-            this.buttonKDockOpenFile.TabIndex = 10;\r
-            this.buttonKDockOpenFile.Text = "参照";\r
-            this.buttonKDockOpenFile.UseVisualStyleBackColor = true;\r
-            this.buttonKDockOpenFile.Click += new System.EventHandler(this.buttonKDockOpenFile_Click);\r
-            // \r
-            // textBoxKDockSoundFile\r
-            // \r
-            this.textBoxKDockSoundFile.Location = new System.Drawing.Point(41, 89);\r
-            this.textBoxKDockSoundFile.Name = "textBoxKDockSoundFile";\r
-            this.textBoxKDockSoundFile.Size = new System.Drawing.Size(144, 19);\r
-            this.textBoxKDockSoundFile.TabIndex = 9;\r
-            // \r
-            // label6\r
-            // \r
-            this.label6.AutoSize = true;\r
-            this.label6.Location = new System.Drawing.Point(6, 92);\r
-            this.label6.Name = "label6";\r
-            this.label6.Size = new System.Drawing.Size(29, 12);\r
-            this.label6.TabIndex = 8;\r
-            this.label6.Text = "建造";\r
-            // \r
-            // buttonNDockOpenFile\r
-            // \r
-            this.buttonNDockOpenFile.Location = new System.Drawing.Point(191, 63);\r
-            this.buttonNDockOpenFile.Name = "buttonNDockOpenFile";\r
-            this.buttonNDockOpenFile.Size = new System.Drawing.Size(41, 23);\r
-            this.buttonNDockOpenFile.TabIndex = 7;\r
-            this.buttonNDockOpenFile.Text = "参照";\r
-            this.buttonNDockOpenFile.UseVisualStyleBackColor = true;\r
-            this.buttonNDockOpenFile.Click += new System.EventHandler(this.buttonNDockOpenFile_Click);\r
-            // \r
-            // textBoxNDockSoundFile\r
-            // \r
-            this.textBoxNDockSoundFile.Location = new System.Drawing.Point(41, 65);\r
-            this.textBoxNDockSoundFile.Name = "textBoxNDockSoundFile";\r
-            this.textBoxNDockSoundFile.Size = new System.Drawing.Size(144, 19);\r
-            this.textBoxNDockSoundFile.TabIndex = 6;\r
-            // \r
-            // label5\r
-            // \r
-            this.label5.AutoSize = true;\r
-            this.label5.Location = new System.Drawing.Point(6, 68);\r
-            this.label5.Name = "label5";\r
-            this.label5.Size = new System.Drawing.Size(29, 12);\r
-            this.label5.TabIndex = 5;\r
-            this.label5.Text = "入渠";\r
-            // \r
-            // buttonMissionOpenFile\r
-            // \r
-            this.buttonMissionOpenFile.Location = new System.Drawing.Point(191, 39);\r
-            this.buttonMissionOpenFile.Name = "buttonMissionOpenFile";\r
-            this.buttonMissionOpenFile.Size = new System.Drawing.Size(41, 23);\r
-            this.buttonMissionOpenFile.TabIndex = 4;\r
-            this.buttonMissionOpenFile.Text = "参照";\r
-            this.buttonMissionOpenFile.UseVisualStyleBackColor = true;\r
-            this.buttonMissionOpenFile.Click += new System.EventHandler(this.buttonMissionOpenFile_Click);\r
-            // \r
-            // textBoxMissionSoundFile\r
-            // \r
-            this.textBoxMissionSoundFile.Location = new System.Drawing.Point(41, 41);\r
-            this.textBoxMissionSoundFile.Name = "textBoxMissionSoundFile";\r
-            this.textBoxMissionSoundFile.Size = new System.Drawing.Size(144, 19);\r
-            this.textBoxMissionSoundFile.TabIndex = 3;\r
-            // \r
-            // label4\r
-            // \r
-            this.label4.AutoSize = true;\r
-            this.label4.Location = new System.Drawing.Point(6, 44);\r
-            this.label4.Name = "label4";\r
-            this.label4.Size = new System.Drawing.Size(29, 12);\r
-            this.label4.TabIndex = 2;\r
-            this.label4.Text = "遠征";\r
-            // \r
             // buttonOk\r
             // \r
             this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK;\r
-            this.buttonOk.Location = new System.Drawing.Point(90, 380);\r
+            this.buttonOk.Location = new System.Drawing.Point(87, 355);\r
             this.buttonOk.Margin = new System.Windows.Forms.Padding(3, 8, 3, 3);\r
             this.buttonOk.Name = "buttonOk";\r
             this.buttonOk.Size = new System.Drawing.Size(75, 23);\r
@@ -362,7 +248,7 @@ namespace KancolleSniffer
             // buttonCancel\r
             // \r
             this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;\r
-            this.buttonCancel.Location = new System.Drawing.Point(171, 380);\r
+            this.buttonCancel.Location = new System.Drawing.Point(165, 355);\r
             this.buttonCancel.Margin = new System.Windows.Forms.Padding(3, 6, 3, 3);\r
             this.buttonCancel.Name = "buttonCancel";\r
             this.buttonCancel.Size = new System.Drawing.Size(75, 23);\r
@@ -454,12 +340,12 @@ namespace KancolleSniffer
             this.ProxyToolStripMenuItem,\r
             this.DebugToolStripMenuItem});\r
             this.contextMenuStrip.Name = "contextMenuStrip";\r
-            this.contextMenuStrip.Size = new System.Drawing.Size(168, 70);\r
+            this.contextMenuStrip.Size = new System.Drawing.Size(168, 48);\r
             // \r
             // ProxyToolStripMenuItem\r
             // \r
             this.ProxyToolStripMenuItem.Name = "ProxyToolStripMenuItem";\r
-            this.ProxyToolStripMenuItem.Size = new System.Drawing.Size(165, 22);\r
+            this.ProxyToolStripMenuItem.Size = new System.Drawing.Size(167, 22);\r
             this.ProxyToolStripMenuItem.Text = "プロキシ設定(&P)";\r
             this.ProxyToolStripMenuItem.Click += new System.EventHandler(this.ProxyToolStripMenuItem_Click);\r
             // \r
@@ -476,7 +362,7 @@ namespace KancolleSniffer
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);\r
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
             this.CancelButton = this.buttonCancel;\r
-            this.ClientSize = new System.Drawing.Size(252, 412);\r
+            this.ClientSize = new System.Drawing.Size(252, 387);\r
             this.ContextMenuStrip = this.contextMenuStrip;\r
             this.Controls.Add(this.groupBoxAchievement);\r
             this.Controls.Add(this.groupBoxShow);\r
@@ -513,18 +399,6 @@ namespace KancolleSniffer
         private System.Windows.Forms.CheckBox checkBoxBalloon;\r
         private System.Windows.Forms.CheckBox checkBoxSound;\r
         private System.Windows.Forms.GroupBox groupBoxSound;\r
-        private System.Windows.Forms.Button buttonKDockOpenFile;\r
-        private System.Windows.Forms.TextBox textBoxKDockSoundFile;\r
-        private System.Windows.Forms.Label label6;\r
-        private System.Windows.Forms.Button buttonNDockOpenFile;\r
-        private System.Windows.Forms.TextBox textBoxNDockSoundFile;\r
-        private System.Windows.Forms.Label label5;\r
-        private System.Windows.Forms.Button buttonMissionOpenFile;\r
-        private System.Windows.Forms.TextBox textBoxMissionSoundFile;\r
-        private System.Windows.Forms.Label label4;\r
-        private System.Windows.Forms.Button buttonMaxShipsOpenFile;\r
-        private System.Windows.Forms.TextBox textBoxMaxShipsSoundFile;\r
-        private System.Windows.Forms.Label label7;\r
         private System.Windows.Forms.Button buttonOk;\r
         private System.Windows.Forms.Button buttonCancel;\r
         private System.Windows.Forms.Label label1;\r
@@ -539,12 +413,13 @@ namespace KancolleSniffer
         private System.Windows.Forms.Label label8;\r
         private System.Windows.Forms.CheckBox checkBoxReset14;\r
         private System.Windows.Forms.CheckBox checkBoxReset02;\r
-        private System.Windows.Forms.Button buttonDamagedShipOpenFile;\r
-        private System.Windows.Forms.TextBox textBoxDamagedShipSoundFile;\r
-        private System.Windows.Forms.Label label9;\r
+        private System.Windows.Forms.Button buttonOpenFile;\r
+        private System.Windows.Forms.TextBox textBoxSoundFile;\r
         private System.Windows.Forms.ContextMenuStrip contextMenuStrip;\r
         private System.Windows.Forms.ToolStripMenuItem DebugToolStripMenuItem;\r
         private System.Windows.Forms.Button buttonResetAchievement;\r
         private System.Windows.Forms.ToolStripMenuItem ProxyToolStripMenuItem;\r
+        private System.Windows.Forms.ListBox listBoxSoundFile;\r
+        private System.Windows.Forms.Button buttonPlay;\r
     }\r
 }
\ No newline at end of file
index 20831d4..aa58ff2 100644 (file)
@@ -16,6 +16,7 @@
 // along with this program; if not, see <http://www.gnu.org/licenses/>.\r
 \r
 using System;\r
+using System.Collections.Generic;\r
 using System.IO;\r
 using System.Linq;\r
 using System.Windows.Forms;\r
@@ -28,12 +29,14 @@ namespace KancolleSniffer
         private readonly MainForm _main;\r
         private DebugDialog _debugDialog;\r
         private ProxyDialog _proxyDialog;\r
+        private readonly Dictionary<string, string> _soundSetting = new Dictionary<string, string>();\r
 \r
         public ConfigDialog(Config config, MainForm main)\r
         {\r
             InitializeComponent();\r
             _config = config;\r
             _main = main;\r
+            listBoxSoundFile.Items.AddRange(new object[] {"遠征終了", "入渠終了", "建造完了", "艦娘数超過", "大破警告", "泊地修理20分経過", "泊地修理進行"});\r
         }\r
 \r
         private void ConfigDialog_Load(object sender, EventArgs e)\r
@@ -48,11 +51,15 @@ namespace KancolleSniffer
             checkBoxReset14.Checked = _config.ResetHours.Any(x => x == 14);\r
 \r
             numericUpDownSoundVolume.Value = _config.SoundVolume;\r
-            textBoxMissionSoundFile.Text = _config.MissionSoundFile;\r
-            textBoxNDockSoundFile.Text = _config.NDockSoundFile;\r
-            textBoxKDockSoundFile.Text = _config.KDockSoundFile;\r
-            textBoxMaxShipsSoundFile.Text = _config.MaxShipsSoundFile;\r
-            textBoxDamagedShipSoundFile.Text = _config.DamagedShipSoundFile;\r
+\r
+            _soundSetting["遠征終了"] = _config.MissionSoundFile;\r
+            _soundSetting["入渠終了"] = _config.NDockSoundFile;\r
+            _soundSetting["建造完了"] = _config.KDockSoundFile;\r
+            _soundSetting["艦娘数超過"] = _config.MaxShipsSoundFile;\r
+            _soundSetting["大破警告"] = _config.DamagedShipSoundFile;\r
+            _soundSetting["泊地修理20分経過"] = _config.Akashi20MinSoundFile;\r
+            _soundSetting["泊地修理進行"] = _config.AkashiProgressSoundFile;\r
+            listBoxSoundFile.SelectedIndex = 0;\r
         }\r
 \r
         private void buttonOk_Click(object sender, EventArgs e)\r
@@ -70,11 +77,14 @@ namespace KancolleSniffer
                 _config.ResetHours.Add(14);\r
 \r
             _config.SoundVolume = (int)numericUpDownSoundVolume.Value;\r
-            _config.MissionSoundFile = textBoxMissionSoundFile.Text;\r
-            _config.NDockSoundFile = textBoxNDockSoundFile.Text;\r
-            _config.KDockSoundFile = textBoxKDockSoundFile.Text;\r
-            _config.MaxShipsSoundFile = textBoxMaxShipsSoundFile.Text;\r
-            _config.DamagedShipSoundFile = textBoxDamagedShipSoundFile.Text;\r
+\r
+            _config.MissionSoundFile = _soundSetting["遠征終了"];\r
+            _config.NDockSoundFile = _soundSetting["入渠終了"];\r
+            _config.KDockSoundFile = _soundSetting["建造完了"];\r
+            _config.MaxShipsSoundFile = _soundSetting["艦娘数超過"];\r
+            _config.DamagedShipSoundFile = _soundSetting["大破警告"];\r
+            _config.Akashi20MinSoundFile = _soundSetting["泊地修理20分経過"];\r
+            _config.AkashiProgressSoundFile = _soundSetting["泊地修理進行"];\r
         }\r
 \r
         private void checkBoxSound_CheckedChanged(object sender, EventArgs e)\r
@@ -82,37 +92,31 @@ namespace KancolleSniffer
             groupBoxSound.Enabled = checkBoxSound.Checked;\r
         }\r
 \r
-        private void buttonMissionOpenFile_Click(object sender, EventArgs e)\r
+        private void textBoxSoundFile_TextChanged(object sender, EventArgs e)\r
         {\r
-            ChooseSoundFile(textBoxMissionSoundFile);\r
+            _soundSetting[(string)listBoxSoundFile.SelectedItem] = textBoxSoundFile.Text;\r
         }\r
 \r
-        private void buttonNDockOpenFile_Click(object sender, EventArgs e)\r
+        private void listBoxSoundFile_SelectedIndexChanged(object sender, EventArgs e)\r
         {\r
-            ChooseSoundFile(textBoxNDockSoundFile);\r
+            textBoxSoundFile.Text = _soundSetting[(string)listBoxSoundFile.SelectedItem];\r
+            textBoxSoundFile.Select(textBoxSoundFile.Text.Length, 0);\r
         }\r
 \r
-        private void buttonKDockOpenFile_Click(object sender, EventArgs e)\r
+        private void buttonOpenFile_Click(object sender, EventArgs e)\r
         {\r
-            ChooseSoundFile(textBoxKDockSoundFile);\r
+            openFileDialog.FileName = textBoxSoundFile.Text;\r
+            openFileDialog.InitialDirectory = Path.GetDirectoryName(textBoxSoundFile.Text) ?? "";\r
+            if (openFileDialog.ShowDialog() != DialogResult.OK)\r
+                return;\r
+            textBoxSoundFile.Text = openFileDialog.FileName;\r
+            textBoxSoundFile.Select(textBoxSoundFile.Text.Length, 0);\r
         }\r
 \r
-        private void buttonMaxShipsOpenFile_Click(object sender, EventArgs e)\r
-        {\r
-            ChooseSoundFile(textBoxMaxShipsSoundFile);\r
-        }\r
-\r
-        private void buttonDamagedShipOpenFile_Click(object sender, EventArgs e)\r
-        {\r
-            ChooseSoundFile(textBoxDamagedShipSoundFile);\r
-        }\r
 \r
-        private void ChooseSoundFile(TextBox textBox)\r
+        private void buttonPlay_Click(object sender, EventArgs e)\r
         {\r
-            openFileDialog.FileName = textBox.Text;\r
-            openFileDialog.InitialDirectory = Path.GetDirectoryName(textBox.Text) ?? "";\r
-            if (openFileDialog.ShowDialog() == DialogResult.OK)\r
-                textBox.Text = openFileDialog.FileName;\r
+            _main.PlaySound(_soundSetting[(string)listBoxSoundFile.SelectedItem], (int)numericUpDownSoundVolume.Value);\r
         }\r
 \r
         private void DebugToolStripMenuItem_Click(object sender, EventArgs e)\r
index b6043d0..bedb068 100644 (file)
@@ -531,7 +531,7 @@ namespace KancolleSniffer
             {\r
                 if (msgs[i] == "")\r
                     continue;\r
-                var sound = msgs[i] == "20分経過しました。" ? "20min.mp3" : "syuuri.mp3";\r
+                var sound = msgs[i] == "20分経過しました。" ? _config.Akashi20MinSoundFile : _config.AkashiProgressSoundFile;\r
                 _akashiTimerNoticeQueue.Enqueue(new[] {"泊地修理 " + fn[i], msgs[i], sound});\r
                 _akashiTimerNoticeQueue.Enqueue(new[] {""}); //連続する通知の間隔をあける\r
                 _akashiTimerNoticeQueue.Enqueue(new[] {""});\r
@@ -620,12 +620,17 @@ namespace KancolleSniffer
                 Win32API.FlashWindow(Handle);\r
             if (_config.ShowBaloonTip)\r
                 notifyIconMain.ShowBalloonTip(20000, baloonTitle, baloonMessage, ToolTipIcon.Info);\r
-            if (_config.PlaySound && File.Exists(soundFile))\r
-            {\r
-                _wmp.settings.volume = _config.SoundVolume;\r
-                _wmp.URL = soundFile;\r
-                _wmp.controls.play();\r
-            }\r
+            if (_config.PlaySound)\r
+                PlaySound(soundFile, _config.SoundVolume);\r
+        }\r
+\r
+        public void PlaySound(string file, int volume)\r
+        {\r
+            if (!File.Exists(file))\r
+                return;\r
+            _wmp.settings.volume = volume;\r
+            _wmp.URL = file;\r
+            _wmp.controls.play();\r
         }\r
 \r
         private void _wmp_PlayStateChange(object sender, EventArgs e)\r