|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- /*
- * DISTRHO Notes Plugin
- * Copyright (C) 2012-2013 Filipe Coelho <falktx@falktx.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * For a full copy of the GNU General Public License see the GPL.txt file
- */
-
- #ifndef __DISTRHO_UI_NOTES_HPP__
- #define __DISTRHO_UI_NOTES_HPP__
-
- #include "DistrhoUIQt.hpp"
- #include "paramspinbox.hpp"
-
- #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
- # include <QtWidgets/QProgressBar>
- # include <QtWidgets/QGridLayout>
- # include <QtWidgets/QLabel>
- # include <QtWidgets/QPushButton>
- # include <QtWidgets/QTextEdit>
- #else
- # include <QtGui/QGridLayout>
- # include <QtGui/QLabel>
- # include <QtGui/QPushButton>
- # include <QtGui/QTextEdit>
- #endif
-
- class QResizeEvent;
-
- START_NAMESPACE_DISTRHO
-
- // -------------------------------------------------
-
- class DistrhoUINotes : public QtUI
- {
- Q_OBJECT
-
- public:
- DistrhoUINotes();
- ~DistrhoUINotes() override;
-
- protected:
- // ---------------------------------------------
- // Information
-
- bool d_resizable() const override
- {
- return true;
- }
-
- uint d_minimumWidth() const override
- {
- return 180;
- }
-
- uint d_minimumHeight() const override
- {
- return 150;
- }
-
- // ---------------------------------------------
- // DSP Callbacks
-
- void d_parameterChanged(uint32_t index, float value) override;
- void d_stateChanged(const char* key, const char* value) override;
-
- // ---------------------------------------------
- // UI Callbacks
-
- void d_uiIdle() override;
-
- // ---------------------------------------------
- // listen for resize events
-
- void resizeEvent(QResizeEvent*) override;
-
- private slots:
- void buttonClicked(bool click);
- void progressBarValueChanged(float value);
- void textChanged();
-
- private:
- int fCurPage;
- int fSaveSizeNowChecker;
- int fSaveTextNowChecker;
-
- QString fNotes[100];
-
- QTextEdit fTextEdit;
- QPushButton fButton;
- ParamProgressBar fProgressBar;
- QLabel fSpacer;
- QGridLayout fGridLayout;
-
- void saveCurrentTextState();
- };
-
- // -------------------------------------------------
-
- END_NAMESPACE_DISTRHO
-
- #endif // __DISTRHO_UI_NOTES_HPP__
|