Make instrument window's piano optional

This commit is contained in:
Johannes Lorenz
2019-03-16 20:10:19 +01:00
parent 5ebe0e002d
commit f8ba88d55a
2 changed files with 10 additions and 1 deletions

View File

@@ -63,6 +63,8 @@ public:
// functions that can/should be re-implemented:
// --------------------------------------------------------------------
virtual bool hasNoteInput() const { return true; }
// if the plugin doesn't play each note, it can create an instrument-
// play-handle and re-implement this method, so that it mixes its
// output buffer only once per mixer-period

View File

@@ -1650,6 +1650,8 @@ void InstrumentTrackWindow::updateInstrumentView()
modelChanged(); // Get the instrument window to refresh
m_track->dataChanged(); // Get the text on the trackButton to change
m_pianoView->setVisible(m_track->m_instrument->hasNoteInput());
}
}
@@ -1704,7 +1706,9 @@ void InstrumentTrackWindow::closeEvent( QCloseEvent* event )
void InstrumentTrackWindow::focusInEvent( QFocusEvent* )
{
m_pianoView->setFocus();
if(m_pianoView->isVisible()) {
m_pianoView->setFocus();
}
}
@@ -1836,6 +1840,9 @@ void InstrumentTrackWindow::viewInstrumentInDirection(int d)
// scroll the SongEditor/BB-editor to make sure the new trackview label is visible
bringToFront->trackContainerView()->scrollToTrackView(bringToFront);
// get the instrument window to refresh
modelChanged();
}
bringToFront->getInstrumentTrackWindow()->setFocus();
}