OMUSIC.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Seven Kingdoms: Ancient Adversaries
  3. *
  4. * Copyright 1997,1998 Enlight Software Ltd.
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. *
  19. */
  20. // Filename : OMUSIC.H
  21. // Description : header of music
  22. #ifndef __OMUSIC_H
  23. #define __OMUSIC_H
  24. #define MUSIC_PLAY_LOOPED 1
  25. #define MUSIC_PLAY_CD 2
  26. #define MUSIC_CD_THEN_WAV 4
  27. class Music
  28. {
  29. public:
  30. int init_flag;
  31. int song_id;
  32. int music_channel;
  33. int play_type; // 0 = non-looped, 1 = looped, bit 1 = play from CD (looped not supported)
  34. public:
  35. Music();
  36. ~Music();
  37. void init();
  38. void deinit();
  39. int stop();
  40. int play(int songId, int playType=1);
  41. int is_playing(int songId=0);
  42. void change_volume(int volume); // 0-100
  43. void yield();
  44. static int max_song();
  45. static int random_bgm_track(int excludeId = 0);
  46. };
  47. extern Music music;
  48. #endif