Пример #1
0
        //frees RtMidiDevice
        static void freeHandle(IntPtr device)
        {
            //free pointer
            MidiInternal.rtmidi_in_free(device);

            //set pointer to null
            device = IntPtr.Zero;
        }
Пример #2
0
    void OnDisable()
    {
        MidiInternal.rtmidi_in_free(ptr);
        MidiInternal.rtmidi_out_free(o);

        ptr = IntPtr.Zero;
        o   = IntPtr.Zero;
    }
Пример #3
0
        public static void Shutdown()
        {
            if (!_initialized)
            {
                return;
            }

            for (int i = 0; i < devices.Length; i++)
            {
                MidiInternal.rtmidi_close_port(devices[i]);
                MidiInternal.rtmidi_in_free(devices[i]);
                devices[i] = (IntPtr)0;
            }

            _initialized             = false;
            OnNextNote               = null;
            EditorApplication.update = null;
            EditorApplication.playModeStateChanged -= EditorApplicationOnplayModeStateChanged;
        }