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: 10 сент. 2019 г.
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_PLUGINS_PARAEQUALIZERUI_H_
23 #define UI_PLUGINS_PARAEQUALIZERUI_H_
24 
25 #include <ui/ui.h>
26 #include <ui/ctl/ctl.h>
27 
28 namespace lsp
29 {
30 
31     class para_equalizer_ui: public plugin_ui
32     {
33         protected:
34             CtlPort            *pRewPath;
35             LSPFileDialog      *pRewImport;
36             const char        **fmtStrings;
37 
38         protected:
39             static status_t slot_start_import_rew_file(LSPWidget *sender, void *ptr, void *data);
40             static status_t slot_call_import_rew_file(LSPWidget *sender, void *ptr, void *data);
41             static status_t slot_fetch_rew_path(LSPWidget *sender, void *ptr, void *data);
42             static status_t slot_commit_rew_path(LSPWidget *sender, void *ptr, void *data);
43 
44         protected:
45             status_t    import_rew_file(const LSPString *path);
46             void        set_port_value(const char *base, size_t id, float value);
47 
48             void        set_filter_mode(size_t id, size_t value);
49             void        set_filter_type(size_t id, size_t value);
50             void        set_filter_frequency(size_t id, double value);
51             void        set_filter_quality(size_t id, double value);
52             void        set_filter_gain(size_t id, double value);
53             void        set_filter_slope(size_t id, size_t slope);
54             void        set_filter_enabled(size_t id, bool enabled);
55             void        set_filter_solo(size_t id, bool solo);
56 
57         public:
58             explicit para_equalizer_ui(const plugin_metadata_t *mdata, void *root_widget);
59             virtual ~para_equalizer_ui();
60 
61         public:
62             virtual status_t    build();
63     };
64 
65 } /* namespace lsp */
66 
67 #endif /* UI_PLUGINS_PARAEQUALIZERUI_H_ */
68