OSDN Git Service

起動時にウインドウが最前面に出なかった場合でも例外が出ないよう修正。HIDのAcqure(やPoll)に失敗したときにデバイスが外されたとみなして同deviceをDisp...
authoryyagi <yyagi.dtxmania@gmail.com>
Mon, 8 May 2017 14:29:55 +0000 (23:29 +0900)
committeryyagi <yyagi.dtxmania@gmail.com>
Mon, 8 May 2017 14:29:55 +0000 (23:29 +0900)
DTXManiaプロジェクト/コード/スコア、曲/CSong管理.cs
FDK17プロジェクト/コード/02.入力/CInput管理.cs

index cb2cc6a..1809d95 100644 (file)
@@ -1082,8 +1082,8 @@ namespace DTXMania
                        this.nSongsDBへ出力できたスコア数 = 0;\r
                        try\r
                        {\r
-                               //BinaryWriter bw = new BinaryWriter( new FileStream( SongsDBファイル名, FileMode.Create, FileAccess.Write ) );\r
-                               BinaryWriter bw = new BinaryWriter( new FileStreamSSD( SongsDBファイル名, FileMode.Create, FileAccess.Write ) );\r
+                               BinaryWriter bw = new BinaryWriter( new FileStream( SongsDBファイル名, FileMode.Create, FileAccess.Write ) );\r
+                               //BinaryWriter bw = new BinaryWriter( new FileStreamSSD( SongsDBファイル名, FileMode.Create, FileAccess.Write ) );\r
                                bw.Write( SONGSDB_VERSION );\r
                                this.tSongsDBにリストを1つ出力する(bw, this.list曲ルート);\r
                                bw.Close();\r
index 2b508bf..28de3f3 100644 (file)
@@ -183,11 +183,16 @@ namespace FDK
                                        {\r
                                                device.tポーリング(bWindowがアクティブ中, bバッファ入力を使用する);\r
                                        }\r
-                                       catch                                           // #24016 2011.1.6 yyagi: catch exception for unplugging USB joystick, and remove the device object from the polling items.\r
+                                       catch (Exception e)                                                                             // #24016 2011.1.6 yyagi: catch exception for unplugging USB joystick, and remove the device object from the polling items.\r
                                        {\r
-                                               this.list入力デバイス.Remove(device);\r
-                                               device.Dispose();\r
-                                               Trace.TraceError("tポーリング時に対象deviceが抜かれており例外発生。同deviceをポーリング対象からRemoveしました。");\r
+                                               Trace.TraceError("tポーリング(): " + device.e入力デバイス種別.ToString() + " : " + e.Message);\r
+                                               if (device.e入力デバイス種別 == E入力デバイス種別.Joystick)\r
+                                               {\r
+                                                       this.list入力デバイス.Remove(device);\r
+                                                       device.Dispose();\r
+                                                       Trace.TraceError("tポーリング時に対象deviceが抜かれており例外発生。同deviceをポーリング対象からRemoveしました。");\r
+                                               }\r
+                                               // Keyboard, mouseは、外されても、何もしない\r
                                        }\r
                                }\r
                        }\r