23#ifndef PATERN_EDITOR_H
24#define PATERN_EDITOR_H
33#if QT_VERSION >= 0x050000
130 setCursor( Qt::CrossCursor );
134 setCursor( Qt::DragMoveCursor );
172 int nSelectedPatternNumber,
173 int nSelectedInstrumentnumber,
179 int nSelectedPatternNumber,
180 int nSelectedInstrumentNumber,
186 float fProbability );
260 int getColumn(
int x,
bool bUseFineGrained =
false )
const;
264 void drawGridLines( QPainter &p, Qt::PenStyle style = Qt::SolidLine )
const;
303#ifdef H2CORE_HAVE_QT6
304 virtual void enterEvent( QEnterEvent *ev )
override;
306 virtual void enterEvent( QEvent *ev )
override;
308 virtual void leaveEvent( QEvent *ev )
override;
The audio engine deals with two distinct TransportPosition.
A note plays an associated instrument with a velocity left and right pan.
Pattern class is a Note container.
Changes
Bitwise or-able options showing which part of the Preferences were altered using the PreferencesDialo...
virtual bool checkDeselectElements(std::vector< SelectionIndex > &elements) override
Deselecting notes.
static QString modeToQString(Mode mode)
virtual void selectInstrumentNotes(int nInstrument)
virtual void mouseDragUpdateEvent(QMouseEvent *ev) override
virtual void mouseMoveEvent(QMouseEvent *ev) override
int lineToPitch(int nLine)
virtual void validateSelection() override
Ensure that the Selection contains only valid elements.
void editNotePropertiesAction(int nColumn, int nRealColumn, int nRow, int nSelectedPatternNumber, int nSelectedInstrumentNumber, Mode mode, Editor editor, float fVelocity, float fPan, float fLeadLag, float fProbability)
void scrolled(int nValue)
int m_nSelectedPatternNumber
virtual void updateWidget() override
Update a widget in response to a change in selection.
static QColor computeNoteColor(float velocity)
Calculate colour to use for note representation based on note velocity.
virtual void mousePressEvent(QMouseEvent *ev) override
Raw Qt mouse events are passed to the Selection.
virtual void updateModifiers(QInputEvent *ev)
Update the status of modifier keys in response to input events.
virtual void selectNone()
int granularity() const
Granularity of grid positioning (in ticks)
static bool isUsingAdditionalPatterns(const H2Core::Pattern *pPattern)
Determines whether to pattern editor should show further patterns (determined by getPattersToShow()) ...
QColor selectedNoteColor() const
Colour to use for outlining selected notes.
virtual void stackedModeActivationEvent(int nValue) override
virtual void deleteSelection()=0
int m_nSelectedInstrumentNumber
Cached properties used when adjusting a note property via right-press mouse movement.
int pitchToLine(int nPitch)
void storeNoteProperties(const H2Core::Note *pNote)
Stores the properties of pNote in member variables.
void updatePosition(float fTick)
Caches the AudioEngine::m_nPatternTickPosition in the member variable m_nTick and triggers an update(...
static void triggerStatusMessage(H2Core::Note *pNote, Mode mode)
void editNoteLengthAction(int nColumn, int nRealColumn, int nRow, int nLength, int nSelectedPatternNumber, int nSelectedInstrumentnumber, Editor editor)
void drawNoteSymbol(QPainter &p, QPoint pos, H2Core::Note *pNote, bool bIsForeground=true) const
Draw a note.
virtual void updateEditor(bool bPatternOnly=false)=0
bool isUsingTriplets() const
bool notesMatchExactly(H2Core::Note *pNoteA, H2Core::Note *pNoteB) const
Do two notes match exactly, from the pattern editor's point of view?
void onPreferencesChanged(H2Core::Preferences::Changes changes)
virtual void createBackground()
Updates m_pBackgroundPixmap to show the latest content.
static constexpr int nMargin
virtual void songModeActivationEvent() override
PatternEditorPanel * m_pPatternEditorPanel
unsigned getGridHeight() const
void mergeSelectionGroups(PatternEditor *pPatternEditor)
Merge together the selection groups of two PatternEditor objects to share a common selection.
virtual void focusInEvent(QFocusEvent *ev) override
H2Core::AudioEngine * m_pAudioEngine
void zoomIn()
Zoom in / out on the time axis.
virtual void leaveEvent(QEvent *ev) override
H2Core::Note * m_pDraggedNote
virtual void mouseReleaseEvent(QMouseEvent *ev) override
float getGridWidth() const
void deselectAndOverwriteNotes(std::vector< H2Core::Note * > &selected, std::vector< H2Core::Note * > &overwritten)
Deselect some notes, and "overwrite" some others.
void updatePatternInfo()
Update current pattern information.
virtual void mouseDragStartEvent(QMouseEvent *ev) override
virtual void endMouseGesture() override
virtual void copy()
Copy selection to clipboard in XML.
virtual void focusOutEvent(QFocusEvent *ev) override
void setCurrentInstrument(int nInstrument)
std::vector< H2Core::Pattern * > getPatternsToShow(void)
Get notes to show in pattern editor.
virtual void startMouseLasso(QMouseEvent *ev) override
Change the mouse cursor during mouse gestures.
void undoDeselectAndOverwriteNotes(std::vector< H2Core::Note * > &selected, std::vector< H2Core::Note * > &overwritten)
void clearSelection()
Clear the pattern editor selection.
QPixmap * m_pBackgroundPixmap
void setResolution(uint res, bool bUseTriplets)
Set the editor grid resolution, dividing a whole note into res subdivisions.
virtual void mouseDragEndEvent(QMouseEvent *ev) override
PatternEditor(QWidget *pParent, PatternEditorPanel *panel)
virtual void selectAll()=0
int getColumn(int x, bool bUseFineGrained=false) const
H2Core::Pattern * m_pPattern
void invalidateBackground()
void updateWidth()
Adjusts m_nActiveWidth and m_nEditorWidth to the current state of the editor.
virtual void enterEvent(QEvent *ev) override
Selection< SelectionIndex > m_selection
The Selection object.
QPoint movingGridOffset() const
bool m_bEntered
Indicates whether the mouse pointer entered the widget.
virtual void startMouseMove(QMouseEvent *ev) override
bool m_bBackgroundInvalid
uint getResolution() const
void drawGridLines(QPainter &p, Qt::PenStyle style=Qt::SolidLine) const
Draw lines for note grid.
#define MAX_NOTES
Maximum number of notes.