Merge branch 'master' of https://github.com/LMMS/lmms into StCyr_ArtworkTabs

This commit is contained in:
Cyrille Bollu
2016-05-12 15:34:35 +02:00
145 changed files with 505 additions and 285 deletions

View File

@@ -3890,6 +3890,36 @@ int PianoRoll::quantization() const
}
void PianoRoll::quantizeNotes()
{
NoteVector notes = getSelectedNotes();
if (notes.empty())
{
for (Note* n : m_pattern->notes())
{
notes.push_back(n);
}
}
for (Note* n : notes)
{
if (n->length() == MidiTime(0))
{
continue;
}
Note copy(*n);
m_pattern->removeNote(n);
copy.quantizePos(quantization());
m_pattern->addNote(copy);
}
update();
gui->songEditor()->update();
}
void PianoRoll::updateSemiToneMarkerMenu()
@@ -4047,10 +4077,15 @@ PianoRollWindow::PianoRollWindow() :
connect(editModeGroup, SIGNAL(triggered(int)), m_editor, SLOT(setEditMode(int)));
QAction* quantizeAction = new QAction(embed::getIconPixmap("quantize"), tr("Quantize"), this);
connect(quantizeAction, SIGNAL(triggered()), m_editor, SLOT(quantizeNotes()));
notesActionsToolBar->addAction( drawAction );
notesActionsToolBar->addAction( eraseAction );
notesActionsToolBar->addAction( selectAction );
notesActionsToolBar->addAction( detuneAction );
notesActionsToolBar->addSeparator();
notesActionsToolBar->addAction( quantizeAction );
// Copy + paste actions
DropToolBar *copyPasteActionsToolBar = addDropToolBarToTop(tr("Copy paste controls"));