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 Lesser General Public License
7 * as published by the Free Software Foundation; either version 2.1 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 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser 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 */
41 short id; //?? unused ?
43 unsigned int duration;
47 unsigned int fluid_event_get_time(fluid_event_t *evt);
48 void fluid_event_set_time(fluid_event_t *evt, unsigned int time);
50 void fluid_event_clear(fluid_event_t *evt);
52 /* private data for sorter + heap */
53 enum fluid_evt_entry_type
55 FLUID_EVT_ENTRY_INSERT = 0,
56 FLUID_EVT_ENTRY_REMOVE
59 typedef struct _fluid_evt_entry fluid_evt_entry;
60 struct _fluid_evt_entry
62 fluid_evt_entry *next;
67 #define HEAP_WITH_DYNALLOC 1
68 /* #undef HEAP_WITH_DYNALLOC */
70 typedef struct _fluid_evt_heap_t
72 #ifdef HEAP_WITH_DYNALLOC
73 fluid_evt_entry *freelist;
76 fluid_evt_entry *head;
77 fluid_evt_entry *tail;
82 fluid_evt_heap_t *_fluid_evt_heap_init(int nbEvents);
83 void _fluid_evt_heap_free(fluid_evt_heap_t *heap);
84 fluid_evt_entry *_fluid_seq_heap_get_free(fluid_evt_heap_t *heap);
85 void _fluid_seq_heap_set_free(fluid_evt_heap_t *heap, fluid_evt_entry *evt);
87 #endif /* _FLUID_EVENT_PRIV_H */