# include/fluidsynth/event.h

Go to the documentation of this file.

    00001 /* FluidSynth - A Software Synthesizer
    00002  *
    00003  * Copyright (C) 2003  Peter Hanappe and others.
    00004  *
    00005  * This library is free software; you can redistribute it and/or
    00006  * modify it under the terms of the GNU Library General Public License
    00007  * as published by the Free Software Foundation; either version 2 of
    00008  * the License, or (at your option) any later version.
    00009  *
    00010  * This library is distributed in the hope that it will be useful, but
    00011  * WITHOUT ANY WARRANTY; without even the implied warranty of
    00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00013  * Library General Public License for more details.
    00014  *
    00015  * You should have received a copy of the GNU Library General Public
    00016  * License along with this library; if not, write to the Free
    00017  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    00018  * 02111-1307, USA
    00019  */
    00020
    00021 #ifndef _FLUIDSYNTH_EVENT_H
    00022 #define _FLUIDSYNTH_EVENT_H
    00023
    00024 #ifdef __cplusplus
    00025 extern "C" {
    00026 #endif
    00027
    00038 enum fluid_seq_event_type {
    00039   FLUID_SEQ_NOTE = 0,
    00040   FLUID_SEQ_NOTEON,
    00041   FLUID_SEQ_NOTEOFF,
    00042   FLUID_SEQ_ALLSOUNDSOFF,
    00043   FLUID_SEQ_ALLNOTESOFF,
    00044   FLUID_SEQ_BANKSELECT,
    00045   FLUID_SEQ_PROGRAMCHANGE,
    00046   FLUID_SEQ_PROGRAMSELECT,
    00047   FLUID_SEQ_PITCHBEND,
    00048   FLUID_SEQ_PITCHWHHELSENS,
    00049   FLUID_SEQ_MODULATION,
    00050   FLUID_SEQ_SUSTAIN,
    00051   FLUID_SEQ_CONTROLCHANGE,
    00052   FLUID_SEQ_PAN,
    00053   FLUID_SEQ_VOLUME,
    00054   FLUID_SEQ_REVERBSEND,
    00055   FLUID_SEQ_CHORUSSEND,
    00056   FLUID_SEQ_TIMER,
    00057   FLUID_SEQ_ANYCONTROLCHANGE,
    00058   FLUID_SEQ_LASTEVENT
    00059 };
    00060
    00061 /* Event alloc/free */
    00062 FLUIDSYNTH_API fluid_event_t* new_fluid_event(void);
    00063 FLUIDSYNTH_API void delete_fluid_event(fluid_event_t* evt);
    00064
    00065 /* Initializing events */
    00066 FLUIDSYNTH_API void fluid_event_set_source(fluid_event_t* evt, short src);
    00067 FLUIDSYNTH_API void fluid_event_set_dest(fluid_event_t* evt, short dest);
    00068
    00069 /* Timer events */
    00070 FLUIDSYNTH_API void fluid_event_timer(fluid_event_t* evt, void* data);
    00071
    00072 /* Note events */
    00073 FLUIDSYNTH_API void fluid_event_note(fluid_event_t* evt, int channel,
    00074                                    short key, short vel,
    00075                                    unsigned int duration);
    00076
    00077 FLUIDSYNTH_API void fluid_event_noteon(fluid_event_t* evt, int channel, short key, short vel);
    00078 FLUIDSYNTH_API void fluid_event_noteoff(fluid_event_t* evt, int channel, short key);
    00079 FLUIDSYNTH_API void fluid_event_all_sounds_off(fluid_event_t* evt, int channel);
    00080 FLUIDSYNTH_API void fluid_event_all_notes_off(fluid_event_t* evt, int channel);
    00081
    00082 /* Instrument selection */
    00083 FLUIDSYNTH_API void fluid_event_bank_select(fluid_event_t* evt, int channel, short bank_num);
    00084 FLUIDSYNTH_API void fluid_event_program_change(fluid_event_t* evt, int channel, short preset_num);
    00085 FLUIDSYNTH_API void fluid_event_program_select(fluid_event_t* evt, int channel, unsigned int sfont_id, short bank_num, short preset_num);
    00086
    00087 /* Real-time generic instrument controllers */
    00088 FLUIDSYNTH_API
    00089 void fluid_event_control_change(fluid_event_t* evt, int channel, short control, short val);
    00090
    00091 /* Real-time instrument controllers shortcuts */
    00092 FLUIDSYNTH_API void fluid_event_pitch_bend(fluid_event_t* evt, int channel, int val);
    00093 FLUIDSYNTH_API void fluid_event_pitch_wheelsens(fluid_event_t* evt, int channel, short val);
    00094 FLUIDSYNTH_API void fluid_event_modulation(fluid_event_t* evt, int channel, short val);
    00095 FLUIDSYNTH_API void fluid_event_sustain(fluid_event_t* evt, int channel, short val);
    00096 FLUIDSYNTH_API void fluid_event_pan(fluid_event_t* evt, int channel, short val);
    00097 FLUIDSYNTH_API void fluid_event_volume(fluid_event_t* evt, int channel, short val);
    00098 FLUIDSYNTH_API void fluid_event_reverb_send(fluid_event_t* evt, int channel, short val);
    00099 FLUIDSYNTH_API void fluid_event_chorus_send(fluid_event_t* evt, int channel, short val);
    00100
    00101 /* Only for removing events */
    00102 FLUIDSYNTH_API void fluid_event_any_control_change(fluid_event_t* evt, int channel);
    00103
    00104 /* Accessing event data */
    00105 FLUIDSYNTH_API int fluid_event_get_type(fluid_event_t* evt);
    00106 FLUIDSYNTH_API short fluid_event_get_source(fluid_event_t* evt);
    00107 FLUIDSYNTH_API short fluid_event_get_dest(fluid_event_t* evt);
    00108 FLUIDSYNTH_API int fluid_event_get_channel(fluid_event_t* evt);
    00109 FLUIDSYNTH_API short fluid_event_get_key(fluid_event_t* evt);
    00110 FLUIDSYNTH_API short fluid_event_get_velocity(fluid_event_t* evt);
    00111 FLUIDSYNTH_API short fluid_event_get_control(fluid_event_t* evt);
    00112 FLUIDSYNTH_API short fluid_event_get_value(fluid_event_t* evt);
    00113 FLUIDSYNTH_API short fluid_event_get_program(fluid_event_t* evt);
    00114 FLUIDSYNTH_API void* fluid_event_get_data(fluid_event_t* evt);
    00115 FLUIDSYNTH_API unsigned int fluid_event_get_duration(fluid_event_t* evt);
    00116 FLUIDSYNTH_API short fluid_event_get_bank(fluid_event_t* evt);
    00117 FLUIDSYNTH_API int fluid_event_get_pitch(fluid_event_t* evt);
    00118 FLUIDSYNTH_API unsigned int fluid_event_get_sfont_id(fluid_event_t* evt);
    00119
    00120 #ifdef __cplusplus
    00121 }
    00122 #endif
    00123 #endif /* _FLUIDSYNTH_EVENT_H */