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.

58 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. class MidiIn;
  16. class AudioOut;
  17. class OutMgr;
  18. struct SYNTH_T;
  19. /**Container/Owner of the long lived Engines*/
  20. class EngineMgr
  21. {
  22. public:
  23. static EngineMgr &getInstance(
  24. const SYNTH_T *synth = nullptr,
  25. const class oss_devs_t* oss_devs = nullptr);
  26. ~EngineMgr();
  27. /**Gets requested engine
  28. * @param name case unsensitive name of engine
  29. * @return pointer to Engine or NULL
  30. */
  31. Engine *getEng(std::string name);
  32. /**Start up defaults*/
  33. bool start();
  34. /**Stop all engines*/
  35. void stop();
  36. std::list<Engine *> engines;
  37. //return false on failure
  38. bool setInDefault(std::string name);
  39. bool setOutDefault(std::string name);
  40. //default I/O
  41. AudioOut *defaultOut;
  42. MidiIn *defaultIn;
  43. private:
  44. EngineMgr(const SYNTH_T *synth, const oss_devs_t &oss_devs);
  45. };
  46. #endif