Some checks failed
Nix-Tests / nix-flake-check (push) Has been cancelled
linux / build (c++20, alpine) (push) Has been cancelled
linux / build (c++20, archlinux) (push) Has been cancelled
linux / build (c++20, debian) (push) Has been cancelled
linux / build (c++20, fedora) (push) Has been cancelled
linux / build (c++20, gentoo) (push) Has been cancelled
linux / build (c++20, opensuse) (push) Has been cancelled
freebsd / build (push) Has been cancelled
clang-format / lint (push) Has been cancelled
28 lines
727 B
C++
28 lines
727 B
C++
#pragma once
|
|
|
|
#ifdef HAVE_LIBCAVA
|
|
#include "cavaRaw.hpp"
|
|
#include "cava_backend.hpp"
|
|
#ifdef HAVE_LIBCAVAGLSL
|
|
#include "cavaGLSL.hpp"
|
|
#endif
|
|
#endif
|
|
|
|
namespace waybar::modules::cava {
|
|
AModule* getModule(const std::string& id, const Json::Value& config) {
|
|
#ifdef HAVE_LIBCAVA
|
|
const std::shared_ptr<CavaBackend> backend_{waybar::modules::cava::CavaBackend::inst(config)};
|
|
switch (backend_->getPrm()->output) {
|
|
#ifdef HAVE_LIBCAVAGLSL
|
|
case ::cava::output_method::OUTPUT_SDL_GLSL:
|
|
return new waybar::modules::cava::CavaGLSL(id, config);
|
|
#endif
|
|
default:
|
|
return new waybar::modules::cava::Cava(id, config);
|
|
}
|
|
#else
|
|
throw std::runtime_error("Unknown module");
|
|
#endif
|
|
};
|
|
} // namespace waybar::modules::cava
|