Audio

package
v0.0.0-...-0caaa62 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2017 License: GPL-3.0-or-later Imports: 7 Imported by: 0

Documentation

Overview

Package Audio is a pulseaudio controler applet for Cairo-Dock.

Index

Constants

View Source
const DefaultIconMuted = "muted.svg"

DefaultIconMuted is the default emblem icon for muted streams.

View Source
const EmblemMuted = cdtype.EmblemTopRight

EmblemMuted is the position of the "upload in progress" emblem.

View Source
const VolumeMax = 65535

VolumeMax is the pulseaudio max value for speakers and channels volumes.

Variables

This section is empty.

Functions

func NewApplet

func NewApplet(base cdtype.AppBase, events *cdtype.Events) cdtype.AppInstance

NewApplet creates a new applet instance.

func VolumeDelta

func VolumeDelta(values []uint32, delta int64) []uint32

VolumeDelta change the volume values provided by delta percent (relative to max).

func VolumeToFloat

func VolumeToFloat(values []uint32) float64

VolumeToFloat converts Dbus volume info into an average usable value.

func VolumeToPercent

func VolumeToPercent(value float64) string

VolumeToPercent formats the volume text (input range 0..1).

Types

type AppPulse

type AppPulse struct {
	pulseaudio.Client // Parent API. Allow direct access to control methods.

	StreamIcons bool // whether we need to manage subicons for streams.
	// contains filtered or unexported fields
}

AppPulse connects the pulseaudio service to the dock icon.

func NewAppPulse

func NewAppPulse(obj interface{}) (*AppPulse, error)

NewAppPulse creates a pulseaudio dbus service.

func (*AppPulse) DeviceMuteUpdated

func (ap *AppPulse) DeviceMuteUpdated(dbus.ObjectPath, bool)

DeviceMuteUpdated receives a device mute update.

func (*AppPulse) DeviceVolumeUpdated

func (ap *AppPulse) DeviceVolumeUpdated(path dbus.ObjectPath, values []uint32)

DeviceVolumeUpdated receives a device volume update.

func (*AppPulse) DisplayStreamVolume

func (ap *AppPulse) DisplayStreamVolume(name string, values []uint32) error

DisplayStreamVolume renders the given stream volume on the subicon.

func (*AppPulse) DisplayVolume

func (ap *AppPulse) DisplayVolume(values []uint32) error

DisplayVolume renders the given device volume on the icon.

func (*AppPulse) Init

func (ap *AppPulse) Init() error

Init finds the default sink to display the current volume on icon.

func (*AppPulse) NewPlaybackStream

func (ap *AppPulse) NewPlaybackStream(path dbus.ObjectPath)

NewPlaybackStream receives a new stream information.

func (*AppPulse) NewSink

func (ap *AppPulse) NewSink(path dbus.ObjectPath)

NewSink receives a new device information.

func (*AppPulse) PlaybackStreamRemoved

func (ap *AppPulse) PlaybackStreamRemoved(path dbus.ObjectPath)

PlaybackStreamRemoved receives a lost stream information.

func (*AppPulse) SetSink

func (ap *AppPulse) SetSink(sink dbus.ObjectPath) error

SetSink sets the sink (device) to monitor.

func (*AppPulse) SetVolumeDelta

func (ap *AppPulse) SetVolumeDelta(delta int64) error

SetVolumeDelta changes the device volume by a relative amount.

func (*AppPulse) SinkRemoved

func (ap *AppPulse) SinkRemoved(path dbus.ObjectPath)

SinkRemoved receives a lost device information.

func (*AppPulse) StreamInfo

func (ap *AppPulse) StreamInfo(path dbus.ObjectPath) (name, icon string)

StreamInfo gives the name and icon of the application source of the stream.

func (*AppPulse) StreamMuteUpdated

func (ap *AppPulse) StreamMuteUpdated(path dbus.ObjectPath, mute bool)

StreamMuteUpdated receives a stream mute update.

func (*AppPulse) StreamVolumeUpdated

func (ap *AppPulse) StreamVolumeUpdated(path dbus.ObjectPath, values []uint32)

StreamVolumeUpdated receives a stream volume update.

func (*AppPulse) ToggleMute

func (ap *AppPulse) ToggleMute() error

ToggleMute changes the muted state of the selected device.

func (*AppPulse) Volume

func (ap *AppPulse) Volume() ([]uint32, error)

Volume returns the selected device current volume.

type Applet

type Applet struct {
	cdtype.AppBase // Applet base and dock connection.
	// contains filtered or unexported fields
}

Applet defines a dock applet.

func (*Applet) Init

func (app *Applet) Init(def *cdtype.Defaults, confLoaded bool)

Init load user configuration if needed and initialise applet.

Jump to

Keyboard shortcuts

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