aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/seq/seq_timer.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-17 08:04:02 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:17:52 -0500
commitc7e0b5bf9fff1b726495081447c107a2333fb82c (patch)
treef4d9ec9a6446f8e2afde4c94e10a39f2b86a0bc9 /sound/core/seq/seq_timer.c
parent6ac77bc180fbd985988015020c2e2347e802959d (diff)
[ALSA] Remove xxx_t typedefs: Sequencer
Modules: ALSA sequencer Remove xxx_t typedefs from the core sequencer codes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/seq/seq_timer.c')
-rw-r--r--sound/core/seq/seq_timer.c68
1 files changed, 36 insertions, 32 deletions
diff --git a/sound/core/seq/seq_timer.c b/sound/core/seq/seq_timer.c
index 65b64a7c456d..a1d8bfd60ae9 100644
--- a/sound/core/seq/seq_timer.c
+++ b/sound/core/seq/seq_timer.c
@@ -41,7 +41,7 @@ extern int seq_default_timer_resolution;
41 41
42#define SKEW_BASE 0x10000 /* 16bit shift */ 42#define SKEW_BASE 0x10000 /* 16bit shift */
43 43
44static void snd_seq_timer_set_tick_resolution(seq_timer_tick_t *tick, 44static void snd_seq_timer_set_tick_resolution(struct snd_seq_timer_tick *tick,
45 int tempo, int ppq) 45 int tempo, int ppq)
46{ 46{
47 if (tempo < 1000000) 47 if (tempo < 1000000)
@@ -60,9 +60,9 @@ static void snd_seq_timer_set_tick_resolution(seq_timer_tick_t *tick,
60} 60}
61 61
62/* create new timer (constructor) */ 62/* create new timer (constructor) */
63seq_timer_t *snd_seq_timer_new(void) 63struct snd_seq_timer *snd_seq_timer_new(void)
64{ 64{
65 seq_timer_t *tmr; 65 struct snd_seq_timer *tmr;
66 66
67 tmr = kzalloc(sizeof(*tmr), GFP_KERNEL); 67 tmr = kzalloc(sizeof(*tmr), GFP_KERNEL);
68 if (tmr == NULL) { 68 if (tmr == NULL) {
@@ -81,9 +81,9 @@ seq_timer_t *snd_seq_timer_new(void)
81} 81}
82 82
83/* delete timer (destructor) */ 83/* delete timer (destructor) */
84void snd_seq_timer_delete(seq_timer_t **tmr) 84void snd_seq_timer_delete(struct snd_seq_timer **tmr)
85{ 85{
86 seq_timer_t *t = *tmr; 86 struct snd_seq_timer *t = *tmr;
87 *tmr = NULL; 87 *tmr = NULL;
88 88
89 if (t == NULL) { 89 if (t == NULL) {
@@ -99,7 +99,7 @@ void snd_seq_timer_delete(seq_timer_t **tmr)
99 kfree(t); 99 kfree(t);
100} 100}
101 101
102void snd_seq_timer_defaults(seq_timer_t * tmr) 102void snd_seq_timer_defaults(struct snd_seq_timer * tmr)
103{ 103{
104 /* setup defaults */ 104 /* setup defaults */
105 tmr->ppq = 96; /* 96 PPQ */ 105 tmr->ppq = 96; /* 96 PPQ */
@@ -118,7 +118,7 @@ void snd_seq_timer_defaults(seq_timer_t * tmr)
118 tmr->skew = tmr->skew_base = SKEW_BASE; 118 tmr->skew = tmr->skew_base = SKEW_BASE;
119} 119}
120 120
121void snd_seq_timer_reset(seq_timer_t * tmr) 121void snd_seq_timer_reset(struct snd_seq_timer * tmr)
122{ 122{
123 unsigned long flags; 123 unsigned long flags;
124 124
@@ -136,13 +136,13 @@ void snd_seq_timer_reset(seq_timer_t * tmr)
136 136
137 137
138/* called by timer interrupt routine. the period time since previous invocation is passed */ 138/* called by timer interrupt routine. the period time since previous invocation is passed */
139static void snd_seq_timer_interrupt(snd_timer_instance_t *timeri, 139static void snd_seq_timer_interrupt(struct snd_timer_instance *timeri,
140 unsigned long resolution, 140 unsigned long resolution,
141 unsigned long ticks) 141 unsigned long ticks)
142{ 142{
143 unsigned long flags; 143 unsigned long flags;
144 queue_t *q = (queue_t *)timeri->callback_data; 144 struct snd_seq_queue *q = timeri->callback_data;
145 seq_timer_t *tmr; 145 struct snd_seq_timer *tmr;
146 146
147 if (q == NULL) 147 if (q == NULL)
148 return; 148 return;
@@ -177,7 +177,7 @@ static void snd_seq_timer_interrupt(snd_timer_instance_t *timeri,
177} 177}
178 178
179/* set current tempo */ 179/* set current tempo */
180int snd_seq_timer_set_tempo(seq_timer_t * tmr, int tempo) 180int snd_seq_timer_set_tempo(struct snd_seq_timer * tmr, int tempo)
181{ 181{
182 unsigned long flags; 182 unsigned long flags;
183 183
@@ -194,7 +194,7 @@ int snd_seq_timer_set_tempo(seq_timer_t * tmr, int tempo)
194} 194}
195 195
196/* set current ppq */ 196/* set current ppq */
197int snd_seq_timer_set_ppq(seq_timer_t * tmr, int ppq) 197int snd_seq_timer_set_ppq(struct snd_seq_timer * tmr, int ppq)
198{ 198{
199 unsigned long flags; 199 unsigned long flags;
200 200
@@ -217,7 +217,8 @@ int snd_seq_timer_set_ppq(seq_timer_t * tmr, int ppq)
217} 217}
218 218
219/* set current tick position */ 219/* set current tick position */
220int snd_seq_timer_set_position_tick(seq_timer_t *tmr, snd_seq_tick_time_t position) 220int snd_seq_timer_set_position_tick(struct snd_seq_timer *tmr,
221 snd_seq_tick_time_t position)
221{ 222{
222 unsigned long flags; 223 unsigned long flags;
223 224
@@ -231,7 +232,8 @@ int snd_seq_timer_set_position_tick(seq_timer_t *tmr, snd_seq_tick_time_t positi
231} 232}
232 233
233/* set current real-time position */ 234/* set current real-time position */
234int snd_seq_timer_set_position_time(seq_timer_t *tmr, snd_seq_real_time_t position) 235int snd_seq_timer_set_position_time(struct snd_seq_timer *tmr,
236 snd_seq_real_time_t position)
235{ 237{
236 unsigned long flags; 238 unsigned long flags;
237 239
@@ -245,7 +247,8 @@ int snd_seq_timer_set_position_time(seq_timer_t *tmr, snd_seq_real_time_t positi
245} 247}
246 248
247/* set timer skew */ 249/* set timer skew */
248int snd_seq_timer_set_skew(seq_timer_t *tmr, unsigned int skew, unsigned int base) 250int snd_seq_timer_set_skew(struct snd_seq_timer *tmr, unsigned int skew,
251 unsigned int base)
249{ 252{
250 unsigned long flags; 253 unsigned long flags;
251 254
@@ -262,10 +265,10 @@ int snd_seq_timer_set_skew(seq_timer_t *tmr, unsigned int skew, unsigned int bas
262 return 0; 265 return 0;
263} 266}
264 267
265int snd_seq_timer_open(queue_t *q) 268int snd_seq_timer_open(struct snd_seq_queue *q)
266{ 269{
267 snd_timer_instance_t *t; 270 struct snd_timer_instance *t;
268 seq_timer_t *tmr; 271 struct snd_seq_timer *tmr;
269 char str[32]; 272 char str[32];
270 int err; 273 int err;
271 274
@@ -282,7 +285,7 @@ int snd_seq_timer_open(queue_t *q)
282 if (err < 0 && tmr->alsa_id.dev_class != SNDRV_TIMER_CLASS_SLAVE) { 285 if (err < 0 && tmr->alsa_id.dev_class != SNDRV_TIMER_CLASS_SLAVE) {
283 if (tmr->alsa_id.dev_class != SNDRV_TIMER_CLASS_GLOBAL || 286 if (tmr->alsa_id.dev_class != SNDRV_TIMER_CLASS_GLOBAL ||
284 tmr->alsa_id.device != SNDRV_TIMER_GLOBAL_SYSTEM) { 287 tmr->alsa_id.device != SNDRV_TIMER_GLOBAL_SYSTEM) {
285 snd_timer_id_t tid; 288 struct snd_timer_id tid;
286 memset(&tid, 0, sizeof(tid)); 289 memset(&tid, 0, sizeof(tid));
287 tid.dev_class = SNDRV_TIMER_CLASS_GLOBAL; 290 tid.dev_class = SNDRV_TIMER_CLASS_GLOBAL;
288 tid.dev_sclass = SNDRV_TIMER_SCLASS_SEQUENCER; 291 tid.dev_sclass = SNDRV_TIMER_SCLASS_SEQUENCER;
@@ -302,9 +305,9 @@ int snd_seq_timer_open(queue_t *q)
302 return 0; 305 return 0;
303} 306}
304 307
305int snd_seq_timer_close(queue_t *q) 308int snd_seq_timer_close(struct snd_seq_queue *q)
306{ 309{
307 seq_timer_t *tmr; 310 struct snd_seq_timer *tmr;
308 311
309 tmr = q->timer; 312 tmr = q->timer;
310 snd_assert(tmr != NULL, return -EINVAL); 313 snd_assert(tmr != NULL, return -EINVAL);
@@ -316,7 +319,7 @@ int snd_seq_timer_close(queue_t *q)
316 return 0; 319 return 0;
317} 320}
318 321
319int snd_seq_timer_stop(seq_timer_t * tmr) 322int snd_seq_timer_stop(struct snd_seq_timer * tmr)
320{ 323{
321 if (! tmr->timeri) 324 if (! tmr->timeri)
322 return -EINVAL; 325 return -EINVAL;
@@ -327,9 +330,9 @@ int snd_seq_timer_stop(seq_timer_t * tmr)
327 return 0; 330 return 0;
328} 331}
329 332
330static int initialize_timer(seq_timer_t *tmr) 333static int initialize_timer(struct snd_seq_timer *tmr)
331{ 334{
332 snd_timer_t *t; 335 struct snd_timer *t;
333 unsigned long freq; 336 unsigned long freq;
334 337
335 t = tmr->timeri->timer; 338 t = tmr->timeri->timer;
@@ -358,7 +361,7 @@ static int initialize_timer(seq_timer_t *tmr)
358 return 0; 361 return 0;
359} 362}
360 363
361int snd_seq_timer_start(seq_timer_t * tmr) 364int snd_seq_timer_start(struct snd_seq_timer * tmr)
362{ 365{
363 if (! tmr->timeri) 366 if (! tmr->timeri)
364 return -EINVAL; 367 return -EINVAL;
@@ -373,7 +376,7 @@ int snd_seq_timer_start(seq_timer_t * tmr)
373 return 0; 376 return 0;
374} 377}
375 378
376int snd_seq_timer_continue(seq_timer_t * tmr) 379int snd_seq_timer_continue(struct snd_seq_timer * tmr)
377{ 380{
378 if (! tmr->timeri) 381 if (! tmr->timeri)
379 return -EINVAL; 382 return -EINVAL;
@@ -391,7 +394,7 @@ int snd_seq_timer_continue(seq_timer_t * tmr)
391} 394}
392 395
393/* return current 'real' time. use timeofday() to get better granularity. */ 396/* return current 'real' time. use timeofday() to get better granularity. */
394snd_seq_real_time_t snd_seq_timer_get_cur_time(seq_timer_t *tmr) 397snd_seq_real_time_t snd_seq_timer_get_cur_time(struct snd_seq_timer *tmr)
395{ 398{
396 snd_seq_real_time_t cur_time; 399 snd_seq_real_time_t cur_time;
397 400
@@ -416,19 +419,20 @@ snd_seq_real_time_t snd_seq_timer_get_cur_time(seq_timer_t *tmr)
416 419
417/* TODO: use interpolation on tick queue (will only be useful for very 420/* TODO: use interpolation on tick queue (will only be useful for very
418 high PPQ values) */ 421 high PPQ values) */
419snd_seq_tick_time_t snd_seq_timer_get_cur_tick(seq_timer_t *tmr) 422snd_seq_tick_time_t snd_seq_timer_get_cur_tick(struct snd_seq_timer *tmr)
420{ 423{
421 return tmr->tick.cur_tick; 424 return tmr->tick.cur_tick;
422} 425}
423 426
424 427
425/* exported to seq_info.c */ 428/* exported to seq_info.c */
426void snd_seq_info_timer_read(snd_info_entry_t *entry, snd_info_buffer_t * buffer) 429void snd_seq_info_timer_read(struct snd_info_entry *entry,
430 struct snd_info_buffer *buffer)
427{ 431{
428 int idx; 432 int idx;
429 queue_t *q; 433 struct snd_seq_queue *q;
430 seq_timer_t *tmr; 434 struct snd_seq_timer *tmr;
431 snd_timer_instance_t *ti; 435 struct snd_timer_instance *ti;
432 unsigned long resolution; 436 unsigned long resolution;
433 437
434 for (idx = 0; idx < SNDRV_SEQ_MAX_QUEUES; idx++) { 438 for (idx = 0; idx < SNDRV_SEQ_MAX_QUEUES; idx++) {