Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New smoothing option for sound effects, fix ArchLinux installer, refactoring of the smoothing module and music effects #871

Merged
merged 2 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/push-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ jobs:
linuxVersion: Fedora_40
dockerName: Fedora 40 (x86_64)
platform: linux
#- dockerImage: x86_64
# linuxVersion: ArchLinux
# dockerName: Arch Linux (x86_64)
# platform: linux
- dockerImage: x86_64
linuxVersion: ArchLinux
dockerName: Arch Linux (x86_64)
platform: linux
steps:
# checkout
- uses: actions/checkout@v4
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/upload-to-github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ jobs:
dockerName: Debian (arm64)
arch: arm64
platform: rpi
#- dockerImage: x86_64
# linuxVersion: ArchLinux
# dockerName: Arch Linux (x86_64)
# arch: amd64
# platform: linux
# niceName: ""
- dockerImage: x86_64
linuxVersion: ArchLinux
dockerName: Arch Linux (x86_64)
arch: amd64
platform: linux
niceName: ""
- dockerImage: x86_64
linuxVersion: jammy
dockerName: Ubuntu 22.04 LTS (x86_64)
Expand Down
4 changes: 4 additions & 0 deletions cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,10 @@ macro(DeployUnix TARGET)
if (${_sysindex} GREATER -1)
list(APPEND DEPENDENCIES ${systraLib})
endif()
string(FIND ${systraLib} "libdbusmenu" _sysDBusindex)
if (${_sysDBusindex} GREATER -1)
list(APPEND DEPENDENCIES ${systraLib})
endif()
endforeach()


Expand Down
38 changes: 19 additions & 19 deletions cmake/arch/INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ post_install() {
BOOT_BERRYBOOT=$(grep -m1 -c '\(/var/media\|/media/pi\)/berryboot' /etc/mtab)

#get current system ip
NET_IP=`hostname -I | cut -d " " -f1`
NET_IP=`hostname -s | cut -d " " -f1`

# search for users in system, returns first entry
FOUND_USR=`who | grep -o -m1 '^\w*\b'` || "root"
Expand Down Expand Up @@ -95,7 +95,7 @@ post_install() {
ENABLE_XSYS=1
fi

install_file /usr/share/hyperhdr/service/hyperhdr.systemd /etc/systemd/system/[email protected]
install_file /usr/share/hyperhdr/service/hyperhdr.systemd /usr/lib/systemd/system/[email protected]

if [ $ENABLE_SERVICE -eq 1 ]; then
systemctl enable hyperhdr"@${FOUND_USR}".service
Expand Down Expand Up @@ -167,25 +167,25 @@ post_install() {

echo ${start_msg}

echo " +-----------------------------------------------------------------------+"
echo " | \033[32;1mHyperHDR has been installed/updated!\033[0m |"
echo " +-----------------------------------------------------------------------+"
printf " | For configuration, visit with your browser: \033[37;1m%13s:%s\033[0m |\n" "$NET_IP" "8090"
printf " | If already used by another service try: \033[37;1m%13s:%s\033[0m |\n" "$NET_IP" "8091"
printf " | Start the service: \033[37;1msudo systemctl start hyperhdr@%-12s\033[0m |\n" "$FOUND_USR"
printf " | Stop the service: \033[37;1msudo systemctl stop hyperhdr@%-12s\033[0m |\n" "$FOUND_USR"
echo " | Troubleshooting? Run HyperHDR manually: \033[37;1m/usr/bin/hyperhdr\033[0m |"
echo " +-----------------------------------------------------------------------+"
printf "\n +-----------------------------------------------------------------------+"
printf "\n | \033[32;1mHyperHDR has been installed/updated!\033[0m |"
printf "\n +-----------------------------------------------------------------------+"
printf "\n | For configuration, visit with your browser: \033[37;1m%13s:%s\033[0m |" "$NET_IP" "8090"
printf "\n | If already used by another service try: \033[37;1m%13s:%s\033[0m |" "$NET_IP" "8091"
printf "\n | Start the service: \033[37;1msudo systemctl start hyperhdr@%-12s\033[0m |" "$FOUND_USR"
printf "\n | Stop the service: \033[37;1msudo systemctl stop hyperhdr@%-12s\033[0m |" "$FOUND_USR"
printf "\n | Troubleshooting? Run HyperHDR manually: \033[37;1m/usr/bin/hyperhdr\033[0m |"
printf "\n +-----------------------------------------------------------------------+"
case "$STARTUP_MSG" in
*"HyperHDR is installed as a service"*)
printf " | \033[32;1m%-67s\033[0m |\n" "$STARTUP_MSG";;
*) printf " | \033[31;1m%-67s\033[0m |\n" "$STARTUP_MSG"
printf "\n | \033[32;1m%-67s\033[0m |" "$STARTUP_MSG";;
*) printf "\n | \033[31;1m%-67s\033[0m |" "$STARTUP_MSG"
esac
[ -z "$REBOOTMESSAGE" ] || printf " | \033[31;1m%-67s\033[0m |\n" "$REBOOTMESSAGE"
echo " +-----------------------------------------------------------------------+"
echo " | Webpage: \033[36;1mhttps://hyperhdr.eu\033[0m |"
echo " | GitHub: \033[36;1mhttps://github.com/awawa-dev/HyperHDR\033[0m |"
echo " +-----------------------------------------------------------------------+"
[ -z "$REBOOTMESSAGE" ] || printf "\n | \033[31;1m%-67s\033[0m |" "$REBOOTMESSAGE"
printf "\n +-----------------------------------------------------------------------+"
printf "\n | Webpage: \033[36;1mhttps://hyperhdr.eu\033[0m |"
printf "\n | GitHub: \033[36;1mhttps://github.com/awawa-dev/HyperHDR\033[0m |"
printf "\n +-----------------------------------------------------------------------+\n"

