Main Page   Data Structures   File List   Data Fields   Globals  

shell.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_SHELL_H
00022 #define _FLUIDSYNTH_SHELL_H
00023 
00024 
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028 
00029 
00030 /*
00031  *
00032  *   Shell interface
00033  *
00034  *   The shell interface allows you to send simple textual commands to
00035  *   the synthesizer, to parse a command file, or to read commands
00036  *   from the stdin or other input streams.
00037  *
00038  *   To find the list of currently supported commands, please check the
00039  *   fluid_cmd.c file.
00040  *   
00041  */
00042 
00043 FLUIDSYNTH_API fluid_istream_t fluid_get_stdin(void);
00044 FLUIDSYNTH_API fluid_ostream_t fluid_get_stdout(void);
00045 
00046 FLUIDSYNTH_API char* fluid_get_userconf(char* buf, int len);
00047 FLUIDSYNTH_API char* fluid_get_sysconf(char* buf, int len);
00048 
00049 
00052 typedef int (*fluid_cmd_func_t)(void* data, int ac, char** av, fluid_ostream_t out);  
00053 
00054 typedef struct {
00055   char* name;                           
00056   char* topic;                          
00057   fluid_cmd_func_t handler;              
00058   void* data;                           
00059   char* help;                           
00060 } fluid_cmd_t;
00061 
00062 
00073 FLUIDSYNTH_API 
00074 fluid_cmd_handler_t* new_fluid_cmd_handler(fluid_synth_t* synth);
00075 
00076 FLUIDSYNTH_API 
00077 void delete_fluid_cmd_handler(fluid_cmd_handler_t* handler);
00078 
00087 FLUIDSYNTH_API 
00088 int fluid_cmd_handler_register(fluid_cmd_handler_t* handler, fluid_cmd_t* cmd);
00089 
00090 FLUIDSYNTH_API 
00091 int fluid_cmd_handler_unregister(fluid_cmd_handler_t* handler, char* cmd);
00092 
00093 
00096 FLUIDSYNTH_API 
00097 int fluid_command(fluid_cmd_handler_t* handler, char* cmd, fluid_ostream_t out);
00098 
00099 FLUIDSYNTH_API 
00100 int fluid_source(fluid_cmd_handler_t* handler, char* filename);
00101 
00102 FLUIDSYNTH_API 
00103 void fluid_usershell(fluid_settings_t* settings, fluid_cmd_handler_t* handler);
00104 
00105 
00108 FLUIDSYNTH_API 
00109 fluid_shell_t* new_fluid_shell(fluid_settings_t* settings, fluid_cmd_handler_t* handler,
00110                              fluid_istream_t in, fluid_ostream_t out, int thread);
00111 
00112 FLUIDSYNTH_API void delete_fluid_shell(fluid_shell_t* shell);
00113 
00114 
00115 
00118 typedef fluid_cmd_handler_t* (*fluid_server_newclient_func_t)(void* data, char* addr);
00119 
00120 FLUIDSYNTH_API 
00121 fluid_server_t* new_fluid_server(fluid_settings_t* settings, 
00122                                fluid_server_newclient_func_t func,
00123                                void* data);
00124 
00125 FLUIDSYNTH_API void delete_fluid_server(fluid_server_t* server);
00126 
00127 FLUIDSYNTH_API int fluid_server_join(fluid_server_t* server);
00128 
00129 
00130 #ifdef __cplusplus
00131 }
00132 #endif
00133 
00134 #endif /* _FLUIDSYNTH_SHELL_H */

Generated on Thu Mar 13 19:09:34 2003 for libfluidsynth by doxygen1.2.15