audio.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. PAL_C_LINKAGE_BEGIN
  25. INT
  26. AUDIO_OpenDevice(
  27. VOID
  28. );
  29. VOID
  30. AUDIO_CloseDevice(
  31. VOID
  32. );
  33. SDL_AudioSpec*
  34. AUDIO_GetDeviceSpec(
  35. VOID
  36. );
  37. VOID
  38. AUDIO_IncreaseVolume(
  39. VOID
  40. );
  41. VOID
  42. AUDIO_DecreaseVolume(
  43. VOID
  44. );
  45. VOID
  46. AUDIO_PlayMusic(
  47. INT iNumRIX,
  48. BOOL fLoop,
  49. FLOAT flFadeTime
  50. );
  51. BOOL
  52. AUDIO_PlayCDTrack(
  53. INT iNumTrack
  54. );
  55. VOID
  56. AUDIO_PlaySound(
  57. INT iSoundNum
  58. );
  59. VOID
  60. AUDIO_EnableMusic(
  61. BOOL fEnable
  62. );
  63. BOOL
  64. AUDIO_MusicEnabled(
  65. VOID
  66. );
  67. VOID
  68. AUDIO_EnableSound(
  69. BOOL fEnable
  70. );
  71. BOOL
  72. AUDIO_SoundEnabled(
  73. VOID
  74. );
  75. PAL_C_LINKAGE_END
  76. #define AUDIO_IsIntegerConversion(a) (((a) % gConfig.iSampleRate) == 0 || (gConfig.iSampleRate % (a)) == 0)
  77. #endif