Merge branch 'stable-1.2' into fix/qt5-vst
# Conflicts: # plugins/vst_base/RemoteVstPlugin.cpp
This commit is contained in:
@@ -252,17 +252,8 @@ void NotePlayHandle::play( sampleFrame * _working_buffer )
|
||||
if( m_released && (!instrumentTrack()->isSustainPedalPressed() ||
|
||||
m_releaseStarted) )
|
||||
{
|
||||
if (m_releaseStarted == false)
|
||||
{
|
||||
m_releaseStarted = true;
|
||||
|
||||
if( m_origin == OriginMidiInput )
|
||||
{
|
||||
setLength( MidiTime( static_cast<f_cnt_t>( totalFramesPlayed() / Engine::framesPerTick() ) ) );
|
||||
m_instrumentTrack->midiNoteOff( *this );
|
||||
}
|
||||
|
||||
m_releaseStarted = true;
|
||||
}
|
||||
f_cnt_t todo = framesThisPeriod;
|
||||
|
||||
// if this note is base-note for arpeggio, always set
|
||||
@@ -389,6 +380,16 @@ void NotePlayHandle::noteOff( const f_cnt_t _s )
|
||||
MidiTime::fromFrames( _s, Engine::framesPerTick() ),
|
||||
_s );
|
||||
}
|
||||
|
||||
// inform attached components about MIDI finished (used for recording in Piano Roll)
|
||||
if (!instrumentTrack()->isSustainPedalPressed())
|
||||
{
|
||||
if( m_origin == OriginMidiInput )
|
||||
{
|
||||
setLength( MidiTime( static_cast<f_cnt_t>( totalFramesPlayed() / Engine::framesPerTick() ) ) );
|
||||
m_instrumentTrack->midiNoteOff( *this );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -495,6 +495,12 @@ bool RemotePlugin::processMessage( const message & _m )
|
||||
resizeSharedProcessingMemory();
|
||||
break;
|
||||
|
||||
case IdChangeInputOutputCount:
|
||||
m_inputCount = _m.getInt( 0 );
|
||||
m_outputCount = _m.getInt( 1 );
|
||||
resizeSharedProcessingMemory();
|
||||
break;
|
||||
|
||||
case IdDebugMessage:
|
||||
fprintf( stderr, "RemotePlugin::DebugMessage: %s",
|
||||
_m.getString( 0 ).c_str() );
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "SongEditor.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QtGlobal>
|
||||
#include <QMessageBox>
|
||||
#include <QSplashScreen>
|
||||
|
||||
@@ -53,6 +54,11 @@ GuiApplication* GuiApplication::instance()
|
||||
|
||||
GuiApplication::GuiApplication()
|
||||
{
|
||||
// enable HiDPI scaling before showing anything (Qt 5.6+ only)
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
|
||||
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
|
||||
#endif
|
||||
|
||||
// prompt the user to create the LMMS working directory (e.g. ~/lmms) if it doesn't exist
|
||||
if ( !ConfigManager::inst()->hasWorkingDir() &&
|
||||
QMessageBox::question( NULL,
|
||||
|
||||
@@ -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))
|
||||
@@ -1541,7 +1540,9 @@ void MainWindow::autoSave()
|
||||
"enablerunningautosave" ).toInt() ||
|
||||
! Engine::getSong()->isPlaying() ) )
|
||||
{
|
||||
Engine::getSong()->saveProjectFile(ConfigManager::inst()->recoveryFile());
|
||||
AutoSaveThread * ast = new AutoSaveThread();
|
||||
connect( ast, SIGNAL( finished() ), ast, SLOT( deleteLater() ) );
|
||||
ast->start();
|
||||
autoSaveTimerReset(); // Reset timer
|
||||
}
|
||||
else
|
||||
@@ -1553,3 +1554,11 @@ void MainWindow::autoSave()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void AutoSaveThread::run()
|
||||
{
|
||||
Engine::getSong()->saveProjectFile(ConfigManager::inst()->recoveryFile());
|
||||
}
|
||||
|
||||
@@ -237,6 +237,11 @@ MidiEvent InstrumentTrack::applyMasterKey( const MidiEvent& event )
|
||||
|
||||
void InstrumentTrack::processInEvent( const MidiEvent& event, const MidiTime& time, f_cnt_t offset )
|
||||
{
|
||||
if( Engine::getSong()->isExporting() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
bool eventHandled = false;
|
||||
|
||||
switch( event.type() )
|
||||
@@ -273,6 +278,12 @@ void InstrumentTrack::processInEvent( const MidiEvent& event, const MidiTime& ti
|
||||
// be deleted later automatically)
|
||||
Engine::mixer()->requestChangeInModel();
|
||||
m_notes[event.key()]->noteOff( offset );
|
||||
if (isSustainPedalPressed() &&
|
||||
m_notes[event.key()]->origin() ==
|
||||
m_notes[event.key()]->OriginMidiInput)
|
||||
{
|
||||
m_sustainedNotes << m_notes[event.key()];
|
||||
}
|
||||
m_notes[event.key()] = NULL;
|
||||
Engine::mixer()->doneChangeInModel();
|
||||
}
|
||||
@@ -302,8 +313,24 @@ void InstrumentTrack::processInEvent( const MidiEvent& event, const MidiTime& ti
|
||||
{
|
||||
m_sustainPedalPressed = true;
|
||||
}
|
||||
else
|
||||
else if (isSustainPedalPressed())
|
||||
{
|
||||
for (NotePlayHandle* nph : m_sustainedNotes)
|
||||
{
|
||||
if (nph && nph->isReleased())
|
||||
{
|
||||
if( nph->origin() ==
|
||||
nph->OriginMidiInput)
|
||||
{
|
||||
nph->setLength(
|
||||
MidiTime( static_cast<f_cnt_t>(
|
||||
nph->totalFramesPlayed() /
|
||||
Engine::framesPerTick() ) ) );
|
||||
midiNoteOff( *nph );
|
||||
}
|
||||
}
|
||||
}
|
||||
m_sustainedNotes.clear();
|
||||
m_sustainPedalPressed = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user