MUSIC.H 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. Copyright (C) 1994-1995 Apogee Software, Ltd.
  3. This program is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU General Public License
  5. as published by the Free Software Foundation; either version 2
  6. of the License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. See the GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. /**********************************************************************
  16. module: MUSIC.H
  17. author: James R. Dose
  18. date: March 25, 1994
  19. Public header for MUSIC.C
  20. (c) Copyright 1994 James R. Dose. All Rights Reserved.
  21. **********************************************************************/
  22. #ifndef __MUSIC_H
  23. #define __MUSIC_H
  24. #include "sndcards.h"
  25. extern int MUSIC_ErrorCode;
  26. enum MUSIC_ERRORS
  27. {
  28. MUSIC_Warning = -2,
  29. MUSIC_Error = -1,
  30. MUSIC_Ok = 0,
  31. MUSIC_ASSVersion,
  32. MUSIC_SoundCardError,
  33. MUSIC_MPU401Error,
  34. MUSIC_InvalidCard,
  35. MUSIC_MidiError,
  36. MUSIC_TaskManError,
  37. MUSIC_FMNotDetected,
  38. MUSIC_DPMI_Error
  39. };
  40. typedef struct
  41. {
  42. unsigned long tickposition;
  43. unsigned long milliseconds;
  44. unsigned int measure;
  45. unsigned int beat;
  46. unsigned int tick;
  47. } songposition;
  48. #define MUSIC_LoopSong ( 1 == 1 )
  49. #define MUSIC_PlayOnce ( !MUSIC_LoopSong )
  50. char *MUSIC_ErrorString( int ErrorNumber );
  51. int MUSIC_Init( int SoundCard, int Address );
  52. int MUSIC_Shutdown( void );
  53. void MUSIC_SetMaxFMMidiChannel( int channel );
  54. void MUSIC_SetVolume( int volume );
  55. void MUSIC_SetMidiChannelVolume( int channel, int volume );
  56. void MUSIC_ResetMidiChannelVolumes( void );
  57. int MUSIC_GetVolume( void );
  58. void MUSIC_SetLoopFlag( int loopflag );
  59. int MUSIC_SongPlaying( void );
  60. void MUSIC_Continue( void );
  61. void MUSIC_Pause( void );
  62. int MUSIC_StopSong( void );
  63. int MUSIC_PlaySong( unsigned char *song, int loopflag );
  64. void MUSIC_SetContext( int context );
  65. int MUSIC_GetContext( void );
  66. void MUSIC_SetSongTick( unsigned long PositionInTicks );
  67. void MUSIC_SetSongTime( unsigned long milliseconds );
  68. void MUSIC_SetSongPosition( int measure, int beat, int tick );
  69. void MUSIC_GetSongPosition( songposition *pos );
  70. void MUSIC_GetSongLength( songposition *pos );
  71. int MUSIC_FadeVolume( int tovolume, int milliseconds );
  72. int MUSIC_FadeActive( void );
  73. void MUSIC_StopFade( void );
  74. void MUSIC_RerouteMidiChannel( int channel, int cdecl ( *function )( int event, int c1, int c2 ) );
  75. void MUSIC_RegisterTimbreBank( unsigned char *timbres );
  76. #endif