update-desktop-database -q
}
Expand Down Expand Up @@ -217,7 +217,7 @@ pre_remove() {
echo "Disabling service and removing entry"
systemctl -q disable hyperhdr"@${FOUND_USR}"

rm -v /etc/systemd/system/[email protected] 2>/dev/null
rm -v /usr/lib/systemd/system/[email protected] 2>/dev/null

elif [ -e /usr/bin/initctl ]
then
Expand Down
1 change: 1 addition & 0 deletions cmake/arch/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ optdepends=('shared-mime-info' 'gtk3')
# md5sums=('SKIP')

build() {
export LDFLAGS=${LDFLAGS/-Wl,-z,pack-relative-relocs/}
cmake -B build -S .. \
-DCMAKE_BUILD_TYPE='None' \
-DCMAKE_INSTALL_PREFIX='/usr' \
Expand Down
32 changes: 16 additions & 16 deletions cmake/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -133,24 +133,24 @@ fi

echo ${start_msg}

echo "\n +-----------------------------------------------------------------------+"
echo " | \033[32;1mHyperHDR has been installed/updated!\033[0m |"
echo " +-----------------------------------------------------------------------+"
printf " | For configuration, visit with your browser: \033[37;1m%13s:%s\033[0m |\n" "$NET_IP" "8090"
printf " | If already used by another service try: \033[37;1m%13s:%s\033[0m |\n" "$NET_IP" "8091"
printf " | Start the service: \033[37;1msudo systemctl start hyperhdr@%-12s\033[0m |\n" "$FOUND_USR"
printf " | Stop the service: \033[37;1msudo systemctl stop hyperhdr@%-12s\033[0m |\n" "$FOUND_USR"
echo " | Troubleshooting? Run HyperHDR manually: \033[37;1m/usr/bin/hyperhdr\033[0m |"
echo " +-----------------------------------------------------------------------+"
printf "\n +-----------------------------------------------------------------------+"
printf "\n | \033[32;1mHyperHDR has been installed/updated!\033[0m |"
printf "\n +-----------------------------------------------------------------------+"
printf "\n | For configuration, visit with your browser: \033[37;1m%13s:%s\033[0m |" "$NET_IP" "8090"
printf "\n | If already used by another service try: \033[37;1m%13s:%s\033[0m |" "$NET_IP" "8091"
printf "\n | Start the service: \033[37;1msudo systemctl start hyperhdr@%-12s\033[0m |" "$FOUND_USR"
printf "\n | Stop the service: \033[37;1msudo systemctl stop hyperhdr@%-12s\033[0m |" "$FOUND_USR"
printf "\n | Troubleshooting? Run HyperHDR manually: \033[37;1m/usr/bin/hyperhdr\033[0m |"
printf "\n +-----------------------------------------------------------------------+"
case "$STARTUP_MSG" in
*"HyperHDR is installed as a service"*)
printf " | \033[32;1m%-67s\033[0m |\n" "$STARTUP_MSG";;
*) printf " | \033[31;1m%-67s\033[0m |\n" "$STARTUP_MSG"
printf "\n | \033[32;1m%-67s\033[0m |" "$STARTUP_MSG";;
*) printf "\n | \033[31;1m%-67s\033[0m |" "$STARTUP_MSG"
esac
[ -z "$REBOOTMESSAGE" ] || printf " | \033[31;1m%-67s\033[0m |\n" "$REBOOTMESSAGE"
echo " +-----------------------------------------------------------------------+"
echo " | Webpage: \033[36;1mhttps://hyperhdr.eu\033[0m |"
echo " | GitHub: \033[36;1mhttps://github.com/awawa-dev/HyperHDR\033[0m |"
echo " +-----------------------------------------------------------------------+\n"
[ -z "$REBOOTMESSAGE" ] || printf "\n | \033[31;1m%-67s\033[0m |" "$REBOOTMESSAGE"
printf "\n +-----------------------------------------------------------------------+"
printf "\n | Webpage: \033[36;1mhttps://hyperhdr.eu\033[0m |"
printf "\n | GitHub: \033[36;1mhttps://github.com/awawa-dev/HyperHDR\033[0m |"
printf "\n +-----------------------------------------------------------------------+\n"

