13#ifndef __PLUGIN_API_PLAYEVENT_H__
14#define __PLUGIN_API_PLAYEVENT_H__
16#include "libmscore/noteevent.h"
45 Q_PROPERTY(
int len READ
len WRITE setLen)
60 : QObject(), ne(_ne), parentNote(_parent) {}
62 virtual ~PlayEvent() {
if (parentNote ==
nullptr)
delete ne; }
64 const Ms::NoteEvent& getNoteEvent() {
return *ne; }
65 void setParentNote(Note* parent) { this->parentNote = parent; }
66 Note* note() {
return parentNote; }
69 int ontime()
const {
return ne->ontime(); }
70 int offtime()
const {
return ne->offtime(); }
71 int len()
const {
return ne->len(); }
73 void setOntime(
int v);
84inline PlayEvent* playEventWrap(Ms::NoteEvent* t,
Note* parent)
88 QQmlEngine::setObjectOwnership(w, QQmlEngine::JavaScriptOwnership);
103class QmlPlayEventsListAccess :
public QQmlListProperty<PlayEvent> {
105 QmlPlayEventsListAccess(QObject* obj, NoteEventList& container)
106 : QQmlListProperty<PlayEvent>(obj, &container, &append, &count, &at, &clear) {}
108 static int count(QQmlListProperty<PlayEvent>* l) {
return int(
static_cast<NoteEventList*
>(l->data)->size()); }
109 static PlayEvent* at(QQmlListProperty<PlayEvent>* l,
int i) {
return playEventWrap(&(*(
static_cast<NoteEventList*
>(l->data)))[i],
reinterpret_cast<Note*
>(l->object)); }
110 static void clear(QQmlListProperty<PlayEvent>* l);
111 static void append(QQmlListProperty<PlayEvent>* l,
PlayEvent *v);
Definition elements.h:429
Definition playevent.h:32
int pitch
The relative pitch to the note pitch.
Definition playevent.h:37
int offtime
Time note will turn off.
Definition playevent.h:50
int ontime
Time to turn on the note event.
Definition playevent.h:41
int len
The length of time for the event.
Definition playevent.h:45
Definition playevent.h:103
Contains items exposed to the QML plugins framework.
Definition cursor.cpp:31