File: seq_queue.h

package info (click to toggle)
alsadriver 0.2.0-pre8-3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 2,808 kB
  • ctags: 6,550
  • sloc: ansic: 43,490; sh: 916; makefile: 759; perl: 54
file content (74 lines) | stat: -rw-r--r-- 2,439 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
 *   ALSA sequencer Queue handling
 *   Copyright (c) 1998 by Frank van de Pol <F.K.W.van.de.Pol@inter.nl.net>
 *
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 */
#ifndef __SND_SEQ_QUEUE_H
#define __SND_SEQ_QUEUE_H

#include "seq_memory.h"
#include "seq_prioq.h"
#include "seq_timer.h"

#define SEQ_QUEUE_NO_OWNER (-1)

typedef struct {
	prioq_t	*tickq;	/* midi tick event queue */
	prioq_t	*timeq;	/* real-time event queue */	
	
	timer_t *timer;	/* time keeper for this queue */
	int	owner;		/* client that 'owns' the timer */
	int	locked:1;	/* timer is only accesibble by owner if set */	
} queue_t;


/* init queues structure */
void snd_seq_queues_init(int num);

/* delete queues */ 
void snd_seq_queues_delete(void);


/* create new queue (constructor) */
extern queue_t *snd_seq_queue_new(void);

/* delete queue (destructor) */
extern void snd_seq_queue_delete(queue_t **q);


/* enqueue a event received from one the clients */
extern void snd_seq_enqueue_event(snd_seq_event_cell_t *cell);


/* return pointer to queue structure for specified id */
queue_t *queueptr(int queueid);

/* check queues and dispatch events */
void snd_seq_check_queues(void);

/* access to queue's parameters */
extern int snd_seq_queue_check_access(int queueid, int client);
extern void snd_seq_queue_timer_stop(int queueid, int client);
extern void snd_seq_queue_timer_start(int queueid, int client);
extern void snd_seq_queue_timer_continue(int queueid, int client);
extern void snd_seq_queue_timer_set_tempo(int queueid, int client, int tempo);
extern void snd_seq_queue_timer_set_ppq(int queueid, int client,int ppq);
extern void snd_seq_queue_set_owner(int queueid, int client);
extern void snd_seq_queue_set_locked(int queueid, int client, int locked);

#endif