libfluidsynth  2.3.5
Command Handler

Handles text commands and reading of configuration files. More...

Lifecycle Functions for Command Handler_linebr@{

fluid_cmd_handler_tnew_fluid_cmd_handler (fluid_synth_t *synth, fluid_midi_router_t *router)
 Create a new command handler. More...
 
fluid_cmd_handler_tnew_fluid_cmd_handler2 (fluid_settings_t *settings, fluid_synth_t *synth, fluid_midi_router_t *router, fluid_player_t *player)
 Create a new command handler. More...
 
void delete_fluid_cmd_handler (fluid_cmd_handler_t *handler)
 Delete a command handler. More...
 

Functions

int fluid_command (fluid_cmd_handler_t *handler, const char *cmd, fluid_ostream_t out)
 Process a string command. More...
 
int fluid_source (fluid_cmd_handler_t *handler, const char *filename)
 Execute shell commands in a file. More...
 

Detailed Description

Handles text commands and reading of configuration files.

Function Documentation

◆ delete_fluid_cmd_handler()

void delete_fluid_cmd_handler ( fluid_cmd_handler_t handler)

Delete a command handler.

Parameters
handlerCommand handler to delete

◆ fluid_command()

int fluid_command ( fluid_cmd_handler_t handler,
const char *  cmd,
fluid_ostream_t  out 
)

Process a string command.

Parameters
handlerFluidSynth command handler
cmdCommand string (NOTE: Gets modified by FluidSynth prior to 1.0.8)
outOutput stream to display command response to
Returns
Integer value corresponding to: -1 on command error, 0 on success, 1 if 'cmd' is a comment or is empty and -2 if quit was issued
Note
FluidSynth 1.0.8 and above no longer modifies the 'cmd' string.

◆ fluid_source()

int fluid_source ( fluid_cmd_handler_t handler,
const char *  filename 
)

Execute shell commands in a file.

Parameters
handlerCommand handler callback
filenameFile name
Returns
0 on success, a negative value on error

◆ new_fluid_cmd_handler()

fluid_cmd_handler_t* new_fluid_cmd_handler ( fluid_synth_t synth,
fluid_midi_router_t router 
)

Create a new command handler.

See new_fluid_cmd_handler2() for more information.

◆ new_fluid_cmd_handler2()

fluid_cmd_handler_t* new_fluid_cmd_handler2 ( fluid_settings_t settings,
fluid_synth_t synth,
fluid_midi_router_t router,
fluid_player_t player 
)

Create a new command handler.

Parameters
settingsIf not NULL, all the settings related commands will be added to the new handler. The settings object must be the same as the one you used for creating the synth and router. Otherwise the behaviour is undefined.
synthIf not NULL, all the default synthesizer commands will be added to the new handler.
routerIf not NULL, all the default midi_router commands will be added to the new handler.
playerIf not NULL, all the default midi file player commands will be added to the new handler.
Returns
New command handler, or NULL if alloc failed