hydrogen 1.2.6
WaveDisplay.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 WAVE_DISPLAY
24#define WAVE_DISPLAY
25
26#include <QtGui>
27#include <QtWidgets>
28
29#include <core/Object.h>
32
33namespace H2Core
34{
35 class InstrumentLayer;
36}
37
39class WaveDisplay : public QWidget, protected WidgetWithScalableFont<8, 10, 12>, public H2Core::Object<WaveDisplay>
40{
42 Q_OBJECT
43
44 public:
45 explicit WaveDisplay(QWidget* pParent);
47
48
49 virtual void updateDisplay( std::shared_ptr<H2Core::InstrumentLayer> pLayer );
50
51 virtual void paintEvent( QPaintEvent *ev ) override;
52 virtual void resizeEvent( QResizeEvent * event ) override;
53 virtual void mouseDoubleClickEvent(QMouseEvent *ev) override;
54
55 void setSampleNameAlignment(Qt::AlignmentFlag flag);
56
57public slots:
59
60 signals:
61 void doubleClicked(QWidget *pWidget);
62
63 protected:
64
65 void createBackground( QPainter* painter );
66
67 Qt::AlignmentFlag m_SampleNameAlignment;
68 QPixmap m_Background;
71
72 /*
73 * Used to re-initialise m_pPeakData if width has changed
74 */
75
77
78 std::shared_ptr<H2Core::InstrumentLayer> m_pLayer;
79};
80
81inline void WaveDisplay::setSampleNameAlignment(Qt::AlignmentFlag flag)
82{
84}
85
86#endif
#define H2_OBJECT(name)
Definition Object.h:227
InstrumentLayer is part of an instrument each layer has it's own : gain which is the ration between...
Changes
Bitwise or-able options showing which part of the Preferences were altered using the PreferencesDialo...
Qt::AlignmentFlag m_SampleNameAlignment
Definition WaveDisplay.h:67
WaveDisplay(QWidget *pParent)
virtual void mouseDoubleClickEvent(QMouseEvent *ev) override
int m_nCurrentWidth
Definition WaveDisplay.h:76
virtual void updateDisplay(std::shared_ptr< H2Core::InstrumentLayer > pLayer)
void createBackground(QPainter *painter)
QString m_sSampleName
Definition WaveDisplay.h:69
int * m_pPeakData
Definition WaveDisplay.h:70
void onPreferencesChanged(H2Core::Preferences::Changes changes)
void doubleClicked(QWidget *pWidget)
virtual void resizeEvent(QResizeEvent *event) override
QPixmap m_Background
Definition WaveDisplay.h:68
std::shared_ptr< H2Core::InstrumentLayer > m_pLayer
Definition WaveDisplay.h:78
virtual void paintEvent(QPaintEvent *ev) override
void setSampleNameAlignment(Qt::AlignmentFlag flag)
Definition WaveDisplay.h:81
Widget is affected by the "Font size" settings in the PreferencesDialog.