20#ifndef DRUMSTICK_PLAYTHREAD_H
21#define DRUMSTICK_PLAYTHREAD_H
25#include <QReadWriteLock>
99 void start( Priority priority = InheritPriority );
Classes managing ALSA Sequencer events.
The QThread class provides platform-independent threads.
Base class for the event's hierarchy.
virtual SequencerEvent * nextEvent()=0
Gets the next event in the sequence.
virtual void run()
Thread process loop.
virtual unsigned int getInitialPosition()
Gets the initial position in ticks of the sequence.
virtual void sendEchoEvent(int tick)
Sends an echo event, with the same PortId as sender and destination.
SequencerOutputThread(MidiClient *seq, int portId)
Constructor.
virtual void syncOutput()
Waits until the ALSA output queue is empty (all the events have been played.)
int m_QueueId
MidiQueue numeric identifier.
MidiClient * m_MidiClient
MidiClient instance pointer.
bool m_Stopped
Stopped status.
virtual void stop()
Stops playing the current sequence.
virtual void sendSongEvent(SequencerEvent *ev)
Sends a SequencerEvent.
virtual void drainOutput()
Flush the ALSA output buffer.
pollfd * m_pfds
Array of pollfd pointers.
QReadWriteLock m_mutex
Mutex object used for synchronization.
MidiQueue * m_Queue
MidiQueue instance pointer.
virtual bool hasNext()=0
Check if there is one more event in the sequence.
virtual unsigned int getEchoResolution()
Gets the echo event resolution in ticks.
void stopped()
Signal emitted when the play-back has stopped.
int m_npfds
Number of pollfd pointers.
int m_PortId
MidiPort numeric identifier.
void start(Priority priority=InheritPriority)
Starts the playback thread.
virtual bool stopRequested()
Checks if stop has been requested.
void finished()
Signal emitted when the sequence play-back has finished.