├── .gitignore ├── .travis.yml ├── 3rdparty └── WAF │ ├── AbstractAnimator.h │ ├── Animation │ ├── Animation.cpp │ ├── Animation.h │ ├── AnimationPrivate.h │ ├── CircleFill │ │ ├── CircleFillAnimator.cpp │ │ ├── CircleFillAnimator.h │ │ ├── CircleFillDecorator.cpp │ │ └── CircleFillDecorator.h │ ├── Expand │ │ ├── ExpandAnimator.cpp │ │ ├── ExpandAnimator.h │ │ ├── ExpandDecorator.cpp │ │ └── ExpandDecorator.h │ ├── SideSlide │ │ ├── SideSlideAnimator.cpp │ │ ├── SideSlideAnimator.h │ │ ├── SideSlideDecorator.cpp │ │ └── SideSlideDecorator.h │ └── Slide │ │ ├── SlideAnimator.cpp │ │ ├── SlideAnimator.h │ │ ├── SlideForegroundDecorator.cpp │ │ └── SlideForegroundDecorator.h │ ├── LICENSE │ ├── README.md │ ├── WAF.h │ └── WAF.pri ├── LICENSE ├── README.md ├── V4L_Frontend-lib.pro ├── V4L_Frontend.pri ├── V4L_Frontend.pro ├── config ├── appconfigwrapper.cpp ├── appconfigwrapper.h ├── container.cpp ├── container.h ├── dbusproxy.cpp ├── dbusproxy.h ├── io.cpp └── io.h ├── crashhandler ├── airbag.c ├── airbag.h ├── killer.h ├── safecall.h └── stacktrace.h ├── dbus ├── clientproxy.cpp ├── clientproxy.h ├── manifest.xml ├── serveradaptor.cpp └── serveradaptor.h ├── deployment └── build_deb_package.sh ├── dialog ├── FlatTabWidget │ ├── 3rdparty │ │ ├── AbstractAnimator.h │ │ ├── LICENSE │ │ ├── README.md │ │ ├── StackedWidgetAnimation │ │ │ ├── StackedWidgetAnimation.cpp │ │ │ ├── StackedWidgetAnimation.h │ │ │ ├── StackedWidgetAnimationPrivate.h │ │ │ ├── StackedWidgetFadeIn │ │ │ │ ├── StackedWidgetFadeInAnimator.cpp │ │ │ │ ├── StackedWidgetFadeInAnimator.h │ │ │ │ ├── StackedWidgetFadeInDecorator.cpp │ │ │ │ └── StackedWidgetFadeInDecorator.h │ │ │ ├── StackedWidgetSlide │ │ │ │ ├── StackedWidgetSlideAnimator.cpp │ │ │ │ ├── StackedWidgetSlideAnimator.h │ │ │ │ ├── StackedWidgetSlideDecorator.cpp │ │ │ │ └── StackedWidgetSlideDecorator.h │ │ │ └── StackedWidgetSlideOver │ │ │ │ ├── StackedWidgetSlideOverAnimator.cpp │ │ │ │ ├── StackedWidgetSlideOverAnimator.h │ │ │ │ ├── StackedWidgetSlideOverDecorator.cpp │ │ │ │ └── StackedWidgetSlideOverDecorator.h │ │ └── WAF.h │ ├── FlatTabWidget.pri │ ├── LICENSE │ ├── README.md │ ├── clickablelabel.cpp │ ├── clickablelabel.h │ ├── colorprovider.cpp │ ├── colorprovider.h │ ├── customtabbar.cpp │ ├── customtabbar.h │ ├── flattabwidget.cpp │ ├── flattabwidget.h │ └── flattabwidget.ui ├── androidimporterdlg.cpp ├── androidimporterdlg.h ├── animatedvipericon.cpp ├── animatedvipericon.h ├── convolver.ui ├── convolverdlg.cpp ├── convolverdlg.h ├── firstlaunchwizard.cpp ├── firstlaunchwizard.h ├── firstlaunchwizard.ui ├── importandroid.ui ├── liquidequalizerwidget.cpp ├── liquidequalizerwidget.h ├── log.ui ├── logdlg.cpp ├── logdlg.h ├── menueditor.ui ├── palettedlg.cpp ├── palettedlg.h ├── palettedlg.ui ├── preset.ui ├── presetdlg.cpp ├── presetdlg.h ├── qanimatedslider.cpp ├── qanimatedslider.h ├── qmenueditor.cpp ├── qmenueditor.h ├── qmessageoverlay.cpp ├── qmessageoverlay.h ├── settings.ui ├── settingsdlg.cpp ├── settingsdlg.h ├── slidingstackedwidget.cpp ├── slidingstackedwidget.h ├── statusfragment.cpp ├── statusfragment.h └── statusfragment.ui ├── icons ├── arrow-down-white.svg ├── arrow-down.svg ├── arrow-left-double-white.svg ├── arrow-left-double.svg ├── arrow-right-double-white.svg ├── arrow-right-double.svg ├── arrow-up-white.svg ├── arrow-up.svg ├── edit-undo-white.svg ├── edit-undo.svg ├── error.svg ├── menu-white.svg ├── menu.svg ├── parts │ ├── lower.svg │ ├── upper.svg │ └── viper.svg ├── queue-white.svg ├── queue.svg ├── settings-white.svg ├── settings.svg ├── viper-new.svg └── viper.png ├── main.cpp ├── misc ├── GstRegistryHelper.h ├── autostartmanager.cpp ├── autostartmanager.h ├── biquad.cpp ├── biquad.h ├── common.h ├── converter.cpp ├── converter.h ├── eventfilter.h ├── findbinary.h ├── initializableqmap.h ├── loghelper.cpp ├── loghelper.h ├── mathfunctions.h ├── overlaymsgproxy.cpp ├── overlaymsgproxy.h ├── presetprovider.cpp ├── presetprovider.h ├── stylehelper.cpp ├── stylehelper.h └── versioncontainer.h ├── phantom ├── LICENSE ├── phantom.pri ├── phantomcolor.cpp ├── phantomcolor.h ├── phantomstyle.cpp ├── phantomstyle.h └── phantomtweak.h ├── screenshots ├── eq.gif └── mainwindow.gif ├── scripts ├── install-debian.sh └── uninstall-debian.sh ├── styles ├── aqua │ ├── LICENSE │ └── aqua.qss ├── default.qss ├── overlay.qss ├── ubuntu │ ├── LICENSE │ └── ubuntu.qss └── v4l_frontend_styles.qrc ├── translations ├── lang_de.qm ├── lang_de.ts ├── lang_en.qm ├── lang_en.ts ├── lang_pt_BR.qm ├── lang_pt_BR.ts ├── lang_zh_CN.qm ├── lang_zh_CN.ts ├── lang_zh_HK.qm └── lang_zh_HK.ts ├── v4l_frontend_resources.qrc ├── viper.png ├── viper_window.cpp ├── viper_window.h ├── viper_window.ui └── visualization ├── SpectrumAudioViewer.pri ├── audiostreamengine.cpp ├── audiostreamengine.h ├── fftreal ├── Array.h ├── Array.hpp ├── DynArray.h ├── DynArray.hpp ├── FFTReal.h ├── FFTReal.hpp ├── FFTRealFixLen.h ├── FFTRealFixLen.hpp ├── FFTRealFixLenParam.h ├── FFTRealPassDirect.h ├── FFTRealPassDirect.hpp ├── FFTRealPassInverse.h ├── FFTRealPassInverse.hpp ├── FFTRealSelect.h ├── FFTRealSelect.hpp ├── FFTRealUseTrigo.h ├── FFTRealUseTrigo.hpp ├── OscSinCos.h ├── OscSinCos.hpp ├── def.h ├── fftreal_wrapper.cpp └── fftreal_wrapper.h ├── frequencyspectrum.cpp ├── frequencyspectrum.h ├── spectrograph.cpp ├── spectrograph.h ├── spectrum.h ├── spectrumanalyser.cpp ├── spectrumanalyser.h ├── utils.cpp └── utils.h /.gitignore: -------------------------------------------------------------------------------- 1 | *.pro.user 2 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /3rdparty/WAF/Animation/CircleFill/CircleFillDecorator.cpp: -------------------------------------------------------------------------------- 1 | #include "CircleFillDecorator.h" 2 | 3 | #include 4 | 5 | using WAF::CircleFillDecorator; 6 | 7 | 8 | 9 | CircleFillDecorator::CircleFillDecorator(QWidget* _parent) : 10 | QWidget(_parent), 11 | m_radius(0), 12 | m_fillColor(Qt::white) 13 | { 14 | 15 | } 16 | 17 | void CircleFillDecorator::setStartPoint(const QPoint& _point) 18 | { 19 | QPoint localStartPoint = mapFromGlobal(_point); 20 | if (m_startPoint != localStartPoint) { 21 | m_startPoint = localStartPoint; 22 | } 23 | } 24 | 25 | int CircleFillDecorator::radius() const 26 | { 27 | return m_radius; 28 | } 29 | 30 | void CircleFillDecorator::setRadius(int _radius) 31 | { 32 | if (m_radius != _radius) { 33 | m_radius = _radius; 34 | 35 | update(); 36 | } 37 | } 38 | 39 | void CircleFillDecorator::setFillColor(const QColor& _fillColor) 40 | { 41 | if (m_fillColor != _fillColor) { 42 | m_fillColor = _fillColor; 43 | } 44 | } 45 | 46 | void CircleFillDecorator::paintEvent(QPaintEvent* _event) 47 | { 48 | QPainter painter(this); 49 | painter.setPen(m_fillColor); 50 | painter.setBrush(m_fillColor); 51 | const qreal opacity = (qreal)m_radius / ((qreal)(width() + height()) / 4.); 52 | painter.setOpacity(opacity); 53 | painter.drawEllipse(m_startPoint, m_radius, m_radius); 54 | 55 | QWidget::paintEvent(_event); 56 | } 57 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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.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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /3rdparty/WAF/Animation/Slide/SlideForegroundDecorator.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 "SlideForegroundDecorator.h" 18 | 19 | #include 20 | 21 | using WAF::SlideForegroundDecorator; 22 | 23 | 24 | SlideForegroundDecorator::SlideForegroundDecorator(QWidget* _parent) : 25 | QWidget(_parent) 26 | { 27 | } 28 | 29 | void SlideForegroundDecorator::grabParent(const QSize& _size) 30 | { 31 | resize(_size); 32 | m_foreground = QPixmap(_size); 33 | parentWidget()->render(&m_foreground, QPoint(), QRegion(QRect(QPoint(), _size))); 34 | } 35 | 36 | void SlideForegroundDecorator::paintEvent(QPaintEvent* _event) 37 | { 38 | QPainter painter(this); 39 | painter.drawPixmap(0, 0, m_foreground); 40 | 41 | QWidget::paintEvent(_event); 42 | } 43 | 44 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /3rdparty/WAF/README.md: -------------------------------------------------------------------------------- 1 | # WidgetAnimationFramework 2 | 3 | Small extension for animate Qt widgets. 4 | 5 | ### Side sliding animation 6 | 7 | `WAF::Animation::sideSlideIn(myCoolWidget, WAF::LeftSide);` 8 | 9 | ![Side sliding animation demonstration](http://dimkanovikov.pro/assets/images/dev/WAF-demo1.gif) 10 | 11 | ### Sliding animation 12 | 13 | `WAF::Animation::slideIn(myCoolWidget, WAF::FromTopToBottom);` 14 | 15 | ![Sliding animation demonstration](http://dimkanovikov.pro/assets/images/dev/WAF-demo2.gif) 16 | 17 | ### Notify example 18 | 19 | Implemented in demo project. 20 | 21 | ![Sliding notifications](http://dimkanovikov.pro/assets/images/dev/WAF-demo3.gif) 22 | -------------------------------------------------------------------------------- /3rdparty/WAF/WAF.h: -------------------------------------------------------------------------------- 1 | #ifndef WAF_H 2 | #define WAF_H 3 | 4 | 5 | /** 6 | * Widgets Animation Framework 7 | */ 8 | namespace WAF 9 | { 10 | /** 11 | * @brief Края приложения 12 | */ 13 | enum ApplicationSide { 14 | LeftSide, 15 | TopSide, 16 | RightSide, 17 | BottomSide 18 | }; 19 | 20 | /** 21 | * @brief Направление анимации 22 | */ 23 | enum AnimationDirection { 24 | Undefined, 25 | FromLeftToRight, 26 | FromTopToBottom, 27 | FromRightToLeft, 28 | FromBottomToTop 29 | }; 30 | } 31 | 32 | #endif // WAF_H 33 | -------------------------------------------------------------------------------- /3rdparty/WAF/WAF.pri: -------------------------------------------------------------------------------- 1 | SOURCES += \ 2 | $$PWD/Animation/Animation.cpp \ 3 | $$PWD/Animation/CircleFill/CircleFillAnimator.cpp \ 4 | $$PWD/Animation/CircleFill/CircleFillDecorator.cpp \ 5 | $$PWD/Animation/Expand/ExpandAnimator.cpp \ 6 | $$PWD/Animation/Expand/ExpandDecorator.cpp \ 7 | $$PWD/Animation/SideSlide/SideSlideAnimator.cpp \ 8 | $$PWD/Animation/SideSlide/SideSlideDecorator.cpp \ 9 | $$PWD/Animation/Slide/SlideAnimator.cpp \ 10 | $$PWD/Animation/Slide/SlideForegroundDecorator.cpp 11 | 12 | HEADERS += \ 13 | $$PWD/AbstractAnimator.h \ 14 | $$PWD/Animation/Animation.h \ 15 | $$PWD/Animation/AnimationPrivate.h \ 16 | $$PWD/Animation/CircleFill/CircleFillAnimator.h \ 17 | $$PWD/Animation/CircleFill/CircleFillDecorator.h \ 18 | $$PWD/Animation/Expand/ExpandAnimator.h \ 19 | $$PWD/Animation/Expand/ExpandDecorator.h \ 20 | $$PWD/Animation/SideSlide/SideSlideAnimator.h \ 21 | $$PWD/Animation/SideSlide/SideSlideDecorator.h \ 22 | $$PWD/Animation/Slide/SlideAnimator.h \ 23 | $$PWD/Animation/Slide/SlideForegroundDecorator.h \ 24 | $$PWD/WAF.h \ 25 | $$PWD/AbstractAnimator.h 26 | 27 | INCLUDEPATH += $$PWD 28 | -------------------------------------------------------------------------------- /V4L_Frontend-lib.pro: -------------------------------------------------------------------------------- 1 | TARGET = Viper4Linux-GUI 2 | TEMPLATE = lib 3 | CONFIG += staticlib 4 | DEFINES += VIPER_PLUGINMODE 5 | 6 | CONFIG += c++11 7 | 8 | include($$PWD/V4L_Frontend.pri) 9 | 10 | QMAKE_CXXFLAGS += "-Wno-old-style-cast -Wno-unused-function" 11 | 12 | LIBS += -ldl 13 | 14 | unix { 15 | QMAKE_LFLAGS += -ldl -lutil 16 | QMAKE_CXXFLAGS += -g 17 | target.path = /usr/lib 18 | } 19 | else: error("Static linking only available on Linux systems") 20 | 21 | !isEmpty(target.path): INSTALLS += target 22 | -------------------------------------------------------------------------------- /V4L_Frontend.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2019-01-11T21:34:04 4 | # 5 | #------------------------------------------------- 6 | 7 | TARGET = V4L_Frontend 8 | TEMPLATE = app 9 | QMAKE_CXXFLAGS += "-Wno-old-style-cast -Wno-unused-function" 10 | 11 | include(V4L_Frontend.pri) 12 | 13 | # The following define makes your compiler emit warnings if you use 14 | # any feature of Qt which has been marked as deprecated (the exact warnings 15 | # depend on your compiler). Please consult the documentation of the 16 | # deprecated API in order to know how to port your code away from it. 17 | DEFINES += QT_DEPRECATED_WARNINGS 18 | 19 | # You can also make your code fail to compile if you use deprecated APIs. 20 | # In order to do so, uncomment the following line. 21 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 22 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 23 | 24 | CONFIG += c++11 25 | 26 | SOURCES += main.cpp 27 | 28 | LIBS += -ldl 29 | 30 | unix { 31 | QMAKE_LFLAGS += -ldl -lutil 32 | QMAKE_CXXFLAGS += -g 33 | } 34 | 35 | # Default rules for deployment. 36 | qnx: target.path = /tmp/$${TARGET}/bin 37 | else: unix:!android: target.path = /usr/bin/ 38 | 39 | # Set BUILDPATH variable to change the output path 40 | # !isEmpty($$BUILDPATH): target.path = $$BUILDPATH 41 | # !isEmpty($$BUILDPATH): DESTDIR = $$BUILDPATH 42 | 43 | !isEmpty(target.path): INSTALLS += target 44 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /config/container.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 CONFIGCONTAINER_H 16 | #define CONFIGCONTAINER_H 17 | 18 | #include 19 | #include 20 | 21 | class ConfigContainer 22 | { 23 | public: 24 | ConfigContainer(); 25 | void setValue(const QString& key,QVariant value); 26 | QVariant getVariant(const QString& key); 27 | QString getString(const QString& key,bool setToDefaultIfMissing=true, QString alternative=""); 28 | int getInt(const QString& key, int alternative = 0); 29 | float getFloat(const QString& key); 30 | bool getBool(const QString& key, bool setToDefaultIfMissing=true, bool alternative=false); 31 | 32 | QVariantMap getConfigMap(); 33 | void setConfigMap(const QVariantMap& newmap); 34 | 35 | private: 36 | QVariantMap map = QVariantMap(); 37 | 38 | }; 39 | 40 | #endif // CONFIGCONTAINER_H 41 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /config/io.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 CONFIGIO_H 16 | #define CONFIGIO_H 17 | 18 | #include 19 | #include 20 | 21 | class ConfigIO 22 | { 23 | public: 24 | static QString writeString(const QVariantMap& map); 25 | static void writeFile(const QString& path,const QVariantMap& map,const QString& prefix = ""); 26 | static QVariantMap readFile(const QString& path); 27 | static QVariantMap readString(const QString& str); 28 | }; 29 | 30 | #endif // CONFIGIO_H 31 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /crashhandler/killer.h: -------------------------------------------------------------------------------- 1 | #ifndef KILLER_H 2 | #define KILLER_H 3 | #include 4 | 5 | int divide_by_zero() 6 | { 7 | int a = 1; 8 | int b = 0; 9 | return a / b; 10 | } 11 | 12 | void cause_segfault() 13 | { 14 | int * p = (int*)0x12345678; 15 | *p = 0; 16 | } 17 | 18 | void stack_overflow(); 19 | void stack_overflow() 20 | { 21 | int foo[1000]; 22 | (void)foo; 23 | stack_overflow(); 24 | } 25 | 26 | /* break out with ctrl+c to test SIGINT handling */ 27 | void infinite_loop() 28 | { 29 | while(1) {}; 30 | } 31 | 32 | void illegal_instruction() 33 | { 34 | /* I couldn't find an easy way to cause this one, so I'm cheating */ 35 | raise(SIGILL); 36 | } 37 | 38 | 39 | #endif // KILLER_H 40 | -------------------------------------------------------------------------------- /dbus/clientproxy.cpp: -------------------------------------------------------------------------------- 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 | * This file may have been hand-edited. Look for HAND-EDIT comments 9 | * before re-generating it. 10 | */ 11 | 12 | #include "clientproxy.h" 13 | 14 | /* 15 | * Implementation of interface class CfTheboneViper4linuxGuiInterface 16 | */ 17 | 18 | CfTheboneViper4linuxGuiInterface::CfTheboneViper4linuxGuiInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) 19 | : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) 20 | { 21 | } 22 | 23 | CfTheboneViper4linuxGuiInterface::~CfTheboneViper4linuxGuiInterface() 24 | { 25 | } 26 | 27 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /dbus/manifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /dbus/serveradaptor.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by qdbusxml2cpp version 0.8 3 | * Command line was: qdbusxml2cpp -a dbus/serveradaptor.h:dbus/serveradaptor.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 | #include "dbus/serveradaptor.h" 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | /* 21 | * Implementation of adaptor class GuiAdaptor 22 | */ 23 | 24 | GuiAdaptor::GuiAdaptor(QObject *parent) 25 | : QDBusAbstractAdaptor(parent) 26 | { 27 | // constructor 28 | setAutoRelaySignals(true); 29 | } 30 | 31 | GuiAdaptor::~GuiAdaptor() 32 | { 33 | // destructor 34 | } 35 | 36 | void GuiAdaptor::hide() 37 | { 38 | // handle method call cf.thebone.viper4linux.Gui.hide 39 | QMetaObject::invokeMethod(parent(), "hide"); 40 | } 41 | 42 | void GuiAdaptor::raiseWindow() 43 | { 44 | // handle method call cf.thebone.viper4linux.Gui.raiseWindow 45 | QMetaObject::invokeMethod(parent(), "raiseWindow"); 46 | } 47 | 48 | void GuiAdaptor::show() 49 | { 50 | // handle method call cf.thebone.viper4linux.Gui.show 51 | QMetaObject::invokeMethod(parent(), "show"); 52 | } 53 | 54 | -------------------------------------------------------------------------------- /dbus/serveradaptor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by qdbusxml2cpp version 0.8 3 | * Command line was: qdbusxml2cpp -a dbus/serveradaptor.h:dbus/serveradaptor.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 | * This file may have been hand-edited. Look for HAND-EDIT comments 9 | * before re-generating it. 10 | */ 11 | 12 | #ifndef SERVERADAPTOR_H 13 | #define SERVERADAPTOR_H 14 | 15 | #include 16 | #include 17 | QT_BEGIN_NAMESPACE 18 | class QByteArray; 19 | template class QList; 20 | template class QMap; 21 | class QString; 22 | class QStringList; 23 | class QVariant; 24 | QT_END_NAMESPACE 25 | 26 | /* 27 | * Adaptor class for interface cf.thebone.viper4linux.Gui 28 | */ 29 | class GuiAdaptor: public QDBusAbstractAdaptor 30 | { 31 | Q_OBJECT 32 | Q_CLASSINFO("D-Bus Interface", "cf.thebone.viper4linux.Gui") 33 | Q_CLASSINFO("D-Bus Introspection", "" 34 | " \n" 35 | " \n" 36 | " \n" 37 | " \n" 38 | " \n" 39 | "") 40 | public: 41 | GuiAdaptor(QObject *parent); 42 | virtual ~GuiAdaptor(); 43 | 44 | public: // PROPERTIES 45 | public Q_SLOTS: // METHODS 46 | void hide(); 47 | void raiseWindow(); 48 | void show(); 49 | Q_SIGNALS: // SIGNALS 50 | }; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /deployment/build_deb_package.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #DEB build script for Travis-CI 3 | #V4L_Frontend binary needs to be in working directory 4 | 5 | debname="viper4linux-gui_"$base_version"-build"$TRAVIS_BUILD_NUMBER 6 | echo $debname 7 | mkdir $debname 8 | mkdir $debname"/DEBIAN" 9 | mkdir -p $debname"/usr/bin" 10 | mkdir -p $debname"/usr/share/applications" 11 | mkdir -p $debname"/usr/share/pixmaps" 12 | cp "V4L_Frontend" $debname"/usr/bin/viper-gui" 13 | 14 | cp "viper.png" $debname"/usr/share/pixmaps/viper-gui.png" 15 | cp "LICENSE" $debname"/DEBIAN" 16 | 17 | cat <> $debname"/usr/share/applications/viper-gui.desktop" 18 | [Desktop Entry] 19 | Name=Viper4Linux 20 | GenericName=Equalizer 21 | Comment=Official UI for Viper4Linux 22 | Keywords=equalizer 23 | Categories=AudioVideo;Audio; 24 | Exec=viper-gui 25 | Icon=/usr/share/pixmaps/viper-gui.png 26 | StartupNotify=false 27 | Terminal=false 28 | Type=Application 29 | EOT 30 | 31 | cat <> $debname"/DEBIAN/control" 32 | Package: viper4linux-gui 33 | Version: $base_version-$TRAVIS_BUILD_NUMBER 34 | Section: sound 35 | Priority: optional 36 | Architecture: amd64 37 | Depends: libqt5multimedia5 (>= 5.9.5), libqt5xml5 (>= 5.9.5), libqt5svg5 (>= 5.9.5), qtbase5-dev (>= 5.9.5), libqt5core5a (>= 5.9.5), libqt5widgets5 (>= 5.9.5), libqt5gui5 (>= 5.9.5), libqt5core5a (>= 5.9.5), libgl1-mesa-dev, libgstreamer-plugins-base1.0-dev, libgstreamer1.0-dev, gstreamer1.0-plugins-bad, libgstreamer-plugins-bad1.0-dev 38 | Maintainer: ThePBone 39 | Description: Official UI for Viper4Linux 40 | Homepage: https://github.com/Audio4Linux/Viper4Linux-GUI 41 | EOT 42 | 43 | dpkg-deb --build $debname 44 | -------------------------------------------------------------------------------- /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/README.md: -------------------------------------------------------------------------------- 1 | # WidgetAnimationFramework 2 | 3 | Small extension for animate Qt widgets. 4 | 5 | ### Side sliding animation 6 | 7 | `WAF::Animation::sideSlideIn(myCoolWidget, WAF::LeftSide);` 8 | 9 | ![Side sliding animation demonstration](http://dimkanovikov.pro/assets/images/dev/WAF-demo1.gif) 10 | 11 | ### Sliding animation 12 | 13 | `WAF::Animation::slideIn(myCoolWidget, WAF::FromTopToBottom);` 14 | 15 | ![Sliding animation demonstration](http://dimkanovikov.pro/assets/images/dev/WAF-demo2.gif) 16 | 17 | ### Notify example 18 | 19 | Implemented in demo project. 20 | 21 | ![Sliding notifications](http://dimkanovikov.pro/assets/images/dev/WAF-demo3.gif) 22 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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/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/FlatTabWidget/3rdparty/WAF.h: -------------------------------------------------------------------------------- 1 | #ifndef WAF_H 2 | #define WAF_H 3 | 4 | 5 | /** 6 | * Widgets Animation Framework 7 | */ 8 | namespace WAF 9 | { 10 | /** 11 | * @brief Края приложения 12 | */ 13 | enum ApplicationSide { 14 | LeftSide, 15 | TopSide, 16 | RightSide, 17 | BottomSide 18 | }; 19 | 20 | /** 21 | * @brief Направление анимации 22 | */ 23 | enum AnimationDirection { 24 | Undefined, 25 | FromLeftToRight, 26 | FromTopToBottom, 27 | FromRightToLeft, 28 | FromBottomToTop 29 | }; 30 | } 31 | 32 | #endif // WAF_H 33 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /dialog/FlatTabWidget/README.md: -------------------------------------------------------------------------------- 1 | # Readme 2 | 3 | Visit the project page for further information: 4 | 5 | > Written by Tim Schneeberger, licensed under GPLv3 6 | 7 | __________________________________________________ 8 | 9 | Check my other Qt widgets/addons out: 10 | 11 | -------------------------------------------------------------------------------- /dialog/FlatTabWidget/clickablelabel.cpp: -------------------------------------------------------------------------------- 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 | #include "clickablelabel.h" 17 | 18 | ClickableLabel::ClickableLabel(QWidget* parent) 19 | : QLabel(parent) { 20 | 21 | } 22 | 23 | ClickableLabel::~ClickableLabel() {} 24 | 25 | void ClickableLabel::mousePressEvent(QMouseEvent* event) { 26 | Q_UNUSED(event); 27 | emit clicked(); 28 | } 29 | 30 | void ClickableLabel::setColor(QColor color){ 31 | mColor = color; 32 | setStyleSheet(QString("color: %1;").arg(color.name())); 33 | } 34 | 35 | QColor ClickableLabel::color() const 36 | { 37 | return mColor; 38 | } 39 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /dialog/FlatTabWidget/customtabbar.cpp: -------------------------------------------------------------------------------- 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 | #include "customtabbar.h" 17 | 18 | CustomTabBar::CustomTabBar(QWidget *parent) 19 | : QWidget(parent) 20 | { 21 | } 22 | 23 | void CustomTabBar::wheelEvent(QWheelEvent *event) 24 | { 25 | if(event->delta() > 5) 26 | emit scrolledUp(); 27 | else if(event->delta() < -5) 28 | emit scrolledDown(); 29 | } 30 | -------------------------------------------------------------------------------- /dialog/FlatTabWidget/customtabbar.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 CUSTOMTABBAR_H 17 | #define CUSTOMTABBAR_H 18 | 19 | #include 20 | #include 21 | #include 22 | /*! 23 | \class CustomTabBar 24 | 25 | \brief The CustomTabBar class provides a tabbar overlay widget with scrolling capabilities 26 | */ 27 | class CustomTabBar : public QWidget 28 | { 29 | Q_OBJECT 30 | public: 31 | CustomTabBar(QWidget* parent = Q_NULLPTR); 32 | void wheelEvent(QWheelEvent *event) override; 33 | signals: 34 | /*! 35 | \brief User has scrolled up 36 | */ 37 | void scrolledUp(); 38 | /*! 39 | \brief User has scrolled down 40 | */ 41 | void scrolledDown(); 42 | }; 43 | 44 | #endif // CUSTOMTABBAR_H 45 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /dialog/androidimporterdlg.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 IMPORTANDROID_H 16 | #define IMPORTANDROID_H 17 | 18 | #include 19 | 20 | namespace Ui { 21 | class importandroid; 22 | } 23 | 24 | class AndroidImporterDlg : public QDialog 25 | { 26 | Q_OBJECT 27 | 28 | public: 29 | explicit AndroidImporterDlg(QString confpath, QWidget *parent = nullptr); 30 | ~AndroidImporterDlg(); 31 | private slots: 32 | void import(); 33 | signals: 34 | void importFinished(); 35 | private: 36 | Ui::importandroid *ui; 37 | QString m_confpath; 38 | QString pathAppend(const QString& path1, const QString& path2); 39 | }; 40 | 41 | #endif // IMPORTANDROID_H 42 | -------------------------------------------------------------------------------- /dialog/animatedvipericon.cpp: -------------------------------------------------------------------------------- 1 | #include "animatedvipericon.h" 2 | 3 | AnimatedViperIcon::AnimatedViperIcon(QWidget *parent) 4 | : QWidget(parent) 5 | { 6 | svgItem->setGeometry(0,0,64,64); 7 | svgItemU->setGeometry(0,0,64,64); 8 | svgItemL->setGeometry(0,0,64,64); 9 | this->setGeometry(0,0,64,64); 10 | this->setFixedSize(64,64); 11 | 12 | svgItemU->hide(); 13 | svgItemL->hide(); 14 | 15 | group = new QParallelAnimationGroup(this); 16 | QPropertyAnimation *upper = new QPropertyAnimation(svgItemU, "geometry"); 17 | upper->setDuration(1000); 18 | upper->setEasingCurve(QEasingCurve::Type::OutExpo); 19 | upper->setStartValue(QRect(0, -64, 64, 64)); 20 | upper->setEndValue(QRect(0, 0, 64, 64)); 21 | group->addAnimation(upper); 22 | QPropertyAnimation *lower = new QPropertyAnimation(svgItemL, "geometry"); 23 | lower->setDuration(1000); 24 | lower->setEasingCurve(QEasingCurve::Type::OutExpo); 25 | lower->setStartValue(QRect(0, 128, 64, 64)); 26 | lower->setEndValue(QRect(0, 0, 64, 64)); 27 | group->addAnimation(lower); 28 | } 29 | 30 | AnimatedViperIcon::~AnimatedViperIcon() 31 | { 32 | delete svgItem; 33 | delete svgItemU; 34 | delete svgItemL; 35 | } 36 | 37 | void AnimatedViperIcon::startAnimation() 38 | { 39 | if(group->state() == QAbstractAnimation::Running) 40 | group->stop(); 41 | group->start(); 42 | svgItemU->show(); 43 | svgItemL->show(); 44 | } 45 | 46 | -------------------------------------------------------------------------------- /dialog/animatedvipericon.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class AnimatedViperIcon : public QWidget 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | AnimatedViperIcon(QWidget *parent = nullptr); 14 | ~AnimatedViperIcon(); 15 | void startAnimation(); 16 | private: 17 | QSvgWidget* svgItem = new QSvgWidget(":/icons/parts/viper.svg",this); 18 | QSvgWidget* svgItemU = new QSvgWidget(":/icons/parts/upper.svg",this); 19 | QSvgWidget* svgItemL = new QSvgWidget(":/icons/parts/lower.svg",this); 20 | QParallelAnimationGroup *group; 21 | }; 22 | #endif // WIDGET_H 23 | -------------------------------------------------------------------------------- /dialog/convolverdlg.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 CONVOLVER_H 16 | #define CONVOLVER_H 17 | 18 | #include 19 | class ViperWindow; 20 | 21 | namespace Ui { 22 | class Convolver; 23 | } 24 | 25 | class ConvolverDlg : public QDialog 26 | { 27 | Q_OBJECT 28 | 29 | public: 30 | explicit ConvolverDlg(ViperWindow* mainwin,QWidget *parent = nullptr); 31 | ~ConvolverDlg(); 32 | private slots: 33 | void reject(); 34 | void reload(); 35 | void reloadFav(); 36 | void addFav(); 37 | void renameFav(); 38 | void removeFav(); 39 | void closeWindow(); 40 | void updateIR(); 41 | void updateIR_Fav(); 42 | void selectFolder(); 43 | signals: 44 | void closePressed(); 45 | private: 46 | Ui::Convolver *ui; 47 | ViperWindow* m_mainwin; 48 | QString configpath = ""; 49 | }; 50 | 51 | #endif // CONVOLVER_H 52 | -------------------------------------------------------------------------------- /dialog/firstlaunchwizard.h: -------------------------------------------------------------------------------- 1 | #ifndef FIRSTLAUNCHWIZARD_H 2 | #define FIRSTLAUNCHWIZARD_H 3 | 4 | #include 5 | #include "config/appconfigwrapper.h" 6 | 7 | class ViperWindow; 8 | 9 | namespace Ui { 10 | class FirstLaunchWizard; 11 | } 12 | 13 | class FirstLaunchWizard : public QWidget 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit FirstLaunchWizard(AppConfigWrapper* _appconf, ViperWindow*,QWidget *parent = nullptr); 19 | ~FirstLaunchWizard(); 20 | 21 | signals: 22 | void wizardFinished(); 23 | 24 | private: 25 | Ui::FirstLaunchWizard *ui; 26 | AppConfigWrapper* appconf; 27 | bool lockslot = false; 28 | 29 | void refreshDevices(); 30 | }; 31 | 32 | #endif // FIRSTLAUNCHWIZARD_H 33 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /dialog/logdlg.cpp: -------------------------------------------------------------------------------- 1 | #include "logdlg.h" 2 | #include "ui_log.h" 3 | 4 | #include 5 | #include 6 | 7 | LogDlg::LogDlg(QWidget *parent) : 8 | QDialog(parent), 9 | ui(new Ui::log) 10 | { 11 | ui->setupUi(this); 12 | connect(ui->reload, SIGNAL(clicked()), this, SLOT(updateLog())); 13 | connect(ui->select, SIGNAL(currentIndexChanged(int)),this,SLOT(updateLog())); 14 | 15 | #ifdef VIPER_PLUGINMODE 16 | ui->select->hide(); 17 | #endif 18 | 19 | updateLog(); 20 | } 21 | 22 | LogDlg::~LogDlg() 23 | { 24 | delete ui; 25 | } 26 | void LogDlg::reject() 27 | { 28 | QDialog::reject(); 29 | } 30 | void LogDlg::updateLog(){ 31 | ui->viperlog->clear(); 32 | QString path; 33 | 34 | #ifndef VIPER_PLUGINMODE 35 | if(ui->select->currentIndex() == 0) path = "/tmp/viper4linux/viper.log"; 36 | else path = "/tmp/viper4linux/ui.log"; 37 | #else 38 | path = "/tmp/gsteffectmanager/viper_ui.log"; 39 | #endif 40 | 41 | QFile file(path); 42 | if(!file.open(QIODevice::ReadOnly)) { 43 | ui->viperlog->append(tr("").arg(path)); 44 | } 45 | 46 | QTextStream in(&file); 47 | while(!in.atEnd()) { 48 | QString line = in.readLine(); 49 | ui->viperlog->append(line); 50 | } 51 | 52 | file.close(); 53 | } 54 | -------------------------------------------------------------------------------- /dialog/logdlg.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 LOG_H 16 | #define LOG_H 17 | 18 | #include 19 | 20 | namespace Ui { 21 | class log; 22 | } 23 | 24 | class LogDlg : public QDialog 25 | { 26 | Q_OBJECT 27 | 28 | public: 29 | explicit LogDlg(QWidget *parent = nullptr); 30 | ~LogDlg(); 31 | public slots: 32 | void updateLog(); 33 | private slots: 34 | void reject(); 35 | private: 36 | Ui::log *ui; 37 | }; 38 | 39 | #endif // LOG_H 40 | -------------------------------------------------------------------------------- /dialog/palettedlg.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 PALETTE_H 16 | #define PALETTE_H 17 | 18 | #include 19 | 20 | namespace Ui { 21 | class palette; 22 | } 23 | 24 | class AppConfigWrapper; 25 | 26 | class PaletteEditor : public QDialog 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit PaletteEditor(AppConfigWrapper *_appconf, QWidget *parent = nullptr); 32 | ~PaletteEditor(); 33 | 34 | private: 35 | Ui::palette *ui; 36 | AppConfigWrapper *appconf; 37 | private slots: 38 | int loadColor(int index,int rgb_index); 39 | void closeWin(); 40 | void Reset(); 41 | void updateBase(); 42 | void updateBack(); 43 | void updateFore(); 44 | void updateIcons(); 45 | void updateSelection(); 46 | void updateDisabled(); 47 | void saveColor(int index,const QColor& color); 48 | }; 49 | 50 | #endif // PALETTE_H 51 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/qmenueditor.h: -------------------------------------------------------------------------------- 1 | #ifndef MENUEDITOR_H 2 | #define MENUEDITOR_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace Ui { 9 | class menueditor; 10 | } 11 | 12 | class QMenuEditor : public QWidget 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit QMenuEditor(QWidget *parent = nullptr); 18 | ~QMenuEditor(); 19 | 20 | void setSourceMenu(QMenu *source); 21 | void setTargetMenu(QMenu *target); 22 | QMenu *exportMenu(); 23 | void setIconStyle(bool white); 24 | signals: 25 | void targetChanged(); 26 | void resetPressed(); 27 | private: 28 | Ui::menueditor *ui; 29 | QList mTarget; 30 | QList mSource; 31 | 32 | bool insertAction(QAction *new_action); 33 | void populateList(QList menu, QListWidget *list); 34 | }; 35 | 36 | #endif // MENUEDITOR_H 37 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /dialog/qmessageoverlay.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 QLIGHTBOXWIDGET_H 16 | #define QLIGHTBOXWIDGET_H 17 | 18 | #include 19 | 20 | class QMessageOverlay : public QWidget 21 | { 22 | Q_OBJECT 23 | 24 | public: 25 | explicit QMessageOverlay(QWidget* _parent, bool _folowToHeadWidget = false); 26 | 27 | protected: 28 | bool eventFilter(QObject* _object, QEvent* _event); 29 | void paintEvent(QPaintEvent* _event); 30 | void showEvent(QShowEvent* _event); 31 | 32 | private: 33 | void updateSelf(); 34 | bool m_isInUpdateSelf; 35 | QPixmap grabParentWidgetPixmap() const; 36 | QPixmap m_parentWidgetPixmap; 37 | }; 38 | 39 | #endif // QLIGHTBOXWIDGET_H 40 | -------------------------------------------------------------------------------- /dialog/settingsdlg.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 SETTINGS_H 16 | #define SETTINGS_H 17 | 18 | #include 19 | 20 | class ViperWindow; 21 | class AppConfigWrapper; 22 | 23 | namespace Ui { 24 | class settings; 25 | } 26 | 27 | class SettingsDlg : public QDialog 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | SettingsDlg(ViperWindow* mainwin, QWidget *parent = nullptr); 33 | Ui::settings *ui; 34 | ~SettingsDlg(); 35 | void updateInputSinks(); 36 | void refreshDevices(); 37 | void setVisible(bool visible) override; 38 | void refreshAll(); 39 | public slots: 40 | void updateButtonStyle(bool white); 41 | signals: 42 | void closeClicked(); 43 | private: 44 | AppConfigWrapper* appconf; 45 | ViperWindow* m_mainwin; 46 | }; 47 | 48 | #endif // SETTINGS_H 49 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /dialog/statusfragment.cpp: -------------------------------------------------------------------------------- 1 | #include "statusfragment.h" 2 | #include "ui_statusfragment.h" 3 | 4 | #include 5 | #include 6 | 7 | StatusDialog::StatusDialog(DBusProxy* dbus, QWidget *parent) : 8 | QDialog(parent), 9 | ui(new Ui::StatusDialog) 10 | { 11 | ui->setupUi(this); 12 | if(!dbus->isValid()){ 13 | emit closePressed(); 14 | return; 15 | } 16 | ui->gst_plugin_ver->setText(dbus->GetVersion()); 17 | 18 | uint versiondata_core = dbus->GetDriverStatus(DBusProxy::PARAM_GET_DRIVER_VERSION); 19 | QString versionhex_core = QString("%1").arg(versiondata_core, 0, 16); 20 | QString versionfinal_core(""); 21 | int count = 0; 22 | for(auto c:versionhex_core){ 23 | if((count%2)!=0)versionfinal_core += '.'; 24 | else versionfinal_core += c; 25 | count++; 26 | } 27 | ui->core_ver->setText(versionfinal_core); 28 | 29 | int proc = dbus->GetDriverStatus(DBusProxy::PARAM_GET_DRVCANWORK); 30 | ui->proc->setText(proc ? tr("Processing") : tr("Not processing")); 31 | int enab = dbus->GetDriverStatus(DBusProxy::PARAM_GET_ENABLED); 32 | ui->enabled->setText(enab ? tr("Enabled") : tr("Disabled")); 33 | 34 | int samplerate = dbus->GetDriverStatus(DBusProxy::PARAM_GET_SAMPLINGRATE); 35 | ui->samplerate->setText(QString::number(samplerate)); 36 | 37 | connect(ui->buttonBox,&QDialogButtonBox::rejected,this,&StatusDialog::closePressed); 38 | 39 | } 40 | 41 | StatusDialog::~StatusDialog() 42 | { 43 | delete ui; 44 | } 45 | -------------------------------------------------------------------------------- /dialog/statusfragment.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 STATUSDIALOG_H 16 | #define STATUSDIALOG_H 17 | #include "config/dbusproxy.h" 18 | 19 | #include 20 | 21 | namespace Ui { 22 | class StatusDialog; 23 | } 24 | 25 | class StatusDialog : public QDialog 26 | { 27 | Q_OBJECT 28 | 29 | public: 30 | explicit StatusDialog(DBusProxy* dbus, QWidget *parent = nullptr); 31 | ~StatusDialog(); 32 | signals: 33 | void closePressed(); 34 | 35 | private: 36 | Ui::StatusDialog *ui; 37 | }; 38 | 39 | #endif // STATUSDIALOG_H 40 | -------------------------------------------------------------------------------- /icons/arrow-down-white.svg: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /icons/arrow-down.svg: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /icons/arrow-left-double-white.svg: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /icons/arrow-left-double.svg: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /icons/arrow-right-double-white.svg: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /icons/arrow-right-double.svg: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /icons/arrow-up-white.svg: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /icons/arrow-up.svg: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /icons/edit-undo-white.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /icons/edit-undo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /icons/error.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/menu-white.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /icons/menu.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/queue-white.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /icons/queue.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/settings-white.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /icons/settings.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/viper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Audio4Linux/Viper4Linux-GUI/dbbc95a98682aabc7be7f736e2f2150c33a66a48/icons/viper.png -------------------------------------------------------------------------------- /misc/GstRegistryHelper.h: -------------------------------------------------------------------------------- 1 | #ifndef GSTREGISTRYHELPER_H 2 | #define GSTREGISTRYHELPER_H 3 | #include 4 | #include 5 | 6 | class GstRegistryHelper 7 | { 8 | public: 9 | static const char* GetPluginPath(){ 10 | GstPlugin* plg = gst_registry_find_plugin (gst_registry_get(), "viperfx"); 11 | return gst_plugin_get_filename (plg); 12 | } 13 | 14 | static const char* GetPluginVersion(){ 15 | GstPlugin* plg = gst_registry_find_plugin (gst_registry_get(), "viperfx"); 16 | return (gst_plugin_get_version(plg)); 17 | } 18 | 19 | static bool IsPluginInstalled(){ 20 | return gst_registry_check_feature_version 21 | (gst_registry_get(), "viperfx", 1, 0, 0);; 22 | } 23 | 24 | static bool HasDBusSupport(){ 25 | return gst_registry_check_feature_version 26 | (gst_registry_get(), "viperfx", 2, 0, 0); 27 | } 28 | 29 | }; 30 | 31 | #endif // GSTREGISTRYHELPER_H 32 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /misc/autostartmanager.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 AUTOSTARTMANAGER_H 16 | #define AUTOSTARTMANAGER_H 17 | 18 | #include 19 | 20 | class AutostartManager 21 | { 22 | public: 23 | typedef enum InspectionMode{ 24 | UsesViperAutostart, 25 | Exists, 26 | Delayed, 27 | }InspectionMode; 28 | AutostartManager(); 29 | static void saveDesktopFile(QString path, const QString& exepath, bool enableAutostartViper, bool delayed); 30 | static bool inspectDesktopFile(const QString& path, InspectionMode mode); 31 | static QString getAutostartPath(const QString& filename); 32 | }; 33 | 34 | #endif // AUTOSTARTMANAGER_H 35 | -------------------------------------------------------------------------------- /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/converter.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 CONVERTER_H 16 | #define CONVERTER_H 17 | #include 18 | #include 19 | typedef struct conversion_result_s{ 20 | QString configuration; 21 | QString notices; 22 | bool error; 23 | bool found_ddc; 24 | bool found_irs; 25 | bool found_spkopt; 26 | }conversion_result_t; 27 | class converter 28 | { 29 | public: 30 | enum configtype{ 31 | officialV4A, 32 | teamDeWittV4A 33 | }; 34 | static conversion_result_t toLinux(const QString&,configtype); 35 | static conversion_result_t toAndroid(const QString&,configtype); 36 | private: 37 | static QString boolToQString(bool b); 38 | static QDomElement generateXmlEntry(QDomDocument*,const QString& type,const QString& name,const QString& value); 39 | }; 40 | 41 | #endif // CONVERTER_H 42 | -------------------------------------------------------------------------------- /misc/eventfilter.h: -------------------------------------------------------------------------------- 1 | #ifndef EVENTFILTER_H 2 | #define EVENTFILTER_H 3 | #include 4 | #include 5 | class KeyboardFilter : public QObject 6 | { 7 | Q_OBJECT 8 | public: 9 | bool eventFilter(QObject *object, QEvent *event) 10 | { 11 | Q_UNUSED(object) 12 | return event->type() == QEvent::KeyPress; 13 | } 14 | }; 15 | 16 | #endif // EVENTFILTER_H 17 | -------------------------------------------------------------------------------- /misc/initializableqmap.h: -------------------------------------------------------------------------------- 1 | #ifndef INITIALIZABLEQMAP_H 2 | #define INITIALIZABLEQMAP_H 3 | #include 4 | 5 | template class InitializableQMap : public QMap 6 | { 7 | public: 8 | inline InitializableQMap &operator<< (const QPair &t) 9 | { this->insert(t.first,t.second); return *this; } 10 | }; 11 | 12 | #endif // INITIALIZABLEQMAP_H 13 | -------------------------------------------------------------------------------- /misc/loghelper.cpp: -------------------------------------------------------------------------------- 1 | #include "loghelper.h" 2 | 3 | void LogHelper::writeLog(const QString& log,int mode){ 4 | //Mode: 0-Log+Stdout 1-Log 2-Stdout 5 | QString path; 6 | 7 | #ifndef VIPER_PLUGINMODE 8 | path = "/tmp/viper4linux/ui.log"; 9 | #else 10 | path = "/tmp/gsteffectmanager/viper_ui.log"; 11 | #endif 12 | 13 | QFile f(path); 14 | QString o = "[" + QTime::currentTime().toString() + "] " + log; 15 | 16 | if(mode==0||mode==1){ 17 | if (f.open(QIODevice::WriteOnly | QIODevice::Append)) { 18 | f.write(QString("%1\n").arg(o).toUtf8().constData()); 19 | } 20 | f.close(); 21 | } 22 | if(mode==0||mode==2) 23 | qDebug().noquote().nospace() << o.toUtf8().constData(); 24 | } 25 | void LogHelper::writeLogF(const QString& log,const QString& _path){ 26 | QFile f(_path); 27 | QString o = "[" + QTime::currentTime().toString() + "] " + log + "\n"; 28 | if (f.open(QIODevice::WriteOnly | QIODevice::Append)) { 29 | f.write(o.toUtf8().constData()); 30 | } 31 | f.close(); 32 | } 33 | void LogHelper::clearLog(){ 34 | QString path; 35 | 36 | #ifndef VIPER_PLUGINMODE 37 | path = "/tmp/viper4linux/ui.log"; 38 | #else 39 | path = "/tmp/gsteffectmanager/viper_ui.log"; 40 | #endif 41 | 42 | QFile file (path); 43 | if(file.exists()) 44 | file.remove(); 45 | } 46 | -------------------------------------------------------------------------------- /misc/loghelper.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 LOGHELPER_H 16 | #define LOGHELPER_H 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | class LogHelper 23 | { 24 | public: 25 | static void writeLog(const QString& log,int mode = 0); 26 | static void writeLogF(const QString& log,const QString& _path); 27 | static void clearLog(); 28 | }; 29 | 30 | #endif // LOGHELPER_H 31 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /misc/overlaymsgproxy.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 OVERLAYMSGPROXY_H 16 | #define OVERLAYMSGPROXY_H 17 | 18 | #include 19 | #include 20 | 21 | class QMessageOverlay; 22 | 23 | class OverlayMsgProxy : public QObject 24 | { 25 | Q_OBJECT 26 | public: 27 | OverlayMsgProxy(QWidget* obj); 28 | void openBase( QString title, QString desc, QString icon = "", QString close = tr("Close"), QString color = "#d72828"); 29 | void openError(QString title, QString desc, QString close = tr("Close")); 30 | void openNormal(QString title, QString desc, QString color = "#d72828"); 31 | void hide(); 32 | signals: 33 | void buttonPressed(); 34 | void fadedOut(); 35 | private: 36 | QMessageOverlay *lightBox; 37 | QWidget* obj; 38 | }; 39 | 40 | #endif // OVERLAYMSGPROXY_H 41 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /phantom/phantom.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH += $$PWD 2 | 3 | HEADERS += \ 4 | $$PWD/phantomcolor.h \ 5 | $$PWD/phantomstyle.h \ 6 | $$PWD/phantomtweak.h 7 | 8 | SOURCES += \ 9 | $$PWD/phantomcolor.cpp \ 10 | $$PWD/phantomstyle.cpp 11 | -------------------------------------------------------------------------------- /phantom/phantomcolor.h: -------------------------------------------------------------------------------- 1 | #ifndef PHANTOMCOLOR_H 2 | #define PHANTOMCOLOR_H 3 | #include 4 | 5 | namespace Phantom { 6 | struct Rgb; 7 | struct Hsl; 8 | 9 | // A color presumed to be in linear space, represented as RGB. Values are in 10 | // the range 0.0 - 1.0. Conversions to and from QColor will assume the QColor 11 | // is in sRGB space, and sRGB conversion will be performed. 12 | struct Rgb { 13 | qreal r, g, b; 14 | Rgb() {} 15 | Rgb(qreal r, qreal g, qreal b) : r(r), g(g), b(b) {} 16 | 17 | inline Hsl toHsl() const; 18 | inline QColor toQColor() const; 19 | static inline Rgb ofHsl(const Hsl&); 20 | static inline Rgb ofQColor(const QColor&); 21 | 22 | static Rgb lerp(const Rgb& x, const Rgb& y, qreal a); 23 | }; 24 | 25 | // A color represented as pseudo-CIE hue, saturation, and lightness. Hue is in 26 | // the range 0.0 - 360.0 (degrees). Lightness and saturation are in the range 27 | // 0.0 - 1.0. Using this and making adjustments to the L value will produce 28 | // more consistent and predictable results than QColor's .darker()/.lighter(). 29 | // Note that this is not strictly CIE -- some of the colorspace is distorted so 30 | // that it can represented as a continuous coordinate space. Therefore not all 31 | // adjustments to the parameters will produce perfectly linear results with 32 | // regards to saturation and lightness. But it's still useful, and better than 33 | // QColor's .darker()/.lighter(). Additionally, the L value is more useful for 34 | // performing comparisons between two colors to measure relative and absolute 35 | // brightness. 36 | // 37 | // See the documentation for the hsluv library for more information. (Note that 38 | // for consistency we treat the S and L values in the range 0.0 - 1.0 instead 39 | // of 0.0 - 100.0 like hsluv-c on its own does.) 40 | struct Hsl { 41 | qreal h, s, l; 42 | Hsl() {} 43 | Hsl(qreal h, qreal s, qreal l) : h(h), s(s), l(l) {} 44 | 45 | inline Rgb toRgb() const; 46 | inline QColor toQColor() const; 47 | static inline Hsl ofRgb(const Rgb&); 48 | static inline Hsl ofQColor(const QColor&); 49 | }; 50 | Rgb rgb_of_qcolor(const QColor& color); 51 | QColor qcolor_of_rgb(qreal r, qreal g, qreal b); 52 | Hsl hsl_of_rgb(qreal r, qreal g, qreal b); 53 | Rgb rgb_of_hsl(qreal h, qreal s, qreal l); 54 | // Clip a floating point value to the range 0.0 - 1.0. 55 | inline qreal saturate(qreal x) { 56 | if (x < 0.0) 57 | return 0.0; 58 | if (x > 1.0) 59 | return 1.0; 60 | return x; 61 | } 62 | inline qreal lerp(qreal x, qreal y, qreal a) { return (1.0 - a) * x + a * y; } 63 | // Linearly interpolate two QColors after trasnforming them to linear color 64 | // space, treating the QColor values as if they were in sRGB space. The 65 | // returned QColor is converted back to sRGB space. 66 | QColor lerpQColor(const QColor& x, const QColor& y, qreal a); 67 | 68 | Hsl Rgb::toHsl() const { return hsl_of_rgb(r, g, b); } 69 | QColor Rgb::toQColor() const { return qcolor_of_rgb(r, g, b); } 70 | Rgb Rgb::ofHsl(const Hsl& hsl) { return rgb_of_hsl(hsl.h, hsl.s, hsl.l); } 71 | Rgb Rgb::ofQColor(const QColor& color) { return rgb_of_qcolor(color); } 72 | Rgb Hsl::toRgb() const { return rgb_of_hsl(h, s, l); } 73 | QColor Hsl::toQColor() const { 74 | Rgb rgb = rgb_of_hsl(h, s, l); 75 | return qcolor_of_rgb(rgb.r, rgb.g, rgb.b); 76 | } 77 | Hsl Hsl::ofRgb(const Rgb& rgb) { return hsl_of_rgb(rgb.r, rgb.g, rgb.b); } 78 | Hsl Hsl::ofQColor(const QColor& color) { 79 | Rgb rgb = rgb_of_qcolor(color); 80 | return hsl_of_rgb(rgb.r, rgb.g, rgb.b); 81 | } 82 | } // namespace Phantom 83 | #endif 84 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /phantom/phantomtweak.h: -------------------------------------------------------------------------------- 1 | #ifndef PHANTOMTWEAK_H 2 | #define PHANTOMTWEAK_H 3 | 4 | // Phantom-specific tweaks that can be applied to QWidgets. These should not 5 | // impact the functionality of the software, but may provide minor visual 6 | // improvements in the case that Phantom is being used as the QStyle. 7 | 8 | namespace Phantom { 9 | namespace Tweak { 10 | 11 | // "_phantom_menubar_no_ruler" 12 | // 13 | // myMenuBar->setProperty(Phantom::Tweak::menubar_no_ruler, true); 14 | // 15 | // Causes a QMenuBar to not have the horizontal divider line to be drawn 16 | // beneath it. Useful for windows where the main content widget spans the full 17 | // width of the window, and it is already visually apparent where the menu bar 18 | // ends on the Y axis and the widgets begin. 19 | // 20 | // The constant C string is provided for convenience, but you may also just use 21 | // a string literal in your own code, if you prefer. 22 | extern const char* const menubar_no_ruler; 23 | 24 | } // namespace Tweak 25 | } // namespace Phantom 26 | #endif 27 | -------------------------------------------------------------------------------- /screenshots/eq.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Audio4Linux/Viper4Linux-GUI/dbbc95a98682aabc7be7f736e2f2150c33a66a48/screenshots/eq.gif -------------------------------------------------------------------------------- /screenshots/mainwindow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Audio4Linux/Viper4Linux-GUI/dbbc95a98682aabc7be7f736e2f2150c33a66a48/screenshots/mainwindow.gif -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /scripts/uninstall-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 | printf "${RED}Please run as root${NC}\n" 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 | printf "Removing viper-gui from /usr/local/bin or /usr/bin...\n" 18 | rm /usr/bin/viper-gui 2> /dev/null #remove gui from oldpath if still existing there 19 | rm /usr/local/bin/viper-gui 2> /dev/null 20 | 21 | printf "Removing desktop entry and icon...\n" 22 | rm /usr/share/pixmaps/viper-gui.png 23 | rm /usr/share/applications/viper-gui.desktop 24 | 25 | printf "${GREEN}Done!${NC}\n" 26 | -------------------------------------------------------------------------------- /styles/aqua/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Jaime Quiroga 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /styles/default.qss: -------------------------------------------------------------------------------- 1 | QFrame[frameShape="4"], 2 | QFrame[frameShape="5"]{ 3 | color: lightgray; 4 | } 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /styles/ubuntu/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Jaime Quiroga 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /styles/v4l_frontend_styles.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | aqua/aqua.qss 9 | 10 | 11 | 12 | ubuntu/ubuntu.qss 13 | 14 | 15 | default.qss 16 | overlay.qss 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /translations/lang_de.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Audio4Linux/Viper4Linux-GUI/dbbc95a98682aabc7be7f736e2f2150c33a66a48/translations/lang_de.qm -------------------------------------------------------------------------------- /translations/lang_en.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Audio4Linux/Viper4Linux-GUI/dbbc95a98682aabc7be7f736e2f2150c33a66a48/translations/lang_en.qm -------------------------------------------------------------------------------- /translations/lang_pt_BR.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Audio4Linux/Viper4Linux-GUI/dbbc95a98682aabc7be7f736e2f2150c33a66a48/translations/lang_pt_BR.qm -------------------------------------------------------------------------------- /translations/lang_zh_CN.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Audio4Linux/Viper4Linux-GUI/dbbc95a98682aabc7be7f736e2f2150c33a66a48/translations/lang_zh_CN.qm -------------------------------------------------------------------------------- /translations/lang_zh_HK.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Audio4Linux/Viper4Linux-GUI/dbbc95a98682aabc7be7f736e2f2150c33a66a48/translations/lang_zh_HK.qm -------------------------------------------------------------------------------- /v4l_frontend_resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | icons/menu.svg 4 | icons/menu-white.svg 5 | icons/queue.svg 6 | icons/queue-white.svg 7 | icons/settings.svg 8 | icons/settings-white.svg 9 | icons/viper.png 10 | icons/parts/lower.svg 11 | icons/parts/upper.svg 12 | icons/parts/viper.svg 13 | icons/viper-new.svg 14 | icons/arrow-down-white.svg 15 | icons/arrow-down.svg 16 | icons/arrow-left-double-white.svg 17 | icons/arrow-left-double.svg 18 | icons/arrow-right-double-white.svg 19 | icons/arrow-right-double.svg 20 | icons/arrow-up-white.svg 21 | icons/arrow-up.svg 22 | icons/edit-undo-white.svg 23 | icons/edit-undo.svg 24 | viper.png 25 | icons/error.svg 26 | translations/lang_de.qm 27 | translations/lang_en.qm 28 | translations/lang_pt_BR.qm 29 | translations/lang_zh_CN.qm 30 | translations/lang_zh_HK.qm 31 | 32 | 33 | -------------------------------------------------------------------------------- /viper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Audio4Linux/Viper4Linux-GUI/dbbc95a98682aabc7be7f736e2f2150c33a66a48/viper.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /visualization/fftreal/FFTRealSelect.hpp: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | FFTRealSelect.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_FFTRealSelect_CURRENT_CODEHEADER) 19 | #error Recursive inclusion of FFTRealSelect code header. 20 | #endif 21 | #define ffft_FFTRealSelect_CURRENT_CODEHEADER 22 | 23 | #if ! defined (ffft_FFTRealSelect_CODEHEADER_INCLUDED) 24 | #define ffft_FFTRealSelect_CODEHEADER_INCLUDED 25 | 26 | 27 | 28 | namespace ffft 29 | { 30 | 31 | 32 | 33 | /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 34 | 35 | 36 | 37 | template 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /visualization/fftreal/def.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | def.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_def_HEADER_INCLUDED) 19 | #define ffft_def_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 | const double PI = 3.1415926535897932384626433832795; 38 | const double SQRT2 = 1.41421356237309514547462185873883; 39 | 40 | #if defined (_MSC_VER) 41 | 42 | #define ffft_FORCEINLINE __forceinline 43 | 44 | #else 45 | 46 | #define ffft_FORCEINLINE inline 47 | 48 | #endif 49 | 50 | 51 | 52 | } // namespace ffft 53 | 54 | 55 | 56 | #endif // ffft_def_HEADER_INCLUDED 57 | 58 | 59 | 60 | /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ 61 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------