Audio plugin host https://kx.studio/carla
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.

62 lines
1.4KB

  1. /*
  2. ZynAddSubFX - a software synthesizer
  3. EngineMgr.h - MIDI/Audio Factory
  4. Copyright (C) 2016 Mark McCurry
  5. This program is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License
  7. as published by the Free Software Foundation; either version 2
  8. of the License, or (at your option) any later version.
  9. */
  10. #ifndef ENGINE_MGR_H
  11. #define ENGINE_MGR_H
  12. #include <list>
  13. #include <string>
  14. #include "Engine.h"
  15. namespace zyncarla {
  16. class MidiIn;
  17. class AudioOut;
  18. class OutMgr;
  19. struct SYNTH_T;
  20. /**Container/Owner of the long lived Engines*/
  21. class EngineMgr
  22. {
  23. public:
  24. static EngineMgr &getInstance(
  25. const SYNTH_T *synth = nullptr,
  26. const class oss_devs_t* oss_devs = nullptr);
  27. ~EngineMgr();
  28. /**Gets requested engine
  29. * @param name case unsensitive name of engine
  30. * @return pointer to Engine or NULL
  31. */
  32. Engine *getEng(std::string name);
  33. /**Start up defaults*/
  34. bool start();
  35. /**Stop all engines*/
  36. void stop();
  37. std::list<Engine *> engines;
  38. //return false on failure
  39. bool setInDefault(std::string name);
  40. bool setOutDefault(std::string name);
  41. //default I/O
  42. AudioOut *defaultOut;
  43. MidiIn *defaultIn;
  44. private:
  45. EngineMgr(const SYNTH_T *synth, const oss_devs_t &oss_devs);
  46. };
  47. }
  48. #endif