LMMS
Loading...
Searching...
No Matches
Lv2ViewBase.h
Go to the documentation of this file.
1/*
2 * Lv2ViewBase.h - base class for Lv2 plugin views
3 *
4 * Copyright (c) 2018-2023 Johannes Lorenz <jlsf2013$users.sourceforge.net, $=@>
5 *
6 * This file is part of LMMS - https://lmms.io
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This program 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 GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program (see COPYING); if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301 USA.
22 *
23 */
24
25#ifndef LMMS_GUI_LV2_VIEW_BASE_H
26#define LMMS_GUI_LV2_VIEW_BASE_H
27
28#include "lmmsconfig.h"
29
30#ifdef LMMS_HAVE_LV2
31
32
34#include "lmms_export.h"
35#include "Lv2Basics.h"
36
37
38class QPushButton;
39class QMdiSubWindow;
40namespace lmms
41{
42
43
44class Lv2Proc;
45class Lv2ControlBase;
46
47
48namespace gui
49{
50
51
54{
55public:
57 Lv2ViewProc(QWidget *parent, Lv2Proc *proc, int colNum);
58 ~Lv2ViewProc() override = default;
59
60private:
61 static AutoLilvNode uri(const char *uriStr);
62};
63
64
65
66
67class HelpWindowEventFilter : public QObject
68{
69 Q_OBJECT
70 class Lv2ViewBase* const m_viewBase;
71protected:
72 bool eventFilter(QObject* obj, QEvent* event) override;
73public:
74 HelpWindowEventFilter(class Lv2ViewBase* viewBase);
75};
76
77
78
79
81class LMMS_EXPORT Lv2ViewBase : public LinkedModelGroupsView
82{
84protected:
86 Lv2ViewBase(class QWidget *pluginWidget, Lv2ControlBase *ctrlBase);
88
89 // these widgets must be connected by child widgets
90 QPushButton* m_reloadPluginButton = nullptr;
91 QPushButton* m_toggleUIButton = nullptr;
92 QPushButton* m_helpButton = nullptr;
93
94 void toggleUI();
95 void toggleHelp(bool visible);
96 void closeHelpWindow();
97
98 // to be called by child virtuals
100 void modelChanged(Lv2ControlBase* ctrlBase);
101
102private:
109
110 static AutoLilvNode uri(const char *uriStr);
112 void onHelpWindowClosed();
113
115
117 const int m_colNum = 6;
118 QMdiSubWindow* m_helpWindow = nullptr;
120};
121
122
123} // namespace gui
124
125} // namespace lmms
126
127#endif // LMMS_HAVE_LV2
128
129#endif // LMMS_GUI_LV2_VIEW_BASE_H
Definition Lv2ControlBase.h:75
Definition Lv2Proc.h:66
class Lv2ViewBase *const m_viewBase
Definition Lv2ViewBase.h:70
HelpWindowEventFilter(class Lv2ViewBase *viewBase)
Definition Lv2ViewBase.cpp:271
bool eventFilter(QObject *obj, QEvent *event) override
Definition Lv2ViewBase.cpp:277
Definition LinkedModelGroupViews.h:63
LinkedModelGroupView(QWidget *parent, LinkedModelGroup *model, std::size_t colNum)
Definition LinkedModelGroupViews.cpp:41
Definition LinkedModelGroupViews.h:103
Base class for view for one Lv2 plugin.
Definition Lv2ViewBase.h:82
void closeHelpWindow()
Definition Lv2ViewBase.cpp:233
Lv2ViewBase(class QWidget *pluginWidget, Lv2ControlBase *ctrlBase)
Definition Lv2ViewBase.cpp:140
Lv2ViewProc * m_procView
Definition Lv2ViewBase.h:114
LinkedModelGroupView * getGroupView() override
Definition Lv2ViewBase.h:111
QPushButton * m_helpButton
Definition Lv2ViewBase.h:92
QMdiSubWindow * m_helpWindow
Definition Lv2ViewBase.h:118
void toggleUI()
Definition Lv2ViewBase.cpp:214
friend class HelpWindowEventFilter
Definition Lv2ViewBase.h:83
Rows
Definition Lv2ViewBase.h:104
@ LinkChannelsRow
Definition Lv2ViewBase.h:107
@ ProcRow
Definition Lv2ViewBase.h:106
@ ButtonRow
Definition Lv2ViewBase.h:105
HelpWindowEventFilter m_helpWindowEventFilter
Definition Lv2ViewBase.h:119
void toggleHelp(bool visible)
Definition Lv2ViewBase.cpp:221
void modelChanged(Lv2ControlBase *ctrlBase)
Reconnect models if model changed.
Definition Lv2ViewBase.cpp:241
QPushButton * m_reloadPluginButton
Definition Lv2ViewBase.h:90
QPushButton * m_toggleUIButton
Definition Lv2ViewBase.h:91
const int m_colNum
Numbers of controls per row; must be multiple of 2 for mono effects.
Definition Lv2ViewBase.h:117
View for one processor, Lv2ViewBase contains 2 of those for mono plugins.
Definition Lv2ViewBase.h:54
~Lv2ViewProc() override=default
static AutoLilvNode uri(const char *uriStr)
Definition Lv2ViewBase.cpp:132
Lv2ViewProc(QWidget *parent, Lv2Proc *proc, int colNum)
Definition Lv2ViewBase.cpp:55
static uintptr_t parent
Definition pugl.h:1644
static SordNode * uri(SordWorld *world, int num)
Definition sord_test.c:47
Definition AudioPortAudio.cpp:223
Definition AudioAlsa.cpp:35
std::unique_ptr< LilvNode, LilvNodeDeleter > AutoLilvNode
Definition Lv2Basics.h:63