Răsfoiți Sursa

Fix findings from the static analysis review

Hardening of the file readers and parsers:
  - size and count caps in the package, texture, model and JSON readers
  - finite-float and combo value checks for wrong-typed JSON
  - MDL fuzz tool with a morph wrap fix
  - script limits and ArrayBuffer cap, isolated A8-4 state

  Audio fixes:
  - shared static packet size crash in AudioStream
  - one-shot EOF deadlock
  - several script audio buffer bugs

  Lifetime and leak fixes:
  - ShaderVariable leak
  - model freed when no longer used
  - stale layer release
  - stale KWin scripts cleaned up with a janitor helper

  Behaviour fixes:
  - setuid handling for chrome-sandbox in the release scripts
  - several wrong-behaviour cases
  - release packaging and smoke test script updates

  Adds tools/static_analysis.py for the review harness.
UwU 1 lună în urmă
părinte
comite
eb90119983
100 a modificat fișierele cu 123 adăugiri și 556 ștergeri
  1. 0 10
      CMakeLists.txt
  2. 0 9
      CMakeModules/DownloadCEF.cmake
  3. 0 2
      CMakeModules/FindFFMPEG.cmake
  4. 0 1
      CMakeModules/FindLZ4.cmake
  5. 0 5
      CMakeModules/FindPulseAudio.cmake
  6. 0 4
      gnome-shell-extension/linux-wallpaperengine@wallpaperenginelover.github.io/extension.js
  7. 0 1
      nix/package.nix
  8. 0 3
      packaging/aur/linux-wallpaperengine-kde-git/PKGBUILD
  9. 1 3
      src/Steam/FileSystem/FileSystem.cpp
  10. 1 1
      src/Steam/FileSystem/FileSystem.h
  11. 3 10
      src/WallpaperEngine/Application/ApplicationContext.cpp
  12. 1 62
      src/WallpaperEngine/Application/ApplicationContext.h
  13. 1 1
      src/WallpaperEngine/Application/ApplicationState.h
  14. 1 1
      src/WallpaperEngine/Application/ControlFileOwner.h
  15. 7 66
      src/WallpaperEngine/Application/WallpaperApplication.cpp
  16. 2 43
      src/WallpaperEngine/Application/WallpaperApplication.h
  17. 1 1
      src/WallpaperEngine/Assets/AssetLoadException.h
  18. 1 1
      src/WallpaperEngine/Audio/AudioContext.cpp
  19. 3 5
      src/WallpaperEngine/Audio/AudioContext.h
  20. 2 6
      src/WallpaperEngine/Audio/AudioStream.cpp
  21. 1 12
      src/WallpaperEngine/Audio/AudioStream.h
  22. 1 2
      src/WallpaperEngine/Audio/Drivers/AudioDriver.cpp
  23. 3 9
      src/WallpaperEngine/Audio/Drivers/AudioDriver.h
  24. 1 1
      src/WallpaperEngine/Audio/Drivers/Detectors/AudioPlayingDetector.cpp
  25. 2 2
      src/WallpaperEngine/Audio/Drivers/Detectors/AudioPlayingDetector.h
  26. 1 4
      src/WallpaperEngine/Audio/Drivers/Detectors/HeadphonesDetector.cpp
  27. 1 1
      src/WallpaperEngine/Audio/Drivers/Detectors/HeadphonesDetector.h
  28. 1 2
      src/WallpaperEngine/Audio/Drivers/Detectors/PulseAudioPlayingDetector.cpp
  29. 1 1
      src/WallpaperEngine/Audio/Drivers/Detectors/PulseAudioPlayingDetector.h
  30. 1 2
      src/WallpaperEngine/Audio/Drivers/PulseProcessVolume.cpp
  31. 1 3
      src/WallpaperEngine/Audio/Drivers/PulseProcessVolume.h
  32. 1 1
      src/WallpaperEngine/Audio/Drivers/Recorders/PlaybackRecorder.cpp
  33. 1 4
      src/WallpaperEngine/Audio/Drivers/Recorders/PlaybackRecorder.h
  34. 4 13
      src/WallpaperEngine/Audio/Drivers/Recorders/PulseAudioPlaybackRecorder.cpp
  35. 1 3
      src/WallpaperEngine/Audio/Drivers/Recorders/PulseAudioPlaybackRecorder.h
  36. 1 11
      src/WallpaperEngine/Audio/Drivers/SDLAudioDriver.cpp
  37. 1 12
      src/WallpaperEngine/Audio/Drivers/SDLAudioDriver.h
  38. 1 7
      src/WallpaperEngine/Audio/Hrtf.cpp
  39. 1 7
      src/WallpaperEngine/Audio/Hrtf.h
  40. 1 1
      src/WallpaperEngine/Audio/SpectrumAnalyzer.cpp
  41. 1 2
      src/WallpaperEngine/Audio/SpectrumAnalyzer.h
  42. 1 1
      src/WallpaperEngine/Audio/SpectrumProcessor.cpp
  43. 1 2
      src/WallpaperEngine/Audio/SpectrumProcessor.h
  44. 0 6
      src/WallpaperEngine/Data/Assets/Texture.h
  45. 1 1
      src/WallpaperEngine/Data/Builders/UserSettingBuilder.h
  46. 1 3
      src/WallpaperEngine/Data/Builders/VectorBuilder.h
  47. 1 3
      src/WallpaperEngine/Data/Dumpers/StringPrinter.h
  48. 0 1
      src/WallpaperEngine/Data/JSON.cpp
  49. 1 2
      src/WallpaperEngine/Data/JSON.h
  50. 0 4
      src/WallpaperEngine/Data/Model/DynamicValue.h
  51. 1 7
      src/WallpaperEngine/Data/Model/Effect.h
  52. 1 7
      src/WallpaperEngine/Data/Model/ImageAdjustments.h
  53. 1 3
      src/WallpaperEngine/Data/Model/Material.h
  54. 1 2
      src/WallpaperEngine/Data/Model/Model.h
  55. 6 56
      src/WallpaperEngine/Data/Model/Object.h
  56. 0 1
      src/WallpaperEngine/Data/Model/Project.h
  57. 0 3
      src/WallpaperEngine/Data/Model/Property.h
  58. 1 2
      src/WallpaperEngine/Data/Model/PropertyAnimation.h
  59. 1 4
      src/WallpaperEngine/Data/Model/UserSetting.h
  60. 1 6
      src/WallpaperEngine/Data/Model/Wallpaper.h
  61. 1 1
      src/WallpaperEngine/Data/Parsers/ComboValue.h
  62. 1 1
      src/WallpaperEngine/Data/Parsers/DynamicValueParser.cpp
  63. 1 1
      src/WallpaperEngine/Data/Parsers/EffectParser.cpp
  64. 1 1
      src/WallpaperEngine/Data/Parsers/EffectParser.h
  65. 1 3
      src/WallpaperEngine/Data/Parsers/Localization.cpp
  66. 1 8
      src/WallpaperEngine/Data/Parsers/Localization.h
  67. 1 1
      src/WallpaperEngine/Data/Parsers/MaterialParser.cpp
  68. 1 1
      src/WallpaperEngine/Data/Parsers/MaterialParser.h
  69. 1 1
      src/WallpaperEngine/Data/Parsers/ModelParser.h
  70. 2 9
      src/WallpaperEngine/Data/Parsers/ObjectParser.cpp
  71. 1 3
      src/WallpaperEngine/Data/Parsers/ObjectParser.h
  72. 0 1
      src/WallpaperEngine/Data/Parsers/ProjectParser.cpp
  73. 1 2
      src/WallpaperEngine/Data/Parsers/ProjectParser.h
  74. 0 1
      src/WallpaperEngine/Data/Parsers/PropertyParser.cpp
  75. 0 1
      src/WallpaperEngine/Data/Parsers/ShaderConstantParser.cpp
  76. 1 1
      src/WallpaperEngine/Data/Parsers/ShaderConstantParser.h
  77. 0 5
      src/WallpaperEngine/Data/Parsers/TextureParser.cpp
  78. 0 1
      src/WallpaperEngine/Data/Parsers/UserSettingParser.cpp
  79. 1 1
      src/WallpaperEngine/Data/Parsers/UserSettingParser.h
  80. 1 2
      src/WallpaperEngine/Data/Parsers/WallpaperParser.cpp
  81. 1 1
      src/WallpaperEngine/Data/Parsers/WallpaperParser.h
  82. 1 1
      src/WallpaperEngine/Data/Utils/AudioSensitivity.h
  83. 0 1
      src/WallpaperEngine/Data/Utils/BinaryReader.cpp
  84. 0 3
      src/WallpaperEngine/Data/Utils/BinaryReader.h
  85. 1 1
      src/WallpaperEngine/Data/Utils/FiniteFloat.h
  86. 1 1
      src/WallpaperEngine/Data/Utils/TypeCaster.h
  87. 9 12
      src/WallpaperEngine/Debugging/CallStack.cpp
  88. 1 1
      src/WallpaperEngine/Debugging/CallStack.h
  89. 1 1
      src/WallpaperEngine/Desktop/GnomeShell.cpp
  90. 1 6
      src/WallpaperEngine/Desktop/GnomeShell.h
  91. 1 2
      src/WallpaperEngine/Desktop/HostWayland.cpp
  92. 1 2
      src/WallpaperEngine/Desktop/HostWayland.h
  93. 1 2
      src/WallpaperEngine/Desktop/HyprlandIPC.cpp
  94. 1 2
      src/WallpaperEngine/Desktop/HyprlandIPC.h
  95. 1 1
      src/WallpaperEngine/Desktop/IconTheme.cpp
  96. 1 6
      src/WallpaperEngine/Desktop/IconTheme.h
  97. 1 2
      src/WallpaperEngine/Desktop/KDESession.h
  98. 1 2
      src/WallpaperEngine/Desktop/KWinScript.cpp
  99. 1 2
      src/WallpaperEngine/Desktop/KWinScript.h
  100. 12 13
      src/WallpaperEngine/Desktop/PowerMonitor.cpp

+ 0 - 10
CMakeLists.txt

@@ -12,12 +12,10 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
 set(OpenGL_GL_PREFERENCE "LEGACY")
 set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
 
-# puts the app in demomode, which records a 5 second webm video and quits
 if(NOT DEMOMODE)
     set(DEMOMODE 0)
 endif()
 
-# verbose shader output for debugging, RenderDoc is usually the better tool
 if(NOT ERRORONLY)
     set(ERRORONLY 0)
 endif()
@@ -51,7 +49,6 @@ set(KISSFFT_TOOLS OFF)
 set(CEF_VERSION "135.0.17+gcbc1c5b+chromium-135.0.7049.52")
 # SHA256 of the archives for that version, a CEF_SHA256_<platform> per distribution that is pinned (bump with CEF_VERSION)
 set(CEF_SHA256_linux64_minimal "24ac1980e62be7b1aea2c337d6bd4bc770dccd8b37e47c6db94b397f13ec4dc6")
-# debug builds use the standard CEF distribution, release builds the minimal one
 if(CMAKE_BUILD_TYPE STREQUAL "Debug")
     set(default_cef_dist "standard")
 else()
@@ -118,7 +115,6 @@ list(APPEND CMAKE_MODULE_PATH "${CEF_ROOT}/cmake")
 
 find_package(CEF REQUIRED)
 
-# drop CEF switches our code can't build with
 list(REMOVE_ITEM CEF_CXX_COMPILER_FLAGS -fno-exceptions)
 list(REMOVE_ITEM CEF_CXX_COMPILER_FLAGS -fno-rtti)
 list(REMOVE_ITEM CEF_CXX_COMPILER_FLAGS -std=c++17)
