controls.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. controls.h
  16. */
  17. /* Return values for ControlMode.read */
  18. #define RC_ERROR -1
  19. #define RC_NO_RETURN_VALUE 0
  20. #define RC_QUIT 1
  21. #define RC_NEXT 2
  22. #define RC_PREVIOUS 3 /* Restart this song at beginning, or the previous
  23. song if we're less than a second into this one. */
  24. #define RC_FORWARD 4
  25. #define RC_BACK 5
  26. #define RC_JUMP 6
  27. #define RC_TOGGLE_PAUSE 7 /* Pause/continue */
  28. #define RC_RESTART 8 /* Restart song at beginning */
  29. #define RC_PAUSE 9 /* Really pause playing */
  30. #define RC_CONTINUE 10 /* Continue if paused */
  31. #define RC_REALLY_PREVIOUS 11 /* Really go to the previous song */
  32. #define RC_CHANGE_VOLUME 12
  33. #define RC_LOAD_FILE 13 /* Load a new midifile */
  34. #define RC_TUNE_END 14 /* The tune is over, play it again sam? */
  35. #define CMSG_INFO 0
  36. #define CMSG_WARNING 1
  37. #define CMSG_ERROR 2
  38. #define CMSG_FATAL 3
  39. #define CMSG_TRACE 4
  40. #define CMSG_TIME 5
  41. #define CMSG_TOTAL 6
  42. #define CMSG_FILE 7
  43. #define CMSG_TEXT 8
  44. #define VERB_NORMAL 0
  45. #define VERB_VERBOSE 1
  46. #define VERB_NOISY 2
  47. #define VERB_DEBUG 3
  48. #define VERB_DEBUG_SILLY 4
  49. typedef struct {
  50. char *id_name, id_character;
  51. int verbosity, trace_playing, opened;
  52. int (*open)(int using_stdin, int using_stdout);
  53. void (*pass_playing_list)(int number_of_files, char *list_of_files[]);
  54. void (*close)(void);
  55. int (*read)(int *valp);
  56. int (*cmsg)(int type, int verbosity_level, char *fmt, ...);
  57. void (*refresh)(void);
  58. void (*reset)(void);
  59. void (*file_name)(char *name);
  60. void (*total_time)(int tt);
  61. void (*current_time)(int ct);
  62. void (*note)(int v);
  63. void (*master_volume)(int mv);
  64. void (*program)(int channel, int val); /* val<0 means drum set -val */
  65. void (*volume)(int channel, int val);
  66. void (*expression)(int channel, int val);
  67. void (*panning)(int channel, int val);
  68. void (*sustain)(int channel, int val);
  69. void (*pitch_bend)(int channel, int val);
  70. } ControlMode;
  71. extern ControlMode *ctl_list[], *ctl;
  72. const int TIMIDITY_ERROR_MAX_CHARS = 1024;
  73. extern char timidity_error[];