volume

package
v0.0.0-...-cb77e8e Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package volume provides an i3bar module that interfaces with alsa or pulse to display and control the system volume.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module struct {
	// contains filtered or unexported fields
}

Module represents a bar.Module that displays volume information.

func DefaultMixer

func DefaultMixer() *Module

DefaultMixer constructs an instance of the volume module for the default mixer.

func DefaultSink

func DefaultSink() *Module

DefaultSink creates a PulseAudio volume module that follows the default sink.

func Mixer

func Mixer(card, mixer string) *Module

Mixer constructs an instance of the volume module for a specific card and mixer on that card.

func Sink

func Sink(sinkName string) *Module

Sink creates a PulseAudio volume module for a named sink.

func (*Module) Output

func (m *Module) Output(outputFunc func(Volume) bar.Output) *Module

Output configures a module to display the output of a user-defined function.

func (*Module) Stream

func (m *Module) Stream(s bar.Sink)

Stream starts the module.

type Volume

type Volume struct {
	Min, Max, Vol int64
	Mute          bool
	// contains filtered or unexported fields
}

Volume represents the current audio volume and mute state.

func (Volume) Frac

func (v Volume) Frac() float64

Frac returns the current volume as a fraction of the total range.

func (Volume) Pct

func (v Volume) Pct() int

Pct returns the current volume in the range 0-100.

func (Volume) SetMuted

func (v Volume) SetMuted(muted bool)

SetMuted controls whether the system volume is muted.

func (Volume) SetVolume

func (v Volume) SetVolume(volume int64)

SetVolume sets the system volume. It does not change the mute status.

Jump to

Keyboard shortcuts

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