hydrogen 1.2.6
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-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 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 static constexpr int m_nMinimumHeight = 50;
88
89 // Implements EventListener interface
90 virtual void selectedPatternChangedEvent() override;
91 virtual void timelineActivationEvent() override;
97 virtual void actionModeChangeEvent( int nValue ) override;
98 virtual void gridCellToggledEvent() override;
99 virtual void patternModifiedEvent() 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 virtual void jackTimebaseStateChangedEvent( int nState ) override;
122
123
124 private slots:
125 void vScrollTo( int value );
126 void hScrollTo( int value );
127
128 void newPatBtnClicked();
129 void upBtnClicked();
130 void downBtnClicked();
131 void clearSequence();
132
135
136 void timelineBtnClicked();
140
141 void zoomInBtnClicked();
142 void zoomOutBtnClicked();
143
144 void faderChanged( WidgetWithInput* pRef );
145
146 void automationPathPointAdded(float x, float y);
147 void automationPathPointRemoved(float x, float y);
148 void automationPathPointMoved(float ox, float oy, float tx, float ty);
149
150 private:
151 static const int m_nPatternListWidth = 200;
152
157
158 QScrollBar * m_pVScrollBar;
159 QScrollBar * m_pHScrollBar;
160
161 QStackedWidget* m_pWidgetStack;
163
164
169
170
176
178
184
189
190 QTimer* m_pTimer;
191
194
195 virtual void resizeEvent( QResizeEvent *ev ) override;
197
199};
200
201#endif
#define H2_OBJECT(name)
Definition Object.h:227
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 controller is detected and enabl...
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
static constexpr int m_nMinimumHeight
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
virtual void jackTimebaseStateChangedEvent(int nState) override
void automationPathPointAdded(float x, float y)
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:270
Song editor.
Definition SongEditor.h:72
Base class for active user input widget, which are not based on a high-level Qt widget.