-
Notifications
You must be signed in to change notification settings - Fork 0
/
soniquewidget.h
77 lines (62 loc) · 2.31 KB
/
soniquewidget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/***************************************************************************
* This file is part of the TTK qmmp plugin project
* Copyright (C) 2015 - 2025 Greedysky Studio
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along
* with this program; If not, see <http://www.gnu.org/licenses/>.
***************************************************************************/
#ifndef SONIQUEWIDGET_H
#define SONIQUEWIDGET_H
#include "visual.h"
#include "kiss_fft.h"
#include <QLibrary>
#include <qmmp/visual.h>
/*!
* @author Greedysky <[email protected]>
*/
class SoniqueWidget : public Visual
{
Q_OBJECT
public:
explicit SoniqueWidget(QWidget *parent = nullptr);
virtual ~SoniqueWidget();
public slots:
virtual void start() override final;
virtual void stop() override final;
public slots:
void nextPreset();
void previousPreset();
void randomPreset();
void updateVisual();
protected:
virtual void hideEvent(QHideEvent *e) override final;
virtual void showEvent(QShowEvent *e) override final;
virtual void resizeEvent(QResizeEvent *e) override final;
virtual void paintEvent(QPaintEvent *e) override final;
virtual void contextMenuEvent(QContextMenuEvent *) override final;
void process(float *left, float *right);
void initialize();
void closePreset();
void generatePreset();
VisInfo *m_sonique = nullptr;
VisData *m_visData = nullptr;
unsigned int *m_texture = nullptr;
unsigned int *m_visProc = nullptr;
QLibrary *m_instance = nullptr;
int m_currentIndex = -1;
QStringList m_presetList;
kiss_fft_cfg m_kiss_cfg;
kiss_fft_cpx *m_in_freq_data = nullptr;
kiss_fft_cpx *m_out_freq_data = nullptr;
QTimer *m_timer = nullptr;
float m_left[QMMP_VISUAL_NODE_SIZE];
float m_right[QMMP_VISUAL_NODE_SIZE];
};
#endif