forked from Geonkick-Synthesizer/geonkick
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpercussion_model.h
113 lines (105 loc) · 3.6 KB
/
percussion_model.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/**
* File name: percussion_model.h
* Project: Geonkick (A percussion synthesizer)
*
* Copyright (C) 2020 Iurie Nistor
*
* This file is part of Geonkick.
*
* GeonKick is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef PERCUSSION_MODEL_H
#define PERCUSSION_MODEL_H
#include "globals.h"
class GeonkickApi;
class GeonkickState;
class KitModel;
class PercussionModel : public RkObject {
public:
using PercussionIndex = int;
using KeyIndex = GeonkickTypes::MidiKey;
explicit PercussionModel(KitModel* parent, int id = -1);
virtual ~PercussionModel() = default;
void setId(int id);
PercussionIndex index() const;
void select();
bool isSelected() const;
void increasePercussionChannel();
void decreasePercussionChannel();
size_t keysNumber() const;
void setKey(KeyIndex keyIndex);
KeyIndex key() const;
void setName(const std::string &name);
std::string name() const;
void setChannel(int index);
int channel() const;
size_t numberOfChannels() const;
bool canCopy() const;
bool canRemove() const;
void play();
void setLimiter(int value);
int limiter() const;
int leveler() const;
void mute(bool b);
bool isMuted() const;
void solo(bool b);
bool isSolo() const;
void remove();
void copy();
KitModel* model() const;
std::vector<float> data() const;
RK_DECL_ACT(modelUpdated,
modelUpdated(),
RK_ARG_TYPE(),
RK_ARG_VAL());
RK_DECL_ACT(selected,
selected(),
RK_ARG_TYPE(),
RK_ARG_VAL());
RK_DECL_ACT(nameUpdated,
nameUpdated(std::string name),
RK_ARG_TYPE(std::string),
RK_ARG_VAL(name));
RK_DECL_ACT(keyUpdated,
keyUpdated(KeyIndex key),
RK_ARG_TYPE(KeyIndex),
RK_ARG_VAL(key));
RK_DECL_ACT(channelUpdated,
channelUpdated(int val),
RK_ARG_TYPE(int),
RK_ARG_VAL(val));
RK_DECL_ACT(limiterUpdated,
limiterUpdated(int val),
RK_ARG_TYPE(int),
RK_ARG_VAL(val));
RK_DECL_ACT(levelerUpdated,
levelerUpdated(int val),
RK_ARG_TYPE(int),
RK_ARG_VAL(val));
RK_DECL_ACT(muteUpdated,
muteUpdated(bool b),
RK_ARG_TYPE(bool),
RK_ARG_VAL(b));
RK_DECL_ACT(soloUpdated,
soloUpdated(bool b),
RK_ARG_TYPE(bool),
RK_ARG_VAL(b));
protected:
void onPercussionSelected();
private:
KitModel* kitModel;
int percussionId;
};
#endif // PERCUSSION_MODEL_H