Collection of tools useful for audio production
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.

72 lines
1.6KB

  1. /*
  2. * Carla bridge code
  3. * Copyright (C) 2011-2012 Filipe Coelho <falktx@gmail.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * For a full copy of the GNU General Public License see the COPYING file
  16. */
  17. #ifndef CARLA_BRIDGE_TOOLKIT_H
  18. #define CARLA_BRIDGE_TOOLKIT_H
  19. #include "carla_bridge.h"
  20. #include <cstdlib>
  21. #include <cstring>
  22. CARLA_BRIDGE_START_NAMESPACE
  23. /*!
  24. * @defgroup CarlaBridgeToolkit Carla Bridge Toolkit
  25. *
  26. * The Carla Bridge Toolkit.
  27. * @{
  28. */
  29. class CarlaToolkit
  30. {
  31. public:
  32. CarlaToolkit(const char* const title)
  33. {
  34. Q_ASSERT(title);
  35. m_title = strdup(title ? title : "(null)");
  36. m_client = nullptr;
  37. }
  38. virtual ~CarlaToolkit()
  39. {
  40. if (m_title)
  41. free(m_title);
  42. }
  43. virtual void init() = 0;
  44. virtual void exec(CarlaClient* const client, const bool showGui) = 0;
  45. virtual void quit() = 0;
  46. virtual void show() = 0;
  47. virtual void hide() = 0;
  48. virtual void resize(int width, int height) = 0;
  49. static CarlaToolkit* createNew(const char* const title);
  50. protected:
  51. char* m_title;
  52. CarlaClient* m_client;
  53. };
  54. /**@}*/
  55. CARLA_BRIDGE_END_NAMESPACE
  56. #endif // CARLA_BRIDGE_TOOLKIT_H