예제 #1
0
        private void CleanUp()
        {
            // <SnippetCleanUp>
            inputDeviceWatcher.StopWatcher();
            inputDeviceWatcher = null;

            outputDeviceWatcher.StopWatcher();
            outputDeviceWatcher = null;

            midiInPort.MessageReceived -= MidiInPort_MessageReceived;
            midiInPort.Dispose();
            midiInPort = null;

            midiOutPort.Dispose();
            midiOutPort = null;
            // </SnippetCleanUp>
        }
예제 #2
0
        // </SnippetEnumerateMidiOutputDevices>



        private void startButton_Click(object sender, RoutedEventArgs e)
        {
            //EnumerateMidiInputDevices();
            //EnumerateMidiOutputDevices();


            // <SnippetStartWatchers>
            inputDeviceWatcher =
                new MyMidiDeviceWatcher(MidiInPort.GetDeviceSelector(), midiInPortListBox, Dispatcher);

            inputDeviceWatcher.StartWatcher();

            outputDeviceWatcher =
                new MyMidiDeviceWatcher(MidiOutPort.GetDeviceSelector(), midiOutPortListBox, Dispatcher);

            outputDeviceWatcher.StartWatcher();
            // </SnippetStartWatchers>
        }