@@ -498,6 +498,8 @@ namespace Core {
498498 removedCount = deleteClips ();
499499 break ;
500500 case dspx::SelectionModel::ST_Note:
501+ removedCount = deleteNotes ();
502+ break ;
501503 case dspx::SelectionModel::ST_AnchorNode:
502504 // TODO delete support for additional selection types
503505 break ;
@@ -572,9 +574,6 @@ namespace Core {
572574 }
573575
574576 int DspxDocumentPrivate::deleteClips () {
575- if (!model || !selectionModel || !model->timeline ())
576- return 0 ;
577-
578577 int removedCount = 0 ;
579578 for (auto *item : selectionModel->clipSelectionModel ()->selectedItems ()) {
580579 if (item->clipSequence ()->removeItem (item)) {
@@ -585,6 +584,17 @@ namespace Core {
585584 return removedCount;
586585 }
587586
587+ int DspxDocumentPrivate::deleteNotes () {
588+ int removedCount = 0 ;
589+ for (auto *item : selectionModel->noteSelectionModel ()->selectedItems ()) {
590+ if (item->noteSequence ()->removeItem (item)) {
591+ model->destroyItem (item);
592+ ++removedCount;
593+ }
594+ }
595+ return removedCount;
596+ }
597+
588598 void DspxDocumentPrivate::selectAllTempos () {
589599 for (auto item : model->timeline ()->tempos ()->asRange ()) {
590600 selectionModel->select (item, dspx::SelectionModel::Select);
@@ -611,6 +621,15 @@ namespace Core {
611621 }
612622 }
613623
624+ void DspxDocumentPrivate::selectAllNotes () {
625+ auto noteSequence = selectionModel->noteSelectionModel ()->noteSequenceWithSelectedItems ();
626+ if (!noteSequence)
627+ return ;
628+ for (auto item : noteSequence->asRange ()) {
629+ selectionModel->select (item, dspx::SelectionModel::Select);
630+ }
631+ }
632+
614633 DspxDocument::DspxDocument (QObject *parent) : QObject(parent), d_ptr(new DspxDocumentPrivate) {
615634 Q_D (DspxDocument);
616635 d->q_ptr = this ;
@@ -809,6 +828,8 @@ namespace Core {
809828 d->selectAllClips ();
810829 break ;
811830 case dspx::SelectionModel::ST_Note:
831+ d->selectAllNotes ();
832+ break ;
812833 case dspx::SelectionModel::ST_AnchorNode:
813834 // TODO select all support for additional selection types
814835 break ;
0 commit comments