Make instrument window's piano optional

This commit is contained in:
Johannes Lorenz
2019-03-21 20:05:36 +01:00
committed by GitHub
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

@@ -1610,6 +1610,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());
}
}
@@ -1664,7 +1666,9 @@ void InstrumentTrackWindow::closeEvent( QCloseEvent* event )
void InstrumentTrackWindow::focusInEvent( QFocusEvent* )
{
m_pianoView->setFocus();
if(m_pianoView->isVisible()) {
m_pianoView->setFocus();
}
}
@@ -1796,6 +1800,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();
}