fix note preview stuff on pattern editor

master
Zithia Satazaki 2022-03-29 14:06:12 -04:00
parent e845325178
commit e6fa6d33fa
3 changed files with 6 additions and 3 deletions

6
notes
View File

@ -40,9 +40,11 @@ TODO {
maybe scroll sensitivity
}
revert-to-saved menu action
- fix space on note or port column (previewing) generating an undo action
- make space preview on port column
fix strut not working except to overwrite another param
- distortion effect
revert-to-saved menu action
automation node {
listens for one specific param

View File

@ -198,6 +198,7 @@ bool PatternEditorItemDelegate::editorEvent(QEvent *event, QAbstractItemModel *m
dc->cancel();
SelectionBounds s(sel);
if (s.x1 == s.x2 && s.x1 % PatternEditorModel::colsPerChannel <= 1) return false; // just previewing the note column
auto* cc = (new CompositeCommand())->reserve((1 + s.y2 - s.y1) * (1 + s.ch2 - s.ch1));
for (int c = s.ch1; c <= s.ch2; c++) {

View File

@ -307,7 +307,7 @@ void PatternEditorView::startPreview(int key) {
auto ind = currentIndex();
int cc = ind.column() % PatternEditorModel::colsPerChannel;
int ch = (ind.column() - cc) / PatternEditorModel::colsPerChannel;
if (cc == 1) { // note column
if (cc == 1 || (cc == 0 && key == Qt::Key_Space)) { // note column or space on port
stopPreview(key); // end current preview first, if applicable
auto& r = mdl->getPattern()->rowAt(ch, ind.row()-1);
auto p = mdl->getPattern()->project->shared_from_this();