drumstick  1.1.0
NoteOnEvent Class Reference

Event representing a note-on MIDI event. More...

#include <alsaevent.h>

Inheritance diagram for NoteOnEvent:

Public Member Functions

 NoteOnEvent ()
 Default constructor.
 
 NoteOnEvent (snd_seq_event_t *event)
 Constructor from an ALSA event record.
 
 NoteOnEvent (const int ch, const int key, const int vel)
 Constructor using proper attribute values. More...
 
int getKey () const
 Gets the MIDI note of this event. More...
 
void setKey (const MidiByte b)
 Sets the MIDI note of this event. More...
 
int getVelocity () const
 Gets the note velocity of this event. More...
 
void setVelocity (const MidiByte b)
 Sets the note velocity of this event. More...
 
void setChannel (const MidiByte c)
 Sets the channel of the event. More...
 
int getChannel () const
 Gets the event's channel. More...
 
void setSequencerType (const snd_seq_event_type_t eventType)
 Sets the event's ALSA sequencer type. More...
 
snd_seq_event_type_t getSequencerType () const
 Gets the sequencer event type. More...
 
void setDestination (const unsigned char client, const unsigned char port)
 Sets the client:port destination of the event. More...
 
void setSource (const unsigned char port)
 Sets the event's source port ID. More...
 
unsigned char getSourceClient () const
 Gets the source client id. More...
 
unsigned char getSourcePort () const
 Gets the source port id. More...
 
snd_seq_tick_time_t getTick () const
 Gets the tick time of the event. More...
 
unsigned int getRealTimeSecs () const
 Gets the seconds of the event's real time. More...
 
unsigned int getRealTimeNanos () const
 Gets the nanoseconds of the event's real time. More...
 
void setSubscribers ()
 Sets the event's destination to be all the subscribers of the source port.
 
void setBroadcast ()
 Sets the event's destination to be all queues/clients/ports/channels.
 
void setDirect ()
 Sets the event to be immediately delivered, not queued/scheduled. More...
 
void scheduleTick (const int queue, const int tick, const bool relative)
 Sets the event to be scheduled in musical time (ticks) units. More...
 
void scheduleReal (const int queue, const ulong secs, const ulong nanos, const bool relative)
 Sets the event to be scheduled in real (clock) time units. More...
 
void setPriority (const bool high)
 Sets the priority of the event. More...
 
unsigned char getTag () const
 Gets the tag of the event. More...
 
void setTag (const unsigned char aTag)
 Sets the event's tag. More...
 
unsigned int getRaw32 (const unsigned int n) const
 Gets an event's raw 32 bits parameter. More...
 
void setRaw32 (const unsigned int n, const unsigned int value)
 Sets an event's raw 32 bits parameter. More...
 
unsigned char getRaw8 (const unsigned int n) const
 Gets an event's raw 8 bits parameter. More...
 
void setRaw8 (const unsigned int n, const unsigned char value)
 Sets an event's raw 8 bits parameter. More...
 
snd_seq_event_t * getHandle ()
 Gets the handle of the event. More...
 
int getEncodedLength ()
 Gets the encoded length of the event record. More...
 
 CLONE_EVENT_DECLARATION (SequencerEvent)
 Clone this object returning a pointer to the new object.
 

Static Public Member Functions

static bool isSubscription (const SequencerEvent *event)
 Checks if the event's type is a subscription. More...
 
static bool isPort (const SequencerEvent *event)
 Checks if the event's type is of type port. More...
 
static bool isClient (const SequencerEvent *event)
 Checks if the event's type is of type client. More...
 
static bool isConnectionChange (const SequencerEvent *event)
 Checks if the event's type is of type connection change. More...
 
static bool isChannel (const SequencerEvent *event)
 Checks if the event's type is a Channel Voice message. More...
 

Protected Member Functions

void free () __attribute__((deprecated))
 Releases the event record. More...
 

Protected Attributes

snd_seq_event_t m_event
 ALSA sequencer event record. More...
 

Detailed Description

Event representing a note-on MIDI event.

Definition at line 238 of file alsaevent.h.

Constructor & Destructor Documentation

NoteOnEvent ( const int  ch,
const int  key,
const int  vel 
)

Constructor using proper attribute values.

Parameters
chMIDI Channel.
keyMIDI note.
velNote velocity.

