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.

63 lines
1.5KB

  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 <cassert>
  21. #include <cstring>
  22. //CARLA_BRIDGE_START_NAMESPACE
  23. namespace CarlaBridge {
  24. class CarlaBridgeToolkit
  25. {
  26. public:
  27. CarlaBridgeToolkit(const char* const title)
  28. {
  29. assert(title);
  30. m_title = strdup(title);
  31. m_client = nullptr;
  32. }
  33. virtual ~CarlaBridgeToolkit()
  34. {
  35. free((void*)m_title);
  36. }
  37. virtual void init() = 0;
  38. virtual void exec(CarlaBridgeClient* const client) = 0;
  39. virtual void quit() = 0;
  40. virtual void show() = 0;
  41. virtual void hide() = 0;
  42. virtual void resize(int width, int height) = 0;
  43. static CarlaBridgeToolkit* createNew(const char* const title);
  44. protected:
  45. const char* m_title;
  46. CarlaBridgeClient* m_client;
  47. };
  48. CARLA_BRIDGE_END_NAMESPACE
  49. #endif // CARLA_BRIDGE_TOOLKIT_H