comparison main/MainWindow.cpp @ 304:fdbb3971bafc

* more rudiments of midi->instants
author Chris Cannam
date Tue, 24 Feb 2009 17:53:01 +0000
parents 5d691489a84f
children f76efdd7d180
comparison
equal deleted inserted replaced
303:5d691489a84f 304:fdbb3971bafc
60 #include "data/fileio/CSVFileWriter.h" 60 #include "data/fileio/CSVFileWriter.h"
61 #include "data/fileio/MIDIFileWriter.h" 61 #include "data/fileio/MIDIFileWriter.h"
62 #include "data/fileio/BZipFileDevice.h" 62 #include "data/fileio/BZipFileDevice.h"
63 #include "data/fileio/FileSource.h" 63 #include "data/fileio/FileSource.h"
64 #include "data/fft/FFTDataServer.h" 64 #include "data/fft/FFTDataServer.h"
65 #include "data/midi/MIDIInput.h"
65 #include "base/RecentFiles.h" 66 #include "base/RecentFiles.h"
66 #include "transform/TransformFactory.h" 67 #include "transform/TransformFactory.h"
67 #include "transform/ModelTransformerFactory.h" 68 #include "transform/ModelTransformerFactory.h"
68 #include "base/PlayParameterRepository.h" 69 #include "base/PlayParameterRepository.h"
69 #include "base/XmlExportable.h" 70 #include "base/XmlExportable.h"
280 connect(this, SIGNAL(replacedDocument()), this, SLOT(documentReplaced())); 281 connect(this, SIGNAL(replacedDocument()), this, SLOT(documentReplaced()));
281 282
282 newSession(); 283 newSession();
283 284
284 m_activityLog->show(); 285 m_activityLog->show();
286
287 connect(m_midiInput, SIGNAL(eventsAvailable()),
288 this, SLOT(midiEventsAvailable()));
285 289
286 TransformFactory::getInstance()->startPopulationThread(); 290 TransformFactory::getInstance()->startPopulationThread();
287 } 291 }
288 292
289 MainWindow::~MainWindow() 293 MainWindow::~MainWindow()
3396 QMessageBox::information 3400 QMessageBox::information
3397 (this, tr("Audio processing overload"), 3401 (this, tr("Audio processing overload"),
3398 tr("<b>Overloaded</b><p>Audio playback speed processing has been reduced to a single channel, due to a processing overload.")); 3402 tr("<b>Overloaded</b><p>Audio playback speed processing has been reduced to a single channel, due to a processing overload."));
3399 shownOnce = true; 3403 shownOnce = true;
3400 } 3404 }
3405
3406 void
3407 MainWindow::midiEventsAvailable()
3408 {
3409 //!!! for now. but this won't do -- we are passing a signal/slot
3410 //!!! connection across threads here, so timing will not be good
3411 //!!! -- we do need to use the original midi event timestamp
3412 MIDIEvent ev(m_midiInput->readEvent());
3413 if (ev.getMessageType() == MIDIConstants::MIDI_NOTE_ON) {
3414 insertInstant();
3415 }
3416 }
3401 3417
3402 void 3418 void
3403 MainWindow::layerRemoved(Layer *layer) 3419 MainWindow::layerRemoved(Layer *layer)
3404 { 3420 {
3405 setupExistingLayersMenus(); 3421 setupExistingLayersMenus();