sdl_a.cpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. TiMidity -- Experimental MIDI to WAVE converter
  3. Copyright (C) 1995 Tuukka Toivonen <toivonen@clinet.fi>
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. sdl_a.c
  16. Functions to output RIFF WAVE format data to a file or stdout.
  17. */
  18. #include "config.h"
  19. #include "output.h"
  20. /* export the playback mode */
  21. #define dpm sdl_play_mode
  22. static int open_output(void); /* 0=success, 1=warning, -1=fatal error */
  23. static void close_output(void);
  24. static void output_data(int *buf, int count, int* bytes_written);
  25. static void flush_output(void);
  26. static void purge_output(void);
  27. PlayMode dpm = {
  28. DEFAULT_RATE, PE_16BIT|PE_SIGNED,
  29. "SDL audio", 0, "d:\\out.wav",
  30. open_output,
  31. close_output,
  32. output_data,
  33. flush_output,
  34. purge_output
  35. };
  36. /* Dummies */
  37. static int open_output(void){
  38. return 0;
  39. }
  40. static void output_data(int *buf, int count, int* bytes_written){}
  41. static void close_output(void){}
  42. static void flush_output(void) { }
  43. static void purge_output(void) { }