exit 0
32 changes: 16 additions & 16 deletions cmake/rpm/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -132,24 +132,24 @@ fi

echo ${start_msg}

echo " +-----------------------------------------------------------------------+"
echo " | \033[32;1mHyperHDR has been installed/updated!\033[0m |"
echo " +-----------------------------------------------------------------------+"
printf " | For configuration, visit with your browser: \033[37;1m%13s:%s\033[0m |\n" "$NET_IP" "8090"
printf " | If already used by another service try: \033[37;1m%13s:%s\033[0m |\n" "$NET_IP" "8091"
printf " | Start the service: \033[37;1msudo systemctl start hyperhdr@%-12s\033[0m |\n" "$FOUND_USR"
printf " | Stop the service: \033[37;1msudo systemctl stop hyperhdr@%-12s\033[0m |\n" "$FOUND_USR"
echo " | Troubleshooting? Run HyperHDR manually: \033[37;1m/usr/bin/hyperhdr\033[0m |"
echo " +-----------------------------------------------------------------------+"
printf "\n +-----------------------------------------------------------------------+"
printf "\n | \033[32;1mHyperHDR has been installed/updated!\033[0m |"
printf "\n +-----------------------------------------------------------------------+"
printf "\n | For configuration, visit with your browser: \033[37;1m%13s:%s\033[0m |" "$NET_IP" "8090"
printf "\n | If already used by another service try: \033[37;1m%13s:%s\033[0m |" "$NET_IP" "8091"
printf "\n | Start the service: \033[37;1msudo systemctl start hyperhdr@%-12s\033[0m |" "$FOUND_USR"
printf "\n | Stop the service: \033[37;1msudo systemctl stop hyperhdr@%-12s\033[0m |" "$FOUND_USR"
printf "\n | Troubleshooting? Run HyperHDR manually: \033[37;1m/usr/bin/hyperhdr\033[0m |"
printf "\n +-----------------------------------------------------------------------+"
case "$STARTUP_MSG" in
*"HyperHDR is installed as a service"*)
printf " | \033[32;1m%-67s\033[0m |\n" "$STARTUP_MSG";;
*) printf " | \033[31;1m%-67s\033[0m |\n" "$STARTUP_MSG"
printf "\n | \033[32;1m%-67s\033[0m |" "$STARTUP_MSG";;
*) printf "\n | \033[31;1m%-67s\033[0m |" "$STARTUP_MSG"
esac
[ -z "$REBOOTMESSAGE" ] || printf " | \033[31;1m%-67s\033[0m |\n" "$REBOOTMESSAGE"
echo " +-----------------------------------------------------------------------+"
echo " | Webpage: \033[36;1mhttps://hyperhdr.eu\033[0m |"
echo " | GitHub: \033[36;1mhttps://github.com/awawa-dev/HyperHDR\033[0m |"
echo " +-----------------------------------------------------------------------+"
[ -z "$REBOOTMESSAGE" ] || printf "\n | \033[31;1m%-67s\033[0m |" "$REBOOTMESSAGE"
printf "\n +-----------------------------------------------------------------------+"
printf "\n | Webpage: \033[36;1mhttps://hyperhdr.eu\033[0m |"
printf "\n | GitHub: \033[36;1mhttps://github.com/awawa-dev/HyperHDR\033[0m |"
printf "\n +-----------------------------------------------------------------------+\n"

exit 0
2 changes: 1 addition & 1 deletion include/base/HyperHdrInstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class HyperHdrInstance : public QObject
quint8 getInstanceIndex() const { return _instIndex; }
QSize getLedGridSize() const { return _ledGridSize; }
bool getScanParameters(size_t led, double& hscanBegin, double& hscanEnd, double& vscanBegin, double& vscanEnd) const;
unsigned updateSmoothingConfig(unsigned id, int settlingTime_ms = 200, double ledUpdateFrequency_hz = 25.0, bool directMode = false);
unsigned addEffectConfig(unsigned id, int settlingTime_ms = 200, double ledUpdateFrequency_hz = 25.0, bool pause = false);

static void signalTerminateTriggered();
static bool isTerminated();
Expand Down
13 changes: 7 additions & 6 deletions include/base/Smoothing.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
#pragma once

#ifndef PCH_ENABLED
#include <QJsonDocument>
#include <QMutex>
#include <QVector>
#include <vector>

#include <utils/ColorRgb.h>
#include <utils/settings.h>
#include <utils/Components.h>
#endif

#include <leddevice/LedDevice.h>
#define SMOOTHING_USER_CONFIG 0
#define SMOOTHING_EFFECT_CONFIGS_START 1

class QTimer;
class Logger;
class HyperHdrInstance;

Expand All @@ -26,7 +29,7 @@ class Smoothing : public QObject
bool isEnabled() const;

void UpdateLedValues(const std::vector<ColorRgb>& ledValues);
unsigned UpdateConfig(unsigned cfgID, int settlingTime_ms, double ledUpdateFrequency_hz, bool directModee);
unsigned AddEffectConfig(unsigned cfgID, int settlingTime_ms, double ledUpdateFrequency_hz, bool pause);
void UpdateCurrentConfig(int settlingTime_ms);
bool SelectConfig(unsigned cfg, bool force);
int GetSuggestedInterval();
Expand Down Expand Up @@ -86,13 +89,12 @@ private slots:
bool pause;
int64_t settlingTime;
int64_t updateInterval;
bool directMode;
SmoothingType type;
int antiFlickeringTreshold;
int antiFlickeringStep;
int64_t antiFlickeringTimeout;

