godock: github.com/sqp/godock/services/Audio Index | Files

package Audio

import "github.com/sqp/godock/services/Audio"

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

Index

Package Files

audio.go config.go

Constants

const DefaultIconMuted = "muted.svg"

DefaultIconMuted is the default emblem icon for muted streams.

const EmblemMuted = cdtype.EmblemTopRight

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

const VolumeMax = 65535

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

func NewApplet Uses

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

NewApplet creates a new applet instance.

func VolumeDelta Uses

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

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

func VolumeToFloat Uses

func VolumeToFloat(values []uint32) float64

VolumeToFloat converts Dbus volume info into an average usable value.

func VolumeToPercent Uses

func VolumeToPercent(value float64) string

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

type AppPulse Uses

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 Uses

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

NewAppPulse creates a pulseaudio dbus service.

func (*AppPulse) DeviceMuteUpdated Uses

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

DeviceMuteUpdated receives a device mute update.

func (*AppPulse) DeviceVolumeUpdated Uses

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

DeviceVolumeUpdated receives a device volume update.

func (*AppPulse) DisplayStreamVolume Uses

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

DisplayStreamVolume renders the given stream volume on the subicon.

func (*AppPulse) DisplayVolume Uses

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

DisplayVolume renders the given device volume on the icon.

func (*AppPulse) Init Uses

func (ap *AppPulse) Init() error

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

func (*AppPulse) NewPlaybackStream Uses

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

NewPlaybackStream receives a new stream information.

func (*AppPulse) NewSink Uses

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

NewSink receives a new device information.

func (*AppPulse) PlaybackStreamRemoved Uses

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

PlaybackStreamRemoved receives a lost stream information.

func (*AppPulse) SetSink Uses

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

SetSink sets the sink (device) to monitor.

func (*AppPulse) SetVolumeDelta Uses

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

SetVolumeDelta changes the device volume by a relative amount.

func (*AppPulse) SinkRemoved Uses

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

SinkRemoved receives a lost device information.

func (*AppPulse) StreamInfo Uses

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 Uses

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

StreamMuteUpdated receives a stream mute update.

func (*AppPulse) StreamVolumeUpdated Uses

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

StreamVolumeUpdated receives a stream volume update.

func (*AppPulse) ToggleMute Uses

func (ap *AppPulse) ToggleMute() error

ToggleMute changes the muted state of the selected device.

func (*AppPulse) Volume Uses

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

Volume returns the selected device current volume.

type Applet Uses

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

Applet defines a dock applet.

func (*Applet) Init Uses

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

Init load user configuration if needed and initialise applet.

Package Audio imports 7 packages (graph) and is imported by 1 packages. Updated 2017-10-02. Refresh now. Tools for package owners.