| 1 |
// Emacs style mode select -*- C -*- |
| 2 |
//----------------------------------------------------------------------------- |
| 3 |
// |
| 4 |
// Copyright(C) 2009 Simon Howard |
| 5 |
// |
| 6 |
// This program is free software; you can redistribute it and/or |
| 7 |
// modify it under the terms of the GNU General Public License |
| 8 |
// as published by the Free Software Foundation; either version 2 |
| 9 |
// of the License, or (at your option) any later version. |
| 10 |
// |
| 11 |
// This program is distributed in the hope that it will be useful, |
| 12 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
// GNU General Public License for more details. |
| 15 |
// |
| 16 |
// You should have received a copy of the GNU General Public License |
| 17 |
// along with this program; if not, write to the Free Software |
| 18 |
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
| 19 |
// 02111-1307, USA. |
| 20 |
// |
| 21 |
// DESCRIPTION: |
| 22 |
// OPL callback queue. |
| 23 |
// |
| 24 |
//----------------------------------------------------------------------------- |
| 25 |
|
| 26 |
#ifndef OPL_QUEUE_H |
| 27 |
#define OPL_QUEUE_H |
| 28 |
|
| 29 |
#include "opl.h" |
| 30 |
|
| 31 |
typedef struct opl_callback_queue_s opl_callback_queue_t; |
| 32 |
|
| 33 |
opl_callback_queue_t *OPL_Queue_Create(void); |
| 34 |
int OPL_Queue_IsEmpty(opl_callback_queue_t *queue); |
| 35 |
void OPL_Queue_Clear(opl_callback_queue_t *queue); |
| 36 |
void OPL_Queue_Destroy(opl_callback_queue_t *queue); |
| 37 |
void OPL_Queue_Push(opl_callback_queue_t *queue, |
| 38 |
opl_callback_t callback, void *data, |
| 39 |
uint64_t time); |
| 40 |
int OPL_Queue_Pop(opl_callback_queue_t *queue, |
| 41 |
opl_callback_t *callback, void **data); |
| 42 |
uint64_t OPL_Queue_Peek(opl_callback_queue_t *queue); |
| 43 |
void OPL_Queue_AdjustCallbacks(opl_callback_queue_t *queue, |
| 44 |
uint64_t time, float factor); |
| 45 |
|
| 46 |
#endif /* #ifndef OPL_QUEUE_H */ |