20 #ifndef DRUMSTICK_ALSAEVENT_H 21 #define DRUMSTICK_ALSAEVENT_H 45 #define CLONE_EVENT_DECLARATION(T) virtual T* clone() { return new T(&m_event); } 63 void setSequencerType(
const snd_seq_event_type_t eventType);
70 void setDestination(
const unsigned char client,
const unsigned char port);
71 void setSource(
const unsigned char port);
89 snd_seq_tick_time_t
getTick()
const {
return m_event.time.tick; }
102 void setSubscribers();
105 void scheduleTick(
const int queue,
const int tick,
const bool relative);
106 void scheduleReal(
const int queue,
const ulong secs,
const ulong nanos,
const bool relative);
107 void setPriority(
const bool high);
113 unsigned char getTag()
const {
return m_event.tag; }
114 void setTag(
const unsigned char aTag);
115 unsigned int getRaw32(
const unsigned int n)
const;
116 void setRaw32(
const unsigned int n,
const unsigned int value);
117 unsigned char getRaw8(
const unsigned int n)
const;
118 void setRaw8(
const unsigned int n,
const unsigned char value);
124 int getEncodedLength();
136 void free() __attribute__((deprecated));
142 snd_seq_event_t m_event;
184 int getKey()
const {
return m_event.data.note.note; }
218 NoteEvent(
const int ch,
const int key,
const int vel,
const int dur);
230 void setDuration(
const ulong d) { m_event.data.note.duration = d; }
245 NoteOnEvent(
const int ch,
const int key,
const int vel);
260 NoteOffEvent(
const int ch,
const int key,
const int vel);
296 uint
getParam()
const {
return m_event.data.control.param; }
302 void setParam(
const uint p ) { m_event.data.control.param = p; }
308 int getValue()
const {
return m_event.data.control.value; }
314 void setValue(
const int v ) { m_event.data.control.value = v; }
331 int getValue()
const {
return m_event.data.control.value; }
333 void setValue(
const int v ) { m_event.data.control.value = v; }
350 int getValue()
const {
return m_event.data.control.value; }
352 void setValue(
const int v ) { m_event.data.control.value = v; }
369 int getValue()
const {
return m_event.data.control.value; }
371 void setValue(
const int v ) { m_event.data.control.value = v; }
389 unsigned int getLength()
const {
return m_event.data.ext.len; }
391 const char*
getData()
const {
return static_cast<const char*>(m_event.data.ext.ptr); }
408 SysExEvent(
const unsigned int datalen,
char* dataptr);
424 explicit TextEvent(
const QString& text,
const int textType = 1);
426 TextEvent(
const unsigned int datalen,
char* dataptr);
427 QString getText()
const;
428 int getTextType()
const;
462 QueueControlEvent(
const snd_seq_event_type_t type,
const int queue,
const int value);
464 int getQueue()
const {
return m_event.data.queue.queue; }
466 void setQueue(
const uchar q) { m_event.data.queue.queue = q; }
468 int getValue()
const {
return m_event.data.queue.param.value; }
470 void setValue(
const int val) { m_event.data.queue.param.value = val; }
472 uint
getPosition()
const {
return m_event.data.queue.param.position; }
474 void setPosition(
const uint pos) { m_event.data.queue.param.position = pos; }
476 snd_seq_tick_time_t
getTickTime()
const {
return m_event.data.queue.param.time.tick; }
478 void setTickTime(
const snd_seq_tick_time_t t) { m_event.data.queue.param.time.tick = t; }
480 uint
getSkewBase()
const {
return m_event.data.queue.param.skew.base; }
482 void setSkewBase(
const uint base) { m_event.data.queue.param.skew.base = base; }
484 uint
getSkewValue()
const {
return m_event.data.queue.param.skew.value; }
486 void setSkewValue(
const uint val) {m_event.data.queue.param.skew.value = val; }
501 ValueEvent(
const snd_seq_event_type_t type,
const int val);
503 int getValue()
const {
return m_event.data.control.value; }
505 void setValue(
const int v ) { m_event.data.control.value = v; }
536 bool subscribed()
const {
return (m_event.type == SND_SEQ_EVENT_PORT_SUBSCRIBED); }
538 bool unsubscribed()
const {
return (m_event.type == SND_SEQ_EVENT_PORT_UNSUBSCRIBED); }
546 int getDestPort()
const {
return m_event.data.connect.dest.port; }
561 int getClient()
const {
return m_event.data.addr.client; }
577 int getPort()
const {
return m_event.data.addr.port; }
599 int getSizeOfInfo()
const;
602 unsigned int getCondition();
603 const snd_seq_addr_t* getDest();
607 const snd_seq_timestamp_t* getTime();
608 void setChannel(
int chan);
609 void setCondition(
unsigned int cond);
610 void setDest(
const snd_seq_addr_t* dest);
611 void setEventType(
int type);
612 void setQueue(
int queue);
613 void setTag(
int tag);
614 void setTime(
const snd_seq_timestamp_t* time);
617 snd_seq_remove_events_t* m_Info;
631 long decode(
unsigned char *buf,
633 const snd_seq_event_t *ev);
634 long encode(
const unsigned char *buf,
636 snd_seq_event_t *ev);
638 snd_seq_event_t *ev);
639 void enableRunningStatus(
bool enable);
642 void resizeBuffer(
int bufsize);
644 snd_midi_event_t* m_Info;
651 #endif //DRUMSTICK_ALSAEVENT_H ValueEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
snd_seq_event_t * getHandle()
Gets the handle of the event.
ClientEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
void setVelocity(const MidiByte b)
Sets the note velocity of this event.
ALSA Event representing a queue control command.
int getVelocity() const
Gets the note velocity of this event.
snd_seq_tick_time_t getTick() const
Gets the tick time of the event.
unsigned char getTag() const
Gets the tag of the event.
bool subscribed() const
Returns true if the event was a subscribed port.
TempoEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
void setValue(const int v)
Sets the MIDI program number.
Base class for the events having Key and Velocity properties.
PortEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
int getSenderClient() const
Gets the sender client number.
Generic event having a value property.
int getQueue() const
Gets the queue number.
ChanPressEvent()
Default constructor.
int getValue() const
Gets the channel aftertouch value.
const QEvent::Type SequencerEventType
Constant SequencerEventType is the QEvent::type() of any SequencerEvent object to be used to check th...
QByteArray m_data
Clone this object returning a pointer to the new object.
void setDuration(const ulong d)
Sets the note's duration.
PortEvent()
Default constructor.
SystemEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
ulong getDuration() const
Gets the note's duration.
virtual ~SequencerEvent()
Destructor.
Event representing a MIDI control change event.
NoteEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
void setTickTime(const snd_seq_tick_time_t t)
Sets the musical time in ticks.
KeyEvent()
Default constructor.
Base class for variable length events.
ProgramChangeEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
ALSA Event representing a change on some ALSA sequencer client on the system.
ControllerEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
The QObject class is the base class of all Qt objects.
Base class for the event's hierarchy.
snd_seq_event_type_t getSequencerType() const
Gets the sequencer event type.
Auxiliary class to translate between raw MIDI streams and ALSA events.
Event representing a MIDI system exclusive event.
int getValue() const
Gets the event's value.
int getValue() const
Gets the MIDI program number.
bool unsubscribed() const
Returns true if the event was an unsubscribed port.
int getValue() const
Gets the event's value.
void setSkewValue(const uint val)
Sets the skew value.
uint getParam() const
Gets the controller event's parameter.
int getSenderPort() const
Gets the sender port number.
NoteOnEvent()
Default constructor.
void setQueue(const uchar q)
Sets the queue number.
ChanPressEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
uint getPosition() const
Gets the queue position.
void setSkewBase(const uint base)
Sets the skew base, should be 65536.
uint getSkewBase() const
Gets the skew base.
PitchBendEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
NoteEvent()
Default constructor.
unsigned char getSourcePort() const
Gets the source port id.
NoteOffEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
void setValue(const int v)
Sets the channel aftertouch value.
ClientEvent()
Default constructor.
void setPosition(const uint pos)
Sets the queue position.
int getValue() const
Gets the controller event's value.
ALSA Event representing a change on some ALSA sequencer port on the system.
Event representing a MIDI key pressure, or polyphonic after-touch event.
SubscriptionEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
void setValue(const int v)
Sets the controller event's value.
Event representing a SMF text event.
ALSA Event representing a tempo change for an ALSA queue.
Event representing a MIDI program change event.
PitchBendEvent()
Default constructor.
void setChannel(const MidiByte c)
Sets the channel of the event.
int getDestClient() const
Gets the destination client number.
Base class for the events having a Channel property.
SubscriptionEvent()
Default constructor.
unsigned int getLength() const
Gets the data length.
unsigned char getSourceClient() const
Gets the source client id.
unsigned int getRealTimeSecs() const
Gets the seconds of the event's real time.
int getChannel() const
Gets the event's channel.
void setValue(const int v)
Sets the event's value.
ControllerEvent()
Default constructor.
Auxiliary class to remove events from an ALSA queue.
Class representing a note event with duration.
void setParam(const uint p)
Sets the controller event's parameter.
int m_textType
Clone this object returning a pointer to the new object.
ALSA Event representing a subscription between two ALSA clients and ports.
int getDestPort() const
Gets the destination port number.
QueueControlEvent()
Default constructor.
ValueEvent()
Default constructor.
ChannelEvent()
Default constructor.
uint getSkewValue() const
Gets the skew value.
Event representing a MIDI bender, or pitch wheel event.
#define CLONE_EVENT_DECLARATION(T)
Macro to declare a virtual clone() method for SequencerEvent and derived classes.
ProgramChangeEvent()
Default constructor.
int getPort() const
Gets the port number.
Event representing a note-off MIDI event.
NoteOffEvent()
Default constructor.
Event representing a MIDI channel pressure or after-touch event.
void setValue(const int v)
Sets the MIDI pitch bend value, zero centered from -8192 to 8191.
Event representing a note-on MIDI event.
unsigned int getRealTimeNanos() const
Gets the nanoseconds of the event's real time.
TempoEvent()
Default constructor.
const char * getData() const
Gets the data pointer.
KeyEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
int getKey() const
Gets the MIDI note of this event.
NoteOnEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
int getValue() const
Gets the MIDI pitch bend value, zero centered from -8192 to 8191.
QueueControlEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
The QEvent class is the base class of all event classes.
KeyPressEvent()
Default constructor.
snd_seq_tick_time_t getTickTime() const
Gets the musical time in ticks.
KeyPressEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
ChannelEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
SystemEvent()
Default constructor.
void setKey(const MidiByte b)
Sets the MIDI note of this event.
quint8 MidiByte
8-bit unsigned number to be used as a MIDI message parameter
void setValue(const int val)
Sets the event's value.