lmms
Cross-platform music production software
Toggle main menu visibility
Loading...
Searching...
No Matches
include
ModelVisitor.h
Go to the documentation of this file.
1
/*
2
* ModelVisitor.h - visitors for automatable models
3
*
4
* Copyright (c) 2019-2019 Johannes Lorenz <j.git$$$lorenz-ho.me, $$$=@>
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_MODEL_VISITOR_H
26
#define LMMS_MODEL_VISITOR_H
27
28
namespace
lmms
29
{
30
31
32
class
AutomatableModel
;
33
class
BoolModel
;
34
class
IntModel
;
35
class
FloatModel
;
36
class
ComboBoxModel
;
37
class
TempoSyncKnobModel
;
38
39
class
ModelVisitor
40
{
41
template
<
class
ParentType = AutomatableModel,
class
ModelType>
42
void
up
(ModelType& m) {
visit
(
static_cast<
ParentType&
>
(m)); }
43
public
:
44
virtual
void
visit
(
AutomatableModel
& ) {}
45
virtual
void
visit
(
BoolModel
& m);
46
virtual
void
visit
(
IntModel
& m);
47
virtual
void
visit
(
FloatModel
& m);
48
virtual
void
visit
(
ComboBoxModel
& m);
49
virtual
void
visit
(
TempoSyncKnobModel
& m);
50
virtual
~ModelVisitor
() =
default
;
51
};
52
53
class
ConstModelVisitor
54
{
55
template
<
class
ParentType = AutomatableModel,
class
ModelType>
56
void
up
(
const
ModelType& m) {
57
visit
(
static_cast<
const
ParentType&
>
(m)); }
58
public
:
59
virtual
void
visit
(
const
AutomatableModel
& ) {}
60
virtual
void
visit
(
const
BoolModel
& m);
61
virtual
void
visit
(
const
IntModel
& m);
62
virtual
void
visit
(
const
FloatModel
& m);
63
virtual
void
visit
(
const
ComboBoxModel
& m);
64
virtual
void
visit
(
const
TempoSyncKnobModel
& m);
65
virtual
~ConstModelVisitor
() =
default
;
66
};
67
68
69
}
// namespace lmms
70
71
#endif
// LMMS_MODEL_VISITOR_H
lmms::AutomatableModel
Definition
AutomatableModel.h:77
lmms::BoolModel
Definition
AutomatableModel.h:502
lmms::ComboBoxModel
Definition
ComboBoxModel.h:39
lmms::ConstModelVisitor
Definition
ModelVisitor.h:54
lmms::ConstModelVisitor::up
void up(const ModelType &m)
Definition
ModelVisitor.h:56
lmms::ConstModelVisitor::~ConstModelVisitor
virtual ~ConstModelVisitor()=default
lmms::ConstModelVisitor::visit
virtual void visit(const AutomatableModel &)
Definition
ModelVisitor.h:59
lmms::FloatModel
Definition
AutomatableModel.h:468
lmms::IntModel
Definition
AutomatableModel.h:486
lmms::ModelVisitor
Definition
ModelVisitor.h:40
lmms::ModelVisitor::~ModelVisitor
virtual ~ModelVisitor()=default
lmms::ModelVisitor::up
void up(ModelType &m)
Definition
ModelVisitor.h:42
lmms::ModelVisitor::visit
virtual void visit(AutomatableModel &)
Definition
ModelVisitor.h:44
lmms::TempoSyncKnobModel
Definition
TempoSyncKnobModel.h:45
lmms
Definition
RemotePluginBase.cpp:34
Generated on
for lmms by
1.18.0