SmoothingConfig(bool __pause, int64_t __settlingTime, int64_t __updateInterval, bool __directMode,
SmoothingConfig(bool __pause, int64_t __settlingTime, int64_t __updateInterval,
SmoothingType __type = SmoothingType::Linear, int __antiFlickeringTreshold = 0, int __antiFlickeringStep = 0,
int64_t __antiFlickeringTimeout = 0);

Expand All @@ -105,7 +107,6 @@ private slots:
std::atomic_bool _enabled;
std::atomic_bool _hasData;
bool _connected;
bool _directMode;
SmoothingType _smoothingType;
bool _infoUpdate;
bool _infoInput;
Expand Down
1 change: 1 addition & 0 deletions include/base/SoundCapture.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class SoundCapture : public QObject

QList<QString> _availableDevices;
bool _isActive;
bool _enable_smoothing;
QString _selectedDevice;
QString _normalizedName;
bool _isRunning;
Expand Down
4 changes: 0 additions & 4 deletions include/effectengine/Animation4Music_PulseBlue.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ class Animation4Music_PulseBlue : public AnimationBaseMusic

Animation4Music_PulseBlue();

void Init(
HyperImage& hyperImage,
int hyperLatchTime) override;

bool Play(HyperImage& painter) override;

static EffectDefinition getDefinition();
Expand Down
4 changes: 0 additions & 4 deletions include/effectengine/Animation4Music_PulseGreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ class Animation4Music_PulseGreen : public AnimationBaseMusic

Animation4Music_PulseGreen();

void Init(
HyperImage& hyperImage,
int hyperLatchTime) override;

bool Play(HyperImage& painter) override;

static EffectDefinition getDefinition();
Expand Down
4 changes: 0 additions & 4 deletions include/effectengine/Animation4Music_PulseMulti.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ class Animation4Music_PulseMulti : public AnimationBaseMusic

Animation4Music_PulseMulti();

void Init(
HyperImage& hyperImage,
int hyperLatchTime) override;

bool Play(HyperImage& painter) override;

static EffectDefinition getDefinition();
Expand Down
4 changes: 0 additions & 4 deletions include/effectengine/Animation4Music_PulseMultiFast.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ class Animation4Music_PulseMultiFast : public AnimationBaseMusic

Animation4Music_PulseMultiFast();

void Init(
HyperImage& hyperImage,
int hyperLatchTime) override;

bool Play(HyperImage& painter) override;

static EffectDefinition getDefinition();
Expand Down
4 changes: 0 additions & 4 deletions include/effectengine/Animation4Music_PulseMultiSlow.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ class Animation4Music_PulseMultiSlow : public AnimationBaseMusic

Animation4Music_PulseMultiSlow();

void Init(
HyperImage& hyperImage,
int hyperLatchTime) override;

bool Play(HyperImage& painter) override;

static EffectDefinition getDefinition();
Expand Down
4 changes: 0 additions & 4 deletions include/effectengine/Animation4Music_PulseRed.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ class Animation4Music_PulseRed : public AnimationBaseMusic

Animation4Music_PulseRed();

void Init(
HyperImage& hyperImage,
int hyperLatchTime) override;

bool Play(HyperImage& painter) override;

static EffectDefinition getDefinition();
Expand Down
4 changes: 0 additions & 4 deletions include/effectengine/Animation4Music_PulseWhite.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ class Animation4Music_PulseWhite : public AnimationBaseMusic

Animation4Music_PulseWhite();

void Init(
HyperImage& hyperImage,
int hyperLatchTime) override;

bool Play(HyperImage& painter) override;

static EffectDefinition getDefinition();
Expand Down
4 changes: 0 additions & 4 deletions include/effectengine/Animation4Music_PulseYellow.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ class Animation4Music_PulseYellow : public AnimationBaseMusic

Animation4Music_PulseYellow();

void Init(
HyperImage& hyperImage,
int hyperLatchTime) override;

bool Play(HyperImage& painter) override;

static EffectDefinition getDefinition();
Expand Down
4 changes: 0 additions & 4 deletions include/effectengine/Animation4Music_QuatroBlue.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ class Animation4Music_QuatroBlue : public AnimationBaseMusic

Animation4Music_QuatroBlue();

void Init(
HyperImage& hyperImage,
int hyperLatchTime) override;

bool Play(HyperImage& painter) override;

static EffectDefinition getDefinition();
Expand Down
4 changes: 0 additions & 4 deletions include/effectengine/Animation4Music_QuatroGreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ class Animation4Music_QuatroGreen : public AnimationBaseMusic

Animation4Music_QuatroGreen();

void Init(
HyperImage& hyperImage,
int hyperLatchTime) override;

bool Play(HyperImage& painter) override;

static EffectDefinition getDefinition();
Expand Down
4 changes: 0 additions & 4 deletions include/effectengine/Animation4Music_QuatroMulti.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ class Animation4Music_QuatroMulti : public AnimationBaseMusic

Animation4Music_QuatroMulti();

void Init(
HyperImage& hyperImage,
int hyperLatchTime) override;

bool Play(HyperImage& painter) override;

static EffectDefinition getDefinition();
Expand Down
Loading