loopback.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /**
  2. * OpenAL cross platform audio library
  3. * Copyright (C) 2011 by Chris Robinson
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Library General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Library General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Library General Public
  15. * License along with this library; if not, write to the
  16. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17. * Boston, MA 02111-1307, USA.
  18. * Or go to http://www.gnu.org/copyleft/lgpl.html
  19. */
  20. #include "config.h"
  21. #include <stdlib.h>
  22. #include "alMain.h"
  23. #include "AL/al.h"
  24. #include "AL/alc.h"
  25. static ALCenum loopback_open_playback(ALCdevice *device, const ALCchar *deviceName)
  26. {
  27. device->szDeviceName = strdup(deviceName);
  28. return ALC_NO_ERROR;
  29. }
  30. static void loopback_close_playback(ALCdevice *device)
  31. {
  32. (void)device;
  33. }
  34. static ALCboolean loopback_reset_playback(ALCdevice *device)
  35. {
  36. SetDefaultWFXChannelOrder(device);
  37. return ALC_TRUE;
  38. }
  39. static ALCboolean loopback_start_playback(ALCdevice *device)
  40. {
  41. return ALC_TRUE;
  42. (void)device;
  43. }
  44. static void loopback_stop_playback(ALCdevice *device)
  45. {
  46. (void)device;
  47. }
  48. static const BackendFuncs loopback_funcs = {
  49. loopback_open_playback,
  50. loopback_close_playback,
  51. loopback_reset_playback,
  52. loopback_start_playback,
  53. loopback_stop_playback,
  54. NULL,
  55. NULL,
  56. NULL,
  57. NULL,
  58. NULL,
  59. NULL
  60. };
  61. ALCboolean alc_loopback_init(BackendFuncs *func_list)
  62. {
  63. *func_list = loopback_funcs;
  64. return ALC_TRUE;
  65. }
  66. void alc_loopback_deinit(void)
  67. {
  68. }
  69. void alc_loopback_probe(enum DevProbe type)
  70. {
  71. (void)type;
  72. }