# ukui-volume-control

`ukui-volume-control` provides the audio service and volume control components
used by UKUI. The project covers backend audio management, the UKUI Control
Center audio plugin, and the shortcut audio widget used by the desktop shell.

## Overview

The repository is organized into several functional parts:

- `backend/`
  Builds `ukui-audio-service`, the background service that manages audio
  devices, streams, volume, mute state, and session-related audio behavior.
- `audio/`
  Builds the shared library used by the UKUI Control Center audio module.
- `tray/`
  Contains the tray volume control application source code.
- `ukui-shortcut-audio/`
  Provides the QML plugin and widget resources for the shortcut audio panel.
- `common/`
  Shared helper code used by multiple components.
- `data/`
  Desktop integration files such as the user service unit and autostart entry.
- `debian/`
  Debian and Ubuntu Kylin packaging metadata.

## Features

- Audio device detection and stream management
- Volume and mute control for input and output devices
- Application stream control
- PipeWire and PulseAudio integration
- UKUI Control Center integration
- UKUI shortcut widget and desktop session integration
- Translation resources for multiple locales

## Build Requirements

The project is intended for UKUI desktop environments and depends on Qt 6 plus
several Linux desktop and audio libraries. On Debian-based systems, the package
set below matches the current packaging metadata closely:

```bash
sudo apt install \
  cmake intltool \
  libasound2-dev libcanberra-dev libdbus-1-dev libdconf-dev \
  libglib2.0-dev libgsettings-qt6-dev libkf6windowsystem-dev \
  libkysdk-applications-dev libkysdk-system-dev \
  libpipewire-0.3-dev libpugixml-dev libpulse-dev libsndfile1-dev \
  libukcc-dev libxml2-dev nlohmann-json3-dev \
  qt6-base-dev qt6-base-dev-tools qt6-declarative-dev \
  qt6-svg-dev qt6-tools-dev qt6-tools-dev-tools
```

If the source package is already known to your build environment, you can also
install dependencies from packaging metadata with:

```bash
sudo apt build-dep .
```

You will also need the UKUI runtime environment and related desktop libraries
when running the built binaries.

## Development Build

For local development and testing, configure and build the project with CMake:

```bash
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j"$(nproc)"
```

To install into the system prefix:

```bash
sudo cmake --install build
```

## Main Outputs

The current build installs these primary artifacts:

- `ukui-audio-service` to `/usr/bin`
- The control center audio plugin to `/usr/lib/<multiarch>/ukui-control-center/`
- The shortcut audio QML plugin to
  `/usr/lib/<multiarch>/qt<major>/qml/org/ukui/shortcut/audio`
- Widget resources to `/usr/share/ukui/widgets/org.ukui.shortcut.audio`
- Translation files under `/usr/share/ukui-media/translations/audio`
- A user service unit under `/usr/lib/systemd/user/`

## Debian Packaging

For Debian and Ubuntu Kylin package creation, packaging files are maintained in
`debian/`.

This package uses the `3.0 (quilt)` source format. When building a source
package, make sure the upstream tarball is available as:

```text
../ukui-volume-control_<upstream-version>.orig.tar.gz
```

The upstream tarball can be fetched according to `debian/watch` with:

```bash
uscan --download-current-version --force-download --rename
```

To build a source package for review or upload:

```bash
debuild -S -sa
```

To build binary packages locally:

```bash
debuild -b -uc -us
```

You can also use `dpkg-buildpackage` directly if preferred.

Build artifacts such as `.dsc`, `.changes`, `.buildinfo`, and `.deb` files are
normally generated in the parent directory.

## License

Most of this project is licensed under GPL-3.0-or-later. See `COPYING` for the
full GPL text and `debian/copyright` for packaged copyright and third-party
license details.
