📄 notationview.h
字号:
void slotInsertRest(); void slotSwitchFromRestToNote(); void slotSwitchFromNoteToRest(); void slotToggleDot(); void slotAddMark(); void slotMarksAddTextMark(); void slotMarksAddFingeringMark(); void slotMarksAddFingeringMarkFromAction(); void slotMarksRemoveMarks(); void slotMarksRemoveFingeringMarks(); void slotMakeOrnament(); void slotUseOrnament(); void slotRemoveOrnament(); void slotNoteChangeAction(); void slotSetNoteDurations(Note::Type, bool notationOnly); void slotAddDot(); void slotAddDotNotationOnly(); void slotAddSlashes(); void slotEditAddClef(); void slotEditAddKeySignature(); void slotEditAddSustainDown(); void slotEditAddSustainUp(); void slotEditAddSustain(bool down); void slotEditTranspose(); void slotEditElement(NotationStaff *, NotationElement *, bool advanced); void slotFinePositionLeft(); void slotFinePositionRight(); void slotFinePositionUp(); void slotFinePositionDown(); void slotFinePositionRestore(); void slotMakeVisible(); void slotMakeInvisible(); void slotDebugDump(); /// Canvas actions slots /** * Called when a mouse press occurred on a notation element * or somewhere on a staff */ void slotItemPressed(int height, int staffNo, QMouseEvent*, NotationElement*); /** * Called when a mouse press occurred on a non-notation element */ void slotNonNotationItemPressed(QMouseEvent *e, QCanvasItem *i); /** * Called when a mouse press occurred on a QCanvasText */ void slotTextItemPressed(QMouseEvent *e, QCanvasItem *i); void slotMouseMoved(QMouseEvent*); void slotMouseReleased(QMouseEvent*); /** * Called when the mouse cursor moves over a different height on * the staff * * @see NotationCanvasView#hoveredOverNoteChange() */ void slotHoveredOverNoteChanged(const QString&); /** * Called when the mouse cursor moves over a note which is at a * different time on the staff * * @see NotationCanvasView#hoveredOverAbsoluteTimeChange() */ void slotHoveredOverAbsoluteTimeChanged(unsigned int); /** * Set the time pointer position during playback (purely visual, * doesn't affect playback). This is also at liberty to highlight * some notes, if it so desires... */ void slotSetPointerPosition(timeT position); /** * As above, but with the ability to specify whether to scroll or * not to follow the pointer (above method uses the play tracking * setting to determine that) */ void slotSetPointerPosition(timeT position, bool scroll); /** * Update the recording segment if it's one of the ones in the * view */ void slotUpdateRecordingSegment(Segment *recordingSegment, timeT updatedFrom); /// Set the current staff to the one containing the given canvas Y coord void slotSetCurrentStaff(double canvasX, int canvasY); /// Set the current staff to that with the given id void slotSetCurrentStaff(int staffNo); /** * Set the insert cursor position (from the top LoopRuler). * If the segment has recently been changed and no refresh has * occurred since, pass updateNow false; then the move will * happen on the next update. */ void slotSetInsertCursorPosition(timeT position, bool scroll, bool updateNow); virtual void slotSetInsertCursorPosition(timeT position) { slotSetInsertCursorPosition(position, true, true); } /// Set the insert cursor position from a mouse event location void slotSetInsertCursorPosition(double canvasX, int canvasY, bool scroll, bool updateNow); void slotSetInsertCursorPosition(double canvasX, int canvasY) { slotSetInsertCursorPosition(canvasX, canvasY, true, true); } /** * Set the insert cursor position and scroll so it's at given point. * If the segment has recently been changed and no refresh has * occurred since, pass updateNow false; then the move will * happen on the next update. */ void slotSetInsertCursorAndRecentre(timeT position, double cx, int cy, bool updateNow = true); void slotSetInsertCursorAndRecentre(timeT position, double cx, double cy) { slotSetInsertCursorAndRecentre(position, cx, static_cast<int>(cy), true); } /// Set insert cursor to playback pointer position void slotJumpCursorToPlayback(); /// Set playback pointer to insert cursor position (affects playback) void slotJumpPlaybackToCursor(); /// Toggle tracking with the position pointer during playback void slotToggleTracking(); /// Change the current staff to the one preceding the current one void slotCurrentStaffUp(); /// Change the current staff to the one following the current one void slotCurrentStaffDown(); /// Change the current segment to the one following the current one void slotCurrentSegmentPrior(); /// Change the current segment to the one preceding the current one void slotCurrentSegmentNext(); /// Changes the font of the staffs on the view, gets font name from sender void slotChangeFontFromAction(); /// Changes the font of the staffs on the view void slotChangeFont(std::string newFont); /// Changes the font and font size of the staffs on the view void slotChangeFont(std::string newFont, int newSize); /// Changes the font of the staffs on the view void slotChangeFont(const QString &newFont); /// Changes the font size of the staffs on the view void slotChangeFontSize(int newSize); /// Changes the font size of the staffs on the view, gets size from sender void slotChangeFontSizeFromAction(); /// Changes the font size of the staffs on the view to the nth size in the available size list void slotChangeFontSizeFromStringValue(const QString&); /// Changes to the next font size up void slotZoomIn(); /// Changes to the next font size down void slotZoomOut(); /// Changes the hlayout spacing of the staffs on the view void slotChangeSpacing(int newSpacing); /// Changes the hlayout spacing of the staffs on the view void slotChangeSpacingFromStringValue(const QString&); /// Changes the hlayout spacing of the staffs on the view void slotChangeSpacingFromAction(); /// Changes the hlayout proportion of the staffs on the view void slotChangeProportion(int newProportion); /// Changes the hlayout proportion of the staffs on the view void slotChangeProportionFromIndex(int newProportionIndex); /// Changes the hlayout proportion of the staffs on the view void slotChangeProportionFromAction(); /// Note-on received asynchronously -- consider step-by-step editing void slotInsertableNoteOnReceived(int pitch, int velocity); /// Note-off received asynchronously -- consider step-by-step editing void slotInsertableNoteOffReceived(int pitch, int velocity); /// Note-on or note-off received asynchronously -- as above void slotInsertableNoteEventReceived(int pitch, int velocity, bool noteOn); /// A timer set when a note-on event was received has elapsed void slotInsertableTimerElapsed(); /// The given QObject has originated a step-by-step-editing request void slotStepByStepTargetRequested(QObject *); /// Do on-demand rendering for a region. void slotCheckRendered(double cx0, double cx1); /// Do some background rendering work. void slotRenderSomething(); void slotSetOperationNameAndStatus(QString); // Update notation view based on track/staff name change void slotUpdateStaffName(); // Lilypond Directive slots void slotBeginLilypondRepeat();signals: /** * Emitted when the note selected in the palette changes */ void changeCurrentNote(bool isRest, Note::Type); /** * Emitted when a new accidental has been choosen by the user */ void changeAccidental(Accidental, bool follow); /** * Emitted when the selection has been cut or copied * * @see NotationSelector#hideSelection */ void usedSelection(); void play(); void stop(); void fastForwardPlayback(); void rewindPlayback(); void fastForwardPlaybackToEnd(); void rewindPlaybackToBeginning(); void jumpPlaybackTo(timeT); void panic(); /// progress Report void setProgress(int); void incrementProgress(int); void setOperationName(QString); void stepByStepTargetRequested(QObject *); void renderComplete(); void editTimeSignature(timeT); void editMetadata(QString); void editTriggerSegment(int); void staffLabelChanged(TrackId id, QString label);protected: virtual RulerScale* getHLayout(); virtual void paintEvent(QPaintEvent* e); /** * init the action maps for notes, marks etc */ void initActionDataMaps();protected slots: /** * save general Options like all bar positions and status as well * as the geometry and the recent file list to the configuration * file */ virtual void slotSaveOptions();protected: /** * read general Options again and initialize all variables like the recent file list */ virtual void readOptions(); void setOneToolbar(const char *actionName, const char *toolbarName); /** * create menus and toolbars */ virtual void setupActions(); /** * create or re-initialise (after font change) the font size menu */ virtual void setupFontSizeMenu(std::string oldFontName = ""); /** * Set KDE3+ menu states based on the current selection */ virtual void setMenuStates(); /** * setup status bar */ virtual void initStatusBar(); /** * Place the staffs at the correct x & y coordinates (before layout) */ void positionStaffs(); /** * Place the page pixmaps (if any) at the correct x & y * coordinates (after layout) */ void positionPages(); /** * Update the panner thumbnail images. If complete is true, * copy the entire mini-canvas. */ void updateThumbnails(bool complete); /** * setup the layout/font toolbar */ void initLayoutToolbar(); /** * Helper function to toggle a toolbar given its name * If \a force point to a bool, then the bool's value * is used to show/hide the toolbar. */ void toggleNamedToolBar(const QString& toolBarName, bool* force = 0); /// Calls all the relevant preparse and layout methods virtual bool applyLayout(int staffNo = -1, timeT startTime = 0, timeT endTime = 0); /** * Readjust the size of the canvas after a layout * * Checks the total width computed by the horizontal layout * * @see NotationHLayout#getTotalWidth() */ void readjustCanvasSize(); /** * Override from EditView * @see EditView#getViewSize */ virtual QSize getViewSize(); /** * Override from EditView * @see EditView#setViewSize */ virtual void setViewSize(QSize); /** * Set the note pixmap factory * * The previous pixmap factory is deleted */ void setNotePixmapFactory(NotePixmapFactory*); virtual NotationCanvasView* getCanvasView(); virtual Segment *getCurrentSegment(); virtual Staff *getCurrentStaff() { return getCurrentLinedStaff(); } virtual LinedStaff *getCurrentLinedStaff(); virtual bool hasSegment(Segment *segment); /** * Return the time at which the insert cursor may be found. */ virtual timeT getInsertionTime(); /** * Return the time at which the insert cursor may be found, * and the time signature, clef and key at that time. */ virtual timeT getInsertionTime(Clef &clef, Rosegarden::Key &key); void doDeferredCursorMove(); void removeViewLocalProperties(Event*); void setupProgress(KProgress*); void setupProgress(ProgressDialog*); void setupDefaultProgress(); void disconnectProgress(); /** * Test whether we've had too many preview notes recently */ bool canPreviewAnotherNote(); virtual void updateViewCaption(); //--------------- Data members --------------------------------- NotationProperties m_properties; /// Displayed in the status bar, shows number of events selected QLabel *m_selectionCounter; /// Displayed in the status bar, shows insertion mode QLabel *m_insertModeLabel; /// Displayed in the status bar, shows when annotations are hidden QLabel *m_annotationsLabel; /// Displayed in the status bar, shows when LilyPond directives are hidden QLabel *m_lilypondDirectivesLabel; /// Displayed in the status bar, shows progress of current operation ProgressBar *m_progressBar; /// Displayed in the status bar, holds the pixmap of the current note QLabel* m_currentNotePixmap; /// Displayed in the status bar, shows the pitch the cursor is at QLabel* m_hoveredOverNoteName; /// Displayed in the status bar, shows the absolute time the cursor is at QLabel* m_hoveredOverAbsoluteTime; std::vector<NotationStaff*> m_staffs; int m_currentStaff; int m_lastFinishingStaff; QCanvasItem *m_title; QCanvasItem *m_subtitle; QCanvasItem *m_composer; QCanvasItem *m_copyright; std::vector<QCanvasItem *> m_pages; std::vector<QCanvasItem *> m_pageNumbers; timeT m_insertionTime; enum DeferredCursorMoveType { NoCursorMoveNeeded, CursorMoveOnly, CursorMoveAndMakeVisible, CursorMoveAndScrollToPosition }; DeferredCursorMoveType m_deferredCursorMove; double m_deferredCursorScrollToX; QString m_lastNoteAction; std::string m_fontName; int m_fontSize; LinedStaff::PageMode m_pageMode; int m_leftGutter; NotePixmapFactory *m_notePixmapFactory; NotationHLayout* m_hlayout; NotationVLayout* m_vlayout; ChordNameRuler *m_chordNameRuler; QWidget *m_tempoRuler; RawNoteRuler *m_rawNoteRuler; bool m_annotationsVisible; bool m_lilypondDirectivesVisible; KAction* m_selectDefaultNote; typedef QMap<QString, NoteActionData *> NoteActionDataMap; static NoteActionDataMap* m_noteActionDataMap; typedef QMap<QString, NoteChangeActionData *> NoteChangeActionDataMap; static NoteChangeActionDataMap* m_noteChangeActionDataMap; typedef QMap<QString, MarkActionData *> MarkActionDataMap; static MarkActionDataMap *m_markActionDataMap; KComboBox *m_fontCombo; KComboBox *m_fontSizeCombo; KComboBox *m_spacingCombo; KActionMenu *m_fontSizeActionMenu; ScrollBoxDialog *m_pannerDialog; QTimer *m_renderTimer; bool m_playTracking; std::vector<std::pair<int, int> > m_pendingInsertableNotes; enum { PROGRESS_NONE, PROGRESS_BAR, PROGRESS_DIALOG } m_progressDisplayer; bool m_inhibitRefresh; bool m_ok; bool m_printMode; int m_printSize; static std::map<KProcess *, KTempFile *> m_lilyTempFileMap;};}#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -