MIDI event sequencer. More...
Typedefs | |
typedef void(* | fluid_event_callback_t )(unsigned int time, fluid_event_t *event, fluid_sequencer_t *seq, void *data) |
Event callback prototype for destination clients. | |
Functions | |
FLUIDSYNTH_API fluid_sequencer_t * | new_fluid_sequencer (void) |
Create a new sequencer object which uses the system timer. | |
FLUIDSYNTH_API fluid_sequencer_t * | new_fluid_sequencer2 (int use_system_timer) |
Create a new sequencer object. | |
FLUIDSYNTH_API void | delete_fluid_sequencer (fluid_sequencer_t *seq) |
Free a sequencer object. | |
FLUIDSYNTH_API int | fluid_sequencer_get_use_system_timer (fluid_sequencer_t *seq) |
Check if a sequencer is using the system timer or not. | |
FLUIDSYNTH_API short | fluid_sequencer_register_client (fluid_sequencer_t *seq, const char *name, fluid_event_callback_t callback, void *data) |
Register a sequencer client. | |
FLUIDSYNTH_API void | fluid_sequencer_unregister_client (fluid_sequencer_t *seq, short id) |
Unregister a previously registered client. | |
FLUIDSYNTH_API int | fluid_sequencer_count_clients (fluid_sequencer_t *seq) |
Count a sequencers registered clients. | |
FLUIDSYNTH_API short | fluid_sequencer_get_client_id (fluid_sequencer_t *seq, int index) |
Get a client ID from its index (order in which it was registered). | |
FLUIDSYNTH_API char * | fluid_sequencer_get_client_name (fluid_sequencer_t *seq, int id) |
Get the name of a registered client. | |
FLUIDSYNTH_API int | fluid_sequencer_client_is_dest (fluid_sequencer_t *seq, int id) |
Check if a client is a destination client. | |
FLUIDSYNTH_API void | fluid_sequencer_process (fluid_sequencer_t *seq, unsigned int msec) |
Advance a sequencer that isn't using the system timer. | |
FLUIDSYNTH_API void | fluid_sequencer_send_now (fluid_sequencer_t *seq, fluid_event_t *evt) |
Send an event immediately. | |
FLUIDSYNTH_API int | fluid_sequencer_send_at (fluid_sequencer_t *seq, fluid_event_t *evt, unsigned int time, int absolute) |
Schedule an event for sending at a later time. | |
FLUIDSYNTH_API void | fluid_sequencer_remove_events (fluid_sequencer_t *seq, short source, short dest, int type) |
Remove events from the event queue. | |
FLUIDSYNTH_API unsigned int | fluid_sequencer_get_tick (fluid_sequencer_t *seq) |
Get the current tick of a sequencer. | |
FLUIDSYNTH_API void | fluid_sequencer_set_time_scale (fluid_sequencer_t *seq, double scale) |
Set the time scale of a sequencer. | |
FLUIDSYNTH_API double | fluid_sequencer_get_time_scale (fluid_sequencer_t *seq) |
Get a sequencer's time scale. |
MIDI event sequencer.
typedef void(* fluid_event_callback_t)(unsigned int time, fluid_event_t *event, fluid_sequencer_t *seq, void *data) |
Event callback prototype for destination clients.
time | Current sequencer tick value (see fluid_sequencer_get_tick()). | |
event | The event being received | |
seq | The sequencer instance | |
data | User defined data registered with the client |
FLUIDSYNTH_API fluid_sequencer_t* new_fluid_sequencer | ( | void | ) |
Create a new sequencer object which uses the system timer.
Use new_fluid_sequencer2() to specify whether the system timer or fluid_sequencer_process() is used to advance the sequencer.
References new_fluid_sequencer(), and new_fluid_sequencer2().
Referenced by new_fluid_sequencer().
FLUIDSYNTH_API fluid_sequencer_t* new_fluid_sequencer2 | ( | int | use_system_timer | ) |
Create a new sequencer object.
use_system_timer | If TRUE, sequencer will advance at the rate of the system clock. If FALSE, call fluid_sequencer_process() to advance the sequencer. |
References fluid_log(), FLUID_PANIC, and new_fluid_sequencer2().
Referenced by new_fluid_sequencer(), and new_fluid_sequencer2().
FLUIDSYNTH_API void delete_fluid_sequencer | ( | fluid_sequencer_t * | seq | ) |
Free a sequencer object.
seq | Sequencer to delete |
References delete_fluid_sequencer(), and fluid_sequencer_unregister_client().
Referenced by delete_fluid_sequencer().
FLUIDSYNTH_API int fluid_sequencer_get_use_system_timer | ( | fluid_sequencer_t * | seq | ) |
Check if a sequencer is using the system timer or not.
seq | Sequencer object |
References fluid_sequencer_get_use_system_timer().
Referenced by fluid_sequencer_get_use_system_timer(), and fluid_sequencer_register_fluidsynth().
FLUIDSYNTH_API short fluid_sequencer_register_client | ( | fluid_sequencer_t * | seq, | |
const char * | name, | |||
fluid_event_callback_t | callback, | |||
void * | data | |||
) |
Register a sequencer client.
seq | Sequencer object | |
name | Name of sequencer client | |
callback | Sequencer client callback or NULL for a source client. | |
data | User data to pass to the callback |
Clients can be sources or destinations of events. Sources don't need to register a callback.
References FLUID_FAILED, fluid_log(), FLUID_PANIC, and fluid_sequencer_register_client().
Referenced by fluid_sequencer_register_client(), and fluid_sequencer_register_fluidsynth().
FLUIDSYNTH_API void fluid_sequencer_unregister_client | ( | fluid_sequencer_t * | seq, | |
short | id | |||
) |
Unregister a previously registered client.
seq | Sequencer object | |
id | Client ID as returned by fluid_sequencer_register_client(). |
References delete_fluid_event(), fluid_event_set_dest(), fluid_event_unregistering(), fluid_sequencer_get_tick(), fluid_sequencer_unregister_client(), and new_fluid_event().
Referenced by delete_fluid_sequencer(), and fluid_sequencer_unregister_client().
FLUIDSYNTH_API int fluid_sequencer_count_clients | ( | fluid_sequencer_t * | seq | ) |
Count a sequencers registered clients.
seq | Sequencer object |
References fluid_sequencer_count_clients().
Referenced by fluid_sequencer_count_clients().
FLUIDSYNTH_API short fluid_sequencer_get_client_id | ( | fluid_sequencer_t * | seq, | |
int | index | |||
) |
Get a client ID from its index (order in which it was registered).
seq | Sequencer object | |
index | Index of register client |
References FLUID_FAILED, and fluid_sequencer_get_client_id().
Referenced by fluid_sequencer_get_client_id().
FLUIDSYNTH_API char* fluid_sequencer_get_client_name | ( | fluid_sequencer_t * | seq, | |
int | id | |||
) |
Get the name of a registered client.
seq | Sequencer object | |
id | Client ID |
References fluid_sequencer_get_client_name().
Referenced by fluid_sequencer_get_client_name().
FLUIDSYNTH_API int fluid_sequencer_client_is_dest | ( | fluid_sequencer_t * | seq, | |
int | id | |||
) |
Check if a client is a destination client.
seq | Sequencer object | |
id | Client ID |
References fluid_sequencer_client_is_dest().
Referenced by fluid_sequencer_client_is_dest().
FLUIDSYNTH_API void fluid_sequencer_process | ( | fluid_sequencer_t * | seq, | |
unsigned int | msec | |||
) |
Advance a sequencer that isn't using the system timer.
seq | Sequencer object | |
msec | Time to advance sequencer to (absolute time since sequencer start). |
References fluid_sequencer_process().
Referenced by fluid_sequencer_process().
FLUIDSYNTH_API void fluid_sequencer_send_now | ( | fluid_sequencer_t * | seq, | |
fluid_event_t * | evt | |||
) |
Send an event immediately.
seq | Sequencer object | |
evt | Event to send (copied) |
References fluid_event_get_dest(), fluid_sequencer_get_tick(), and fluid_sequencer_send_now().
Referenced by fluid_sequencer_send_now().
FLUIDSYNTH_API int fluid_sequencer_send_at | ( | fluid_sequencer_t * | seq, | |
fluid_event_t * | evt, | |||
unsigned int | time, | |||
int | absolute | |||
) |
Schedule an event for sending at a later time.
seq | Sequencer object | |
evt | Event to send | |
time | Time value in ticks (in milliseconds with the default time scale of 1000). | |
absolute | TRUE if time is absolute sequencer time (time since sequencer creation), FALSE if relative to current time. |
References fluid_sequencer_get_tick(), and fluid_sequencer_send_at().
Referenced by fluid_sequencer_add_midi_event_to_buffer(), and fluid_sequencer_send_at().
FLUIDSYNTH_API void fluid_sequencer_remove_events | ( | fluid_sequencer_t * | seq, | |
short | source, | |||
short | dest, | |||
int | type | |||
) |
Remove events from the event queue.
seq | Sequencer object | |
source | Source client ID to match or -1 for wildcard | |
dest | Destination client ID to match or -1 for wildcard | |
type | Event type to match or -1 for wildcard (fluid_seq_event_type) |
References fluid_sequencer_remove_events().
Referenced by fluid_sequencer_remove_events().
FLUIDSYNTH_API unsigned int fluid_sequencer_get_tick | ( | fluid_sequencer_t * | seq | ) |
Get the current tick of a sequencer.
seq | Sequencer object |
References fluid_sequencer_get_tick().
Referenced by fluid_sequencer_add_midi_event_to_buffer(), fluid_sequencer_get_tick(), fluid_sequencer_send_at(), fluid_sequencer_send_now(), and fluid_sequencer_unregister_client().
FLUIDSYNTH_API void fluid_sequencer_set_time_scale | ( | fluid_sequencer_t * | seq, | |
double | scale | |||
) |
Set the time scale of a sequencer.
seq | Sequencer object | |
scale | Sequencer scale value in ticks per second (default is 1000 for 1 tick per millisecond, max is 1000.0) |
If there are already scheduled events in the sequencer and the scale is changed the events are adjusted accordingly.
References fluid_log(), fluid_sequencer_set_time_scale(), and FLUID_WARN.
Referenced by fluid_sequencer_set_time_scale().
FLUIDSYNTH_API double fluid_sequencer_get_time_scale | ( | fluid_sequencer_t * | seq | ) |
Get a sequencer's time scale.
seq | Sequencer object. |
References fluid_sequencer_get_time_scale().
Referenced by fluid_sequencer_get_time_scale().