comparison src/MainWindow.cpp @ 327:b3ed6e562ee5

sorting out note and pitch track key shortcuts
author matthiasm
date Fri, 13 Jun 2014 14:22:26 +0100
parents 68779eb910c7
children d4c70bef4c25
comparison
equal deleted inserted replaced
320:68779eb910c7 327:b3ed6e562ee5
668 connect(this, SIGNAL(canClearSelection(bool)), m_showCandidatesAction, SLOT(setEnabled(bool))); 668 connect(this, SIGNAL(canClearSelection(bool)), m_showCandidatesAction, SLOT(setEnabled(bool)));
669 menu->addAction(m_showCandidatesAction); 669 menu->addAction(m_showCandidatesAction);
670 m_rightButtonMenu->addAction(m_showCandidatesAction); 670 m_rightButtonMenu->addAction(m_showCandidatesAction);
671 671
672 action = new QAction(tr("Remove Pitches"), this); 672 action = new QAction(tr("Remove Pitches"), this);
673 action->setShortcut(tr("Backspace")); 673 action->setShortcut(tr("Ctrl+Backspace"));
674 action->setStatusTip(tr("Remove all pitch estimates within the selected region, making it unvoiced")); 674 action->setStatusTip(tr("Remove all pitch estimates within the selected region, making it unvoiced"));
675 m_keyReference->registerShortcut(action); 675 m_keyReference->registerShortcut(action);
676 connect(action, SIGNAL(triggered()), this, SLOT(clearPitches())); 676 connect(action, SIGNAL(triggered()), this, SLOT(clearPitches()));
677 connect(this, SIGNAL(canClearSelection(bool)), action, SLOT(setEnabled(bool))); 677 connect(this, SIGNAL(canClearSelection(bool)), action, SLOT(setEnabled(bool)));
678 menu->addAction(action); 678 menu->addAction(action);
679 m_rightButtonMenu->addAction(action); 679 m_rightButtonMenu->addAction(action);
680 680
681 menu->addSeparator(); 681 menu->addSeparator();
682 m_rightButtonMenu->addSeparator(); 682 m_rightButtonMenu->addSeparator();
683 683
684 m_keyReference->setCategory(tr("Note Track"));
685
684 action = new QAction(tr("Split Note"), this); 686 action = new QAction(tr("Split Note"), this);
685 action->setShortcut(tr("Ctrl+/")); 687 action->setShortcut(tr("/"));
686 action->setStatusTip(tr("Split the note at the current playback position into two")); 688 action->setStatusTip(tr("Split the note at the current playback position into two"));
687 m_keyReference->registerShortcut(action); 689 m_keyReference->registerShortcut(action);
688 connect(action, SIGNAL(triggered()), this, SLOT(splitNote())); 690 connect(action, SIGNAL(triggered()), this, SLOT(splitNote()));
689 connect(this, SIGNAL(canExportNotes(bool)), action, SLOT(setEnabled(bool))); 691 connect(this, SIGNAL(canExportNotes(bool)), action, SLOT(setEnabled(bool)));
690 menu->addAction(action); 692 menu->addAction(action);
691 m_rightButtonMenu->addAction(action); 693 m_rightButtonMenu->addAction(action);
692 694
693 action = new QAction(tr("Merge Notes"), this); 695 action = new QAction(tr("Merge Notes"), this);
694 action->setShortcut(tr("Ctrl+\\")); 696 action->setShortcut(tr("\\"));
695 action->setStatusTip(tr("Merge all notes within the selected region into a single note")); 697 action->setStatusTip(tr("Merge all notes within the selected region into a single note"));
696 m_keyReference->registerShortcut(action); 698 m_keyReference->registerShortcut(action);
697 connect(action, SIGNAL(triggered()), this, SLOT(mergeNotes())); 699 connect(action, SIGNAL(triggered()), this, SLOT(mergeNotes()));
698 connect(this, SIGNAL(canSnapNotes(bool)), action, SLOT(setEnabled(bool))); 700 connect(this, SIGNAL(canSnapNotes(bool)), action, SLOT(setEnabled(bool)));
699 menu->addAction(action); 701 menu->addAction(action);
700 m_rightButtonMenu->addAction(action); 702 m_rightButtonMenu->addAction(action);
701 703
702 action = new QAction(tr("Delete Notes"), this); 704 action = new QAction(tr("Delete Notes"), this);
703 action->setShortcut(tr("Ctrl+d")); 705 action->setShortcut(tr("Backspace"));
704 action->setStatusTip(tr("Delete all notes within the selected region=")); 706 action->setStatusTip(tr("Delete all notes within the selected region"));
705 m_keyReference->registerShortcut(action); 707 m_keyReference->registerShortcut(action);
706 connect(action, SIGNAL(triggered()), this, SLOT(deleteNotes())); 708 connect(action, SIGNAL(triggered()), this, SLOT(deleteNotes()));
707 connect(this, SIGNAL(canSnapNotes(bool)), action, SLOT(setEnabled(bool))); 709 connect(this, SIGNAL(canSnapNotes(bool)), action, SLOT(setEnabled(bool)));
708 menu->addAction(action); 710 menu->addAction(action);
709 m_rightButtonMenu->addAction(action); 711 m_rightButtonMenu->addAction(action);
710 712
711 action = new QAction(tr("Form Note from Selection"), this); 713 action = new QAction(tr("Form Note from Selection"), this);
712 action->setShortcut(tr("Ctrl+=")); 714 action->setShortcut(tr("="));
713 action->setStatusTip(tr("Form a note spanning the selected region, splitting any existing notes at its boundaries")); 715 action->setStatusTip(tr("Form a note spanning the selected region, splitting any existing notes at its boundaries"));
714 m_keyReference->registerShortcut(action); 716 m_keyReference->registerShortcut(action);
715 connect(action, SIGNAL(triggered()), this, SLOT(formNoteFromSelection())); 717 connect(action, SIGNAL(triggered()), this, SLOT(formNoteFromSelection()));
716 connect(this, SIGNAL(canSnapNotes(bool)), action, SLOT(setEnabled(bool))); 718 connect(this, SIGNAL(canSnapNotes(bool)), action, SLOT(setEnabled(bool)));
717 menu->addAction(action); 719 menu->addAction(action);
718 m_rightButtonMenu->addAction(action); 720 m_rightButtonMenu->addAction(action);
719 721
720 action = new QAction(tr("Snap Notes to Pitch Track"), this); 722 action = new QAction(tr("Snap Notes to Pitch Track"), this);
721 action->setStatusTip(tr("Set notes within the selected region to the median frequency of their underlying pitches, or remove them if there are no underlying pitches")); 723 action->setStatusTip(tr("Set notes within the selected region to the median frequency of their underlying pitches, or remove them if there are no underlying pitches"));
722 m_keyReference->registerShortcut(action); 724 // m_keyReference->registerShortcut(action);
723 connect(action, SIGNAL(triggered()), this, SLOT(snapNotesToPitches())); 725 connect(action, SIGNAL(triggered()), this, SLOT(snapNotesToPitches()));
724 connect(this, SIGNAL(canSnapNotes(bool)), action, SLOT(setEnabled(bool))); 726 connect(this, SIGNAL(canSnapNotes(bool)), action, SLOT(setEnabled(bool)));
725 menu->addAction(action); 727 menu->addAction(action);
726 m_rightButtonMenu->addAction(action); 728 m_rightButtonMenu->addAction(action);
727 } 729 }