audio.h 1.6 KB

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