| 1 |
/* |
| 2 |
* Copyright (C) 2018-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 <QKeyEvent> |
| 29 |
#include <memory> |
| 30 |
#include "instrument.hpp" |
| 31 |
#include "instrument/instrument_property_defs.hpp" |
| 32 |
#include "gui/instrument_editor/instrument_editor.hpp" |
| 33 |
#include "gui/instrument_editor/visualized_instrument_macro_editor.hpp" |
| 34 |
|
| 35 |
namespace Ui { |
| 36 |
class SsgInstrumentEditor; |
| 37 |
} |
| 38 |
|
| 39 |
class SsgInstrumentEditor final : public InstrumentEditor |
| 40 |
{ |
| 41 |
Q_OBJECT |
| 42 |
|
| 43 |
public: |
| 44 |
SsgInstrumentEditor(int num, QWidget* parent = nullptr); |
| 45 |
~SsgInstrumentEditor() override; |
| 46 |
|
| 47 |
/** |
| 48 |
* @brief Return sound source of instrument related to this dialog. |
| 49 |
* @return SSG. |
| 50 |
*/ |
| 51 |
SoundSource getSoundSource() const override; |
| 52 |
|
| 53 |
/** |
| 54 |
* @brief Return instrument type of instrument related to this dialog. |
| 55 |
* @return SSG. |
| 56 |
*/ |
| 57 |
InstrumentType getInstrumentType() const override; |
| 58 |
|
| 59 |
void updateByConfigurationChange() override; |
| 60 |
|
| 61 |
protected: |
| 62 |
void keyPressEvent(QKeyEvent* event) override; |
| 63 |
void keyReleaseEvent(QKeyEvent* event) override; |
| 64 |
|
| 65 |
private: |
| 66 |
Ui::SsgInstrumentEditor *ui; |
| 67 |
bool isIgnoreEvent_; |
| 68 |
|
| 69 |
// SSG specific process called in settiing core / cofiguration / color palette. |
| 70 |
void updateBySettingCore() override; |
| 71 |
void updateBySettingConfiguration() override {} |
| 72 |
void updateBySettingColorPalette() override; |
| 73 |
|
| 74 |
void updateInstrumentParameters(); |
| 75 |
|
| 76 |
//========== Waveform ==========// |
| 77 |
signals: |
| 78 |
void waveformNumberChanged(); |
| 79 |
void waveformParameterChanged(int wfNum, int fromInstNum); |
| 80 |
|
| 81 |
public slots: |
| 82 |
void onWaveformNumberChanged(); |
| 83 |
void onWaveformParameterChanged(int wfNum); |
| 84 |
|
| 85 |
private: |
| 86 |
void setInstrumentWaveformParameters(); |
| 87 |
SSGWaveformUnit setWaveformSequenceColumn(int col, int wfRow); |
| 88 |
|
| 89 |
private slots: |
| 90 |
void on_waveEditGroupBox_toggled(bool arg1); |
| 91 |
void on_waveNumSpinBox_valueChanged(int arg1); |
| 92 |
void on_squareMaskRawSpinBox_valueChanged(int arg1); |
| 93 |
|
| 94 |
//========== Tone/Noise ==========// |
| 95 |
signals: |
| 96 |
void toneNoiseNumberChanged(); |
| 97 |
void toneNoiseParameterChanged(int tnNum, int fromInstNum); |
| 98 |
|
| 99 |
public slots: |
| 100 |
void onToneNoiseNumberChanged(); |
| 101 |
void onToneNoiseParameterChanged(int tnNum); |
| 102 |
|
| 103 |
private: |
| 104 |
void setInstrumentToneNoiseParameters(); |
| 105 |
|
| 106 |
private slots: |
| 107 |
void on_tnEditGroupBox_toggled(bool arg1); |
| 108 |
void on_tnNumSpinBox_valueChanged(int arg1); |
| 109 |
|
| 110 |
//========== Envelope ==========// |
| 111 |
signals: |
| 112 |
void envelopeNumberChanged(); |
| 113 |
void envelopeParameterChanged(int wfNum, int fromInstNum); |
| 114 |
|
| 115 |
public slots: |
| 116 |
void onEnvelopeNumberChanged(); |
| 117 |
void onEnvelopeParameterChanged(int envNum); |
| 118 |
|
| 119 |
private: |
| 120 |
void setInstrumentEnvelopeParameters(); |
| 121 |
SSGEnvelopeUnit setEnvelopeSequenceColumn(int col, int envRow); |
| 122 |
|
| 123 |
private slots: |
| 124 |
void on_envEditGroupBox_toggled(bool arg1); |
| 125 |
void on_envNumSpinBox_valueChanged(int arg1); |
| 126 |
void on_hardFreqRawSpinBox_valueChanged(int arg1); |
| 127 |
|
| 128 |
//========== Arpeggio ==========// |
| 129 |
signals: |
| 130 |
void arpeggioNumberChanged(); |
| 131 |
void arpeggioParameterChanged(int arpNum, int fromInstNum); |
| 132 |
|
| 133 |
public slots: |
| 134 |
void onArpeggioNumberChanged(); |
| 135 |
void onArpeggioParameterChanged(int arpNum); |
| 136 |
|
| 137 |
private: |
| 138 |
void setInstrumentArpeggioParameters(); |
| 139 |
|
| 140 |
private slots: |
| 141 |
void onArpeggioTypeChanged(int); |
| 142 |
void on_arpEditGroupBox_toggled(bool arg1); |
| 143 |
void on_arpNumSpinBox_valueChanged(int arg1); |
| 144 |
|
| 145 |
//========== Pitch ==========// |
| 146 |
signals: |
| 147 |
void pitchNumberChanged(); |
| 148 |
void pitchParameterChanged(int ptNum, int fromInstNum); |
| 149 |
|
| 150 |
public slots: |
| 151 |
void onPitchNumberChanged(); |
| 152 |
void onPitchParameterChanged(int ptNum); |
| 153 |
|
| 154 |
private: |
| 155 |
void setInstrumentPitchParameters(); |
| 156 |
|
| 157 |
private slots: |
| 158 |
void onPitchTypeChanged(int); |
| 159 |
void on_ptEditGroupBox_toggled(bool arg1); |
| 160 |
void on_ptNumSpinBox_valueChanged(int arg1); |
| 161 |
}; |