audiolevel

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2026 License: MIT, MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package audiolevel is the volume level the `lys-shell audio output-volume` and `input-volume` commands take: a percentage to set, or +N and -N to move the current one.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level struct {
	// Percent is the level to set, or the signed step of a relative one.
	Percent float64
	// Relative marks a +N or -N step.
	Relative bool
}

Level is a parsed volume level.

func Parse

func Parse(s string) (Level, error)

Parse reads "N" as a level to set and "+N" or "-N" as a step.

func (Level) Apply

func (l Level) Apply(current float64) float64

Apply is the level reached from current, clamped to 0-100.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL