Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  *   ALSA sequencer Priority Queue
0004  *   Copyright (c) 1998 by Frank van de Pol <fvdpol@coil.demon.nl>
0005  */
0006 #ifndef __SND_SEQ_PRIOQ_H
0007 #define __SND_SEQ_PRIOQ_H
0008 
0009 #include "seq_memory.h"
0010 
0011 
0012 /* === PRIOQ === */
0013 
0014 struct snd_seq_prioq {
0015     struct snd_seq_event_cell *head;      /* pointer to head of prioq */
0016     struct snd_seq_event_cell *tail;      /* pointer to tail of prioq */
0017     int cells;
0018     spinlock_t lock;
0019 };
0020 
0021 
0022 /* create new prioq (constructor) */
0023 struct snd_seq_prioq *snd_seq_prioq_new(void);
0024 
0025 /* delete prioq (destructor) */
0026 void snd_seq_prioq_delete(struct snd_seq_prioq **fifo);
0027 
0028 /* enqueue cell to prioq */
0029 int snd_seq_prioq_cell_in(struct snd_seq_prioq *f, struct snd_seq_event_cell *cell);
0030 
0031 /* dequeue cell from prioq */ 
0032 struct snd_seq_event_cell *snd_seq_prioq_cell_out(struct snd_seq_prioq *f,
0033                           void *current_time);
0034 
0035 /* return number of events available in prioq */
0036 int snd_seq_prioq_avail(struct snd_seq_prioq *f);
0037 
0038 /* client left queue */
0039 void snd_seq_prioq_leave(struct snd_seq_prioq *f, int client, int timestamp);        
0040 
0041 /* Remove events */
0042 void snd_seq_prioq_remove_events(struct snd_seq_prioq *f, int client,
0043                  struct snd_seq_remove_events *info);
0044 
0045 #endif