aRts audio server
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.

bus.h 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. Copyright (C) 1998-2000 Stefan Westerfeld
  3. stefan@space.twc.de
  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. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Library General Public License for more details.
  12. You should have received a copy of the GNU Library General Public License
  13. along with this library; see the file COPYING.LIB. If not, write to
  14. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  15. Boston, MA 02110-1301, USA.
  16. */
  17. #ifndef ARTS_BUS_H
  18. #define ARTS_BUS_H
  19. #include "stdsynthmodule.h"
  20. #include "artsflow.h"
  21. /*
  22. * BC - Status (2002-03-08): BusClient, BusManager
  23. *
  24. * None of these classes is considered part of the public API. Do NOT use it
  25. * in your apps. These are part of the implementation of libartsflow's
  26. * Synth_BUS_* and Synth_AMAN_* and AudioManager interfaces. Use these for
  27. * public use instead, and don't touch this here.
  28. */
  29. namespace Arts {
  30. class BusClient
  31. {
  32. public:
  33. virtual Arts::ScheduleNode *snode() = 0;
  34. };
  35. class BusManager
  36. {
  37. protected:
  38. struct Bus
  39. {
  40. std::string name;
  41. std::list<BusClient *> clients;
  42. std::list<BusClient *> servers;
  43. Arts::Synth_MULTI_ADD left, right;
  44. };
  45. std::list<Bus *> _busList;
  46. BusManager();
  47. public:
  48. Bus* findBus(const std::string& name);
  49. void addClient(const std::string& busname, BusClient *client);
  50. void removeClient(BusClient *client);
  51. void addServer(const std::string& busname, BusClient *server);
  52. void removeServer(BusClient *server);
  53. std::vector<std::string> *busList();
  54. static BusManager *the();
  55. };
  56. }
  57. #endif /* ARTS_BUS_H */