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.

114 lines
2.8KB

  1. /*
  2. * DISTRHO Notes Plugin
  3. * Copyright (C) 2012-2013 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation; either version 2 of
  8. * the License, or 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 doc/GPL.txt file.
  16. */
  17. #ifndef DISTRHO_UI_NOTES_HPP_INCLUDED
  18. #define DISTRHO_UI_NOTES_HPP_INCLUDED
  19. #include "DistrhoUIQt.hpp"
  20. #include "paramspinbox.hpp"
  21. #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
  22. # include <QtWidgets/QProgressBar>
  23. # include <QtWidgets/QGridLayout>
  24. # include <QtWidgets/QLabel>
  25. # include <QtWidgets/QPushButton>
  26. # include <QtWidgets/QTextEdit>
  27. #else
  28. # include <QtGui/QGridLayout>
  29. # include <QtGui/QLabel>
  30. # include <QtGui/QPushButton>
  31. # include <QtGui/QTextEdit>
  32. #endif
  33. class QResizeEvent;
  34. START_NAMESPACE_DISTRHO
  35. // -----------------------------------------------------------------------
  36. class DistrhoUINotes : public QtUI
  37. {
  38. Q_OBJECT
  39. public:
  40. DistrhoUINotes();
  41. ~DistrhoUINotes() override;
  42. protected:
  43. // -------------------------------------------------------------------
  44. // Information
  45. bool d_isResizable() const noexcept override
  46. {
  47. return true;
  48. }
  49. uint d_getMinimumWidth() const noexcept override
  50. {
  51. return 180;
  52. }
  53. uint d_getMinimumHeight() const noexcept override
  54. {
  55. return 150;
  56. }
  57. // -------------------------------------------------------------------
  58. // DSP Callbacks
  59. void d_parameterChanged(uint32_t index, float value) override;
  60. void d_stateChanged(const char* key, const char* value) override;
  61. // -------------------------------------------------------------------
  62. // UI Callbacks
  63. void d_uiIdle() override;
  64. // -------------------------------------------------------------------
  65. // listen for resize events
  66. void resizeEvent(QResizeEvent*) override;
  67. // -------------------------------------------------------------------
  68. private slots:
  69. void buttonClicked(bool click);
  70. void progressBarValueChanged(float value);
  71. void textChanged();
  72. private:
  73. int fCurPage;
  74. int fSaveSizeNowChecker;
  75. int fSaveTextNowChecker;
  76. QString fNotes[100];
  77. QTextEdit fTextEdit;
  78. QPushButton fButton;
  79. ParamProgressBar fProgressBar;
  80. QLabel fSpacer;
  81. QGridLayout fGridLayout;
  82. void saveCurrentTextState();
  83. };
  84. // -----------------------------------------------------------------------
  85. END_NAMESPACE_DISTRHO
  86. #endif // DISTRHO_UI_NOTES_HPP_INCLUDED