libfluidsynth
2.1.1
|
Command shell interface. More...
Functions | |
FLUIDSYNTH_API fluid_istream_t | fluid_get_stdin (void) |
Get standard in stream handle. More... | |
FLUIDSYNTH_API fluid_ostream_t | fluid_get_stdout (void) |
Get standard output stream handle. More... | |
FLUIDSYNTH_API char * | fluid_get_userconf (char *buf, int len) |
Get the user specific FluidSynth command file name. More... | |
FLUIDSYNTH_API char * | fluid_get_sysconf (char *buf, int len) |
Get the system FluidSynth command file name. More... | |
FLUIDSYNTH_API fluid_cmd_handler_t * | new_fluid_cmd_handler (fluid_synth_t *synth, fluid_midi_router_t *router) |
Create a new command handler. More... | |
FLUIDSYNTH_API void | delete_fluid_cmd_handler (fluid_cmd_handler_t *handler) |
Delete a command handler. More... | |
FLUIDSYNTH_API int | fluid_command (fluid_cmd_handler_t *handler, const char *cmd, fluid_ostream_t out) |
Process a string command. More... | |
FLUIDSYNTH_API int | fluid_source (fluid_cmd_handler_t *handler, const char *filename) |
Execute shell commands in a file. More... | |
FLUIDSYNTH_API void | fluid_usershell (fluid_settings_t *settings, fluid_cmd_handler_t *handler) |
A convenience function to create a shell interfacing to standard input/output console streams. More... | |
FLUIDSYNTH_API fluid_shell_t * | new_fluid_shell (fluid_settings_t *settings, fluid_cmd_handler_t *handler, fluid_istream_t in, fluid_ostream_t out, int thread) |
Create a new FluidSynth command shell. More... | |
FLUIDSYNTH_API void | delete_fluid_shell (fluid_shell_t *shell) |
Delete a FluidSynth command shell. More... | |
FLUIDSYNTH_API fluid_server_t * | new_fluid_server (fluid_settings_t *settings, fluid_synth_t *synth, fluid_midi_router_t *router) |
Create a new TCP/IP command shell server. More... | |
FLUIDSYNTH_API void | delete_fluid_server (fluid_server_t *server) |
Delete a TCP/IP shell server. More... | |
FLUIDSYNTH_API int | fluid_server_join (fluid_server_t *server) |
Join a shell server thread (wait until it quits). More... | |
Command shell interface.
The shell interface allows you to send simple textual commands to the synthesizer, to parse a command file, or to read commands from the stdin or other input streams.
FLUIDSYNTH_API fluid_istream_t fluid_get_stdin | ( | void | ) |
FLUIDSYNTH_API fluid_ostream_t fluid_get_stdout | ( | void | ) |
Get standard output stream handle.
Referenced by fluid_source(), and fluid_usershell().
FLUIDSYNTH_API char* fluid_get_userconf | ( | char * | buf, |
int | len | ||
) |
Get the user specific FluidSynth command file name.
buf | Caller supplied string buffer to store file name to. |
len | Length of buf |
FLUIDSYNTH_API char* fluid_get_sysconf | ( | char * | buf, |
int | len | ||
) |
Get the system FluidSynth command file name.
buf | Caller supplied string buffer to store file name to. |
len | Length of buf |
FLUIDSYNTH_API fluid_cmd_handler_t* new_fluid_cmd_handler | ( | fluid_synth_t * | synth, |
fluid_midi_router_t * | router | ||
) |
Create a new command handler.
synth | If not NULL, all the default synthesizer commands will be added to the new handler. |
router | If not NULL, all the default midi_router commands will be added to the new handler. |
FLUIDSYNTH_API void delete_fluid_cmd_handler | ( | fluid_cmd_handler_t * | handler | ) |
Delete a command handler.
handler | Command handler to delete |
FLUIDSYNTH_API int fluid_command | ( | fluid_cmd_handler_t * | handler, |
const char * | cmd, | ||
fluid_ostream_t | out | ||
) |
Process a string command.
NOTE: FluidSynth 1.0.8 and above no longer modifies the 'cmd' string.
handler | FluidSynth command handler |
cmd | Command string (NOTE: Gets modified by FluidSynth prior to 1.0.8) |
out | Output stream to display command response to |
References FLUID_FAILED.
FLUIDSYNTH_API int fluid_source | ( | fluid_cmd_handler_t * | handler, |
const char * | filename | ||
) |
Execute shell commands in a file.
handler | Command handler callback |
filename | File name |
References fluid_get_stdout().
FLUIDSYNTH_API void fluid_usershell | ( | fluid_settings_t * | settings, |
fluid_cmd_handler_t * | handler | ||
) |
A convenience function to create a shell interfacing to standard input/output console streams.
settings | Settings instance for the shell |
handler | Command handler callback |
References fluid_get_stdin(), and fluid_get_stdout().
FLUIDSYNTH_API fluid_shell_t* new_fluid_shell | ( | fluid_settings_t * | settings, |
fluid_cmd_handler_t * | handler, | ||
fluid_istream_t | in, | ||
fluid_ostream_t | out, | ||
int | thread | ||
) |
Create a new FluidSynth command shell.
settings | Setting parameters to use with the shell |
handler | Command handler |
in | Input stream |
out | Output stream |
thread | TRUE if shell should be run in a separate thread, FALSE to run it in the current thread (function blocks until "quit") |
References delete_fluid_shell(), and FLUID_PANIC.
FLUIDSYNTH_API void delete_fluid_shell | ( | fluid_shell_t * | shell | ) |
Delete a FluidSynth command shell.
shell | Command shell instance |
Referenced by new_fluid_shell().
FLUIDSYNTH_API fluid_server_t* new_fluid_server | ( | fluid_settings_t * | settings, |
fluid_synth_t * | synth, | ||
fluid_midi_router_t * | router | ||
) |
Create a new TCP/IP command shell server.
settings | Settings instance to use for the shell |
synth | If not NULL, the synth instance for the command handler to be used by the client |
router | If not NULL, the midi_router instance for the command handler to be used by the client |
References FLUID_ERR, fluid_settings_getint(), and FLUID_WARN.
FLUIDSYNTH_API void delete_fluid_server | ( | fluid_server_t * | server | ) |
Delete a TCP/IP shell server.
server | Shell server instance |
FLUIDSYNTH_API int fluid_server_join | ( | fluid_server_t * | server | ) |
Join a shell server thread (wait until it quits).
server | Shell server instance |
References FLUID_FAILED.