mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
acdf733936
* Creating Audio Grabber Creating Audio Grabber Creating Audio Grabber. Successfully began capturing audio in windows. Starting to implement a hard-coded UV Visualizer. Got Windows DirectSound Implementation working. Hardcoded basic VU Meter. Begin working on linux audio grabber implementation. Finished Linux Draft Implementation. Minor Mods to windows implementation. Windows: - Free memory used by device id. - Prevent starting audio if the grabber is disabled - More debug logging Linux: - Prevent starting audio if the grabber is disabled Added strings to english Removed "custom" from device selection Made hard-coded visualizer values configurable. wrote values to imageData with BGR priority to enable configurable values to be set in RGB format. created logic to support "Automatic" to enable the API to select the default device. Add language key for audio in "Remote Control" section. Removed audio configuration for number of channels. This was causing an error with some devices. Fixed logic to update capture while its active. Optimizing code . UI Tweaks Destructuring. Fixed build error on linux. Custom Effects - Clean-ups and Enhancements (#1163) * Cleanup EffectFileHandler * Support Custom Effect Schemas and align EffectFileHandler * Change back to colon prefix for system effects * WebSockets - Fix error in handling fragmented frames * Correct missing colon updates * Update json with image file location for custom gif effects * Image effect deletion - considere full filename is stored in JSON * Correct selection lists indentions Creating Audio Grabber Creating Audio Grabber Creating Audio Grabber. Successfully began capturing audio in windows. Starting to implement a hard-coded UV Visualizer. Got Windows DirectSound Implementation working. Hardcoded basic VU Meter. Begin working on linux audio grabber implementation. Finished Linux Draft Implementation. Minor Mods to windows implementation. Windows: - Free memory used by device id. - Prevent starting audio if the grabber is disabled - More debug logging Linux: - Prevent starting audio if the grabber is disabled Added strings to english Removed "custom" from device selection Made hard-coded visualizer values configurable. wrote values to imageData with BGR priority to enable configurable values to be set in RGB format. created logic to support "Automatic" to enable the API to select the default device. Add language key for audio in "Remote Control" section. Removed audio configuration for number of channels. This was causing an error with some devices. Fixed logic to update capture while its active. Optimizing code . UI Tweaks Destructuring. Fixed build error on linux. Commented setVideoMode from AudioGrabber. Linux Threading changes. Implementing new API Continuing to implement audio into new APIs Fixed Audio Grabber for DirectSound on Windows Fixed UI for Audio Grabber Configuration Default AUDIO to off unless specified. fixed missing #ifdef for audio grabber. Added logic to calculate a dynamic multiplier from the signal input. Updating linux api for discovering devices. Fixed HTML/JS issues with view. Fixed NPE in Windows. Disabled setting thread priority in linux. updated the schema options check to pass through hidden states and commented the change. Updated grabber start conditions Updated Audio grabber to instantiate similar to video grabber Updated windows grabber to set "started" flag to false when shutting down. Removed "tryStart" to prevent enabling audio capture unnecessarily. Fixing instance audio grabber device configuration Added configurable resolution Reduced tolerance to 5% Fixed issue where grabber failed for additional instances when "start" was called multiple times. Fixed resolution calculation Change averaging algorithm to prevent overflowing the sum. Updated logic to stop audio grabber when disabled. Fix integer casting and rounding. Restart grabber on configuration change. Fix missing include/grabber/AudioGrabber. Disable tolerance. Added configurable tolerance. Fixed tolerance algorithm. reset multiplier on configuration change. Line Endings Proposed change and questions/request to fix implementing more of LordGrey's suggestions. Fix mode for snd_pcm_open. Latest ALSA uses SND_PCM_NONBLOCK instead of SND_PCM_OPEN_NONBLOCK defaulted multiplier to 0 "auto" defaulted tolerance to 20% changed 100 to 100.0 for pixel value percentage calculation to fix value from being 0. missed a 100 as a double so precision isn't lost during math operation. Fix Windows grabber and further cleanups Enable Audio grabbing in standard build Remove empty methods Fix audio capture priority setting Remove unused code Clean-up default config Allow additional json-editor attributes Allow multiple effects and resetting to defaults Correct default values Allow to build for Qt < 5.14 Update CodeQL build dependency Update build dependencies Remove effect1 placeholder * Renamed uvMeter to VU Meter (Volume Unit) - Fixed issues flagged by code scanning bot. * Moved stop call into destructor of implementing class. * Removed commented linux audio channel configuration logic. --------- Co-authored-by: Michael Rochelle <michael@j2inn.com>
95 lines
2.4 KiB
C++
95 lines
2.4 KiB
C++
#pragma once
|
|
|
|
#include <utils/Logger.h>
|
|
#include <utils/settings.h>
|
|
#include <utils/Components.h>
|
|
#include <utils/Image.h>
|
|
|
|
class Hyperion;
|
|
class QTimer;
|
|
|
|
///
|
|
/// @brief Capture Control class which is a interface to the HyperionDaemon native capture classes.
|
|
/// It controls the instance based enable/disable of capture feeds and PriorityMuxer registrations
|
|
///
|
|
class CaptureCont : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
CaptureCont(Hyperion* hyperion);
|
|
|
|
void setSystemCaptureEnable(bool enable);
|
|
void setV4LCaptureEnable(bool enable);
|
|
void setAudioCaptureEnable(bool enable);
|
|
|
|
private slots:
|
|
///
|
|
/// @brief Handle component state change of V4L and SystemCapture
|
|
/// @param component The component from enum
|
|
/// @param enable The new state
|
|
///
|
|
void handleCompStateChangeRequest(hyperion::Components component, bool enable);
|
|
|
|
///
|
|
/// @brief Handle settings update from Hyperion Settingsmanager emit or this constructor
|
|
/// @param type settingyType from enum
|
|
/// @param config configuration object
|
|
///
|
|
void handleSettingsUpdate(settings::type type, const QJsonDocument& config);
|
|
|
|
///
|
|
/// @brief forward system image
|
|
/// @param image The image
|
|
///
|
|
void handleSystemImage(const QString& name, const Image<ColorRgb>& image);
|
|
|
|
///
|
|
/// @brief forward v4l image
|
|
/// @param image The image
|
|
///
|
|
void handleV4lImage(const QString& name, const Image<ColorRgb> & image);
|
|
|
|
///
|
|
/// @brief forward audio image
|
|
/// @param image The image
|
|
///
|
|
void handleAudioImage(const QString& name, const Image<ColorRgb>& image);
|
|
|
|
///
|
|
/// @brief Is called from _v4lInactiveTimer to set source after specific time to inactive
|
|
///
|
|
void setV4lInactive();
|
|
|
|
///
|
|
/// @brief Is called from _audioInactiveTimer to set source after specific time to inactive
|
|
///
|
|
void setAudioInactive();
|
|
|
|
///
|
|
/// @brief Is called from _systemInactiveTimer to set source after specific time to inactive
|
|
///
|
|
void setSystemInactive();
|
|
|
|
private:
|
|
/// Hyperion instance
|
|
Hyperion* _hyperion;
|
|
|
|
/// Reflect state of System capture and prio
|
|
bool _systemCaptEnabled;
|
|
quint8 _systemCaptPrio;
|
|
QString _systemCaptName;
|
|
QTimer* _systemInactiveTimer;
|
|
|
|
/// Reflect state of v4l capture and prio
|
|
bool _v4lCaptEnabled;
|
|
quint8 _v4lCaptPrio;
|
|
QString _v4lCaptName;
|
|
QTimer* _v4lInactiveTimer;
|
|
|
|
/// Reflect state of audio capture and prio
|
|
bool _audioCaptEnabled;
|
|
quint8 _audioCaptPrio;
|
|
QString _audioCaptName;
|
|
QTimer* _audioInactiveTimer;
|
|
};
|