Skip to content

Commit

Permalink
New smoothing option for sound effects, fix ArchLinux installer, ref…
Browse files Browse the repository at this point in the history
…actoring of the smoothing module and music effects (#871)

* Restore Arch Linux

* New smoothing option for sound effects, fix ArchLinux, refactor Smoothing module
  • Loading branch information
awawa-dev authored May 30, 2024
1 parent 4f20f39 commit 5e78bba
Show file tree
Hide file tree
Showing 72 changed files with 138 additions and 451 deletions.
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
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
4 changes: 0 additions & 4 deletions include/effectengine/Animation4Music_QuatroMultiFast.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ class Animation4Music_QuatroMultiFast : public AnimationBaseMusic

Animation4Music_QuatroMultiFast();

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_QuatroMultiSlow.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ class Animation4Music_QuatroMultiSlow : public AnimationBaseMusic

Animation4Music_QuatroMultiSlow();

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_QuatroRed.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ class Animation4Music_QuatroRed : public AnimationBaseMusic

Animation4Music_QuatroRed();

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_QuatroWhite.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ class Animation4Music_QuatroWhite : public AnimationBaseMusic

Animation4Music_QuatroWhite();

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

bool Play(HyperImage& painter) override;

static EffectDefinition getDefinition();
Expand Down
Loading

0 comments on commit 5e78bba

Please sign in to comment.