AudioCppTray is a lightweight Windows system-tray manager for the native
audiocpp_server.exe process. It keeps the server lifecycle, status, logging,
live log viewing, and log rotation in one small desktop application.
The application is written in modern C++ on top of the Win32 API. It does not require WinUI 3, .NET, or a web runtime.
- Windows system-tray icon with online/offline status.
- Start, stop, and restart the AudioCpp server.
- Prevents multiple tray instances with a named Windows mutex.
- Optional startup with Windows.
- Live log window with a dark theme and a monospace font.
- Live updates without repeatedly displaying the existing log history.
- Thread-safe in-memory log buffer with a 2,000-line limit.
- Manual log rotation from the tray menu.
- Optional automatic daily log rotation at a configurable time.
- Settings window with editable paths, folder/file pickers, Save, and Cancel.
- Configuration stored in the current user's Windows Registry.
- English user interface by default with optional JSON localization.
- Windows 10 or later.
- x64 Microsoft C++ compiler (Visual Studio or Visual Studio Build Tools).
- Windows SDK and the standard Windows libraries used by the project.
audiocpp_server.exe.- A compatible
server.jsonconfiguration file.
The server executable is not included in this repository. It must be supplied separately and placed in the configured server directory.
A typical runtime directory looks like this:
AudioCppTray/
├── AudioCppTray.exe
├── audiocpp_server.exe
├── server.json
├── audiocpptray_locale.json
├── log.txt
└── log/
The default server directory is the directory containing AudioCppTray.exe.
The default active log is log.txt, and rotated logs are written to the
log subdirectory.
Open an x64 Native Tools Command Prompt for Visual Studio, change to the project directory, and run:
build.batThe script compiles the C++ sources with optimization enabled and links the
result as a Windows GUI executable. The generated AudioCppTray.exe and
intermediate object files are build outputs and are not part of the source
history.
The build script compiles these modules:
AudioCppTray.cpp Tray icon, menu, message loop, and application entry point
Server.cpp audiocpp_server.exe process lifecycle
Status.cpp Tray status icon and tooltip updates
AutoStart.cpp Windows Startup shortcut management
AutoLogRoll.cpp Automatic rotation state and daily execution tracking
Settings.cpp Settings window and Registry persistence
Localization.cpp Optional JSON-based user-interface translations
LogBuffer.cpp Thread-safe circular in-memory log buffer
LogViewer.cpp Dark live log window
LogWatcher.cpp Incremental log-file watcher and rotation logic
When the server is started, AudioCppTray launches the executable with the following command pattern:
audiocpp_server.exe --config server.json --log --log-file "<configured-log-file>"
The configured server directory is used as the process working directory, so
the relative server.json path is resolved there. The server executable name
is always audiocpp_server.exe.
The tray menu contains a Settings entry with these options:
- Server execution directory.
- Main active log file.
- Rotated-log directory.
- Server configuration file.
- Automatic rotation enable/disable flag.
- Automatic rotation hour and minute.
Saving settings applies them immediately. If the server is running, the application stops and restarts it so the new command-line parameters take effect. Cancelling closes the window without changing the stored values.
Settings are stored per Windows user under:
HKEY_CURRENT_USER\Software\AudioCppTray
The stored values are:
ServerFolder
LogFile
RotationFolder
ConfigFile
AutomaticLogRoll
RotationHour
RotationMinute
The default interface language is English. To customize the text, place
audiocpptray_locale.json next to AudioCppTray.exe. The repository includes
a human-editable template. Each entry contains the original English text and
a translation field; fill in the translation field and leave it empty to use
English for that entry. If the file is malformed, AudioCppTray shows an error
message and continues with the built-in English text.
The watcher checks the active log file periodically and reads only data added since the previous check. It detects a truncated or recreated log file and starts reading from the beginning of the new file.
The live viewer uses a dark background, light text, and a compact Consolas font. It automatically follows new entries only when the user is already at the bottom, allowing older entries to be inspected without being forced back down by incoming log lines.
Selecting Roll log from the tray menu:
-
Stops the server if it is running.
-
Waits for the server process to release the active log file.
-
Moves the active log into the rotation directory.
-
Names the archived file with a timestamp, for example:
log_2026-08-03_04-00-00-123.txt -
Creates a new empty active log file.
-
Restarts the server if it was running before the operation.
The Automatic Log Rotation menu item enables or disables the feature. When enabled, AudioCppTray checks the configured time once per day and rotates the log only when the active log contains data. The daily execution marker is stored so the same day is not rotated repeatedly.
The repository contains the AudioCppTray source code, headers, resources, and
the build script. Generated files such as .obj, .exe, .res, and runtime
logs are excluded through .gitignore.
The external audiocpp_server.exe binary and its server configuration remain
separate from this repository because they belong to the AudioCpp server
project.
Version v0.2 adds the configurable server configuration path, startup
validation, reset of all settings and the Windows Startup shortcut, orderly
shutdown of secondary windows, colored server status indicators, start/stop
notifications, English UI text, and optional JSON localization through
audiocpptray_locale.json.
Version v0.1 is the first functional release and includes the tray manager,
server lifecycle controls, settings persistence, live logging, manual log
rotation, and optional scheduled log rotation.