seq_oss_timer.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * OSS compatible sequencer driver
  3. * timer handling routines
  4. *
  5. * Copyright (C) 1998,99 Takashi Iwai <tiwai@suse.de>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. */
  21. #ifndef __SEQ_OSS_TIMER_H
  22. #define __SEQ_OSS_TIMER_H
  23. #include "seq_oss_device.h"
  24. /*
  25. * timer information definition
  26. */
  27. struct seq_oss_timer {
  28. struct seq_oss_devinfo *dp;
  29. reltime_t cur_tick;
  30. int realtime;
  31. int running;
  32. int tempo, ppq; /* ALSA queue */
  33. int oss_tempo, oss_timebase;
  34. };
  35. struct seq_oss_timer *snd_seq_oss_timer_new(struct seq_oss_devinfo *dp);
  36. void snd_seq_oss_timer_delete(struct seq_oss_timer *dp);
  37. int snd_seq_oss_timer_start(struct seq_oss_timer *timer);
  38. int snd_seq_oss_timer_stop(struct seq_oss_timer *timer);
  39. int snd_seq_oss_timer_continue(struct seq_oss_timer *timer);
  40. int snd_seq_oss_timer_tempo(struct seq_oss_timer *timer, int value);
  41. #define snd_seq_oss_timer_reset snd_seq_oss_timer_start
  42. int snd_seq_oss_timer_ioctl(struct seq_oss_timer *timer, unsigned int cmd, int __user *arg);
  43. /*
  44. * get current processed time
  45. */
  46. static inline abstime_t
  47. snd_seq_oss_timer_cur_tick(struct seq_oss_timer *timer)
  48. {
  49. return timer->cur_tick;
  50. }
  51. /*
  52. * is realtime event?
  53. */
  54. static inline int
  55. snd_seq_oss_timer_is_realtime(struct seq_oss_timer *timer)
  56. {
  57. return timer->realtime;
  58. }
  59. #endif