145 snd_seq_event_type_t te =
event->getSequencerType();
146 return ( te == SND_SEQ_EVENT_PORT_SUBSCRIBED ||
147 te == SND_SEQ_EVENT_PORT_UNSUBSCRIBED );
158 snd_seq_event_type_t te =
event->getSequencerType();
159 return ( te == SND_SEQ_EVENT_PORT_START ||
160 te == SND_SEQ_EVENT_PORT_EXIT ||
161 te == SND_SEQ_EVENT_PORT_CHANGE );
172 snd_seq_event_type_t te =
event->getSequencerType();
173 return ( te == SND_SEQ_EVENT_CLIENT_START ||
174 te == SND_SEQ_EVENT_CLIENT_EXIT ||
175 te == SND_SEQ_EVENT_CLIENT_CHANGE );
186 snd_seq_event_type_t te =
event->getSequencerType();
187 return ( te == SND_SEQ_EVENT_PORT_START ||
188 te == SND_SEQ_EVENT_PORT_EXIT ||
189 te == SND_SEQ_EVENT_PORT_CHANGE ||
190 te == SND_SEQ_EVENT_CLIENT_START ||
191 te == SND_SEQ_EVENT_CLIENT_EXIT ||
192 te == SND_SEQ_EVENT_CLIENT_CHANGE ||
193 te == SND_SEQ_EVENT_PORT_SUBSCRIBED ||
194 te == SND_SEQ_EVENT_PORT_UNSUBSCRIBED );
206 snd_seq_event_type_t te =
event->getSequencerType();
207 return ( te == SND_SEQ_EVENT_NOTEOFF ||
208 te == SND_SEQ_EVENT_NOTEON ||
209 te == SND_SEQ_EVENT_NOTE ||
210 te == SND_SEQ_EVENT_KEYPRESS ||
211 te == SND_SEQ_EVENT_CONTROLLER ||
212 te == SND_SEQ_EVENT_CONTROL14 ||
213 te == SND_SEQ_EVENT_PGMCHANGE ||
214 te == SND_SEQ_EVENT_CHANPRESS ||
215 te == SND_SEQ_EVENT_PITCHBEND );
235 snd_seq_ev_set_dest(&
m_event, client, port);
245 snd_seq_ev_set_source(&
m_event, port);
261 snd_seq_ev_set_broadcast(&
m_event);
270 snd_seq_ev_set_direct(&
m_event);
281 snd_seq_ev_schedule_tick(&
m_event, queue, relative, tick);
293 snd_seq_real_time_t rtime;
295 rtime.tv_nsec = nanos;
296 snd_seq_ev_schedule_real(&
m_event, queue, relative, &rtime);
307 snd_seq_ev_set_priority(&
m_event, high);
317 #if SND_LIB_VERSION > 0x010008 318 snd_seq_ev_set_tag(&
m_event, aTag);
332 if (n < 3)
return m_event.data.raw32.d[n];
343 if (n < 3)
m_event.data.raw32.d[n] = value;
354 if (n < 12)
return m_event.data.raw8.d[n];
365 if (n < 12)
m_event.data.raw8.d[n] = value;
383 return snd_seq_event_length(&
m_event);
395 snd_seq_ev_set_note(&
m_event, ch, key, vel, dur);
406 snd_seq_ev_set_noteon(&
m_event, ch, key, vel);
417 snd_seq_ev_set_noteoff(&
m_event, ch, key, vel);
428 snd_seq_ev_set_keypress(&
m_event, ch, key, vel);
439 snd_seq_ev_set_controller(&
m_event, ch, cc, val);
449 snd_seq_ev_set_pgmchange(&
m_event, ch, val);
459 snd_seq_ev_set_pitchbend(&
m_event, ch, val);
469 snd_seq_ev_set_chanpress(&
m_event, ch, val);
489 m_data = QByteArray((
char *) event->data.ext.ptr,
490 event->data.ext.len);
524 m_data = QByteArray(dataptr, datalen);
667 snd_seq_ev_set_fixed(&
m_event);
680 snd_seq_ev_set_queue_control(&
m_event, type, queue, value);
690 snd_seq_ev_set_fixed(&
m_event);
702 snd_seq_ev_set_queue_tempo(&
m_event, queue, tempo);
710 snd_seq_remove_events_malloc(&m_Info);
719 snd_seq_remove_events_malloc(&m_Info);
720 snd_seq_remove_events_copy(m_Info, other.m_Info);
729 snd_seq_remove_events_malloc(&m_Info);
730 snd_seq_remove_events_copy(m_Info, other);
738 snd_seq_remove_events_free(m_Info);
759 snd_seq_remove_events_copy(m_Info, other.m_Info);
770 return snd_seq_remove_events_sizeof();
781 return snd_seq_remove_events_get_channel(m_Info);
792 return snd_seq_remove_events_get_condition(m_Info);
800 const snd_seq_addr_t*
803 return snd_seq_remove_events_get_dest(m_Info);
814 return snd_seq_remove_events_get_event_type(m_Info);
825 return snd_seq_remove_events_get_queue(m_Info);
836 return snd_seq_remove_events_get_tag(m_Info);
844 const snd_seq_timestamp_t*
847 return snd_seq_remove_events_get_time(m_Info);
858 snd_seq_remove_events_set_channel(m_Info, chan);
882 snd_seq_remove_events_set_condition(m_Info, cond);
893 snd_seq_remove_events_set_dest(m_Info, dest);
904 snd_seq_remove_events_set_event_type(m_Info, type);
915 snd_seq_remove_events_set_queue(m_Info, queue);
926 snd_seq_remove_events_set_tag(m_Info, tag);
937 snd_seq_remove_events_set_time(m_Info, time);
955 snd_midi_event_free(m_Info);
964 snd_midi_event_init(m_Info);
977 const snd_seq_event_t *ev)
979 return CHECK_WARNING(snd_midi_event_decode(m_Info, buf, count, ev));
994 return CHECK_WARNING(snd_midi_event_encode(m_Info, buf, count, ev));
1005 snd_seq_event_t *ev)
1007 return CHECK_WARNING(snd_midi_event_encode_byte(m_Info, c, ev));
1017 snd_midi_event_no_status(m_Info, enable ? 0 : 1);
1026 snd_midi_event_reset_decode(m_Info);
1035 snd_midi_event_reset_encode(m_Info);
1045 CHECK_WARNING(snd_midi_event_resize_buffer(m_Info, bufsize));
QString getText() const
Gets the event's text content.
void setSequencerType(const snd_seq_event_type_t eventType)
Sets the event's ALSA sequencer type.
ALSA Event representing a queue control command.
void resetDecoder()
Reset MIDI decode parser.
void setChannel(int chan)
Gets the MIDI channel.
void init()
CODEC initialization.
Base class for the events having Key and Velocity properties.
void setDirect()
Sets the event to be immediately delivered, not queued/scheduled.
void setTime(const snd_seq_timestamp_t *time)
Sets the timestamp.
void setEventType(int type)
Sets the event type.
ChanPressEvent()
Default constructor.
void setQueue(int queue)
Sets the queue number.
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.
const snd_seq_addr_t * getDest()
Gets the destination.
static bool isPort(const SequencerEvent *event)
Checks if the event's type is of type port.
void free() __attribute__((deprecated))
Releases the event record.
Base class for variable length events.
static bool isConnectionChange(const SequencerEvent *event)
Checks if the event's type is of type connection change.
RemoveEvents * clone()
Create a new object copied from this object and return a pointer to the copy.
The QObject class is the base class of all Qt objects.
Base class for the event's hierarchy.
Event representing a MIDI system exclusive event.
VariableEvent()
Default constructor.
long encode(const unsigned char *buf, long count, snd_seq_event_t *ev)
Encode from byte stream.
unsigned int getCondition()
Gets the condition.
VariableEvent & operator=(const VariableEvent &other)
Assignment operator.
void setTag(int tag)
Sets the numeric tag.
NoteOnEvent()
Default constructor.
NoteEvent()
Default constructor.
void setRaw8(const unsigned int n, const unsigned char value)
Sets an event's raw 8 bits parameter.
virtual ~RemoveEvents()
Destructor.
int getEventType()
Gets the event type.
Event representing a SMF text event.
SequencerEvent & operator=(const SequencerEvent &other)
Assignment operator.
void enableRunningStatus(bool enable)
Enable MIDI running status (command merge)
void scheduleTick(const int queue, const int tick, const bool relative)
Sets the event to be scheduled in musical time (ticks) units.
PitchBendEvent()
Default constructor.
void resizeBuffer(int bufsize)
Resize the CODEC buffer.
Base class for the events having a Channel property.
void setSource(const unsigned char port)
Sets the event's source port ID.
int getTag()
Gets the numeric tag.
int getChannel()
Gets the MIDI channel.
void setPriority(const bool high)
Sets the priority of the event.
void setValue(const int v)
Sets the event's value.
ControllerEvent()
Default constructor.
Auxiliary class to remove events from an ALSA queue.
const snd_seq_timestamp_t * getTime()
Gets the timestamp.
void resetEncoder()
Reset MIDI encode parser.
void setRaw32(const unsigned int n, const unsigned int value)
Sets an event's raw 32 bits parameter.
int m_textType
Clone this object returning a pointer to the new object.
static bool isSubscription(const SequencerEvent *event)
Checks if the event's type is a subscription.
unsigned int getRaw32(const unsigned int n) const
Gets an event's raw 32 bits parameter.
QueueControlEvent()
Default constructor.
ValueEvent()
Default constructor.
static bool isChannel(const SequencerEvent *event)
Checks if the event's type is a Channel Voice message.
MidiCodec(int bufsize, QObject *parent=0)
MidiCodec constructor.
void setTag(const unsigned char aTag)
Sets the event's tag.
SysExEvent()
Default constructor.
void setBroadcast()
Sets the event's destination to be all queues/clients/ports/channels.
void setCondition(unsigned int cond)
Sets the flags of the conditional event's removal.
RemoveEvents()
Default constructor.
int getTextType() const
Gets the event's SMF text type.
ProgramChangeEvent()
Default constructor.
NoteOffEvent()
Default constructor.
unsigned char getRaw8(const unsigned int n) const
Gets an event's raw 8 bits parameter.
long decode(unsigned char *buf, long count, const snd_seq_event_t *ev)
Decode from event to bytes.
TempoEvent()
Default constructor.
void setSubscribers()
Sets the event's destination to be all the subscribers of the source port.
snd_seq_event_t m_event
ALSA sequencer event record.
void setDest(const snd_seq_addr_t *dest)
Set the destination address.
#define CHECK_ERROR(x)
This macro calls the check error function.
#define CHECK_WARNING(x)
This macro calls the check warning function.
static bool isClient(const SequencerEvent *event)
Checks if the event's type is of type client.
The QEvent class is the base class of all event classes.
int getQueue()
Gets the queue number.
TextEvent()
Default constructor.
int getEncodedLength()
Gets the encoded length of the event record.
Classes managing ALSA Sequencer events.
KeyPressEvent()
Default constructor.
SequencerEvent()
Default constructor.
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.
SystemEvent()
Default constructor.
int getSizeOfInfo() const
Gets the allocated size of the ALSA remove events object.
RemoveEvents & operator=(const RemoveEvents &other)
Assignment operator.
void setDestination(const unsigned char client, const unsigned char port)
Sets the client:port destination of the event.