mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Refactor/Create APT/DNF Repository (#1648)
This commit is contained in:
69
include/grabber/audio/AudioWrapper.h
Normal file
69
include/grabber/audio/AudioWrapper.h
Normal file
@@ -0,0 +1,69 @@
|
||||
#pragma once
|
||||
|
||||
#include <hyperion/GrabberWrapper.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#include <grabber/audio/AudioGrabberWindows.h>
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
#include <grabber/audio/AudioGrabberLinux.h>
|
||||
#endif
|
||||
|
||||
///
|
||||
/// Audio Grabber wrapper
|
||||
///
|
||||
class AudioWrapper : public GrabberWrapper
|
||||
{
|
||||
public:
|
||||
|
||||
// The AudioWrapper has no params...
|
||||
|
||||
///
|
||||
/// Constructs the Audio grabber with a specified grab size and update rate.
|
||||
///
|
||||
/// @param[in] device Audio Device Identifier
|
||||
/// @param[in] updateRate_Hz The audio grab rate [Hz]
|
||||
///
|
||||
AudioWrapper();
|
||||
|
||||
///
|
||||
/// Destructor of this Audio grabber. Releases any claimed resources.
|
||||
///
|
||||
~AudioWrapper() override;
|
||||
|
||||
///
|
||||
/// Settings update handler
|
||||
///
|
||||
void handleSettingsUpdate(settings::type type, const QJsonDocument& config) override;
|
||||
|
||||
public slots:
|
||||
///
|
||||
/// Performs a single frame grab and computes the led-colors
|
||||
///
|
||||
void action() override;
|
||||
|
||||
///
|
||||
/// Start audio capturing session
|
||||
///
|
||||
/// @returns true if successful
|
||||
bool start() override;
|
||||
|
||||
///
|
||||
/// Stop audio capturing session
|
||||
///
|
||||
void stop() override;
|
||||
|
||||
private:
|
||||
void newFrame(const Image<ColorRgb>& image);
|
||||
|
||||
/// The actual grabber
|
||||
#ifdef WIN32
|
||||
AudioGrabberWindows _grabber;
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
AudioGrabberLinux _grabber;
|
||||
#endif
|
||||
|
||||
};
|
Reference in New Issue
Block a user