Go to the documentation of this file.
19 #include <QReadLocker>
20 #include <QWriteLocker>
55 const int TIMEOUT = 100;
166 unsigned int last_tick;
173 if (last_tick == 0) {
203 qWarning(
"exception in output thread");
218 QThread::start( priority );
virtual void sendEchoEvent(int tick)
Sends an echo event, with the same PortId as sender and destination.
int m_QueueId
MidiQueue numeric identifier.
int getEvents()
Gets the number of queued events.
snd_seq_t * getHandle()
Returns the sequencer handler managed by ALSA.
void setSource(const unsigned char port)
Sets the event's source port ID.
virtual void stop()
Stops playing the current sequence.
Base class for the event's hierarchy.
pollfd * m_pfds
Array of pollfd pointers.
bool m_Stopped
Stopped status.
void stopped()
Signal emitted when the play-back has stopped.
void stop()
Stop the queue.
Classes managing ALSA Sequencer queues.
QReadWriteLock m_mutex
Mutex object used for synchronization.
QueueStatus & getStatus()
Gets a QueueStatus object reference.
void finished()
Signal emitted when the sequence play-back has finished.
static bool isConnectionChange(const SequencerEvent *event)
Checks if the event's type is of type connection change.
void scheduleTick(const int queue, const int tick, const bool relative)
Sets the event to be scheduled in musical time (ticks) units.
void setDestination(const unsigned char client, const unsigned char port)
Sets the client:port destination of the event.
virtual bool hasNext()=0
Check if there is one more event in the sequence.
MidiClient * m_MidiClient
MidiClient instance pointer.
virtual void sendSongEvent(SequencerEvent *ev)
Sends a SequencerEvent.
virtual void drainOutput()
Flush the ALSA output buffer.
virtual unsigned int getInitialPosition()
Gets the initial position in ticks of the sequence.
int m_PortId
MidiPort numeric identifier.
MidiQueue * getQueue()
Get the MidiQueue instance associated to this client.
virtual SequencerEvent * nextEvent()=0
Gets the next event in the sequence.
virtual bool stopRequested()
Checks if stop has been requested.
MidiQueue * m_Queue
MidiQueue instance pointer.
void setTickPosition(snd_seq_tick_time_t pos)
Sets the queue position in musical time (ticks).
Classes managing ALSA Sequencer clients.
int m_npfds
Number of pollfd pointers.
virtual unsigned int getEchoResolution()
Gets the echo event resolution in ticks.
snd_seq_event_t * getHandle()
Gets the handle of the event.
The QThread class provides platform-independent threads.
int getClientId()
Gets the client ID.
virtual void run()
Thread process loop.
void continueRunning()
Start the queue without resetting the last position.
virtual void syncOutput()
Waits until the ALSA output queue is empty (all the events have been played.)
SequencerOutputThread(MidiClient *seq, int portId)
Constructor.
void start()
Start the queue.
void start(Priority priority=InheritPriority)
Starts the playback thread.
void clear()
Clear the queue, dropping any scheduled events.