Definition at line 404 of file alsaevent.cpp.

References SequencerEvent::m_event.

Member Function Documentation

void free ( )
protectedinherited

Releases the event record.

Deprecated:

Definition at line 372 of file alsaevent.cpp.

References SequencerEvent::m_event.

int getChannel ( ) const
inlineinherited

Gets the event's channel.

Returns
The event's channel
See Also
setChannel()

Definition at line 166 of file alsaevent.h.

int getEncodedLength ( )
inherited

Gets the encoded length of the event record.

Returns
The encoded length.

Definition at line 381 of file alsaevent.cpp.

References SequencerEvent::m_event.

snd_seq_event_t* getHandle ( )
inlineinherited
int getKey ( ) const
inlineinherited

Gets the MIDI note of this event.

Returns
The event's MIDI note.
See Also
setKey()

Definition at line 184 of file alsaevent.h.

unsigned int getRaw32 ( const unsigned int  n) const
inherited

Gets an event's raw 32 bits parameter.

Parameters
nThe parameter index, between 0 and 2.
Returns
The parameter's value.
See Also
setRaw32()

Definition at line 330 of file alsaevent.cpp.

References SequencerEvent::m_event.

unsigned char getRaw8 ( const unsigned int  n) const
inherited

Gets an event's raw 8 bits parameter.

Parameters
nThe parameter index, between 0 and 11.
Returns
The parameter's value.
See Also
setRaw8()

Definition at line 352 of file alsaevent.cpp.

References SequencerEvent::m_event.

unsigned int getRealTimeNanos ( ) const
inlineinherited

Gets the nanoseconds of the event's real time.

Returns
The nanoseconds of the time.
See Also
scheduleReal(), getRealTimeSecs()

Definition at line 101 of file alsaevent.h.

unsigned int getRealTimeSecs ( ) const
inlineinherited

Gets the seconds of the event's real time.

Returns
The seconds of the time.
See Also
scheduleReal(), getRealTimeNanos()

Definition at line 95 of file alsaevent.h.

snd_seq_event_type_t getSequencerType ( ) const
inlineinherited

Gets the sequencer event type.

Returns
The sequencer event type.
See Also
setSequencerType()

Definition at line 69 of file alsaevent.h.

unsigned char getSourceClient ( ) const
inlineinherited

Gets the source client id.

Returns
The source client id.
See Also
setSource()

Definition at line 77 of file alsaevent.h.

unsigned char getSourcePort ( ) const
inlineinherited

Gets the source port id.

Returns
The source port id.
See Also
setSource()

Definition at line 83 of file alsaevent.h.

unsigned char getTag ( ) const
inlineinherited

Gets the tag of the event.

Returns
The event's tag
See Also
setTag()

Definition at line 113 of file alsaevent.h.

snd_seq_tick_time_t getTick ( void  ) const
inlineinherited

Gets the tick time of the event.

Returns
The tick time.
See Also
scheduleTick()

Definition at line 89 of file alsaevent.h.

int getVelocity ( ) const
inlineinherited

Gets the note velocity of this event.

Returns
The event's note velocity.
See Also
setVelocity()

Definition at line 196 of file alsaevent.h.

bool isChannel ( const SequencerEvent event)
staticinherited

Checks if the event's type is a Channel Voice message.

Parameters
eventA SequencerEvent object pointer
Returns
True if the event is a channel voice message.
Since
0.2.0

Definition at line 204 of file alsaevent.cpp.

bool isClient ( const SequencerEvent event)
staticinherited

Checks if the event's type is of type client.

Parameters
eventA SequencerEvent object pointer
Returns
True if the event has a client start/exit/change type.

Definition at line 170 of file alsaevent.cpp.

bool isConnectionChange ( const SequencerEvent event)
staticinherited

Checks if the event's type is of type connection change.

Parameters
eventA SequencerEvent object pointer
Returns
True if the event has a client/port/subscription type.

Definition at line 184 of file alsaevent.cpp.

Referenced by SequencerOutputThread::run().

bool isPort ( const SequencerEvent event)
staticinherited

Checks if the event's type is of type port.

Parameters
eventA SequencerEvent object pointer
Returns
True if the event has a port start/exit/change type.

Definition at line 156 of file alsaevent.cpp.

