public void UnsubscribeToNoteOffUpdates(MidiChannel channel, int note, NoteOffDelegate callback) { if (noteOffCallbacks.ContainsKey(channel) && noteOffCallbacks[channel].ContainsKey(note) && noteOffCallbacks[channel][note].Contains(callback)) { noteOffCallbacks[channel][note].Remove(callback); } }
public void SubscribeToNoteOffUpdates(MidiChannel channel, int note, NoteOffDelegate callback) { if (!noteOffCallbacks.ContainsKey(channel)) { noteOffCallbacks.Add(channel, new Dictionary <int, List <NoteOffDelegate> >()); } if (!noteOffCallbacks[channel].ContainsKey(note)) { noteOffCallbacks[channel].Add(note, new List <NoteOffDelegate>()); } if (!noteOffCallbacks[channel][note].Contains(callback)) { noteOffCallbacks[channel][note].Add(callback); } }
public static void UnsubscribeToNoteOffUpdates(MidiChannel channel, int note, NoteOffDelegate callback) { MidiDriver.Instance.UnsubscribeToNoteOffUpdates(channel, note, callback); }