mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
* Fix macOS build * Update minimum cmake version * Correct compile errorswith Qt6.7 * Update minimum cmake version (2) * Use C++17 * Correct compile errors with Qt6.7 * Replace unsupported Lambda UniqueConnection * Support UTF-8 Output on console * Fix #1630
This commit is contained in:
@@ -88,6 +88,11 @@ private slots:
|
||||
///
|
||||
void handleInstanceStateChange(InstanceState state, quint8 instance, const QString &name = QString());
|
||||
|
||||
///
|
||||
/// @brief Stream a new LED Colors update
|
||||
///
|
||||
void streamLedColorsUpdate();
|
||||
|
||||
signals:
|
||||
///
|
||||
/// Signal emits with the reply message provided with handleMessage()
|
||||
|
@@ -39,8 +39,8 @@ class AudioGrabberWindows : public AudioGrabber
|
||||
HANDLE notificationEvent;
|
||||
std::atomic<bool> isRunning{ false };
|
||||
|
||||
static BOOL CALLBACK DirectSoundEnumProcessor(LPGUID deviceIdGuid, LPCTSTR deviceDescStr,
|
||||
LPCTSTR deviceModelStr, LPVOID context)
|
||||
static BOOL CALLBACK DirectSoundEnumProcessor(LPGUID deviceIdGuid, LPCWSTR deviceDescStr,
|
||||
LPCWSTR deviceModelStr, LPVOID context)
|
||||
{
|
||||
// Skip undefined audio devices
|
||||
if (deviceIdGuid == NULL)
|
||||
@@ -50,12 +50,15 @@ static BOOL CALLBACK DirectSoundEnumProcessor(LPGUID deviceIdGuid, LPCTSTR devic
|
||||
|
||||
AudioGrabber::DeviceProperties device;
|
||||
|
||||
// Process Device Information
|
||||
QString deviceName = QString::fromWCharArray(deviceDescStr);
|
||||
|
||||
// Process Device ID
|
||||
LPOLESTR deviceIdStr;
|
||||
HRESULT res = StringFromCLSID(*deviceIdGuid, &deviceIdStr);
|
||||
if (FAILED(res))
|
||||
{
|
||||
Error(Logger::getInstance("AUDIOGRABBER"), "Failed to get CLSID-string for %s with error: 0x%08x: %s", deviceDescStr, res, std::system_category().message(res).c_str());
|
||||
Error(Logger::getInstance("AUDIOGRABBER"), "Failed to get CLSID-string for %s with error: 0x%08x: %s", QSTRING_CSTR(deviceName), res, std::system_category().message(res).c_str());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -63,10 +66,7 @@ static BOOL CALLBACK DirectSoundEnumProcessor(LPGUID deviceIdGuid, LPCTSTR devic
|
||||
|
||||
CoTaskMemFree(deviceIdStr);
|
||||
|
||||
// Process Device Information
|
||||
QString deviceName = QString::fromLocal8Bit(deviceDescStr);
|
||||
|
||||
Debug(Logger::getInstance("AUDIOGRABBER"), "Found Audio Device: %s", deviceDescStr);
|
||||
Debug(Logger::getInstance("AUDIOGRABBER"), "Found Audio Device: %s", QSTRING_CSTR(deviceName));
|
||||
|
||||
device.id = deviceId;
|
||||
device.name = deviceName;
|
||||
|
@@ -413,9 +413,13 @@ namespace hyperion
|
||||
}
|
||||
|
||||
// Compute the average of each color channel
|
||||
const uint8_t avgRed = uint8_t(std::min(std::lround(sqrt(static_cast<double>(cummRed/pixelNum))), 255L));
|
||||
const uint8_t avgGreen = uint8_t(std::min(std::lround(sqrt(static_cast<double>(cummGreen/pixelNum))), 255L));
|
||||
const uint8_t avgBlue = uint8_t(std::min(std::lround(sqrt(static_cast<double>(cummBlue/pixelNum))), 255L));
|
||||
|
||||
#ifdef WIN32
|
||||
#undef min
|
||||
#endif
|
||||
const uint8_t avgRed = static_cast<uint8_t>(std::min(std::lround(std::sqrt(static_cast<double>(cummRed / pixelNum))), 255L));
|
||||
const uint8_t avgGreen = static_cast<uint8_t>(std::min(std::lround(sqrt(static_cast<double>(cummGreen / pixelNum))), 255L));
|
||||
const uint8_t avgBlue = static_cast<uint8_t>(std::min(std::lround(sqrt(static_cast<double>(cummBlue / pixelNum))), 255L));
|
||||
|
||||
// Return the computed color
|
||||
return {avgRed, avgGreen, avgBlue};
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#define QSTRING_CSTR(str) str.toLocal8Bit().constData()
|
||||
#define QSTRING_CSTR(str) str.toUtf8().constData()
|
||||
typedef QList< int > QIntList;
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user