lmms
Cross-platform music production software
Toggle main menu visibility
Loading...
Searching...
No Matches
include
Oscilloscope.h
Go to the documentation of this file.
1
/*
2
* Oscilloscope.h
3
*
4
* Copyright (c) 2005-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
5
*
6
* This file is part of LMMS - https://lmms.io
7
*
8
* This program is free software; you can redistribute it and/or
9
* modify it under the terms of"the GNU General Public
10
* License as published by the Free Software Foundation; either
11
* version 2 of the License, or (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 GNU
16
* General Public License for more details.
17
*
18
* You should have received a copy of the GNU General Public
19
* License along with this program (see COPYING); if not, write to the
20
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21
* Boston, MA 02110-1301 USA.
22
*
23
*/
24
25
#ifndef LMMS_GUI_OSCILLOSCOPE_H
26
#define LMMS_GUI_OSCILLOSCOPE_H
27
28
#include <QWidget>
29
#include <QPixmap>
30
31
#include "
LmmsTypes.h
"
32
33
namespace
lmms
34
{
35
36
class
SampleFrame
;
37
38
}
39
40
namespace
lmms::gui
41
{
42
43
44
class
Oscilloscope
:
public
QWidget
45
{
46
Q_OBJECT
47
public
:
48
Q_PROPERTY( QColor
leftChannelColor
READ
leftChannelColor
WRITE
setLeftChannelColor
)
49
Q_PROPERTY( QColor
rightChannelColor
READ
rightChannelColor
WRITE
setRightChannelColor
)
50
Q_PROPERTY( QColor
otherChannelsColor
READ
otherChannelsColor
WRITE
setOtherChannelsColor
)
51
Q_PROPERTY( QColor
clippingColor
READ
clippingColor
WRITE
setClippingColor
)
52
53
Oscilloscope
( QWidget * _parent );
54
~
Oscilloscope
() override;
55
56
void
setActive
(
bool
_active );
57
58
QColor const &
leftChannelColor
() const;
59
void
setLeftChannelColor
(QColor const &
leftChannelColor
);
60
61
QColor const &
rightChannelColor
() const;
62
void
setRightChannelColor
(QColor const &
rightChannelColor
);
63
64
QColor const &
otherChannelsColor
() const;
65
void
setOtherChannelsColor
(QColor const &
otherChannelsColor
);
66
67
QColor const &
clippingColor
() const;
68
void
setClippingColor
(QColor const &
clippingColor
);
69
70
71
protected:
72
void
paintEvent
( QPaintEvent * _pe ) override;
73
void
mousePressEvent
( QMouseEvent * _me ) override;
74
75
76
protected slots:
77
void
updateAudioBuffer
(const
lmms
::
SampleFrame
* buffer);
78
79
private:
80
bool
clips
(
float
level) const;
81
82
private:
83
QPixmap
m_background
;
84
QPointF *
m_points
;
85
86
SampleFrame
*
m_buffer
;
87
bool
m_active
;
88
89
QColor
m_leftChannelColor
;
90
QColor
m_rightChannelColor
;
91
QColor
m_otherChannelsColor
;
92
QColor
m_clippingColor
;
93
} ;
94
95
96
}
// namespace lmms::gui
97
98
#endif
// LMMS_GUI_OSCILLOSCOPE_H
LmmsTypes.h
lmms::SampleFrame
Definition
SampleFrame.h:41
lmms::gui::Oscilloscope::setClippingColor
void setClippingColor(QColor const &clippingColor)
Definition
Oscilloscope.cpp:150
lmms::gui::Oscilloscope::clippingColor
QColor clippingColor
Definition
Oscilloscope.h:51
lmms::gui::Oscilloscope::setOtherChannelsColor
void setOtherChannelsColor(QColor const &otherChannelsColor)
Definition
Oscilloscope.cpp:140
lmms::gui::Oscilloscope::rightChannelColor
QColor rightChannelColor
Definition
Oscilloscope.h:49
lmms::gui::Oscilloscope::m_points
QPointF * m_points
Definition
Oscilloscope.h:84
lmms::gui::Oscilloscope::setActive
void setActive(bool _active)
Definition
Oscilloscope.cpp:88
lmms::gui::Oscilloscope::otherChannelsColor
QColor otherChannelsColor
Definition
Oscilloscope.h:50
lmms::gui::Oscilloscope::setRightChannelColor
void setRightChannelColor(QColor const &rightChannelColor)
Definition
Oscilloscope.cpp:130
lmms::gui::Oscilloscope::paintEvent
void paintEvent(QPaintEvent *_pe) override
Definition
Oscilloscope.cpp:156
lmms::gui::Oscilloscope::m_active
bool m_active
Definition
Oscilloscope.h:87
lmms::gui::Oscilloscope::updateAudioBuffer
void updateAudioBuffer(const lmms::SampleFrame *buffer)
Definition
Oscilloscope.cpp:76
lmms::gui::Oscilloscope::m_rightChannelColor
QColor m_rightChannelColor
Definition
Oscilloscope.h:90
lmms::gui::Oscilloscope::setLeftChannelColor
void setLeftChannelColor(QColor const &leftChannelColor)
Definition
Oscilloscope.cpp:120
lmms::gui::Oscilloscope::m_otherChannelsColor
QColor m_otherChannelsColor
Definition
Oscilloscope.h:91
lmms::gui::Oscilloscope::m_buffer
SampleFrame * m_buffer
Definition
Oscilloscope.h:86
lmms::gui::Oscilloscope::mousePressEvent
void mousePressEvent(QMouseEvent *_me) override
Definition
Oscilloscope.cpp:212
lmms::gui::Oscilloscope::clips
bool clips(float level) const
Definition
Oscilloscope.cpp:220
lmms::gui::Oscilloscope::m_leftChannelColor
QColor m_leftChannelColor
Definition
Oscilloscope.h:89
lmms::gui::Oscilloscope::Oscilloscope
Oscilloscope(QWidget *_parent)
Definition
Oscilloscope.cpp:42
lmms::gui::Oscilloscope::m_background
QPixmap m_background
Definition
Oscilloscope.h:83
lmms::gui::Oscilloscope::m_clippingColor
QColor m_clippingColor
Definition
Oscilloscope.h:92
lmms::gui::Oscilloscope::leftChannelColor
QColor leftChannelColor
Definition
Oscilloscope.h:48
lmms::gui
Definition
AudioPortAudio.cpp:209
lmms
Definition
RemotePluginBase.cpp:34
Generated on
for lmms by
1.18.0