Fix MIDI export (#3733)

* Re-enable MIDI export

* Fix logic for processing BB tracks and BB notes

* Consider master pitch and base note in MIDI export.

* Cut BB notes at the end of BB pattern.
This commit is contained in:
Hyunjin Song
2017-09-14 08:09:54 +09:00
committed by GitHub
parent f26a02da04
commit c0682c94a4
8 changed files with 278 additions and 71 deletions

View File

@@ -1444,14 +1444,15 @@ void Song::exportProjectMidi()
// instantiate midi export plugin
TrackContainer::TrackList tracks;
tracks += Engine::getSong()->tracks();
tracks += Engine::getBBTrackContainer()->tracks();
TrackContainer::TrackList tracks_BB;
tracks = Engine::getSong()->tracks();
tracks_BB = Engine::getBBTrackContainer()->tracks();
ExportFilter *exf = dynamic_cast<ExportFilter *> (Plugin::instantiate("midiexport", NULL, NULL));
if (exf==NULL) {
qDebug() << "failed to load midi export filter!";
return;
}
exf->tryExport(tracks, Engine::getSong()->getTempo(), export_filename);
exf->tryExport(tracks, tracks_BB, getTempo(), m_masterPitchModel.value(), export_filename);
}
}

View File

@@ -300,12 +300,11 @@ void MainWindow::finalize()
SLOT( exportProjectTracks() ),
Qt::CTRL + Qt::SHIFT + Qt::Key_E );
// temporarily disabled broken MIDI export
/*project_menu->addAction( embed::getIconPixmap( "midi_file" ),
project_menu->addAction( embed::getIconPixmap( "midi_file" ),
tr( "Export &MIDI..." ),
Engine::getSong(),
SLOT( exportProjectMidi() ),
Qt::CTRL + Qt::Key_M );*/
Qt::CTRL + Qt::Key_M );
// Prevent dangling separator at end of menu per https://bugreports.qt.io/browse/QTBUG-40071
#if !(defined(LMMS_BUILD_APPLE) && (QT_VERSION >= 0x050000) && (QT_VERSION < 0x050600))