1 /* 2 * Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/> 3 * (C) 2020 Vladimir Sadovnikov <sadko4u@gmail.com> 4 * 5 * This file is part of lsp-plugins 6 * Created on: 9 авг. 2017 г. 7 * 8 * lsp-plugins is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU Lesser General Public License as published by 10 * the Free Software Foundation, either version 3 of the License, or 11 * any later version. 12 * 13 * lsp-plugins is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public License 19 * along with lsp-plugins. If not, see <https://www.gnu.org/licenses/>. 20 */ 21 22 #ifndef UI_TK_LSPITEM_H_ 23 #define UI_TK_LSPITEM_H_ 24 25 namespace lsp 26 { 27 namespace tk 28 { 29 class LSPItem 30 { 31 protected: 32 class LocalString: public LSPLocalString 33 { 34 private: 35 friend class LSPItem; 36 37 protected: 38 LSPItem *pItem; 39 40 protected: 41 virtual void sync(); 42 43 public: LocalString(LSPItem * item)44 inline LocalString(LSPItem *item) { pItem = item; } 45 }; 46 47 protected: 48 LocalString sText; 49 float fValue; 50 51 public: 52 explicit LSPItem(); 53 explicit LSPItem(const LSPItem *src); 54 virtual ~LSPItem(); 55 56 protected: 57 virtual void on_change(); 58 59 public: text()60 inline LSPLocalString *text() { return &sText; } text()61 inline const LSPLocalString *text() const { return &sText; } value()62 inline float value() const { return fValue; } 63 64 public: 65 status_t set(const LSPItem *src); 66 void set_value(float value); 67 }; 68 69 } /* namespace tk */ 70 } /* namespace lsp */ 71 72 #endif /* UI_TK_LSPITEM_H_ */ 73