hydrogen 1.2.6
InstrumentEditor.h
Go to the documentation of this file.
1/*
2 * Hydrogen
3 * Copyright(c) 2002-2008 by Alex >Comix< Cominu [comix@users.sourceforge.net]
4 * Copyright(c) 2008-2025 The hydrogen development team [hydrogen-devel@lists.sourceforge.net]
5 *
6 * http://www.hydrogen-music.org
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (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
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see https://www.gnu.org/licenses
20 *
21 */
22
23#ifndef INSTRUMENT_EDITOR_DIALOG_H
24#define INSTRUMENT_EDITOR_DIALOG_H
25
26#include <QtGui>
27#include <QtWidgets>
28#include <memory>
29
31#include <core/Object.h>
33
34#include "../EventListener.h"
37
38class Fader;
39class LCDDisplay;
40class LCDSpinBox;
41class Button;
42class ClickableLabel;
43class Rotary;
44class LCDCombo;
45class WaveDisplay;
46class LayerPreview;
47class WidgetWithInput;
48
52
53class InstrumentEditor : public QWidget, protected WidgetWithScalableFont<10, 12, 14>, public H2Core::Object<InstrumentEditor>, public EventListener
54{
56 Q_OBJECT
57
58 public:
59 explicit InstrumentEditor( QWidget* parent );
61
62 void selectLayer( int nLayer );
63 void setFileforLayer(QString filename );
64
65 void selectComponent( int nComponent );
66
67 // implements EventListener interface
68 virtual void selectedInstrumentChangedEvent() override;
69 virtual void drumkitLoadedEvent() override;
70 virtual void updateSongEvent( int ) override;
71 virtual void instrumentParametersChangedEvent( int ) override;
72 // ~ implements EventListener interface
73 void update();
74 static int findFreeDrumkitComponentId( int startingPoint = 0 );
75
76
77 public slots:
79 void showLayers( bool bShow );
80 void showSampleEditor();
82
83 private slots:
88 void labelClicked( ClickableLabel* pRef );
90 void compoChangeAddDelete(QAction*);
92
93 void muteGroupChanged( double fValue );
94 void onIsStopNoteCheckBoxClicked( bool on );
96 void midiOutChannelChanged( double fValue );
97 void midiOutNoteChanged( double fValue );
98
99 void hihatGroupChanged( double fValue );
100 void hihatMinRangeChanged( double fValue );
101 void hihatMaxRangeChanged( double fValue );
102
103 void sampleSelectionChanged( int );
104
105 void waveDisplayDoubleClicked( QWidget *pRef );
106
107 private:
108 std::shared_ptr<H2Core::Instrument> m_pInstrument;
111
114
115 // Instrument properties
119
120 // ADSR
129
130 // Instrument pitch
139 void setInstrumentPitch();
140
141 // Low pass filter
147
148 // Instrument gain
152
156
157 // Instrument mute group
160
161 // Instrument midi out
167
170
171 // Instrument hihat
172
175
178
181
182 // ~ Instrument properties
183
184 // Layer properties
186 QScrollArea *m_pLayerScrollArea;
187
188
197
200
203
204 //LCDCombo *__pattern_size_combo;
207
209
214 // ~ Layer properties
215
216
217 // Component
220 QStringList itemsCompo;
221 QMenu *popCompo;
222
225 // ~ Component
226
227 void setAutoVelocity();
228};
229
230
231#endif
#define H2_OBJECT(name)
Definition Object.h:227
Generic Button with SVG icons or text.
Definition Button.h:60
Custom QLabel that emits a signal when clicked.
Custom fader widget.
Definition Fader.h:44
Changes
Bitwise or-able options showing which part of the Preferences were altered using the PreferencesDialo...
Rotary * m_pRandomPitchRotary
void labelCompoClicked(ClickableLabel *pRef)
ClickableLabel * m_pLayerPitchLbl
PixmapWidget * m_pInstrumentPropTop
LCDSpinBox * m_pMidiOutNoteLCD
Rotary * m_pPitchCoarseRotary
LCDDisplay * m_pInstrumentGainLCD
LCDSpinBox * m_pHihatMaxRangeLCD
void selectLayer(int nLayer)
ClickableLabel * m_pGainLbl
ClickableLabel * m_pMidiOutNoteLbl
Button * m_buttonDropDownCompo
ClickableLabel * m_pLayerGainLbl
void showLayers(bool bShow)
Used by #Shotlist.
ClickableLabel * m_pPitchFineLbl
ClickableLabel * m_pMuteGroupLbl
ClickableLabel * m_pCompoNameLbl
void hihatGroupChanged(double fValue)
ClickableLabel * m_pReleaseLbl
double m_fPreviousMidiOutChannel
In order to allow for enumerations starting at 1 while using -1 to turn off the LCD.
LCDDisplay * m_pLayerPitchFineLCD
ClickableLabel * m_pHihatGroupLbl
void labelClicked(ClickableLabel *pRef)
ClickableLabel * m_pNameLbl
PixmapWidget * m_pInstrumentProp
void muteGroupChanged(double fValue)
ClickableLabel * m_pCutoffLbl
ClickableLabel * m_pDecayLbl
void onPreferencesChanged(H2Core::Preferences::Changes changes)
void onIsApplyVelocityCheckBoxClicked(bool on)
void onIsStopNoteCheckBoxClicked(bool on)
ClickableLabel * m_pAttackLbl
void selectComponent(int nComponent)
QCheckBox * m_pApplyVelocity
void compoChangeAddDelete(QAction *)
ClickableLabel * m_pHihatMinRangeLbl
virtual void drumkitLoadedEvent() override
virtual void instrumentParametersChangedEvent(int) override
ClickableLabel * m_pCompoGainLbl
ClickableLabel * m_pLayerPitchFineLbl
LCDDisplay * m_pLayerPitchCoarseLCD
Rotary * m_pLayerPitchCoarseRotary
ClickableLabel * m_pIsStopNoteLbl
Button * m_pShowInstrumentBtn
ClickableLabel * m_pResonanceLbl
PixmapWidget * m_pLayerProp
ClickableLabel * m_pPitchCoarseLbl
WaveDisplay * m_pWaveDisplay
ClickableLabel * m_pApplyVelocityLbl
ClickableLabel * m_pLayerPitchCoarseLbl
virtual void selectedInstrumentChangedEvent() override
ClickableLabel * m_pSustainLbl
virtual void updateSongEvent(int) override
ClickableLabel * m_pHihatMaxRangeLbl
LCDSpinBox * m_pMidiOutChannelLCD
void hihatMinRangeChanged(double fValue)
LayerPreview * m_pLayerPreview
Rotary * m_pLayerPitchFineRotary
static int findFreeDrumkitComponentId(int startingPoint=0)
InstrumentEditor(QWidget *parent)
LCDSpinBox * m_pMuteGroupLCD
LCDDisplay * m_pLayerGainLCD
void hihatMaxRangeChanged(double fValue)
void setFileforLayer(QString filename)
LCDCombo * m_sampleSelectionAlg
LCDDisplay * m_pCompoGainLCD
void rotaryChanged(WidgetWithInput *ref)
ClickableLabel * m_pPitchLbl
LCDSpinBox * m_pHihatMinRangeLCD
std::shared_ptr< H2Core::Instrument > m_pInstrument
QScrollArea * m_pLayerScrollArea
LCDSpinBox * m_pHihatGroupLCD
void midiOutNoteChanged(double fValue)
void waveDisplayDoubleClicked(QWidget *pRef)
void midiOutChannelChanged(double fValue)
QCheckBox * m_pIsStopNoteCheckBox
ClickableLabel * m_pMidiOutChannelLbl
ClickableLabel * m_pSampleSelectionLbl
ClickableLabel * m_pPitchRandomLbl
LCDDisplay * m_pPitchLCD
Non-interactive display used for both numerical values and the status display.
Definition LCDDisplay.h:40
Custom spin box.
Definition LCDSpinBox.h:50
Custom rotary widget.
Definition Rotary.h:45
Base class for active user input widget, which are not based on a high-level Qt widget.
Widget is affected by the "Font size" settings in the PreferencesDialog.