audio.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /* -*- mode: c; tab-width: 4; c-basic-offset: 4; c-file-style: "linux" -*- */
  2. //
  3. // Copyright (c) 2009-2011, Wei Mingzhi <whistler_wmz@users.sf.net>.
  4. // Copyright (c) 2011-2017, SDLPAL development team.
  5. // All rights reserved.
  6. //
  7. // This file is part of SDLPAL.
  8. //
  9. // SDLPAL is free software: you can redistribute it and/or modify
  10. // it under the terms of the GNU General Public License as published by
  11. // the Free Software Foundation, either version 3 of the License, or
  12. // (at your option) any later version.
  13. //
  14. // This program is distributed in the hope that it will be useful,
  15. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. // GNU General Public License for more details.
  18. //
  19. // You should have received a copy of the GNU General Public License
  20. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. //
  22. #ifndef AUDIO_H
  23. #define AUDIO_H
  24. #include "common.h"
  25. PAL_C_LINKAGE_BEGIN
  26. INT
  27. AUDIO_OpenDevice(
  28. VOID
  29. );
  30. VOID
  31. AUDIO_CloseDevice(
  32. VOID
  33. );
  34. SDL_AudioSpec*
  35. AUDIO_GetDeviceSpec(
  36. VOID
  37. );
  38. VOID
  39. AUDIO_IncreaseVolume(
  40. VOID
  41. );
  42. VOID
  43. AUDIO_DecreaseVolume(
  44. VOID
  45. );
  46. VOID
  47. AUDIO_PlayMusic(
  48. INT iNumRIX,
  49. BOOL fLoop,
  50. FLOAT flFadeTime
  51. );
  52. BOOL
  53. AUDIO_PlayCDTrack(
  54. INT iNumTrack
  55. );
  56. VOID
  57. AUDIO_PlaySound(
  58. INT iSoundNum
  59. );
  60. VOID
  61. AUDIO_EnableMusic(
  62. BOOL fEnable
  63. );
  64. BOOL
  65. AUDIO_MusicEnabled(
  66. VOID
  67. );
  68. VOID
  69. AUDIO_EnableSound(
  70. BOOL fEnable
  71. );
  72. BOOL
  73. AUDIO_SoundEnabled(
  74. VOID
  75. );
  76. PAL_C_LINKAGE_END
  77. #define AUDIO_IsIntegerConversion(a) (((a) % gConfig.iSampleRate) == 0 || (gConfig.iSampleRate % (a)) == 0)
  78. #endif