62 snd_seq_queue_info_malloc(&m_Info);
71 snd_seq_queue_info_malloc(&m_Info);
72 snd_seq_queue_info_copy(m_Info, other);
81 snd_seq_queue_info_malloc(&m_Info);
82 snd_seq_queue_info_copy(m_Info, other.m_Info);
90 snd_seq_queue_info_free(m_Info);
109 snd_seq_queue_info_copy(m_Info, other.m_Info);
119 return snd_seq_queue_info_get_queue(m_Info);
128 return QString(snd_seq_queue_info_get_name(m_Info));
137 return snd_seq_queue_info_get_owner(m_Info);
146 return (snd_seq_queue_info_get_locked(m_Info) != 0);
155 return snd_seq_queue_info_get_flags(m_Info);
164 snd_seq_queue_info_set_name(m_Info, value.toLocal8Bit().data());
173 snd_seq_queue_info_set_owner(m_Info, value);
182 snd_seq_queue_info_set_flags(m_Info, value);
191 snd_seq_queue_info_set_locked(m_Info, locked ? 1 : 0);
200 return snd_seq_queue_info_sizeof();
209 snd_seq_queue_status_malloc(&m_Info);
218 snd_seq_queue_status_malloc(&m_Info);
219 snd_seq_queue_status_copy(m_Info, other);
228 snd_seq_queue_status_malloc(&m_Info);
229 snd_seq_queue_status_copy(m_Info, other.m_Info);
237 snd_seq_queue_status_free(m_Info);
256 snd_seq_queue_status_copy(m_Info, other.m_Info);
266 return snd_seq_queue_status_get_queue(m_Info);
275 return snd_seq_queue_status_get_events(m_Info);
284 return snd_seq_queue_status_get_real_time(m_Info);
293 return snd_seq_queue_status_get_status(m_Info);
302 return snd_seq_queue_status_get_tick_time(m_Info);
311 return snd_seq_queue_status_sizeof();
320 return (snd_seq_queue_status_get_status(m_Info) != 0);
329 const snd_seq_real_time_t* time = snd_seq_queue_status_get_real_time(m_Info);
330 return (time->tv_sec * 1.0) + (time->tv_nsec * 1.0e-9);
338 snd_seq_queue_tempo_malloc(&m_Info);
347 snd_seq_queue_tempo_malloc(&m_Info);
348 snd_seq_queue_tempo_copy(m_Info, other);
357 snd_seq_queue_tempo_malloc(&m_Info);
358 snd_seq_queue_tempo_copy(m_Info, other.m_Info);
366 snd_seq_queue_tempo_free(m_Info);
385 snd_seq_queue_tempo_copy(m_Info, other.m_Info);
395 return snd_seq_queue_tempo_get_queue(m_Info);
404 return snd_seq_queue_tempo_get_ppq(m_Info);
415 return snd_seq_queue_tempo_get_skew(m_Info);
426 return snd_seq_queue_tempo_get_skew_base(m_Info);
435 return snd_seq_queue_tempo_get_tempo(m_Info);
444 snd_seq_queue_tempo_set_ppq(m_Info, value);
455 snd_seq_queue_tempo_set_skew(m_Info, value);
467 snd_seq_queue_tempo_set_skew_base(m_Info, value);
476 snd_seq_queue_tempo_set_tempo(m_Info, value);
485 int itempo = getTempo();
487 return 6.0e7f / itempo;
498 float tempo = getNominalBPM();
499 return tempo * getSkewValue() /
SKEW_BASE;
518 setTempo(floor(6.0e7f / value));
527 return snd_seq_queue_tempo_sizeof();
535 snd_seq_queue_timer_malloc(&m_Info);
544 snd_seq_queue_timer_malloc(&m_Info);
545 snd_seq_queue_timer_copy(m_Info, other);
554 snd_seq_queue_timer_malloc(&m_Info);
555 snd_seq_queue_timer_copy(m_Info, other.m_Info);
563 snd_seq_queue_timer_free(m_Info);
582 snd_seq_queue_timer_copy(m_Info, other.m_Info);
592 return snd_seq_queue_timer_get_queue(m_Info);
609 return snd_seq_queue_timer_get_type(m_Info);
618 return snd_seq_queue_timer_get_id(m_Info);
627 return snd_seq_queue_timer_get_resolution(m_Info);
643 snd_seq_queue_timer_set_type(m_Info, value);
652 snd_seq_queue_timer_set_id(m_Info, value);
671 snd_seq_queue_timer_set_resolution(m_Info, value);
680 return snd_seq_queue_timer_sizeof();
693 m_allocated = !(m_Id < 0);
708 m_allocated = !(m_Id < 0);
721 m_Id =
CHECK_ERROR(snd_seq_alloc_named_queue(m_MidiClient->
getHandle(), name.toLocal8Bit().data()));
722 m_allocated = !(m_Id < 0);
746 if ( m_allocated && (m_MidiClient->
getHandle() != NULL) )
860 if (m_MidiClient != NULL && m_MidiClient->
getHandle() != NULL) {
882 if (m_MidiClient != NULL && m_MidiClient->
getHandle() != NULL)
883 snd_seq_drop_output(m_MidiClient->
getHandle());
893 snd_seq_ev_set_queue_pos_tick(event.
getHandle(), m_Id, pos);
905 snd_seq_ev_set_queue_pos_real(event.
getHandle(), m_Id, pos);
void setTimer(const QueueTimer &value)
Applies q QueueTimer object to the queue.
snd_seq_event_t * getHandle()
Gets the handle of the event.
virtual ~QueueTempo()
Destructor.
void setPPQ(int value)
Sets the queue resolution in parts per quarter note.
void setTickPosition(snd_seq_tick_time_t pos)
Sets the queue position in musical time (ticks).
virtual ~QueueStatus()
Destructor.
int getInfoSize() const
Gets the size of the ALSA queue timer object.
#define SKEW_BASE
This is the value for the base skew used in ALSA.
Classes managing ALSA Sequencer clients.
void continueRunning()
Start the queue without resetting the last position.
void setLocked(bool locked)
Sets the locked status of the queue.
float getRealBPM()
Gets the queue's real BPM tempo in beats per minute.
void setTempo(const QueueTempo &value)
Applies a QueueTempo object to the queue.
void clear()
Clear the queue, dropping any scheduled events.
int getId()
Gets the queue's numeric identifier.
bool isRunning()
Gets the queue's running state.
QueueInfo()
Default constructor.
void setFlags(unsigned int value)
Sets the bit flags of the queue.
void start()
Start the queue.
void setNominalBPM(float value)
Sets the queue's nominal tempo in BPM (beats per minute).
void setTempoFactor(float value)
Sets the queue's tempo skew factor.
int getPPQ()
Gets the PPQ (parts per quarter note) resolution of the queue.
snd_seq_tick_time_t getTickTime()
Gets the musical time (ticks) of the queue.
void stop()
Stop the queue.
unsigned int getStatusBits()
Gets the running status bits.
void setRealTimePosition(snd_seq_real_time_t *pos)
Sets the queue position in real time (clock) units: seconds and nanoseconds.
int getUsage()
Gets the queue usage flag.
void setName(QString value)
Sets the queue name.
float getNominalBPM()
Gets the queue's nominal BPM tempo (in beats per minute)
QueueStatus & getStatus()
Gets a QueueStatus object reference.
The QObject class is the base class of all Qt objects.
QueueTimer & getTimer()
Gets a QueueTimer object reference.
Classes managing ALSA Timers.
double getClockTime()
Gets the clock time in seconds of the queue.
int getOwner()
Gets the owner's client id of the queue.
int getEvents()
Gets the number of queued events.
MidiQueue(MidiClient *seq, QObject *parent=0)
Constructor.
QueueTempo()
Default constructor.
snd_seq_t * getHandle()
Returns the sequencer handler managed by ALSA.
unsigned int getSkewValue()
Gets the tempo skew numerator.
QueueTempo & operator=(const QueueTempo &other)
Assignment operator.
QueueTempo & getTempo()
Gets a QueueTempo object reference.
void setSkewBase(unsigned int value)
Sets the tempo skew base.
unsigned int getTempo()
Gets the queue's tempo in microseconds per beat.
void setSkewValue(unsigned int value)
Sets the tempo skew numerator.
QueueTimer * clone()
Copy the current object and return the copy.
void setType(snd_seq_queue_timer_type_t value)
Sets the timer type.
void setOwner(int value)
Sets the client ID of the owner.
QueueTempo * clone()
Copy the current object returning the copied object.
QString getName()
Gets the queue name.
virtual ~QueueTimer()
Destructor.
void setId(snd_timer_id_t *value)
Sets the timer identifier record.
unsigned int getResolution()
Gets the timer resolution.
const snd_timer_id_t * getId()
Gets the timer identifier record.
QueueTimer & operator=(const QueueTimer &other)
Assignment operator.
virtual ~QueueInfo()
Destructor.
Queue information container.
void setResolution(unsigned int value)
Sets the timer resolution.
QueueTimer()
Default constructor.
int getQueueId()
The queue's numeric identifier.
QueueInfo & operator=(const QueueInfo &other)
Assignment operator.
int getInfoSize() const
Gets the size of the ALSA queue info object.
unsigned int getSkewBase()
Gets the tempo skew base.
virtual ~MidiQueue()
Destructor.
QueueInfo * clone()
Copy the current object and return the copy.
bool isLocked()
Returns the locking status of the queue.
QueueStatus & operator=(const QueueStatus &other)
Assignment operator.
void setTempo(unsigned int value)
Sets the queue tempo in microseconds per beat.
void outputDirect(SequencerEvent *ev, bool async=false, int timeout=-1)
Output an event directly to the sequencer.
snd_seq_queue_timer_type_t getType()
Gets the timer type.
QueueStatus * clone()
Copy the current object and return the copy.
int getInfoSize() const
Gets the size of the ALSA status object.
#define CHECK_ERROR(x)
This macro calls the check error function.
void setUsage(int used)
Sets the queue usage flag.
void setInfo(const QueueInfo &value)
Applies a QueueInfo object to the queue.
unsigned int getFlags()
Gets the flags of the queue.
#define CHECK_WARNING(x)
This macro calls the check warning function.
Classes managing ALSA Sequencer queues.
QueueInfo & getInfo()
Gets a QueueInfo object reference.
const snd_seq_real_time_t * getRealtime()
Gets the real time (secods and nanoseconds) of the queue.
Classes managing ALSA Sequencer events.
int getInfoSize() const
Gets the size of the ALSA queue tempo object.
int getId()
Gets the queue's numeric identifier.
QueueStatus()
Default constructor.
ALSA Timer identifier container.
int getId()
Gets the queue's numeric identifier.