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);
unsigned int getTempo()
Gets the queue's tempo in microseconds per beat.
unsigned int getSkewValue()
Gets the tempo skew numerator.
virtual ~QueueInfo()
Destructor.
Error checking functions and macros.
int getId()
Gets the queue's numeric identifier.
void setInfo(const QueueInfo &value)
Applies a QueueInfo object to the queue.
int getInfoSize() const
Gets the size of the ALSA queue timer object.
virtual ~MidiQueue()
Destructor.
void stop()
Stop the queue.
void setUsage(int used)
Sets the queue usage flag.
Classes managing ALSA Sequencer clients.
void setResolution(unsigned int value)
Sets the timer resolution.
void setPPQ(int value)
Sets the queue resolution in parts per quarter note.
snd_seq_queue_timer_type_t getType()
Gets the timer type.
void setFlags(unsigned int value)
Sets the bit flags of the queue.
void setTempo(unsigned int value)
Sets the queue tempo in microseconds per beat.
snd_seq_t * getHandle()
Returns the sequencer handler managed by ALSA.
Queue information container.
#define DRUMSTICK_ALSA_CHECK_WARNING(x)
This macro calls the check warning function.
QueueStatus & operator=(const QueueStatus &other)
Assignment operator.
virtual ~QueueStatus()
Destructor.
float getNominalBPM()
Gets the queue's nominal BPM tempo (in beats per minute)
QueueTimer * clone()
Copy the current object and return the copy.
unsigned int getFlags()
Gets the flags of the queue.
QueueTempo()
Default constructor.
virtual ~QueueTimer()
Destructor.
QueueTimer()
Default constructor.
float getRealBPM()
Gets the queue's real BPM tempo in beats per minute.
QueueInfo * clone()
Copy the current object and return the copy.
void setRealTimePosition(snd_seq_real_time_t *pos)
Sets the queue position in real time (clock) units: seconds and nanoseconds.
The QObject class is the base class of all Qt objects.
snd_seq_tick_time_t getTickTime()
Gets the musical time (ticks) of the queue.
int getInfoSize() const
Gets the size of the ALSA status object.
void setOwner(int value)
Sets the client ID of the owner.
int getPPQ()
Gets the PPQ (parts per quarter note) resolution of the queue.
Classes managing ALSA Timers.
QueueInfo & getInfo()
Gets a QueueInfo object reference.
void setLocked(bool locked)
Sets the locked status of the queue.
unsigned int getSkewBase()
Gets the tempo skew base.
void clear()
Clear the queue, dropping any scheduled events.
int getId()
Gets the queue's numeric identifier.
void setTimer(const QueueTimer &value)
Applies q QueueTimer object to the queue.
QueueTempo * clone()
Copy the current object returning the copied object.
bool isLocked()
Returns the locking status of the queue.
int getId()
Gets the queue's numeric identifier.
QueueTimer & getTimer()
Gets a QueueTimer object reference.
snd_seq_event_t * getHandle()
Gets the handle of the event.
void start()
Start the queue.
double getClockTime()
Gets the clock time in seconds of the queue.
QueueInfo()
Default constructor.
void setTickPosition(snd_seq_tick_time_t pos)
Sets the queue position in musical time (ticks).
QueueTempo & operator=(const QueueTempo &other)
Assignment operator.
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.
int getQueueId()
The queue's numeric identifier.
bool isRunning()
Gets the queue's running state.
ALSA Timer identifier container.
void setTempo(const QueueTempo &value)
Applies a QueueTempo object to the queue.
const unsigned int SKEW_BASE
This is the value for the base skew used in ALSA.
void setSkewValue(unsigned int value)
Sets the tempo skew numerator.
QueueTempo & getTempo()
Gets a QueueTempo object reference.
int getOwner()
Gets the owner's client id of the queue.
QueueTimer & operator=(const QueueTimer &other)
Assignment operator.
void setSkewBase(unsigned int value)
Sets the tempo skew base.
unsigned int getResolution()
Gets the timer resolution.
void setTempoFactor(float value)
Sets the queue's tempo skew factor.
QueueStatus & getStatus()
Gets a QueueStatus object reference.
void outputDirect(SequencerEvent *ev, bool async=false, int timeout=-1)
Output an event directly to the sequencer.
QueueStatus()
Default constructor.
int getEvents()
Gets the number of queued events.
void setType(snd_seq_queue_timer_type_t value)
Sets the timer type.
int getUsage()
Gets the queue usage flag.
unsigned int getStatusBits()
Gets the running status bits.
QueueInfo & operator=(const QueueInfo &other)
Assignment operator.
QString getName()
Gets the queue name.
const snd_timer_id_t * getId()
Gets the timer identifier record.
virtual ~QueueTempo()
Destructor.
MidiQueue(MidiClient *seq, QObject *parent=nullptr)
Constructor.
Classes managing ALSA Sequencer queues.
Classes managing ALSA Sequencer events.
int getInfoSize() const
Gets the size of the ALSA queue tempo object.
void setId(snd_timer_id_t *value)
Sets the timer identifier record.
void setNominalBPM(float value)
Sets the queue's nominal tempo in BPM (beats per minute).
int getInfoSize() const
Gets the size of the ALSA queue info object.
void continueRunning()
Start the queue without resetting the last position.
void setName(QString value)
Sets the queue name.
#define DRUMSTICK_ALSA_CHECK_ERROR(x)
This macro calls the check error function.