1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * OSS compatible sequencer driver
4  * timer handling routines
5  *
6  * Copyright (C) 1998,99 Takashi Iwai <tiwai@suse.de>
7  */
8 
9 #ifndef __SEQ_OSS_TIMER_H
10 #define __SEQ_OSS_TIMER_H
11 
12 #include "seq_oss_device.h"
13 
14 /*
15  * timer information definition
16  */
17 struct seq_oss_timer {
18 	struct seq_oss_devinfo *dp;
19 	reltime_t cur_tick;
20 	int realtime;
21 	int running;
22 	int tempo, ppq;	/* ALSA queue */
23 	int oss_tempo, oss_timebase;
24 };
25 
26 
27 struct seq_oss_timer *snd_seq_oss_timer_new(struct seq_oss_devinfo *dp);
28 void snd_seq_oss_timer_delete(struct seq_oss_timer *dp);
29 
30 int snd_seq_oss_timer_start(struct seq_oss_timer *timer);
31 int snd_seq_oss_timer_stop(struct seq_oss_timer *timer);
32 int snd_seq_oss_timer_continue(struct seq_oss_timer *timer);
33 int snd_seq_oss_timer_tempo(struct seq_oss_timer *timer, int value);
34 #define snd_seq_oss_timer_reset  snd_seq_oss_timer_start
35 
36 int snd_seq_oss_timer_ioctl(struct seq_oss_timer *timer, unsigned int cmd, int __user *arg);
37 
38 /*
39  * get current processed time
40  */
41 static inline abstime_t
snd_seq_oss_timer_cur_tick(struct seq_oss_timer * timer)42 snd_seq_oss_timer_cur_tick(struct seq_oss_timer *timer)
43 {
44 	return timer->cur_tick;
45 }
46 
47 #endif
48