1 /* FluidSynth - A Software Synthesizer
3 * Copyright (C) 2003 Peter Hanappe and others.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public License
7 * as published by the Free Software Foundation; either version 2 of
8 * the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 #ifndef _FLUID_EVENT_PRIV_H
23 #define _FLUID_EVENT_PRIV_H
25 #include "fluidsynth.h"
26 #include "fluid_sys.h"
28 /* Private data for event */
29 /* ?? should be optimized in size, using unions */
30 struct _fluid_event_t {
40 short id; //?? unused ?
42 unsigned int duration;
46 unsigned int fluid_event_get_time(fluid_event_t* evt);
47 void fluid_event_set_time(fluid_event_t* evt, unsigned int time);
49 void fluid_event_clear(fluid_event_t* evt);
51 /* private data for sorter + heap */
52 enum fluid_evt_entry_type {
53 FLUID_EVT_ENTRY_INSERT = 0,
54 FLUID_EVT_ENTRY_REMOVE
57 typedef struct _fluid_evt_entry fluid_evt_entry;
58 struct _fluid_evt_entry {
59 fluid_evt_entry *next;
64 #define HEAP_WITH_DYNALLOC 1
65 /* #undef HEAP_WITH_DYNALLOC */
67 typedef struct _fluid_evt_heap_t {
68 #ifdef HEAP_WITH_DYNALLOC
69 fluid_evt_entry* freelist;
72 fluid_evt_entry* head;
73 fluid_evt_entry* tail;
78 fluid_evt_heap_t* _fluid_evt_heap_init(int nbEvents);
79 void _fluid_evt_heap_free(fluid_evt_heap_t* heap);
80 fluid_evt_entry* _fluid_seq_heap_get_free(fluid_evt_heap_t* heap);
81 void _fluid_seq_heap_set_free(fluid_evt_heap_t* heap, fluid_evt_entry* evt);
83 #endif /* _FLUID_EVENT_PRIV_H */