20 #ifndef DRUMSTICK_ALSATIMER_H 21 #define DRUMSTICK_ALSATIMER_H 26 #include <QReadWriteLock> 40 class TimerGlobalInfo;
58 int getSizeOfInfo()
const;
68 long getTicks() __attribute__((deprecated));
71 snd_timer_info_t *m_Info;
88 TimerId(
const snd_timer_id_t *other);
89 TimerId(
int cls,
int scls,
int card,
int dev,
int sdev);
93 int getSizeOfInfo()
const;
95 void setClass(
int devclass);
97 void setSlaveClass(
int devsclass);
99 void setCard(
int card);
101 void setDevice(
int device);
103 void setSubdevice(
int subdevice);
107 snd_timer_id_t *m_Info;
131 int getSizeOfInfo()
const;
133 void setTimerId(
const TimerId& tid);
135 unsigned int getFlags();
139 unsigned long getResolution();
140 unsigned long getMinResolution();
141 unsigned long getMaxResolution();
142 unsigned int getClients();
145 snd_timer_ginfo_t* m_Info;
157 TimerQuery(
const QString& deviceName,
int openMode);
158 TimerQuery(
const QString& deviceName,
int openMode, snd_config_t* conf);
166 void setGlobalParams(snd_timer_gparams_t* params);
167 void getGlobalParams(snd_timer_gparams_t* params);
168 void getGlobalStatus(snd_timer_gstatus_t* status);
175 snd_timer_query_t *m_Info;
176 TimerIdList m_timers;
196 int getSizeOfInfo()
const;
198 void setAutoStart(
bool auto_start);
200 void setExclusive(
bool exclusive);
202 void setEarlyEvent(
bool early_event);
203 bool getEarlyEvent();
204 void setTicks(
long ticks);
206 void setQueueSize(
long queue_size);
208 void setFilter(
unsigned int filter);
209 unsigned int getFilter();
212 snd_timer_params_t* m_Info;
231 int getSizeOfInfo()
const;
233 snd_htimestamp_t getTimestamp();
234 long getResolution();
240 snd_timer_status_t* m_Info;
259 virtual void handleTimerEvent(
int ticks,
int msecs) = 0;
275 class TimerInputThread :
public QThread 279 TimerInputThread(
Timer* t,
int timeout)
285 virtual ~TimerInputThread() {}
293 QReadWriteLock m_mutex;
297 Timer(
int cls,
int scls,
int card,
int dev,
int sdev,
int openMode,
QObject* parent = 0);
298 Timer(
const QString& deviceName,
int openMode,
QObject* parent = 0);
299 Timer(
const QString& deviceName,
int openMode, snd_config_t* config,
QObject* parent = 0);
303 static TimerId bestGlobalTimerId();
304 static Timer* bestGlobalTimer(
int openMode,
QObject* parent = 0);
316 void continueRunning();
318 void addAsyncTimerHandler(snd_async_callback_t callback,
void *private_data);
319 int getPollDescriptorsCount();
320 void pollDescriptors(
struct pollfd *pfds,
unsigned int space);
321 void pollDescriptorsRevents(
struct pollfd *pfds,
unsigned int nfds,
unsigned short *revents);
322 ssize_t read(
void *buffer,
size_t size);
323 snd_timer_t* getTimerHandle();
343 void timerExpired(
int ticks,
int msecs);
347 snd_async_handler_t *m_asyncHandler;
349 QPointer<TimerInputThread> m_thread;
352 QString m_deviceName;
353 snd_htimestamp_t m_last_time;
TimerIdList getTimers() const
Gets the list of available timers.
virtual ~TimerEventHandler()
Destructor.
The QObject class is the base class of all Qt objects.
void setHandler(TimerEventHandler *h)
Sets an event handler providing a method to be called when a timer expires.
snd_timer_t * getHandle()
Gets the ALSA timer object.
ALSA Timer information container.
ALSA Timer status container.
ALSA Timer parameters container.
Global timer information container.
ALSA Timer events handler.
QList< TimerId > TimerIdList
List of timer identifiers.
ALSA Timer inquiry helper.
The QThread class provides platform-independent threads.
ALSA Timer identifier container.