public static SmiResultCode PlayNotes(int handle, uint noteCount, HapticsNote[] notes, bool repeat, Notification callback) { CallbackItem item= new CallbackItem(); c_Notification cN = new c_Notification(Haptics.NotificationCallbakHandler); item.callback = callback; item.handle = handle; item.notesArray = notes; item.c_callback = cN; // reserve callback until callback is done lock (_locker) { // protect the _list inside of critical section _list.Add(item); } SmiResultCode result = c_PlayNotes(handle, noteCount, notes, repeat, cN); //System.Console.WriteLine("@PlayNotes handle = " + handle); //System.Console.WriteLine("@PlayNotes noteCount = " + noteCount); //System.Console.WriteLine("@PlayNotes repeat = " + repeat); //System.Console.WriteLine("@PlayNotes result = " + result); return result; }
private static extern SmiResultCode c_PlayNotes(int handle, uint noteCount, HapticsNote[] notes, bool repeat, c_Notification callback);