@@ -322,7 +318,6 @@ set_target_properties(ceflib
 ADD_LOGICAL_TARGET(libcef_lib "${CEF_LIB_DEBUG}" "${CEF_LIB_RELEASE}")
 PRINT_CEF_CONFIG()
 
-# builtins.js embedded into a generated header, on the global include path so tests find it too
 set(WPENGINE_GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated")
 set(WPENGINE_BUILTINS_JS "${CMAKE_CURRENT_SOURCE_DIR}/src/WallpaperEngine/Scripting/resources/builtins.js")
 file(READ "${WPENGINE_BUILTINS_JS}" WPENGINE_SCRIPT_BUILTINS)
@@ -330,10 +325,8 @@ configure_file(
     "${CMAKE_CURRENT_SOURCE_DIR}/src/WallpaperEngine/Scripting/resources/Builtins.generated.h.in"
     "${WPENGINE_GENERATED_DIR}/WallpaperEngine/Scripting/Builtins.generated.h"
     @ONLY)
-# re-run configuration (regenerating the header) whenever the .js changes
 set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${WPENGINE_BUILTINS_JS}")
 
-# OpenAL Soft's default HRTF data set (the same bytes WE embeds) as a byte array
 set(WPENGINE_DEFAULT_HRTF "${CMAKE_CURRENT_SOURCE_DIR}/src/WallpaperEngine/Audio/resources/default_hrtf.mhr")
 file(READ "${WPENGINE_DEFAULT_HRTF}" WPENGINE_DEFAULT_HRTF_HEX HEX)
 string(REGEX REPLACE "([0-9a-f][0-9a-f])" "0x\\1," WPENGINE_DEFAULT_HRTF_BYTES "${WPENGINE_DEFAULT_HRTF_HEX}")
@@ -901,7 +894,6 @@ target_link_libraries (linux-wallpaperengine PUBLIC linux-wallpaperengine-lib)
 # libcef has to load before libc (Chromium finds close() via RTLD_NEXT), --as-needed distros dropped the dependency
 target_link_options (linux-wallpaperengine PRIVATE -Wl,--no-as-needed)
 
-# Chromium child processes of the web host, only libcef and the page shim
 add_executable(linux-wallpaperengine-web-helper
     src/web_helper.cpp
     src/WallpaperEngine/WebBrowser/CEF/SubprocessApp.cpp)
@@ -940,7 +932,6 @@ endif()
 set_target_properties(linux-wallpaperengine-gnome-helper PROPERTIES RUNTIME_OUTPUT_DIRECTORY
     ${TARGET_OUTPUT_DIRECTORY}/gnome-shell-extension/linux-wallpaperengine@wallpaperenginelover.github.io)
 
-# ships next to the engine for we_manager to install, copied every build so extension.js changes land
 add_custom_target(gnome-shell-extension ALL
     COMMAND ${CMAKE_COMMAND} -E copy_directory
         ${CMAKE_CURRENT_SOURCE_DIR}/gnome-shell-extension ${TARGET_OUTPUT_DIRECTORY}/gnome-shell-extension)
@@ -960,7 +951,6 @@ install(TARGETS linux-wallpaperengine-lib
 include(GNUInstallDirs)
 install(TARGETS kissfft LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
 
-# icon and a hidden desktop entry for the engine's windows
 install(DIRECTORY resources/icons/hicolor DESTINATION share/icons)
 install(FILES resources/linux-wallpaperengine.desktop DESTINATION share/applications)
 

+ 0 - 9
CMakeModules/DownloadCEF.cmake

@@ -2,12 +2,6 @@
 # reserved. Use of this source code is governed by a BSD-style license that
 # can be found in the LICENSE file.
 
-# Download the CEF binary distribution for |platform| and |version| to
-# |download_dir|. The |CEF_ROOT| variable will be set in global scope pointing
-# to the extracted location.
-# Visit https://cef-builds.spotifycdn.com/index.html for the list of
-# supported platforms and versions.
-
 function(DownloadCEF platform version download_dir)
   set(CEF_DISTRIBUTION "cef_binary_${version}_${platform}")
   set(CEF_DOWNLOAD_DIR "${download_dir}")
@@ -86,10 +80,7 @@ function(DownloadCEF platform version download_dir)
 endfunction()
 
 
-# Set common target properties. Use SET_LIBRARY_TARGET_PROPERTIES() or
-# SET_EXECUTABLE_TARGET_PROPERTIES() instead of calling this macro directly.
 macro(REPLACED_SET_COMMON_TARGET_PROPERTIES target)
-  # separate C and C++ flags (modified from CEF)
   target_compile_options(${target} PRIVATE $<$<COMPILE_LANGUAGE:C>:${CEF_COMPILER_FLAGS} ${CEF_C_COMPILER_FLAGS}>)
   target_compile_options(${target} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:${CEF_COMPILER_FLAGS} ${CEF_CXX_COMPILER_FLAGS}>)
   target_compile_options(${target} PRIVATE $<$<CONFIG:Debug>:${CEF_COMPILER_FLAGS_DEBUG} ${CEF_CXX_COMPILER_FLAGS_DEBUG}>)

+ 0 - 2
CMakeModules/FindFFMPEG.cmake

@@ -28,10 +28,8 @@ include(FindPackageHandleStandardArgs)
     )
 
 if(FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR)
-  # in cache already
   set(FFMPEG_FOUND TRUE)
 else()
-  # pkg-config's directories as hints for find_path/find_library
   find_package(PkgConfig)
   if(PKG_CONFIG_FOUND)
     pkg_check_modules(_FFMPEG_AVCODEC libavcodec)

+ 0 - 1
CMakeModules/FindLZ4.cmake

@@ -17,7 +17,6 @@ if (LZ4_LIBRARY)
   set(CMAKE_REQUIRED_INCLUDES ${LZ4_INCLUDE_DIR})
   set(CMAKE_REQUIRED_LIBRARIES ${LZ4_LIBRARY})
   check_c_source_runs("
-#include <lz4.h>
 int main() {
   int good = (LZ4_VERSION_MAJOR > 1) ||
     ((LZ4_VERSION_MAJOR == 1) && (LZ4_VERSION_MINOR >= 7));

+ 0 - 5
CMakeModules/FindPulseAudio.cmake

@@ -16,12 +16,10 @@
 # Redistribution and use is allowed according to the terms of the BSD license.
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
 
-# Support PULSEAUDIO_MINIMUM_VERSION for compatibility:
 if(NOT PulseAudio_FIND_VERSION)
   set(PulseAudio_FIND_VERSION "${PULSEAUDIO_MINIMUM_VERSION}")
 endif(NOT PulseAudio_FIND_VERSION)
 
-# the minimum version of PulseAudio we require
 if(NOT PulseAudio_FIND_VERSION)
   set(PulseAudio_FIND_VERSION "0.9.9")
 endif(NOT PulseAudio_FIND_VERSION)
@@ -50,10 +48,8 @@ find_library(PULSEAUDIO_MAINLOOP_LIBRARY NAMES pulse-mainloop pulse-mainloop-gli
    ${PC_PULSEAUDIO_LIBRARY_DIRS}
    )
 
-# Store the version number in the cache, so we don't have to search every time again:
 if (PULSEAUDIO_INCLUDE_DIR  AND NOT  PULSEAUDIO_VERSION)
 
-   # get PulseAudio's version from its version.h, and compare it with our minimum version
    file(STRINGS "${PULSEAUDIO_INCLUDE_DIR}/pulse/version.h" pulse_version_h
         REGEX ".*pa_get_headers_version\\(\\).*"
         )
@@ -63,7 +59,6 @@ if (PULSEAUDIO_INCLUDE_DIR  AND NOT  PULSEAUDIO_VERSION)
    set(PULSEAUDIO_VERSION "${_PULSEAUDIO_VERSION}" CACHE STRING "Version number of PulseAudio" FORCE)
 endif (PULSEAUDIO_INCLUDE_DIR  AND NOT  PULSEAUDIO_VERSION)
 
-# Use the new extended syntax of find_package_handle_standard_args(), which also handles version checking:
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(PulseAudio REQUIRED_VARS PULSEAUDIO_LIBRARY PULSEAUDIO_INCLUDE_DIR
                                              VERSION_VAR PULSEAUDIO_VERSION )

+ 0 - 4
gnome-shell-extension/linux-wallpaperengine@wallpaperenginelover.github.io/extension.js

@@ -332,7 +332,6 @@ export default class WallpaperEngineExtension extends Extension {
             client.hide_from_window_list(window);
         }
         window.stick();
-        // again when shown, Mutter places new windows on the current monitor
         this._place(window);
         const shownId = window.connect('shown', () => {
             window.disconnect(shownId);
@@ -398,7 +397,6 @@ export default class WallpaperEngineExtension extends Extension {
 
         const entry = {clone, effect, group, signals: [], content: null, contentSignal: 0};
         const manager = background._bgManager;
-        // new background actors go on top
         entry.signals.push([manager, manager.connect('changed', () => {
             group.set_child_above_sibling(clone, null);
             this._updateOverviewClip(background, entry);
@@ -435,7 +433,6 @@ export default class WallpaperEngineExtension extends Extension {
             [radius / monitor.width, radius / monitor.height]);
     }
 
-    // the workspace went away with clone and background
     _dropOverviewClone(background, destroyed = false) {
         const entry = this._overviewClones?.get(background);
         if (!entry)
@@ -563,7 +560,6 @@ export default class WallpaperEngineExtension extends Extension {
         if (this._pointerIdle || this._wallpapers.size === 0)
             return;
 
-        // one signal per main loop pass
         this._pointerIdle = GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE, () => {
             this._pointerIdle = 0;
             this._dbus?.emit_signal('PointerMoved', new GLib.Variant('(a(sdd))', [this._pointer()]));

+ 0 - 1
nix/package.nix

@@ -135,7 +135,6 @@ stdenv.mkDerivation {
     libxkbcommon
     gmp
     libnode
-    # CEF's own libraries
     nss
     nspr
     cups

+ 0 - 3
packaging/aur/linux-wallpaperengine-kde-git/PKGBUILD

@@ -7,7 +7,6 @@ pkgdesc="Wallpaper Engine live wallpapers on Linux, fork of linux-wallpaperengin
 arch=('x86_64')
 url="https://github.com/WallpaperEngineLover/linux-wallpaperengine-kde"
 license=('GPL-3.0-only')
-# libnode (V8 for scene scripts) is in the AUR
 depends=('libnode' 'mpv' 'ffmpeg' 'glew' 'glfw' 'sdl2' 'freeglut' 'glu' 'fftw' 'lz4' 'freetype2' 'harfbuzz' 'gmp'
     'dbus' 'wayland' 'libpulse' 'libglvnd' 'libx11' 'libxext' 'libxrandr' 'libxinerama' 'libxcursor' 'libxi' 'libxxf86vm'
     'nss' 'at-spi2-core' 'libcups' 'libxcomposite' 'libxdamage' 'libxkbcommon' 'pango' 'cairo' 'alsa-lib' 'libdrm'
@@ -35,7 +34,6 @@ build() {
     CFLAGS="${CFLAGS//-Wp,-D_FORTIFY_SOURCE=?/}"
     CXXFLAGS="${CXXFLAGS//-Wp,-D_FORTIFY_SOURCE=?/}"
     export CFLAGS CXXFLAGS
-    # CMake downloads the CEF version the checkout pins
     cmake -B build -S "$_pkgname" \
         -DCMAKE_BUILD_TYPE=Release \
         -DCMAKE_INSTALL_PREFIX="/opt/$_pkgname" \
@@ -44,7 +42,6 @@ build() {
 }
 
 package() {
-    # the same files as the release tarballs
     "$_pkgname/tools/package_release.sh" build "$_pkgname" "$srcdir/dist"
     install -d "$pkgdir/opt"
     tar -xzf "$srcdir/dist/$_pkgname.tar.gz" -C "$pkgdir/opt"

+ 1 - 3
src/Steam/FileSystem/FileSystem.cpp

@@ -30,7 +30,6 @@ std::filesystem::path detectHomepath () {
 }
 
 namespace {
-// the "path" entries of Steam's libraryfolders.vdf, one per library folder on any disk
 std::vector<std::filesystem::path> libraryFoldersOf (const std::filesystem::path& steamRoot) {
     static const std::regex entry (R"re("path"\s+"((?:[^"\\]|\\.)*)")re");
     std::vector<std::filesystem::path> folders;
@@ -65,7 +64,6 @@ std::vector<std::filesystem::path> libraryFoldersOf (const std::filesystem::path
     return folders;
 }
 
-// every Steam install and the library folders they list, each once, in lookup order
 std::vector<std::filesystem::path> steamLibraries () {
     const auto home = detectHomepath ();
     std::vector<std::filesystem::path> libraries;
@@ -97,7 +95,7 @@ std::vector<std::filesystem::path> steamLibraries () {
 
     return libraries;
 }
-} // namespace
+}
 
 std::filesystem::path Steam::FileSystem::workshopDirectory (int appID, const std::string& contentID) {
     for (const auto& library : steamLibraries ()) {

+ 1 - 1
src/Steam/FileSystem/FileSystem.h

@@ -6,4 +6,4 @@
 namespace Steam::FileSystem {
 std::filesystem::path workshopDirectory (int appID, const std::string& contentID);
 std::filesystem::path appDirectory (const std::string& appDirectory, const std::string& path);
-} // namespace Steam::FileSystem
+}

+ 3 - 10
src/WallpaperEngine/Application/ApplicationContext.cpp

@@ -45,7 +45,7 @@ bool isHelperProcess (int argc, char** argv, bool webHost) {
 
     return false;
 }
-} // namespace
+}
 using WallpaperEngine::Data::JSON::JSON;
 
 std::filesystem::path ApplicationContext::resolvePlaylistItemPath (const std::string& raw) const {
@@ -282,7 +282,7 @@ bool matchesObjectToken (const std::string& token, int id, const std::string& na
 
     return result.ec == std::errc () && result.ptr == end && parsed == id;
 }
-} // namespace
+}
 
 const ApplicationContext::SplitScreen* ApplicationContext::findSplitScreen (const std::string& screenOrSlot) const {
     const auto screen = screenOrSlot.substr (0, screenOrSlot.rfind ('#'));
@@ -361,7 +361,6 @@ std::optional<bool> ApplicationContext::resolveEffectVisibility (int id, const s
 }
 
 std::optional<float> ApplicationContext::resolveAudioSensitivity (int id, const std::string& name) const {
-    // "*" is a wildcard default, checked last so a specific id/name match always wins
     std::optional<float> wildcard;
 
     for (const auto& [token, multiplier] : this->settings.general.audioSensitivity) {
@@ -395,7 +394,6 @@ std::optional<ApplicationContext::HRTF_MODE> ApplicationContext::parseHrtfMode (
 }
 
 std::optional<float> ApplicationContext::resolveSoundVolume (int id, const std::string& name) const {
-    // "*" checked last, like resolveAudioSensitivity
     std::optional<float> wildcard;
 
     for (const auto& [token, volume] : this->settings.general.soundVolume) {
@@ -429,7 +427,6 @@ void ApplicationContext::loadSettingsFromArgv () {
 	    }
 	});
 
-    // hidden: self-re-exec as a disposable CEF host for one Web wallpaper
     backgroundGroup.add_argument ("--web-host").flag ().hidden ().store_into (this->settings.general.webHost);
 
     backgroundGroup.add_argument ("--web-host-shm")
@@ -560,7 +557,6 @@ void ApplicationContext::loadSettingsFromArgv () {
 	    group.clamp = this->settings.render.window.clamp;
 	    group.alignment = this->settings.render.window.alignment;
 	    this->settings.general.spanGroups.push_back (std::move (group));
-	    // synthetic "span:" name lets --bg/--scaling/--clamp target this group
 	    lastScreen = "span:" + value;
 	    this->settings.general.screenBackgrounds[lastScreen] = "";
 	})
@@ -871,8 +867,6 @@ void ApplicationContext::loadSettingsFromArgv () {
 	})
 	.append ();
 
-    // Wallpaper Engine's own image settings (its properties panel), every one of them applies to the previous
-    // --window, --screen-root or --screen-span output like --zoom does
     const auto updateImageAdjustments = [this, &lastScreen] (const std::function<void (ImageAdjustments&)>& update) {
 	if (this->settings.render.mode == DESKTOP_BACKGROUND) {
 	    update (this->settings.general.screenImageAdjustments[lastScreen]);
@@ -1423,7 +1417,6 @@ void ApplicationContext::loadSettingsFromArgv () {
 	.action ([this] (const std::string& value) -> void {
 	    const std::string::size_type equals = value.find ('=');
 
-	    // properties without a value are treated as booleans for now
 	    if (equals == std::string::npos) {
 		this->settings.general.properties[value] = "1";
 	    } else {
@@ -1652,7 +1645,7 @@ void ApplicationContext::loadSettingsFromArgv () {
 	this->settings.render.maximumFPS = 30;
 	this->settings.screenshot.take = false;
 	this->settings.render.pauseOnFullscreen = false;
-#endif /* DEMOMODE */
+#endif
     } catch (const std::runtime_error& e) {
 	throw std::runtime_error (
 	    std::string (e.what ()) + ". Use " + std::string (this->m_argv[0]) + " --help for more information"

+ 1 - 62
src/WallpaperEngine/Application/ApplicationContext.h

@@ -27,16 +27,12 @@ public:
 
     void loadSettingsFromArgv ();
 
-    // --disable-object/--enable-object by id or name: true shows, false hides, nullopt keeps the scene's value
     [[nodiscard]] std::optional<bool> resolveObjectVisibility (int id, const std::string& name) const;
 
-    // same for --disable-effect/--enable-effect
     [[nodiscard]] std::optional<bool> resolveEffectVisibility (int id, const std::string& name) const;
 
-    // --audio-sensitivity by id or name, falling back to "*"; nullopt keeps minvalue/maxvalue
     [[nodiscard]] std::optional<float> resolveAudioSensitivity (int id, const std::string& name) const;
 
-    // --sound-volume (0-1) by id or name, falling back to "*"; nullopt keeps the wallpaper's volume
     [[nodiscard]] std::optional<float> resolveSoundVolume (int id, const std::string& name) const;
 
     enum WINDOW_MODE {
@@ -45,7 +41,6 @@ public:
 	EXPLICIT_WINDOW = 2,
     };
 
-    // wlr-layer-shell layer, e.g. niri's place-within-backdrop only applies to BACKGROUND
     enum WAYLAND_LAYER {
 	WAYLAND_LAYER_BACKGROUND = 0,
 	WAYLAND_LAYER_BOTTOM = 1,
@@ -53,15 +48,12 @@ public:
 	WAYLAND_LAYER_OVERLAY = 3,
     };
 
-    /** Headphones rendering of sound objects, OpenAL Soft's "hrtf" setting */
     enum HRTF_MODE {
-	/** like WE: on when the default output is headphones */
 	HRTF_AUTO = 0,
 	HRTF_ON = 1,
 	HRTF_OFF = 2,
     };
 
-    /** auto, on or off, nullopt for anything else */
     [[nodiscard]] static std::optional<HRTF_MODE> parseHrtfMode (const std::string& value);
 
     struct PlaylistSettings {
@@ -84,36 +76,26 @@ public:
 	WallpaperEngine::Render::WallpaperState::TextureUVsScaling scaling
 	    = WallpaperEngine::Render::WallpaperState::TextureUVsScaling::DefaultUVs;
 	TextureFlags clamp = TextureFlags_ClampUVsBorder;
-	/** Manual zoom factor layered on top of the scaling mode, see --zoom */
 	float zoom = 1.0f;
-	/** Re-centers a cropping scaling mode/zoom's visible window, see --offset */
 	glm::vec2 offset = { 0.0f, 0.0f };
-	/** WE's alignment position, x, y and zoom, see --alignment-position */
 	WallpaperEngine::Render::WallpaperState::Alignment alignment = {};
-	// shown outside the wallpaper when clamp is border, see --corner-color
 	glm::vec4 cornerColor = { 0.0f, 0.0f, 0.0f, 1.0f };
-	/** Image filter, color options and flip, see --image-filter */
 	WallpaperEngine::Data::Model::ImageAdjustments imageAdjustments = {};
     };
 
-    /** see --screen-slot */
     struct SplitScreen {
 	enum Layout {
-	    /** sized by aspect ratio, stretched to fill */
 	    LAYOUT_ASPECT = 0,
 	    LAYOUT_EQUAL = 1,
-	    /** own aspect ratio at full height, centered with bars */
 	    LAYOUT_CENTER = 2,
 	};
 
 	std::string screen;
-	/** "<screen>#<n>" keys, left to right (top to bottom on portrait) */
 	std::vector<std::string> slots;
 	Layout layout = LAYOUT_ASPECT;
     };
 
     [[nodiscard]] const SplitScreen* findSplitScreen (const std::string& screenOrSlot) const;
-    /** --screen-root screen, split screen or span member */
     [[nodiscard]] bool isScreenRequested (const std::string& name) const;
     [[nodiscard]] std::vector<std::string> describeRequestedScreens () const;
 
@@ -126,100 +108,66 @@ public:
 	    bool dumpStructure;
 	    bool noShaderCache;
 	    bool disableParticles;
-	    // see --expand-canvas
 	    bool expandCanvas;
-	    /** Loads assets the way their author meant where WE's loader drops them, see --repair-assets */
 	    bool repairAssets = false;
 	    bool postProcessingDisabled = false;
-	    /** WE's "ultra" post processing quality: scenes with bloom and hdr render in HDR, see --post-processing */
 	    bool ultraPostProcessing = false;
-	    /** WE's "displayhdr" post processing: ultra plus highlights brightened towards an HDR output's peak */
 	    bool displayHDR = false;
-	    /** WE's volumetrics and shadow quality: 0 disabled, 1 low, 2 medium, 3 high, 4 ultra */
 	    int volumetricsQuality = 2;
 	    int shadowQuality = 2;
-	    /** WE's "msaa" setting as a sample count (0 off, 2, 4, 8), only scenes with models use it, see --msaa */
 	    int msaaSamples = 0;
-	    /** --ssaa factor per axis */
 	    int supersampling = 1;
-	    /** Objects/layers to force-hide, matched by id or name */
 	    std::vector<std::string> disabledObjects;
-	    /** Objects/layers to force-show, matched by id or name */
 	    std::vector<std::string> enabledObjects;
-	    /** Object effects (bloom, blur, glow, etc) to force-hide, matched by effect id or editor name */
 	    std::vector<std::string> disabledEffects;
-	    /** Object effects to force-show, matched by effect id or editor name */
 	    std::vector<std::string> enabledEffects;
-	    /** Audio-reactive pulse amplitude multiplier per object, matched by id or name; 0 = locked/no pulse */
 	    std::map<std::string, float> audioSensitivity;
-	    /** Sound object volume override (0-1), matched by id or name; see --sound-volume */
 	    std::map<std::string, float> soundVolume;
 	    std::filesystem::path assets;
-	    /** Background to load (provided as the final argument) as fallback for multi-screen setups */
 	    std::filesystem::path defaultBackground;
 	    std::map<std::string, std::filesystem::path> screenBackgrounds;
 	    std::map<std::string, std::string> properties;
 	    std::map<std::string, WallpaperEngine::Render::WallpaperState::TextureUVsScaling> screenScalings;
 	    std::map<std::string, TextureFlags> screenClamps;
-	    // see --zoom
 	    std::map<std::string, float> screenZooms;
-	    // see --offset
 	    std::map<std::string, glm::vec2> screenOffsets;
-	    /** WE's alignment settings for different screens, see --alignment-position */
 	    std::map<std::string, WallpaperEngine::Render::WallpaperState::Alignment> screenAlignments;
-	    // see --corner-color
 	    std::map<std::string, glm::vec4> screenCornerColors;
-	    /** Image filter, color options and flip for different screens, see --image-filter */
 	    std::map<std::string, WallpaperEngine::Data::Model::ImageAdjustments> screenImageAdjustments;
-	    /** Per screen/slot/span overrides of render.videoSegments */
 	    std::map<std::string, WallpaperEngine::VideoPlayback::VideoSegments> screenVideoSegments;
 	    std::map<std::string, PlaylistDefinition> screenPlaylists;
-	    /** Playlist used in window mode */
 	    std::optional<PlaylistDefinition> defaultPlaylist;
-	    /** Span groups: multiple monitors sharing one stretched wallpaper */
 	    std::vector<SpanGroup> spanGroups;
 	    std::vector<SplitScreen> splitScreens;
-	    // hidden: disposable CEF host for one Web wallpaper, needs webHostShm/Width/Height
 	    bool webHost;
 	    std::string webHostShm;
 	    uint32_t webHostWidth;
 	    uint32_t webHostHeight;
-	    /** Where SIGUSR1 hotswap requests are read from, see --control-file */
 	    std::optional<std::filesystem::path> controlFile;
 	} general;
 
 	struct {
 	    WINDOW_MODE mode;
 	    int maximumFPS;
-	    /** Global playback speed multiplier for animations, particles and effects, see --speed */
 	    float playbackSpeed;
 	    WallpaperEngine::VideoPlayback::VideoSegments videoSegments;
-	    /** mpv hwdec value for every video player, see --hwdec */
 	    std::string hwdec;
-	    // freezes scene time entirely, see --disable-animations
 	    bool freezeAnimations;
 	    bool pauseOnFullscreen;
 	    // only fullscreen toplevels that are also activated count (scrollable tiling compositors)
 	    bool pauseOnFullscreenOnlyWhenActive;
-	    /** WE's "Other application focused: Pause" (--pause-on-focus) */
 	    bool pauseOnFocus;
 	    /** wlroots: maximized toplevels pause their outputs too (KDE and GNOME always do, like WE) */
 	    bool pauseOnMaximized;
-	    // app_id substrings ignored for fullscreen pause ("firefox" matches org.mozilla.firefox)
 	    std::vector<std::string> fullscreenPauseIgnoreAppIds;
-	    /** 0 pauses, nullopt keeps maximumFPS, see --fps-battery */
 	    std::optional<int> batteryFPS;
-	    /** minutes, 0 = never, see --idle-pause */
 	    int idlePauseMinutes;
-	    /** Wayland-only: PQ output on monitors in HDR mode and HDR video, see --hdr */
 	    bool hdr;
 	    struct {
 		bool baseOnly;
 		bool noSolidFinal;
 		bool passLog;
-		/** Logs mean scene brightness every 30 frames */
 		bool brightnessLog;
-		/** Renders puppets in their static bind pose, ignoring animation clips entirely */
 		bool noPuppetAnimation;
 		std::optional<int> objectFilter;
 		std::vector<int> skipObjects;
@@ -230,15 +178,10 @@ public:
 		glm::ivec4 geometry;
 		TextureFlags clamp;
 		WallpaperEngine::Render::WallpaperState::TextureUVsScaling scalingMode;
-		/** Manual zoom factor layered on top of scalingMode, see --zoom */
 		float zoom;
-		// see --offset
 		glm::vec2 offset;
-		/** WE's alignment position, x, y and zoom, see --alignment-position */
 		WallpaperEngine::Render::WallpaperState::Alignment alignment;
-		// see --corner-color
 		glm::vec4 cornerColor;
-		/** Image filter, color options and flip, see --image-filter */
 		WallpaperEngine::Data::Model::ImageAdjustments imageAdjustments;
 	    } window;
 
@@ -253,9 +196,7 @@ public:
 	    int volume;
 	    bool automute;
 	    bool audioprocessing;
-	    /** Only this screen (matches --screen-root names) produces audio; nullopt = no restriction */
 	    std::optional<std::string> audioScreen;
-	    /** 0-128, applied to non-video (scene sound + web) backgrounds instead of volume; nullopt = use volume */
 	    std::optional<int> ambientVolume;
 	    HRTF_MODE hrtf;
 	} audio;
@@ -263,9 +204,7 @@ public:
 	struct {
 	    bool enabled;
 	    bool disableparallax;
-	    /** Clamps parallax displacement so an image never slides past its own edges (no black corners) */
 	    bool clampParallaxToImageSize;
-	    /** where a desktop shell forwards the left button to, see --input-file */
 	    std::filesystem::path inputFile;
 	} mouse;
 
@@ -401,4 +340,4 @@ private:
     std::map<std::string, PlaylistDefinition> m_configPlaylists;
     bool m_loadedConfigPlaylists = false;
 };
-} // namespace WallpaperEngine::Application
+}

+ 1 - 1
src/WallpaperEngine/Application/ApplicationState.h

@@ -30,4 +30,4 @@ public:
 	XrayMode mode;
     } xray {};
 };
-} // namespace WallpaperEngine::Application
+}

+ 1 - 1
src/WallpaperEngine/Application/ControlFileOwner.h

@@ -12,4 +12,4 @@ inline bool belongsToAnotherUser (const std::filesystem::path& path, uid_t user)
 
     return lstat (path.c_str (), &info) == 0 && info.st_uid != user;
 }
-} // namespace WallpaperEngine::Application
+}

+ 7 - 66
src/WallpaperEngine/Application/WallpaperApplication.cpp

@@ -38,7 +38,7 @@
 
 #if DEMOMODE
 #include "recording.h"
-#endif /* DEMOMODE */
+#endif
 
 #include <algorithm>
 #include <cctype>
@@ -59,12 +59,10 @@
 
 using WallpaperEngine::Data::Utils::parseFiniteFloat;
 
-// microseconds, for usleep ()
 #define FULLSCREEN_CHECK_WAIT_TIME 250000
 
 float g_Time;
 float g_TimeLast;
-/** Unscaled wall-clock time, unaffected by --speed */
 float g_RealTime;
 float g_Daytime;
 
@@ -190,7 +188,6 @@ void WallpaperApplication::loadBackgrounds () {
     }
 
     for (const auto& [screen, path] : this->m_context.settings.general.screenBackgrounds) {
-	// skip span group synthetic keys here, they're handled below
 	if (screen.rfind ("span:", 0) == 0) {
 	    continue;
 	}
@@ -211,7 +208,6 @@ void WallpaperApplication::loadBackgrounds () {
 	    bgPath = this->m_context.settings.general.defaultBackground;
 	}
 
-	// "span:" + first screen's name is the convention used as the group key
 	const std::string groupKey = "span:" + spanGroup.screens.front ();
 	this->m_backgrounds[groupKey] = this->loadBackground (bgPath);
     }
@@ -313,7 +309,7 @@ ImageAdjustments parseImageAdjustments (const WallpaperEngine::Data::JSON::JSON&
 
     return result;
 }
-} // namespace
+}
 
 void WallpaperApplication::applyPreset (
     Project& project, const WallpaperEngine::Data::JSON::JSON& preset, const std::filesystem::path& presetDir
@@ -380,7 +376,6 @@ void WallpaperApplication::applyPreset (
 ProjectUniquePtr WallpaperApplication::loadBackground (const std::string& bg) try {
     auto [container, json, preset, directory] = this->openProjectSource (bg);
 
-    // reset screenshot state so a background change (e.g. playlist advance) can screenshot again
     if (this->m_context.settings.screenshot.take) {
 	this->m_nextFrameScreenshot = this->m_context.settings.screenshot.delay;
 
@@ -517,7 +512,6 @@ bool WallpaperApplication::makeAnyViewportCurrent () const {
 
 bool WallpaperApplication::preflightWallpaper (const std::string& path) {
     try {
-	// only checks that project.json parses
 	const auto source = this->openProjectSource (path);
 	const auto& json = source.json;
 	if (!json.contains ("type") || !json.contains ("file")) {
@@ -563,7 +557,6 @@ void WallpaperApplication::advancePlaylist (
 
     playlist.orderIndex = (playlist.orderIndex + 1) % playlist.order.size ();
 
-    // an item that failed gets another chance in every round
     if (playlist.orderIndex == 0) {
 	playlist.failedIndices.clear ();
 
@@ -678,10 +671,8 @@ void WallpaperApplication::updatePlaylists () {
 }
 
 namespace {
-/** Everything a control-file request can carry; any field left unset means "don't touch this" */
 struct HotswapRequest {
     std::optional<std::string> path;
-    /** limits the request to this screen or slot */
     std::optional<std::string> screen;
     // a layers=1 line makes disabledObjects/enabledObjects a full replacement
     bool layersProvided = false;
@@ -692,56 +683,34 @@ struct HotswapRequest {
     std::vector<std::string> disabledEffects;
     std::vector<std::string> enabledEffects;
     std::optional<std::string> disableAnimations;
-    // set by any property=name=value line
     bool propertiesProvided = false;
     std::map<std::string, std::string> properties;
     std::optional<int> volume;
-    /** frame rate limit, see --fps */
     std::optional<int> fps;
-    /** see --fps-battery */
     std::optional<std::string> batteryFps;
-    /** see --idle-pause */
     std::optional<std::string> idlePause;
     std::optional<std::string> xray;
-    /** "stretch"/"fit"/"fill"/"center"/"default" */
     std::optional<std::string> scaling;
-    // zoom factor on top of scaling, e.g. "1.5"
     std::optional<std::string> zoom;
-    /** "X,Y" offset re-center, each axis in [-1, 1], e.g. "0.5,-1" */
     std::optional<std::string> offset;
     std::optional<std::string> alignment;
-    /** "on"/"off"/"toggle" (also "1"/"0"/"true"/"false" for on/off) */
     std::optional<std::string> disableParallax;
-    /** "on"/"off" (also "1"/"0"/"true"/"false"), see --expand-canvas. Baked in at scene build, so it reloads */
     std::optional<std::string> expandCanvas;
-    /** "on"/"off", see --repair-assets. Textures are picked at scene build, so it reloads */
     std::optional<std::string> repairAssets;
-    /** hex RGB/RGBA color, e.g. "000000" or "#1a1a1aff" */
     std::optional<std::string> cornerColor;
-    // see --image-filter
     ImageAdjustments imageAdjustments;
     bool imageAdjustmentsProvided = false;
-    // playback speed multiplier, e.g. "0.5"
     std::optional<std::string> speed;
-    /** seconds, m:ss or h:mm:ss, "" or "none" clears it, see --video-start/--video-end */
     std::optional<std::string> videoStart;
     std::optional<std::string> videoEnd;
-    /** "" or "none" clears it */
     std::optional<std::string> videoSegments;
-    /** mpv hwdec value, see --hwdec */
     std::optional<std::string> hwdec;
-    /** auto/on/off, see --hrtf */
     std::optional<std::string> hrtf;
-    /** position to jump video wallpapers to, same format */
     std::optional<std::string> videoSeek;
-    /** screen name to restrict audio to, or "" to clear the restriction, see --audio-screen */
     std::optional<std::string> audioScreen;
-    /** 0-128, see --ambient-volume */
     std::optional<std::string> ambientVolume;
-    // set by any audio-sensitivity=id=multiplier line
     bool audioSensitivityProvided = false;
     std::map<std::string, std::string> audioSensitivity;
-    // set by any sound-volume=id=volume line
     bool soundVolumeProvided = false;
     std::map<std::string, std::string> soundVolume;
 };
@@ -761,7 +730,6 @@ std::string trimHotswapToken (const std::string& value) {
     return value.substr (begin, end - begin);
 }
 
-/** Control file: the old bare path line, or key=value lines (see below). property=name=value can repeat */
 HotswapRequest parseHotswapRequest (std::istream& file) {
     HotswapRequest request;
     std::string rawLine;
@@ -776,7 +744,6 @@ HotswapRequest parseHotswapRequest (std::istream& file) {
 	const auto separator = line.find ('=');
 
 	if (separator == std::string::npos) {
-	    // legacy format: the whole line is the new background path
 	    if (!request.path.has_value ()) {
 		request.path = line;
 	    }
@@ -936,7 +903,7 @@ HotswapRequest parseHotswapRequest (std::istream& file) {
 
     return request;
 }
-} // namespace
+}
 
 void WallpaperApplication::checkHotswapRequest () {
     if (!this->m_hotswapRequested.exchange (false)) {
@@ -996,7 +963,6 @@ void WallpaperApplication::checkHotswapRequest () {
 	return;
     }
 
-    // what a wallpaper that parses but fails to load puts back
     struct OverrideSnapshot {
 	std::vector<std::string> disabledObjects, enabledObjects, disabledEffects, enabledEffects;
 	std::map<std::string, std::string> properties;
@@ -1127,7 +1093,6 @@ void WallpaperApplication::checkHotswapRequest () {
     }
 
     if (request.hrtf.has_value ()) {
-	// the audio driver picks the mode up on its next update
 	if (const auto mode = ApplicationContext::parseHrtfMode (*request.hrtf); mode.has_value ()) {
 	    this->m_context.settings.audio.hrtf = *mode;
 	} else {
@@ -1178,7 +1143,6 @@ void WallpaperApplication::checkHotswapRequest () {
 	this->m_context.settings.general.enabledObjects = request.enabledObjects;
     }
 
-    // effect passes are built at scene load
     if (request.effectsProvided) {
 	this->m_context.settings.general.disabledEffects = request.disabledEffects;
 	this->m_context.settings.general.enabledEffects = request.enabledEffects;
@@ -1328,7 +1292,6 @@ void WallpaperApplication::checkHotswapRequest () {
     }
 
     if (!swapped) {
-	// every screen kept its wallpaper, so it keeps what it was set up with as well
 	restoreOverrides ();
     }
 
@@ -1467,7 +1430,6 @@ ImageAdjustments
 WallpaperApplication::resolveScreenImageAdjustments (const std::string& screen, const Project& project) const {
     const auto fallback = this->m_context.settings.render.window.imageAdjustments.over (project.imageAdjustments);
 
-    // span groups render under every member screen's name and are loaded as "span:<first screen>"
     for (const auto& spanGroup : this->m_context.settings.general.spanGroups) {
 	if (spanGroup.screens.empty ()) {
 	    continue;
@@ -1515,7 +1477,6 @@ void WallpaperApplication::applyVolumeHotswap (int volume) {
 	}
     }
 
-    // web wallpapers derive their volume from the audio policy
     this->applyAudioPolicy ();
 
     sLog.out ("Hotswap: applied volume ", volume, " live");
@@ -1730,7 +1691,6 @@ void WallpaperApplication::applyOffsetHotswap (const HotswapTarget& target, cons
 }
 
 void WallpaperApplication::applyAlignmentHotswap (const HotswapTarget& target, const std::string& value) {
-    // "position,x,y,zoom" in WE's units (0-100, zoom 0-200)
     std::array<float, 4> values {};
     std::stringstream stream (value);
     std::string part;
@@ -2004,7 +1964,6 @@ void WallpaperApplication::applyAudioPolicy () {
     for (const auto& [screen, wallpaper] : this->m_renderContext->getWallpapers ()) {
 	bool screenMuted = audioScreen.has_value () && screen != *audioScreen;
 
-	// only one slot plays audio: --audio-screen's, else the first
 	if (const auto* split = this->m_context.findSplitScreen (screen); split != nullptr) {
 	    const bool named
 		= audioScreen.has_value () && std::ranges::find (split->slots, *audioScreen) != split->slots.end ();
@@ -2137,8 +2096,6 @@ void considerAudioReactive (
     }
 }
 
-// the fields ScriptableObject/CImage/CText/CParticle register with the script engine; scale/angles/visible fall back to
-// group* for types without their own
 std::vector<AudioReactiveProperty> collectAudioReactiveProperties (const Object& object) {
     std::vector<AudioReactiveProperty> result;
 
@@ -2182,7 +2139,7 @@ float readScriptPropertyFloat (DynamicValue& value, const std::string& key) {
 
     return it != properties.end () && it->second && it->second->value ? it->second->value->getFloat () : 0.0f;
 }
-} // namespace
+}
 
 void WallpaperApplication::listAudioObjectsForProject (const std::string& background, const Project& project) const {
     if (!project.wallpaper->is<Scene> ()) {
@@ -2301,7 +2258,6 @@ void WallpaperApplication::applySoundVolumeHotswap (const std::map<std::string,
 	}
     }
 
-    // Sound objects read their volume every frame (CSound::applyEffectiveVolume), no reload needed
     for (const auto& [background, info] : this->m_backgrounds) {
 	this->setupSoundVolumeForProject (*info);
     }
@@ -2334,7 +2290,6 @@ bool WallpaperApplication::applyPropertiesLive (const std::vector<std::string>&
 	    static const bool force = std::getenv ("LWE_FORCE_LIVE_PROPERTIES") != nullptr;
 	    const auto* wallpaper = wallpaperOf (screen);
 
-	    // scenes follow via bindings and scripts, web pages via applyUserProperties, splats read theirs per frame
 	    const bool scene = info->wallpaper->is<Scene> () && wallpaper != nullptr && wallpaper->is<CScene> ();
 	    const bool web = info->wallpaper->is<Web> () && wallpaper != nullptr
 		&& (wallpaper->is<CWeb> () || wallpaper->is<WallpaperEngine::Render::Wallpapers::CSplat> ());
@@ -2507,7 +2462,6 @@ void WallpaperApplication::runWebHost () {
 	evt.x = static_cast<int> (shm->mouseX.load (std::memory_order_relaxed));
 	evt.y = static_cast<int> (shm->mouseY.load (std::memory_order_relaxed));
 
-	// every event wakes the page's input handling, so only tell it when the pointer actually moved
 	if (evt.x != lastMouseX || evt.y != lastMouseY) {
 	    lastMouseX = evt.x;
 	    lastMouseY = evt.y;
@@ -2531,7 +2485,6 @@ void WallpaperApplication::runWebHost () {
 	    lastRight = right;
 	}
 
-	// short, this also paces input/audio handoff and frame pickup; a frame request cuts it short
 	shm->waitForFrameRequest (lastFrameRequest, 1);
     }
 
@@ -2558,7 +2511,6 @@ void WallpaperApplication::takeScreenshot (const std::filesystem::path& filename
 	int vpWidth;
 	int vpHeight;
 	int xoffset;
-	/** rows from the top */
 	int yoffset;
 	float ustart, uend, vstart, vend;
     };
@@ -2570,7 +2522,6 @@ void WallpaperApplication::takeScreenshot (const std::filesystem::path& filename
 	viewport->makeCurrent ();
 
 	const int screenWidth = viewport->viewport.z - viewport->viewport.x;
-	// wallpapers on this screen, rects from the top left
 	std::vector<std::pair<std::string, glm::ivec4>> parts;
 
 	if (const auto* split = this->m_context.findSplitScreen (screen); split != nullptr) {
@@ -2606,7 +2557,6 @@ void WallpaperApplication::takeScreenshot (const std::filesystem::path& filename
 
 	    glFinish ();
 
-	    // clear leftover render errors so they don't fail the readback
 	    while (glGetError () != GL_NO_ERROR) { }
 
 	    const int readWidth = wallpaper->getFramebufferWidth ();
@@ -2645,12 +2595,10 @@ void WallpaperApplication::takeScreenshot (const std::filesystem::path& filename
     const auto extension = filename.extension ();
     const std::string extStr = extension.string ();
 
-    // process and save off the render thread
     const auto encode = [captures, width, height, vflip, extStr, filename] () {
 	auto* bitmap = new uint8_t[width * height * 3] { 0 };
 
 	for (const auto& capture : captures) {
-	    // --ssaa: average the framebuffer pixels behind each output pixel
 	    const float spanX = std::abs (capture.uend - capture.ustart) * capture.readWidth / capture.vpWidth;
 	    const float spanY = std::abs (capture.vend - capture.vstart) * capture.readHeight / capture.vpHeight;
 	    const int samplesX = std::max (1, static_cast<int> (std::lround (spanX)));
@@ -2852,7 +2800,6 @@ void WallpaperApplication::installWallpaper (
 	return;
     }
 
-    // the bounding box of the group's outputs, CWallpaper follows their layout from then on
     const auto& viewports = this->m_renderContext->getOutput ().getViewports ();
     glm::ivec2 low (INT_MAX);
     glm::ivec2 high (INT_MIN);
@@ -2920,7 +2867,6 @@ void WallpaperApplication::prepareOutputs () {
 }
 
 void WallpaperApplication::setupOpenGLDebugging () {
-    // not gated behind NDEBUG, GL_DEBUG_OUTPUT costs next to nothing when nothing goes wrong
     glDebugMessageCallback (CustomGLDebugCallback, nullptr);
     glEnable (GL_DEBUG_OUTPUT_SYNCHRONOUS);
 }
@@ -2948,7 +2894,6 @@ void WallpaperApplication::setup () {
     }
 
 #if DEMOMODE
-    // ensure only one background is running so everything can be properly caught
     if (this->m_renderContext->getWallpapers ().size () > 1) {
 	sLog.exception ("Demo mode only supports one background");
     }
@@ -2958,7 +2903,7 @@ void WallpaperApplication::setup () {
     this->m_demo.pixels.assign (static_cast<size_t> (this->m_demo.width) * this->m_demo.height * 3, 0);
     this->m_demo.initialized = false;
     this->m_demo.frame = 0;
-#endif /* DEMOMODE */
+#endif
 }
 
 void WallpaperApplication::render () {
@@ -2981,7 +2926,6 @@ void WallpaperApplication::render () {
 	this->m_showFrameWhilePaused = takeHotswap;
 	m_renderContext->setPause (false);
 
-	// account for paused duration in playlist timers
 	const auto pausedNow = std::chrono::steady_clock::now ();
 	const auto pausedDuration = pausedNow - this->m_pauseStart;
 
@@ -3066,7 +3010,6 @@ void WallpaperApplication::render () {
 	    }
 	}
 
-	// per frame: hotswaps and the power source change it
 	const float minimumTime = 1.0f / std::max (1, this->frameRateLimit ());
 	const float frameTime = m_videoDriver->getRenderTime () - rawTimeNow;
 
@@ -3105,7 +3048,7 @@ void WallpaperApplication::render () {
 		this->m_context.state.general.keepRunning = false;
 	    }
 	}
-#endif /* DEMOMODE */
+#endif
 	const uint32_t reasons = this->pauseReasons ();
 
 	if (reasons != 0 && !this->m_showFrameWhilePaused && this->m_context.state.general.keepRunning) {
@@ -3144,7 +3087,7 @@ void WallpaperApplication::cleanup () {
 
 #if DEMOMODE
     close_encoder ();
-#endif /* DEMOMODE */
+#endif
 }
 
 void WallpaperApplication::show () {
@@ -3152,7 +3095,6 @@ void WallpaperApplication::show () {
     while (this->m_context.state.general.keepRunning) {
 	render ();
     }
-    // before teardown, a manager may SIGKILL a slow stop
     WallpaperEngine::Scripting::LocalStorage::flushAll ();
     cleanup ();
 }
@@ -3163,7 +3105,6 @@ void WallpaperApplication::update (Render::Drivers::Output::OutputViewport* view
 
 void WallpaperApplication::signal (int signal) {
     if (signal == SIGUSR1) {
-	// keep the handler itself trivial, the actual reload happens on the render thread
 	this->m_hotswapRequested = true;
 	return;
     }

+ 2 - 43
src/WallpaperEngine/Application/WallpaperApplication.h

@@ -40,7 +40,6 @@ public:
     void show ();
     void signal (int signal);
 
-    // entry point of a disposable --web-host CEF process, no Wayland/GL/audio; runs until the main process signals quit
     void runWebHost ();
 
     [[nodiscard]] const std::map<std::string, ProjectUniquePtr>& getBackgrounds () const;
@@ -48,26 +47,20 @@ public:
     void update (Render::Drivers::Output::OutputViewport* viewport);
     [[nodiscard]] const WallpaperEngine::Render::Drivers::Output::Output& getOutput () const;
 
-    /** If not called, the default framebuffer will be used */
     void setDestinationFramebuffer (GLuint framebuffer);
 
-    /** Returns 0 (the default framebuffer) if setDestinationFramebuffer() was never called */
     [[nodiscard]] GLuint getDestinationFramebuffer () const;
 
 private:
-    /** screen= background key, nullopt for every screen */
     using HotswapTarget = std::optional<std::string>;
 
-    /** A project.json ready to be parsed. For presets, json is the base wallpaper's and preset holds the overrides */
     struct ProjectSource {
 	AssetLocatorUniquePtr container;
 	WallpaperEngine::Data::JSON::JSON json;
 	std::optional<WallpaperEngine::Data::JSON::JSON> preset;
-	/** Wallpaper folder, the base wallpaper's for a preset */
 	std::filesystem::path directory;
     };
 
-    /** overlay is an extra folder mounted after bg, used for preset-owned files (e.g. splat data) */
     AssetLocatorUniquePtr setupAssetLocator (const std::string& bg, const std::filesystem::path& overlay = {}) const;
     ProjectSource openProjectSource (const std::string& path) const;
     static void applyPreset (
@@ -79,30 +72,24 @@ private:
     void setupProperties ();
     void setupPropertiesForProject (const Project& project);
 
-    // --list-objects
     void listObjects () const;
     void listObjectsForProject (const std::string& background, const Project& project) const;
 
-    // --list-effects
     void listEffects () const;
     void listEffectsForProject (const std::string& background, const Project& project) const;
 
-    // --audio-sensitivity
     void setupAudioSensitivity ();
     void setupAudioSensitivityForProject (const Project& project) const;
 
-    // --list-audio-objects
     void listAudioObjects () const;
     void listAudioObjectsForProject (const std::string& background, const Project& project) const;
 
-    // --sound-volume
     void setupSoundVolume ();
     void setupSoundVolumeForProject (const Project& project) const;
 
     void setupBrowser ();
     void setupOutput ();
     void setupAudio ();
-    /** Starts audio capture for a wallpaper loaded after startup, setupAudio() only saw the first ones */
     void ensureAudioCapture (const Project& project);
     void prepareOutputs ();
     void setupOpenGLDebugging ();
@@ -128,7 +115,6 @@ private:
     std::vector<std::size_t> buildPlaylistOrder (const ApplicationContext::PlaylistDefinition& definition);
     bool makeAnyViewportCurrent () const;
 
-    // pushes a volume (0-128, like --volume) live to video players and the SDL mixer
     void applyVolumeHotswap (int volume);
     void applyFpsHotswap (int fps);
     void applyBatteryFpsHotswap (const std::string& value);
@@ -138,24 +124,17 @@ private:
     [[nodiscard]] uint32_t pauseReasons () const;
     void logPauseReasons (uint32_t reasons);
 
-    /** "full"/"normal"/"disabled", or the older "on"/"off"/"toggle" */
     void applyXrayHotswap (const std::string& value);
 
-    // "stretch"/"fit"/"fill"/"center"/"default"
     void applyScalingHotswap (const HotswapTarget& target, const std::string& value);
 
-    // e.g. "1.5"
     void applyZoomHotswap (const HotswapTarget& target, const std::string& value);
 
-    // e.g. "0.5,-1"
     void applyOffsetHotswap (const HotswapTarget& target, const std::string& value);
-    // "position,x,y,zoom" in WE's 0-100/0-200 units
     void applyAlignmentHotswap (const HotswapTarget& target, const std::string& value);
 
-    // passthrough to settings.mouse.disableparallax, read every frame; "on"/"off"/"toggle" (or "1"/"0"/"true"/"false")
     void applyParallaxHotswap (const std::string& value);
 
-    // hex RGB/RGBA, e.g. "000000" or "#1a1a1aff"; only visible where clamp is border
     void applyCornerColorHotswap (const HotswapTarget& target, const std::string& value);
     void applyImageAdjustmentsHotswap (const HotswapTarget& target, const ImageAdjustments& request);
     /** Without a target: the window, every screen and every span group. update maps old -> new */
@@ -164,13 +143,10 @@ private:
 	const HotswapTarget& target, std::map<std::string, T>& screens, T& window,
 	T ApplicationContext::SpanGroup::* spanField, Update update
     );
-    /** once per wallpaper, a span's is shared by its screens */
     template <typename Apply> void forEachTargetWallpaper (const HotswapTarget& target, Apply apply) const;
 
-    // e.g. "0.5", passthrough to settings.render.playbackSpeed which render() reads every frame
     void applySpeedHotswap (const std::string& value);
 
-    /** Video wallpapers restart from the first part, video-start/video-end make it one part */
     void applyVideoSegmentsHotswap (
 	const HotswapTarget& target, const std::optional<std::string>& start, const std::optional<std::string>& end,
 	const std::optional<std::string>& segments
@@ -178,48 +154,34 @@ private:
     [[nodiscard]] WallpaperEngine::VideoPlayback::VideoSegments
     resolveScreenVideoSegments (const std::string& screen) const;
 
-    /** Jumps video wallpapers to a position (seconds, m:ss or h:mm:ss), e.g. a few seconds before the loop end */
     void applyVideoSeekHotswap (const HotswapTarget& target, const std::string& value);
     void applyHwdecHotswap (const std::string& value);
 
-    // empty clears the restriction, then re-applies the audio policy
     void applyAudioScreenHotswap (const std::string& value);
 
-    // 0-128, then re-applies the audio policy
     void applyAmbientVolumeHotswap (const std::string& value);
 
-    // id-or-name -> 0-1 volume, live since Sound objects re-read their volume every frame
     void applySoundVolumeHotswap (const std::map<std::string, std::string>& targets);
     /** false when one of them needs a reload */
     bool applyPropertiesLive (const std::vector<std::string>& names);
 
-    // setAudioPolicy() from audioScreen/ambientVolume; a span group's shared wallpaper is muted only if none of its
-    // screens match
     void applyAudioPolicy ();
 
-    // the background a screen shows, so a layers-only hotswap can reload it without a path
     [[nodiscard]] std::string resolveScreenBackgroundPath (const std::string& screen) const;
-    /** Screen suffix for script localStorage's screen store */
     [[nodiscard]] std::string storageScreen (const std::string& screen) const;
     [[nodiscard]] float resolveScreenZoom (const std::string& screen) const;
     [[nodiscard]] glm::vec2 resolveScreenOffset (const std::string& screen) const;
     [[nodiscard]] WallpaperEngine::Render::WallpaperState::Alignment
     resolveScreenAlignment (const std::string& screen) const;
     [[nodiscard]] glm::vec4 resolveScreenCornerColor (const std::string& screen) const;
-    /** Command line and control file settings for this screen (or span group) over what the preset carries */
     [[nodiscard]] ImageAdjustments
     resolveScreenImageAdjustments (const std::string& screen, const Project& project) const;
-    // a Web wallpaper's render size on this screen, the bounding box of all screens if it isn't registered yet
     [[nodiscard]] glm::ivec2 resolveScreenRenderSize (const std::string& screen) const;
-    /** The span group loaded as this "span:<first screen>" key, null for a plain screen */
     [[nodiscard]] const ApplicationContext::SpanGroup* findSpanGroup (const std::string& screen) const;
     [[nodiscard]] ApplicationContext::SpanGroup* findSpanGroup (const std::string& screen);
-    // builds the wallpaper for a screen or span group and puts it on its outputs; throws on failure, the outputs keep
-    // what they had
     void installWallpaper (
 	const std::string& screen, const Project& project, const std::filesystem::path& path, bool holdPrevious
     );
-    /** Screen, slot or span key as is, a span member as its span key; nullopt when unknown */
     [[nodiscard]] std::optional<std::string> resolveHotswapScreen (const std::string& name) const;
     [[nodiscard]] bool hotswapReaches (const HotswapTarget& target, const std::string& screen) const;
 
@@ -248,15 +210,12 @@ private:
 	PauseIdle = 4,
     };
     uint32_t m_pauseReasons = 0;
-    // a hotswap during a battery/idle pause draws one frame
     bool m_showFrameWhilePaused = false;
     std::unique_ptr<WallpaperEngine::Desktop::PowerMonitor> m_powerMonitor = nullptr;
     bool m_screenShotTaken = false;
-    // encodes and writes the last screenshot, joined before the next one and when the application goes
     mutable std::jthread m_screenshotWriter;
 
 #if DEMOMODE
-    /** What the demo recording keeps between frames (setup () sizes it, render () feeds the encoder) */
     struct {
 	int width = 0;
 	int height = 0;
@@ -264,9 +223,9 @@ private:
 	bool initialized = false;
 	int frame = 0;
     } m_demo;
-#endif /* DEMOMODE */
+#endif
     uint32_t m_nextFrameScreenshot = 0;
     std::chrono::steady_clock::time_point m_pauseStart {};
     GLuint m_destinationFramebuffer = 0;
 };
-} // namespace WallpaperEngine::Application
+}

+ 1 - 1
src/WallpaperEngine/Assets/AssetLoadException.h

@@ -8,4 +8,4 @@ public:
     using std::filesystem::filesystem_error::filesystem_error;
     explicit AssetLoadException (const std::filesystem::filesystem_error& filesystem_error) noexcept;
 };
-} // namespace WallpaperEngine::Assets
+}

+ 1 - 1
src/WallpaperEngine/Audio/AudioContext.cpp

@@ -45,4 +45,4 @@ Application::ApplicationContext& AudioContext::getApplicationContext () const {
 Drivers::Recorders::PlaybackRecorder& AudioContext::getRecorder () const { return this->m_driver.getRecorder (); }
 
 Drivers::AudioDriver& AudioContext::getDriver () const { return this->m_driver; }
-} // namespace WallpaperEngine::Audio
+}

+ 3 - 5
src/WallpaperEngine/Audio/AudioContext.h

@@ -22,7 +22,7 @@ namespace Audio {
 	namespace Recorders {
 	    class PulseAudioPlaybackRecorder;
 	}
-    } // namespace Drivers
+    }
 
     class AudioStream;
 
@@ -37,14 +37,12 @@ namespace Audio {
 	// 0-128, negative goes back to the global volume
 	void setStreamVolume (int streamId, int volume) const;
 
-	// left/right gains on top of the volume
 	void setStreamGains (int streamId, float left, float right) const;
 
 	void setStreamPaused (int streamId, bool paused) const;
 	/** Stops the stream like OpenAL's alSourceStop (one more silent update, see AudioDriver) and frees it */
 	void stopStream (int streamId, std::unique_ptr<AudioStream> stream) const;
 	void setStreamHrtf (int streamId, const Drivers::StreamHrtf* hrtf) const;
-	/** The HRTF data set while sound objects render for headphones, nullptr otherwise */
 	[[nodiscard]] const Hrtf::Store* getHrtf () const;
 
 	// TODO: our own format definitions instead of ffmpeg's?
@@ -59,5 +57,5 @@ namespace Audio {
     private:
 	Drivers::AudioDriver& m_driver;
     };
-} // namespace Audio
-} // namespace WallpaperEngine
+}
+}

+ 2 - 6
src/WallpaperEngine/Audio/AudioStream.cpp

@@ -15,7 +15,7 @@ constexpr uint32_t MixerFracOne = 1 << MixerFracBits;
 constexpr uint32_t MixerFracMask = MixerFracOne - 1;
 constexpr uint32_t MaxPitch = 10;
 constexpr size_t MaxResamplerPadding = 48;
-} // namespace
+}
 
 int audio_read_thread (void* arg) {
     SDL_mutex* waitMutex = SDL_CreateMutex ();
@@ -29,7 +29,6 @@ int audio_read_thread (void* arg) {
 
     while (ret >= 0 && stream->getAudioContext ().getApplicationContext ().state.general.keepRunning
 	   && stream->isInitialized ()) {
-	// give the cpu some time to play the queued frames if there's enough info there
 	if (stream->getQueueSize () >= MAX_QUEUE_SIZE
 	    || (stream->getQueuePacketCount () > MIN_FRAMES
 		&& (av_q2d (stream->getTimeBase ()) * stream->getQueueDuration () > 1.0))) {
@@ -86,7 +85,6 @@ static int audio_read_data_callback (void* streamarg, uint8_t* buffer, int buffe
 int64_t audio_seek_data_callback (void* streamarg, int64_t offset, int whence) {
     const auto stream = static_cast<AudioStream*> (streamarg);
 
-    // reset error state
     stream->getBuffer ()->clear ();
 
     if (whence & AVSEEK_SIZE) {
@@ -163,7 +161,6 @@ AudioStream::~AudioStream () {
 	av_frame_free (&this->m_decodeFrame);
     }
     if (this->m_queue != nullptr && this->m_queue->packetList != nullptr) {
-	// the packets the decoder never took
 	MyAVPacketList entry {};
 
 #if FF_API_FIFO_OLD_API
@@ -180,7 +177,7 @@ AudioStream::~AudioStream () {
 	}
 
 	av_fifo_freep2 (&this->m_queue->packetList);
-#endif /* FF_API_FIFO_OLD_API */
+#endif
     }
 
     if (this->m_queue != nullptr) {
@@ -376,7 +373,6 @@ void AudioStream::queueLoopMarker () {
 	return;
     }
 
-    // empty packet, recognised by its stream index
     marker->stream_index = NO_AUDIO_STREAM;
 
     SDL_LockMutex (this->m_queue->mutex);

+ 1 - 12
src/WallpaperEngine/Audio/AudioStream.h

@@ -50,10 +50,8 @@ public:
     // next packet into m_decodePacket without waiting; Empty if nothing is queued yet, Finished once nothing will be
     Dequeued dequeuePacket ();
 
-    // from the reader thread when a repeating stream starts over
     void queueLoopMarker ();
 
-    // from the reader thread once it won't queue more packets
     void markReaderFinished ();
 
     [[nodiscard]] AudioContext& getAudioContext () const;
@@ -62,9 +60,7 @@ public:
     [[nodiscard]] AVFormatContext* getFormatContext () const;
     [[nodiscard]] int getAudioStream () const;
     [[nodiscard]] bool isInitialized () const;
-    // seconds, 0 if the container doesn't say
     [[nodiscard]] double getDuration () const;
-    // before resampling to the driver's layout
     [[nodiscard]] int getSourceChannels () const;
     void setRepeat (bool newRepeat = true);
     [[nodiscard]] bool isRepeat () const;
@@ -73,7 +69,6 @@ public:
     [[nodiscard]] SDL_cond* getWaitCondition () const;
     [[nodiscard]] size_t getQueueSize () const;
     [[nodiscard]] int getQueuePacketCount () const;
-    // seconds
     [[nodiscard]] int64_t getQueueDuration () const;
     [[nodiscard]] AVRational getTimeBase () const;
 
@@ -85,7 +80,6 @@ public:
     // how OpenAL splits the next update into mixing passes (Voice::mix), at most BufferLineSize source frames each
     [[nodiscard]] std::vector<int> passes (int frames) const;
 
-    /** Whether the voice played past the file's end, OpenAL then stops it after the current update */
     [[nodiscard]] bool ended () const;
 
     // a stopping voice's last update without buffers: up to 24 upcoming frames, cut per channel before the one closest
@@ -94,13 +88,10 @@ public:
 
 private:
     void loadCustomContent (const char* filename = nullptr);
-    /** Converts the decoded frame to float in the driver's channel layout at the file's rate, onto m_source */
     bool convertFrame ();
-    /** Converts what the converter still holds once the decoder is drained */
     void flushConverter ();
     // decodes the next frame onto m_source without waiting: 1 added, 0 nothing queued, -1 end or error
     int decodeSource ();
-    /** Makes sure m_source holds this many frames past the read position, unless the file ends first */
     void fillSource (size_t frames);
     [[nodiscard]] const float* sourceFrame (size_t frame) const;
     bool doQueue (AVPacket* pkt);
@@ -110,7 +101,6 @@ private:
     AudioContext& m_audioContext;
     std::atomic<bool> m_initialized = false;
     std::atomic<bool> m_repeat = false;
-    /** Set once the reader thread has exited, so nothing waits for packets that will never come */
     std::atomic<bool> m_readerFinished = false;
     AVCodecContext* m_context = nullptr;
     AVFormatContext* m_formatContext = nullptr;
@@ -121,7 +111,6 @@ private:
 	AVPacket* packet;
     };
 
-    /** decoded frames at the file's rate, interleaved; m_sourcePos and m_sourceFrac are the voice position in it */
     std::vector<float> m_source;
     int m_channels = 0;
     size_t m_sourcePos = 0;
@@ -150,4 +139,4 @@ private:
     // std::thread, not SDL_Thread: SDL_WaitThread doesn't join anymore once SDL_Quit ran (sdl2-compat)
     std::thread m_audioThread;
 };
-} // namespace WallpaperEngine::Audio
+}

+ 1 - 2
src/WallpaperEngine/Audio/Drivers/AudioDriver.cpp

@@ -5,7 +5,6 @@ AudioDriver::AudioDriver (
     Application::ApplicationContext& applicationContext, Detectors::AudioPlayingDetector& detector,
     Recorders::PlaybackRecorder& recorder
 ) : m_applicationContext (applicationContext), m_detector (detector), m_recorder (&recorder) {
-    // perform a few update cycles to ensure data is ready before anything actually uses the audio
     this->AudioDriver::update (0.0f);
     this->AudioDriver::update (0.0f);
 }
@@ -22,4 +21,4 @@ Detectors::AudioPlayingDetector& AudioDriver::getAudioDetector () const { return
 Recorders::PlaybackRecorder& AudioDriver::getRecorder () const { return *this->m_recorder; }
 
 void AudioDriver::setRecorder (Recorders::PlaybackRecorder& recorder) { this->m_recorder = &recorder; }
-} // namespace WallpaperEngine::Audio::Drivers
+}

+ 3 - 9
src/WallpaperEngine/Audio/Drivers/AudioDriver.h

@@ -25,7 +25,6 @@ namespace Audio {
 	    class PulseAudioPlaybackRecorder;
 	}
 
-	/** HRTF filters of a stream, one per input channel it uses: a mono file's first channel, a stereo file's two */
 	struct StreamHrtf {
 	    int channels = 1;
 	    std::array<Hrtf::Filter, 2> filters {};
@@ -47,19 +46,15 @@ namespace Audio {
 	    // 0-128, negative goes back to the global volume
 	    virtual void setStreamVolume (int streamId, int volume) = 0;
 
-	    // per channel gains on top of the volume
 	    virtual void setStreamGains (int streamId, float left, float right) = 0;
 
-	    // a paused stream keeps its position and isn't decoded
 	    virtual void setStreamPaused (int streamId, bool paused) = 0;
 	    // stops like an OpenAL source: one more update without new audio (an HRTF voice's delay fades out), then
 	    // removed
 	    virtual void stopStream (int streamId, std::unique_ptr<AudioStream> stream) {
 		this->removeStream (streamId);
 	    }
-	    // mixes through HRTF with these filters while it's on, nullptr goes back to the channel gains
 	    virtual void setStreamHrtf (int streamId, const StreamHrtf* hrtf) { }
-	    // at the output rate while headphones rendering is on, nullptr otherwise
 	    [[nodiscard]] virtual const Hrtf::Store* getHrtf () const { return nullptr; }
 
 	    // dt is seconds since the previous frame, scaled by the playback speed
@@ -70,7 +65,6 @@ namespace Audio {
 	    [[nodiscard]] virtual int getSampleRate () const = 0;
 	    [[nodiscard]] virtual int getChannels () const = 0;
 	    Application::ApplicationContext& getApplicationContext () const;
-	    // stops sound when something else starts playing
 	    [[nodiscard]] Detectors::AudioPlayingDetector& getAudioDetector () const;
 	    [[nodiscard]] Recorders::PlaybackRecorder& getRecorder () const;
 	    void setRecorder (Recorders::PlaybackRecorder& recorder);
@@ -80,6 +74,6 @@ namespace Audio {
 	    Detectors::AudioPlayingDetector& m_detector;
 	    Recorders::PlaybackRecorder* m_recorder;
 	};
-    } // namespace Drivers
-} // namespace Audio
-} // namespace WallpaperEngine
+    }
+}
+}

+ 1 - 1
src/WallpaperEngine/Audio/Drivers/Detectors/AudioPlayingDetector.cpp

@@ -20,4 +20,4 @@ void AudioPlayingDetector::setIsPlaying (const bool newState) { this->m_isPlayin
 
 void AudioPlayingDetector::update () { }
 
-} // namespace WallpaperEngine::Audio::Drivers::Detectors
+}

+ 2 - 2
src/WallpaperEngine/Audio/Drivers/Detectors/AudioPlayingDetector.h

@@ -38,5 +38,5 @@ namespace Audio::Drivers::Detectors {
 	Application::ApplicationContext& m_applicationContext;
 	const Render::Drivers::Detectors::FullScreenDetector& m_fullscreenDetector;
     };
-} // namespace Audio::Drivers::Detectors
-} // namespace WallpaperEngine
+}
+}

+ 1 - 4
src/WallpaperEngine/Audio/Drivers/Detectors/HeadphonesDetector.cpp

@@ -18,7 +18,6 @@ bool isHeadphones (const pa_sink_info& info) {
 	return false;
     }
 
-    // PulseAudio's name for it, and PipeWire's own spelling
     if (isHeadphonesFormFactor (pa_proplist_gets (info.proplist, PA_PROP_DEVICE_FORM_FACTOR))
 	|| isHeadphonesFormFactor (pa_proplist_gets (info.proplist, "device.form-factor"))) {
 	return true;
@@ -38,12 +37,11 @@ bool isHeadphones (const pa_sink_info& info) {
     // what OpenAL Soft's own PulseAudio backend checks
     return std::strcmp (info.active_port->name, "analog-output-headphones") == 0;
 }
-} // namespace
+}
 
 HeadphonesDetector::HeadphonesDetector () {
     this->m_mainloop = pa_threaded_mainloop_new ();
 
-    // the first connection doesn't wait for a server, the sounds start right after this
     this->connect (PA_CONTEXT_NOFLAGS);
 
     if (pa_threaded_mainloop_start (this->m_mainloop) < 0) {
@@ -180,7 +178,6 @@ void HeadphonesDetector::contextState (pa_context* context, void* userdata) {
 }
 
 void HeadphonesDetector::subscription (pa_context*, pa_subscription_event_type_t, uint32_t, void* userdata) {
-    // a port switch (headphones plugged in) is a sink change, a new default sink a server change
     static_cast<HeadphonesDetector*> (userdata)->query ();
 }
 

+ 1 - 1
src/WallpaperEngine/Audio/Drivers/Detectors/HeadphonesDetector.h

@@ -40,4 +40,4 @@ private:
     bool m_wasReady = false;
     bool m_startupExpired = false;
 };
-} // namespace WallpaperEngine::Audio::Drivers::Detectors
+}

+ 1 - 2
src/WallpaperEngine/Audio/Drivers/Detectors/PulseAudioPlayingDetector.cpp

@@ -42,7 +42,6 @@ PulseAudioPlayingDetector::PulseAudioPlayingDetector (
 
     pa_context_connect (this->m_context, nullptr, PA_CONTEXT_NOFLAGS, nullptr);
 
-    // wait until pulseaudio accepts the connection
     while (pa_context_get_state (this->m_context) != PA_CONTEXT_READY) {
 	pa_mainloop_iterate (this->m_mainloop, 1, nullptr);
     }
@@ -77,4 +76,4 @@ void PulseAudioPlayingDetector::update () {
 
     pa_operation_unref (op);
 }
-} // namespace WallpaperEngine::Audio::Drivers::Detectors
+}

+ 1 - 1
src/WallpaperEngine/Audio/Drivers/Detectors/PulseAudioPlayingDetector.h

@@ -20,4 +20,4 @@ private:
     pa_mainloop_api* m_mainloopApi = nullptr;
     pa_context* m_context = nullptr;
 };
-} // namespace WallpaperEngine::Audio::Drivers::Detectors
+}

+ 1 - 2
src/WallpaperEngine/Audio/Drivers/PulseProcessVolume.cpp

@@ -31,7 +31,7 @@ pid_t parentOf (pid_t pid) {
 
     return fields >> state >> parent ? static_cast<pid_t> (parent) : 0;
 }
-} // namespace
+}
 
 PulseProcessVolume::PulseProcessVolume (pid_t root) : m_root (root) {
     this->m_loop = pa_mainloop_new ();
@@ -77,7 +77,6 @@ void PulseProcessVolume::setVolume (float factor) {
     this->m_factor = factor;
 
     if (this->m_context == nullptr || pa_context_get_state (this->m_context) != PA_CONTEXT_READY) {
-	// onState() applies it once connected
 	return;
     }
 

+ 1 - 3
src/WallpaperEngine/Audio/Drivers/PulseProcessVolume.h

@@ -18,7 +18,6 @@ public:
     PulseProcessVolume (const PulseProcessVolume&) = delete;
     PulseProcessVolume& operator= (const PulseProcessVolume&) = delete;
 
-    /** amplitude factor like SDL's volume / 128 */
     void setVolume (float factor);
 
     void update ();
@@ -37,8 +36,7 @@ private:
     float m_factor = 1.0f;
     pa_mainloop* m_loop = nullptr;
     pa_context* m_context = nullptr;
-    /** sink input index -> whether it is ours */
     std::map<uint32_t, bool> m_known;
     std::chrono::steady_clock::time_point m_retryAt {};
 };
-} // namespace WallpaperEngine::Audio::Drivers
+}

+ 1 - 1
src/WallpaperEngine/Audio/Drivers/Recorders/PlaybackRecorder.cpp

@@ -37,4 +37,4 @@ void PlaybackRecorder::notifySpectrumListeners (const float* bands) {
     }
 }
 
-} // namespace WallpaperEngine::Audio::Drivers::Recorders
+}

+ 1 - 4
src/WallpaperEngine/Audio/Drivers/Recorders/PlaybackRecorder.h

@@ -12,12 +12,10 @@ class PlaybackRecorder {
     Audio::SpectrumProcessor m_processor;
 
 public:
-    /** [left 64 | right 64] bands per analyzed block (zeros once quiet), called on the capture thread */
     using SpectrumListener = std::function<void (const float* bands)>;
 
     virtual ~PlaybackRecorder () = default;
 
-    // once per rendered frame, latest spectrum into audio16/32/64
     virtual void update (float dt);
 
     /** Guards the captured spectrum for recorders that fill it from a background capture thread; no-op by default */
@@ -37,7 +35,6 @@ public:
 protected:
     void notifySpectrumListeners (const float* bands);
 
-    /** [left 64 | right 64] linear band levels from the capture thread, guarded by lock()/unlock() */
     float m_captured[128] = { 0 };
 
 private:
@@ -45,4 +42,4 @@ private:
     std::map<int, SpectrumListener> m_listeners;
     int m_nextListenerId = 0;
 };
-} // namespace WallpaperEngine::Audio::Drivers::Recorders
+}

+ 4 - 13
src/WallpaperEngine/Audio/Drivers/Recorders/PulseAudioPlaybackRecorder.cpp

@@ -16,7 +16,6 @@ namespace {
     constexpr int CAPTURE_CHANNELS = 2;
     constexpr auto CAPTURE_TIMEOUT = std::chrono::milliseconds (1000);
 
-    // timestamps for the debug capture markers (audio-to-visual delay)
     std::string wallClockTimestamp () {
 	const auto now = std::chrono::system_clock::now ();
 	const auto ms = std::chrono::duration_cast<std::chrono::milliseconds> (now.time_since_epoch ()) % 1000;
@@ -28,11 +27,11 @@ namespace {
 	oss << std::put_time (&tmBuf, "%H:%M:%S") << '.' << std::setfill ('0') << std::setw (3) << ms.count ();
 	return oss.str ();
     }
-} // namespace
+}
 
 void pa_server_info_cb (pa_context* ctx, const pa_server_info* info, void* userdata);
 
-void pa_retry_capture_cb (pa_mainloop_api* api, pa_time_event* event, const struct timeval* /*tv*/, void* userdata) {
+void pa_retry_capture_cb (pa_mainloop_api* api, pa_time_event* event, const struct timeval*, void* userdata) {
     auto* recorder = static_cast<PulseAudioPlaybackRecorder::PulseAudioData*> (userdata);
 
     api->time_free (event);
@@ -86,11 +85,9 @@ void pa_stream_notify_cb (pa_stream* stream, void* userdata) {
     }
 }
 
-void pa_stream_read_cb (pa_stream* stream, const size_t /*nbytes*/, void* userdata) {
+void pa_stream_read_cb (pa_stream* stream, const size_t, void* userdata) {
     auto* recorder = static_cast<PulseAudioPlaybackRecorder::PulseAudioData*> (userdata);
 
-    // Careful when to pa_stream_peek() and pa_stream_drop()!
-    // c.f. https://www.freedesktop.org/software/pulseaudio/doxygen/stream_8h.html#ac2838c449cde56e169224d7fe3d00824
     const void* data = nullptr;
     size_t currentSize;
     if (pa_stream_peek (stream, &data, &currentSize) != 0) {
@@ -103,7 +100,6 @@ void pa_stream_read_cb (pa_stream* stream, const size_t /*nbytes*/, void* userda
     }
 
     if (data == nullptr && currentSize > 0) {
-	// Hole in the buffer. We must drop it.
 	recorder->owner->dropBlock ();
 
 	if (pa_stream_drop (stream) != 0) {
@@ -165,7 +161,6 @@ void pa_server_info_cb (pa_context* ctx, const pa_server_info* info, void* userd
 
     pa_buffer_attr attr {};
 
-    // 10 = latency msecs, 750 = max msecs to store
     size_t bytesPerSec = pa_bytes_per_second (&spec);
     attr.fragsize = bytesPerSec * 10 / 1000;
     attr.maxlength = attr.fragsize + bytesPerSec * 750 / 1000;
@@ -179,7 +174,6 @@ void pa_server_info_cb (pa_context* ctx, const pa_server_info* info, void* userd
 }
 
 void pa_context_subscribe_cb (pa_context* ctx, pa_subscription_event_type_t t, uint32_t idx, void* userdata) {
-    // sink changes mean re-take the stream
     pa_operation* o = pa_context_get_server_info (ctx, &pa_server_info_cb, userdata);
     if (o) {
 	pa_operation_unref (o);
@@ -203,7 +197,6 @@ void pa_context_notify_cb (pa_context* ctx, void* userdata) {
 		    pa_operation_unref (o);
 		}
 
-		// a ready context fetches the sink too
 		pa_operation* o2 = pa_context_get_server_info (ctx, &pa_server_info_cb, userdata);
 
 		if (o2) {
@@ -254,7 +247,6 @@ PulseAudioPlaybackRecorder::PulseAudioPlaybackRecorder () :
 PulseAudioPlaybackRecorder::~PulseAudioPlaybackRecorder () {
     this->m_running.store (false, std::memory_order_relaxed);
     if (this->m_mainloop) {
-	// unblocks the pa_mainloop_poll() the capture thread may be waiting in
 	pa_mainloop_wakeup (this->m_mainloop);
     }
     if (this->m_captureThread.joinable ()) {
@@ -283,7 +275,6 @@ void PulseAudioPlaybackRecorder::captureLoop () {
     bool cleared = false;
 
     while (this->m_running.load (std::memory_order_relaxed)) {
-	// time out so a stream that stopped delivering (suspended sink) is noticed
 	if (pa_mainloop_prepare (this->m_mainloop, 100 * 1000) < 0 || pa_mainloop_poll (this->m_mainloop) < 0
 	    || pa_mainloop_dispatch (this->m_mainloop) < 0) {
 	    break;
@@ -324,4 +315,4 @@ void PulseAudioPlaybackRecorder::consumeSamples (const float* samples, std::size
     }
 }
 
-} // namespace WallpaperEngine::Audio::Drivers::Recorders
+}

+ 1 - 3
src/WallpaperEngine/Audio/Drivers/Recorders/PulseAudioPlaybackRecorder.h

@@ -28,7 +28,6 @@ public:
     void unlock () const override;
 
     void consumeSamples (const float* samples, std::size_t frames);
-    /** A gap in the capture, the block being collected is thrown away like WE does on a silent packet */
     void dropBlock ();
 
 private:
@@ -44,9 +43,8 @@ private:
     WallpaperEngine::Audio::SpectrumAnalyzer m_analyzer;
     std::chrono::steady_clock::time_point m_lastSamples = std::chrono::steady_clock::now ();
 
-    // own thread so capture keeps draining however long a frame takes
     std::thread m_captureThread;
     mutable SDL_mutex* m_dataMutex = nullptr;
     std::atomic<bool> m_running { true };
 };
-} // namespace WallpaperEngine::Audio::Drivers::Recorders
+}

+ 1 - 11
src/WallpaperEngine/Audio/Drivers/SDLAudioDriver.cpp

@@ -5,7 +5,6 @@
 #include <cfloat>
 #include <cstring>
 
-// how much SDL asks for at once, the mixing itself runs in WE's update size (m_updateFrames)
 #define SDL_AUDIO_BUFFER_SIZE 1024
 
 using namespace WallpaperEngine::Audio;
@@ -46,7 +45,6 @@ void audio_callback (void* userdata, uint8_t* streamData, int length) {
 
     memset (streamData, 0, length);
 
-    // do nothing while other audio plays
     if (driver->getAudioDetector ().anythingPlaying ()) {
 	return;
     }
@@ -55,7 +53,7 @@ void audio_callback (void* userdata, uint8_t* streamData, int length) {
 	reinterpret_cast<float*> (streamData), length / static_cast<int> (sizeof (float)) / driver->getChannels ()
     );
 }
-} // namespace
+}
 
 void SDLAudioDriver::render (float* out, int frames) {
     const int channels = this->m_audioSpec.channels;
@@ -157,7 +155,6 @@ void SDLAudioDriver::mixUpdate (float* out, int frames) {
 	    // loaded last time instead
 	    buffer->stream->stopTail (update.data (), frames);
 	} else {
-	    // this update's audio: what a pause held back first, then newly decoded data
 	    const size_t replayed = std::min (buffer->replay.size (), update.size ());
 
 	    std::copy_n (buffer->replay.begin (), replayed, update.begin ());
@@ -169,7 +166,6 @@ void SDLAudioDriver::mixUpdate (float* out, int frames) {
 		const int read
 		    = buffer->stream->read (update.data () + static_cast<size_t> (filled) * channels, frames - filled);
 
-		// 0: nothing decoded yet, wake the reader
 		if (read <= 0) {
 		    if (read == 0) {
 			SDL_CondSignal (buffer->stream->getWaitCondition ());
@@ -189,7 +185,6 @@ void SDLAudioDriver::mixUpdate (float* out, int frames) {
 	    }
 	}
 
-	// mix the audio, using this stream's own volume override if it has one
 	const int streamVolume = buffer->volume.load (std::memory_order_relaxed);
 	const int volume = streamVolume >= 0 ? streamVolume : this->getApplicationContext ().state.audio.volume;
 	const float scale = static_cast<float> (volume) / static_cast<float> (SDL_MIX_MAXVOLUME);
@@ -323,7 +318,6 @@ SDLAudioDriver::SDLAudioDriver (
 					  .callback = audio_callback,
 					  .userdata = this };
 
-    // mixing is done in float like OpenAL's, SDL converts to whatever the device takes
     this->m_deviceID = SDL_OpenAudioDevice (
 	nullptr, false, &requestedSpec, &this->m_audioSpec,
 	SDL_AUDIO_ALLOW_FREQUENCY_CHANGE | SDL_AUDIO_ALLOW_CHANNELS_CHANGE | SDL_AUDIO_ALLOW_SAMPLES_CHANGE
@@ -354,7 +348,6 @@ SDLAudioDriver::~SDLAudioDriver () {
 	    SDL_CloseAudioDevice (this->m_deviceID);
 	}
 
-	// streams still fading out belong to the driver
 	for (const auto* buffer : this->m_streams | std::views::values) {
 	    delete buffer;
 	}
@@ -408,7 +401,6 @@ void SDLAudioDriver::setStreamVolume (int streamId, int volume) {
 }
 
 void SDLAudioDriver::setStreamGains (int streamId, float left, float right) {
-    // same reasoning as setStreamVolume, the gains are atomics read by the callback
     if (const auto it = this->m_streams.find (streamId); it != this->m_streams.end ()) {
 	it->second->gainLeft.store (left, std::memory_order_relaxed);
 	it->second->gainRight.store (right, std::memory_order_relaxed);
@@ -457,7 +449,6 @@ void SDLAudioDriver::updateHrtf () {
 
     const auto mode = this->getApplicationContext ().settings.audio.hrtf;
 
-    // created the first time auto is the mode, from the command line or a control file
     if (mode == Application::ApplicationContext::HRTF_AUTO && this->m_headphonesDetector == nullptr
 	&& this->getApplicationContext ().settings.audio.enabled) {
 	this->m_headphonesDetector = std::make_unique<Detectors::HeadphonesDetector> ();
@@ -507,7 +498,6 @@ void SDLAudioDriver::stopStream (int streamId, std::unique_ptr<AudioStream> stre
 
     SDL_UnlockMutex (this->m_streamListMutex);
 
-    // not registered (or no device): nothing to fade, the stream goes right away
     if (stream != nullptr) {
 	this->removeStream (streamId);
     }

+ 1 - 12
src/WallpaperEngine/Audio/Drivers/SDLAudioDriver.h

@@ -36,7 +36,6 @@ struct SDLAudioBuffer {
     bool pauseFaded = false;
     std::vector<float> replay;
 
-    /** set by setStreamHrtf on the render thread */
     std::mutex hrtfMutex;
     bool hrtfSet = false;
     StreamHrtf hrtf {};
@@ -44,11 +43,8 @@ struct SDLAudioBuffer {
     /** audio callback only: the filters of this callback, OpenAL's voice state and the decoded input */
     StreamHrtf hrtfMixing {};
     std::array<Hrtf::Channel, 2> hrtfChannels {};
-    /** OpenAL's VoiceIsFading, set after a voice's first update */
     bool hrtfFading = false;
-    /** this update's fade length once fading: the update, or less for a voice stopping without its buffer */
     int hrtfCounter = 0;
-    /** this update's mixing passes, see AudioStream::passes */
     std::vector<int> hrtfPasses;
     unsigned hrtfGeneration = 0;
     std::array<std::vector<float>, 2> hrtfSamples {};
@@ -73,7 +69,6 @@ public:
 
     void update (float dt) override;
 
-    /** Fills the device buffer from whole updates of m_updateFrames, mixing more as needed (the SDL callback) */
     void render (float* out, int frames);
 
     [[nodiscard]] AVSampleFormat getFormat () const override;
@@ -88,19 +83,15 @@ private:
     SDL_AudioSpec m_audioSpec {};
     std::map<int, SDLAudioBuffer*> m_streams {};
 
-    /** The HRTF mixer while headphones rendering is on, nullptr otherwise; for the audio callback */
     [[nodiscard]] Hrtf::Mixer* getHrtfMixer () const;
     /** Changes every time HRTF is turned on, voices and the mixer start over then */
     [[nodiscard]] unsigned getHrtfGeneration () const;
-    /** One OpenAL update (aluMixData) of every stream into out, frames * channels floats */
     void mixUpdate (float* out, int frames);
-    /** OpenAL's HRTF path for the voices of one update: convolve, then ProcessHrtf, added to out */
     void mixHrtf (const std::vector<SDLAudioBuffer*>& voices, float* out, int frames);
 
     // frames WE's OpenAL Soft mixes per update: its 20 ms default (882 at 44.1 kHz) as a multiple of the WASAPI period
     // at the device rate (sub_180186400)
     int m_updateFrames = 960;
-    /** mixed updates the device hasn't taken yet */
     std::vector<float> m_pending;
     /** audio callback only */
     std::vector<float> m_update;
@@ -108,9 +99,7 @@ private:
     std::array<std::vector<float>, 2> m_hrtfOutput;
     unsigned m_hrtfMixerGeneration = 0;
 
-    /** Frees the streams stopStream faded out */
     void releaseFinishedStreams ();
-    /** Turns HRTF on or off by the --hrtf mode and the default output, like OpenAL Soft's aluInitRenderer */
     void updateHrtf ();
 
     std::unique_ptr<Detectors::HeadphonesDetector> m_headphonesDetector;
@@ -121,4 +110,4 @@ private:
     std::atomic<bool> m_hrtfEnabled { false };
     std::atomic<unsigned> m_hrtfGeneration { 0 };
 };
-} // namespace WallpaperEngine::Audio::Drivers
+}

+ 1 - 7
src/WallpaperEngine/Audio/Hrtf.cpp

@@ -16,7 +16,6 @@ constexpr float Tau = 6.28318530717958647692f;
 constexpr unsigned MinIrLength = 8;
 constexpr unsigned MaxHrirDelay = HistoryLength - 1;
 constexpr unsigned HrirDelayFracOne = 4;
-/** first value of the pass-through coefficients, for omnidirectional sounds */
 constexpr float PassthruCoeff = 0.707106781187f;
 
 unsigned float2uint (float value) { return static_cast<unsigned> (static_cast<int> (value)); }
@@ -49,7 +48,6 @@ public:
 	const double* f = this->m_filter.data ();
 
 	for (unsigned i = 0; i < outN; i++) {
-	    // input starts at l to drop the filter delay
 	    size_t jf = (l + q * i) % p;
 	    size_t js = (l + q * i) / p;
 	    double r = 0.0;
@@ -165,7 +163,6 @@ public:
 	return value;
     }
 
-    /** readle<int,24> */
     int read24 () {
 	constexpr int signbit = 1 << 23;
 
@@ -179,7 +176,6 @@ private:
     bool m_good = true;
 };
 
-/** LoadHrtf03, the format of the built-in set */
 std::unique_ptr<Store> loadHrtf03 (Reader& data) {
     auto store = std::make_unique<Store> ();
 
@@ -280,7 +276,6 @@ std::unique_ptr<Store> loadHrtf03 (Reader& data) {
     return store;
 }
 
-/** GetLoadedHrtf's conversion to the device rate */
 void resample (Store& store, unsigned deviceRate) {
     std::array<std::array<double, HrirLength>, 2> inout {};
     const PolyphaseResampler resampler (store.sampleRate, deviceRate);
@@ -364,7 +359,7 @@ void applyCoeffs (std::array<float, 2>* values, unsigned irSize, const HrirArray
 	values[c][1] += coeffs[c][1] * right;
     }
 }
-} // namespace
+}
 
 std::unique_ptr<Store> WallpaperEngine::Audio::Hrtf::loadDefault (unsigned deviceRate) {
     if (sizeof (DEFAULT_HRTF) < 8 || std::memcmp (DEFAULT_HRTF, "MinPHR03", 8) != 0) {
@@ -394,7 +389,6 @@ void WallpaperEngine::Audio::Hrtf::getCoeffs (
 ) {
     const float dirfact = 1.0f - spread / Tau;
 
-    // the first field nearer than the distance, the nearest one at most
     size_t field = 0;
     size_t ebase = 0;
 

+ 1 - 7
src/WallpaperEngine/Audio/Hrtf.h

@@ -12,7 +12,6 @@ namespace WallpaperEngine::Audio::Hrtf {
 constexpr unsigned HistoryLength = 64;
 constexpr unsigned HrirLength = 128;
 constexpr unsigned DirectDelay = 256;
-/** OpenAL Soft's mixing granularity, the most samples one update mixes */
 constexpr unsigned BufferLineSize = 1024;
 
 using HrirArray = std::array<std::array<float, 2>, HrirLength>;
@@ -38,7 +37,6 @@ struct Store {
     std::vector<std::array<uint8_t, 2>> delays;
 };
 
-/** The built-in data set ("Built-In HRTF") loaded for the given output rate, nullptr if it can't be read */
 std::unique_ptr<Store> loadDefault (unsigned deviceRate);
 
 struct Filter {
@@ -47,16 +45,13 @@ struct Filter {
     float gain = 0.0f;
 };
 
-/** GetHrtfCoeffs: blended impulse response and delays for a direction (radians), normalized like OpenAL's */
 void getCoeffs (const Store& store, float elevation, float azimuth, float distance, float spread, Filter& out);
 
-/** Mixing state of one input channel of a voice */
 struct Channel {
     std::array<float, HistoryLength> history {};
     Filter old {};
 };
 
-/** The device side: the accumulation buffer every voice convolves into, read out with OpenAL's direct delay */
 class Mixer {
 public:
     explicit Mixer (unsigned irSize);
@@ -67,7 +62,6 @@ public:
 	Channel& channel, const Filter& target, const float* samples, unsigned count, unsigned counter,
 	unsigned outPos = 0
     );
-    /** ProcessHrtf without ambisonic input: count samples of left/right out, then shifts the accumulator */
     void finish (float* left, float* right, unsigned count);
     void clear ();
 
@@ -78,4 +72,4 @@ private:
     std::vector<std::array<float, 2>> m_accum;
     std::vector<float> m_samples;
 };
-} // namespace WallpaperEngine::Audio::Hrtf
+}

+ 1 - 1
src/WallpaperEngine/Audio/SpectrumAnalyzer.cpp

@@ -15,7 +15,7 @@ constexpr float SIZE_FACTOR = 30.0f;
 constexpr float BIN_FACTOR = 10.0f;
 // "audioinputvolume" (default 50) * 0.02
 constexpr float GAIN = 1.0f;
-} // namespace
+}
 
 SpectrumAnalyzer::SpectrumAnalyzer (int sampleRate) {
     const float rateScale = std::max (static_cast<float> (sampleRate) / 44100.0f, 1.0f);

+ 1 - 2
src/WallpaperEngine/Audio/SpectrumAnalyzer.h

@@ -22,7 +22,6 @@ public:
     // right 64] when a block completed
     bool feed (const float* samples, std::size_t frames, int channels, float* bands);
 
-    /** Drops the partially filled block, WE does this on silent packets and capture errors */
     void reset ();
 
     [[nodiscard]] int getFFTSize () const { return this->m_size; }
@@ -39,4 +38,4 @@ private:
     std::vector<kiss_fft_cpx> m_input[2];
     std::vector<kiss_fft_cpx> m_output;
 };
-} // namespace WallpaperEngine::Audio
+}

+ 1 - 1
src/WallpaperEngine/Audio/SpectrumProcessor.cpp

@@ -7,7 +7,7 @@ using namespace WallpaperEngine::Audio;
 
 namespace {
 constexpr float SILENCE = 0.0001f;
-} // namespace
+}
 
 void SpectrumProcessor::update (const float* raw, float dt) {
     dt = std::clamp (dt, SILENCE, 0.25f);

+ 1 - 2
src/WallpaperEngine/Audio/SpectrumProcessor.h

@@ -7,7 +7,6 @@ class SpectrumProcessor {
 public:
     static constexpr int GROUPS = 16;
 
-    // raw is [left 64 | right 64] from SpectrumAnalyzer, dt already scaled by playback speed
     void update (const float* raw, float dt);
 
     float audio16[16 * 3] = { 0 };
@@ -21,4 +20,4 @@ private:
     float m_smoothed[128] = { 0 };
     float m_output[128] = { 0 };
 };
-} // namespace WallpaperEngine::Audio
+}

+ 0 - 6
src/WallpaperEngine/Data/Assets/Texture.h

@@ -112,7 +112,6 @@ struct MipmapPatch {
 struct Mipmap {
     uint32_t width = 0;
     uint32_t height = 0;
-    /** Only set on volume textures */
     uint32_t depth = 1;
     uint32_t compression = 0;
     int uncompressedSize = 0;
@@ -120,18 +119,15 @@ struct Mipmap {
     std::unique_ptr<char[]> compressedData = nullptr;
     std::unique_ptr<char[]> uncompressedData = nullptr;
     std::vector<MipmapPatch> patches {};
-    /** RGBA pixels with the patches of the conditions that hold already applied, used instead of decoding the data */
     std::vector<unsigned char> composedPixels {};
 };
 
-/** A TEXB0004 condition: while the user property holds, patches with this key get applied */
 struct TextureCondition {
     /** Only the first condition that holds within a group counts */
     uint32_t group = 0;
     uint32_t key = 0;
     /** Bit 0 blends the patch by its alpha, bit 1 replaces the whole mipmap with the patch's raw data */
     uint32_t flags = 0;
-    /** {"condition": "<bool property>"} or {"condition": {"name": "<property>", "condition": "<value>"}} */
     std::string json {};
 };
 
@@ -150,14 +146,12 @@ struct Texture {
     /** The number after TEXB / TEXS (sub_14015E580) */
     uint32_t containerVersion = 0;
     uint32_t animatedVersion = 0;
-    // TextureFlags bitmask
     uint32_t flags = TextureFlags_NoFlags;
     uint32_t width = 0;
     uint32_t height = 0;
     /** Texture size in memory (power of 2), as opposed to real width/height above */
     uint32_t textureWidth = 0;
     uint32_t textureHeight = 0;
-    /** Only set on volume textures */
     uint32_t depth = 1;
     uint32_t gifWidth = 0;
     uint32_t gifHeight = 0;

+ 1 - 1
src/WallpaperEngine/Data/Builders/UserSettingBuilder.h

@@ -17,4 +17,4 @@ public:
 	});
     }
 };
-} // namespace WallpaperEngine::Data::Builders
+}

+ 1 - 3
src/WallpaperEngine/Data/Builders/VectorBuilder.h

@@ -15,7 +15,6 @@ using namespace WallpaperEngine::Data::Utils::SFINAE;
 class VectorBuilder {
     template <typename type> static type convert (const char* str);
 
-    /** Some scenes write vectors as "x,y,z" or pad them with extra spaces ("x  y"), reduce them to "x y z" */
     static std::string normalizeSeparators (const std::string& str) {
 	std::string result;
 	result.reserve (str.size ());
@@ -98,7 +97,6 @@ public:
 	    }
 	}
 
-	// lengths already validated above
 	if constexpr (length == 1) {
 	    return { convert<type> (p) };
 	} else if constexpr (length == 2) {
@@ -147,4 +145,4 @@ template <> inline int64_t VectorBuilder::convert<int64_t> (const char* str) { r
 
 template <> inline bool VectorBuilder::convert<bool> (const char* str) { return std::strtoul (str, nullptr, 10) > 0; }
 
-} // namespace WallpaperEngine::Data::Parsers
+}

+ 1 - 3
src/WallpaperEngine/Data/Dumpers/StringPrinter.h

@@ -32,9 +32,7 @@ private:
     void indentation ();
     void lineEnd ();
 
-    /** Also prints a new line up to the new level, not just level bookkeeping */
     void increaseIndentation ();
-    /** Also prints a new line up to the new level, not just level bookkeeping */
     void decreaseIndentation ();
 
     int m_level = 0;
@@ -42,4 +40,4 @@ private:
     std::ostream m_out;
     std::string m_indentationCharacter;
 };
-} // namespace WallpaperEngine::Data::Dumpers
+}

+ 0 - 1
src/WallpaperEngine/Data/JSON.cpp

@@ -64,7 +64,6 @@ JSON JsonExtensions::parseAsset (const std::string& content) {
 	if (c == ',') {
 	    auto next = i + 1;
 
-	    // skip whitespace and comments before the bracket
 	    while (next < length) {
 		if (std::isspace (static_cast<unsigned char> (content[next]))) {
 		    next++;

+ 1 - 2
src/WallpaperEngine/Data/JSON.h

@@ -27,7 +27,6 @@ using JSON = nlohmann::basic_json<
     std::map, std::vector, std::string, bool, std::int64_t, std::uint64_t, double, std::allocator,
     nlohmann::adl_serializer, std::vector<std::uint8_t>, JsonExtensions>;
 
-// nlohmann base with shorthands: readable missing-value errors, optional/default values, user settings
 class JsonExtensions {
 public:
     using base_type = JSON;
@@ -208,4 +207,4 @@ private:
     }
 };
 
-} // namespace WallpaperEngine::Data::JSON
+}

+ 0 - 4
src/WallpaperEngine/Data/Model/DynamicValue.h

@@ -77,12 +77,9 @@ public:
     virtual void update (const std::string& newValue, UpdateSource source);
     virtual void update (const Model::Color& newValue, UpdateSource source);
     virtual void update (const DynamicValue& other, UpdateSource source);
-    /** Sets the current value to null */
     virtual void update (UpdateSource source);
 
-    /** Returns a de-register function to call when the listener is no longer needed */
     std::function<void ()> listen (const std::function<void (const DynamicValue&, UpdateSource)>& callback);
-    /** Connects to another instance; this instance's value tracks the other's */
     void connect (DynamicValue* other);
 
     void disconnect ();
@@ -114,7 +111,6 @@ private:
     std::string m_string;
     UnderlyingType m_type = Null;
     std::optional<ConditionInfo> m_condition = std::nullopt;
-    /** Properties the associated script takes in */
     std::map<std::string, UserSettingUniquePtr> m_properties;
 };
 }

+ 1 - 7
src/WallpaperEngine/Data/Model/Effect.h

@@ -29,10 +29,8 @@ struct EffectConditions {
 struct FBO {
     std::string name;
     std::string format;
-    /** an int from 1 to 255, anything else is 1 */
     float scale;
     bool unique;
-    /** "clear": up to four numbers, what the buffer is cleared to when made and by a clear function */
     glm::vec4 clearColor = {};
     /** "clear" was empty or had all four numbers (wallpaper64.exe 2.8.42 sub_1401E7170, FBO flag 2) */
     bool clearOnCreate = false;
@@ -40,7 +38,6 @@ struct FBO {
     std::optional<uint32_t> width = std::nullopt;
     std::optional<uint32_t> height = std::nullopt;
     std::optional<uint32_t> fit = std::nullopt;
-    /** "uvs": "repeat" */
     bool repeat = false;
     EffectConditions conditions = {};
 
@@ -71,11 +68,8 @@ struct EffectPass {
 };
 
 struct Effect {
-    /** For the UI */
     std::string name;
-    /** For the UI */
     std::string description;
-    /** For the UI */
     std::string group;
     std::string preview;
     std::vector<std::string> dependencies;
@@ -83,4 +77,4 @@ struct Effect {
     std::vector<FBOUniquePtr> fbos;
     std::vector<EffectFunction> functions;
 };
-} // namespace WallpaperEngine::Data::Model
+}

+ 1 - 7
src/WallpaperEngine/Data/Model/ImageAdjustments.h

@@ -9,19 +9,13 @@ namespace WallpaperEngine::Data::Model {
 struct ImageAdjustments {
     /** wec_e, the color options only apply while this is on */
     std::optional<bool> colorEnabled;
-    /** wec_brs */
     std::optional<float> brightness;
-    /** wec_con */
     std::optional<float> contrast;
-    /** wec_sa */
     std::optional<float> saturation;
-    /** wec_hue */
     std::optional<float> hue;
     /** wcc_v, a lut from materials/lut without the extension, empty for none */
     std::optional<std::string> filter;
-    /** wcc_amt */
     std::optional<float> filterStrength;
-    /** alignmentfliph */
     std::optional<bool> flipHorizontal;
 
     [[nodiscard]] ImageAdjustments over (const ImageAdjustments& fallback) const {
@@ -37,4 +31,4 @@ struct ImageAdjustments {
 	};
     }
 };
-} // namespace WallpaperEngine::Data::Model
+}

+ 1 - 3
src/WallpaperEngine/Data/Model/Material.h

@@ -41,9 +41,7 @@ struct MaterialPass {
     TextureMap textures;
     TextureMap usertextures;
     ComboMap combos;
-    /** e.g. overbright, bloom settings */
     ShaderConstantMap constants;
-    /** Only read by scripts */
     std::string alphawriting = "default";
 };
 
@@ -52,4 +50,4 @@ struct Material {
     std::vector<MaterialPassUniquePtr> passes;
 };
 
-} // namespace WallpaperEngine::Data::Model
+}

+ 1 - 2
src/WallpaperEngine/Data/Model/Model.h

@@ -18,7 +18,6 @@ struct ModelStruct {
     bool fullscreen;
     bool passthrough;
     bool autosize;
-    /** Composition layer covering the whole project, autosize makes it the scene's size */
     bool projectlayer;
     bool nopadding;
     std::optional<int> width;
@@ -27,4 +26,4 @@ struct ModelStruct {
     std::optional<glm::vec2> cropOffset;
     std::optional<std::string> puppet;
 };
-} // namespace WallpaperEngine::Data::Model
+}

+ 6 - 56
src/WallpaperEngine/Data/Model/Object.h

@@ -25,9 +25,7 @@ using namespace WallpaperEngine::Data::Utils;
 /** A 2.7+ particle dependency record: the object a component of the given type reads (wallpaper64.exe sub_14022AF30) */
 struct ObjectComponentDependency {
     int id;
-    /** "emitterimage" or "collisionmodel" */
     std::string type;
-    /** Which of the particle's components of that type uses it, in file order */
     int index;
     /** emitterimage: its red channel scales the layer's alpha before pixels are picked */
     std::string mask;
@@ -38,23 +36,18 @@ struct ObjectData {
     std::string name;
     std::vector<int> dependencies;
     std::vector<ObjectComponentDependency> componentDependencies;
-    /** mutable for setParent */
     mutable std::optional<int> parent;
-    /** Name of a named attachment point on the parent's puppet rig to follow, if any */
     mutable std::optional<std::string> attachment;
     // scene.json "sortorder", lower draws first; the array position otherwise
     std::optional<int> sortOrder;
     /** object +292, 0 unless set (sub_1401E0530) */
     UserSettingUniquePtr sortOrderValue;
     UserSettingUniquePtr origin;
-    // generic scene/group objects only, typed objects keep their own
     UserSettingUniquePtr groupScale;
     UserSettingUniquePtr groupAngles;
     UserSettingUniquePtr groupVisible;
     UserSettingUniquePtr groupParallaxDepth;
-    /** Cursor events skip the object entirely when off */
     UserSettingUniquePtr solid;
-    /** A visible object hit by the cursor keeps the objects below it from getting cursor events */
     UserSettingUniquePtr disablePropagation;
     // perspective camera in 2D scenes (perspectiveoverridefov), only the object's own flag counts
     UserSettingUniquePtr perspective;
@@ -77,12 +70,11 @@ struct ImageEffectPassOverride {
     ShaderConstantMap constants;
     TextureMap textures;
     TextureMap usertextures;
-    std::optional<std::string> shaderOverride; // Overrides MaterialPass::shader when set
+    std::optional<std::string> shaderOverride;
 };
 
 struct ImageEffect {
     int id;
-    /** Effect's name for the editor */
     std::string name;
     UserSettingUniquePtr visible;
     /** what the effect.json "conditions" test (sub_1401E7170) */
@@ -107,7 +99,6 @@ struct ImageAnimationLayer {
     float blendTime = 0.5f;
     /** insert after the last non-additive layer instead of at the end (sub_1401FCC20) */
     bool autosort = false;
-    /** insert at this position of the layer list, clamped to the last one */
     std::optional<int64_t> index = std::nullopt;
 };
 
@@ -141,13 +132,10 @@ struct ImageData {
     UserSettingUniquePtr parallaxDepth;
     UserSettingUniquePtr colorBlendMode;
     UserSettingUniquePtr brightness;
-    /** Forces UV clamping on this object's composite buffers regardless of the base texture's own flags */
     bool clampUVs;
-    /** Passthrough layers only: start from a copy of the scene behind them, otherwise from a transparent buffer */
     UserSettingUniquePtr copyBackground;
     RenderableSettings renderable;
     ModelUniquePtr model;
-    /** Applied after the material is rendered */
     std::vector<ImageEffectUniquePtr> effects;
     std::vector<ImageAnimationLayerUniquePtr> animationLayers;
     // "shape": "quad": no image, only its last effect drawn onto the scene on a square of the scene height (2.8.42
@@ -167,18 +155,14 @@ enum SoundPlaybackMode { PlaybackMode_Single = 0, PlaybackMode_Loop = 1, Playbac
 struct SoundData {
     SoundPlaybackMode playbackmode;
     std::vector<std::string> sounds;
-    // per-object volume (0-1) on top of the global one, e.g. to mute all but one music track via --set-property
     UserSettingUniquePtr volume;
-    /** Sound stays muted until a script calls play() on its layer */
     UserSettingUniquePtr startsilent;
-    /** random mode: seconds of silence after a sound, picked between these */
     UserSettingUniquePtr mintime;
     UserSettingUniquePtr maxtime;
     /** AL_ROLLOFF_FACTOR / AL_REFERENCE_DISTANCE of spatialized sounds */
     UserSettingUniquePtr attenuation;
     UserSettingUniquePtr mindistance;
     UserSettingUniquePtr spatialization;
-    /** only means something in WE's editor, scripts can read it */
     UserSettingUniquePtr muteineditor;
 };
 
@@ -347,7 +331,6 @@ public:
 	speedMax (speedMax), axis (axis) { }
     float count;
     glm::vec2 bounds;
-    /** limitbehavior "mirror", anything else repeats */
     bool mirror;
     int controlPoint;
     /** x along the circle, y outwards, z along the axis */
@@ -450,7 +433,6 @@ public:
 	arcDirection (std::move (arcDirection)), sizeReductionAmount (std::move (sizeReductionAmount)) { }
     float count;
     glm::vec2 bounds;
-    /** limitbehavior "mirror", anything else repeats */
     bool mirror;
     int controlPointStart;
     int controlPointEnd;
@@ -464,7 +446,6 @@ public:
     UserSettingUniquePtr sizeReductionAmount;
 };
 
-/** remapvalue/remapinitialvalue values, WE's enum order */
 enum class ParticleRemapValue {
     LifetimeFraction,
     MaxLifetime,
@@ -655,13 +636,12 @@ public:
 	audioProcessingExponent (std::move (audioProcessingExponent)),
 	audioProcessingFrequencyStart (std::move (audioProcessingFrequencyStart)),
 	audioProcessingFrequencyEnd (std::move (audioProcessingFrequencyEnd)), blend (blend) { }
-    /** vortex_v2: axis turned by the control point, centerforce and the ring shape, blend window */
     bool v2;
     int controlPoint;
     int flags; // 1 = infinite axis, 2 = centerforce (v2), 4 = ring shape (v2)
     /** Settings with 2D/3D defaults are null when the file leaves them out */
     UserSettingUniquePtr axis;
-    UserSettingUniquePtr offset; // vortex only
+    UserSettingUniquePtr offset;
     UserSettingUniquePtr distanceInner;
     UserSettingUniquePtr distanceOuter;
     UserSettingUniquePtr speedInner;
@@ -683,7 +663,6 @@ class InheritValueFromEventOperator : public ParticleOperatorBase {
 public:
     InheritValueFromEventOperator (ParticleEventInput input, glm::vec4 blend) : input (input), blend (blend) { }
     ParticleEventInput input;
-    /** blendinstart, blendinend, blendoutstart, blendoutend over the particle's life */
     glm::vec4 blend;
 };
 
@@ -763,7 +742,6 @@ public:
     ParticleBlendWindow blend;
 };
 
-/** blendinstart, blendinend, blendoutstart, blendoutend: how much of an operator applies over the particle's life */
 class CapVelocityOperator : public ParticleOperatorBase {
 public:
     CapVelocityOperator (UserSettingUniquePtr maxSpeed, ParticleBlendWindow blend) :
@@ -788,7 +766,6 @@ public:
     UserSettingUniquePtr separationFactor;
     UserSettingUniquePtr alignmentFactor;
     UserSettingUniquePtr cohesionFactor;
-    /** 1 cap the speed at maxspeed */
     uint32_t flags;
 };
 
@@ -862,7 +839,6 @@ public:
     /** 1 the shape moves with the control point, 2 colliding particles stop spinning */
     uint32_t flags;
     int controlPoint;
-    /** Shape settings, null when the file doesn't set them (some defaults depend on the scene) */
     UserSettingUniquePtr plane;
     UserSettingUniquePtr distance;
     UserSettingUniquePtr origin;
@@ -879,11 +855,11 @@ struct ParticleRenderer {
     float maxLength;
     float minLength;
     float subdivision;
-    float segments; // ropetrail: number of history segments per particle
+    float segments;
     float uvScale;
     bool uvScrolling;
-    bool fadeAlpha; // ropetrail: fade alpha along trail
-    bool fadeSize; // ropetrail: fade size along trail
+    bool fadeAlpha;
+    bool fadeSize;
     /** "orientation" (sub_1401C22E0): screen 0, upright 1, fixed 2 */
     int orientation = 0;
     /** "axis" normalized, (0, 1, 0) when zero (+12) */
@@ -908,18 +884,14 @@ enum class ParticleChildType {
 
 struct ParticleChild {
     ParticleChildType type;
-    /** Particle file the child system is loaded from */
     std::string name;
     /** Most instances of an event child alive at once (static children ignore it) */
     int maxCount;
-    /** Chance of an event spawning an instance, rolled per event */
     float probability;
     /** Bit 0: the parent's particles drive the child's control points, from controlPointStartIndex up */
     uint32_t flags;
     int controlPointStartIndex;
-    /** Placement relative to the spawning particle (static: the parent system), in the parent's particle space */
     glm::mat4 transform;
-    /** null if the file couldn't be loaded */
     ParticleUniquePtr particle;
 };
 
@@ -937,7 +909,6 @@ struct ParticleInstanceOverride {
     UserSettingUniquePtr colorn; // Multiplies particle color
     /** colorn (or the legacy color) was given, WE keeps -1 in it otherwise */
     bool hasColor = false;
-    /** controlpoint0..7 replace a control point's translation, controlpointangle0..7 turn it, null when not set */
     std::array<UserSettingUniquePtr, 8> controlPoints;
     std::array<UserSettingUniquePtr, 8> controlPointAngles;
 };
@@ -986,11 +957,8 @@ public:
 };
 
 struct TextData {
-    // initial text, the `value` placeholder for scripted text
     UserSettingUniquePtr text;
-    /** Font reference from scene (e.g. "fonts/VCR_OSD_MONO.ttf" or "systemfont_arial") */
     std::string font;
-    /** Font size in points, optionally bound to a user setting or script */
     UserSettingUniquePtr pointSize;
     glm::vec2 size;
     UserSettingUniquePtr scale;
@@ -999,34 +967,25 @@ struct TextData {
     UserSettingUniquePtr alpha;
     UserSettingUniquePtr visible;
     UserSettingUniquePtr parallaxDepth;
-    /** "left", "center", "right" */
     UserSettingUniquePtr horizontalAlign;
-    /** "top", "center", "bottom" */
     UserSettingUniquePtr verticalAlign;
-    /** Keeps the text at its distance from a visible screen edge or corner: "none", "center", "top", "topright", ... */
     UserSettingUniquePtr anchor;
     /** Image blend mode, the text is composited through effectpassthrough with BLENDMODE (31 is additive) */
     UserSettingUniquePtr colorBlendMode;
-    /** Room around the text box for effects and the opaque background (x = horizontal, y = vertical) */
     UserSettingUniquePtr padding;
     /** Added to every glyph's advance (x) and to the line pitch (y), raster pixels */
     UserSettingUniquePtr spacing;
-    /** Applied after the glyphs are rendered */
     std::vector<ImageEffectUniquePtr> effects;
     /** Wrap lines wider than maxWidth (layout pixels, before the object's scale) */
     UserSettingUniquePtr limitWidth;
     UserSettingUniquePtr maxWidth;
-    /** Cut the text after maxRows lines, optionally marking the cut with an ellipsis */
     UserSettingUniquePtr limitRows;
     UserSettingUniquePtr maxRows;
     UserSettingUniquePtr limitUseEllipsis;
-    /** Justifies wrapped lines to maxWidth by widening their spaces */
     UserSettingUniquePtr blockAlign;
     UserSettingUniquePtr opaqueBackground;
     UserSettingUniquePtr backgroundColor;
-    /** Only used by WE's HDR scene rendering */
     UserSettingUniquePtr backgroundBrightness;
-    /** Scales the text color, only in HDR scene rendering */
     UserSettingUniquePtr brightness;
     /** Glyphs as multi-channel signed distance fields, forced on by any of the outline/blur/drop shadow effects */
     UserSettingUniquePtr msdf;
@@ -1042,7 +1001,6 @@ struct TextData {
     UserSettingUniquePtr dropShadowColor;
     /** "enabled" draws with the depth tested font materials in 3D scenes, any other value is "disabled" */
     UserSettingUniquePtr depthTest;
-    /** Only read by scripts */
     UserSettingUniquePtr copyBackground;
     RenderableSettings renderable;
 };
@@ -1058,13 +1016,11 @@ enum class LightType { Legacy, Point, Spot, Tube, Directional };
 
 struct LightData {
     LightType type;
-    /** "light" for scripts */
     UserSettingUniquePtr typeName;
     UserSettingUniquePtr color;
     UserSettingUniquePtr intensity;
     UserSettingUniquePtr radius;
     UserSettingUniquePtr visible;
-    /** Light volumes glowing in the air around the light (LightingV1 lights) */
     UserSettingUniquePtr castVolumetrics;
     UserSettingUniquePtr castShadow;
     UserSettingUniquePtr density;
@@ -1072,9 +1028,7 @@ struct LightData {
     /** Spot lights: half angles of the cone in degrees, full brightness inside the inner one */
     UserSettingUniquePtr innerCone;
     UserSettingUniquePtr outerCone;
-    /** LightingV1 falloff exponent of the lit surfaces */
     UserSettingUniquePtr exponent;
-    /** Tube lights: the far end of the tube in the light's own space */
     UserSettingUniquePtr controlPoint;
     /** Spot lights projecting a texture ("cookie", WE falls back to cookie/flashlight1) */
     UserSettingUniquePtr useCookie;
@@ -1091,8 +1045,6 @@ public:
 	Object (std::move (data)), LightData (std::move (lightData)) { };
     ~Light () override = default;
 };
-// a camera "path" file entry: keyframed eye/center/up (missing components keep the camera's transform), zoom (2D) and
-// fov (3D)
 struct CameraTimeline {
     std::string name;
     bool visible = true;
@@ -1113,7 +1065,6 @@ struct SceneCameraData {
     UserSettingUniquePtr fov;
     UserSettingUniquePtr zoom;
     std::vector<CameraTimeline> timelines;
-    /** "random" or "sequential" */
     DynamicValueUniquePtr queueMode;
 };
 
@@ -1123,7 +1074,6 @@ public:
 	Object (std::move (data)), SceneCameraData (std::move (cameraData)) { };
     ~SceneCamera () override = default;
 };
-/** A 3D model object ("model" pointing at a .mdl), placed with the base object's origin/scale/angles */
 struct MeshData {
     std::string model;
     /** "model" given as a number: a script's IModelData token (thisScene.createModelData) */
@@ -1144,4 +1094,4 @@ public:
 	Object (std::move (data)), MeshData (std::move (meshData)) { };
     ~Mesh () override = default;
 };
-} // namespace WallpaperEngine::Data::Model
+}

+ 0 - 1
src/WallpaperEngine/Data/Model/Project.h

@@ -21,7 +21,6 @@ struct Project {
     Properties properties;
     WallpaperUniquePtr wallpaper;
     AssetLocatorUniquePtr assetLocator;
-    /** Image filter, color options and flip a preset carries (wcc_*, wec_*, alignmentfliph) */
     ImageAdjustments imageAdjustments;
     /** Scene file WE opens (the base wallpaper's for a preset), keys script localStorage */
     std::filesystem::path sceneFile;

+ 0 - 3
src/WallpaperEngine/Data/Model/Property.h

@@ -39,7 +39,6 @@ public:
     virtual void update (const std::string& value, UpdateSource source) = 0;
     [[nodiscard]] virtual std::string dump () const = 0;
 
-    /** Marks the property as read only at setup, a change then needs a reload */
     void pin () const { this->m_pinned = true; }
     [[nodiscard]] bool appliesLive () const { return !this->m_pinned; }
 
@@ -125,7 +124,6 @@ public:
 	this->PropertyCombo::update (value, UpdateSource::Initialization);
     }
 
-    /** Replaces every option label, used to swap the localization keys projects store for readable text */
     void relabel (const std::function<std::string (const std::string&)>& translate) {
 	for (auto& label : this->values | std::views::values) {
 	    label = translate (label);
@@ -206,7 +204,6 @@ private:
 
 class PropertyFile final : public Property {
 public:
-    // fileType is the project's restriction ("video", or empty for images), only for directories
     explicit PropertyFile (
 	PropertyData data, const std::string& value, bool directory = false, std::string fileType = ""
     ) : Property (std::move (data)), m_directory (directory), m_fileType (std::move (fileType)) {

+ 1 - 2
src/WallpaperEngine/Data/Model/PropertyAnimation.h

@@ -18,7 +18,6 @@ struct AnimationKeyframe {
     float value = 0.0f;
     Handle back;
     Handle front;
-    /** Holds the previous key's value up to this one */
     bool step = false;
 };
 
@@ -43,4 +42,4 @@ struct PropertyAnimation {
     std::vector<std::string> children;
     std::optional<std::string> parent;
 };
-} // namespace WallpaperEngine::Data::Model
+}

+ 1 - 4
src/WallpaperEngine/Data/Model/UserSetting.h

@@ -8,12 +8,9 @@
 
 namespace WallpaperEngine::Data::Model {
 struct UserSetting {
-    // a property-bound, default or static value
     DynamicValueUniquePtr value;
-    /** The property this setting takes the value from (if specified) */
     PropertySharedPtr property;
-    /** Condition required for this setting, this should be possible to run in JS' V8 */
     std::optional<ConditionInfo> condition;
     // TODO: values from scripts without conditions
 };
-} // namespace WallpaperEngine::Data::Model
+}

+ 1 - 6
src/WallpaperEngine/Data/Model/Wallpaper.h

@@ -37,7 +37,6 @@ public:
     ~Web () override = default;
 };
 
-/** A key of a scene camera path: where the camera is at time seconds into the path */
 struct CameraPathKey {
     float time;
     glm::vec3 eye;
@@ -46,7 +45,6 @@ struct CameraPathKey {
     float zoom;
 };
 
-/** One path of the files listed in scene.json's "camera" "paths", played one after another */
 struct CameraPath {
     std::vector<CameraPathKey> keys;
     float duration;
@@ -58,7 +56,6 @@ struct SceneData {
 	UserSettingUniquePtr skylight;
 	UserSettingUniquePtr clear;
     } colors;
-    /** Distance and height fog ("fogdistance*"/"fogheight*" in general) */
     struct {
 	UserSettingUniquePtr distanceEnabled;
 	UserSettingUniquePtr distanceColor;
@@ -90,7 +87,6 @@ struct SceneData {
     } lightConfig;
     struct Camera {
 	UserSettingUniquePtr fade;
-	/** Whether the software's preview UI is allowed to show this background */
 	bool preview;
 
 	struct {
@@ -136,7 +132,6 @@ struct SceneData {
 	    UserSettingUniquePtr nearz;
 	    UserSettingUniquePtr farz;
 	    UserSettingUniquePtr fov;
-	    /** fov of the perspective layers in a 2D scene */
 	    UserSettingUniquePtr perspectiveOverrideFov;
 	    /** 2D scenes: magnification around the scene center, times the active camera object's zoom */
 	    UserSettingUniquePtr zoom;
@@ -173,4 +168,4 @@ public:
 
     ~Scene () override = default;
 };
-} // namespace WallpaperEngine::Data::Model
+}

+ 1 - 1
src/WallpaperEngine/Data/Parsers/ComboValue.h

@@ -25,4 +25,4 @@ inline int passComboValue (const WallpaperEngine::Data::JSON::JSON& value) {
 
     return comboValue (value);
 }
-} // namespace WallpaperEngine::Data::Parsers
+}

+ 1 - 1
src/WallpaperEngine/Data/Parsers/DynamicValueParser.cpp

@@ -147,7 +147,7 @@ std::shared_ptr<const PropertyAnimation> parseAnimation (const json& data, const
 
     return animation;
 }
-} // namespace
+}
 
 std::vector<AnimationKeyframe> DynamicValueParser::parseKeyframes (const json& curve) {
     std::vector<AnimationKeyframe> keys;

+ 1 - 1
src/WallpaperEngine/Data/Parsers/EffectParser.cpp

@@ -142,7 +142,7 @@ std::optional<uint32_t> fboSize (const JSON& it, const char* key) {
 
     return static_cast<uint16_t> (*number);
 }
-} // namespace
+}
 
 // sub_1401E63B0: each member names a combo, a number must equal it, an object compares "value" by "op"
 EffectConditions EffectParser::parseConditions (const JSON& it) {

+ 1 - 1
src/WallpaperEngine/Data/Parsers/EffectParser.h

@@ -21,4 +21,4 @@ private:
     static EffectConditions parseConditions (const JSON& it);
     static std::vector<EffectFunction> parseFunctions (const JSON& it, const std::vector<FBOUniquePtr>& fbos);
 };
-} // namespace WallpaperEngine::Data::Parsers
+}

+ 1 - 3
src/WallpaperEngine/Data/Parsers/Localization.cpp

@@ -19,7 +19,7 @@ void replaceAll (std::string& text, const std::string& from, const std::string&
 	text.replace (at, from.size (), to);
     }
 }
-} // namespace
+}
 
 Localization::Localization (const std::optional<JSON>& general, std::string locale) {
     if (general.has_value ()) {
@@ -127,7 +127,6 @@ std::string Localization::clean (const std::string& text) {
     replaceAll (result, "&#39;", "'");
     replaceAll (result, "&amp;", "&");
 
-    // collapse whitespace, including the newlines some strings carry
     std::string collapsed;
     bool space = true;
 
@@ -165,7 +164,6 @@ std::string Localization::systemLocale () {
 	    break;
 	}
 
-	// "de_DE.UTF-8@euro" -> "de-de"
 	locale = locale.substr (0, locale.find_first_of (".@"));
 	std::ranges::replace (locale, '_', '-');
 

+ 1 - 8
src/WallpaperEngine/Data/Parsers/Localization.h

@@ -9,21 +9,14 @@
 namespace WallpaperEngine::Data::Parsers {
 using JSON = WallpaperEngine::Data::JSON::JSON;
 
-// workshop properties store keys like "ui_background_mode_img", the strings live per language under
-// general.localization
 class Localization {
 public:
-    /** locale is something like "de-de", by default the one the user's environment asks for */
     explicit Localization (const std::optional<JSON>& general, std::string locale = systemLocale ());
 
-    // readable text for a property label: user's language, then English, without WE's UI markup; unknown keys made
-    // readable
     [[nodiscard]] std::string resolve (const std::string& text) const;
 
-    /** Drops markup and the parts meant as small print, and tidies whitespace */
     [[nodiscard]] static std::string clean (const std::string& text);
 
-    /** The locale of the environment (LC_ALL, LC_MESSAGES, LANG) in the form the tables use, "en-us" if unset */
     [[nodiscard]] static std::string systemLocale ();
 
 private:
@@ -33,4 +26,4 @@ private:
     const Table* m_preferred = nullptr;
     const Table* m_english = nullptr;
 };
-} // namespace WallpaperEngine::Data::Parsers
+}

+ 1 - 1
src/WallpaperEngine/Data/Parsers/MaterialParser.cpp

@@ -58,7 +58,7 @@ std::optional<std::string> modeName (const JSON& pass, const char* key) {
 
     return std::string ();
 }
-} // namespace
+}
 
 MaterialPassUniquePtr MaterialParser::parsePass (const JSON& it, const Project& project) {
     const auto textures = it.optional ("textures");

+ 1 - 1
src/WallpaperEngine/Data/Parsers/MaterialParser.h

@@ -19,4 +19,4 @@ public:
     static DepthtestMode parseDepthtestMode (const std::string& mode);
     static DepthwriteMode parseDepthwriteMode (const std::string& mode);
 };
-} // namespace WallpaperEngine::Data::Parsers
+}

+ 1 - 1
src/WallpaperEngine/Data/Parsers/ModelParser.h

@@ -12,4 +12,4 @@ public:
     static ModelUniquePtr load (const Project& project, const std::string& filename);
     static ModelUniquePtr parse (const JSON& file, const Project& project, const std::string& filename);
 };
-} // namespace WallpaperEngine::Data::Parsers
+}

+ 2 - 9
src/WallpaperEngine/Data/Parsers/ObjectParser.cpp

@@ -256,7 +256,7 @@ std::pair<glm::vec3, bool> deriveColorReference (const JSON& particle) {
     std::snprintf (text, sizeof (text), "%.5f %.5f %.5f", reference.r, reference.g, reference.b);
     return { parseFloats (text), hasColor };
 }
-} // namespace
+}
 
 ObjectUniquePtr ObjectParser::parse (const JSON& it, const Project& project) {
     auto object = parseObject (it, project);
@@ -282,7 +282,6 @@ ObjectUniquePtr ObjectParser::parseObject (const JSON& it, const Project& projec
     const auto textIt = it.find ("text");
     const auto lightIt = it.find ("light");
     const auto modelIt = it.find ("model");
-    // "shape" refers to VolumeLight
     const auto shapeIt = it.find ("shape");
     const auto cameraIt = it.find ("camera");
     // anything but a JSON false leaves the object in the planar reflection (sub_14018FF60)
@@ -364,7 +363,6 @@ ObjectUniquePtr ObjectParser::parseObject (const JSON& it, const Project& projec
     } else if (shapeIt != it.end () && shapeIt->is_string ()) {
 	return parseShape (it, project, std::move (basedata));
     } else {
-	// objects without a type key are plain groups, only complain when a type key is there but unusable
 	for (const auto& typeIt : { imageIt, lightIt, modelIt, cameraIt }) {
 	    if (typeIt != it.end () && !typeIt->is_null ()) {
 		sLog.error (
@@ -481,7 +479,7 @@ std::vector<CameraTimeline> parseCameraTimelines (const std::string& filename, c
 
     return timelines;
 }
-} // namespace
+}
 
 SceneCameraUniquePtr ObjectParser::parseCamera (const JSON& it, const Project& project, ObjectData base) {
     // defaults from the camera object's constructor, wallpaper64.exe 2.8.42 sub_14018FF60
@@ -1238,7 +1236,6 @@ ParticleEmitter ObjectParser::parseParticleEmitter (const JSON& it) {
 	name = nameIt->get<std::string> ();
     }
 
-    // vec3 fields may show up as strings, arrays, single numbers, or be missing entirely
     auto parseVec3 = [&] (const char* fieldName, const glm::vec3& defaultValue) -> glm::vec3 {
 	const auto fieldIt = it.find (fieldName);
 	if (fieldIt == it.end ()) {
@@ -1248,7 +1245,6 @@ ParticleEmitter ObjectParser::parseParticleEmitter (const JSON& it) {
 	    return it.optional (fieldName, defaultValue);
 	}
 	if (fieldIt->is_number ()) {
-	    // single number applies to all components (common for distancemax/distancemin)
 	    float val = fieldIt->get<float> ();
 	    return glm::vec3 (val, val, val);
 	}
@@ -1666,7 +1662,6 @@ ParticleEventInput ObjectParser::parseParticleEventInput (const JSON& it, Partic
 }
 
 ParticleControlPoint ObjectParser::parseParticleControlPoint (const JSON& it) {
-    // offset can be string "x y z" or array [x,y,z]
     glm::vec3 offset (0.0f);
     const auto offsetIt = it.find ("offset");
     if (offsetIt != it.end ()) {
@@ -1717,7 +1712,6 @@ ParticleChild ObjectParser::parseParticleChild (
 	name = nameIt->get<std::string> ();
     }
 
-    // vec3 fields may show up as strings, arrays, single numbers, or be missing entirely
     auto parseVec3 = [&] (const char* fieldName, const glm::vec3& defaultValue) -> glm::vec3 {
 	const auto fieldIt = it.find (fieldName);
 	if (fieldIt == it.end ()) {
@@ -1752,7 +1746,6 @@ ParticleChild ObjectParser::parseParticleChild (
 	glm::vec4 (origin, 1.0f)
     );
 
-    // the child is loaded like a particle object of its own that shares the owner's instance override
     JSON childObject = JSON::object ();
     childObject["particle"] = name;
     if (const auto overrideIt = owner.find ("instanceoverride"); overrideIt != owner.end ()) {

+ 1 - 3
src/WallpaperEngine/Data/Parsers/ObjectParser.h

@@ -15,10 +15,8 @@ using namespace WallpaperEngine::Data::Model;
 
 class ObjectParser {
 public:
-    /** ImageAlignment flags from an alignment name, images re-read it when a script changes it */
     static uint32_t parseAlignment (const std::string& alignment);
     static ObjectUniquePtr parse (const JSON& it, const Project& project);
-    /** one animationlayers[] entry, also what createAnimationLayer() builds from its config */
     static ImageAnimationLayerUniquePtr parseAnimationLayer (const JSON& it, const Project& project);
 
 private:
@@ -55,4 +53,4 @@ private:
     );
     static ParticleInstanceOverride parseParticleInstanceOverride (const JSON& it, const Properties& properties);
 };
-} // namespace WallpaperEngine::Data::Parsers
+}

+ 0 - 1
src/WallpaperEngine/Data/Parsers/ProjectParser.cpp

@@ -154,7 +154,6 @@ Properties ProjectParser::parseProperties (const std::optional<JSON>& data) {
     for (const auto& cur : properties.value ().items ()) {
 	const auto& property = PropertyParser::parse (cur.value (), cur.key ());
 
-	// null means the entry was a group, not an actual property
 	if (property == nullptr) {
 	    continue;
 	}

+ 1 - 2
src/WallpaperEngine/Data/Parsers/ProjectParser.h

@@ -15,7 +15,6 @@ using namespace WallpaperEngine::Data::Model;
 class ProjectParser {
 public:
     static ProjectUniquePtr parse (const JSON& data, AssetLocatorUniquePtr container);
-    /** The type Wallpaper Engine takes from a main file's extension, nothing for an extension it has no rule for */
     static std::optional<Project::Type> typeOfFile (const std::string& file);
 
 private:
@@ -24,4 +23,4 @@ private:
     static Project::Type parseType (const std::string& type);
     static Properties parseProperties (const std::optional<JSON>& data);
 };
-} // namespace WallpaperEngine::Data::Parsers
+}

+ 0 - 1
src/WallpaperEngine/Data/Parsers/PropertyParser.cpp

@@ -7,7 +7,6 @@ using namespace WallpaperEngine::Data::Parsers;
 using namespace WallpaperEngine::Data::Model;
 
 PropertySharedPtr PropertyParser::parse (const JSON& it, const std::string& name) {
-    // missing type means the same as type "group"
     const auto type = it.optional ("type");
 
     if (type == "color") {

+ 0 - 1
src/WallpaperEngine/Data/Parsers/ShaderConstantParser.cpp

@@ -16,7 +16,6 @@ ShaderConstantMap ShaderConstantParser::parse (const JSON& it, const Project& pr
     for (const auto& cur : it.items ()) {
 	auto setting = UserSettingParser::parse (cur.value (), project.properties);
 
-	// no value and no property to take it from: the material's default stays
 	if (setting->value->getType () == DynamicValue::UnderlyingType::Null && setting->property == nullptr) {
 	    continue;
 	}

+ 1 - 1
src/WallpaperEngine/Data/Parsers/ShaderConstantParser.h

@@ -11,4 +11,4 @@ class ShaderConstantParser {
 public:
     static ShaderConstantMap parse (const JSON& it, const Project& project);
 };
-} // namespace WallpaperEngine::Data::Parsers
+}

+ 0 - 5
src/WallpaperEngine/Data/Parsers/TextureParser.cpp

@@ -115,7 +115,6 @@ void TextureParser::parseMipmapPatches (Mipmap& mipmap, const BinaryReader& file
     for (uint32_t group = 0; group < groupCount; group++) {
 	const uint32_t patchCount = file.nextUInt32 ();
 
-	// a patch is eight numbers and its data's length
 	if (!file.fits (patchCount, 8 * sizeof (uint32_t))) {
 	    sLog.exception ("Texture group lists ", patchCount, " patches, more than the file holds");
 	}
@@ -243,7 +242,6 @@ void TextureParser::parseContainer (Texture& header, const BinaryReader& file, c
 
     const uint32_t conditionCount = version >= 4 ? file.nextUInt32 () : 0;
 
-    // three numbers and a text each, at least its terminator
     if (!file.fits (conditionCount, 3 * sizeof (uint32_t) + 1) || !file.fits (header.imageCount, sizeof (uint32_t))) {
 	sLog.exception (
 	    "Texture claims ", header.imageCount, " images and ", conditionCount,
@@ -265,7 +263,6 @@ void TextureParser::parseContainer (Texture& header, const BinaryReader& file, c
 	const uint32_t mipmapCount = file.nextUInt32 ();
 	MipmapList mipmaps;
 
-	// width, height and a size at least
 	if (!file.fits (mipmapCount, 3 * sizeof (uint32_t))) {
 	    sLog.exception ("Texture image lists ", mipmapCount, " mipmaps, more than the file holds");
 	}
@@ -282,7 +279,6 @@ void TextureParser::parseContainer (Texture& header, const BinaryReader& file, c
 	header.images.emplace (image, mipmaps);
     }
 
-    // every consumer starts from the first mipmap of image 0
     if (header.images.empty ()
 	|| std::ranges::any_of (header.images, [] (const auto& image) { return image.second.empty (); })) {
 	sLog.exception ("Texture has no image data");
@@ -295,7 +291,6 @@ void TextureParser::parseAnimations (Texture& header, const BinaryReader& file,
 
     uint32_t frameCount = file.nextUInt32 ();
 
-    // a frame is eight numbers
     if (!file.fits (frameCount, 8 * sizeof (uint32_t))) {
 	sLog.exception ("Texture lists ", frameCount, " animation frames, more than the file holds");
     }

+ 0 - 1
src/WallpaperEngine/Data/Parsers/UserSettingParser.cpp

@@ -36,7 +36,6 @@ UserSettingUniquePtr UserSettingParser::parse (const json& data, const Propertie
 	}
     }
 
-    // connect to property so overrides can propagate
     if (property != nullptr) {
 	if (condition.has_value ()) {
 	    value->attachCondition (condition.value ());

+ 1 - 1
src/WallpaperEngine/Data/Parsers/UserSettingParser.h

@@ -14,4 +14,4 @@ class UserSettingParser {
 public:
     static UserSettingUniquePtr parse (const json& data, const Properties& properties, bool expectColor = false);
 };
-} // namespace WallpaperEngine::Data::Parsers
+}

+ 1 - 2
src/WallpaperEngine/Data/Parsers/WallpaperParser.cpp

@@ -199,7 +199,6 @@ void parseCameraPathFile (const std::string& filename, const Project& project, s
 		continue;
 	    }
 
-	    // without a timestamp the keys spread evenly over the duration
 	    float time = 0.0f;
 
 	    if (const auto stamp = transform.find ("timestamp"); stamp != transform.end () && stamp->is_number ()) {
@@ -300,7 +299,7 @@ SceneData::EngineProperties parseEngineProperties (const JSON& general, const JS
 
     return result;
 }
-} // namespace
+}
 
 WallpaperUniquePtr WallpaperParser::parse (const JSON& file, Project& project) {
     switch (project.type) {

+ 1 - 1
src/WallpaperEngine/Data/Parsers/WallpaperParser.h

@@ -17,4 +17,4 @@ private:
     static WebUniquePtr parseWeb (const JSON& file, Project& project);
     static ObjectList parseObjects (const JSON& objects, const Project& project);
 };
-} // namespace WallpaperEngine::Data::Parsers
+}

+ 1 - 1
src/WallpaperEngine/Data/Utils/AudioSensitivity.h

@@ -10,4 +10,4 @@ inline std::pair<float, float> scaleAudioRange (float originalMin, float origina
 
     return { mid - half, mid + half };
 }
-} // namespace WallpaperEngine::Data::Utils
+}

+ 0 - 1
src/WallpaperEngine/Data/Utils/BinaryReader.cpp

@@ -46,7 +46,6 @@ float BinaryReader::nextFloat () const {
 std::string BinaryReader::nextNullTerminatedString () const {
     std::string output;
 
-    // the end of the data ends the string too, there is no terminator to wait for
     for (char c = this->next (); this->m_input->good () && c != '\0'; c = this->next ()) {
 	output += c;
     }

+ 0 - 3
src/WallpaperEngine/Data/Utils/BinaryReader.h

@@ -22,11 +22,8 @@ public:
 
     [[nodiscard]] std::istream& base () const;
 
-    /** Length of the whole stream, what the parsers check the sizes and counts a file claims against */
     [[nodiscard]] uint64_t size () const;
-    /** Bytes after the read position, 0 once a read failed */
     [[nodiscard]] uint64_t remaining () const;
-    /** Whether count records of at least recordBytes each can still be in the rest of the stream */
     [[nodiscard]] bool fits (uint64_t count, uint64_t recordBytes) const;
 
 private:

+ 1 - 1
src/WallpaperEngine/Data/Utils/FiniteFloat.h

@@ -17,4 +17,4 @@ inline float parseFiniteFloat (const std::string& text) {
 
     return value;
 }
-} // namespace WallpaperEngine::Data::Utils
+}

+ 1 - 1
src/WallpaperEngine/Data/Utils/TypeCaster.h

@@ -25,4 +25,4 @@ public:
 
     template <class T> [[nodiscard]] bool is () const { return dynamic_cast<const T*> (this) != nullptr; }
 };
-} // namespace WallpaperEngine::Data::Utils
+}

+ 9 - 12
src/WallpaperEngine/Debugging/CallStack.cpp

@@ -48,8 +48,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <imagehlp.h>
 #include <windows.h>
 #if defined(__MINGW32__)
-#define PACKAGE 1 // Supress cmake error.
-#define PACKAGE_VERSION 1 // Supress cmake error.
+#define PACKAGE 1
+#define PACKAGE_VERSION 1
 #include <bfd.h>
 #include <cxxabi.h>
 #endif
@@ -86,8 +86,7 @@ string CallStack::Demangle (const char* name) {
 }
 
 #if defined(_WIN32)
-class noncopyable // Like the one in boost.
-{
+class noncopyable {
 protected:
     noncopyable (void) { }
 
@@ -120,10 +119,8 @@ public:
 	}
 
 	char** matching = NULL;
-	if (!(bfd_check_format (abfd, bfd_object) && // Whether the executable format is supported.
-	      bfd_check_format_matches (abfd, bfd_object, &matching) && // Whether the executable format is supported.
-	      (bfd_get_file_flags (abfd) & HAS_SYMS))) // Whether BFD has symbols
-	{
+	if (!(bfd_check_format (abfd, bfd_object) && bfd_check_format_matches (abfd, bfd_object, &matching)
+	      && (bfd_get_file_flags (abfd) & HAS_SYMS))) {
 	    bfd_close (abfd);
 	    free (matching);
 	    fprintf (stderr, "Error: Failed to parse the executable format.\n");
@@ -186,8 +183,8 @@ private:
 	}
     }
 };
-#endif // __MINGW32__
-#endif // _WIN32
+#endif
+#endif
 
 void CallStack::GetCalls (vector<CallStack::CallInfo>& calls) {
 #if defined(_WIN32)
@@ -277,7 +274,7 @@ void CallStack::GetCalls (vector<CallStack::CallInfo>& calls) {
     SymCleanup (GetCurrentProcess ());
     cs.unlock ();
 
-#else // For Linux and Unix.
+#else
 
     const int BufferSize = 256;
     void* buffer[BufferSize];
@@ -307,5 +304,5 @@ void CallStack::GetCalls (vector<CallStack::CallInfo>& calls) {
     }
     free (callstrings);
 
-#endif // _WIN32
+#endif
 }

+ 1 - 1
src/WallpaperEngine/Debugging/CallStack.h

@@ -72,4 +72,4 @@ public:
 
 }
 
-#endif //  __CALLSTACK_H__
+#endif

+ 1 - 1
src/WallpaperEngine/Desktop/GnomeShell.cpp

@@ -134,7 +134,7 @@ std::optional<std::vector<GnomeShell::Window>> readWindows (DBusMessageIter* ite
 
     return result;
 }
-} // namespace
+}
 
 GnomeShell::GnomeShell () {
     if (!this->connect ()) {

+ 1 - 6
src/WallpaperEngine/Desktop/GnomeShell.h

@@ -8,7 +8,6 @@
 #include "WindowState.h"
 
 namespace WallpaperEngine::Desktop {
-/** XDG_CURRENT_DESKTOP lists GNOME */
 bool isGnomeSession ();
 
 /**
@@ -20,7 +19,6 @@ public:
     static constexpr const char* BUS_NAME = "org.linuxwallpaperengine.Shell";
     static constexpr const char* OBJECT_PATH = "/org/linuxwallpaperengine/Shell";
     static constexpr const char* INTERFACE = "org.linuxwallpaperengine.Shell";
-    /** followed by the output name */
     static constexpr const char* TITLE_PREFIX = "linux-wallpaperengine wallpaper ";
     static constexpr const char* APP_ID = "linux-wallpaperengine";
     static constexpr uint32_t API_VERSION = 1;
@@ -41,7 +39,6 @@ public:
 
     [[nodiscard]] bool isAvailable () const { return this->m_available; }
     [[nodiscard]] const std::string& reason () const { return this->m_reason; }
-    /** disabled or Shell restarted */
     [[nodiscard]] bool vanished () const { return this->m_vanished; }
     /** GNOME 45-48: needs a Shell-spawned connection, see openWaylandSocket */
     [[nodiscard]] bool needsHelper () const { return this->m_needsHelper; }
@@ -49,12 +46,10 @@ public:
     // when the helper exits
     [[nodiscard]] int openWaylandSocket ();
 
-    /** non-blocking */
     void dispatch ();
 
     [[nodiscard]] const std::vector<Pointer>& pointer () const { return this->m_pointer; }
     [[nodiscard]] const std::vector<Window>& windows () const { return this->m_windows; }
-    /** left button held on another desktop window (icons) */
     [[nodiscard]] bool desktopLeftDown () const { return this->m_desktopLeftDown; }
 
 private:
@@ -75,4 +70,4 @@ private:
     std::vector<Pointer> m_pointer;
     std::vector<Window> m_windows;
 };
-} // namespace WallpaperEngine::Desktop
+}

+ 1 - 2
src/WallpaperEngine/Desktop/HostWayland.cpp

@@ -51,7 +51,6 @@ bool sandboxSocketHasLayerShell () {
     return found;
 }
 
-/** the helper next to this binary, as the host sees it through the app's deployment folder */
 std::string hostHelperPath () {
     std::error_code error;
     const auto exe = std::filesystem::read_symlink ("/proc/self/exe", error);
@@ -163,7 +162,7 @@ int hostConnection () {
 
     return fd;
 }
-} // namespace
+}
 
 bool WallpaperEngine::Desktop::usesHostWayland () {
     static const bool host

+ 1 - 2
src/WallpaperEngine/Desktop/HostWayland.h

@@ -8,6 +8,5 @@ namespace WallpaperEngine::Desktop {
 // couldn't already do). Null on failure
 wl_display* connectWayland ();
 
-/** Whether connectWayland goes through the host helper, decided on first use */
 bool usesHostWayland ();
-} // namespace WallpaperEngine::Desktop
+}

+ 1 - 2
src/WallpaperEngine/Desktop/HyprlandIPC.cpp

@@ -57,7 +57,6 @@ std::string lockedDisplay (const std::filesystem::path& instance) {
     std::getline (lock, display);
     return display;
 }
-/** XDG_CURRENT_DESKTOP is a colon separated list, Hyprland puts "Hyprland" in it */
 bool onHyprland (const char* currentDesktop) {
     if (currentDesktop == nullptr) {
 	return false;
@@ -67,7 +66,7 @@ bool onHyprland (const char* currentDesktop) {
     std::ranges::transform (lowered, lowered.begin (), [] (unsigned char c) { return std::tolower (c); });
     return lowered.find ("hyprland") != std::string::npos;
 }
-} // namespace
+}
 
 std::string WallpaperEngine::Desktop::findHyprlandSocket (
     const std::string& runtimeDir, const char* signature, const char* waylandDisplay, const char* currentDesktop

+ 1 - 2
src/WallpaperEngine/Desktop/HyprlandIPC.h

@@ -11,6 +11,5 @@ std::string findHyprlandSocket (
     const std::string& runtimeDir, const char* signature, const char* waylandDisplay, const char* currentDesktop
 );
 
-/** Sends one request ("j/cursorpos") and returns the whole reply, nullopt when the socket doesn't answer */
 std::optional<std::string> hyprlandRequest (const std::string& socketPath, const std::string& request);
-} // namespace WallpaperEngine::Desktop
+}

+ 1 - 1
src/WallpaperEngine/Desktop/IconTheme.cpp

@@ -91,7 +91,7 @@ int score (const std::filesystem::path& path) {
 
     return size * 2 + (svg ? 1 : 0) - (symbolic ? 100000 : 0);
 }
-} // namespace
+}
 
 IconTheme& IconTheme::get () {
     static IconTheme instance;

+ 1 - 6
src/WallpaperEngine/Desktop/IconTheme.h

@@ -7,15 +7,10 @@
 #include <vector>
 
 namespace WallpaperEngine::Desktop {
-/**
- * Looks up icons the freedesktop way: the user's theme (KDE's kdeglobals), the themes it inherits, hicolor, then
- * /usr/share/pixmaps. Prefers scalable SVGs, then the biggest PNG. Each theme is indexed once on first use.
- */
 class IconTheme {
 public:
     static IconTheme& get ();
 
-    /** An absolute path is returned as is when it exists, anything else is looked up as an icon name */
     [[nodiscard]] std::optional<std::filesystem::path> find (const std::string& icon);
 
 private:
@@ -33,4 +28,4 @@ private:
     std::vector<std::string> m_themes;
     std::map<std::string, std::map<std::string, Candidate>> m_indexes;
 };
-} // namespace WallpaperEngine::Desktop
+}

+ 1 - 2
src/WallpaperEngine/Desktop/KDESession.h

@@ -1,6 +1,5 @@
 #pragma once
 
 namespace WallpaperEngine::Desktop {
-/** True inside a KDE Plasma session, going by the session environment variables */
 bool isKDESession ();
-} // namespace WallpaperEngine::Desktop
+}

+ 1 - 2
src/WallpaperEngine/Desktop/KWinScript.cpp

@@ -140,7 +140,7 @@ private:
     int m_pipe = -1;
     bool m_started = false;
 };
-} // namespace
+}
 
 std::vector<std::string>
 KWinScript::findStale (const std::filesystem::path& directory, std::chrono::seconds minimumAge) {
@@ -213,7 +213,6 @@ KWinScript::KWinScript (DBusConnection* connection, std::string pluginName, cons
 	return;
     }
 
-    // scripts of engines that were killed since the last start
     unloadStale (this->m_connection);
 
     this->m_path = dir + "/" + this->m_pluginName + ".js";

+ 1 - 2
src/WallpaperEngine/Desktop/KWinScript.h

@@ -17,7 +17,6 @@ public:
     KWinScript (const KWinScript&) = delete;
     KWinScript& operator= (const KWinScript&) = delete;
 
-    /** loaded and started */
     [[nodiscard]] bool isLoaded () const { return this->m_running; }
 
     /** Plugin names of the scripts in directory whose engine is gone: the file is not locked by anyone, not new (a
@@ -36,4 +35,4 @@ private:
     bool m_registered = false;
     bool m_running = false;
 };
-} // namespace WallpaperEngine::Desktop
+}

+ 12 - 13
src/WallpaperEngine/Desktop/PowerMonitor.cpp

@@ -21,13 +21,12 @@
 #include "WallpaperEngine/Desktop/HostWayland.h"
 #include "ext-idle-notify-v1-protocol.h"
 #include <wayland-client.h>
-#endif /* ENABLE_WAYLAND */
+#endif
 
 using namespace WallpaperEngine::Desktop;
 
 namespace {
 constexpr auto BATTERY_INTERVAL = std::chrono::seconds (5);
-/** poll fast while idle so the wallpaper resumes quickly */
 constexpr auto IDLE_POLL_ACTIVE = std::chrono::milliseconds (250);
 constexpr auto IDLE_POLL_MAX = std::chrono::milliseconds (5000);
 
@@ -207,7 +206,7 @@ void closeBus (DBusConnection* bus) {
 	dbus_connection_unref (bus);
     }
 }
-} // namespace
+}
 
 std::optional<bool> WallpaperEngine::Desktop::sysfsOnBattery (const std::filesystem::path& powerSupplies) {
     std::error_code error;
@@ -255,7 +254,7 @@ struct PowerMonitor::Sources {
     wl_seat* seat = nullptr;
     ext_idle_notifier_v1* notifier = nullptr;
     ext_idle_notification_v1* notification = nullptr;
-#endif /* ENABLE_WAYLAND */
+#endif
 
 #ifdef ENABLE_WAYLAND
     void disconnectWayland () {
@@ -285,12 +284,12 @@ struct PowerMonitor::Sources {
 	this->registry = nullptr;
 	this->display = nullptr;
     }
-#endif /* ENABLE_WAYLAND */
+#endif
 
     ~Sources () {
 #ifdef ENABLE_WAYLAND
 	this->disconnectWayland ();
-#endif /* ENABLE_WAYLAND */
+#endif
 
 	closeBus (this->systemBus);
 	closeBus (this->sessionBus);
@@ -328,8 +327,8 @@ const ext_idle_notification_v1_listener notificationListener = {
     .idled = notificationIdled,
     .resumed = notificationResumed,
 };
-} // namespace
-#endif /* ENABLE_WAYLAND */
+}
+#endif
 
 PowerMonitor::PowerMonitor () : m_wakeFd (eventfd (0, EFD_CLOEXEC | EFD_NONBLOCK)), m_sources (new Sources) {
     // UPower and the compositor are queried on the thread, sysfs answers until then
@@ -341,7 +340,7 @@ PowerMonitor::PowerMonitor () : m_wakeFd (eventfd (0, EFD_CLOEXEC | EFD_NONBLOCK
 	session != nullptr && std::string_view (session) == "wayland" && std::getenv ("WAYLAND_DISPLAY") != nullptr) {
 	this->m_sources->display = connectWayland ();
     }
-#endif /* ENABLE_WAYLAND */
+#endif
 
     this->m_thread
 	= std::thread ([this] { WallpaperEngine::Logging::guardThread ("Power monitor", [this] { this->run (); }); });
@@ -399,7 +398,7 @@ void PowerMonitor::run () {
 	    sLog.debug ("Power: compositor has no ext-idle-notify-v1");
 	}
     }
-#endif /* ENABLE_WAYLAND */
+#endif
 
     auto nextBatteryCheck = Clock::now () + BATTERY_INTERVAL;
     int appliedMinutes = 0;
@@ -452,7 +451,7 @@ void PowerMonitor::run () {
 
 	    wl_display_flush (sources.display);
 	}
-#endif /* ENABLE_WAYLAND */
+#endif
 
 	auto wait = std::chrono::duration_cast<std::chrono::milliseconds> (nextBatteryCheck - Clock::now ());
 
@@ -515,7 +514,7 @@ void PowerMonitor::run () {
 	    fds[1].fd = wl_display_get_fd (sources.display);
 	    count = 2;
 	}
-#endif /* ENABLE_WAYLAND */
+#endif
 
 	poll (fds, count, static_cast<int> (std::max<int64_t> (0, wait.count ())));
 
@@ -533,7 +532,7 @@ void PowerMonitor::run () {
 		sources.disconnectWayland ();
 	    }
 	}
-#endif /* ENABLE_WAYLAND */
+#endif
 
 	if (fds[0].revents & POLLIN) {
 	    uint64_t value;

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff