hydrogen 1.2.3
SongEditorPanel.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-2024 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 SONG_EDITOR_PANEL_H
24#define SONG_EDITOR_PANEL_H
25
26
27#include "../EventListener.h"
28#include <core/Object.h>
29#include <core/Basics/Pattern.h>
30
31#include <QtGui>
32#include <QtWidgets>
33
34#include "Widgets/Button.h"
35
36class SongEditor;
39class Button;
40class Fader;
41class WidgetWithInput;
43class LCDCombo;
45
47class SongEditorPanel : public QWidget, public EventListener, public H2Core::Object<SongEditorPanel>
48{
50 Q_OBJECT
51
52 public:
53 explicit SongEditorPanel( QWidget *parent );
55
61
62 void updateAll();
64
65 void showTimeline();
66 void showPlaybackTrack();
68
69 bool getTimelineActive() const;
70 void setTimelineActive( bool bActive );
71 bool getTimelineEnabled() const;
72 void setTimelineEnabled( bool bEnabled );
73
78 void highlightPatternEditorLocked( bool bUseRedBackground );
79 void restoreGroupVector( QString filename );
80 // ~ Implements EventListener interface
86
87 // Implements EventListener interface
88 virtual void selectedPatternChangedEvent() override;
89 virtual void timelineActivationEvent() override;
95 virtual void actionModeChangeEvent( int nValue ) override;
96 virtual void gridCellToggledEvent() override;
97 virtual void patternModifiedEvent() override;
98
99 virtual void jackTimebaseStateChangedEvent() override;
100
101 virtual void playingPatternsChangedEvent() override;
102
103 virtual void patternEditorLockedEvent() override;
104 virtual void stackedModeActivationEvent( int ) override;
105 virtual void updateSongEvent( int ) override;
106 virtual void songModeActivationEvent() override;
107 virtual void playbackTrackChangedEvent() override;
108 virtual void stateChangedEvent( H2Core::AudioEngine::State ) override;
109
110 public slots:
113 void activateStackedMode( bool bActivate );
114 void activateSelectMode( bool bActivate );
115
116 void showHideTimeline( bool bClicked ) {
117 m_pTimelineBtn->setChecked( bClicked );
119 }
121
122 private slots:
123 void vScrollTo( int value );
124 void hScrollTo( int value );
125
126 void newPatBtnClicked();
127 void upBtnClicked();
128 void downBtnClicked();
129 void clearSequence();
130
133
134 void timelineBtnClicked();
138
139 void zoomInBtnClicked();
140 void zoomOutBtnClicked();
141
142 void faderChanged( WidgetWithInput* pRef );
143
144 void automationPathPointAdded(float x, float y);
145 void automationPathPointRemoved(float x, float y);
146 void automationPathPointMoved(float ox, float oy, float tx, float ty);
147
148 private:
151
152 static const int m_nPatternListWidth = 200;
153
158
159 QScrollBar * m_pVScrollBar;
160 QScrollBar * m_pHScrollBar;
161
162 QStackedWidget* m_pWidgetStack;
164
165
170
171
177
179
185
190
191 QTimer* m_pTimer;
192
195
196 virtual void resizeEvent( QResizeEvent *ev ) override;
198
200};
201
202#endif
#define H2_OBJECT(name)
Definition Object.h:224
Generic Button with SVG icons or text.
Definition Button.h:60
Custom fader widget.
Definition Fader.h:44
void updateAll()
Update and redraw all...
SongEditorPositionRuler * getSongEditorPositionRuler() const
Button * m_pPlaySelectedMultipleBtn
virtual void playbackTrackChangedEvent() override
QScrollArea * m_pPlaybackTrackScrollView
void updateTimelineUsage()
Disables and deactivates the Timeline when an external JACK timebase master is detected and enables i...
virtual void timelineActivationEvent() override
QScrollArea * m_pPositionRulerScrollView
Button * m_pViewTimelineBtn
void setTimelineEnabled(bool bEnabled)
SongEditorPanel(QWidget *parent)
static const int m_nPatternListWidth
QScrollArea * m_pEditorScrollView
void faderChanged(WidgetWithInput *pRef)
QStackedWidget * m_pWidgetStack
void newPatBtnClicked()
Create a new pattern.
void hScrollTo(int value)
void restoreGroupVector(QString filename)
virtual void stateChangedEvent(H2Core::AudioEngine::State) override
void editPlaybackTrackBtnClicked()
void toggleAutomationAreaVisibility()
void downBtnClicked()
Move down a pattern in the patternList.
QScrollBar * m_pHScrollBar
void highlightPatternEditorLocked(bool bUseRedBackground)
Turns the background color of m_pPatternEditorLockedBtn red to signal the user her last action was no...
SongEditorPositionRuler * m_pPositionRuler
virtual void resizeEvent(QResizeEvent *ev) override
bool getTimelineActive() const
void upBtnClicked()
Move up a pattern in the patternList.
virtual void patternModifiedEvent() override
void automationPathPointRemoved(float x, float y)
void activateSelectMode(bool bActivate)
QScrollBar * m_pVScrollBar
bool getTimelineEnabled() const
virtual void stackedModeActivationEvent(int) override
virtual void songModeActivationEvent() override
SongEditor * getSongEditor() const
Button * m_pPatternEditorLockedBtn
void activateStackedMode(bool bActivate)
Used by the shotlist during automated generation of images for the manual.
SongEditorPatternList * getSongEditorPatternList() const
void setTimelineActive(bool bActive)
Button * m_pPlaySelectedSingleBtn
Fader * m_pPlaybackTrackFader
Button * m_pViewPlaybackBtn
AutomationPathView * getAutomationPathView() const
SongEditor * m_pSongEditor
QScrollArea * m_pAutomationPathScrollView
void updatePlaybackTrackIfNecessary()
virtual void playingPatternsChangedEvent() override
void showHideTimeline(bool bClicked)
virtual void updateSongEvent(int) override
LCDCombo * m_pAutomationCombo
Button * m_pClearPatternSeqBtn
void vScrollTo(int value)
QScrollArea * m_pPatternListScrollView
Button * m_pSelectionModeBtn
Button * m_pMutePlaybackBtn
AutomationPathView * m_pAutomationPathView
SongEditorPatternList * m_pPatternList
void viewPlaybackTrackBtnClicked()
Button * m_pEditPlaybackBtn
virtual void selectedPatternChangedEvent() override
virtual void gridCellToggledEvent() override
void automationPathPointMoved(float ox, float oy, float tx, float ty)
virtual void patternEditorLockedEvent() override
void automationPathPointAdded(float x, float y)
virtual void jackTimebaseStateChangedEvent() override
Button * m_pPatternEditorUnlockedBtn
PlaybackTrackWaveDisplay * m_pPlaybackTrackWaveDisplay
virtual void actionModeChangeEvent(int nValue) override
Updates the associated buttons if the action mode was changed within the core.
PlaybackTrackWaveDisplay * getPlaybackTrackWaveDisplay() const
Song editor pattern list.
Definition SongEditor.h:263
Song editor.
Definition SongEditor.h:72
Base class for active user input widget, which are not based on a high-level Qt widget.