Sayonara Player
Toggle main menu visibility
Loading...
Searching...
No Matches
src
Gui
Plugins
Engine
GUI_SpectrogramPainter.h
1
/* GUI_SpectrogramPainter.h
2
*
3
* Copyright (C) 2011-2024 Michael Lugmair
4
*
5
* This file is part of sayonara player
6
*
7
* This program is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
11
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
17
* You should have received a copy of the GNU General Public License
18
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
*/
20
21
#ifndef GUI_SPECTROGRAMPAINTER_H
22
#define GUI_SPECTROGRAMPAINTER_H
23
24
#include "Gui/Plugins/PlayerPluginBase.h"
25
26
#include <QList>
27
#include <QWidget>
28
29
class
PlayManager
;
30
31
class
GUI_SpectrogramPainter :
32
public
PlayerPlugin::Base
33
{
34
Q_OBJECT
35
PIMPL(GUI_SpectrogramPainter)
36
37
public
:
38
explicit
GUI_SpectrogramPainter(
PlayManager
* playManager, QWidget* parent =
nullptr
);
39
~GUI_SpectrogramPainter()
override
;
40
41
QString
name
()
const override
;
42
QString
displayName
()
const override
;
43
bool
isUiInitialized
()
const override
;
44
45
private
slots:
46
void
reset();
47
void
spectrumChanged(
const
QList<float>
& spectrum, MilliSeconds ms);
48
void
finished();
49
50
void
playstateChanged(PlayState state);
51
void
trackChanged(
const
MetaData
& md);
52
53
protected
:
54
void
retranslate()
override
;
55
void
initUi
()
override
;
56
57
void
paintEvent(QPaintEvent* e)
override
;
58
void
mousePressEvent(QMouseEvent* e)
override
;
59
void
mouseMoveEvent(QMouseEvent* e)
override
;
60
61
void
showEvent(QShowEvent* e)
override
;
62
void
closeEvent(QCloseEvent* e)
override
;
63
64
private
:
65
void
drawBuffer(
int
percent_step);
66
QString calcTooltip(
float
yPercent);
67
68
void
showFullsize();
69
void
positionClicked(QPoint position);
70
71
void
startAudioDataProvider(
const
MetaData
& md);
72
void
stopAudioDataProvider();
73
74
QSize minimumSizeHint()
const override
;
75
};
76
77
#endif
// GUI_SPECTROGRAMPAINTER_H
GUI_SpectrogramPainter::isUiInitialized
bool isUiInitialized() const override
Check if ui already was initialized.
GUI_SpectrogramPainter::name
QString name() const override
must be overwritten
GUI_SpectrogramPainter::displayName
QString displayName() const override
must be overwritten
GUI_SpectrogramPainter::initUi
void initUi() override
GUI will be initialized on first show up. Please use this to make Sayonara starting fast.
MetaData
Definition
MetaData.h:43
PlayManager
Definition
PlayManager.h:34
PlayerPlugin::Base
Definition
PlayerPluginBase.h:40
QList
Definition
EngineUtils.h:33
Generated on
for Sayonara Player by
1.17.0