|
hydrogen 1.2.6
|
NotePropertiesEditor is (currently) a single class instantiated in different "modes" to select which property it edits. More...
#include <NotePropertiesRuler.h>
Public Slots | |
| virtual void | copy () override |
| virtual void | cut () override |
| virtual void | deleteSelection () override |
| void | onPreferencesChanged (H2Core::Preferences::Changes changes) |
| virtual void | paste () override |
| void | scrolled (int) |
| virtual void | selectAll () override |
| virtual void | updateEditor (bool bPatternOnly=false) override |
Public Slots inherited from PatternEditor | |
| virtual void | copy () |
| Copy selection to clipboard in XML. | |
| virtual void | cut () |
| virtual void | deleteSelection ()=0 |
| void | onPreferencesChanged (H2Core::Preferences::Changes changes) |
| virtual void | paste ()=0 |
| void | scrolled (int nValue) |
| virtual void | selectAll ()=0 |
| virtual void | selectInstrumentNotes (int nInstrument) |
| virtual void | selectNone () |
| void | setCurrentInstrument (int nInstrument) |
| virtual void | updateEditor (bool bPatternOnly=false)=0 |
Public Member Functions | |
| NotePropertiesRuler (const NotePropertiesRuler &)=delete | |
| NotePropertiesRuler (QWidget *parent, PatternEditorPanel *pPatternEditorPanel, Mode mode) | |
| ~NotePropertiesRuler () | |
| NotePropertiesRuler & | operator= (const NotePropertiesRuler &rhs)=delete |
Property drag (or click) gestures | |
The user can drag (or just click) on a note's bar or dot to change that property. Properties are updated live during the drag gesture, with 'undo' information being written at the end. | |
| void | propertyDragStart (QMouseEvent *ev) |
| void | propertyDragUpdate (QMouseEvent *ev) |
| Update notes for a property adjust drag, in response to the mouse moving. | |
| void | propertyDragEnd () |
PatternEditor interfaces | |
| virtual std::vector< SelectionIndex > | elementsIntersecting (QRect r) override |
| Find list of elements which intersect a rectangular area. | |
| virtual void | mouseClickEvent (QMouseEvent *ev) override |
| virtual void | mousePressEvent (QMouseEvent *ev) override |
| Raw Qt mouse events are passed to the Selection. | |
| virtual void | mouseDragStartEvent (QMouseEvent *ev) override |
| virtual void | mouseDragUpdateEvent (QMouseEvent *ev) override |
| virtual void | mouseDragEndEvent (QMouseEvent *ev) override |
| virtual void | selectionMoveUpdateEvent (QMouseEvent *ev) override |
| virtual void | selectionMoveEndEvent (QInputEvent *ev) override |
| virtual void | selectionMoveCancelEvent () override |
| Move of selection is cancelled. Revert notes to preserved state. | |
| virtual QRect | getKeyboardCursorRect () override |
| The screen area occupied by the keyboard cursor. | |
Public Member Functions inherited from PatternEditor | |
| PatternEditor (QWidget *pParent, PatternEditorPanel *panel) | |
| ~PatternEditor () | |
| virtual bool | checkDeselectElements (std::vector< SelectionIndex > &elements) override |
| Deselecting notes. | |
| void | clearSelection () |
| Clear the pattern editor selection. | |
| void | deselectAndOverwriteNotes (std::vector< H2Core::Note * > &selected, std::vector< H2Core::Note * > &overwritten) |
| Deselect some notes, and "overwrite" some others. | |
| void | editNoteLengthAction (int nColumn, int nRealColumn, int nRow, int nLength, int nSelectedPatternNumber, int nSelectedInstrumentnumber, Editor editor) |
| void | editNotePropertiesAction (int nColumn, int nRealColumn, int nRow, int nSelectedPatternNumber, int nSelectedInstrumentNumber, Mode mode, Editor editor, float fVelocity, float fPan, float fLeadLag, float fProbability) |
| virtual void | endMouseGesture () override |
| unsigned | getGridHeight () const |
| float | getGridWidth () const |
| uint | getResolution () const |
| bool | isUsingTriplets () const |
| int | lineToPitch (int nLine) |
| void | mergeSelectionGroups (PatternEditor *pPatternEditor) |
| Merge together the selection groups of two PatternEditor objects to share a common selection. | |
| virtual void | mouseReleaseEvent (QMouseEvent *ev) override |
| bool | notesMatchExactly (H2Core::Note *pNoteA, H2Core::Note *pNoteB) const |
| Do two notes match exactly, from the pattern editor's point of view? | |
| int | pitchToLine (int nPitch) |
| void | setResolution (uint res, bool bUseTriplets) |
Set the editor grid resolution, dividing a whole note into res subdivisions. | |
| virtual void | stackedModeActivationEvent (int nValue) override |
| virtual void | startMouseLasso (QMouseEvent *ev) override |
| Change the mouse cursor during mouse gestures. | |
| virtual void | startMouseMove (QMouseEvent *ev) override |
| void | undoDeselectAndOverwriteNotes (std::vector< H2Core::Note * > &selected, std::vector< H2Core::Note * > &overwritten) |
| virtual void | updateModifiers (QInputEvent *ev) |
| Update the status of modifier keys in response to input events. | |
| void | updatePosition (float fTick) |
| Caches the AudioEngine::m_nPatternTickPosition in the member variable m_nTick and triggers an update(). | |
| virtual void | updateWidget () override |
| Update a widget in response to a change in selection. | |
| virtual void | validateSelection () override |
| Ensure that the Selection contains only valid elements. | |
| void | zoomIn () |
| Zoom in / out on the time axis. | |
| void | zoomOut () |
Public Member Functions inherited from EventListener | |
| virtual | ~EventListener () |
| virtual void | actionModeChangeEvent (int nValue) |
| virtual void | bbtChangedEvent () |
| virtual void | driverChangedEvent () |
| virtual void | drumkitLoadedEvent () |
| virtual void | errorEvent (int nErrorCode) |
| virtual void | gridCellToggledEvent () |
| virtual void | instrumentParametersChangedEvent (int nInstrumentNumber) |
| virtual void | jacksessionEvent (int nValue) |
| virtual void | jackTimebaseStateChangedEvent (int nValue) |
| virtual void | jackTransportActivationEvent () |
| virtual void | loopModeActivationEvent () |
| virtual void | metronomeEvent (int nValue) |
| virtual void | midiActivityEvent () |
| virtual void | midiMapChangedEvent () |
| virtual void | nextPatternsChangedEvent () |
| virtual void | nextShotEvent () |
| virtual void | noteOnEvent (int nInstrument) |
| virtual void | patternEditorLockedEvent () |
| virtual void | patternModifiedEvent () |
| virtual void | playbackTrackChangedEvent () |
| virtual void | playingPatternsChangedEvent () |
| virtual void | playlistLoadSongEvent (int nIndex) |
| virtual void | progressEvent (int nValue) |
| virtual void | quitEvent (int nValue) |
| virtual void | relocationEvent () |
| virtual void | songModifiedEvent () |
| virtual void | songSizeChangedEvent () |
| virtual void | soundLibraryChangedEvent () |
| virtual void | stateChangedEvent (H2Core::AudioEngine::State state) |
| virtual void | tempoChangedEvent (int nValue) |
| virtual void | timelineActivationEvent () |
| virtual void | timelineUpdateEvent (int nValue) |
| virtual void | undoRedoActionEvent (int nValue) |
| virtual void | updatePreferencesEvent (int nValue) |
| virtual void | updateSongEvent (int nValue) |
| virtual void | XRunEvent () |
Public Member Functions inherited from Object< PatternEditor > | |
| Object () | |
| Object (const Object< PatternEditor > &other) | |
Public Member Functions inherited from Base | |
| Base () | |
| Base (const Base &other) | |
| virtual const char * | class_name () const |
| void | logBacktrace () const |
| Print the current stack at point into the debug log. | |
| void | Print (bool bShort=true) const |
| Prints content of toQString() via DEBUGLOG. | |
| virtual QString | toQString (const QString &sPrefix="", bool bShort=true) const |
| Formatted string version for debugging purposes. | |
Public Member Functions inherited from SelectionWidget< H2Core::Note * > | |
| virtual bool | canDragElements () |
| Can elements be dragged as well as being selected? This may change to suit widget's current state. | |
| virtual bool | checkDeselectElements (std::vector< SelectionIndex > &elements) |
| Inform the client that we're deselecting elements. | |
| virtual QScrollArea * | findScrollArea () |
| Find the QScrollArea, if any, which contains the widget. | |
Private Member Functions | |
| void | addUndoAction () |
| void | adjustNotePropertyDelta (H2Core::Note *pNote, float fDelta, bool bMessage=false) |
| Adjust a note's property by applying a delta to the current value, and clipping to the appropriate range. | |
| void | clearOldNotes () |
| void | createBackground () override |
| Updates m_pBackgroundPixmap to show the latest content. | |
| void | createCenteredBackground (QPixmap *pixmap) |
| void | createNormalizedBackground (QPixmap *pixmap) |
| void | createNoteKeyBackground (QPixmap *pixmap) |
| void | drawDefaultBackground (QPainter &painter, int nHeight=0, int nIncrement=0) |
| void | drawFocus (QPainter &painter) |
| virtual void | enterEvent (QEvent *ev) override |
| void | keyPressEvent (QKeyEvent *ev) override |
| void | leaveEvent (QEvent *ev) override |
| virtual void | mouseMoveEvent (QMouseEvent *ev) override |
| void | paintEvent (QPaintEvent *ev) override |
| void | prepareUndoAction (int x) |
| Preserve current note properties at position x (or in selection, if any) for use in later UndoAction. | |
| virtual void | selectedInstrumentChangedEvent () override |
| virtual void | selectedPatternChangedEvent () override |
| virtual void | songModeActivationEvent () override |
| void | wheelEvent (QWheelEvent *ev) override |
| Scroll wheel gestures will adjust the property of notes under the mouse cursor (or selected notes, if any). | |
Private Attributes | |
| bool | m_bEntered |
| bool | m_bNeedsUpdate |
| bool | m_bValueHasBeenSet |
| double | m_fLastSetValue |
| int | m_nDragPreviousColumn |
| int | m_nSelectedPatternNumber |
| std::map< H2Core::Note *, H2Core::Note * > | m_oldNotes |
| Map of notes currently in the pattern -> old notes with their properties. | |
Static Private Attributes | |
| static constexpr int | nDefaultHeight = 100 |
| Height of all editors except the NoteKey one. | |
| static int | nNoteKeyHeight |
| The height of the overall NoteKey Editor. | |
| static constexpr int | nNoteKeyLineHeight = 10 |
| Height of a single line in the key section. | |
| static constexpr int | nNoteKeyOctaveHeight = 90 |
| Height of the whole octave section. | |
| static constexpr int | nNoteKeySpaceHeight = 10 |
| Height of the non-interactive space in NoteKey editor between octave and key section. | |
Additional Inherited Members | |
Public Types inherited from PatternEditor | |
| enum class | Editor { DrumPattern = 0 , PianoRoll = 1 , NotePropertiesRuler = 2 , None = 3 } |
| enum class | Mode { Velocity = 0 , Pan = 1 , LeadLag = 2 , NoteKey = 3 , Probability = 4 , None = 5 } |
Public Types inherited from SelectionWidget< H2Core::Note * > | |
| typedef H2Core::Note * | SelectionIndex |
Static Public Member Functions inherited from PatternEditor | |
| static QColor | computeNoteColor (float velocity) |
| Calculate colour to use for note representation based on note velocity. | |
| static bool | isUsingAdditionalPatterns (const H2Core::Pattern *pPattern) |
| Determines whether to pattern editor should show further patterns (determined by getPattersToShow()) or just the currently selected one. | |
| static QString | modeToQString (Mode mode) |
| static void | triggerStatusMessage (H2Core::Note *pNote, Mode mode) |
Static Public Member Functions inherited from Base | |
| static const char * | _class_name () |
| return the class name | |
| static QString | base_clock (const QString &sMsg) |
| Measures the current time and stores it in __last_clock. | |
| static QString | base_clock_in (const QString &sMsg) |
| static int | bootstrap (Logger *logger, bool count=false) |
| must be called before any Object instantiation ! | |
| static bool | count_active () |
| static int | getAliveObjectCount () |
| static object_map_t | getObjectMap () |
| static Logger * | logger () |
| return the logger instance | |
| static int | objects_count () |
| static void | printObjectMapDiff (object_map_t map) |
| Creates the difference between a snapshot of the object map and its current state and prints it to std::cout. | |
| static void | set_count (bool flag) |
| enable/disable class instances counting | |
| static void | write_objects_map_to (std::ostream &out, object_map_t *map=nullptr) |
| output the full objects map to a given ostream | |
| static void | write_objects_map_to_cerr () |
| output objects map to stderr | |
Static Public Attributes inherited from PatternEditor | |
| static constexpr int | nMargin = 20 |
Static Public Attributes inherited from Base | |
| static QString | sPrintIndention = " " |
| String used to format the debugging string output of some core classes. | |
Protected Member Functions inherited from PatternEditor | |
| void | drawGridLines (QPainter &p, Qt::PenStyle style=Qt::SolidLine) const |
| Draw lines for note grid. | |
| void | drawNoteSymbol (QPainter &p, QPoint pos, H2Core::Note *pNote, bool bIsForeground=true) const |
| Draw a note. | |
| virtual void | focusInEvent (QFocusEvent *ev) override |
| virtual void | focusOutEvent (QFocusEvent *ev) override |
| int | getColumn (int x, bool bUseFineGrained=false) const |
| std::vector< H2Core::Pattern * > | getPatternsToShow (void) |
| Get notes to show in pattern editor. | |
| int | granularity () const |
| Granularity of grid positioning (in ticks) | |
| void | invalidateBackground () |
| QPoint | movingGridOffset () const |
| QColor | selectedNoteColor () const |
| Colour to use for outlining selected notes. | |
| void | storeNoteProperties (const H2Core::Note *pNote) |
| Stores the properties of pNote in member variables. | |
| void | updatePatternInfo () |
| Update current pattern information. | |
| void | updateWidth () |
| Adjusts m_nActiveWidth and m_nEditorWidth to the current state of the editor. | |
Protected Member Functions inherited from Object< PatternEditor > | |
| ~Object () | |
Protected Member Functions inherited from Base | |
| ~Base () | |
Protected Member Functions inherited from WidgetWithScalableFont< 7, 9, 11 > | |
| constexpr int | getPointSize (H2Core::FontTheme::FontSize fontSize) const |
Static Protected Member Functions inherited from Base | |
| static void | registerClass (const char *name, const atomic_obj_cpt_t *counters) |
Protected Attributes inherited from PatternEditor | |
| bool | m_bBackgroundInvalid |
| bool | m_bCopyNotMove |
| bool | m_bEntered |
| Indicates whether the mouse pointer entered the widget. | |
| bool | m_bFineGrained |
| bool | m_bSelectNewNotes |
| bool | m_bUseTriplets |
| Editor | m_editor |
| float | m_fGridWidth |
| float | m_fLeadLag = 0 |
| float | m_fOldLeadLag = 0 |
| float | m_fOldPan = 0 |
| float | m_fOldProbability = 0 |
| float | m_fOldVelocity = 0 |
| float | m_fPan = 0 |
| float | m_fProbability = 0 |
| float | m_fVelocity = 0 |
| Mode | m_mode |
| int | m_nActiveWidth |
| int | m_nColumn = 0 |
| uint | m_nEditorHeight |
| uint | m_nEditorWidth |
| unsigned | m_nGridHeight |
| unsigned | m_nOctaves = 7 |
| int | m_nOldLength = 0 |
| int | m_nOldPoint |
| int | m_nPressedLine = 0 |
| int | m_nRealColumn = 0 |
| uint | m_nResolution |
| int | m_nRow = 0 |
| int | m_nSelectedInstrumentNumber = 0 |
| Cached properties used when adjusting a note property via right-press mouse movement. | |
| int | m_nSelectedPatternNumber = 0 |
| int | m_nTick |
| H2Core::AudioEngine * | m_pAudioEngine |
| QPixmap * | m_pBackgroundPixmap |
| H2Core::Note * | m_pDraggedNote |
| H2Core::Pattern * | m_pPattern |
| PatternEditorPanel * | m_pPatternEditorPanel |
| QMenu * | m_pPopupMenu |
| Selection< SelectionIndex > | m_selection |
| The Selection object. | |
Static Protected Attributes inherited from Base | |
| static bool | __count = false |
| should we count class instances | |
| static timeval | __last_clock = { 0, 0 } |
| static Logger * | __logger = nullptr |
| static bool | bLogColors = true |
NotePropertiesEditor is (currently) a single class instantiated in different "modes" to select which property it edits.
There are individual instances for each property which are hidden and shown depending on what the user selects.
Definition at line 51 of file NotePropertiesRuler.h.
| NotePropertiesRuler | ( | QWidget * | parent, |
| PatternEditorPanel * | pPatternEditorPanel, | ||
| PatternEditor::Mode | mode ) |
Definition at line 49 of file NotePropertiesRuler.cpp.
| ~NotePropertiesRuler | ( | ) |
Definition at line 94 of file NotePropertiesRuler.cpp.
|
delete |
|
private |
Definition at line 880 of file NotePropertiesRuler.cpp.
|
private |
Adjust a note's property by applying a delta to the current value, and clipping to the appropriate range.
Optionally, show a message with the value for some properties.
Definition at line 577 of file NotePropertiesRuler.cpp.
|
private |
Definition at line 310 of file NotePropertiesRuler.cpp.
|
inlineoverridevirtualslot |
Definition at line 92 of file NotePropertiesRuler.h.
|
overrideprivatevirtual |
Updates m_pBackgroundPixmap to show the latest content.
Reimplemented from PatternEditor.
Definition at line 1488 of file NotePropertiesRuler.cpp.
|
private |
Definition at line 1194 of file NotePropertiesRuler.cpp.
|
private |
Definition at line 1109 of file NotePropertiesRuler.cpp.
|
private |
Definition at line 1317 of file NotePropertiesRuler.cpp.
|
inlineoverridevirtualslot |
Definition at line 94 of file NotePropertiesRuler.h.
|
inlineoverridevirtualslot |
Definition at line 91 of file NotePropertiesRuler.h.
|
private |
Definition at line 1065 of file NotePropertiesRuler.cpp.
|
private |
Definition at line 972 of file NotePropertiesRuler.cpp.
|
overridevirtual |
Find list of elements which intersect a rectangular area.
This may be a selection lasso rectangle, or a single point such as a mouse click. This should concern itself only with the geometry.
Implements SelectionWidget< H2Core::Note * >.
Definition at line 1530 of file NotePropertiesRuler.cpp.
|
overrideprivatevirtual |
Reimplemented from PatternEditor.
Definition at line 1052 of file NotePropertiesRuler.cpp.
|
overridevirtual |
The screen area occupied by the keyboard cursor.
Implements SelectionWidget< H2Core::Note * >.
Definition at line 1577 of file NotePropertiesRuler.cpp.
|
overrideprivate |
Definition at line 644 of file NotePropertiesRuler.cpp.
|
overrideprivatevirtual |
Reimplemented from PatternEditor.
Definition at line 1059 of file NotePropertiesRuler.cpp.
|
overridevirtual |
Implements SelectionWidget< H2Core::Note * >.
Definition at line 176 of file NotePropertiesRuler.cpp.
|
overridevirtual |
Reimplemented from PatternEditor.
Definition at line 245 of file NotePropertiesRuler.cpp.
|
overridevirtual |
Reimplemented from PatternEditor.
Definition at line 229 of file NotePropertiesRuler.cpp.
|
overridevirtual |
Reimplemented from PatternEditor.
Definition at line 241 of file NotePropertiesRuler.cpp.
|
overrideprivatevirtual |
Reimplemented from PatternEditor.
Definition at line 352 of file NotePropertiesRuler.cpp.
|
overridevirtual |
Raw Qt mouse events are passed to the Selection.
Reimplemented from PatternEditor.
Definition at line 190 of file NotePropertiesRuler.cpp.
|
slot |
Definition at line 1589 of file NotePropertiesRuler.cpp.
|
delete |
|
overrideprivate |
Definition at line 923 of file NotePropertiesRuler.cpp.
|
inlineoverridevirtualslot |
Definition at line 93 of file NotePropertiesRuler.h.
|
private |
Preserve current note properties at position x (or in selection, if any) for use in later UndoAction.
Definition at line 391 of file NotePropertiesRuler.cpp.
| void propertyDragEnd | ( | ) |
Definition at line 567 of file NotePropertiesRuler.cpp.
| void propertyDragStart | ( | QMouseEvent * | ev | ) |
Definition at line 379 of file NotePropertiesRuler.cpp.
| void propertyDragUpdate | ( | QMouseEvent * | ev | ) |
Update notes for a property adjust drag, in response to the mouse moving.
This modifies the values of the notes as the mouse moves, but does not complete an undo action until the notes final value has been set. This occurs either when the mouse is released, or when the pointer moves off of the note's column.
Definition at line 433 of file NotePropertiesRuler.cpp.
|
slot |
Definition at line 1044 of file NotePropertiesRuler.cpp.
|
overridevirtualslot |
Definition at line 1584 of file NotePropertiesRuler.cpp.
|
overrideprivatevirtual |
Reimplemented from EventListener.
Definition at line 1521 of file NotePropertiesRuler.cpp.
|
overrideprivatevirtual |
Reimplemented from EventListener.
Definition at line 1516 of file NotePropertiesRuler.cpp.
|
overridevirtual |
Move of selection is cancelled. Revert notes to preserved state.
Reimplemented from SelectionWidget< H2Core::Note * >.
Definition at line 318 of file NotePropertiesRuler.cpp.
|
overridevirtual |
Implements SelectionWidget< H2Core::Note * >.
Definition at line 303 of file NotePropertiesRuler.cpp.
|
overridevirtual |
Reimplemented from SelectionWidget< H2Core::Note * >.
Definition at line 250 of file NotePropertiesRuler.cpp.
|
overrideprivatevirtual |
Reimplemented from PatternEditor.
Definition at line 1526 of file NotePropertiesRuler.cpp.
|
overridevirtualslot |
Definition at line 1468 of file NotePropertiesRuler.cpp.
|
overrideprivate |
Scroll wheel gestures will adjust the property of notes under the mouse cursor (or selected notes, if any).
Unlike drag gestures, each individual wheel movement will result in an undo/redo action since the events are discrete.
Definition at line 102 of file NotePropertiesRuler.cpp.
|
private |
Definition at line 156 of file NotePropertiesRuler.h.
|
private |
Definition at line 113 of file NotePropertiesRuler.h.
|
private |
Definition at line 119 of file NotePropertiesRuler.h.
|
private |
Definition at line 118 of file NotePropertiesRuler.h.
|
private |
Definition at line 155 of file NotePropertiesRuler.h.
|
private |
Definition at line 146 of file NotePropertiesRuler.h.
|
private |
Map of notes currently in the pattern -> old notes with their properties.
Populated at the beginning of a properties editing gesture.
Definition at line 150 of file NotePropertiesRuler.h.
|
staticconstexprprivate |
Height of all editors except the NoteKey one.
Definition at line 111 of file NotePropertiesRuler.h.
|
staticprivate |
The height of the overall NoteKey Editor.
It will be calculated during runtime using the other constexprs.
Definition at line 109 of file NotePropertiesRuler.h.
|
staticconstexprprivate |
Height of a single line in the key section.
Definition at line 101 of file NotePropertiesRuler.h.
|
staticconstexprprivate |
Height of the whole octave section.
Definition at line 103 of file NotePropertiesRuler.h.
|
staticconstexprprivate |
Height of the non-interactive space in NoteKey editor between octave and key section.
It is contained within the octave part.
Definition at line 106 of file NotePropertiesRuler.h.