🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
1.9 KiB

  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.,
  17. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  18. * Or go to http://www.gnu.org/copyleft/lgpl.html
  19. */
  20. #include "config.h"
  21. #include "loopback.h"
  22. #include "core/device.h"
  23. namespace {
  24. struct LoopbackBackend final : public BackendBase {
  25. LoopbackBackend(DeviceBase *device) noexcept : BackendBase{device} { }
  26. void open(const char *name) override;
  27. bool reset() override;
  28. void start() override;
  29. void stop() override;
  30. DEF_NEWDEL(LoopbackBackend)
  31. };
  32. void LoopbackBackend::open(const char *name)
  33. {
  34. mDevice->DeviceName = name;
  35. }
  36. bool LoopbackBackend::reset()
  37. {
  38. setDefaultWFXChannelOrder();
  39. return true;
  40. }
  41. void LoopbackBackend::start()
  42. { }
  43. void LoopbackBackend::stop()
  44. { }
  45. } // namespace
  46. bool LoopbackBackendFactory::init()
  47. { return true; }
  48. bool LoopbackBackendFactory::querySupport(BackendType)
  49. { return true; }
  50. std::string LoopbackBackendFactory::probe(BackendType)
  51. { return std::string{}; }
  52. BackendPtr LoopbackBackendFactory::createBackend(DeviceBase *device, BackendType)
  53. { return BackendPtr{new LoopbackBackend{device}}; }
  54. BackendFactory &LoopbackBackendFactory::getFactory()
  55. {
  56. static LoopbackBackendFactory factory{};
  57. return factory;
  58. }