# HG changeset patch # User Chris Cannam # Date 1235497981 0 # Node ID fdbb3971bafc62beaebd2bd379ebbbc7f5b4e175 # Parent 5d691489a84fa41c84f546a97461a778fe373506 * more rudiments of midi->instants diff -r 5d691489a84f -r fdbb3971bafc main/MainWindow.cpp --- a/main/MainWindow.cpp Tue Feb 24 17:25:55 2009 +0000 +++ b/main/MainWindow.cpp Tue Feb 24 17:53:01 2009 +0000 @@ -62,6 +62,7 @@ #include "data/fileio/BZipFileDevice.h" #include "data/fileio/FileSource.h" #include "data/fft/FFTDataServer.h" +#include "data/midi/MIDIInput.h" #include "base/RecentFiles.h" #include "transform/TransformFactory.h" #include "transform/ModelTransformerFactory.h" @@ -282,6 +283,9 @@ newSession(); m_activityLog->show(); + + connect(m_midiInput, SIGNAL(eventsAvailable()), + this, SLOT(midiEventsAvailable())); TransformFactory::getInstance()->startPopulationThread(); } @@ -3400,6 +3404,18 @@ } void +MainWindow::midiEventsAvailable() +{ + //!!! for now. but this won't do -- we are passing a signal/slot + //!!! connection across threads here, so timing will not be good + //!!! -- we do need to use the original midi event timestamp + MIDIEvent ev(m_midiInput->readEvent()); + if (ev.getMessageType() == MIDIConstants::MIDI_NOTE_ON) { + insertInstant(); + } +} + +void MainWindow::layerRemoved(Layer *layer) { setupExistingLayersMenus(); diff -r 5d691489a84f -r fdbb3971bafc main/MainWindow.h --- a/main/MainWindow.h Tue Feb 24 17:25:55 2009 +0000 +++ b/main/MainWindow.h Tue Feb 24 17:53:01 2009 +0000 @@ -165,6 +165,7 @@ virtual void mouseLeftWidget(); virtual void handleOSCMessage(const OSCMessage &); + virtual void midiEventsAvailable(); virtual void website(); virtual void help();