Debian Codegraph @

BambooTracker/gui/instrument_editor/adpcm_instrument_editor.hpp

raw
1 /*
2 * Copyright (C) 2020-2022 Rerrah
3 *
4 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation
6 * files (the "Software"), to deal in the Software without
7 * restriction, including without limitation the rights to use,
8 * copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following
11 * conditions:
12 *
13 * The above copyright notice and this permission notice shall be
14 * included in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
24 */
25
26 #pragma once
27
28 #include <memory>
29 #include <QKeyEvent>
30 #include "gui/instrument_editor/instrument_editor.hpp"
31 #include "gui/instrument_editor/visualized_instrument_macro_editor.hpp"
32
33 namespace Ui {
34 class AdpcmInstrumentEditor;
35 }
36
37 class AdpcmInstrumentEditor final : public InstrumentEditor
38 {
39 Q_OBJECT
40
41 public:
42 explicit AdpcmInstrumentEditor(int num, QWidget* parent = nullptr);
43 ~AdpcmInstrumentEditor() override;
44
45 /**
46 * @brief Return sound source of instrument related to this dialog.
47 * @return ADPCM.
48 */
49 SoundSource getSoundSource() const override;
50
51 /**
52 * @brief Return instrument type of instrument related to this dialog.
53 * @return ADPCM.
54 */
55 InstrumentType getInstrumentType() const override;
56
57 void updateByConfigurationChange() override;
58
59 protected:
60 void keyPressEvent(QKeyEvent* event) override;
61 void keyReleaseEvent(QKeyEvent* event) override;
62
63 private:
64 Ui::AdpcmInstrumentEditor *ui;
65 bool isIgnoreEvent_;
66
67 // ADPCM specific process called in settiing core / cofiguration / color palette.
68 void updateBySettingCore() override;
69 void updateBySettingConfiguration() override;
70 void updateBySettingColorPalette() override;
71
72 void updateInstrumentParameters();
73
74 //========== Sample ==========//
75 signals:
76 void sampleNumberChanged();
77 void sampleParameterChanged(int sampNum, int fromInstNum);
78 void sampleAssignRequested();
79 void sampleMemoryChanged();
80
81 public slots:
82 void onSampleNumberChanged();
83 void onSampleParameterChanged(int sampNum);
84 void onSampleMemoryUpdated();
85
86 private:
87 void setInstrumentSampleParameters();
88
89 //========== Envelope ==========//
90 signals:
91 void envelopeNumberChanged();
92 void envelopeParameterChanged(int envNum, int fromInstNum);
93
94 public slots:
95 void onEnvelopeNumberChanged();
96 void onEnvelopeParameterChanged(int envNum);
97
98 private:
99 void setInstrumentEnvelopeParameters();
100
101 private slots:
102 void on_envEditGroupBox_toggled(bool arg1);
103 void on_envNumSpinBox_valueChanged(int arg1);
104
105 //========== Arpeggio ==========//
106 signals:
107 void arpeggioNumberChanged();
108 void arpeggioParameterChanged(int arpNum, int fromInstNum);
109
110 public slots:
111 void onArpeggioNumberChanged();
112 void onArpeggioParameterChanged(int arpNum);
113
114 private:
115 void setInstrumentArpeggioParameters();
116
117 private slots:
118 void onArpeggioTypeChanged(int);
119 void on_arpEditGroupBox_toggled(bool arg1);
120 void on_arpNumSpinBox_valueChanged(int arg1);
121
122 //========== Pitch ==========//
123 signals:
124 void pitchNumberChanged();
125 void pitchParameterChanged(int ptNum, int fromInstNum);
126
127 public slots:
128 void onPitchNumberChanged();
129 void onPitchParameterChanged(int ptNum);
130
131 private:
132 void setInstrumentPitchParameters();
133
134 private slots:
135 void onPitchTypeChanged(int);
136 void on_ptEditGroupBox_toggled(bool arg1);
137 void on_ptNumSpinBox_valueChanged(int arg1);
138
139 //========== Pan ==========//
140 signals:
141 void panNumberChanged();
142 void panParameterChanged(int panNum, int fromInstNum);
143
144 public slots:
145 void onPanNumberChanged();
146 void onPanParameterChanged(int arpNum);
147
148 private:
149 void setInstrumentPanParameters();
150
151 private slots:
152 void on_panEditGroupBox_toggled(bool arg1);
153 void on_panNumSpinBox_valueChanged(int arg1);
154 };