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.

DistrhoUINotes.hpp 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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 GPL.txt file
  16. */
  17. #ifndef __DISTRHO_UI_NOTES_HPP__
  18. #define __DISTRHO_UI_NOTES_HPP__
  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_resizable() const override
  46. {
  47. return true;
  48. }
  49. uint d_minimumWidth() const override
  50. {
  51. return 180;
  52. }
  53. uint d_minimumHeight() const 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. private slots:
  68. void buttonClicked(bool click);
  69. void progressBarValueChanged(float value);
  70. void textChanged();
  71. private:
  72. int fCurPage;
  73. int fSaveSizeNowChecker;
  74. int fSaveTextNowChecker;
  75. QString fNotes[100];
  76. QTextEdit fTextEdit;
  77. QPushButton fButton;
  78. ParamProgressBar fProgressBar;
  79. QLabel fSpacer;
  80. QGridLayout fGridLayout;
  81. void saveCurrentTextState();
  82. };
  83. // -------------------------------------------------
  84. END_NAMESPACE_DISTRHO
  85. #endif // __DISTRHO_UI_NOTES_HPP__