• R/O
  • HTTP
  • SSH
  • HTTPS

dtxmania: Commit


Commit MetaInfo

Revision0c282febd430a19882761187d8704f9829cc36c7 (tree)
Time2019-06-14 00:38:10
Authoryyagi <yyagi.dtxmania@gmai...>
Commiteryyagi

Log Message

#34763 64bit対応でMIDI入力が動作しなくなっていた問題を修正。
(せなさんのDTXMania ALの修正コメントがヒントになりました。ありがとうございます。)

Change Summary

Incremental Difference

--- a/FDK/コード/00.共通/CWin32.cs
+++ b/FDK/コード/00.共通/CWin32.cs
@@ -343,21 +343,21 @@ namespace FDK
343343 [DllImport( "user32.dll", CharSet = CharSet.Auto )]
344344 public static extern bool IsZoomed( IntPtr hWnd );
345345 [DllImport( "winmm.dll" )]
346- public static extern uint midiInClose( uint hMidiIn );
346+ public static extern uint midiInClose( IntPtr hMidiIn );
347347 [DllImport( "winmm.dll" )]
348348 public static extern uint midiInGetDevCaps( uint uDeviceID, ref MIDIINCAPS lpMidiInCaps, uint cbMidiInCaps );
349349 [DllImport( "winmm.dll" )]
350- public static extern uint midiInGetID( uint hMidiIn, ref uint puDeviceID );
350+ public static extern uint midiInGetID( IntPtr hMidiIn, ref IntPtr puDeviceID );
351351 [DllImport( "winmm.dll" )]
352352 public static extern uint midiInGetNumDevs();
353353 [DllImport( "winmm.dll" )]
354- public static extern uint midiInOpen( ref uint phMidiIn, uint uDeviceID, MidiInProc dwCallback, int dwInstance, int fdwOpen );
354+ public static extern uint midiInOpen( ref IntPtr phMidiIn, uint uDeviceID, MidiInProc dwCallback, IntPtr dwInstance, int fdwOpen );
355355 [DllImport( "winmm.dll" )]
356- public static extern uint midiInReset( uint hMidiIn );
356+ public static extern uint midiInReset( IntPtr hMidiIn );
357357 [DllImport( "winmm.dll" )]
358- public static extern uint midiInStart( uint hMidiIn );
358+ public static extern uint midiInStart( IntPtr hMidiIn );
359359 [DllImport( "winmm.dll" )]
360- public static extern uint midiInStop( uint hMidiIn );
360+ public static extern uint midiInStop( IntPtr hMidiIn );
361361 [DllImport( "user32.dll", CharSet = CharSet.Auto )]
362362 public static extern IntPtr MonitorFromWindow( IntPtr hwnd, uint dwFlags );
363363 [return: MarshalAs( UnmanagedType.Bool )]
@@ -808,6 +808,6 @@ namespace FDK
808808
809809 // Win32 メッセージ処理デリゲート
810810
811- public delegate void MidiInProc( uint hMidiIn, uint wMsg, int dwInstance, int dwParam1, int dwParam2 );
811+ public delegate void MidiInProc( IntPtr hMidiIn, uint wMsg, int dwInstance, int dwParam1, int dwParam2 );
812812 }
813813 }
--- a/FDK/コード/02.入力/CInputMIDI.cs
+++ b/FDK/コード/02.入力/CInputMIDI.cs
@@ -9,14 +9,14 @@ namespace FDK
99 {
1010 // プロパティ
1111
12- public uint hMidiIn;
12+ public IntPtr hMidiIn;
1313 public List<STInputEvent> listEventBuffer;
1414
1515 // コンストラクタ
1616
1717 public CInputMIDI( uint nID )
1818 {
19- this.hMidiIn = 0;
19+ this.hMidiIn = IntPtr.Zero;
2020 this.listEventBuffer = new List<STInputEvent>( 32 );
2121 this.list入力イベント = new List<STInputEvent>( 32 );
2222 this.e入力デバイス種別 = E入力デバイス種別.MidiIn;
--- a/FDK/コード/02.入力/CInput管理.cs
+++ b/FDK/コード/02.入力/CInput管理.cs
@@ -62,11 +62,7 @@ namespace FDK
6262
6363
6464 // コンストラクタ
65- public CInput管理( IntPtr hWnd )
66- {
67- CInput管理初期化( hWnd, true );
68- }
69- public CInput管理( IntPtr hWnd, bool bUseMidiIn )
65+ public CInput管理( IntPtr hWnd, bool bUseMidiIn = true )
7066 {
7167 CInput管理初期化( hWnd, bUseMidiIn );
7268 }
@@ -117,7 +113,7 @@ namespace FDK
117113 {
118114 Trace.TraceError( "MIDI In: Device{0}: midiInDevCaps(): {1:X2}: ", i, num3 );
119115 }
120- else if ( ( CWin32.midiInOpen( ref item.hMidiIn, i, this.proc, 0, 0x30000 ) == 0 ) && ( item.hMidiIn != 0 ) )
116+ else if ( ( CWin32.midiInOpen( ref item.hMidiIn, i, this.proc, IntPtr.Zero, 0x30000 ) == 0 ) && ( item.hMidiIn != IntPtr.Zero ) )
121117 {
122118 CWin32.midiInStart( item.hMidiIn );
123119 Trace.TraceInformation( "MIDI In: [{0}] \"{1}\" の入力受付を開始しました。", i, lpMidiInCaps.szPname );
@@ -267,7 +263,7 @@ namespace FDK
267263 private CWin32.MidiInProc proc;
268264 // private CTimer timer;
269265
270- private void MidiInCallback( uint hMidiIn, uint wMsg, int dwInstance, int dwParam1, int dwParam2 )
266+ private void MidiInCallback( IntPtr hMidiIn, uint wMsg, int dwInstance, int dwParam1, int dwParam2 )
271267 {
272268 int p = dwParam1 & 0xF0;
273269 if( wMsg != CWin32.MIM_DATA || ( p != 0x80 && p != 0x90 && p != 0xB0 ) )
--- a/MidiInChecker2_Solution/MidiInChecker2_Project/PsuedoFDK/CInputManager.cs
+++ b/MidiInChecker2_Solution/MidiInChecker2_Project/PsuedoFDK/CInputManager.cs
@@ -45,7 +45,7 @@ namespace MidiInChecker2
4545 {
4646 Trace.TraceError( "MIDI In: Device{0}: midiInDevCaps(): {1:X2}: ", i, retcode );
4747 }
48- else if ( ( CWin32.midiInOpen( ref item.hMidiIn, i, this.proc, 0, 0x30000 ) == 0 ) && ( item.hMidiIn != 0 ) )
48+ else if ( ( CWin32.midiInOpen( ref item.hMidiIn, i, this.proc, IntPtr.Zero, 0x30000 ) == 0 ) && ( item.hMidiIn != IntPtr.Zero ) )
4949 {
5050 CWin32.midiInStart( item.hMidiIn );
5151 Trace.TraceInformation( "MIDI In: [{0}] \"{1}\" の入力受付を開始しました。", i, lpMidiInCaps.szPname );
@@ -154,7 +154,7 @@ namespace MidiInChecker2
154154 private object objMidiIn排他用 = new object();
155155 private CWin32.MidiInProc proc;
156156
157- private void MidiInCallback( uint hMidiIn, uint wMsg, int dwInstance, int dwParam1, int dwParam2 )
157+ private void MidiInCallback( IntPtr hMidiIn, uint wMsg, int dwInstance, int dwParam1, int dwParam2 )
158158 {
159159 int p = dwParam1 & 0xF0;
160160 if ( wMsg != CWin32.MIM_DATA ) // || ( p != 0x80 && p != 0x90 && p != 0xB0 ) )
--- a/MidiInChecker2_Solution/MidiInChecker2_Project/PsuedoFDK/CInputMidi.cs
+++ b/MidiInChecker2_Solution/MidiInChecker2_Project/PsuedoFDK/CInputMidi.cs
@@ -9,7 +9,7 @@ namespace MidiInChecker2
99 {
1010 // プロパティ
1111
12- public uint hMidiIn;
12+ public IntPtr hMidiIn;
1313 public List<STInputEvent> listEventBuffer;
1414
1515
@@ -17,7 +17,7 @@ namespace MidiInChecker2
1717
1818 public CInputMIDI( uint nID )
1919 {
20- this.hMidiIn = 0;
20+ this.hMidiIn = IntPtr.Zero;
2121 this.listEventBuffer = new List<STInputEvent>( 32 );
2222 this.list入力イベント = new List<STInputEvent>( 32 );
2323 this.e入力デバイス種別 = E入力デバイス種別.MidiIn;
--- a/MidiInChecker2_Solution/MidiInChecker2_Project/PsuedoFDK/CWin32.cs
+++ b/MidiInChecker2_Solution/MidiInChecker2_Project/PsuedoFDK/CWin32.cs
@@ -186,21 +186,21 @@ namespace MidiInChecker2
186186 [DllImport( "user32.dll", CharSet = CharSet.Auto )]
187187 public static extern bool IsZoomed( IntPtr hWnd );
188188 [DllImport( "winmm.dll" )]
189- public static extern uint midiInClose( uint hMidiIn );
189+ public static extern uint midiInClose( IntPtr hMidiIn );
190190 [DllImport( "winmm.dll" )]
191191 public static extern uint midiInGetDevCaps( uint uDeviceID, ref MIDIINCAPS lpMidiInCaps, uint cbMidiInCaps );
192192 [DllImport( "winmm.dll" )]
193- public static extern uint midiInGetID( uint hMidiIn, ref uint puDeviceID );
193+ public static extern uint midiInGetID( IntPtr hMidiIn, ref IntPtr puDeviceID );
194194 [DllImport( "winmm.dll" )]
195195 public static extern uint midiInGetNumDevs();
196196 [DllImport( "winmm.dll" )]
197- public static extern uint midiInOpen( ref uint phMidiIn, uint uDeviceID, MidiInProc dwCallback, int dwInstance, int fdwOpen );
197+ public static extern uint midiInOpen( ref IntPtr phMidiIn, uint uDeviceID, MidiInProc dwCallback, IntPtr dwInstance, int fdwOpen );
198198 [DllImport( "winmm.dll" )]
199- public static extern uint midiInReset( uint hMidiIn );
199+ public static extern uint midiInReset( IntPtr hMidiIn );
200200 [DllImport( "winmm.dll" )]
201- public static extern uint midiInStart( uint hMidiIn );
201+ public static extern uint midiInStart( IntPtr hMidiIn );
202202 [DllImport( "winmm.dll" )]
203- public static extern uint midiInStop( uint hMidiIn );
203+ public static extern uint midiInStop( IntPtr hMidiIn );
204204 [DllImport( "user32.dll", CharSet = CharSet.Auto )]
205205 public static extern IntPtr MonitorFromWindow( IntPtr hwnd, uint dwFlags );
206206 [return: MarshalAs( UnmanagedType.Bool )]
@@ -496,6 +496,6 @@ namespace MidiInChecker2
496496
497497 // Win32 メッセージ処理デリゲート
498498
499- public delegate void MidiInProc( uint hMidiIn, uint wMsg, int dwInstance, int dwParam1, int dwParam2 );
499+ public delegate void MidiInProc( IntPtr hMidiIn, uint wMsg, int dwInstance, int dwParam1, int dwParam2 );
500500 }
501501 }
Binary files /dev/null and b/RuntimeResources/MidiInChecker2.exe differ
Show on old repository browser