Documentation ¶
Overview ¶
Package Audio is a pulseaudio controler applet for Cairo-Dock.
Index ¶
- Constants
- func NewApplet(base cdtype.AppBase, events *cdtype.Events) cdtype.AppInstance
- func VolumeDelta(values []uint32, delta int64) []uint32
- func VolumeToFloat(values []uint32) float64
- func VolumeToPercent(value float64) string
- type AppPulse
- func (ap *AppPulse) DeviceMuteUpdated(dbus.ObjectPath, bool)
- func (ap *AppPulse) DeviceVolumeUpdated(path dbus.ObjectPath, values []uint32)
- func (ap *AppPulse) DisplayStreamVolume(name string, values []uint32) error
- func (ap *AppPulse) DisplayVolume(values []uint32) error
- func (ap *AppPulse) Init() error
- func (ap *AppPulse) NewPlaybackStream(path dbus.ObjectPath)
- func (ap *AppPulse) NewSink(path dbus.ObjectPath)
- func (ap *AppPulse) PlaybackStreamRemoved(path dbus.ObjectPath)
- func (ap *AppPulse) SetSink(sink dbus.ObjectPath) error
- func (ap *AppPulse) SetVolumeDelta(delta int64) error
- func (ap *AppPulse) SinkRemoved(path dbus.ObjectPath)
- func (ap *AppPulse) StreamInfo(path dbus.ObjectPath) (name, icon string)
- func (ap *AppPulse) StreamMuteUpdated(path dbus.ObjectPath, mute bool)
- func (ap *AppPulse) StreamVolumeUpdated(path dbus.ObjectPath, values []uint32)
- func (ap *AppPulse) ToggleMute() error
- func (ap *AppPulse) Volume() ([]uint32, error)
- type Applet
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.
Variables ¶
This section is empty.
Functions ¶
func VolumeDelta ¶
VolumeDelta change the volume values provided by delta percent (relative to max).
func VolumeToFloat ¶
VolumeToFloat converts Dbus volume info into an average usable value.
func VolumeToPercent ¶
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 ¶
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 ¶
DisplayStreamVolume renders the given stream volume on the subicon.
func (*AppPulse) DisplayVolume ¶
DisplayVolume renders the given device volume on the 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 ¶
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 ¶
ToggleMute changes the muted state of the selected device.