sound.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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 SOUND_H
  22. #define SOUND_H
  23. #include "common.h"
  24. #ifndef PAL_SAMPLE_RATE
  25. #define PAL_SAMPLE_RATE 44100 /*49716*/
  26. #endif
  27. #ifndef PAL_CHANNELS
  28. #define PAL_CHANNELS 2
  29. #endif
  30. #ifdef __cplusplus
  31. extern "C"
  32. {
  33. #endif
  34. INT
  35. SOUND_OpenAudio(
  36. VOID
  37. );
  38. VOID
  39. SOUND_CloseAudio(
  40. VOID
  41. );
  42. VOID
  43. SOUND_PlayChannel(
  44. INT iSoundNum,
  45. INT iChannel
  46. );
  47. #ifdef __SYMBIAN32__
  48. VOID
  49. SOUND_AdjustVolume(
  50. INT iDirectory
  51. );
  52. #endif
  53. VOID
  54. PAL_PlayMUS(
  55. INT iNumRIX,
  56. BOOL fLoop,
  57. FLOAT flFadeTime
  58. );
  59. BOOL
  60. SOUND_PlayCDA(
  61. INT iNumTrack
  62. );
  63. #ifdef PAL_CLASSIC
  64. extern int g_iCurrChannel;
  65. #define SOUND_Play(i) SOUND_PlayChannel((i), (g_iCurrChannel ^= 1))
  66. #else
  67. #define SOUND_Play(i) SOUND_PlayChannel((i), 0)
  68. #endif
  69. extern BOOL g_fNoSound;
  70. extern BOOL g_fNoMusic;
  71. #ifdef PAL_HAS_NATIVEMIDI
  72. extern BOOL g_fUseMidi;
  73. #endif
  74. #ifdef __cplusplus
  75. }
  76. #endif
  77. #endif