38 | float * FFTRealSelect ::sel_bin (float *e_ptr, float *o_ptr)
39 | {
40 | return (o_ptr);
41 | }
42 |
43 |
44 |
45 | template <>
46 | inline float * FFTRealSelect <0>::sel_bin (float *e_ptr, float *o_ptr)
47 | {
48 | return (e_ptr);
49 | }
50 |
51 |
52 |
53 | } // namespace ffft
54 |
55 |
56 |
57 | #endif // ffft_FFTRealSelect_CODEHEADER_INCLUDED
58 |
59 | #undef ffft_FFTRealSelect_CURRENT_CODEHEADER
60 |
61 |
62 |
63 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
64 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: cpp
2 | dist: bionic
3 | os: linux
4 | compiler: g++
5 | group: travis_latest
6 | addons:
7 | ssh_known_hosts: local.timschneeberger.me
8 | env:
9 | global:
10 | - base_version: 2.2
11 | - secure: MUZVB76DqKEtZB38CIM9qN6SnxCKeHWAIxcWBrHlsNfx3Cz0dfAWb0xCUX9v/yuupnoR9MKzppt0G02GCjtypS9VzZ6s0Xm1oYjA4OhLSAREJ+fqL8aYxh2G34k2ZLitMRAiZzlycGgOwltKXb8vX18UtKyY+9ml0tkvzN9Mv/7NyNYMPP5+ZJKLnXwoN5ygNQa2gq07zW80KkpJzlYQUaWtwcyEZyL2INBEt6zh5R/MMagH3apTHnaB2Y9ZMrfpH52VghEvZ0LoZlB/5UeXLgkByF8i9jJsALwAk185iufQkXGErAgLXWobdBvWrIXZVUT5I5nrgNdQjpuYOHGvkwa0V8aLWD2US975IGP6PY0aZDsRQ3dKvJRCM4bukqGXKkuFsBt9pH8ZtfUsfff4gkQLDe+VAiuaU810bG2uua1JrwTLDInxFXISkd5h2ZZeJ4QvA5mGhOKEI2CuQCB3nYHKQXPzFsC4uaTe7F/2fYOctlxvgLZ8Wxpi0yvBa1vMoQfPZplh+jJMwa139MqVRjoqhWJQvtLHCfr+iWlUlBbGu1QBgqseCpIb4BIrsAM2/KG090X3nEjXaIN79gjI7a8P/wXGni5lHOLG3WHIeYD4CiVhpcrhKcKaQHsUk1fRmc9yj/WIH2a3Sr/vX3de4vD680nX5p3njQvL/PzDKQQ=
12 | before_install:
13 | - sudo apt-get update -qq
14 | - sudo apt-get install lftp gstreamer-1.0 libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev gstreamer1.0-plugins-bad libgstreamer-plugins-bad1.0-dev
15 | - sudo apt-get install qtbase5-dev libqt5svg5-dev qt5-default qttools5-dev-tools qtmultimedia5-dev
16 | script:
17 | - qmake V4L_Frontend.pro
18 | - make
19 | - chmod +x ./deployment/build_deb_package.sh
20 | - "./deployment/build_deb_package.sh"
21 | after_success:
22 | - for file in ./*.deb; do if [ -f "$file" ]; then export artifact=$file; break 1;
23 | fi; done;
24 | - echo $artifact
25 | - lftp -u pi,${SFTP_PWD} -e "set sftp:auto-confirm true;set ssl:check-hostname false;set
26 | ssl:verify-certificate false;put $artifact;quit" sftp://local.timschneeberger.me/disks/sandisk/www/nightly/vipergui-debian/
27 |
--------------------------------------------------------------------------------
/styles/overlay.qss:
--------------------------------------------------------------------------------
1 | QPushButton{
2 | border-style: solid;
3 | border-top-color: transparent;
4 | border-right-color: transparent;
5 | border-left-color: transparent;
6 | border-bottom-color: transparent;
7 | border-width: 1px;
8 | border-style: solid;
9 | color: #a9b7c6;
10 | padding: 4 12 4 12;
11 | background-color: #000000;
12 | }
13 | QPushButton::default{
14 | border-style: solid;
15 | border-top-color: transparent;
16 | border-right-color: transparent;
17 | border-left-color: transparent;
18 | border-bottom-color: #e67e22;
19 | border-width: 1px;
20 | color: #a9b7c6;
21 | padding: 2px;
22 | background-color: #000000;
23 | }
24 | QPushButton:hover{
25 | border-style: solid;
26 | border-top-color: transparent;
27 | border-right-color: transparent;
28 | border-left-color: transparent;
29 | border-bottom-color: #e67e22;
30 | border-bottom-width: 1px;
31 | border-style: solid;
32 | color: #FFFFFF;
33 | padding-bottom: 2px;
34 | background-color: #000000;
35 | }
36 | QPushButton:pressed{
37 | border-style: solid;
38 | border-top-color: transparent;
39 | border-right-color: transparent;
40 | border-left-color: transparent;
41 | border-bottom-color: #e67e22;
42 | border-bottom-width: 2px;
43 | border-style: solid;
44 | color: #e67e22;
45 | padding-bottom: 1px;
46 | background-color: #000000;
47 | }
48 | QPushButton:disabled{
49 | border-style: solid;
50 | border-top-color: transparent;
51 | border-right-color: transparent;
52 | border-left-color: transparent;
53 | border-bottom-color: transparent;
54 | border-bottom-width: 2px;
55 | border-style: solid;
56 | color: #808086;
57 | padding-bottom: 1px;
58 | background-color: #000000;
59 | }
60 |
--------------------------------------------------------------------------------
/dialog/FlatTabWidget/clickablelabel.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This program is free software: you can redistribute it and/or modify
3 | it under the terms of the GNU General Public License as published by
4 | the Free Software Foundation, either version 3 of the License, or
5 | (at your option) any later version.
6 | This program is distributed in the hope that it will be useful,
7 | but WITHOUT ANY WARRANTY; without even the implied warranty of
8 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 | GNU General Public License for more details.
10 | You should have received a copy of the GNU General Public License
11 | along with this program. If not, see .
12 |
13 | ThePBone (c) 2020
14 | */
15 |
16 | #ifndef CLICKABLELABEL_H
17 | #define CLICKABLELABEL_H
18 |
19 | #include
20 | #include
21 | /*!
22 | \class ClickableLabel
23 |
24 | \brief The ClickableLabel class provides a simple label with a click signal and color property for color animation
25 | */
26 | class ClickableLabel : public QLabel {
27 | Q_OBJECT
28 | Q_PROPERTY(QColor color WRITE setColor READ color)
29 | public:
30 | explicit ClickableLabel(QWidget* parent = Q_NULLPTR);
31 | ~ClickableLabel();
32 | /*!
33 | \brief Set text color
34 | */
35 | void setColor(QColor color);
36 | /*!
37 | \brief Get text color\n
38 | \bold Warning: Usage not recommended
39 | */
40 | QColor color() const;
41 |
42 | signals:
43 | /*!
44 | \brief User has clicked the label
45 | */
46 | void clicked();
47 |
48 | protected:
49 | void mousePressEvent(QMouseEvent* event);
50 |
51 | private:
52 | QColor mColor;
53 | };
54 |
55 | #endif // CLICKABLELABEL_H
56 |
--------------------------------------------------------------------------------
/3rdparty/WAF/Animation/Slide/SlideForegroundDecorator.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Dimka Novikov, to@dimkanovikov.pro
3 | *
4 | * This library is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or any later version.
8 | *
9 | * This library is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * Full license: https://github.com/dimkanovikov/WidgetAnimationFramework/blob/master/LICENSE
15 | */
16 |
17 | #ifndef SLIDEBACKGROUNDDECORATOR_H
18 | #define SLIDEBACKGROUNDDECORATOR_H
19 |
20 | #include
21 | #include
22 |
23 |
24 | /**
25 | * Widgets Animation Framework
26 | */
27 | namespace WAF
28 | {
29 | /**
30 | * @brief Класс перекрывающий передний план выкатываемого виджета
31 | * @note Делается это для того, чтобы скрыть деформации компоновщика, при изменении размера виджета
32 | */
33 | class SlideForegroundDecorator : public QWidget
34 | {
35 | Q_OBJECT
36 |
37 | public:
38 | explicit SlideForegroundDecorator(QWidget* _parent);
39 |
40 | /**
41 | * @brief Сохранить изображение родительского виджета
42 | */
43 | void grabParent(const QSize& _size);
44 |
45 | protected:
46 | /**
47 | * @brief Переопределяется для прорисовки декорации
48 | */
49 | void paintEvent(QPaintEvent* _event);
50 |
51 | private:
52 | /**
53 | * @brief Фоновое изображение
54 | */
55 | QPixmap m_foreground;
56 | };
57 | }
58 |
59 | #endif // SLIDEBACKGROUNDDECORATOR_H
60 |
--------------------------------------------------------------------------------
/dialog/FlatTabWidget/FlatTabWidget.pri:
--------------------------------------------------------------------------------
1 | SOURCES += \
2 | $$PWD/3rdparty/StackedWidgetAnimation/StackedWidgetAnimation.cpp \
3 | $$PWD/3rdparty/StackedWidgetAnimation/StackedWidgetFadeIn/StackedWidgetFadeInAnimator.cpp \
4 | $$PWD/3rdparty/StackedWidgetAnimation/StackedWidgetFadeIn/StackedWidgetFadeInDecorator.cpp \
5 | $$PWD/3rdparty/StackedWidgetAnimation/StackedWidgetSlide/StackedWidgetSlideAnimator.cpp \
6 | $$PWD/3rdparty/StackedWidgetAnimation/StackedWidgetSlide/StackedWidgetSlideDecorator.cpp \
7 | $$PWD/3rdparty/StackedWidgetAnimation/StackedWidgetSlideOver/StackedWidgetSlideOverAnimator.cpp \
8 | $$PWD/3rdparty/StackedWidgetAnimation/StackedWidgetSlideOver/StackedWidgetSlideOverDecorator.cpp \
9 | $$PWD/clickablelabel.cpp \
10 | $$PWD/colorprovider.cpp \
11 | $$PWD/customtabbar.cpp \
12 | $$PWD/flattabwidget.cpp
13 |
14 | HEADERS += \
15 | $$PWD/3rdparty/AbstractAnimator.h \
16 | $$PWD/3rdparty/StackedWidgetAnimation/StackedWidgetAnimation.h \
17 | $$PWD/3rdparty/StackedWidgetAnimation/StackedWidgetAnimationPrivate.h \
18 | $$PWD/3rdparty/StackedWidgetAnimation/StackedWidgetFadeIn/StackedWidgetFadeInAnimator.h \
19 | $$PWD/3rdparty/StackedWidgetAnimation/StackedWidgetFadeIn/StackedWidgetFadeInDecorator.h \
20 | $$PWD/3rdparty/StackedWidgetAnimation/StackedWidgetSlide/StackedWidgetSlideAnimator.h \
21 | $$PWD/3rdparty/StackedWidgetAnimation/StackedWidgetSlide/StackedWidgetSlideDecorator.h \
22 | $$PWD/3rdparty/StackedWidgetAnimation/StackedWidgetSlideOver/StackedWidgetSlideOverAnimator.h \
23 | $$PWD/3rdparty/StackedWidgetAnimation/StackedWidgetSlideOver/StackedWidgetSlideOverDecorator.h \
24 | $$PWD/3rdparty/WAF.h \
25 | $$PWD/clickablelabel.h \
26 | $$PWD/colorprovider.h \
27 | $$PWD/customtabbar.h \
28 | $$PWD/flattabwidget.h
29 |
30 | FORMS += \
31 | $$PWD/flattabwidget.ui
32 |
33 | INCLUDEPATH += $$PWD
34 |
--------------------------------------------------------------------------------
/misc/biquad.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This program is free software: you can redistribute it and/or modify
3 | it under the terms of the GNU General Public License as published by
4 | the Free Software Foundation, either version 3 of the License, or
5 | (at your option) any later version.
6 | This program is distributed in the hope that it will be useful,
7 | but WITHOUT ANY WARRANTY; without even the implied warranty of
8 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 | GNU General Public License for more details.
10 | You should have received a copy of the GNU General Public License
11 | along with this program. If not, see .
12 | *
13 | * ThePBone (c) 2020
14 | * Modified version of biquad.h from https://github.com/ThePBone/DDCToolbox
15 | */
16 |
17 | #ifndef BIQUAD_H
18 | #define BIQUAD_H
19 | #include
20 | #include
21 | #include
22 | #include
23 |
24 | class biquad
25 | {
26 | public:
27 | enum Type
28 | {
29 | PEAKING = 0x00,
30 | LOW_PASS,
31 | HIGH_PASS,
32 | BAND_PASS1,
33 | BAND_PASS2,
34 | NOTCH,
35 | ALL_PASS,
36 | LOW_SHELF,
37 | HIGH_SHELF,
38 | UNITY_GAIN,
39 | ONEPOLE_LOWPASS,
40 | ONEPOLE_HIGHPASS,
41 | INVALID = 0xFF
42 | };
43 | biquad();
44 | void refreshFilter(uint32_t id, Type type,double dbGain, double centreFreq, double fs, double dBandwidthOrQOrS, bool isBandwidthOrS);
45 | std::complex evaluateTransfer(std::complex z);
46 | uint32_t getId();
47 |
48 | private:
49 | std::complex internalBiquadCoeffs[6];
50 | double m_dFilterBQ;
51 | double m_dFilterFreq;
52 | double m_dFilterGain;
53 | Type m_dFilterType;
54 | bool m_isBandwidthOrS;
55 | uint32_t m_id;
56 | };
57 |
58 | #endif // BIQUAD_H
59 |
--------------------------------------------------------------------------------
/misc/autostartmanager.cpp:
--------------------------------------------------------------------------------
1 | #include "autostartmanager.h"
2 | #include "config/container.h"
3 | #include "config/io.h"
4 |
5 | #include
6 | #include
7 |
8 | AutostartManager::AutostartManager()
9 | {
10 | }
11 |
12 | void AutostartManager::saveDesktopFile(QString path, const QString& exepath,
13 | bool enableAutostartViper, bool delayed){
14 | ConfigContainer* conf = new ConfigContainer();
15 | conf->setValue("Exec",QString("%0%1 --tray%2%3")
16 | .arg(delayed ? "sleep 5s && " : "")
17 | .arg(exepath)
18 | .arg(enableAutostartViper ? " --startviper" : "")
19 | .arg(delayed ? " &" : ""));
20 | conf->setValue("Name","Viper4Linux2-GUI Systray");
21 | conf->setValue("StartupNotify",false);
22 | conf->setValue("Terminal",false);
23 | conf->setValue("Type","Application");
24 | conf->setValue("Version","1.0");
25 | conf->setValue("X-GNOME-Autostart-Delay",10);
26 | conf->setValue("X-GNOME-Autostart-enabled",true);
27 | conf->setValue("X-KDE-autostart-after","panel");
28 | conf->setValue("X-KDE-autostart-phase",2);
29 | conf->setValue("X-MATE-Autostart-Delay",10);
30 | ConfigIO::writeFile(path,conf->getConfigMap(),"[Desktop Entry]");
31 | }
32 |
33 | bool AutostartManager::inspectDesktopFile(const QString& path, InspectionMode mode){
34 | ConfigContainer conf;
35 | conf.setConfigMap(ConfigIO::readFile(path));
36 | switch(mode){
37 | case UsesViperAutostart:
38 | return conf.getString("Exec").contains("--startviper");
39 | case Delayed:
40 | return conf.getString("Exec").contains("sleep 5s");
41 | case Exists:
42 | return QFile::exists(path);
43 | }
44 | return false;
45 | }
46 |
47 | QString AutostartManager::getAutostartPath(const QString& filename){
48 | return QDir::homePath() + "/.config/autostart/" + filename;
49 | }
50 |
--------------------------------------------------------------------------------
/visualization/fftreal/fftreal_wrapper.cpp:
--------------------------------------------------------------------------------
1 | /***************************************************************************
2 | **
3 | ** Copyright (C) 2015 The Qt Company Ltd.
4 | ** Contact: http://www.qt.io/licensing/
5 | **
6 | ** This file is part of the examples of the Qt Toolkit.
7 | **
8 | ** This program is free software: you can redistribute it and/or modify
9 | ** it under the terms of the GNU Lesser General Public License as
10 | ** published by the Free Software Foundation, either version 2.1. This
11 | ** program is distributed in the hope that it will be useful, but WITHOUT
12 | ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | ** for more details. You should have received a copy of the GNU General
15 | ** Public License along with this program. If not, see
16 | ** .
17 | **
18 | ***************************************************************************/
19 |
20 | #include "fftreal_wrapper.h"
21 |
22 | // FFTReal code generates quite a lot of 'unused parameter' compiler warnings,
23 | // which we suppress here in order to get a clean build output.
24 | #if defined Q_CC_MSVC
25 | # pragma warning(disable:4100)
26 | #elif defined Q_CC_GNU
27 | # pragma GCC diagnostic ignored "-Wunused-parameter"
28 | #elif defined Q_CC_MWERKS
29 | # pragma warning off (10182)
30 | #endif
31 |
32 | #include "FFTRealFixLen.h"
33 |
34 | class FFTRealWrapperPrivate {
35 | public:
36 | ffft::FFTRealFixLen m_fft;
37 | };
38 |
39 |
40 | FFTRealWrapper::FFTRealWrapper()
41 | : m_private(new FFTRealWrapperPrivate)
42 | {
43 |
44 | }
45 |
46 | FFTRealWrapper::~FFTRealWrapper()
47 | {
48 | delete m_private;
49 | }
50 |
51 | void FFTRealWrapper::calculateFFT(DataType in[], const DataType out[])
52 | {
53 | m_private->m_fft.do_fft(in, out);
54 | }
55 |
--------------------------------------------------------------------------------
/misc/presetprovider.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This program is free software: you can redistribute it and/or modify
3 | it under the terms of the GNU General Public License as published by
4 | the Free Software Foundation, either version 3 of the License, or
5 | (at your option) any later version.
6 | This program is distributed in the hope that it will be useful,
7 | but WITHOUT ANY WARRANTY; without even the implied warranty of
8 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 | GNU General Public License for more details.
10 | You should have received a copy of the GNU General Public License
11 | along with this program. If not, see .
12 | *
13 | * ThePBone (c) 2020
14 | */
15 | #ifndef PRESETEXTENSION_H
16 | #define PRESETEXTENSION_H
17 | #include
18 | #include
19 | #include
20 | #include "initializableqmap.h"
21 |
22 | #define FLOAT_LIST QVector
23 | #define INT_LIST QVector
24 |
25 | #define EQ_UNIT QString,FLOAT_LIST
26 | #define DYNSYS_UNIT QString,INT_LIST
27 | #define COLM_UNIT QString,INT_LIST
28 |
29 | namespace PresetProvider {
30 | class EQ {
31 | public:
32 | static const FLOAT_LIST defaultPreset();
33 | static const FLOAT_LIST lookupPreset(const QString& preset);
34 | static const QMap EQ_LOOKUP_TABLE();
35 | static const QString reverseLookup(const QVector& data);
36 | };
37 | class Dynsys{
38 | public:
39 | static const QMap DYNSYS_LOOKUP_TABLE();
40 | static const INT_LIST lookupPreset(const QString& preset);
41 | static const QString reverseLookup(const QVector& data);
42 | };
43 | class Colm{
44 | public:
45 | static const QMap COLM_LOOKUP_TABLE();
46 | static const INT_LIST lookupPreset(const QString& preset);
47 | static const QString reverseLookup(const QVector &data);
48 | };
49 | }
50 | #endif // PRESETEXTENSION_H
51 |
--------------------------------------------------------------------------------
/dialog/FlatTabWidget/3rdparty/StackedWidgetAnimation/StackedWidgetSlide/StackedWidgetSlideDecorator.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Dimka Novikov, to@dimkanovikov.pro
3 | *
4 | * This library is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or any later version.
8 | *
9 | * This library is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * Full license: https://github.com/dimkanovikov/WidgetAnimationFramework/blob/master/LICENSE
15 | */
16 |
17 | #include "StackedWidgetSlideDecorator.h"
18 |
19 | #include
20 | #include
21 |
22 | using WAF::StackedWidgetSlideDecorator;
23 |
24 |
25 | StackedWidgetSlideDecorator::StackedWidgetSlideDecorator(QWidget* _parent, QWidget* _widgetForGrab) :
26 | QWidget(_parent),
27 | m_widgetForGrab(_widgetForGrab)
28 | {
29 | grabWidget();
30 | }
31 |
32 | void StackedWidgetSlideDecorator::grabContainer()
33 | {
34 | if (QStackedWidget* container = qobject_cast(parentWidget())) {
35 | m_widgetForGrab = container->currentWidget();
36 | grabWidget();
37 | }
38 | }
39 |
40 | void StackedWidgetSlideDecorator::grabWidget()
41 | {
42 | const QSize size = parentWidget()->size();
43 | m_widgetForGrab->resize(size);
44 | resize(size);
45 | m_foreground = QPixmap(size);
46 | m_widgetForGrab->render(&m_foreground, QPoint(), QRegion(QRect(QPoint(), size)));
47 | }
48 |
49 | void StackedWidgetSlideDecorator::paintEvent(QPaintEvent* _event)
50 | {
51 | QPainter painter(this);
52 | painter.drawPixmap(0, 0, m_foreground);
53 |
54 | QWidget::paintEvent(_event);
55 | }
56 |
57 |
--------------------------------------------------------------------------------
/dialog/FlatTabWidget/3rdparty/StackedWidgetAnimation/StackedWidgetSlideOver/StackedWidgetSlideOverDecorator.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Dimka Novikov, to@dimkanovikov.pro
3 | *
4 | * This library is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or any later version.
8 | *
9 | * This library is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * Full license: https://github.com/dimkanovikov/WidgetAnimationFramework/blob/master/LICENSE
15 | */
16 |
17 | #include "StackedWidgetSlideOverDecorator.h"
18 |
19 | #include
20 | #include
21 |
22 | using WAF::StackedWidgetSlideOverDecorator;
23 |
24 |
25 | StackedWidgetSlideOverDecorator::StackedWidgetSlideOverDecorator(QWidget* _parent, QWidget* _widgetForGrab) :
26 | QWidget(_parent),
27 | m_widgetForGrab(_widgetForGrab)
28 | {
29 | grabWidget();
30 | }
31 |
32 | void StackedWidgetSlideOverDecorator::grabContainer()
33 | {
34 | if (QStackedWidget* container = qobject_cast(parentWidget())) {
35 | m_widgetForGrab = container->currentWidget();
36 | grabWidget();
37 | }
38 | }
39 |
40 | void StackedWidgetSlideOverDecorator::grabWidget()
41 | {
42 | const QSize size = parentWidget()->size();
43 | m_widgetForGrab->resize(size);
44 | resize(size);
45 | m_foreground = QPixmap(size);
46 | m_widgetForGrab->render(&m_foreground, QPoint(), QRegion(QRect(QPoint(), size)));
47 | }
48 |
49 | void StackedWidgetSlideOverDecorator::paintEvent(QPaintEvent* _event)
50 | {
51 | QPainter painter(this);
52 | painter.drawPixmap(0, 0, m_foreground);
53 |
54 | QWidget::paintEvent(_event);
55 | }
56 |
57 |
--------------------------------------------------------------------------------
/dialog/FlatTabWidget/3rdparty/StackedWidgetAnimation/StackedWidgetSlide/StackedWidgetSlideDecorator.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Dimka Novikov, to@dimkanovikov.pro
3 | *
4 | * This library is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or any later version.
8 | *
9 | * This library is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * Full license: https://github.com/dimkanovikov/WidgetAnimationFramework/blob/master/LICENSE
15 | */
16 |
17 | #ifndef STACKEDWIDGETSLIDEDECORATOR_H
18 | #define STACKEDWIDGETSLIDEDECORATOR_H
19 |
20 | #include
21 |
22 | class QStackedWidget;
23 |
24 |
25 | /**
26 | * Widgets Animation Framework
27 | */
28 | namespace WAF
29 | {
30 | /**
31 | * @brief Класс рисующий выкатываемый виджет
32 | */
33 | class StackedWidgetSlideDecorator : public QWidget
34 | {
35 | Q_OBJECT
36 |
37 | public:
38 | explicit StackedWidgetSlideDecorator(QWidget* _parent, QWidget* _widgetForGrab);
39 |
40 | /**
41 | * @brief Сохранить изображение стэка для прорисовки
42 | */
43 | void grabContainer();
44 |
45 | /**
46 | * @brief Сохранить изображение виджета для прорисовки
47 | */
48 | void grabWidget();
49 |
50 | protected:
51 | /**
52 | * @brief Переопределяется для прорисовки декорации
53 | */
54 | void paintEvent(QPaintEvent* _event);
55 |
56 | private:
57 | /**
58 | * @brief Виджет, который будем рисовать
59 | */
60 | QWidget* m_widgetForGrab;
61 |
62 | /**
63 | * @brief Фоновое изображение
64 | */
65 | QPixmap m_foreground;
66 | };
67 | }
68 |
69 | #endif // STACKEDWIDGETSLIDEDECORATOR_H
70 |
--------------------------------------------------------------------------------
/visualization/fftreal/FFTRealSelect.h:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 |
3 | FFTRealSelect.h
4 | By Laurent de Soras
5 |
6 | --- Legal stuff ---
7 |
8 | This program is free software. It comes without any warranty, to
9 | the extent permitted by applicable law. You can redistribute it
10 | and/or modify it under the terms of the Do What The Fuck You Want
11 | To Public License, Version 2, as published by Sam Hocevar. See
12 | http://sam.zoy.org/wtfpl/COPYING for more details.
13 |
14 | *Tab=3***********************************************************************/
15 |
16 |
17 |
18 | #if ! defined (ffft_FFTRealSelect_HEADER_INCLUDED)
19 | #define ffft_FFTRealSelect_HEADER_INCLUDED
20 |
21 | #if defined (_MSC_VER)
22 | #pragma once
23 | #endif
24 |
25 |
26 |
27 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
28 |
29 | #include "def.h"
30 |
31 |
32 |
33 | namespace ffft
34 | {
35 |
36 |
37 |
38 | template
39 | class FFTRealSelect
40 | {
41 |
42 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
43 |
44 | public:
45 |
46 | ffft_FORCEINLINE static float *
47 | sel_bin (float *e_ptr, float *o_ptr);
48 |
49 |
50 |
51 | /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
52 |
53 | private:
54 |
55 | FFTRealSelect ();
56 | ~FFTRealSelect ();
57 | FFTRealSelect (const FFTRealSelect &other);
58 | FFTRealSelect& operator = (const FFTRealSelect &other);
59 | bool operator == (const FFTRealSelect &other);
60 | bool operator != (const FFTRealSelect &other);
61 |
62 | }; // class FFTRealSelect
63 |
64 |
65 |
66 | } // namespace ffft
67 |
68 |
69 |
70 | #include "FFTRealSelect.hpp"
71 |
72 |
73 |
74 | #endif // ffft_FFTRealSelect_HEADER_INCLUDED
75 |
76 |
77 |
78 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
79 |
--------------------------------------------------------------------------------
/dialog/FlatTabWidget/3rdparty/StackedWidgetAnimation/StackedWidgetSlideOver/StackedWidgetSlideOverDecorator.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Dimka Novikov, to@dimkanovikov.pro
3 | *
4 | * This library is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or any later version.
8 | *
9 | * This library is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * Full license: https://github.com/dimkanovikov/WidgetAnimationFramework/blob/master/LICENSE
15 | */
16 |
17 | #ifndef STACKEDWIDGETSLIDEOVERDECORATOR_H
18 | #define STACKEDWIDGETSLIDEOVERDECORATOR_H
19 |
20 | #include
21 |
22 | class QStackedWidget;
23 |
24 |
25 | /**
26 | * Widgets Animation Framework
27 | */
28 | namespace WAF
29 | {
30 | /**
31 | * @brief Класс рисующий выкатываемый виджет
32 | */
33 | class StackedWidgetSlideOverDecorator : public QWidget
34 | {
35 | Q_OBJECT
36 |
37 | public:
38 | explicit StackedWidgetSlideOverDecorator(QWidget* _parent, QWidget* _widgetForGrab);
39 |
40 | /**
41 | * @brief Сохранить изображение стэка для прорисовки
42 | */
43 | void grabContainer();
44 |
45 | /**
46 | * @brief Сохранить изображение виджета для прорисовки
47 | */
48 | void grabWidget();
49 |
50 | protected:
51 | /**
52 | * @brief Переопределяется для прорисовки декорации
53 | */
54 | void paintEvent(QPaintEvent* _event);
55 |
56 | private:
57 | /**
58 | * @brief Виджет, который будем рисовать
59 | */
60 | QWidget* m_widgetForGrab;
61 |
62 | /**
63 | * @brief Фоновое изображение
64 | */
65 | QPixmap m_foreground;
66 | };
67 | }
68 |
69 | #endif // STACKEDWIDGETSLIDEOVERDECORATOR_H
70 |
--------------------------------------------------------------------------------
/dialog/slidingstackedwidget.h:
--------------------------------------------------------------------------------
1 | #ifndef SLIDINGSTACKEDWIDGET_H
2 | #define SLIDINGSTACKEDWIDGET_H
3 | #include
4 | #include
5 |
6 | class SlidingStackedWidget : public QStackedWidget {
7 |
8 | Q_OBJECT
9 | public:
10 | //! This enumeration is used to define the animation direction
11 | enum t_direction {
12 | LEFT2RIGHT,
13 | RIGHT2LEFT,
14 | TOP2BOTTOM,
15 | BOTTOM2TOP,
16 | AUTOMATIC
17 | };
18 | //! The Constructor and Destructor
19 | SlidingStackedWidget(QWidget *parent);
20 |
21 |
22 | public slots:
23 |
24 | //! Some basic settings API
25 | void setSpeed(int speed); //animation duration in milliseconds
26 | void setAnimation(enum QEasingCurve::Type animationtype); //check out the QEasingCurve documentation for different styles
27 | void setVerticalMode(bool vertical=true);
28 | void setWrap(bool wrap); //wrapping is related to slideInNext/Prev;it defines the behaviour when reaching last/first page
29 | //! The Animation / Page Change API
30 | void slideInNext();
31 | void slideInPrev();
32 | void slideInIdx(int idx, enum t_direction direction=AUTOMATIC);
33 |
34 | signals:
35 | //! this is used for internal purposes in the class engine
36 | void animationFinished(void);
37 | protected slots:
38 |
39 | //! this is used for internal purposes in the class engine
40 | void animationDoneSlot(void);
41 | protected:
42 |
43 | //! this is used for internal purposes in the class engine
44 | void slideInWgt(QWidget * widget, enum t_direction direction=AUTOMATIC);
45 | QWidget *m_mainwindow;
46 | int m_speed;
47 | enum QEasingCurve::Type m_animationtype;
48 | bool m_vertical;
49 | int m_now;
50 | int m_next;
51 | bool m_wrap;
52 | QPoint m_pnow;
53 | bool m_active;
54 | QList blockedPageList;
55 | };
56 | #endif // SLIDINGSTACKEDWIDGET_H
57 |
--------------------------------------------------------------------------------
/dbus/clientproxy.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file was generated by qdbusxml2cpp version 0.8
3 | * Command line was: qdbusxml2cpp -a adaptor.h:adaptor.cpp -p clientproxy.h:clientproxy.cpp dbus/manifest.xml cf.thebone.viper4linux.Gui
4 | *
5 | * qdbusxml2cpp is Copyright (C) 2019 The Qt Company Ltd.
6 | *
7 | * This is an auto-generated file.
8 | * Do not edit! All changes made to it will be lost.
9 | */
10 |
11 | #ifndef CLIENTPROXY_H
12 | #define CLIENTPROXY_H
13 |
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 | #include
20 | #include
21 | #include
22 |
23 | /*
24 | * Proxy class for interface cf.thebone.viper4linux.Gui
25 | */
26 | class CfTheboneViper4linuxGuiInterface: public QDBusAbstractInterface
27 | {
28 | Q_OBJECT
29 | public:
30 | static inline const char *staticInterfaceName()
31 | { return "cf.thebone.viper4linux.Gui"; }
32 |
33 | public:
34 | CfTheboneViper4linuxGuiInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);
35 |
36 | ~CfTheboneViper4linuxGuiInterface();
37 |
38 | public Q_SLOTS: // METHODS
39 | inline QDBusPendingReply<> hide()
40 | {
41 | QList argumentList;
42 | return asyncCallWithArgumentList(QStringLiteral("hide"), argumentList);
43 | }
44 |
45 | inline QDBusPendingReply<> raiseWindow()
46 | {
47 | QList argumentList;
48 | return asyncCallWithArgumentList(QStringLiteral("raiseWindow"), argumentList);
49 | }
50 |
51 | inline QDBusPendingReply<> show()
52 | {
53 | QList argumentList;
54 | return asyncCallWithArgumentList(QStringLiteral("show"), argumentList);
55 | }
56 |
57 | Q_SIGNALS: // SIGNALS
58 | };
59 |
60 | namespace cf {
61 | namespace thebone {
62 | namespace viper4linux {
63 | typedef ::CfTheboneViper4linuxGuiInterface Gui;
64 | }
65 | }
66 | }
67 | #endif
68 |
--------------------------------------------------------------------------------
/dialog/importandroid.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | importandroid
4 |
5 |
6 | Qt::ApplicationModal
7 |
8 |
9 |
10 | 0
11 | 0
12 | 396
13 | 43
14 |
15 |
16 |
17 | Import Android Config
18 |
19 |
20 |
21 | :/icons/viper.png:/icons/viper.png
22 |
23 |
24 | true
25 |
26 |
27 |
28 | 6
29 |
30 |
31 | 3
32 |
33 |
34 | 6
35 |
36 |
37 | 3
38 |
39 | -
40 |
41 |
42 | New Name
43 |
44 |
45 |
46 | -
47 |
48 |
49 |
50 | 100
51 | 16777215
52 |
53 |
54 |
55 |
56 | -
57 |
58 |
59 | Select XML
60 |
61 |
62 |
63 |
64 |
65 |
66 | lineEdit
67 | comboBox
68 | pushButton
69 |
70 |
71 |
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/dialog/qmessageoverlay.cpp:
--------------------------------------------------------------------------------
1 | #include "qmessageoverlay.h"
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 |
9 | QMessageOverlay::QMessageOverlay(QWidget* _parent, bool _folowToHeadWidget) :
10 | QWidget(_parent),
11 | m_isInUpdateSelf(false)
12 | {
13 | Q_ASSERT_X(_parent, "", Q_FUNC_INFO);
14 |
15 | if (_folowToHeadWidget) {
16 | while (_parent->parentWidget() != nullptr) {
17 | _parent = _parent->parentWidget();
18 | }
19 | setParent(_parent);
20 | }
21 |
22 | _parent->installEventFilter(this);
23 | setVisible(false);
24 | }
25 |
26 | bool QMessageOverlay::eventFilter(QObject* _object, QEvent* _event)
27 | {
28 | if (_event->type() == QEvent::ChildAdded) {
29 | QChildEvent* childEvent = dynamic_cast(_event);
30 | if (childEvent->child() != this && _object != qobject_cast(parentWidget())) {
31 | QWidget* parent = parentWidget();
32 | setParent(nullptr);
33 | setParent(parent);
34 | }
35 | }
36 |
37 | if (isVisible()
38 | && _event->type() == QEvent::Resize) {
39 | updateSelf();
40 | }
41 | return QWidget::eventFilter(_object, _event);
42 | }
43 |
44 | void QMessageOverlay::paintEvent(QPaintEvent* _event)
45 | {
46 | QPainter p;
47 | p.begin(this);
48 | p.drawPixmap(-1, -1, width(), height(), m_parentWidgetPixmap);
49 | p.setBrush(QBrush(QColor(0, 0, 0, 220)));
50 | p.drawRect(-1, -1, width()+1, height()+1);
51 | p.end();
52 | QWidget::paintEvent(_event);
53 | }
54 |
55 | void QMessageOverlay::showEvent(QShowEvent* _event)
56 | {
57 | updateSelf();
58 | QWidget::showEvent(_event);
59 | }
60 |
61 | void QMessageOverlay::updateSelf()
62 | {
63 | if (!m_isInUpdateSelf) {
64 | m_isInUpdateSelf = true;
65 | {
66 | hide();
67 | resize(parentWidget()->size());
68 | m_parentWidgetPixmap = grabParentWidgetPixmap();
69 | show();
70 | }
71 | m_isInUpdateSelf = false;
72 | }
73 | }
74 |
75 | QPixmap QMessageOverlay::grabParentWidgetPixmap() const
76 | {
77 | QPixmap parentWidgetPixmap;
78 | parentWidgetPixmap = parentWidget()->grab();
79 | return parentWidgetPixmap;
80 | }
81 |
--------------------------------------------------------------------------------
/config/container.cpp:
--------------------------------------------------------------------------------
1 | #include "container.h"
2 |
3 | #include
4 | #include
5 | ConfigContainer::ConfigContainer()
6 | = default;
7 | void ConfigContainer::setValue(const QString& key,QVariant value){
8 | map[key] = std::move(value);
9 | }
10 | QVariant ConfigContainer::getVariant(const QString& key){
11 | if(!map.contains(key)){
12 | qWarning().noquote().nospace() << "[W] Requested key '" << key << "' not found";
13 | return QVariant();
14 | }
15 | return map.find(key).value();
16 | }
17 | QString ConfigContainer::getString(const QString& key,bool setToDefaultIfMissing, QString alternative){
18 | if(!map.contains(key)){
19 | qWarning().noquote().nospace() << "[W] Requested key '" << key << "' not found";
20 | if(setToDefaultIfMissing)map[key] = alternative;
21 | return alternative;
22 | }
23 | return getVariant(key).toString();
24 | }
25 | int ConfigContainer::getInt(const QString& key, int alternative){
26 | if(!map.contains(key)){
27 | qWarning().noquote().nospace() << "[W] Requested key '" << key << "' not found";
28 | map[key] = alternative;
29 | return alternative;
30 | }
31 | return getVariant(key).toInt();
32 | }
33 | float ConfigContainer::getFloat(const QString& key){
34 | if(!map.contains(key)){
35 | qWarning().noquote().nospace() << "[W] Requested key '" << key << "' not found";
36 | map[key] = 0.0F;
37 | return 0.0F;
38 | }
39 | return getVariant(key).toFloat();
40 | }
41 | bool ConfigContainer::getBool(const QString& key, bool setToDefaultIfMissing, bool alternative){
42 | if(!map.contains(key)){
43 | qWarning().noquote().nospace() << "[W] Requested key '" << key << "' not found";
44 | if(setToDefaultIfMissing)map[key] = alternative;
45 | return alternative;
46 | }
47 | return getVariant(key).toBool();
48 | }
49 | QVariantMap ConfigContainer::getConfigMap(){
50 | return map;
51 | }
52 | void ConfigContainer::setConfigMap(const QVariantMap& newmap){
53 | map.clear();
54 | for(const auto& e : newmap.keys())
55 | map[e] = newmap.value(e);
56 | }
57 |
--------------------------------------------------------------------------------
/visualization/SpectrumAudioViewer.pri:
--------------------------------------------------------------------------------
1 | TEMPLATE = app
2 |
3 | QT += multimedia widgets
4 |
5 | SOURCES += \
6 | $$PWD/audiostreamengine.cpp \
7 | $$PWD/fftreal/fftreal_wrapper.cpp \
8 | $$PWD/frequencyspectrum.cpp \
9 | $$PWD/spectrograph.cpp \
10 | $$PWD/spectrumanalyser.cpp \
11 | $$PWD/utils.cpp
12 |
13 | HEADERS += \
14 | $$PWD/audiostreamengine.h \
15 | $$PWD/fftreal/Array.h \
16 | $$PWD/fftreal/Array.hpp \
17 | $$PWD/fftreal/DynArray.h \
18 | $$PWD/fftreal/DynArray.hpp \
19 | $$PWD/fftreal/FFTReal.h \
20 | $$PWD/fftreal/FFTReal.hpp \
21 | $$PWD/fftreal/FFTRealFixLen.h \
22 | $$PWD/fftreal/FFTRealFixLen.hpp \
23 | $$PWD/fftreal/FFTRealFixLenParam.h \
24 | $$PWD/fftreal/FFTRealPassDirect.h \
25 | $$PWD/fftreal/FFTRealPassDirect.hpp \
26 | $$PWD/fftreal/FFTRealPassInverse.h \
27 | $$PWD/fftreal/FFTRealPassInverse.hpp \
28 | $$PWD/fftreal/FFTRealSelect.h \
29 | $$PWD/fftreal/FFTRealSelect.hpp \
30 | $$PWD/fftreal/FFTRealUseTrigo.h \
31 | $$PWD/fftreal/FFTRealUseTrigo.hpp \
32 | $$PWD/fftreal/OscSinCos.h \
33 | $$PWD/fftreal/OscSinCos.hpp \
34 | $$PWD/fftreal/def.h \
35 | $$PWD/fftreal/fftreal_wrapper.h \
36 | $$PWD/frequencyspectrum.h \
37 | $$PWD/spectrograph.h \
38 | $$PWD/spectrum.h \
39 | $$PWD/spectrumanalyser.h \
40 | $$PWD/utils.h
41 |
42 | fftreal_dir = $$PWD/fftreal
43 |
44 | INCLUDEPATH += $${fftreal_dir}
45 |
46 | #DEFINES += LOG_SPECTRUMANALYSER
47 | #DEFINES += LOG_WAVEFORM
48 | #DEFINES += LOG_ENGINE
49 | #DEFINES += DUMP_SPECTRUMANALYSER
50 | #DEFINES += DUMP_CAPTURED_AUDIO
51 | DEFINES += DISABLE_LEVEL
52 | #DEFINES += DISABLE_FFT
53 | DEFINES += DISABLE_WAVEFORM
54 | #DEFINES += SUPERIMPOSE_PROGRESS_ON_WAVEFORM
55 | DEFINES += SPECTRUM_ANALYSER_SEPARATE_THREAD
56 |
57 | CONFIG += install_ok # Do not cargo-cult this!
58 |
--------------------------------------------------------------------------------
/3rdparty/WAF/Animation/CircleFill/CircleFillDecorator.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Dimka Novikov, to@dimkanovikov.pro
3 | *
4 | * This library is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or any later version.
8 | *
9 | * This library is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * Full license: https://github.com/dimkanovikov/WidgetAnimationFramework/blob/master/LICENSE
15 | */
16 |
17 |
18 | #ifndef CIRCLEFILLDECORATOR_H
19 | #define CIRCLEFILLDECORATOR_H
20 |
21 | #include
22 |
23 |
24 | /**
25 | * Widgets Animation Framework
26 | */
27 | namespace WAF
28 | {
29 | /**
30 | * @brief Класс рисующий круг, заполняющий пространство
31 | */
32 | class CircleFillDecorator : public QWidget
33 | {
34 | Q_OBJECT
35 |
36 | Q_PROPERTY(int radius READ radius WRITE setRadius)
37 |
38 | public:
39 | explicit CircleFillDecorator(QWidget* _parent);
40 |
41 | /**
42 | * @brief Установить точку центра круга
43 | */
44 | void setStartPoint(const QPoint& _point);
45 |
46 | /**
47 | * @brief Радиус рисуемой окружности
48 | */
49 | /** @{ */
50 | int radius() const;
51 | void setRadius(int _radius);
52 | /** @} */
53 |
54 | /**
55 | * @brief Установить цвет заливки
56 | */
57 | void setFillColor(const QColor& _fillColor);
58 |
59 | protected:
60 | /**
61 | * @brief Переопределяется для прорисовки декорации
62 | */
63 | void paintEvent(QPaintEvent* _event);
64 |
65 | private:
66 | /**
67 | * @brief Точка из которой начинается заполенние
68 | */
69 | QPoint m_startPoint;
70 |
71 | /**
72 | * @brief Прозрачность изображения виджета для прорисовки
73 | */
74 | int m_radius;
75 |
76 | /**
77 | * @brief Цвет растворения
78 | */
79 | QColor m_fillColor;
80 | };
81 | }
82 |
83 | #endif // CIRCLEFILLDECORATOR_H
84 |
--------------------------------------------------------------------------------
/dialog/log.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | log
4 |
5 |
6 |
7 | 0
8 | 0
9 | 443
10 | 260
11 |
12 |
13 |
14 | Log Viewer
15 |
16 |
17 |
18 | :/icons/viper-new.svg:/icons/viper-new.svg
19 |
20 |
21 | -
22 |
23 |
24 | Reload
25 |
26 |
27 |
28 | -
29 |
30 |
31 | QTextEdit::NoWrap
32 |
33 |
34 |
35 | -
36 |
37 |
38 | Qt::Horizontal
39 |
40 |
41 |
42 | 40
43 | 20
44 |
45 |
46 |
47 |
48 | -
49 |
50 |
51 |
52 | 120
53 | 0
54 |
55 |
56 |
-
57 |
58 | User Interface
59 |
60 |
61 | -
62 |
63 | GST Plugin
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | viperlog
72 | select
73 | reload
74 |
75 |
76 |
77 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/visualization/fftreal/fftreal_wrapper.h:
--------------------------------------------------------------------------------
1 | /***************************************************************************
2 | **
3 | ** Copyright (C) 2015 The Qt Company Ltd.
4 | ** Contact: http://www.qt.io/licensing/
5 | **
6 | ** This file is part of the examples of the Qt Toolkit.
7 | **
8 | ** This program is free software: you can redistribute it and/or modify
9 | ** it under the terms of the GNU Lesser General Public License as
10 | ** published by the Free Software Foundation, either version 2.1. This
11 | ** program is distributed in the hope that it will be useful, but WITHOUT
12 | ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 | ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 | ** for more details. You should have received a copy of the GNU General
15 | ** Public License along with this program. If not, see
16 | ** .
17 | **
18 | ***************************************************************************/
19 |
20 | #ifndef FFTREAL_WRAPPER_H
21 | #define FFTREAL_WRAPPER_H
22 |
23 | #include
24 |
25 | #if defined(FFTREAL_LIBRARY)
26 | # define FFTREAL_EXPORT Q_DECL_EXPORT
27 | #else
28 | # define FFTREAL_EXPORT Q_DECL_IMPORT
29 | #endif
30 |
31 | class FFTRealWrapperPrivate;
32 |
33 | // Each pass of the FFT processes 2^X samples, where X is the
34 | // number below.
35 | static const int FFTLengthPowerOfTwo = 12;
36 |
37 | /**
38 | * Wrapper around the FFTRealFixLen template provided by the FFTReal
39 | * library
40 | *
41 | * This class instantiates a single instance of FFTRealFixLen, using
42 | * FFTLengthPowerOfTwo as the template parameter. It then exposes
43 | * FFTRealFixLen::do_fft via the calculateFFT
44 | * function, thereby allowing an application to dynamically link
45 | * against the FFTReal implementation.
46 | *
47 | * See http://ldesoras.free.fr/prod.html
48 | */
49 | class FFTREAL_EXPORT FFTRealWrapper
50 | {
51 | public:
52 | FFTRealWrapper();
53 | ~FFTRealWrapper();
54 |
55 | typedef float DataType;
56 | void calculateFFT(DataType in[], const DataType out[]);
57 |
58 | private:
59 | FFTRealWrapperPrivate* m_private;
60 | };
61 |
62 | #endif // FFTREAL_WRAPPER_H
63 |
64 |
--------------------------------------------------------------------------------
/3rdparty/WAF/Animation/Expand/ExpandDecorator.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Dimka Novikov, to@dimkanovikov.pro
3 | *
4 | * This library is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or any later version.
8 | *
9 | * This library is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * Full license: https://github.com/dimkanovikov/WidgetAnimationFramework/blob/master/LICENSE
15 | */
16 |
17 |
18 | #ifndef EXPANDDECORATOR_H
19 | #define EXPANDDECORATOR_H
20 |
21 | #include
22 |
23 |
24 | /**
25 | * Widgets Animation Framework
26 | */
27 | namespace WAF
28 | {
29 | /**
30 | * @brief Класс рисующий выезжание области, с последующим заполнением пространства
31 | */
32 | class ExpandDecorator : public QWidget
33 | {
34 | Q_OBJECT
35 |
36 | Q_PROPERTY(QRect expandRect READ expandRect WRITE setExpandRect)
37 |
38 | public:
39 | explicit ExpandDecorator(QWidget* _parent);
40 |
41 | /**
42 | * @brief Радиус рисуемой окружности
43 | */
44 | /** @{ */
45 | QRect expandRect() const;
46 | void setExpandRect(QRect _expandRect);
47 | /** @} */
48 |
49 | /**
50 | * @brief Сохранить изображение расширяемой области, для последующего его смещения
51 | */
52 | void grabExpandRect();
53 |
54 | /**
55 | * @brief Установить цвет заливки
56 | */
57 | void setFillColor(const QColor& _fillColor);
58 |
59 | protected:
60 | /**
61 | * @brief Переопределяется для прорисовки декорации
62 | */
63 | void paintEvent(QPaintEvent* _event);
64 |
65 | private:
66 | /**
67 | * @brief Точка из которой начинается заполенние
68 | */
69 | QPixmap m_expandRectPixmap;
70 |
71 | /**
72 | * @brief Прозрачность изображения виджета для прорисовки
73 | */
74 | QRect m_expandRect;
75 |
76 | /**
77 | * @brief Цвет растворения
78 | */
79 | QColor m_fillColor;
80 | };
81 | }
82 |
83 | #endif // EXPANDDECORATOR_H
84 |
--------------------------------------------------------------------------------
/dialog/presetdlg.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This program is free software: you can redistribute it and/or modify
3 | it under the terms of the GNU General Public License as published by
4 | the Free Software Foundation, either version 3 of the License, or
5 | (at your option) any later version.
6 | This program is distributed in the hope that it will be useful,
7 | but WITHOUT ANY WARRANTY; without even the implied warranty of
8 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 | GNU General Public License for more details.
10 | You should have received a copy of the GNU General Public License
11 | along with this program. If not, see .
12 | *
13 | * ThePBone (c) 2020
14 | */
15 | #ifndef PRESET_H
16 | #define PRESET_H
17 |
18 | #include
19 | #include
20 | #include "misc/converter.h"
21 |
22 | class AppConfigWrapper;
23 |
24 | class ViperWindow;
25 |
26 | namespace Ui {
27 | class Preset;
28 | }
29 |
30 | class PresetDlg : public QDialog
31 | {
32 | Q_OBJECT
33 |
34 | public:
35 | explicit PresetDlg(ViperWindow *mainwin,QWidget *parent = nullptr);
36 | void UpdateList();
37 | ~PresetDlg();
38 | private slots:
39 | void reject();
40 | void add();
41 | void remove();
42 | void load();
43 | void reloadRepo();
44 | void repoIndexChanged();
45 | void importAndroid();
46 | void exportAndroid(converter::configtype cmode);
47 | void importLinux();
48 | void exportLinux();
49 | void download();
50 | void nameChanged(const QString&);
51 | void showContextMenu(const QPoint &pos);
52 | void indexDownloaded(QNetworkReply*);
53 | void visitGithub();
54 | void performIRSDownload(QNetworkReply* reply);
55 | void performDownload(QNetworkReply* reply);
56 |
57 | private:
58 | Ui::Preset *ui;
59 | ViperWindow* m_mainwin;
60 | AppConfigWrapper *appconf;
61 | QStringList irs;
62 | QString optimizeName(const QString& s);
63 | QNetworkAccessManager *manager;
64 | QNetworkRequest request;
65 | QString toCamelCase(const QString& s);
66 |
67 | signals:
68 | void presetChanged();
69 | };
70 | class FileObject
71 | {
72 | public:
73 | const QString url;
74 | const QString name;
75 | };
76 | #endif // PRESET_H
77 |
--------------------------------------------------------------------------------
/visualization/fftreal/Array.h:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 |
3 | Array.h
4 | By Laurent de Soras
5 |
6 | --- Legal stuff ---
7 |
8 | This program is free software. It comes without any warranty, to
9 | the extent permitted by applicable law. You can redistribute it
10 | and/or modify it under the terms of the Do What The Fuck You Want
11 | To Public License, Version 2, as published by Sam Hocevar. See
12 | http://sam.zoy.org/wtfpl/COPYING for more details.
13 |
14 | *Tab=3***********************************************************************/
15 |
16 |
17 |
18 | #if ! defined (ffft_Array_HEADER_INCLUDED)
19 | #define ffft_Array_HEADER_INCLUDED
20 |
21 | #if defined (_MSC_VER)
22 | #pragma once
23 | #pragma warning (4 : 4250) // "Inherits via dominance."
24 | #endif
25 |
26 |
27 |
28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
29 |
30 |
31 |
32 | namespace ffft
33 | {
34 |
35 |
36 |
37 | template
38 | class Array
39 | {
40 |
41 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
42 |
43 | public:
44 |
45 | typedef T DataType;
46 |
47 | Array ();
48 |
49 | inline const DataType &
50 | operator [] (long pos) const;
51 | inline DataType &
52 | operator [] (long pos);
53 |
54 | static inline long
55 | size ();
56 |
57 |
58 |
59 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
60 |
61 | protected:
62 |
63 |
64 |
65 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
66 |
67 | private:
68 |
69 | DataType _data_arr [LEN];
70 |
71 |
72 |
73 | /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
74 |
75 | private:
76 |
77 | Array (const Array &other);
78 | Array & operator = (const Array &other);
79 | bool operator == (const Array &other);
80 | bool operator != (const Array &other);
81 |
82 | }; // class Array
83 |
84 |
85 |
86 | } // namespace ffft
87 |
88 |
89 |
90 | #include "Array.hpp"
91 |
92 |
93 |
94 | #endif // ffft_Array_HEADER_INCLUDED
95 |
96 |
97 |
98 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
99 |
--------------------------------------------------------------------------------
/scripts/install-debian.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | RED='\033[0;31m'
3 | GREEN='\033[0;32m'
4 | NC='\033[0m'
5 |
6 | if ( $EUID != 0 ); then
7 | echo "Please run as root"
8 | exit
9 | fi
10 |
11 | if pgrep viper-gui >/dev/null 2>&1
12 | then
13 | printf "${RED}viper-gui is in use\n${NC}Please terminate all Viper4Linux-GUI processes and try again.\n"
14 | exit 1
15 | fi
16 |
17 | dir=$(mktemp -d)
18 | cd $dir
19 | printf "Working Directory: $dir\n"
20 |
21 | printf "Getting latest release tag... "
22 | latestrelease=$(curl --silent "https://api.github.com/repos/Audio4Linux/Audio4Linux/releases/latest" |grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
23 |
24 | if [[ $latestrelease == "" ]]
25 | then
26 | printf "${RED}Invalid Response${NC}\n"
27 | printf "Please check your network connection.\n"
28 | exit 1
29 | fi
30 |
31 | printf ${GREEN}$latestrelease${NC}"\n"
32 |
33 | printf "Downloading build using wget... \n"
34 | wget -O viper-gui https://github.com/ThePBone/Audio4Linux/releases/download/$latestrelease/viper-gui -q --show-progress
35 |
36 | if [ ! -f "viper-gui" ]; then
37 | printf "${RED}Downloaded file not found${NC}\n"
38 | exit 1
39 | fi
40 |
41 | printf "Downloading icon using wget... \n"
42 | wget -O viper-gui.png https://raw.githubusercontent.com/ThePBone/Audio4Linux/master/viper.png -q --show-progress
43 |
44 | if [ ! -f "viper-gui.png" ]; then
45 | printf "${RED}Downloaded icon not found${NC}\n"
46 | fi
47 |
48 | printf "Installing Dependencies using apt-get\n"
49 | sudo apt-get --assume-yes install libqt5widgets5 libqt5gui5 libqt5core5a libqt5xml5 libgl1-mesa-dev
50 |
51 | printf "Installing viper-gui to /usr/local/bin...\n"
52 | rm /usr/bin/viper-gui 2> /dev/null #remove gui from oldpath if still existing there
53 | cp viper-gui /usr/local/bin/
54 | chmod 755 /usr/local/bin/viper-gui
55 |
56 | printf "Installing Desktop Entry and Icon\n"
57 | cp viper-gui.png /usr/share/pixmaps/viper-gui.png
58 | cat <> /usr/share/applications/viper-gui.desktop
59 | [Desktop Entry]
60 | Name=Viper4Linux2
61 | GenericName=Equalizer
62 | Comment=Official UI for Viper4Linux2
63 | Keywords=equalizer
64 | Categories=AudioVideo;Audio;
65 | Exec=viper-gui
66 | Icon=/usr/share/pixmaps/viper-gui.png
67 | StartupNotify=false
68 | Terminal=false
69 | Type=Application
70 |
71 | EOT
72 |
73 | printf "${GREEN}Done!${NC}\n"
74 |
--------------------------------------------------------------------------------
/visualization/fftreal/FFTRealFixLenParam.h:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 |
3 | FFTRealFixLenParam.h
4 | By Laurent de Soras
5 |
6 | --- Legal stuff ---
7 |
8 | This program is free software. It comes without any warranty, to
9 | the extent permitted by applicable law. You can redistribute it
10 | and/or modify it under the terms of the Do What The Fuck You Want
11 | To Public License, Version 2, as published by Sam Hocevar. See
12 | http://sam.zoy.org/wtfpl/COPYING for more details.
13 |
14 | *Tab=3***********************************************************************/
15 |
16 |
17 |
18 | #if ! defined (ffft_FFTRealFixLenParam_HEADER_INCLUDED)
19 | #define ffft_FFTRealFixLenParam_HEADER_INCLUDED
20 |
21 | #if defined (_MSC_VER)
22 | #pragma once
23 | #pragma warning (4 : 4250) // "Inherits via dominance."
24 | #endif
25 |
26 |
27 |
28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
29 |
30 |
31 |
32 | namespace ffft
33 | {
34 |
35 |
36 |
37 | class FFTRealFixLenParam
38 | {
39 |
40 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
41 |
42 | public:
43 |
44 | // Over this bit depth, we use direct calculation for sin/cos
45 | enum { TRIGO_BD_LIMIT = 12 };
46 |
47 | typedef float DataType;
48 |
49 |
50 |
51 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
52 |
53 | protected:
54 |
55 |
56 |
57 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
58 |
59 | private:
60 |
61 |
62 |
63 | /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
64 |
65 | private:
66 |
67 | FFTRealFixLenParam ();
68 | FFTRealFixLenParam (const FFTRealFixLenParam &other);
69 | FFTRealFixLenParam &
70 | operator = (const FFTRealFixLenParam &other);
71 | bool operator == (const FFTRealFixLenParam &other);
72 | bool operator != (const FFTRealFixLenParam &other);
73 |
74 | }; // class FFTRealFixLenParam
75 |
76 |
77 |
78 | } // namespace ffft
79 |
80 |
81 |
82 | //#include "FFTRealFixLenParam.hpp"
83 |
84 |
85 |
86 | #endif // ffft_FFTRealFixLenParam_HEADER_INCLUDED
87 |
88 |
89 |
90 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
91 |
--------------------------------------------------------------------------------
/3rdparty/WAF/Animation/SideSlide/SideSlideAnimator.h:
--------------------------------------------------------------------------------
1 | #ifndef SIDESLIDEANIMATOR2_H
2 | #define SIDESLIDEANIMATOR2_H
3 |
4 | #include "../../WAF.h"
5 | #include "../../AbstractAnimator.h"
6 |
7 | class QPropertyAnimation;
8 |
9 |
10 | /**
11 | * Widgets Animation Framework
12 | */
13 | namespace WAF
14 | {
15 | class SideSlideDecorator;
16 |
17 |
18 | /**
19 | * @brief Аниматор выдвижения виджета из-за стороны приложения
20 | */
21 | class SideSlideAnimator : public AbstractAnimator
22 | {
23 | Q_OBJECT
24 |
25 | public:
26 | explicit SideSlideAnimator(QWidget* _widgetForSlide);
27 |
28 | /**
29 | * @brief Установить сторону, откуда выдвигать виджет
30 | */
31 | void setApplicationSide(ApplicationSide _side);
32 |
33 | /**
34 | * @brief Использовать ли декорирование фона
35 | */
36 | void setDecorateBackground(bool _decorate);
37 |
38 | /**
39 | * @brief Длительность анимации
40 | */
41 | int animationDuration() const;
42 |
43 | /**
44 | * @brief Выдвинуть виджет
45 | */
46 | /** @{ */
47 | void animateForward();
48 | void slideIn();
49 | /** @} */
50 |
51 | /**
52 | * @brief Задвинуть виджет
53 | */
54 | /** @{ */
55 | void animateBackward();
56 | void slideOut();
57 | /** @} */
58 |
59 | protected:
60 | /**
61 | * @brief Переопределяется, чтобы корректировать размер выкатываемого виджета
62 | */
63 | bool eventFilter(QObject* _object, QEvent* _event);
64 |
65 | private:
66 | /**
67 | * @brief Получить виджет, который нужно анимировать
68 | */
69 | QWidget* widgetForSlide() const;
70 |
71 | private:
72 | /**
73 | * @brief Сторона из-за которой выкатывать виджет
74 | */
75 | ApplicationSide m_side;
76 |
77 | /**
78 | * @brief Необходимо ли декорировать фон
79 | */
80 | bool m_decorateBackground;
81 |
82 | /**
83 | * @brief Помошник затемняющий фон под выезжающим виджетом
84 | */
85 | SideSlideDecorator* m_decorator = nullptr;
86 |
87 | /**
88 | * @brief Объект для анимирования выезжания
89 | */
90 | QPropertyAnimation* m_animation = nullptr;
91 | };
92 | }
93 |
94 | #endif // SIDESLIDEANIMATOR2_H
95 |
--------------------------------------------------------------------------------
/3rdparty/WAF/Animation/SideSlide/SideSlideDecorator.h:
--------------------------------------------------------------------------------
1 | #ifndef SIDESLIDEDECORATOR_H
2 | #define SIDESLIDEDECORATOR_H
3 |
4 | #include
5 | #include
6 |
7 |
8 | /**
9 | * Widgets Animation Framework
10 | */
11 | namespace WAF
12 | {
13 | /**
14 | * @brief Класс декорирующий анимацию выкатывания
15 | */
16 | class SideSlideDecorator : public QWidget
17 | {
18 | Q_OBJECT
19 |
20 | Q_PROPERTY(QPoint slidePos READ slidePos WRITE setSlidePos)
21 |
22 | public:
23 | explicit SideSlideDecorator(QWidget* _parent);
24 |
25 | /**
26 | * @brief Сохранить изображение выкатываемого виджета
27 | */
28 | void grabSlideWidget(QWidget* _slideWidget);
29 |
30 | /**
31 | * @brief Сохранить изображение родительского виджета
32 | */
33 | void grabParent();
34 |
35 | /**
36 | * @brief Задекорировать фон
37 | */
38 | void decorate(bool _dark);
39 |
40 | /**
41 | * @brief Получить позицию выкатываемого виджета
42 | */
43 | QPoint slidePos() const;
44 |
45 | /**
46 | * @brief Установить позицию выкатываемого виджета
47 | */
48 | void setSlidePos(const QPoint& _pos);
49 |
50 | signals:
51 | /**
52 | * @brief На виджете произведён щелчёк мышью
53 | */
54 | void clicked();
55 |
56 | protected:
57 | /**
58 | * @brief Переопределяется для прорисовки декорации
59 | */
60 | void paintEvent(QPaintEvent* _event);
61 |
62 | /**
63 | * @brief Переопределяется для отлавливания щелчка мышью
64 | */
65 | void mousePressEvent(QMouseEvent* _event);
66 |
67 | private:
68 | /**
69 | * @brief Позиция выкатываемого виджета
70 | */
71 | QPoint m_slidePos;
72 |
73 | /**
74 | * @brief Изображение выкатываемого виджета
75 | */
76 | QPixmap m_slideWidgetPixmap;
77 |
78 | /**
79 | * @brief Таймлайн для реализации анимированного декорирования
80 | */
81 | QTimeLine m_timeline;
82 |
83 | /**
84 | * @brief Фоновое изображение
85 | */
86 | QPixmap m_backgroundPixmap;
87 |
88 | /**
89 | * @brief Цвет декорирования фона
90 | */
91 | QColor m_decorationColor;
92 | };
93 | }
94 |
95 | #endif // SIDESLIDEDECORATOR_H
96 |
--------------------------------------------------------------------------------
/visualization/fftreal/Array.hpp:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 |
3 | Array.hpp
4 | By Laurent de Soras
5 |
6 | --- Legal stuff ---
7 |
8 | This program is free software. It comes without any warranty, to
9 | the extent permitted by applicable law. You can redistribute it
10 | and/or modify it under the terms of the Do What The Fuck You Want
11 | To Public License, Version 2, as published by Sam Hocevar. See
12 | http://sam.zoy.org/wtfpl/COPYING for more details.
13 |
14 | *Tab=3***********************************************************************/
15 |
16 |
17 |
18 | #if defined (ffft_Array_CURRENT_CODEHEADER)
19 | #error Recursive inclusion of Array code header.
20 | #endif
21 | #define ffft_Array_CURRENT_CODEHEADER
22 |
23 | #if ! defined (ffft_Array_CODEHEADER_INCLUDED)
24 | #define ffft_Array_CODEHEADER_INCLUDED
25 |
26 |
27 |
28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
29 |
30 | #include
31 |
32 |
33 |
34 | namespace ffft
35 | {
36 |
37 |
38 |
39 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
40 |
41 |
42 |
43 | template
44 | Array ::Array ()
45 | {
46 | // Nothing
47 | }
48 |
49 |
50 |
51 | template
52 | const typename Array ::DataType & Array ::operator [] (long pos) const
53 | {
54 | assert (pos >= 0);
55 | assert (pos < LEN);
56 |
57 | return (_data_arr [pos]);
58 | }
59 |
60 |
61 |
62 | template
63 | typename Array ::DataType & Array ::operator [] (long pos)
64 | {
65 | assert (pos >= 0);
66 | assert (pos < LEN);
67 |
68 | return (_data_arr [pos]);
69 | }
70 |
71 |
72 |
73 | template
74 | long Array ::size ()
75 | {
76 | return (LEN);
77 | }
78 |
79 |
80 |
81 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
82 |
83 |
84 |
85 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
86 |
87 |
88 |
89 | } // namespace ffft
90 |
91 |
92 |
93 | #endif // ffft_Array_CODEHEADER_INCLUDED
94 |
95 | #undef ffft_Array_CURRENT_CODEHEADER
96 |
97 |
98 |
99 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
100 |
--------------------------------------------------------------------------------
/visualization/fftreal/FFTRealUseTrigo.hpp:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 |
3 | FFTRealUseTrigo.hpp
4 | By Laurent de Soras
5 |
6 | --- Legal stuff ---
7 |
8 | This program is free software. It comes without any warranty, to
9 | the extent permitted by applicable law. You can redistribute it
10 | and/or modify it under the terms of the Do What The Fuck You Want
11 | To Public License, Version 2, as published by Sam Hocevar. See
12 | http://sam.zoy.org/wtfpl/COPYING for more details.
13 |
14 | *Tab=3***********************************************************************/
15 |
16 |
17 |
18 | #if defined (ffft_FFTRealUseTrigo_CURRENT_CODEHEADER)
19 | #error Recursive inclusion of FFTRealUseTrigo code header.
20 | #endif
21 | #define ffft_FFTRealUseTrigo_CURRENT_CODEHEADER
22 |
23 | #if ! defined (ffft_FFTRealUseTrigo_CODEHEADER_INCLUDED)
24 | #define ffft_FFTRealUseTrigo_CODEHEADER_INCLUDED
25 |
26 |
27 |
28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
29 |
30 | #include "OscSinCos.h"
31 |
32 |
33 |
34 | namespace ffft
35 | {
36 |
37 |
38 |
39 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
40 |
41 |
42 |
43 | template
44 | void FFTRealUseTrigo ::prepare (OscType &osc)
45 | {
46 | osc.clear_buffers ();
47 | }
48 |
49 | template <>
50 | inline void FFTRealUseTrigo <0>::prepare (OscType &osc)
51 | {
52 | // Nothing
53 | }
54 |
55 |
56 |
57 | template
58 | void FFTRealUseTrigo ::iterate (OscType &osc, DataType &c, DataType &s, const DataType cos_ptr [], long index_c, long index_s)
59 | {
60 | osc.step ();
61 | c = osc.get_cos ();
62 | s = osc.get_sin ();
63 | }
64 |
65 | template <>
66 | inline void FFTRealUseTrigo <0>::iterate (OscType &osc, DataType &c, DataType &s, const DataType cos_ptr [], long index_c, long index_s)
67 | {
68 | c = cos_ptr [index_c];
69 | s = cos_ptr [index_s];
70 | }
71 |
72 |
73 |
74 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
75 |
76 |
77 |
78 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
79 |
80 |
81 |
82 | } // namespace ffft
83 |
84 |
85 |
86 | #endif // ffft_FFTRealUseTrigo_CODEHEADER_INCLUDED
87 |
88 | #undef ffft_FFTRealUseTrigo_CURRENT_CODEHEADER
89 |
90 |
91 |
92 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
93 |
--------------------------------------------------------------------------------
/visualization/fftreal/DynArray.h:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 |
3 | DynArray.h
4 | By Laurent de Soras
5 |
6 | --- Legal stuff ---
7 |
8 | This program is free software. It comes without any warranty, to
9 | the extent permitted by applicable law. You can redistribute it
10 | and/or modify it under the terms of the Do What The Fuck You Want
11 | To Public License, Version 2, as published by Sam Hocevar. See
12 | http://sam.zoy.org/wtfpl/COPYING for more details.
13 |
14 | *Tab=3***********************************************************************/
15 |
16 |
17 |
18 | #if ! defined (ffft_DynArray_HEADER_INCLUDED)
19 | #define ffft_DynArray_HEADER_INCLUDED
20 |
21 | #if defined (_MSC_VER)
22 | #pragma once
23 | #pragma warning (4 : 4250) // "Inherits via dominance."
24 | #endif
25 |
26 |
27 |
28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
29 |
30 |
31 |
32 | namespace ffft
33 | {
34 |
35 |
36 |
37 | template
38 | class DynArray
39 | {
40 |
41 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
42 |
43 | public:
44 |
45 | typedef T DataType;
46 |
47 | DynArray ();
48 | explicit DynArray (long size);
49 | ~DynArray ();
50 |
51 | inline long size () const;
52 | inline void resize (long size);
53 |
54 | inline const DataType &
55 | operator [] (long pos) const;
56 | inline DataType &
57 | operator [] (long pos);
58 |
59 |
60 |
61 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
62 |
63 | protected:
64 |
65 |
66 |
67 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
68 |
69 | private:
70 |
71 | DataType * _data_ptr;
72 | long _len;
73 |
74 |
75 |
76 | /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
77 |
78 | private:
79 |
80 | DynArray (const DynArray &other);
81 | DynArray & operator = (const DynArray &other);
82 | bool operator == (const DynArray &other);
83 | bool operator != (const DynArray &other);
84 |
85 | }; // class DynArray
86 |
87 |
88 |
89 | } // namespace ffft
90 |
91 |
92 |
93 | #include "DynArray.hpp"
94 |
95 |
96 |
97 | #endif // ffft_DynArray_HEADER_INCLUDED
98 |
99 |
100 |
101 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
102 |
--------------------------------------------------------------------------------
/3rdparty/WAF/Animation/Expand/ExpandDecorator.cpp:
--------------------------------------------------------------------------------
1 | #include "ExpandDecorator.h"
2 |
3 | #include
4 |
5 | using WAF::ExpandDecorator;
6 |
7 |
8 | ExpandDecorator::ExpandDecorator(QWidget* _parent) :
9 | QWidget(_parent)
10 | {
11 |
12 | }
13 |
14 | QRect ExpandDecorator::expandRect() const
15 | {
16 | return m_expandRect;
17 | }
18 |
19 | void ExpandDecorator::setExpandRect(QRect _expandRect)
20 | {
21 | if (m_expandRect != _expandRect) {
22 | m_expandRect = _expandRect;
23 |
24 | update();
25 | }
26 | }
27 |
28 | void ExpandDecorator::grabExpandRect()
29 | {
30 | m_expandRectPixmap = QPixmap(m_expandRect.size());
31 | parentWidget()->render(&m_expandRectPixmap, QPoint(), QRegion(m_expandRect));
32 | }
33 |
34 | void ExpandDecorator::setFillColor(const QColor& _fillColor)
35 | {
36 | if (m_fillColor != _fillColor) {
37 | m_fillColor = _fillColor;
38 | }
39 | }
40 |
41 | void ExpandDecorator::paintEvent(QPaintEvent* _event)
42 | {
43 | QPainter painter(this);
44 | painter.setOpacity(qMin((qreal)m_expandRect.height() / height(), 0.4));
45 | painter.fillRect(rect(), Qt::black);
46 | painter.setOpacity(1.);
47 | painter.fillRect(m_expandRect, m_fillColor);
48 | painter.drawPixmap(m_expandRect.topLeft(), m_expandRectPixmap);
49 | //
50 | // Рисуем декорации для создания эффекта наложения сверху
51 | //
52 | painter.setPen(Qt::black);
53 | QPoint left, right;
54 | left = m_expandRect.topLeft();
55 | right = m_expandRect.topRight();
56 | left.setY(left.y() - 1);
57 | right.setY(right.y() - 1);
58 | painter.setOpacity(0.1);
59 | painter.drawLine(left, right);
60 | //
61 | left.setY(left.y() - 1);
62 | right.setY(right.y() - 1);
63 | painter.setOpacity(0.4);
64 | painter.drawLine(left, right);
65 | //
66 | left.setY(left.y() - 1);
67 | right.setY(right.y() - 1);
68 | painter.setOpacity(0.2);
69 | painter.drawLine(left, right);
70 | //
71 | left = m_expandRect.bottomLeft();
72 | right = m_expandRect.bottomRight();
73 | left.setY(left.y() + 1);
74 | right.setY(right.y() + 1);
75 | painter.setOpacity(0.1);
76 | painter.drawLine(left, right);
77 | //
78 | left.setY(left.y() + 1);
79 | right.setY(right.y() + 1);
80 | painter.setOpacity(0.4);
81 | painter.drawLine(left, right);
82 | //
83 | left.setY(left.y() + 1);
84 | right.setY(right.y() + 1);
85 | painter.setOpacity(0.2);
86 | painter.drawLine(left, right);
87 | //
88 | left.setY(left.y() + 1);
89 | right.setY(right.y() + 1);
90 | painter.setOpacity(0.1);
91 | painter.drawLine(left, right);
92 |
93 | QWidget::paintEvent(_event);
94 | }
95 |
--------------------------------------------------------------------------------
/visualization/fftreal/FFTRealPassDirect.h:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 |
3 | FFTRealPassDirect.h
4 | By Laurent de Soras
5 |
6 | --- Legal stuff ---
7 |
8 | This program is free software. It comes without any warranty, to
9 | the extent permitted by applicable law. You can redistribute it
10 | and/or modify it under the terms of the Do What The Fuck You Want
11 | To Public License, Version 2, as published by Sam Hocevar. See
12 | http://sam.zoy.org/wtfpl/COPYING for more details.
13 |
14 | *Tab=3***********************************************************************/
15 |
16 |
17 |
18 | #if ! defined (ffft_FFTRealPassDirect_HEADER_INCLUDED)
19 | #define ffft_FFTRealPassDirect_HEADER_INCLUDED
20 |
21 | #if defined (_MSC_VER)
22 | #pragma once
23 | #pragma warning (4 : 4250) // "Inherits via dominance."
24 | #endif
25 |
26 |
27 |
28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
29 |
30 | #include "def.h"
31 | #include "FFTRealFixLenParam.h"
32 | #include "OscSinCos.h"
33 |
34 |
35 |
36 | namespace ffft
37 | {
38 |
39 |
40 |
41 | template
42 | class FFTRealPassDirect
43 | {
44 |
45 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
46 |
47 | public:
48 |
49 | typedef FFTRealFixLenParam::DataType DataType;
50 | typedef OscSinCos OscType;
51 |
52 | ffft_FORCEINLINE static void
53 | process (long len, DataType dest_ptr [], DataType src_ptr [], const DataType x_ptr [], const DataType cos_ptr [], long cos_len, const long br_ptr [], OscType osc_list []);
54 |
55 |
56 |
57 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
58 |
59 | protected:
60 |
61 |
62 |
63 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
64 |
65 | private:
66 |
67 |
68 |
69 | /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
70 |
71 | private:
72 |
73 | FFTRealPassDirect ();
74 | FFTRealPassDirect (const FFTRealPassDirect &other);
75 | FFTRealPassDirect &
76 | operator = (const FFTRealPassDirect &other);
77 | bool operator == (const FFTRealPassDirect &other);
78 | bool operator != (const FFTRealPassDirect &other);
79 |
80 | }; // class FFTRealPassDirect
81 |
82 |
83 |
84 | } // namespace ffft
85 |
86 |
87 |
88 | #include "FFTRealPassDirect.hpp"
89 |
90 |
91 |
92 | #endif // ffft_FFTRealPassDirect_HEADER_INCLUDED
93 |
94 |
95 |
96 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
97 |
--------------------------------------------------------------------------------
/3rdparty/WAF/Animation/AnimationPrivate.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Dimka Novikov, to@dimkanovikov.pro
3 | *
4 | * This library is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or any later version.
8 | *
9 | * This library is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * Full license: https://github.com/dimkanovikov/WidgetAnimationFramework/blob/master/LICENSE
15 | */
16 |
17 | #ifndef ANIMATIONPRIVATE
18 | #define ANIMATIONPRIVATE
19 |
20 | #include
21 |
22 | class QWidget;
23 |
24 |
25 | /**
26 | * Widgets Animation Framework
27 | */
28 | namespace WAF
29 | {
30 | class AbstractAnimator;
31 |
32 | /**
33 | * @brief Данные фасада анимаций
34 | */
35 | class AnimationPrivate
36 | {
37 | public:
38 | /**
39 | * @brief Виды аниматоров
40 | */
41 | enum AnimatorType {
42 | SideSlide,
43 | Slide,
44 | Popup,
45 | CircleFill,
46 | Expand
47 | };
48 |
49 | public:
50 | /**
51 | * @brief Есть ли аниматор для заданного виджета
52 | */
53 | bool hasAnimator(QWidget* _widget, AnimatorType _animatorType) const {
54 | bool contains = false;
55 | if (m_animators.contains(_animatorType)) {
56 | contains = m_animators.value(_animatorType).contains(_widget);
57 | }
58 | return contains;
59 | }
60 |
61 | /**
62 | * @brief Получить аниматор для заданного виджета
63 | */
64 | AbstractAnimator* animator(QWidget* _widget, AnimatorType _animatorType) const {
65 | AbstractAnimator* animator = 0;
66 | if (m_animators.contains(_animatorType)) {
67 | animator = m_animators.value(_animatorType).value(_widget, 0);
68 | }
69 | return animator;
70 | }
71 |
72 | /**
73 | * @brief Сохранить аниматор для заданного виджета
74 | */
75 | void saveAnimator(QWidget* _widget, AbstractAnimator* _animator, AnimatorType _animatorType) {
76 | if (!hasAnimator(_widget, _animatorType)) {
77 | QMap animators = m_animators.value(_animatorType);
78 | animators.insert(_widget, _animator);
79 | m_animators.insert(_animatorType, animators);
80 | }
81 | }
82 |
83 | private:
84 | /**
85 | * @brief Карта аниматоров
86 | */
87 | QMap > m_animators;
88 | };
89 | }
90 |
91 | #endif // ANIMATIONPRIVATE
92 |
93 |
--------------------------------------------------------------------------------
/visualization/fftreal/FFTRealUseTrigo.h:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 |
3 | FFTRealUseTrigo.h
4 | By Laurent de Soras
5 |
6 | --- Legal stuff ---
7 |
8 | This program is free software. It comes without any warranty, to
9 | the extent permitted by applicable law. You can redistribute it
10 | and/or modify it under the terms of the Do What The Fuck You Want
11 | To Public License, Version 2, as published by Sam Hocevar. See
12 | http://sam.zoy.org/wtfpl/COPYING for more details.
13 |
14 | *Tab=3***********************************************************************/
15 |
16 |
17 |
18 | #if ! defined (ffft_FFTRealUseTrigo_HEADER_INCLUDED)
19 | #define ffft_FFTRealUseTrigo_HEADER_INCLUDED
20 |
21 | #if defined (_MSC_VER)
22 | #pragma once
23 | #pragma warning (4 : 4250) // "Inherits via dominance."
24 | #endif
25 |
26 |
27 |
28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
29 |
30 | #include "def.h"
31 | #include "FFTRealFixLenParam.h"
32 | #include "OscSinCos.h"
33 |
34 |
35 |
36 | namespace ffft
37 | {
38 |
39 |
40 |
41 | template
42 | class FFTRealUseTrigo
43 | {
44 |
45 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
46 |
47 | public:
48 |
49 | typedef FFTRealFixLenParam::DataType DataType;
50 | typedef OscSinCos OscType;
51 |
52 | ffft_FORCEINLINE static void
53 | prepare (OscType &osc);
54 | ffft_FORCEINLINE static void
55 | iterate (OscType &osc, DataType &c, DataType &s, const DataType cos_ptr [], long index_c, long index_s);
56 |
57 |
58 |
59 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
60 |
61 | protected:
62 |
63 |
64 |
65 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
66 |
67 | private:
68 |
69 |
70 |
71 | /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
72 |
73 | private:
74 |
75 | FFTRealUseTrigo ();
76 | ~FFTRealUseTrigo ();
77 | FFTRealUseTrigo (const FFTRealUseTrigo &other);
78 | FFTRealUseTrigo &
79 | operator = (const FFTRealUseTrigo &other);
80 | bool operator == (const FFTRealUseTrigo &other);
81 | bool operator != (const FFTRealUseTrigo &other);
82 |
83 | }; // class FFTRealUseTrigo
84 |
85 |
86 |
87 | } // namespace ffft
88 |
89 |
90 |
91 | #include "FFTRealUseTrigo.hpp"
92 |
93 |
94 |
95 | #endif // ffft_FFTRealUseTrigo_HEADER_INCLUDED
96 |
97 |
98 |
99 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
100 |
--------------------------------------------------------------------------------
/dialog/FlatTabWidget/3rdparty/StackedWidgetAnimation/StackedWidgetAnimationPrivate.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Dimka Novikov, to@dimkanovikov.pro
3 | *
4 | * This library is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or any later version.
8 | *
9 | * This library is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * Full license: https://github.com/dimkanovikov/WidgetAnimationFramework/blob/master/LICENSE
15 | */
16 |
17 | #ifndef ANIMATIONPRIVATE
18 | #define ANIMATIONPRIVATE
19 |
20 | #include
21 |
22 | class QWidget;
23 |
24 |
25 | /**
26 | * Widgets Animation Framework
27 | */
28 | namespace WAF
29 | {
30 | class AbstractAnimator;
31 |
32 | /**
33 | * @brief Данные фасада анимаций
34 | */
35 | class StackedWidgetAnimationPrivate
36 | {
37 | public:
38 | /**
39 | * @brief Виды аниматоров
40 | */
41 | enum AnimatorType {
42 | Slide,
43 | SlideOver,
44 | FadeIn,
45 | ExpandOrCollapse
46 | };
47 |
48 | public:
49 | /**
50 | * @brief Есть ли аниматор для заданного виджета
51 | */
52 | bool hasAnimator(QWidget* _widget, AnimatorType _animatorType) const {
53 | bool contains = false;
54 | if (m_animators.contains(_animatorType)) {
55 | contains = m_animators.value(_animatorType).contains(_widget);
56 | }
57 | return contains;
58 | }
59 |
60 | /**
61 | * @brief Получить аниматор для заданного виджета
62 | */
63 | AbstractAnimator* animator(QWidget* _widget, AnimatorType _animatorType) const {
64 | AbstractAnimator* animator = 0;
65 | if (m_animators.contains(_animatorType)) {
66 | animator = m_animators.value(_animatorType).value(_widget, 0);
67 | }
68 | return animator;
69 | }
70 |
71 | /**
72 | * @brief Сохранить аниматор для заданного виджета
73 | */
74 | void saveAnimator(QWidget* _widget, AbstractAnimator* _animator, AnimatorType _animatorType) {
75 | if (!hasAnimator(_widget, _animatorType)) {
76 | QMap animators = m_animators.value(_animatorType);
77 | animators.insert(_widget, _animator);
78 | m_animators.insert(_animatorType, animators);
79 | }
80 | }
81 |
82 | private:
83 | /**
84 | * @brief Карта аниматоров
85 | */
86 | QMap > m_animators;
87 | };
88 | }
89 |
90 | #endif // ANIMATIONPRIVATE
91 |
92 |
--------------------------------------------------------------------------------
/dialog/FlatTabWidget/3rdparty/StackedWidgetAnimation/StackedWidgetFadeIn/StackedWidgetFadeInAnimator.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Dimka Novikov, to@dimkanovikov.pro
3 | *
4 | * This library is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or any later version.
8 | *
9 | * This library is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * Full license: https://github.com/dimkanovikov/WidgetAnimationFramework/blob/master/LICENSE
15 | */
16 |
17 | #ifndef STACKEDWIDGETFADEINANIMATOR_H
18 | #define STACKEDWIDGETFADEINANIMATOR_H
19 |
20 | #include "../../WAF.h"
21 | #include "../../AbstractAnimator.h"
22 |
23 | class QPropertyAnimation;
24 | class QStackedWidget;
25 |
26 |
27 | /**
28 | * Widgets Animation Framework
29 | */
30 | namespace WAF
31 | {
32 | class StackedWidgetFadeInDecorator;
33 |
34 |
35 | /**
36 | * @brief Аниматор появления виджета из стека с пропаданием текущего виджета
37 | */
38 | class StackedWidgetFadeInAnimator : public AbstractAnimator
39 | {
40 | Q_OBJECT
41 |
42 | public:
43 | explicit StackedWidgetFadeInAnimator(QStackedWidget* _container, QWidget* _fadeWidget);
44 |
45 | /**
46 | * @brief Длительность анимации
47 | */
48 | int animationDuration() const;
49 |
50 | /**
51 | * @brief Отобразить виджет
52 | */
53 | /** @{ */
54 | void animateForward();
55 | void fadeIn();
56 | /** @} */
57 |
58 | /**
59 | * @brief Обратной анимации для данного случая нет
60 | */
61 | void animateBackward() {}
62 | void animateStop();
63 | protected:
64 | /**
65 | * @brief Переопределяется, чтобы корректировать позицию перекрывающего виджета
66 | */
67 | bool eventFilter(QObject* _object, QEvent* _event);
68 |
69 | private:
70 | /**
71 | * @brief Получить виджет, который нужно анимировать
72 | */
73 | QWidget* fadeWidget() const;
74 |
75 | private:
76 | /**
77 | * @brief Помошник
78 | */
79 | StackedWidgetFadeInDecorator* m_decorator;
80 |
81 | /**
82 | * @brief Объект для анимирования появления
83 | */
84 | QPropertyAnimation* m_animation;
85 | };
86 | }
87 |
88 | #endif // STACKEDWIDGETFADEINANIMATOR_H
89 |
--------------------------------------------------------------------------------
/3rdparty/WAF/AbstractAnimator.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Dimka Novikov, to@dimkanovikov.pro
3 | *
4 | * This library is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or any later version.
8 | *
9 | * This library is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * Full license: https://github.com/dimkanovikov/WidgetAnimationFramework/blob/master/LICENSE
15 | */
16 |
17 | #ifndef ABSTRACTANIMATOR
18 | #define ABSTRACTANIMATOR
19 |
20 | #include
21 |
22 | /**
23 | * Widgets Animation Framework
24 | */
25 | namespace WAF
26 | {
27 | /**
28 | * @brief Абстрактный класс аниматора
29 | */
30 | class AbstractAnimator : public QObject
31 | {
32 | Q_OBJECT
33 |
34 | public:
35 | explicit AbstractAnimator(QObject* _parent = 0) : QObject(_parent) {}
36 |
37 | /**
38 | * @brief Длительность анимации
39 | */
40 | virtual int animationDuration() const = 0;
41 |
42 | /**
43 | * @brief Выполнить прямую анимацию
44 | */
45 | virtual void animateForward() = 0;
46 |
47 | /**
48 | * @brief Выполнить обратную анимацию
49 | */
50 | virtual void animateBackward() = 0;
51 |
52 | protected:
53 | /**
54 | * @brief Установить флаг выполнения анимации
55 | */
56 | /** @{ */
57 | void setAnimatedForward() {
58 | m_isAnimated = true;
59 | m_isAnimatedForward = true;
60 | }
61 | void setAnimatedBackward() {
62 | m_isAnimated = true;
63 | m_isAnimatedForward = false;
64 | }
65 | void setAnimatedStopped() {
66 | m_isAnimated = false;
67 | }
68 | /** @} */
69 |
70 | /**
71 | * @brief Выполняется ли анимация в данный момент
72 | */
73 | bool isAnimated() const {
74 | return m_isAnimated;
75 | }
76 |
77 | /**
78 | * @brief Направление последней анимации
79 | */
80 | /** @{ */
81 | bool isAnimatedForward() const {
82 | return m_isAnimatedForward;
83 | }
84 | bool isAnimatedBackward() const {
85 | return !isAnimatedForward();
86 | }
87 | /** @} */
88 |
89 | private:
90 | /**
91 | * @brief Выполняется ли анимация в данный момент
92 | */
93 | bool m_isAnimated = false;
94 |
95 | /**
96 | * @brief Направление последней анимации
97 | */
98 | bool m_isAnimatedForward = true;
99 | };
100 | }
101 |
102 | #endif // ABSTRACTANIMATOR
103 |
104 |
--------------------------------------------------------------------------------
/visualization/fftreal/OscSinCos.h:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 |
3 | OscSinCos.h
4 | By Laurent de Soras
5 |
6 | --- Legal stuff ---
7 |
8 | This program is free software. It comes without any warranty, to
9 | the extent permitted by applicable law. You can redistribute it
10 | and/or modify it under the terms of the Do What The Fuck You Want
11 | To Public License, Version 2, as published by Sam Hocevar. See
12 | http://sam.zoy.org/wtfpl/COPYING for more details.
13 |
14 | *Tab=3***********************************************************************/
15 |
16 |
17 |
18 | #if ! defined (ffft_OscSinCos_HEADER_INCLUDED)
19 | #define ffft_OscSinCos_HEADER_INCLUDED
20 |
21 | #if defined (_MSC_VER)
22 | #pragma once
23 | #pragma warning (4 : 4250) // "Inherits via dominance."
24 | #endif
25 |
26 |
27 |
28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
29 |
30 | #include "def.h"
31 |
32 |
33 |
34 | namespace ffft
35 | {
36 |
37 |
38 |
39 | template
40 | class OscSinCos
41 | {
42 |
43 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
44 |
45 | public:
46 |
47 | typedef T DataType;
48 |
49 | OscSinCos ();
50 |
51 | ffft_FORCEINLINE void
52 | set_step (double angle_rad);
53 |
54 | ffft_FORCEINLINE DataType
55 | get_cos () const;
56 | ffft_FORCEINLINE DataType
57 | get_sin () const;
58 | ffft_FORCEINLINE void
59 | step ();
60 | ffft_FORCEINLINE void
61 | clear_buffers ();
62 |
63 |
64 |
65 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
66 |
67 | protected:
68 |
69 |
70 |
71 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
72 |
73 | private:
74 |
75 | DataType _pos_cos; // Current phase expressed with sin and cos. [-1 ; 1]
76 | DataType _pos_sin; // -
77 | DataType _step_cos; // Phase increment per step, [-1 ; 1]
78 | DataType _step_sin; // -
79 |
80 |
81 |
82 | /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
83 |
84 | private:
85 |
86 | OscSinCos (const OscSinCos &other);
87 | OscSinCos & operator = (const OscSinCos &other);
88 | bool operator == (const OscSinCos &other);
89 | bool operator != (const OscSinCos &other);
90 |
91 | }; // class OscSinCos
92 |
93 |
94 |
95 | } // namespace ffft
96 |
97 |
98 |
99 | #include "OscSinCos.hpp"
100 |
101 |
102 |
103 | #endif // ffft_OscSinCos_HEADER_INCLUDED
104 |
105 |
106 |
107 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
108 |
--------------------------------------------------------------------------------
/dialog/FlatTabWidget/3rdparty/StackedWidgetAnimation/StackedWidgetFadeIn/StackedWidgetFadeInDecorator.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Dimka Novikov, to@dimkanovikov.pro
3 | *
4 | * This library is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or any later version.
8 | *
9 | * This library is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * Full license: https://github.com/dimkanovikov/WidgetAnimationFramework/blob/master/LICENSE
15 | */
16 |
17 | #include "StackedWidgetFadeInDecorator.h"
18 |
19 | #include
20 | #include
21 | #include
22 |
23 | using WAF::StackedWidgetFadeInDecorator;
24 |
25 |
26 | StackedWidgetFadeInDecorator::StackedWidgetFadeInDecorator(QWidget* _parent, QWidget* _fadeWidget) :
27 | QWidget(_parent),
28 | m_opacity(1),
29 | m_fadeWidget(_fadeWidget)
30 | {
31 | grabFadeWidget();
32 | }
33 |
34 | qreal StackedWidgetFadeInDecorator::opacity() const
35 | {
36 | return m_opacity;
37 | }
38 |
39 | void StackedWidgetFadeInDecorator::setOpacity(qreal _opacity)
40 | {
41 | if (m_opacity != _opacity) {
42 | m_opacity = _opacity;
43 |
44 | update();
45 | }
46 | }
47 |
48 | void StackedWidgetFadeInDecorator::grabContainer()
49 | {
50 | if (QStackedWidget* container = qobject_cast(parentWidget())) {
51 | container->setStyleSheet(QString("QWidget#tabhostPage1,QWidget#tabhostPage2,QWidget#tabhostPage3,QWidget#tabhostPage4,QWidget#tabhostPage5,QWidget#tabhostPage6,QWidget#tabhostPage7{background-color: %1;}").arg(qApp->palette().window().color().lighter().name()));
52 | m_containerPixmap = grabWidget(container->currentWidget());
53 | }
54 | }
55 |
56 | void StackedWidgetFadeInDecorator::grabFadeWidget()
57 | {
58 | m_fadeWidgetPixmap = grabWidget(m_fadeWidget);
59 | }
60 |
61 | void StackedWidgetFadeInDecorator::paintEvent(QPaintEvent* _event)
62 | {
63 | QPainter painter(this);
64 | painter.drawPixmap(0, 0, m_containerPixmap);
65 | painter.setOpacity(m_opacity);
66 | painter.drawPixmap(0, 0, m_fadeWidgetPixmap);
67 |
68 | QWidget::paintEvent(_event);
69 | }
70 |
71 | QPixmap StackedWidgetFadeInDecorator::grabWidget(QWidget* _widgetForGrab)
72 | {
73 | const QSize size = parentWidget()->size();
74 | _widgetForGrab->resize(size);
75 | resize(size);
76 | QPixmap widgetPixmap(size);
77 | _widgetForGrab->render(&widgetPixmap, QPoint(), QRegion(QRect(QPoint(), size)));
78 | return widgetPixmap;
79 | }
80 |
81 |
--------------------------------------------------------------------------------
/dialog/FlatTabWidget/3rdparty/StackedWidgetAnimation/StackedWidgetAnimation.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Dimka Novikov, to@dimkanovikov.pro
3 | *
4 | * This library is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or any later version.
8 | *
9 | * This library is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * Full license: https://github.com/dimkanovikov/WidgetAnimationFramework/blob/master/LICENSE
15 | */
16 |
17 | #ifndef STACKEDWIDGETANIMATION_H
18 | #define STACKEDWIDGETANIMATION_H
19 |
20 | #include "../WAF.h"
21 | #include "../AbstractAnimator.h"
22 |
23 | class QColor;
24 | class QRect;
25 | class QStackedWidget;
26 | class QWidget;
27 |
28 |
29 | /**
30 | * Widgets Animation Framework
31 | */
32 | namespace WAF
33 | {
34 | /**
35 | * @brief Данные фасада
36 | */
37 | class StackedWidgetAnimationPrivate;
38 |
39 | /**
40 | * @brief Фасад доступа к анимациям
41 | */
42 | class StackedWidgetAnimation
43 | {
44 | public:
45 | /**
46 | * @brief Выкатить заданный виджет, смещая текущий активный
47 | */
48 | static void slide(QStackedWidget* _container, QWidget* _widget, AnimationDirection _direction);
49 |
50 | /****/
51 |
52 | /**
53 | * @brief Выкатить заданный виджет поверх текущего
54 | */
55 | static void slideOverIn(QStackedWidget* _container, QWidget* _widget, AnimationDirection _direction);
56 |
57 | /**
58 | * @brief Закатить заданный виджет поверх текущего
59 | */
60 | static void slideOverOut(QStackedWidget* _container, QWidget* _widget, AnimationDirection _direction);
61 |
62 | /**
63 | * @brief Выкатить или закатить заданный виджет поверх текущего
64 | */
65 | static void slideOver(QStackedWidget* _container, QWidget* _widget, AnimationDirection _direction, bool _in);
66 |
67 | /****/
68 |
69 | /**
70 | * @brief Текущий виджет растворяется, а заданный виджет появляется
71 | */
72 | static AbstractAnimator* fadeIn(QStackedWidget* _container, QWidget* _widget);
73 |
74 | private:
75 | /**
76 | * @brief Данные
77 | */
78 | /** @{ */
79 | static StackedWidgetAnimationPrivate* m_pimpl;
80 | static StackedWidgetAnimationPrivate* pimpl();
81 | /** @} */
82 | };
83 | }
84 |
85 | #endif // STACKEDWIDGETANIMATION_H
86 |
--------------------------------------------------------------------------------
/crashhandler/airbag.h:
--------------------------------------------------------------------------------
1 | #ifndef AIRBAG_FD_H
2 | #define AIRBAG_FD_H
3 |
4 | /**
5 | * @mainpage
6 | * Drop-in crash handlers for POSIX, particularly embedded Linux.
7 | * Please see @ref airbag_fd.h for more details.
8 | *
9 | * @file airbag_fd.h
10 | * @brief Drop-in crash handlers for POSIX, particularly embedded Linux.
11 | *
12 | * Dumps registers, backtrace, and instruction stream to a file descriptor. Intended to be
13 | * self-contained and resilient. Where possible, will detect and intelligently handle corrupt
14 | * state, such as jumping through a bad pointer or a blown stack. The harvesting and reporting
15 | * of the crash log is left as an exercise for the reader.
16 | *
17 | * The common case requires no \#defines. Optional defines:
18 | * - AIRBAG_NO_PTHREADS
19 | * - AIRBAG_NO_DLADDR
20 | * - AIRBAG_NO_BACKTRACE
21 | *
22 | * Should compile as C or C++. C++ users are covered; airbag_fd catches SIGABRT. By default,
23 | * std::terminate and std::unexpected abort() the program. Be sure to compile as C++ if you
24 | * want name demangling.
25 | *
26 | * @todo
27 | * - chaining handlers?
28 | * - better symbols on x86-64
29 | * - improve GCC's unwind with bad PC, blown stack, etc
30 | * - test on more OSs: bsd
31 | * - if failed to get any backtrace, scan /proc/pid/maps for library offsets
32 | * - stop other threads, get their backtraces
33 | * - expose airbag_walkstack
34 | * - arm: thumb mode
35 | * - arm: http://www.mcternan.me.uk/ArmStackUnwinding/
36 | * @sa https://github.com/ccoffing/airbag_fd
37 | * @author Chuck Coffing
38 | * @copyright Copyright 2011-2014 Chuck Coffing , MIT licensed
39 | */
40 |
41 | #ifdef __cplusplus
42 | extern "C" {
43 | #endif
44 |
45 | /** Optional user callback, to print additional state at time of crash (build #, uptime, etc).
46 | */
47 | typedef void (*airbag_user_callback)(int fd);
48 |
49 | /** Registers crash handlers to output to the file descriptor.
50 | * @return 0 iff registered; else errno is set.
51 | */
52 | int airbag_init_fd(int fd, airbag_user_callback cb,const char* execname);
53 |
54 | /** Registers crash handlers to output to the named file. The file is created only if and when
55 | * a crash occurs.
56 | * @return 0 iff registered; else errno is set.
57 | */
58 | int airbag_init_filename(const char *filename, airbag_user_callback cb,const char* execname);
59 |
60 | /** Names the current thread.
61 | * @return 0 iff name is set; else errno is set.
62 | */
63 | int airbag_name_thread(const char *name);
64 |
65 |
66 | /** Looks up the file name, function name, and offset corresponding to pc.
67 | * Writes text representation to fd.
68 | */
69 | void airbag_symbol(int fd, void *pc);
70 |
71 | /** Deregisters the crash handlers.
72 | */
73 | void airbag_deinit();
74 |
75 | #ifdef __cplusplus
76 | }
77 | #endif
78 |
79 |
80 | #endif
81 |
--------------------------------------------------------------------------------
/dialog/FlatTabWidget/3rdparty/AbstractAnimator.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Dimka Novikov, to@dimkanovikov.pro
3 | *
4 | * This library is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or any later version.
8 | *
9 | * This library is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * Full license: https://github.com/dimkanovikov/WidgetAnimationFramework/blob/master/LICENSE
15 | */
16 |
17 | #ifndef ABSTRACTANIMATOR
18 | #define ABSTRACTANIMATOR
19 |
20 | #include
21 |
22 | /**
23 | * Widgets Animation Framework
24 | */
25 | namespace WAF
26 | {
27 | /**
28 | * @brief Абстрактный класс аниматора
29 | */
30 | class AbstractAnimator : public QObject
31 | {
32 | Q_OBJECT
33 |
34 | public:
35 | explicit AbstractAnimator(QObject* _parent = 0) : QObject(_parent) {}
36 |
37 | /**
38 | * @brief Длительность анимации
39 | */
40 | virtual int animationDuration() const = 0;
41 |
42 | /**
43 | * @brief Выполнить прямую анимацию
44 | */
45 | virtual void animateForward() = 0;
46 |
47 | /**
48 | * @brief Выполнить обратную анимацию
49 | */
50 | virtual void animateBackward() = 0;
51 |
52 | virtual void animateStop() = 0;
53 |
54 | protected:
55 | /**
56 | * @brief Установить флаг выполнения анимации
57 | */
58 | /** @{ */
59 | void setAnimatedForward() {
60 | m_isAnimated = true;
61 | m_isAnimatedForward = true;
62 | }
63 | void setAnimatedBackward() {
64 | m_isAnimated = true;
65 | m_isAnimatedForward = false;
66 | }
67 | void setAnimatedStopped() {
68 | m_isAnimated = false;
69 | }
70 | /** @} */
71 |
72 | /**
73 | * @brief Выполняется ли анимация в данный момент
74 | */
75 | bool isAnimated() const {
76 | return m_isAnimated;
77 | }
78 |
79 | /**
80 | * @brief Направление последней анимации
81 | */
82 | /** @{ */
83 | bool isAnimatedForward() const {
84 | return m_isAnimatedForward;
85 | }
86 | bool isAnimatedBackward() const {
87 | return !isAnimatedForward();
88 | }
89 | /** @} */
90 |
91 | private:
92 | /**
93 | * @brief Выполняется ли анимация в данный момент
94 | */
95 | bool m_isAnimated = false;
96 |
97 | /**
98 | * @brief Направление последней анимации
99 | */
100 | bool m_isAnimatedForward = true;
101 | };
102 | }
103 |
104 | #endif // ABSTRACTANIMATOR
105 |
106 |
--------------------------------------------------------------------------------
/dialog/FlatTabWidget/3rdparty/StackedWidgetAnimation/StackedWidgetFadeIn/StackedWidgetFadeInDecorator.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Dimka Novikov, to@dimkanovikov.pro
3 | *
4 | * This library is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or any later version.
8 | *
9 | * This library is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * Full license: https://github.com/dimkanovikov/WidgetAnimationFramework/blob/master/LICENSE
15 | */
16 |
17 | #ifndef STACKEDWIDGETFADEINDECORATOR_H
18 | #define STACKEDWIDGETFADEINDECORATOR_H
19 |
20 | #include
21 |
22 | class QStackedWidget;
23 |
24 |
25 | /**
26 | * Widgets Animation Framework
27 | */
28 | namespace WAF
29 | {
30 | /**
31 | * @brief Класс рисующий растворяемый виджет
32 | */
33 | class StackedWidgetFadeInDecorator : public QWidget
34 | {
35 | Q_OBJECT
36 |
37 | Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity)
38 |
39 | public:
40 | explicit StackedWidgetFadeInDecorator(QWidget* _parent, QWidget* _fadeWidget);
41 |
42 | /**
43 | * @brief Свойство прозрачности изображения виджета для прорисовки
44 | */
45 | /** @{ */
46 | qreal opacity() const;
47 | void setOpacity(qreal _opacity);
48 | /** @} */
49 |
50 | /**
51 | * @brief Установить цвет растворения
52 | */
53 | void setFadeInColor(const QColor& _fadeInColor);
54 |
55 | /**
56 | * @brief Сохранить изображение стэка для прорисовки
57 | */
58 | void grabContainer();
59 |
60 | /**
61 | * @brief Сохранить изображение виджета для прорисовки
62 | */
63 | void grabFadeWidget();
64 |
65 | protected:
66 | /**
67 | * @brief Переопределяется для прорисовки декорации
68 | */
69 | void paintEvent(QPaintEvent* _event);
70 |
71 | private:
72 | /**
73 | * @brief Сохранить изображение заданного виджета
74 | */
75 | QPixmap grabWidget(QWidget* _widgetForGrab);
76 |
77 | private:
78 | /**
79 | * @brief Прозрачность изображения виджета для прорисовки
80 | */
81 | qreal m_opacity;
82 |
83 | /**
84 | * @brief Виджет, который будем рисовать
85 | */
86 | QWidget* m_fadeWidget;
87 |
88 | /**
89 | * @brief Изображение контейнера
90 | */
91 | QPixmap m_containerPixmap;
92 |
93 | /**
94 | * @brief Изображение появляющегося виджета
95 | */
96 | QPixmap m_fadeWidgetPixmap;
97 | };
98 | }
99 |
100 | #endif // STACKEDWIDGETFADEINDECORATOR_H
101 |
--------------------------------------------------------------------------------
/config/dbusproxy.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This program is free software: you can redistribute it and/or modify
3 | it under the terms of the GNU General Public License as published by
4 | the Free Software Foundation, either version 3 of the License, or
5 | (at your option) any later version.
6 | This program is distributed in the hope that it will be useful,
7 | but WITHOUT ANY WARRANTY; without even the implied warranty of
8 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 | GNU General Public License for more details.
10 | You should have received a copy of the GNU General Public License
11 | along with this program. If not, see .
12 | *
13 | * ThePBone (c) 2020
14 | */
15 | #ifndef DBUSPROXY_H
16 | #define DBUSPROXY_H
17 |
18 | #include
19 | #include
20 | #include
21 | #include
22 |
23 | class DBusProxy : public QObject
24 | {
25 | Q_OBJECT
26 | public:
27 | typedef enum
28 | {
29 | PARAM_GROUP_NONE = 0x0000,
30 | PARAM_GROUP_AGC = (1u << 0),
31 | PARAM_GROUP_AX = (1u << 1),
32 | PARAM_GROUP_COLM = (1u << 2),
33 | PARAM_GROUP_CONV = (1u << 3),
34 | PARAM_GROUP_CURE = (1u << 4),
35 | PARAM_GROUP_DS = (1u << 5),
36 | PARAM_GROUP_DYNSYS = (1u << 6),
37 | PARAM_GROUP_EQ = (1u << 7),
38 | PARAM_GROUP_FETCOMP = (1u << 8),
39 | PARAM_GROUP_LIM = (1u << 9),
40 | PARAM_GROUP_MSWITCH = (1u << 10),
41 | PARAM_GROUP_REVERB = (1u << 11),
42 | PARAM_GROUP_TUBE = (1u << 12),
43 | PARAM_GROUP_VB = (1u << 13),
44 | PARAM_GROUP_VC = (1u << 14),
45 | PARAM_GROUP_VHE = (1u << 15),
46 | PARAM_GROUP_VSE = (1u << 16),
47 | PARAM_GROUP_ALL = 0x1FFFF
48 | } PARAM_GROUP;
49 | typedef enum
50 | {
51 | PARAM_GET_STATUS_BEGIN = 0x08000,
52 | PARAM_GET_DRIVER_VERSION,
53 | PARAM_GET_NEONENABLED,
54 | PARAM_GET_ENABLED,
55 | PARAM_GET_DRVCANWORK,
56 | PARAM_GET_EFFECT_TYPE,
57 | PARAM_GET_SAMPLINGRATE,
58 | PARAM_GET_CONVKNLID,
59 | PARAM_GET_STATUS_END
60 | } PARAM_GET;
61 | static constexpr int E_INVALID_INTF = -100;
62 |
63 | DBusProxy();
64 | bool isValid();
65 | int CommitProperties(PARAM_GROUP pg);
66 | QString GetVersion();
67 | QString GetGstVersion();
68 | int GetDriverStatus(PARAM_GET param);
69 | QVariantMap FetchPropertyMap();
70 | bool SubmitPropertyMap(const QVariantMap& map);
71 | bool SetProperty(const QString& key, const QVariant& value);
72 | QVariant GetProperty(const QString& key);
73 | private slots:
74 | void PropertiesSignalReceived(uint);
75 | signals:
76 | void propertiesCommitted(uint);
77 | private:
78 | QDBusInterface *m_dbInterface;
79 | };
80 |
81 | #endif // DBUSPROXY_H
82 |
--------------------------------------------------------------------------------
/dialog/qanimatedslider.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 |
4 | Copyright (c) 2020 Tim Schneeberger (ThePBone)
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | SOFTWARE.
23 | *
24 | */
25 | #ifndef QANIMATEDSLIDER_H
26 | #define QANIMATEDSLIDER_H
27 |
28 | #include
29 | #include
30 |
31 | /*!
32 | \class QAnimatedSlider
33 |
34 | \brief The QAnimatedSlider class provides an extended slider widget with animation capabilities.
35 | */
36 | class QAnimatedSlider : public QSlider
37 | {
38 | Q_OBJECT
39 |
40 | public:
41 | QAnimatedSlider(QWidget *parent = nullptr);
42 | ~QAnimatedSlider();
43 | /*!
44 | \brief Updates the current stored value and animates this change if \c animate is \c true.
45 | */
46 | void setValueA(int value, bool animate = true);
47 | /*!
48 | \brief Current value of the underlying slider widget
49 | */
50 | int valueA() const;
51 |
52 | /*!
53 | \brief Returns the currently set easing curve used for the animation
54 | */
55 | QEasingCurve easingCurve() const;
56 | /*!
57 | \brief Set a custom easing curve used for the animation.\n
58 | By default, the \c QEasingCurve::InOutCirc curve is used.
59 | */
60 | void setEasingCurve(const QEasingCurve &easingCurve);
61 |
62 | /*!
63 | \brief Returns the currently set animation duration
64 | */
65 | int duration() const;
66 | /*!
67 | \brief Set a custom animation duration.\n
68 | By default, this value is set to 300ms.
69 | */
70 | void setDuration(int duration);
71 | signals:
72 | void valueChangedA(int value);
73 | private:
74 | QVariantAnimation* anim;
75 | int cValue = 0;
76 | int mDuration = 300;
77 | QEasingCurve mEasingCurve = QEasingCurve(QEasingCurve::Type::InOutCirc);
78 | bool event(QEvent *event) override;
79 | };
80 | #endif // QANIMATEDSLIDER_H
81 |
--------------------------------------------------------------------------------
/dialog/androidimporterdlg.cpp:
--------------------------------------------------------------------------------
1 | #include "androidimporterdlg.h"
2 | #include "ui_importandroid.h"
3 | #include "misc/converter.h"
4 | #include "viper_window.h"
5 | #include "misc/loghelper.h"
6 |
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | using namespace std;
14 | AndroidImporterDlg::AndroidImporterDlg(QString confpath,QWidget *parent) :
15 | QDialog(parent),
16 | ui(new Ui::importandroid)
17 | {
18 | m_confpath = std::move(confpath);
19 | ui->setupUi(this);
20 | ui->comboBox->addItem(tr("V4A <2.6"),0);
21 | ui->comboBox->addItem(tr("V4A >2.7"),1);
22 | connect(ui->pushButton,SIGNAL(clicked()),SLOT(import()));
23 | }
24 |
25 | AndroidImporterDlg::~AndroidImporterDlg()
26 | {
27 | delete ui;
28 | }
29 |
30 | void AndroidImporterDlg::import(){
31 | if(ui->lineEdit->text()==""){
32 | QMessageBox::warning(this, tr("Missing Input"), tr("Name is not set"),QMessageBox::Ok);
33 | return;
34 | }
35 | QString filename = QFileDialog::getOpenFileName(this,tr("Import Viper4Android config file (xml)"),"","*.xml");
36 | if(filename=="")return;
37 | auto mode = converter::officialV4A;
38 | if(ui->comboBox->currentIndex()==1)mode = converter::teamDeWittV4A;
39 | conversion_result_t response = converter::toLinux(filename,mode);
40 | if( response.error ) {
41 | QMessageBox::warning(this, tr("Syntax Error"), response.notices,QMessageBox::Ok);
42 | LogHelper::writeLog("Converter (a-to-l;mode=" + QString::number(mode) + "): " + response.notices + " (importandroid/syntaxcheck)");
43 | return;
44 | }
45 |
46 | string newconfig = response.configuration.toUtf8().constData();
47 | QString msginfotext = tr("Successfully converted!\n");
48 | if(response.notices.length() > 0){
49 | msginfotext += tr("\nNotices:\n");
50 | msginfotext += response.notices;
51 | }
52 |
53 | #ifndef VIPER_PLUGINMODE
54 | QDir d = QFileInfo(m_confpath).absoluteDir();
55 | QString absolute=d.absolutePath();
56 | QString path = pathAppend(absolute,"presets");
57 | #else
58 | QString path = pathAppend(m_confpath,"presets");
59 | #endif
60 |
61 | QString text = ui->lineEdit->text();
62 | if (!text.isEmpty()) {
63 |
64 | ofstream cfile(QDir::cleanPath(path + QDir::separator() + text + ".conf").toUtf8().constData());
65 | if (cfile.is_open())
66 | {
67 | cfile << newconfig;
68 | cfile.close();
69 | }
70 | else
71 | LogHelper::writeLog("Unable to create new file at '" + QDir::cleanPath(path + QDir::separator() + text + ".conf") + "'; cannot import converted android config (importandroid/importer)");
72 | }
73 |
74 | emit importFinished();
75 | QMessageBox::information(this,tr("Import"),msginfotext);
76 | this->close();
77 | }
78 | QString AndroidImporterDlg::pathAppend(const QString& path1, const QString& path2)
79 | {
80 | return QDir::cleanPath(path1 + QDir::separator() + path2);
81 | }
82 |
--------------------------------------------------------------------------------
/phantom/phantomstyle.h:
--------------------------------------------------------------------------------
1 | #ifndef PHANTOMSTYLE_H
2 | #define PHANTOMSTYLE_H
3 | #include
4 |
5 | class PhantomStylePrivate;
6 | class PhantomStyle : public QCommonStyle {
7 | Q_OBJECT
8 | public:
9 | PhantomStyle();
10 | ~PhantomStyle();
11 |
12 | enum PhantomPrimitiveElement {
13 | Phantom_PE_IndicatorTabNew = PE_CustomBase + 1,
14 | Phantom_PE_ScrollBarSliderVertical,
15 | Phantom_PE_WindowFrameColor,
16 | };
17 |
18 | QPalette standardPalette() const override;
19 | void drawPrimitive(PrimitiveElement elem, const QStyleOption* option,
20 | QPainter* painter,
21 | const QWidget* widget = nullptr) const override;
22 | void drawControl(ControlElement ce, const QStyleOption* option,
23 | QPainter* painter, const QWidget* widget) const override;
24 | int pixelMetric(PixelMetric metric, const QStyleOption* option = nullptr,
25 | const QWidget* widget = nullptr) const override;
26 | void drawComplexControl(ComplexControl control,
27 | const QStyleOptionComplex* option, QPainter* painter,
28 | const QWidget* widget) const override;
29 | QRect subElementRect(SubElement r, const QStyleOption* opt,
30 | const QWidget* widget = nullptr) const override;
31 | QSize sizeFromContents(ContentsType type, const QStyleOption* option,
32 | const QSize& size,
33 | const QWidget* widget) const override;
34 | SubControl hitTestComplexControl(ComplexControl cc,
35 | const QStyleOptionComplex* opt,
36 | const QPoint& pt,
37 | const QWidget* w = nullptr) const override;
38 | QRect subControlRect(ComplexControl cc, const QStyleOptionComplex* opt,
39 | SubControl sc, const QWidget* widget) const override;
40 | QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap& pixmap,
41 | const QStyleOption* opt) const override;
42 | int styleHint(StyleHint hint, const QStyleOption* option = nullptr,
43 | const QWidget* widget = nullptr,
44 | QStyleHintReturn* returnData = nullptr) const override;
45 | QRect itemPixmapRect(const QRect& r, int flags,
46 | const QPixmap& pixmap) const override;
47 | void drawItemPixmap(QPainter* painter, const QRect& rect, int alignment,
48 | const QPixmap& pixmap) const override;
49 | void
50 | drawItemText(QPainter* painter, const QRect& rect, int flags,
51 | const QPalette& pal, bool enabled, const QString& text,
52 | QPalette::ColorRole textRole = QPalette::NoRole) const override;
53 | void polish(QWidget* widget) override;
54 | void polish(QApplication* app) override;
55 | void polish(QPalette& pal) override;
56 | void unpolish(QWidget* widget) override;
57 | void unpolish(QApplication* app) override;
58 |
59 | protected:
60 | PhantomStylePrivate* d;
61 | };
62 | #endif
63 |
--------------------------------------------------------------------------------
/visualization/fftreal/OscSinCos.hpp:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 |
3 | OscSinCos.hpp
4 | By Laurent de Soras
5 |
6 | --- Legal stuff ---
7 |
8 | This program is free software. It comes without any warranty, to
9 | the extent permitted by applicable law. You can redistribute it
10 | and/or modify it under the terms of the Do What The Fuck You Want
11 | To Public License, Version 2, as published by Sam Hocevar. See
12 | http://sam.zoy.org/wtfpl/COPYING for more details.
13 |
14 | *Tab=3***********************************************************************/
15 |
16 |
17 |
18 | #if defined (ffft_OscSinCos_CURRENT_CODEHEADER)
19 | #error Recursive inclusion of OscSinCos code header.
20 | #endif
21 | #define ffft_OscSinCos_CURRENT_CODEHEADER
22 |
23 | #if ! defined (ffft_OscSinCos_CODEHEADER_INCLUDED)
24 | #define ffft_OscSinCos_CODEHEADER_INCLUDED
25 |
26 |
27 |
28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
29 |
30 | #include
31 |
32 | namespace std { }
33 |
34 |
35 |
36 | namespace ffft
37 | {
38 |
39 |
40 |
41 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
42 |
43 |
44 |
45 | template
46 | OscSinCos ::OscSinCos ()
47 | : _pos_cos (1)
48 | , _pos_sin (0)
49 | , _step_cos (1)
50 | , _step_sin (0)
51 | {
52 | // Nothing
53 | }
54 |
55 |
56 |
57 | template
58 | void OscSinCos ::set_step (double angle_rad)
59 | {
60 | using namespace std;
61 |
62 | _step_cos = static_cast (cos (angle_rad));
63 | _step_sin = static_cast (sin (angle_rad));
64 | }
65 |
66 |
67 |
68 | template
69 | typename OscSinCos ::DataType OscSinCos ::get_cos () const
70 | {
71 | return (_pos_cos);
72 | }
73 |
74 |
75 |
76 | template
77 | typename OscSinCos ::DataType OscSinCos ::get_sin () const
78 | {
79 | return (_pos_sin);
80 | }
81 |
82 |
83 |
84 | template
85 | void OscSinCos ::step ()
86 | {
87 | const DataType old_cos = _pos_cos;
88 | const DataType old_sin = _pos_sin;
89 |
90 | _pos_cos = old_cos * _step_cos - old_sin * _step_sin;
91 | _pos_sin = old_cos * _step_sin + old_sin * _step_cos;
92 | }
93 |
94 |
95 |
96 | template
97 | void OscSinCos ::clear_buffers ()
98 | {
99 | _pos_cos = static_cast (1);
100 | _pos_sin = static_cast (0);
101 | }
102 |
103 |
104 |
105 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
106 |
107 |
108 |
109 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
110 |
111 |
112 |
113 | } // namespace ffft
114 |
115 |
116 |
117 | #endif // ffft_OscSinCos_CODEHEADER_INCLUDED
118 |
119 | #undef ffft_OscSinCos_CURRENT_CODEHEADER
120 |
121 |
122 |
123 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
124 |
--------------------------------------------------------------------------------
/misc/overlaymsgproxy.cpp:
--------------------------------------------------------------------------------
1 | #include "overlaymsgproxy.h"
2 | #include "dialog/qmessageoverlay.h"
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 |
12 | OverlayMsgProxy::OverlayMsgProxy(QWidget* _obj)
13 | {
14 | lightBox = new QMessageOverlay(_obj,false);
15 | obj = _obj;
16 | }
17 |
18 | void OverlayMsgProxy::openError(QString title, QString desc, QString close){
19 | openBase(title,desc,":/icons/error.svg",close,"#d72828");
20 | }
21 | void OverlayMsgProxy::openNormal(QString title, QString desc, QString color){
22 | openBase(title,desc,"",tr("Close"),color);
23 | }
24 | void OverlayMsgProxy::openBase(QString title, QString desc, QString icon, QString close, QString color){
25 | QLabel* lbTitle = new QLabel(title);
26 | lbTitle->setStyleSheet("font-size: 24px; font-weight: bold; color: white");
27 | QLabel* lbIcon = new QLabel;
28 | lbIcon->setPixmap(QPixmap(icon));
29 | QLabel* lbDescription = new QLabel(desc);
30 | lbDescription->setStyleSheet("color: white");
31 | lbDescription->setWordWrap(true);
32 | QPushButton* lbClose = new QPushButton(close);
33 |
34 | QGridLayout* lbLayout = new QGridLayout;
35 | lbLayout->setRowStretch(0, 1);
36 | lbLayout->setColumnStretch(0, 1);
37 | lbLayout->addWidget(lbTitle, 1, 1);
38 | lbLayout->addWidget(lbTitle, 1, 1);
39 | lbLayout->addWidget(lbIcon, 1, 2, Qt::AlignRight);
40 | lbLayout->setColumnStretch(3, 1);
41 | lbLayout->addWidget(lbDescription, 2, 1, 1, 2);
42 | lbLayout->addWidget(lbClose, 3, 2);
43 | lbLayout->setRowStretch(4, 1);
44 |
45 | QFile f(":/overlay.qss");
46 | f.open(QFile::ReadOnly | QFile::Text);
47 | QTextStream ts(&f);
48 | lbClose->setStyleSheet(ts.readAll().replace("#e67e22",color));
49 |
50 | QGraphicsOpacityEffect *eff = new QGraphicsOpacityEffect();
51 | lightBox->setGraphicsEffect(eff);
52 | lightBox->show();
53 |
54 | QPropertyAnimation *a = new QPropertyAnimation(eff,"opacity");
55 | a->setDuration(500);
56 | a->setStartValue(0);
57 | a->setEndValue(1);
58 | a->setEasingCurve(QEasingCurve::InBack);
59 | a->start(QPropertyAnimation::DeleteWhenStopped);
60 |
61 | connect(lbClose, &QPushButton::clicked, this, &OverlayMsgProxy::buttonPressed);
62 | connect(lbClose, &QPushButton::clicked, lightBox, [lbClose,this](){
63 | lbClose->setEnabled(false);
64 | QGraphicsOpacityEffect *eff2 = new QGraphicsOpacityEffect();
65 | lightBox->setGraphicsEffect(eff2);
66 | QPropertyAnimation *a = new QPropertyAnimation(eff2,"opacity");
67 | a->setDuration(500);
68 | a->setStartValue(1);
69 | a->setEndValue(0);
70 | a->setEasingCurve(QEasingCurve::OutBack);
71 | a->start(QPropertyAnimation::DeleteWhenStopped);
72 | connect(a,&QAbstractAnimation::finished, [this](){
73 | lightBox->hide();
74 | });
75 | });
76 | lightBox->setLayout(lbLayout);
77 | }
78 |
79 | void OverlayMsgProxy::hide(){
80 | lightBox->hide();
81 | }
82 |
--------------------------------------------------------------------------------
/3rdparty/WAF/Animation/SideSlide/SideSlideDecorator.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015-2017 Dimka Novikov, to@dimkanovikov.pro
3 | *
4 | * This library is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or any later version.
8 | *
9 | * This library is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * Full license: https://github.com/dimkanovikov/WidgetAnimationFramework/blob/master/LICENSE
15 | */
16 |
17 | #include "SideSlideDecorator.h"
18 |
19 | #include
20 |
21 | using WAF::SideSlideDecorator;
22 |
23 |
24 | SideSlideDecorator::SideSlideDecorator(QWidget* _parent) :
25 | QWidget(_parent)
26 | {
27 | resize(maximumSize());
28 |
29 | m_timeline.setDuration(260);
30 | m_timeline.setUpdateInterval(40);
31 | m_timeline.setEasingCurve(QEasingCurve::OutQuad);
32 | m_timeline.setStartFrame(0);
33 | m_timeline.setEndFrame(10000);
34 |
35 | m_decorationColor = QColor(0, 0, 0, 0);
36 |
37 | //
38 | // Анимируем затемнение/осветление
39 | //
40 | connect(&m_timeline, &QTimeLine::frameChanged, [=](int _value){
41 | m_decorationColor = QColor(0, 0, 0, _value/100);
42 | update();
43 | });
44 | }
45 |
46 | void SideSlideDecorator::grabSlideWidget(QWidget* _slideWidget)
47 | {
48 | m_slideWidgetPixmap = _slideWidget->grab();
49 | }
50 |
51 | void SideSlideDecorator::grabParent()
52 | {
53 | #if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
54 | //
55 | // В андройде Qt не умеет рисовать прозрачные виджеты https://bugreports.qt.io/browse/QTBUG-43635
56 | // поэтому сохранем картинку с изображением подложки
57 | //
58 | m_backgroundPixmap = parentWidget()->grab();
59 | #endif
60 | }
61 |
62 | void SideSlideDecorator::decorate(bool _dark)
63 | {
64 | if (m_timeline.state() == QTimeLine::Running) {
65 | m_timeline.stop();
66 | }
67 |
68 | m_timeline.setDirection(_dark ? QTimeLine::Forward : QTimeLine::Backward);
69 | m_timeline.start();
70 | }
71 |
72 | QPoint SideSlideDecorator::slidePos() const
73 | {
74 | return m_slidePos;
75 | }
76 |
77 | void SideSlideDecorator::setSlidePos(const QPoint& _pos)
78 | {
79 | if (m_slidePos != _pos) {
80 | m_slidePos = _pos;
81 | update();
82 | }
83 | }
84 |
85 | void SideSlideDecorator::paintEvent(QPaintEvent* _event)
86 | {
87 | QPainter painter(this);
88 | painter.drawPixmap(0, 0, m_backgroundPixmap);
89 | painter.fillRect(rect(), m_decorationColor);
90 | painter.drawPixmap(m_slidePos, m_slideWidgetPixmap);
91 |
92 | QWidget::paintEvent(_event);
93 | }
94 |
95 | void SideSlideDecorator::mousePressEvent(QMouseEvent *_event)
96 | {
97 | emit clicked();
98 |
99 | QWidget::mousePressEvent(_event);
100 | }
101 |
102 |
--------------------------------------------------------------------------------
/visualization/fftreal/FFTRealPassInverse.h:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 |
3 | FFTRealPassInverse.h
4 | By Laurent de Soras
5 |
6 | --- Legal stuff ---
7 |
8 | This program is free software. It comes without any warranty, to
9 | the extent permitted by applicable law. You can redistribute it
10 | and/or modify it under the terms of the Do What The Fuck You Want
11 | To Public License, Version 2, as published by Sam Hocevar. See
12 | http://sam.zoy.org/wtfpl/COPYING for more details.
13 |
14 | *Tab=3***********************************************************************/
15 |
16 |
17 |
18 | #if ! defined (ffft_FFTRealPassInverse_HEADER_INCLUDED)
19 | #define ffft_FFTRealPassInverse_HEADER_INCLUDED
20 |
21 | #if defined (_MSC_VER)
22 | #pragma once
23 | #pragma warning (4 : 4250) // "Inherits via dominance."
24 | #endif
25 |
26 |
27 |
28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
29 |
30 | #include "def.h"
31 | #include "FFTRealFixLenParam.h"
32 | #include "OscSinCos.h"
33 |
34 |
35 |
36 |
37 | namespace ffft
38 | {
39 |
40 |
41 |
42 | template
43 | class FFTRealPassInverse
44 | {
45 |
46 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
47 |
48 | public:
49 |
50 | typedef FFTRealFixLenParam::DataType DataType;
51 | typedef OscSinCos OscType;
52 |
53 | ffft_FORCEINLINE static void
54 | process (long len, DataType dest_ptr [], DataType src_ptr [], const DataType f_ptr [], const DataType cos_ptr [], long cos_len, const long br_ptr [], OscType osc_list []);
55 | ffft_FORCEINLINE static void
56 | process_rec (long len, DataType dest_ptr [], DataType src_ptr [], const DataType cos_ptr [], long cos_len, const long br_ptr [], OscType osc_list []);
57 | ffft_FORCEINLINE static void
58 | process_internal (long len, DataType dest_ptr [], const DataType src_ptr [], const DataType cos_ptr [], long cos_len, const long br_ptr [], OscType osc_list []);
59 |
60 |
61 |
62 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
63 |
64 | protected:
65 |
66 |
67 |
68 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
69 |
70 | private:
71 |
72 |
73 |
74 | /*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
75 |
76 | private:
77 |
78 | FFTRealPassInverse ();
79 | FFTRealPassInverse (const FFTRealPassInverse &other);
80 | FFTRealPassInverse &
81 | operator = (const FFTRealPassInverse &other);
82 | bool operator == (const FFTRealPassInverse &other);
83 | bool operator != (const FFTRealPassInverse &other);
84 |
85 | }; // class FFTRealPassInverse
86 |
87 |
88 |
89 | } // namespace ffft
90 |
91 |
92 |
93 | #include "FFTRealPassInverse.hpp"
94 |
95 |
96 |
97 | #endif // ffft_FFTRealPassInverse_HEADER_INCLUDED
98 |
99 |
100 |
101 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
102 |
--------------------------------------------------------------------------------
/3rdparty/WAF/Animation/Expand/ExpandAnimator.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Dimka Novikov, to@dimkanovikov.pro
3 | *
4 | * This library is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or any later version.
8 | *
9 | * This library is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * Full license: https://github.com/dimkanovikov/WidgetAnimationFramework/blob/master/LICENSE
15 | */
16 |
17 | #ifndef EXPANDANIMATOR_H
18 | #define EXPANDANIMATOR_H
19 |
20 | #include "../../WAF.h"
21 | #include "../../AbstractAnimator.h"
22 |
23 | #include
24 |
25 | class QPropertyAnimation;
26 |
27 |
28 | /**
29 | * Widgets Animation Framework
30 | */
31 | namespace WAF
32 | {
33 | class ExpandDecorator;
34 |
35 | /**
36 | * @brief Аниматор выводящий элемент на передний план и заполняющий пространство
37 | */
38 | class ExpandAnimator : public AbstractAnimator
39 | {
40 | Q_OBJECT
41 |
42 | public:
43 | explicit ExpandAnimator(QWidget* _widgetForFill);
44 |
45 | /**
46 | * @brief Установить область для выведения на передний план
47 | */
48 | void setExpandRect(const QRect& _rect);
49 |
50 | /**
51 | * @brief Установить цвет заливки
52 | */
53 | void setFillColor(const QColor& _color);
54 |
55 | /**
56 | * @brief Длительность анимации
57 | */
58 | int animationDuration() const;
59 |
60 | /**
61 | * @brief Заполнить виджет
62 | */
63 | /** @{ */
64 | void animateForward();
65 | void expandIn();
66 | /** @} */
67 |
68 | /**
69 | * @brief Свернуть цветовой круг - очистить виджет
70 | */
71 | /** @{ */
72 | void animateBackward();
73 | void expandOut();
74 | /** @} */
75 |
76 | protected:
77 | /**
78 | * @brief Переопределяется, чтобы корректировать размер перекрывающего виджета
79 | */
80 | bool eventFilter(QObject* _object, QEvent* _event);
81 |
82 | private:
83 | /**
84 | * @brief Получить виджет, который нужно заполнить
85 | */
86 | QWidget* widgetForFill() const;
87 |
88 | private:
89 | /**
90 | * @brief Исходная область для выдвижения
91 | */
92 | QRect m_expandRect;
93 |
94 | /**
95 | * @brief Декоратор, рисующий заполнение
96 | */
97 | ExpandDecorator* m_decorator;
98 |
99 | /**
100 | * @brief Объект для анимирования декоратора
101 | */
102 | QPropertyAnimation* m_animation;
103 | };
104 | }
105 |
106 | #endif // EXPANDANIMATOR_H
107 |
--------------------------------------------------------------------------------
/3rdparty/WAF/Animation/CircleFill/CircleFillAnimator.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Dimka Novikov, to@dimkanovikov.pro
3 | *
4 | * This library is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or any later version.
8 | *
9 | * This library is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * Full license: https://github.com/dimkanovikov/WidgetAnimationFramework/blob/master/LICENSE
15 | */
16 |
17 | #ifndef CIRCLEFILLANIMATOR_H
18 | #define CIRCLEFILLANIMATOR_H
19 |
20 | #include "../../WAF.h"
21 | #include "../../AbstractAnimator.h"
22 |
23 | class QPropertyAnimation;
24 |
25 |
26 | /**
27 | * Widgets Animation Framework
28 | */
29 | namespace WAF
30 | {
31 | class CircleFillDecorator;
32 |
33 | /**
34 | * @brief Аниматор заполнения цветным кругом
35 | */
36 | class CircleFillAnimator : public AbstractAnimator
37 | {
38 | Q_OBJECT
39 |
40 | public:
41 | explicit CircleFillAnimator(QWidget* _widgetForFill);
42 |
43 | /**
44 | * @brief Установить точку начала анимации
45 | */
46 | void setStartPoint(const QPoint& _point);
47 |
48 | /**
49 | * @brief Установить цвет заливки
50 | */
51 | void setFillColor(const QColor& _color);
52 |
53 | /**
54 | * @brief Скрывать ли декоратор после окончания анимации
55 | */
56 | void setHideAfterFinish(bool _hide);
57 |
58 | /**
59 | * @brief Длительность анимации
60 | */
61 | int animationDuration() const;
62 |
63 | /**
64 | * @brief Заполнить виджет
65 | */
66 | /** @{ */
67 | void animateForward();
68 | void fillIn();
69 | /** @} */
70 |
71 | /**
72 | * @brief Свернуть цветовой круг - очистить виджет
73 | */
74 | /** @{ */
75 | void animateBackward();
76 | void fillOut();
77 | /** @} */
78 |
79 | /**
80 | * @brief Скрыть декоратор
81 | */
82 | void hideDecorator();
83 |
84 | private:
85 | /**
86 | * @brief Получить виджет, который нужно заполнить
87 | */
88 | QWidget* widgetForFill() const;
89 |
90 | private:
91 | /**
92 | * @brief Декоратор, рисующий заполнение
93 | */
94 | CircleFillDecorator* m_decorator;
95 |
96 | /**
97 | * @brief Объект для анимирования декоратора
98 | */
99 | QPropertyAnimation* m_animation;
100 |
101 | /**
102 | * @brief Скрывать ли декоратор после завершения анимации
103 | */
104 | bool m_hideAfterFinish = true;
105 | };
106 | }
107 |
108 | #endif // CIRCLEFILLANIMATOR_H
109 |
--------------------------------------------------------------------------------
/visualization/fftreal/DynArray.hpp:
--------------------------------------------------------------------------------
1 | /*****************************************************************************
2 |
3 | DynArray.hpp
4 | By Laurent de Soras
5 |
6 | --- Legal stuff ---
7 |
8 | This program is free software. It comes without any warranty, to
9 | the extent permitted by applicable law. You can redistribute it
10 | and/or modify it under the terms of the Do What The Fuck You Want
11 | To Public License, Version 2, as published by Sam Hocevar. See
12 | http://sam.zoy.org/wtfpl/COPYING for more details.
13 |
14 | *Tab=3***********************************************************************/
15 |
16 |
17 |
18 | #if defined (ffft_DynArray_CURRENT_CODEHEADER)
19 | #error Recursive inclusion of DynArray code header.
20 | #endif
21 | #define ffft_DynArray_CURRENT_CODEHEADER
22 |
23 | #if ! defined (ffft_DynArray_CODEHEADER_INCLUDED)
24 | #define ffft_DynArray_CODEHEADER_INCLUDED
25 |
26 |
27 |
28 | /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
29 |
30 | #include
31 |
32 |
33 |
34 | namespace ffft
35 | {
36 |
37 |
38 |
39 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
40 |
41 |
42 |
43 | template
44 | DynArray ::DynArray ()
45 | : _data_ptr (0)
46 | , _len (0)
47 | {
48 | // Nothing
49 | }
50 |
51 |
52 |
53 | template
54 | DynArray ::DynArray (long size)
55 | : _data_ptr (0)
56 | , _len (0)
57 | {
58 | assert (size >= 0);
59 | if (size > 0)
60 | {
61 | _data_ptr = new DataType [size];
62 | _len = size;
63 | }
64 | }
65 |
66 |
67 |
68 | template
69 | DynArray ::~DynArray ()
70 | {
71 | delete [] _data_ptr;
72 | _data_ptr = 0;
73 | _len = 0;
74 | }
75 |
76 |
77 |
78 | template
79 | long DynArray ::size () const
80 | {
81 | return (_len);
82 | }
83 |
84 |
85 |
86 | template
87 | void DynArray ::resize (long size)
88 | {
89 | assert (size >= 0);
90 | if (size > 0)
91 | {
92 | DataType * old_data_ptr = _data_ptr;
93 | DataType * tmp_data_ptr = new DataType [size];
94 |
95 | _data_ptr = tmp_data_ptr;
96 | _len = size;
97 |
98 | delete [] old_data_ptr;
99 | }
100 | }
101 |
102 |
103 |
104 | template
105 | const typename DynArray ::DataType & DynArray ::operator [] (long pos) const
106 | {
107 | assert (pos >= 0);
108 | assert (pos < _len);
109 |
110 | return (_data_ptr [pos]);
111 | }
112 |
113 |
114 |
115 | template
116 | typename DynArray ::DataType & DynArray ::operator [] (long pos)
117 | {
118 | assert (pos >= 0);
119 | assert (pos < _len);
120 |
121 | return (_data_ptr [pos]);
122 | }
123 |
124 |
125 |
126 | /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
127 |
128 |
129 |
130 | /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
131 |
132 |
133 |
134 | } // namespace ffft
135 |
136 |
137 |
138 | #endif // ffft_DynArray_CODEHEADER_INCLUDED
139 |
140 | #undef ffft_DynArray_CURRENT_CODEHEADER
141 |
142 |
143 |
144 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
145 |
--------------------------------------------------------------------------------
/dialog/FlatTabWidget/3rdparty/StackedWidgetAnimation/StackedWidgetSlide/StackedWidgetSlideAnimator.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Dimka Novikov, to@dimkanovikov.pro
3 | *
4 | * This library is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 3 of the License, or any later version.
8 | *
9 | * This library is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * Full license: https://github.com/dimkanovikov/WidgetAnimationFramework/blob/master/LICENSE
15 | */
16 |
17 | #ifndef STACKEDWIDGETSLIDEANIMATOR_H
18 | #define STACKEDWIDGETSLIDEANIMATOR_H
19 |
20 | #include "../../WAF.h"
21 | #include "../../AbstractAnimator.h"
22 |
23 | class QPropertyAnimation;
24 | class QStackedWidget;
25 |
26 |
27 | /**
28 | * Widgets Animation Framework
29 | */
30 | namespace WAF
31 | {
32 | class StackedWidgetSlideDecorator;
33 |
34 |
35 | /**
36 | * @brief Аниматор выдвижения виджета из стека со смещением текущего виджета
37 | */
38 | class StackedWidgetSlideAnimator : public AbstractAnimator
39 | {
40 | Q_OBJECT
41 |
42 | public:
43 | explicit StackedWidgetSlideAnimator(QStackedWidget* _container, QWidget* _widgetForSlide);
44 |
45 | /**
46 | * @brief Установить направление выдвижения
47 | */
48 | void setAnimationDirection(AnimationDirection _direction);
49 |
50 | /**
51 | * @brief Длительность анимации
52 | */
53 | int animationDuration() const;
54 |
55 | /**
56 | * @brief Выдвинуть виджет
57 | */
58 | /** @{ */
59 | void animateForward();
60 | void slide();
61 | /** @} */
62 |
63 | /**
64 | * @brief Обратной анимации для данного случая нет
65 | */
66 | void animateBackward() {}
67 | void animateStop();
68 |
69 | protected:
70 | /**
71 | * @brief Переопределяется, чтобы корректировать позицию перекрывающего виджета
72 | */
73 | bool eventFilter(QObject* _object, QEvent* _event);
74 |
75 | private:
76 | /**
77 | * @brief Получить виджет, который нужно анимировать
78 | */
79 | QWidget* widgetForSlide() const;
80 |
81 | private:
82 | /**
83 | * @brief Направление, по которому выкатывать виджет
84 | */
85 | AnimationDirection m_direction;
86 |
87 | /**
88 | * @brief Помошники
89 | */
90 | /** @{ */
91 | StackedWidgetSlideDecorator* m_containerDecorator;
92 | StackedWidgetSlideDecorator* m_widgetDecorator;
93 | /** @} */
94 |
95 | /**
96 | * @brief Объекты для анимирования выезжания
97 | */
98 | /** @{ */
99 | QPropertyAnimation* m_containerAnimation;
100 | QPropertyAnimation* m_widgetAnimation;
101 | /** @} */
102 | };
103 | }
104 |
105 | #endif // STACKEDWIDGETSLIDEANIMATOR_H
106 |
--------------------------------------------------------------------------------
/phantom/phantomcolor.h:
--------------------------------------------------------------------------------
1 | #ifndef PHANTOMCOLOR_H
2 | #define PHANTOMCOLOR_H
3 | #include