Go to the documentation of this file.
19 #ifndef DRUMSTICK_ALSAEVENT_H
20 #define DRUMSTICK_ALSAEVENT_H
44 #define CLONE_EVENT_DECLARATION(T) virtual T* clone() { return new T(&m_event); }
62 void setSequencerType(
const snd_seq_event_type_t eventType);
69 void setDestination(
const unsigned char client,
const unsigned char port);
70 void setSource(
const unsigned char port);
88 snd_seq_tick_time_t
getTick()
const {
return m_event.time.tick; }
101 void setSubscribers();
104 void scheduleTick(
const int queue,
const int tick,
const bool relative);
105 void scheduleReal(
const int queue,
const ulong secs,
const ulong nanos,
const bool relative);
106 void setPriority(
const bool high);
112 unsigned char getTag()
const {
return m_event.tag; }
113 void setTag(
const unsigned char aTag);
114 unsigned int getRaw32(
const unsigned int n)
const;
115 void setRaw32(
const unsigned int n,
const unsigned int value);
116 unsigned char getRaw8(
const unsigned int n)
const;
117 void setRaw8(
const unsigned int n,
const unsigned char value);
123 int getEncodedLength();
135 void free() __attribute__((deprecated));
141 snd_seq_event_t m_event;
183 int getKey()
const {
return m_event.data.note.note; }
217 NoteEvent(
const int ch,
const int key,
const int vel,
const int dur);
229 void setDuration(
const ulong d) { m_event.data.note.duration = d; }
244 NoteOnEvent(
const int ch,
const int key,
const int vel);
259 NoteOffEvent(
const int ch,
const int key,
const int vel);
295 uint
getParam()
const {
return m_event.data.control.param; }
301 void setParam(
const uint p ) { m_event.data.control.param = p; }
307 int getValue()
const {
return m_event.data.control.value; }
313 void setValue(
const int v ) { m_event.data.control.value = v; }
330 int getValue()
const {
return m_event.data.control.value; }
332 void setValue(
const int v ) { m_event.data.control.value = v; }
349 int getValue()
const {
return m_event.data.control.value; }
351 void setValue(
const int v ) { m_event.data.control.value = v; }
368 int getValue()
const {
return m_event.data.control.value; }
370 void setValue(
const int v ) { m_event.data.control.value = v; }
388 unsigned int getLength()
const {
return m_event.data.ext.len; }
390 const char*
getData()
const {
return static_cast<const char*
>(m_event.data.ext.ptr); }
407 SysExEvent(
const unsigned int datalen,
char* dataptr);
423 explicit TextEvent(
const QString& text,
const int textType = 1);
425 TextEvent(
const unsigned int datalen,
char* dataptr);
426 QString getText()
const;
427 int getTextType()
const;
461 QueueControlEvent(
const snd_seq_event_type_t type,
const int queue,
const int value);
463 int getQueue()
const {
return m_event.data.queue.queue; }
465 void setQueue(
const uchar q) { m_event.data.queue.queue = q; }
467 int getValue()
const {
return m_event.data.queue.param.value; }
469 void setValue(
const int val) { m_event.data.queue.param.value = val; }
471 uint
getPosition()
const {
return m_event.data.queue.param.position; }
473 void setPosition(
const uint pos) { m_event.data.queue.param.position = pos; }
475 snd_seq_tick_time_t
getTickTime()
const {
return m_event.data.queue.param.time.tick; }
477 void setTickTime(
const snd_seq_tick_time_t t) { m_event.data.queue.param.time.tick = t; }
479 uint
getSkewBase()
const {
return m_event.data.queue.param.skew.base; }
481 void setSkewBase(
const uint base) { m_event.data.queue.param.skew.base = base; }
483 uint
getSkewValue()
const {
return m_event.data.queue.param.skew.value; }
485 void setSkewValue(
const uint val) {m_event.data.queue.param.skew.value = val; }
500 ValueEvent(
const snd_seq_event_type_t type,
const int val);
502 int getValue()
const {
return m_event.data.control.value; }
504 void setValue(
const int v ) { m_event.data.control.value = v; }
535 bool subscribed()
const {
return (m_event.type == SND_SEQ_EVENT_PORT_SUBSCRIBED); }
537 bool unsubscribed()
const {
return (m_event.type == SND_SEQ_EVENT_PORT_UNSUBSCRIBED); }
545 int getDestPort()
const {
return m_event.data.connect.dest.port; }
560 int getClient()
const {
return m_event.data.addr.client; }
576 int getPort()
const {
return m_event.data.addr.port; }
598 int getSizeOfInfo()
const;
601 unsigned int getCondition();
602 const snd_seq_addr_t* getDest();
606 const snd_seq_timestamp_t* getTime();
607 void setChannel(
int chan);
608 void setCondition(
unsigned int cond);
609 void setDest(
const snd_seq_addr_t* dest);
610 void setEventType(
int type);
611 void setQueue(
int queue);
612 void setTag(
int tag);
613 void setTime(
const snd_seq_timestamp_t* time);
616 snd_seq_remove_events_t* m_Info;
630 long decode(
unsigned char *buf,
632 const snd_seq_event_t *ev);
633 long encode(
const unsigned char *buf,
635 snd_seq_event_t *ev);
637 snd_seq_event_t *ev);
638 void enableRunningStatus(
bool enable);
641 void resizeBuffer(
int bufsize);
643 snd_midi_event_t* m_Info;
650 #endif //DRUMSTICK_ALSAEVENT_H
void setValue(const int v)
Sets the channel aftertouch value.
The QObject class is the base class of all Qt objects.
PitchBendEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
uint getSkewBase() const
Gets the skew base.
ProgramChangeEvent()
Default constructor.
snd_seq_tick_time_t getTickTime() const
Gets the musical time in ticks.
SubscriptionEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
SystemEvent()
Default constructor.
int m_textType
Clone this object returning a pointer to the new object.
uint getParam() const
Gets the controller event's parameter.
Event representing a MIDI control change event.
The QEvent class is the base class of all event classes.
void setValue(const int v)
Sets the MIDI program number.
void setSkewValue(const uint val)
Sets the skew value.
snd_seq_tick_time_t getTick() const
Gets the tick time of the event.
Event representing a MIDI system exclusive event.
uint getPosition() const
Gets the queue position.
KeyEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
Base class for the events having a Channel property.
Base class for the event's hierarchy.
QueueControlEvent()
Default constructor.
ProgramChangeEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
KeyEvent()
Default constructor.
#define CLONE_EVENT_DECLARATION(T)
Macro to declare a virtual clone() method for SequencerEvent and derived classes.
int getPort() const
Gets the port number.
ChanPressEvent()
Default constructor.
int getValue() const
Gets the channel aftertouch value.
ALSA Event representing a change on some ALSA sequencer client on the system.
void setPosition(const uint pos)
Sets the queue position.
int getVelocity() const
Gets the note velocity of this event.
int getValue() const
Gets the event's value.
void setParam(const uint p)
Sets the controller event's parameter.
ClientEvent()
Default constructor.
Event representing a MIDI program change event.
void setKey(const MidiByte b)
Sets the MIDI note of this event.
void setSkewBase(const uint base)
Sets the skew base, should be 65536.
unsigned int getRealTimeNanos() const
Gets the nanoseconds of the event's real time.
QueueControlEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
SystemEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
ALSA Event representing a change on some ALSA sequencer port on the system.
PortEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
Event representing a SMF text event.
virtual ~SequencerEvent()
Destructor.
int getChannel() const
Gets the event's channel.
ALSA Event representing a subscription between two ALSA clients and ports.
SubscriptionEvent()
Default constructor.
snd_seq_event_type_t getSequencerType() const
Gets the sequencer event type.
const char * getData() const
Gets the data pointer.
Class representing a note event with duration.
NoteOnEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
PortEvent()
Default constructor.
int getKey() const
Gets the MIDI note of this event.
int getValue() const
Gets the MIDI pitch bend value, zero centered from -8192 to 8191.
int getValue() const
Gets the MIDI program number.
PitchBendEvent()
Default constructor.
void setTickTime(const snd_seq_tick_time_t t)
Sets the musical time in ticks.
unsigned char getTag() const
Gets the tag of the event.
KeyPressEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
Auxiliary class to remove events from an ALSA queue.
unsigned char getSourceClient() const
Gets the source client id.
void setValue(const int v)
Sets the event's value.
void setChannel(const MidiByte c)
Sets the channel of the event.
uint getSkewValue() const
Gets the skew value.
QByteArray m_data
Clone this object returning a pointer to the new object.
Generic event having a value property.
NoteOffEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
Event representing a MIDI key pressure, or polyphonic after-touch event.
NoteOffEvent()
Default constructor.
void setVelocity(const MidiByte b)
Sets the note velocity of this event.
bool subscribed() const
Returns true if the event was a subscribed port.
void setQueue(const uchar q)
Sets the queue number.
bool unsubscribed() const
Returns true if the event was an unsubscribed port.
snd_seq_event_t * getHandle()
Gets the handle of the event.
void setDuration(const ulong d)
Sets the note's duration.
ChannelEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
ValueEvent()
Default constructor.
Event representing a MIDI bender, or pitch wheel event.
ChannelEvent()
Default constructor.
NoteEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
ulong getDuration() const
Gets the note's duration.
int getQueue() const
Gets the queue number.
void setValue(const int val)
Sets the event's value.
unsigned int getRealTimeSecs() const
Gets the seconds of the event's real time.
Event representing a note-on MIDI event.
int getDestClient() const
Gets the destination client number.
ALSA Event representing a queue control command.
void setValue(const int v)
Sets the controller event's value.
ALSA Event representing a tempo change for an ALSA queue.
int getDestPort() const
Gets the destination port number.
Event representing a note-off MIDI event.
int getValue() const
Gets the event's value.
const QEvent::Type SequencerEventType
Constant SequencerEventType is the QEvent::type() of any SequencerEvent object to be used to check th...
quint8 MidiByte
8-bit unsigned number to be used as a MIDI message parameter
Auxiliary class to translate between raw MIDI streams and ALSA events.
TempoEvent()
Default constructor.
ClientEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
int getValue() const
Gets the controller event's value.
int getSenderPort() const
Gets the sender port number.
unsigned char getSourcePort() const
Gets the source port id.
Base class for variable length events.
NoteOnEvent()
Default constructor.
ChanPressEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
unsigned int getLength() const
Gets the data length.
CLONE_EVENT_DECLARATION(SequencerEvent)
Clone this object returning a pointer to the new object.
int getSenderClient() const
Gets the sender client number.
TempoEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
ValueEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
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
ControllerEvent(snd_seq_event_t *event)
Constructor from an ALSA event record.
KeyPressEvent()
Default constructor.
Base class for the events having Key and Velocity properties.
NoteEvent()
Default constructor.
ControllerEvent()
Default constructor.