bool isSubscription ( const SequencerEvent event)
staticinherited

Checks if the event's type is a subscription.

Parameters
eventA SequencerEvent object pointer
Returns
True if the event has a subscribe/unsubscribe type.

Definition at line 143 of file alsaevent.cpp.

void scheduleReal ( const int  queue,
const ulong  secs,
const ulong  nanos,
const bool  relative 
)
inherited

Sets the event to be scheduled in real (clock) time units.

Parameters
queueThe queue number to be used.
secsThe time in whole seconds.
nanosThe nanoseconds to be added.
relativeUse relative (to the current) time instead of absolute time.

Definition at line 291 of file alsaevent.cpp.

References SequencerEvent::m_event.

void scheduleTick ( const int  queue,
const int  tick,
const bool  relative 
)
inherited

Sets the event to be scheduled in musical time (ticks) units.

Parameters
queueThe queue number to be used.
tickThe time in ticks.
relativeUse relative (to the current) time instead of absolute time.

Definition at line 279 of file alsaevent.cpp.

References SequencerEvent::m_event.

Referenced by SequencerOutputThread::sendEchoEvent().

void setChannel ( const MidiByte  c)
inlineinherited

Sets the channel of the event.

Parameters
cA channel, between 0 and 15.
See Also
getChannel()

Definition at line 160 of file alsaevent.h.

void setDestination ( const unsigned char  client,
const unsigned char  port 
)
inherited

Sets the client:port destination of the event.

Parameters
clientThe destination's client ID
portThe destination port ID
See Also
setSubscribers()

Definition at line 233 of file alsaevent.cpp.

References SequencerEvent::m_event.

Referenced by SequencerOutputThread::sendEchoEvent().

void setDirect ( )
inherited

Sets the event to be immediately delivered, not queued/scheduled.

See Also
scheduleTick(), scheduleReal()

Definition at line 268 of file alsaevent.cpp.

References SequencerEvent::m_event.

void setKey ( const MidiByte  b)
inlineinherited

Sets the MIDI note of this event.

Parameters
bA MIDI note, between 0 and 127.
See Also
getKey()

Definition at line 190 of file alsaevent.h.

void setPriority ( const bool  high)
inherited

Sets the priority of the event.

This is used in case of several events share the same scheduling time.

Parameters
highMark the event as a high priority one.

Definition at line 305 of file alsaevent.cpp.

References SequencerEvent::m_event.

void setRaw32 ( const unsigned int  n,
const unsigned int  value 
)
inherited

Sets an event's raw 32 bits parameter.

Parameters
nThe parameter index, between 0 and 2.
valueThe parameter's value.

Definition at line 341 of file alsaevent.cpp.

References SequencerEvent::m_event.

void setRaw8 ( const unsigned int  n,
const unsigned char  value 
)
inherited

Sets an event's raw 8 bits parameter.

Parameters
nThe parameter index, between 0 and 11.
valueThe parameter's value.

Definition at line 363 of file alsaevent.cpp.

References SequencerEvent::m_event.

void setSequencerType ( const snd_seq_event_type_t  eventType)
inherited

Sets the event's ALSA sequencer type.

Parameters
eventTypeThe ALSA sequencer type

Definition at line 222 of file alsaevent.cpp.

References SequencerEvent::m_event.

Referenced by SystemEvent::SystemEvent(), TextEvent::TextEvent(), and ValueEvent::ValueEvent().

void setSource ( const unsigned char  port)
inherited

Sets the event's source port ID.

Parameters
portThe source port ID
See Also
getSourceClient(), getSourcePort()

Definition at line 243 of file alsaevent.cpp.

References SequencerEvent::m_event.

Referenced by SequencerOutputThread::sendEchoEvent().

void setTag ( const unsigned char  aTag)
inherited

Sets the event's tag.

This attribute is any arbitrary number, not used by the ALSA library. Range limited to 0 thru 255.

Parameters
aTagA tag number.

Definition at line 315 of file alsaevent.cpp.

References SequencerEvent::m_event.

void setVelocity ( const MidiByte  b)
inlineinherited

Sets the note velocity of this event.

Parameters
bA velocity value, between 0 and 127.
See Also
getVelocity()

Definition at line 202 of file alsaevent.h.

Member Data Documentation


The documentation for this class was generated from the following files: