hydrogen 1.2.3
PlayerControl.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 PLAYER_CONTROL_H
24#define PLAYER_CONTROL_H
25
26#include <QtGui>
27#include <QtWidgets>
28#include <chrono>
29
30#include "EventListener.h"
31#include <core/Object.h>
34
35namespace H2Core
36{
37 class Hydrogen;
38}
39
40class LCDSpinBox;
41class LCDDisplay;
42class Button;
43class CpuLoadWidget;
44class PixmapWidget;
45class LED;
46class MetronomeLED;
47class ClickableLabel;
49
51class PlayerControl : public QLabel, protected WidgetWithScalableFont<5, 6, 7>, public EventListener, public H2Core::Object<PlayerControl> {
53 Q_OBJECT
54public:
55 explicit PlayerControl(QWidget *parent);
57
58 void showStatusBarMessage( const QString& msg, const QString& sCaller = "" );
59
60 virtual void timelineActivationEvent() override;
61 virtual void tempoChangedEvent( int nValue ) override;
62 virtual void jackTransportActivationEvent() override;
63 virtual void jackTimebaseStateChangedEvent() override;
71 virtual void songModeActivationEvent() override;
72 virtual void updateSongEvent( int nValue ) override;
73 virtual void loopModeActivationEvent() override;
74 virtual void driverChangedEvent() override;
75
76public slots:
78 void activateSongMode( bool bActivate );
79
80private slots:
81 void recBtnClicked();
82 void playBtnClicked();
83 void stopBtnClicked();
86 //jack time master
87 void jackMasterBtnClicked(); // ~ jack time master
88 void bpmChanged( double );
90 void rewindBtnClicked();
94
95 //beatcounter
96 void activateBeatCounter( bool bActivate );
98 void bcbUpButtonClicked();
100 void bctUpButtonClicked();
102 // ~ beatcounter
103
104 //rubberband
106
108private:
112 void midiActivityEvent() override;
113
116
122
128
129 //beatcounter
136 // ~ beatcounter
137
138 //rubberbandBPMChange
140
142 //jack time master
144 // ~ jack time master
145
150
158
159 //beatcounter
161
165 // ~ beatcounter
166
169
172
178 std::chrono::milliseconds m_midiActivityTimeout;
179
181
184 void updateBPMSpinbox();
185 void updateBeatCounter();
194
202};
203
204
205#endif
#define H2_OBJECT(name)
Definition Object.h:224
Generic Button with SVG icons or text.
Definition Button.h:60
Custom QLabel that emits a signal when clicked.
Shows the current CPU load using a meter similar to the one used in Fader.
Hydrogen Audio Engine.
Definition Hydrogen.h:54
Changes
Bitwise or-able options showing which part of the Preferences were altered using the PreferencesDialo...
Non-interactive display used for both numerical values and the status display.
Definition LCDDisplay.h:40
Custom spin box.
Definition LCDSpinBox.h:50
LED identicating a user selection.
Definition LED.h:43
Custom LED that comes with its own timer.
Definition LED.h:72
void updateBeatCounterToolTip()
Button * m_pBCBDownBtn
Button * m_pRecBtn
void midiActivityEvent() override
void bcbDownButtonClicked()
LCDDisplay * m_pTimeDisplay
void showInstrumentRackButtonClicked()
virtual void timelineActivationEvent() override
Button * m_pBCTUpBtn
PixmapWidget * m_pControlsBCPanel
virtual void driverChangedEvent() override
Button * m_pMetronomeBtn
void updateBPMSpinbox()
Store the tool tip of the beat counter since it gets overwritten during deactivation.
void activateBeatCounter(bool bActivate)
ClickableLabel * m_pTimeMinutesLbl
MetronomeLED * m_pMetronomeLED
Button * m_pSongLoopBtn
void bcbUpButtonClicked()
Button * m_pBCOnOffBtn
void updatePlayerControl()
void recBtnClicked()
Toggle record mode.
void bctDownButtonClicked()
Button * m_pRubberBPMChange
void metronomeButtonClicked()
ClickableLabel * m_pBPMLbl
LED * m_pPatternModeLED
void jackMasterBtnClicked()
QPixmap m_background
Button * m_pShowInstrumentRackBtn
void playBtnClicked()
Start audio engine.
QLabel * m_pBCDisplayB
void bpmChanged(double)
void onPreferencesChanged(H2Core::Preferences::Changes changes)
ClickableLabel * m_pMidiInLbl
QTimer * m_pMidiActivityTimer
Used to turn off the LED m_pMidiActivityLED indicating an incoming MIDI event after m_midiActivityTim...
virtual void updateSongEvent(int nValue) override
virtual void songModeActivationEvent() override
Shared GUI update when activating Song or Pattern mode via button click or via OSC command.
void rubberbandButtonToggle()
QString m_sBCOnOffBtnToolTip
StatusMessageDisplay * m_pStatusLabel
Button * m_pPlayBtn
Button * m_pBCSetPlayBtn
virtual void jackTransportActivationEvent() override
Button * m_pJackMasterBtn
ClickableLabel * m_pTimeHoursLbl
Button * m_pStopBtn
PlayerControl(QWidget *parent)
void jackTransportBtnClicked()
void showMixerButtonClicked()
QLabel * m_pBCDisplayT
void bcSetPlayBtnClicked()
virtual void tempoChangedEvent(int nValue) override
ClickableLabel * m_pCpuLbl
std::chrono::milliseconds m_midiActivityTimeout
ClickableLabel * m_pTimeSecondsLbl
QLabel * m_pBCDisplayZ
void fastForwardBtnClicked()
virtual void loopModeActivationEvent() override
void updateBPMSpinboxToolTip()
LED * m_pMidiActivityLED
CpuLoadWidget * m_pCpuLoadWidget
Button * m_pJackTransportBtn
Button * m_pBCBUpBtn
void updateStatusLabel()
Ensure that the full width of the status label is used without cutting of the beginning of the messag...
Button * m_pShowMixerBtn
void bctUpButtonClicked()
QString m_sBCOnOffBtnTimelineToolTip
bool m_bLastBCOnOffBtnState
void activateSongMode(bool bActivate)
QString m_sBCOnOffBtnJackTimebaseToolTip
Button * m_pBCTDownBtn
void showStatusBarMessage(const QString &msg, const QString &sCaller="")
Button * m_pRwdBtn
ClickableLabel * m_pTimeMilliSecondsLbl
QString m_sLCDBPMSpinboxToolTip
Button * m_pSongModeBtn
QString m_sLCDBPMSpinboxJackTimebaseToolTip
Button * m_pPatternModeBtn
void deactivateMidiActivityLED()
void stopBtnClicked()
Stop audio engine.
bool m_bLCDBPMSpinboxIsArmed
When updating the tempo of the BPM spin box it is crucial to indicated that this was done due to a ba...
virtual void jackTimebaseStateChangedEvent() override
LCDSpinBox * m_pLCDBPMSpinbox
H2Core::Hydrogen * m_pHydrogen
QString m_sLCDBPMSpinboxTimelineToolTip
Button * m_pFfwdBtn
Non-interactive display for status messages in the PlayerControl.
Widget is affected by the "Font size" settings in the PreferencesDialog.