Command shell interface. More...
Data Structures | |
struct | fluid_cmd_t |
Shell command information structure. More... | |
Typedefs | |
typedef int(* | fluid_cmd_func_t )(void *data, int ac, char **av, fluid_ostream_t out) |
Command handler function prototype. | |
typedef fluid_cmd_handler_t *(* | fluid_server_newclient_func_t )(void *data, char *addr) |
Callback function which is executed for new server connections. | |
Functions | |
FLUIDSYNTH_API fluid_istream_t | fluid_get_stdin (void) |
Get standard in stream handle. | |
FLUIDSYNTH_API fluid_ostream_t | fluid_get_stdout (void) |
Get standard output stream handle. | |
FLUIDSYNTH_API char * | fluid_get_userconf (char *buf, int len) |
Get the user specific FluidSynth command file name. | |
FLUIDSYNTH_API char * | fluid_get_sysconf (char *buf, int len) |
Get the system FluidSynth command file name. | |
FLUIDSYNTH_API fluid_cmd_handler_t * | new_fluid_cmd_handler (fluid_synth_t *synth) |
Create a new command handler. | |
FLUIDSYNTH_API void | delete_fluid_cmd_handler (fluid_cmd_handler_t *handler) |
Delete a command handler. | |
FLUIDSYNTH_API int | fluid_cmd_handler_register (fluid_cmd_handler_t *handler, fluid_cmd_t *cmd) |
Register a new command to the handler. | |
FLUIDSYNTH_API int | fluid_cmd_handler_unregister (fluid_cmd_handler_t *handler, const char *cmd) |
Unregister a command from a command handler. | |
FLUIDSYNTH_API int | fluid_command (fluid_cmd_handler_t *handler, const char *cmd, fluid_ostream_t out) |
Process a string command. | |
FLUIDSYNTH_API int | fluid_source (fluid_cmd_handler_t *handler, const char *filename) |
Execute shell commands in a file. | |
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. | |
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. | |
FLUIDSYNTH_API void | delete_fluid_shell (fluid_shell_t *shell) |
Delete a FluidSynth command shell. |
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.
typedef int(* fluid_cmd_func_t)(void *data, int ac, char **av, fluid_ostream_t out) |
Command handler function prototype.
data | User defined data | |
ac | Argument count | |
av | Array of string arguments | |
out | Output stream to send response to |
typedef fluid_cmd_handler_t*(* fluid_server_newclient_func_t)(void *data, char *addr) |
Callback function which is executed for new server connections.
data | User defined data supplied in call to new_fluid_server() | |
addr | The IP address of the client (can be NULL) |
FLUIDSYNTH_API fluid_istream_t fluid_get_stdin | ( | void | ) |
Get standard in stream handle.
FLUIDSYNTH_API fluid_ostream_t fluid_get_stdout | ( | void | ) |
Get standard output stream handle.
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 | ) |
Create a new command handler.
synth | If not NULL, all the default synthesizer 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_cmd_handler_register | ( | fluid_cmd_handler_t * | handler, | |
fluid_cmd_t * | cmd | |||
) |
Register a new command to the handler.
handler | Command handler instance | |
cmd | Command info (gets copied) |
FLUIDSYNTH_API int fluid_cmd_handler_unregister | ( | fluid_cmd_handler_t * | handler, | |
const char * | cmd | |||
) |
Unregister a command from a command handler.
handler | Command handler instance | |
cmd | Name of the command |
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 |
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 |
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 |
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") |
FLUIDSYNTH_API void delete_fluid_shell | ( | fluid_shell_t * | shell | ) |
Delete a FluidSynth command shell.
shell | Command shell instance |