16 #ifndef _NOTE_LAYER_H_ 17 #define _NOTE_LAYER_H_ 22 #include "data/model/NoteModel.h" 67 virtual void copy(
View *v, Selection s, Clipboard &to);
68 virtual bool paste(
View *v,
const Clipboard &from,
int frameOffset,
79 int *min,
int *max,
int *deflt)
const;
82 virtual void setProperty(
const PropertyName &,
int value);
101 bool &log, QString &unit)
const;
116 void addNoteOn(
int frame,
int pitch,
int velocity);
129 virtual void toXml(QTextStream &stream, QString indent =
"",
130 QString extraAttributes =
"")
const;
160 typedef std::set<NoteModel::Point, NoteModel::Point::Comparator>
NoteSet;
168 void finish(NoteModel::EditCommand *command) {
169 Command *c = command->finish();
virtual void editDrag(View *v, QMouseEvent *)
void finish(NoteModel::EditCommand *command)
virtual void copy(View *v, Selection s, Clipboard &to)
void getScaleExtents(View *, float &min, float &max, bool &log) const
virtual QString getPropertyGroupName(const PropertyName &) const
virtual const Model * getModel() const
virtual void eraseDrag(View *v, QMouseEvent *)
virtual int getCompletion(View *) const
Return the proportion of background work complete in drawing this view, as a percentage – in most cas...
bool shouldAutoAlign() const
virtual bool getValueExtents(float &min, float &max, bool &log, QString &unit) const
Return the minimum and maximum values for the y axis of the model in this layer, as well as whether t...
virtual bool editOpen(View *v, QMouseEvent *)
Open an editor on the item under the mouse (e.g.
virtual void moveSelection(Selection s, int newStartFrame)
VerticalScale getVerticalScale() const
NoteModel::Point m_editingPoint
void addCommand(Command *command)
Add a command to the command history.
void addNoteOn(int frame, int pitch, int velocity)
Add a note-on.
virtual PropertyList getProperties() const
bool getPointToDrag(View *v, int x, int y, NoteModel::Point &) const
std::set< NoteModel::Point, NoteModel::Point::Comparator > NoteSet
virtual void setProperty(const PropertyName &, int value)
virtual void setVerticalZoomStep(int)
!! lots of duplication with TimeValueLayer
NoteModel::EditCommand * m_editingCommand
NoteModel::Point m_originalPoint
virtual void drawEnd(View *v, QMouseEvent *)
virtual int getPropertyRangeAndValue(const PropertyName &, int *min, int *max, int *deflt) const
VerticalScale m_verticalScale
void addNoteOff(int frame, int pitch)
Add a note-off.
virtual RangeMapper * getNewVerticalZoomRangeMapper() const
Create and return a range mapper for vertical zoom step values.
virtual void paintVerticalScale(View *v, bool, QPainter &paint, QRect rect) const
virtual void deleteSelection(Selection s)
void setProperties(const QXmlAttributes &attributes)
Set the particular properties of a layer (those specific to the subclass) from a set of XML attribute...
virtual void resizeSelection(Selection s, Selection newSize)
virtual bool getDisplayExtents(float &min, float &max) const
Return the minimum and maximum values within the displayed range for the y axis, if only a subset of ...
virtual QString getFeatureDescription(View *v, QPoint &) const
virtual void editStart(View *v, QMouseEvent *)
void setModel(NoteModel *model)
virtual void toXml(QTextStream &stream, QString indent="", QString extraAttributes="") const
Convert the layer's data (though not those of the model it refers to) into XML for file output.
virtual void editEnd(View *v, QMouseEvent *)
virtual int getCurrentVerticalZoomStep() const
Get the current vertical zoom step.
virtual bool setDisplayExtents(float min, float max)
Set the displayed minimum and maximum values for the y axis to the given range, if supported.
virtual PropertyType getPropertyType(const PropertyName &) const
virtual QString getPropertyLabel(const PropertyName &) const
virtual void eraseStart(View *v, QMouseEvent *)
virtual QString getPropertyValueLabel(const PropertyName &, int value) const
static CommandHistory * getInstance()
void abandonNoteOns()
Abandon all pending note-on events.
virtual bool snapToFeatureFrame(View *v, int &frame, int &resolution, SnapType snap) const
Adjust the given frame to snap to the nearest feature, if possible.
virtual bool isLayerScrollable(const View *v) const
This should return true if the layer can safely be scrolled automatically by a given view (simply cop...
virtual void drawStart(View *v, QMouseEvent *)
virtual void drawDrag(View *v, QMouseEvent *)
View is the base class of widgets that display one or more overlaid views of data against a horizonta...
virtual QString getScaleUnits() const
virtual int getVerticalScaleWidth(View *v, bool, QPainter &) const
NoteModel::PointList getLocalPoints(View *v, int) const
virtual float getValueForY(View *v, int y) const
bool shouldConvertMIDIToHz() const
void setVerticalScale(VerticalScale scale)
virtual bool isLayerEditable() const
This should return true if the layer can be edited by the user.
virtual int getDefaultColourHint(bool dark, bool &impose)
virtual int getVerticalZoomSteps(int &defaultStep) const
Get the number of vertical zoom steps available for this layer.
virtual void paint(View *v, QPainter &paint, QRect rect) const
Paint the given rectangle of this layer onto the given view using the given painter,...
virtual bool paste(View *v, const Clipboard &from, int frameOffset, bool interactive)
Paste from the given clipboard onto the layer at the given frame offset.
virtual void eraseEnd(View *v, QMouseEvent *)
virtual int getYForValue(View *v, float value) const
VerticalScaleLayer methods.