📄 notationview.cpp
字号:
new KAction (i18n("Insert Rest"), Key_P, this, SLOT(slotInsertRest()), actionCollection(), QString("insert_rest")); new KAction (i18n("Switch from Note to Rest"), Key_T, this, SLOT(slotSwitchFromNoteToRest()), actionCollection(), QString("switch_from_note_to_rest")); new KAction (i18n("Switch from Rest to Note"), Key_Y, this, SLOT(slotSwitchFromRestToNote()), actionCollection(), QString("switch_from_rest_to_note")); // setup Notes menu & toolbar QIconSet icon; for (NoteActionDataMap::Iterator actionDataIter = m_noteActionDataMap->begin(); actionDataIter != m_noteActionDataMap->end(); ++actionDataIter) { NoteActionData noteActionData = **actionDataIter; icon = QIconSet (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap (noteActionData.pixmapName))); noteAction = new KRadioAction(noteActionData.title, icon, noteActionData.keycode, this, SLOT(slotNoteAction()), actionCollection(), noteActionData.actionName); noteAction->setExclusiveGroup("notes"); if (noteActionData.noteType == Note::Crotchet && noteActionData.dots == 0 && !noteActionData.rest) { m_selectDefaultNote = noteAction; } } // Note duration change actions for (NoteChangeActionDataMap::Iterator actionDataIter = m_noteChangeActionDataMap->begin(); actionDataIter != m_noteChangeActionDataMap->end(); ++actionDataIter) { NoteChangeActionData data = **actionDataIter; icon = QIconSet (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap (data.pixmapName))); KAction *action = new KAction(data.title, icon, data.keycode, this, SLOT(slotNoteChangeAction()), actionCollection(), data.actionName); } // // Accidentals // static QString actionsAccidental[][4] = { { i18n("No accidental"), "1slotNoAccidental()", "no_accidental", "accidental-none" }, { i18n("Follow previous accidental"), "1slotFollowAccidental()", "follow_accidental", "accidental-follow" }, { i18n("Sharp"), "1slotSharp()", "sharp_accidental", "accidental-sharp" }, { i18n("Flat"), "1slotFlat()", "flat_accidental", "accidental-flat" }, { i18n("Natural"), "1slotNatural()", "natural_accidental", "accidental-natural" }, { i18n("Double sharp"), "1slotDoubleSharp()", "double_sharp_accidental", "accidental-doublesharp" }, { i18n("Double flat"), "1slotDoubleFlat()", "double_flat_accidental", "accidental-doubleflat" } }; for (unsigned int i = 0; i < sizeof(actionsAccidental) / sizeof(actionsAccidental[0]); ++i) { icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap (actionsAccidental[i][3]))); noteAction = new KRadioAction(actionsAccidental[i][0], icon, 0, this, actionsAccidental[i][1], actionCollection(), actionsAccidental[i][2]); noteAction->setExclusiveGroup("accidentals"); } // // Clefs // // Treble icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap("clef-treble"))); noteAction = new KRadioAction(i18n("&Treble Clef"), icon, 0, this, SLOT(slotTrebleClef()), actionCollection(), "treble_clef"); noteAction->setExclusiveGroup("notes"); // Alto icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap("clef-alto"))); noteAction = new KRadioAction(i18n("&Alto Clef"), icon, 0, this, SLOT(slotAltoClef()), actionCollection(), "alto_clef"); noteAction->setExclusiveGroup("notes"); // Tenor icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap("clef-tenor"))); noteAction = new KRadioAction(i18n("Te&nor Clef"), icon, 0, this, SLOT(slotTenorClef()), actionCollection(), "tenor_clef"); noteAction->setExclusiveGroup("notes"); // Bass icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap("clef-bass"))); noteAction = new KRadioAction(i18n("&Bass Clef"), icon, 0, this, SLOT(slotBassClef()), actionCollection(), "bass_clef"); noteAction->setExclusiveGroup("notes"); icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap("text"))); noteAction = new KRadioAction(i18n("&Text"), icon, Key_F8, this, SLOT(slotText()), actionCollection(), "text"); noteAction->setExclusiveGroup("notes"); icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap("guitarchord"))); noteAction = new KRadioAction(i18n("&Guitar Chord"), icon, Key_F9, this, SLOT(slotGuitarChord()), actionCollection(), "guitarchord"); noteAction->setExclusiveGroup("notes"); /* icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap("lilypond"))); noteAction = new KRadioAction(i18n("Lil&ypond Directive"), icon, Key_F9, this, SLOT(slotLilypondDirective()), actionCollection(), "lilypond_directive"); noteAction->setExclusiveGroup("notes"); */ // // Edition tools (eraser, selector...) // noteAction = new KRadioAction(i18n("&Erase"), "eraser", Key_F4, this, SLOT(slotEraseSelected()), actionCollection(), "erase"); noteAction->setExclusiveGroup("notes"); icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap("select"))); noteAction = new KRadioAction(i18n("&Select and Edit"), icon, Key_F2, this, SLOT(slotSelectSelected()), actionCollection(), "select"); noteAction->setExclusiveGroup("notes"); icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap("step_by_step"))); new KToggleAction(i18n("Ste&p Recording"), icon, 0, this, SLOT(slotToggleStepByStep()), actionCollection(), "toggle_step_by_step"); // Edit menu new KAction(i18n("Select from Sta&rt"), 0, this, SLOT(slotEditSelectFromStart()), actionCollection(), "select_from_start"); new KAction(i18n("Select to &End"), 0, this, SLOT(slotEditSelectToEnd()), actionCollection(), "select_to_end"); new KAction(i18n("Select Whole St&aff"), Key_A + CTRL, this, SLOT(slotEditSelectWholeStaff()), actionCollection(), "select_whole_staff"); new KAction(i18n("C&ut and Close"), CTRL + SHIFT + Key_X, this, SLOT(slotEditCutAndClose()), actionCollection(), "cut_and_close"); new KAction(i18n("Pa&ste..."), CTRL + SHIFT + Key_V, this, SLOT(slotEditGeneralPaste()), actionCollection(), "general_paste"); new KAction(i18n("De&lete"), Key_Delete, this, SLOT(slotEditDelete()), actionCollection(), "delete"); // // Settings menu // int layoutMode = m_config->readNumEntry("layoutmode", 0); QString pixmapDir = KGlobal::dirs()->findResource("appdata", "pixmaps/"); QCanvasPixmap pixmap(pixmapDir + "/toolbar/linear-layout.xpm"); icon = QIconSet(pixmap); KRadioAction *linearModeAction = new KRadioAction (i18n("&Linear Layout"), icon, 0, this, SLOT(slotLinearMode()), actionCollection(), "linear_mode"); linearModeAction->setExclusiveGroup("layoutMode"); if (layoutMode == 0) linearModeAction->setChecked(true); pixmap.load(pixmapDir + "/toolbar/continuous-page-mode.xpm"); icon = QIconSet(pixmap); KRadioAction *continuousPageModeAction = new KRadioAction (i18n("&Continuous Page Layout"), icon, 0, this, SLOT(slotContinuousPageMode()), actionCollection(), "continuous_page_mode"); continuousPageModeAction->setExclusiveGroup("layoutMode"); if (layoutMode == 1) continuousPageModeAction->setChecked(true); pixmap.load(pixmapDir + "/toolbar/multi-page-mode.xpm"); icon = QIconSet(pixmap); KRadioAction *multiPageModeAction = new KRadioAction (i18n("&Multiple Page Layout"), icon, 0, this, SLOT(slotMultiPageMode()), actionCollection(), "multi_page_mode"); multiPageModeAction->setExclusiveGroup("layoutMode"); if (layoutMode == 2) multiPageModeAction->setChecked(true); new KToggleAction(i18n("Show Ch&ord Name Ruler"), 0, this, SLOT(slotToggleChordsRuler()), actionCollection(), "show_chords_ruler"); new KToggleAction(i18n("Show Ra&w Note Ruler"), 0, this, SLOT(slotToggleRawNoteRuler()), actionCollection(), "show_raw_note_ruler"); new KToggleAction(i18n("Show &Tempo Ruler"), 0, this, SLOT(slotToggleTempoRuler()), actionCollection(), "show_tempo_ruler"); new KToggleAction(i18n("Show &Annotations"), 0, this, SLOT(slotToggleAnnotations()), actionCollection(), "show_annotations"); new KToggleAction(i18n("Show Lily&Pond Directives"), 0, this, SLOT(slotToggleLilyPondDirectives()), actionCollection(), "show_lilypond_directives"); new KAction(i18n("Open L&yric Editor"), 0, this, SLOT(slotEditLyrics()), actionCollection(), "lyric_editor"); // // Group menu // icon = QIconSet (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap ("group-beam"))); new KAction(BeamCommand::getGlobalName(), icon, Key_B + CTRL, this, SLOT(slotGroupBeam()), actionCollection(), "beam"); new KAction(AutoBeamCommand::getGlobalName(), 0, this, SLOT(slotGroupAutoBeam()), actionCollection(), "auto_beam"); icon = QIconSet (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap ("group-unbeam"))); new KAction(BreakCommand::getGlobalName(), icon, Key_U + CTRL, this, SLOT(slotGroupBreak()), actionCollection(), "break_group"); icon = QIconSet (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap ("group-simple-tuplet"))); new KAction(TupletCommand::getGlobalName(true), icon, Key_R + CTRL, this, SLOT(slotGroupSimpleTuplet()), actionCollection(), "simple_tuplet"); icon = QIconSet (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap ("group-tuplet"))); new KAction(TupletCommand::getGlobalName(false), icon, Key_T + CTRL, this, SLOT(slotGroupGeneralTuplet()), actionCollection(), "tuplet"); new KAction(UnTupletCommand::getGlobalName(), 0, this, SLOT(slotGroupUnTuplet()), actionCollection(), "break_tuplets"); icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap("triplet"))); (new KToggleAction(i18n("Trip&let Insert Mode"), icon, Key_G, this, SLOT(slotUpdateInsertModeStatus()), actionCollection(), "triplet_mode"))-> setChecked(false); icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap("chord"))); (new KToggleAction(i18n("C&hord Insert Mode"), icon, Key_H, this, SLOT(slotUpdateInsertModeStatus()), actionCollection(), "chord_mode"))-> setChecked(false); icon = QIconSet (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap ("group-grace"))); new KAction(GraceCommand::getGlobalName(), icon, 0, this, SLOT(slotGroupGrace()), actionCollection(), "grace"); new KAction(UnGraceCommand::getGlobalName(), 0, this, SLOT(slotGroupUnGrace()), actionCollection(), "ungrace"); icon = QIconSet (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap ("group-slur"))); new KAction(AddIndicationCommand::getGlobalName (Indication::Slur), icon, Key_ParenRight, this, SLOT(slotGroupSlur()), actionCollection(), "slur"); new KAction(AddIndicationCommand::getGlobalName (Indication::PhrasingSlur), 0, Key_ParenRight + CTRL, this, SLOT(slotGroupPhrasingSlur()), actionCollection(), "phrasing_slur"); icon = QIconSet (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap ("group-glissando"))); new KAction(AddIndicationCommand::getGlobalName (Indication::Glissando), icon, 0, this, SLOT(slotGroupGlissando()), actionCollection(), "glissando"); icon = QIconSet (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap ("group-crescendo"))); new KAction(AddIndicationCommand::getGlobalName (Indication::Crescendo), icon, Key_Less, this, SLOT(slotGroupCrescendo()), actionCollection(), "crescendo"); icon = QIconSet (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap ("group-decrescendo"))); new KAction(AddIndicationCommand::getGlobalName (Indication::Decrescendo), icon, Key_Greater, this, SLOT(slotGroupDecrescendo()), actionCollection(), "decrescendo"); new KAction(AddIndicationCommand::getGlobalName (Indication::QuindicesimaUp), 0, 0, this, SLOT(slotGroupOctave2Up()), actionCollection(), "octave_2up"); icon = QIconSet (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap ("group-ottava"))); new KAction(AddIndicationCommand::getGlobalName (Indication::OttavaUp), icon, 0, this, SLOT(slotGroupOctaveUp()), actionCollection(), "octave_up"); new KAction(AddIndicationCommand::getGlobalName (Indication::OttavaDown), 0, 0, this, SLOT(slotGroupOctaveDown()), actionCollection(), "octave_down"); new KAction(AddIndicationCommand::getGlobalName (Indication::QuindicesimaDown), 0, 0, this, SLOT(slotGroupOctave2Down()), actionCollection(), "octave_2down"); icon = QIconSet (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap ("group-chord"))); new KAction(MakeChordCommand::getGlobalName(), icon, 0, this, SLOT(slotGroupMakeChord()), actionCollection(), "make_chord"); // setup Transforms menu new KAction(NormalizeRestsCommand::getGlobalName(), Key_N + CTRL, this, SLOT(slotTransformsNormalizeRests()), actionCollection(), "normalize_rests"); new KAction(CollapseRestsCommand::getGlobalName(), 0, this, SLOT(slotTransformsCollapseRests()), actionCollection(), "collapse_rests_aggressively"); new KAction(CollapseNotesCommand::getGlobalName(), Key_Equal + CTRL,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -