|
| 1 | +/* |
| 2 | + * Copyright (C) 2026 Linux Studio Plugins Project <https://lsp-plug.in/> |
| 3 | + * (C) 2026 Vladimir Sadovnikov <sadko4u@gmail.com> |
| 4 | + * |
| 5 | + * This file is part of lsp-plugins-deesser |
| 6 | + * Created on: 27 июн. 2026 г. |
| 7 | + * |
| 8 | + * lsp-plugins-deesser 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-deesser 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-deesser. If not, see <https://www.gnu.org/licenses/>. |
| 20 | + */ |
| 21 | + |
| 22 | +#ifndef PRIVATE_UI_DEESSER_H_ |
| 23 | +#define PRIVATE_UI_DEESSER_H_ |
| 24 | + |
| 25 | +#include <lsp-plug.in/plug-fw/ui.h> |
| 26 | +#include <lsp-plug.in/tk/tk.h> |
| 27 | +#include <lsp-plug.in/lltl/darray.h> |
| 28 | + |
| 29 | +namespace lsp |
| 30 | +{ |
| 31 | + namespace plugui |
| 32 | + { |
| 33 | + /** |
| 34 | + * UI for Deesser plugin series |
| 35 | + */ |
| 36 | + class deesser_ui: public ui::Module, public ui::IPortListener |
| 37 | + { |
| 38 | + protected: |
| 39 | + typedef struct filter_label_t |
| 40 | + { |
| 41 | + ui::IPort *pFreq; // Port that contains frequency value |
| 42 | + ui::IPort *pLevel; // Port that contains amplification value |
| 43 | + tk::Widget *wWidget; // Associated widget |
| 44 | + tk::GraphText *wText; // Associated text |
| 45 | + const char *sLcKey; // Localization key |
| 46 | + uint32_t nID; // ID |
| 47 | + } filter_label_t; |
| 48 | + |
| 49 | + typedef struct filter_label_meta_t |
| 50 | + { |
| 51 | + const uint32_t id; |
| 52 | + const char *freq_id; |
| 53 | + const char *lvl_id; |
| 54 | + const char *widget_id; |
| 55 | + const char *text_id; |
| 56 | + const char *lc_key; |
| 57 | + } filter_label_meta_t; |
| 58 | + |
| 59 | + protected: |
| 60 | + static const filter_label_meta_t filter_label_meta[]; |
| 61 | + |
| 62 | + protected: |
| 63 | + lltl::darray<filter_label_t> vFilterLabels; |
| 64 | + |
| 65 | + protected: |
| 66 | + static status_t slot_filter_label_mouse_in(tk::Widget *sender, void *ptr, void *data); |
| 67 | + static status_t slot_filter_label_mouse_out(tk::Widget *sender, void *ptr, void *data); |
| 68 | + |
| 69 | + protected: |
| 70 | + void add_filter_label(const filter_label_meta_t * meta); |
| 71 | + void update_filter_label_text(filter_label_t *label); |
| 72 | + |
| 73 | + public: |
| 74 | + explicit deesser_ui(const meta::plugin_t *meta); |
| 75 | + deesser_ui(const deesser_ui &) = delete; |
| 76 | + deesser_ui(deesser_ui &&) = delete; |
| 77 | + virtual ~deesser_ui() override; |
| 78 | + |
| 79 | + deesser_ui & operator = (const deesser_ui &) = delete; |
| 80 | + deesser_ui & operator = (deesser_ui &&) = delete; |
| 81 | + |
| 82 | + public: |
| 83 | + virtual status_t post_init() override; |
| 84 | + |
| 85 | + virtual void notify(ui::IPort *port, size_t flags) override; |
| 86 | + }; |
| 87 | + } /* namespace plugui */ |
| 88 | +} /* namespace lsp */ |
| 89 | + |
| 90 | + |
| 91 | +#endif /* PRIVATE_UI_DEESSER_H_ */ |
0 commit comments