timidity_sdl_c.cpp

Go to the documentation of this file.
00001 /* 
00002 
00003     TiMidity -- Experimental MIDI to WAVE converter
00004     Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019 
00020     sdl_c.c
00021     Minimal control mode -- no interaction, just stores messages.
00022     */
00023 
00024 #include "pent_include.h"
00025 
00026 #ifdef USE_TIMIDITY_MIDI
00027 
00028 #include <cstdio>
00029 #include <cstdlib>
00030 #include <cstdarg>
00031 
00032 #include "timidity.h"
00033 #include "timidity_common.h"
00034 #include "timidity_output.h"
00035 #include "timidity_controls.h"
00036 #include "timidity_instrum.h"
00037 #include "timidity_playmidi.h"
00038 
00039 #ifdef NS_TIMIDITY
00040 namespace NS_TIMIDITY {
00041 #endif
00042 
00043 static void ctl_refresh(void);
00044 static void ctl_total_time(int tt);
00045 static void ctl_master_volume(int mv);
00046 static void ctl_file_name(char *name);
00047 static void ctl_current_time(int ct);
00048 static void ctl_note(int v);
00049 static void ctl_program(int ch, int val);
00050 static void ctl_volume(int channel, int val);
00051 static void ctl_expression(int channel, int val);
00052 static void ctl_panning(int channel, int val);
00053 static void ctl_sustain(int channel, int val);
00054 static void ctl_pitch_bend(int channel, int val);
00055 static void ctl_reset(void);
00056 static int ctl_open(int using_stdin, int using_stdout);
00057 static void ctl_close(void);
00058 static int ctl_read(sint32 *valp);
00059 static int cmsg(int type, int verbosity_level, char *fmt, ...);
00060 
00061 /**********************************/
00062 /* export the interface functions */
00063 
00064 #define ctl sdl_control_mode
00065 
00066 ControlMode ctl= 
00067 {
00068   "SDL interface", 's',
00069   OF_NORMAL,0,0,
00070   ctl_open,NULL, ctl_close, ctl_read, cmsg,
00071   ctl_refresh, ctl_reset, ctl_file_name, ctl_total_time, ctl_current_time, 
00072   ctl_note, 
00073   ctl_master_volume, ctl_program, ctl_volume, 
00074   ctl_expression, ctl_panning, ctl_sustain, ctl_pitch_bend
00075 };
00076 
00077 static int ctl_open(int using_stdin, int using_stdout)
00078 {
00079   ctl.opened=1;
00080   return 0;
00081 }
00082 
00083 static void ctl_close(void)
00084 { 
00085   ctl.opened=0;
00086 }
00087 
00088 static int ctl_read(sint32 *valp)
00089 {
00090   return TM_RC_NONE;
00091 }
00092 
00093 static int cmsg(int type, int verbosity_level, char *fmt, ...)
00094 {
00095   va_list ap;
00096   if ((type==CMSG_TEXT || type==CMSG_INFO || type==CMSG_WARNING) &&
00097       ctl.verbosity<verbosity_level)
00098     return 0;
00099   va_start(ap, fmt);
00100   vsprintf(timidity_error, fmt, ap);
00101   va_end(ap);
00102   //perr.printf ("%s\n", timidity_error);
00103   return 0;
00104 }
00105 
00106 static void ctl_refresh(void) { }
00107 
00108 static void ctl_total_time(int tt) {}
00109 
00110 static void ctl_master_volume(int mv) {}
00111 
00112 static void ctl_file_name(char *name) {}
00113 
00114 static void ctl_current_time(int ct) {}
00115 
00116 static void ctl_note(int v) {}
00117 
00118 static void ctl_program(int ch, int val) {}
00119 
00120 static void ctl_volume(int channel, int val) {}
00121 
00122 static void ctl_expression(int channel, int val) {}
00123 
00124 static void ctl_panning(int channel, int val) {}
00125 
00126 static void ctl_sustain(int channel, int val) {}
00127 
00128 static void ctl_pitch_bend(int channel, int val) {}
00129 
00130 static void ctl_reset(void) {}
00131 
00132 #ifdef NS_TIMIDITY
00133 };
00134 #endif
00135 
00136 #endif //USE_TIMIDITY_MIDI

Generated on Fri Jul 27 22:27:45 2007 for pentagram by  doxygen 1.4.7