| 1 | /* |
|---|
| 2 | * Hydrogen |
|---|
| 3 | * Copyright(c) 2002-2008 by Alex >Comix< Cominu [comix@users.sourceforge.net] |
|---|
| 4 | * |
|---|
| 5 | * http://www.hydrogen-music.org |
|---|
| 6 | * |
|---|
| 7 | * This program is free software; you can redistribute it and/or modify |
|---|
| 8 | * it under the terms of the GNU General Public License as published by |
|---|
| 9 | * the Free Software Foundation; either version 2 of the License, or |
|---|
| 10 | * (at your option) any later version. |
|---|
| 11 | * |
|---|
| 12 | * This program is distributed in the hope that it will be useful, |
|---|
| 13 | * but WITHOUT ANY WARRANTY, without even the implied warranty of |
|---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 15 | * GNU General Public License for more details. |
|---|
| 16 | * |
|---|
| 17 | * You should have received a copy of the GNU General Public License |
|---|
| 18 | * along with this program; if not, write to the Free Software |
|---|
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 20 | * |
|---|
| 21 | */ |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | #ifndef PATTERN_EDITOR_PANEL_H |
|---|
| 25 | #define PATTERN_EDITOR_PANEL_H |
|---|
| 26 | |
|---|
| 27 | #include <QtGui> |
|---|
| 28 | |
|---|
| 29 | #include <hydrogen/Object.h> |
|---|
| 30 | |
|---|
| 31 | #include "../EventListener.h" |
|---|
| 32 | |
|---|
| 33 | |
|---|
| 34 | class Button; |
|---|
| 35 | class ToggleButton; |
|---|
| 36 | class Fader; |
|---|
| 37 | class PatternEditorRuler; |
|---|
| 38 | class PatternEditorInstrumentList; |
|---|
| 39 | class NotePropertiesRuler; |
|---|
| 40 | class LCDCombo; |
|---|
| 41 | class DrumPatternEditor; |
|---|
| 42 | //class PianoRollEditor; |
|---|
| 43 | |
|---|
| 44 | |
|---|
| 45 | namespace H2Core |
|---|
| 46 | { |
|---|
| 47 | class Pattern; |
|---|
| 48 | } |
|---|
| 49 | |
|---|
| 50 | /// |
|---|
| 51 | /// Pattern Editor Panel |
|---|
| 52 | /// |
|---|
| 53 | class PatternEditorPanel : public QWidget, public EventListener, public Object |
|---|
| 54 | { |
|---|
| 55 | Q_OBJECT |
|---|
| 56 | |
|---|
| 57 | public: |
|---|
| 58 | PatternEditorPanel(QWidget *parent); |
|---|
| 59 | ~PatternEditorPanel(); |
|---|
| 60 | |
|---|
| 61 | DrumPatternEditor* getDrumPatternEditor() { return m_pDrumPatternEditor; } |
|---|
| 62 | NotePropertiesRuler* getVelocityEditor() { return m_pNoteVelocityEditor; } |
|---|
| 63 | NotePropertiesRuler* getPanEditor() { return m_pNotePanEditor; } |
|---|
| 64 | NotePropertiesRuler* getLeadLagEditor() { return m_pNoteLeadLagEditor; } |
|---|
| 65 | NotePropertiesRuler* getNoteKeyEditor() { return m_pNoteNoteKeyEditor; } |
|---|
| 66 | PatternEditorInstrumentList* getInstrumentList() { return m_pInstrumentList; } |
|---|
| 67 | |
|---|
| 68 | void updateSLnameLabel( ); |
|---|
| 69 | |
|---|
| 70 | // Implements EventListener interface |
|---|
| 71 | virtual void selectedPatternChangedEvent(); |
|---|
| 72 | virtual void selectedInstrumentChangedEvent(); |
|---|
| 73 | virtual void stateChangedEvent(int nState); |
|---|
| 74 | //~ Implements EventListener interface |
|---|
| 75 | |
|---|
| 76 | private slots: |
|---|
| 77 | void gridResolutionChanged( QString text ); |
|---|
| 78 | void propertiesComboChanged( QString text ); |
|---|
| 79 | void patternSizeChanged( QString text ); |
|---|
| 80 | |
|---|
| 81 | void hearNotesBtnClick(Button *ref); |
|---|
| 82 | void quantizeEventsBtnClick(Button *ref); |
|---|
| 83 | |
|---|
| 84 | void showDrumEditorBtnClick(Button *ref); |
|---|
| 85 | void showPianoEditorBtnClick(Button *ref); |
|---|
| 86 | |
|---|
| 87 | void syncToExternalHorizontalScrollbar(int); |
|---|
| 88 | void contentsMoving(int dummy); |
|---|
| 89 | void on_patternEditorScroll(int); |
|---|
| 90 | |
|---|
| 91 | |
|---|
| 92 | void zoomInBtnClicked(Button *ref); |
|---|
| 93 | void zoomOutBtnClicked(Button *ref); |
|---|
| 94 | |
|---|
| 95 | void moveDownBtnClicked(Button *); |
|---|
| 96 | void moveUpBtnClicked(Button *); |
|---|
| 97 | |
|---|
| 98 | void playselectedinstrument( QString text ); |
|---|
| 99 | void rightclickSelect( QString text ); |
|---|
| 100 | |
|---|
| 101 | private: |
|---|
| 102 | H2Core::Pattern *m_pPattern; |
|---|
| 103 | QPixmap m_backgroundPixmap; |
|---|
| 104 | QLabel *pSLlabel; |
|---|
| 105 | |
|---|
| 106 | // Editor top |
|---|
| 107 | LCDCombo *__pattern_size_combo; |
|---|
| 108 | LCDCombo *__resolution_combo; |
|---|
| 109 | ToggleButton *__show_drum_btn; |
|---|
| 110 | ToggleButton *__show_piano_btn; |
|---|
| 111 | |
|---|
| 112 | |
|---|
| 113 | // ~Editor top |
|---|
| 114 | |
|---|
| 115 | |
|---|
| 116 | // drum editor |
|---|
| 117 | QScrollArea* m_pEditorScrollView; |
|---|
| 118 | DrumPatternEditor *m_pDrumPatternEditor; |
|---|
| 119 | |
|---|
| 120 | // piano roll editor |
|---|
| 121 | // QScrollArea* m_pPianoRollScrollView; |
|---|
| 122 | // PianoRollEditor *m_pPianoRollEditor; |
|---|
| 123 | |
|---|
| 124 | // ruler |
|---|
| 125 | QScrollArea* m_pRulerScrollView; |
|---|
| 126 | PatternEditorRuler *m_pPatternEditorRuler; |
|---|
| 127 | |
|---|
| 128 | // instr list |
|---|
| 129 | QScrollArea* m_pInstrListScrollView; |
|---|
| 130 | PatternEditorInstrumentList *m_pInstrumentList; |
|---|
| 131 | |
|---|
| 132 | // note velocity editor |
|---|
| 133 | QScrollArea* m_pNoteVelocityScrollView; |
|---|
| 134 | NotePropertiesRuler *m_pNoteVelocityEditor; |
|---|
| 135 | |
|---|
| 136 | // note pan editor |
|---|
| 137 | QScrollArea* m_pNotePanScrollView; |
|---|
| 138 | NotePropertiesRuler *m_pNotePanEditor; |
|---|
| 139 | |
|---|
| 140 | // note leadlag editor |
|---|
| 141 | QScrollArea* m_pNoteLeadLagScrollView; |
|---|
| 142 | NotePropertiesRuler *m_pNoteLeadLagEditor; |
|---|
| 143 | |
|---|
| 144 | // note notekey editor |
|---|
| 145 | QScrollArea* m_pNoteNoteKeyScrollView; |
|---|
| 146 | NotePropertiesRuler *m_pNoteNoteKeyEditor; |
|---|
| 147 | |
|---|
| 148 | |
|---|
| 149 | |
|---|
| 150 | QScrollBar *m_pPatternEditorHScrollBar; |
|---|
| 151 | QScrollBar *m_pPatternEditorVScrollBar; |
|---|
| 152 | |
|---|
| 153 | // TOOLBAR |
|---|
| 154 | QLabel *m_pPatternNameLbl; |
|---|
| 155 | |
|---|
| 156 | |
|---|
| 157 | |
|---|
| 158 | Button *m_pRandomVelocityBtn; |
|---|
| 159 | //~ TOOLBAR |
|---|
| 160 | |
|---|
| 161 | |
|---|
| 162 | Button *sizeDropdownBtn; |
|---|
| 163 | Button *resDropdownBtn; |
|---|
| 164 | |
|---|
| 165 | |
|---|
| 166 | |
|---|
| 167 | |
|---|
| 168 | bool m_bEnablePatternResize; |
|---|
| 169 | |
|---|
| 170 | |
|---|
| 171 | virtual void dragEnterEvent(QDragEnterEvent *event); |
|---|
| 172 | virtual void dropEvent(QDropEvent *event); |
|---|
| 173 | |
|---|
| 174 | virtual void resizeEvent(QResizeEvent *ev); |
|---|
| 175 | virtual void showEvent(QShowEvent *ev); |
|---|
| 176 | }; |
|---|
| 177 | |
|---|
| 178 | |
|---|
| 179 | |
|---|
| 180 | #endif |
|---|