예제 #1
0
        public void Dispose()
        {
            if (this.inputDevice != null)
            {
                this.inputDevice.StopListening();
                //this.inputDevice.Dispose();
                this.inputDevice = null;
            }

            if (this.sanfordOutputDevice != null)
            {
                //this.sanfordOutputDevice.Dispose();
                this.sanfordOutputDevice = null;
            }
        }
예제 #2
0
        public MainWindow()
        {
            InitializeComponent();

            try
            {
                this.sanfordOutputDevice = new MidiWrapper.OSCMidiOutputDevice(); //new Sanford.Multimedia.Midi.OutputDevice(2);

                var count = Sanford.Multimedia.Midi.InputDevice.DeviceCount;

                inputDevice = new MidiWrapper.OSCMidiInputDevice(); ///new Sanford.Multimedia.Midi.InputDevice(0);
                inputDevice.StartListening();
                inputDevice.ChannelMessageReceived += InputDevice_ChannelMessageReceived;
                //inputDevice.SysExMessageReceived += InputDevice_SysExMessageReceived;
                //inputDevice.ShortMessageReceived += InputDevice_ShortMessageReceived;
            }
            catch (Exception ex)
            {
                Console.Write(ex);
            }

            this.oscSender.Connect();
        }