69 snd_seq_queue_info_malloc(&m_Info);
78 snd_seq_queue_info_malloc(&m_Info);
79 snd_seq_queue_info_copy(m_Info, other);
88 snd_seq_queue_info_malloc(&m_Info);
89 snd_seq_queue_info_copy(m_Info, other.m_Info);
97 snd_seq_queue_info_free(m_Info);
118 snd_seq_queue_info_copy(m_Info, other.m_Info);
128 return snd_seq_queue_info_get_queue(m_Info);
137 return QString(snd_seq_queue_info_get_name(m_Info));
146 return snd_seq_queue_info_get_owner(m_Info);
155 return (snd_seq_queue_info_get_locked(m_Info) != 0);
164 return snd_seq_queue_info_get_flags(m_Info);
173 snd_seq_queue_info_set_name(m_Info, value.toLocal8Bit().data());
182 snd_seq_queue_info_set_owner(m_Info, value);
191 snd_seq_queue_info_set_flags(m_Info, value);
200 snd_seq_queue_info_set_locked(m_Info, locked ? 1 : 0);
209 return snd_seq_queue_info_sizeof();
218 snd_seq_queue_status_malloc(&m_Info);
227 snd_seq_queue_status_malloc(&m_Info);
228 snd_seq_queue_status_copy(m_Info, other);
237 snd_seq_queue_status_malloc(&m_Info);
238 snd_seq_queue_status_copy(m_Info, other.m_Info);
246 snd_seq_queue_status_free(m_Info);
267 snd_seq_queue_status_copy(m_Info, other.m_Info);
277 return snd_seq_queue_status_get_queue(m_Info);
286 return snd_seq_queue_status_get_events(m_Info);
295 return snd_seq_queue_status_get_real_time(m_Info);
304 return snd_seq_queue_status_get_status(m_Info);
313 return snd_seq_queue_status_get_tick_time(m_Info);
322 return snd_seq_queue_status_sizeof();
331 return (snd_seq_queue_status_get_status(m_Info) != 0);
340 const snd_seq_real_time_t* time = snd_seq_queue_status_get_real_time(m_Info);
341 return (time->tv_sec * 1.0) + (time->tv_nsec * 1.0e-9);
349 snd_seq_queue_tempo_malloc(&m_Info);
358 snd_seq_queue_tempo_malloc(&m_Info);
359 snd_seq_queue_tempo_copy(m_Info, other);
368 snd_seq_queue_tempo_malloc(&m_Info);
369 snd_seq_queue_tempo_copy(m_Info, other.m_Info);
377 snd_seq_queue_tempo_free(m_Info);
398 snd_seq_queue_tempo_copy(m_Info, other.m_Info);
408 return snd_seq_queue_tempo_get_queue(m_Info);
417 return snd_seq_queue_tempo_get_ppq(m_Info);
428 return snd_seq_queue_tempo_get_skew(m_Info);
439 return snd_seq_queue_tempo_get_skew_base(m_Info);
448 return snd_seq_queue_tempo_get_tempo(m_Info);
457 snd_seq_queue_tempo_set_ppq(m_Info, value);
468 snd_seq_queue_tempo_set_skew(m_Info, value);
480 snd_seq_queue_tempo_set_skew_base(m_Info, value);
489 snd_seq_queue_tempo_set_tempo(m_Info, value);
500 return 6.0e7f / itempo;
540 return snd_seq_queue_tempo_sizeof();
548 snd_seq_queue_timer_malloc(&m_Info);
557 snd_seq_queue_timer_malloc(&m_Info);
558 snd_seq_queue_timer_copy(m_Info, other);
567 snd_seq_queue_timer_malloc(&m_Info);
568 snd_seq_queue_timer_copy(m_Info, other.m_Info);
576 snd_seq_queue_timer_free(m_Info);
597 snd_seq_queue_timer_copy(m_Info, other.m_Info);
607 return snd_seq_queue_timer_get_queue(m_Info);
624 return snd_seq_queue_timer_get_type(m_Info);
633 return snd_seq_queue_timer_get_id(m_Info);
642 return snd_seq_queue_timer_get_resolution(m_Info);
658 snd_seq_queue_timer_set_type(m_Info, value);
667 snd_seq_queue_timer_set_id(m_Info, value);
686 snd_seq_queue_timer_set_resolution(m_Info, value);
695 return snd_seq_queue_timer_sizeof();
708 m_allocated = !(m_Id < 0);
723 m_allocated = !(m_Id < 0);
737 m_allocated = !(m_Id < 0);
761 if ( m_allocated && (m_MidiClient->
getHandle() !=
nullptr) )
875 if (m_MidiClient !=
nullptr && m_MidiClient->
getHandle() !=
nullptr) {
897 if (m_MidiClient !=
nullptr && m_MidiClient->
getHandle() !=
nullptr)
898 snd_seq_drop_output(m_MidiClient->
getHandle());
908 snd_seq_ev_set_queue_pos_tick(event.
getHandle(), m_Id, pos);
920 snd_seq_ev_set_queue_pos_real(event.
getHandle(), m_Id, pos);
Classes managing ALSA Sequencer clients.
Classes managing ALSA Sequencer events.
Classes managing ALSA Sequencer queues.
Classes managing ALSA Timers.
The QObject class is the base class of all Qt objects.
void setTimer(const QueueTimer &value)
Applies q QueueTimer object to the queue.
void setInfo(const QueueInfo &value)
Applies a QueueInfo object to the queue.
int getUsage()
Gets the queue usage flag.
void setTickPosition(snd_seq_tick_time_t pos)
Sets the queue position in musical time (ticks).
void continueRunning()
Start the queue without resetting the last position.
QueueTimer & getTimer()
Gets a QueueTimer object reference.
QueueStatus & getStatus()
Gets a QueueStatus object reference.
void start()
Start the queue.
void stop()
Stop the queue.
MidiQueue(MidiClient *seq, QObject *parent=nullptr)
Constructor.
void setRealTimePosition(snd_seq_real_time_t *pos)
Sets the queue position in real time (clock) units: seconds and nanoseconds.
void clear()
Clear the queue, dropping any scheduled events.
QueueInfo & getInfo()
Gets a QueueInfo object reference.
virtual ~MidiQueue()
Destructor.
QueueTempo & getTempo()
Gets a QueueTempo object reference.
void setUsage(int used)
Sets the queue usage flag.
void setTempo(const QueueTempo &value)
Applies a QueueTempo object to the queue.
Queue information container.
bool isLocked()
Returns the locking status of the queue.
int getInfoSize() const
Gets the size of the ALSA queue info object.
unsigned int getFlags()
Gets the flags of the queue.
void setLocked(bool locked)
Sets the locked status of the queue.
int getOwner()
Gets the owner's client id of the queue.
virtual ~QueueInfo()
Destructor.
QueueInfo()
Default constructor.
int getId()
Gets the queue's numeric identifier.
QueueInfo * clone()
Copy the current object and return the copy.
void setFlags(unsigned int value)
Sets the bit flags of the queue.
QString getName()
Gets the queue name.
void setName(QString value)
Sets the queue name.
QueueInfo & operator=(const QueueInfo &other)
Assignment operator.
void setOwner(int value)
Sets the client ID of the owner.
int getInfoSize() const
Gets the size of the ALSA status object.
bool isRunning()
Gets the queue's running state.
int getEvents()
Gets the number of queued events.
int getId()
Gets the queue's numeric identifier.
QueueStatus * clone()
Copy the current object and return the copy.
const snd_seq_real_time_t * getRealtime()
Gets the real time (secods and nanoseconds) of the queue.
QueueStatus()
Default constructor.
snd_seq_tick_time_t getTickTime()
Gets the musical time (ticks) of the queue.
double getClockTime()
Gets the clock time in seconds of the queue.
QueueStatus & operator=(const QueueStatus &other)
Assignment operator.
virtual ~QueueStatus()
Destructor.
unsigned int getStatusBits()
Gets the running status bits.
int getInfoSize() const
Gets the size of the ALSA queue tempo object.
void setSkewValue(unsigned int value)
Sets the tempo skew numerator.
int getId()
Gets the queue's numeric identifier.
void setPPQ(int value)
Sets the queue resolution in parts per quarter note.
unsigned int getTempo()
Gets the queue's tempo in microseconds per beat.
QueueTempo()
Default constructor.
void setTempo(unsigned int value)
Sets the queue tempo in microseconds per beat.
float getRealBPM()
Gets the queue's real BPM tempo in beats per minute.
unsigned int getSkewValue()
Gets the tempo skew numerator.
float getNominalBPM()
Gets the queue's nominal BPM tempo (in beats per minute)
unsigned int getSkewBase()
Gets the tempo skew base.
QueueTempo * clone()
Copy the current object returning the copied object.
void setSkewBase(unsigned int value)
Sets the tempo skew base.
void setNominalBPM(float value)
Sets the queue's nominal tempo in BPM (beats per minute).
virtual ~QueueTempo()
Destructor.
int getPPQ()
Gets the PPQ (parts per quarter note) resolution of the queue.
QueueTempo & operator=(const QueueTempo &other)
Assignment operator.
void setTempoFactor(float value)
Sets the queue's tempo skew factor.
int getInfoSize() const
Gets the size of the ALSA queue timer object.
snd_seq_queue_timer_type_t getType()
Gets the timer type.
const snd_timer_id_t * getId()
Gets the timer identifier record.
QueueTimer()
Default constructor.
QueueTimer & operator=(const QueueTimer &other)
Assignment operator.
void setResolution(unsigned int value)
Sets the timer resolution.
QueueTimer * clone()
Copy the current object and return the copy.
unsigned int getResolution()
Gets the timer resolution.
int getQueueId()
The queue's numeric identifier.
void setId(snd_timer_id_t *value)
Sets the timer identifier record.
void setType(snd_seq_queue_timer_type_t value)
Sets the timer type.
virtual ~QueueTimer()
Destructor.
snd_seq_event_t * getHandle()
Gets the handle of the event.
ALSA Timer identifier container.
Error checking functions and macros.
snd_seq_t * getHandle()
Returns the sequencer handler managed by ALSA.
void outputDirect(SequencerEvent *ev, bool async=false, int timeout=-1)
Output an event directly to the sequencer.
#define DRUMSTICK_ALSA_CHECK_WARNING(x)
This macro calls the check warning function.
#define DRUMSTICK_ALSA_CHECK_ERROR(x)
This macro calls the check error function.
const unsigned int SKEW_BASE
This is the value for the base skew used in ALSA.