pulseaudio

package
v0.0.0-...-09171d8 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AudioSource

type AudioSource struct {
	ID         string `json:"id"`
	Name       string `json:"name"`
	BinaryName string `json:"binaryName"`
	Type       string `json:"type"`
	Volume     int    `json:"volume"`
}

type MediaStatusCallback

type MediaStatusCallback func(isPlaying bool)

MediaStatusCallback is called when media playback status changes

type PAClient

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

func NewPAClient

func NewPAClient() *PAClient

func (*PAClient) GetAudioSources

func (client *PAClient) GetAudioSources() []AudioSource

GetAudioSources returns all audio sources in a format suitable for the UI

func (*PAClient) GetFocusedWindowPlaybackStreams

func (client *PAClient) GetFocusedWindowPlaybackStreams() ([]Stream, error)

GetFocusedWindowPlaybackStreams returns active playback streams that best match the focused niri window.

func (*PAClient) IsMediaPlaying

func (client *PAClient) IsMediaPlaying() bool

IsMediaPlaying checks if any media player is currently playing

func (*PAClient) List

func (client *PAClient) List()

func (*PAClient) ListDetailed

func (client *PAClient) ListDetailed()

ListDetailed shows detailed information about streams including all properties

func (*PAClient) ProcessMediaControlAction

func (client *PAClient) ProcessMediaControlAction(action configuration.Action) error

ProcessMediaControlAction handles media control actions like play/pause

func (*PAClient) ProcessVolumeAction

func (client *PAClient) ProcessVolumeAction(action configuration.Action, volumePercent float32) error

func (*PAClient) SetDefaultOutput

func (client *PAClient) SetDefaultOutput(action configuration.Action) error

func (*PAClient) SetMediaStatusCallback

func (client *PAClient) SetMediaStatusCallback(callback MediaStatusCallback)

SetMediaStatusCallback sets the callback function that will be called when media playback status changes

func (*PAClient) SetNewStreamCallback

func (client *PAClient) SetNewStreamCallback(callback StreamEventCallback)

SetNewStreamCallback sets the callback function that will be called when new streams are detected

func (*PAClient) SetRemovedStreamCallback

func (client *PAClient) SetRemovedStreamCallback(callback StreamEventCallback)

SetRemovedStreamCallback sets the callback function that will be called when streams are removed

func (*PAClient) SmartMatchStreams

func (client *PAClient) SmartMatchStreams(sourceType configuration.PulseAudioTargetType, sourceName string) ([]Stream, *Stream)

SmartMatchStreams is a public wrapper for smart matching by source type and name

func (*PAClient) StartMediaStatusMonitoring

func (client *PAClient) StartMediaStatusMonitoring() error

StartMediaStatusMonitoring begins monitoring MPRIS media players for playback status changes

func (*PAClient) StartStreamMonitoring

func (client *PAClient) StartStreamMonitoring() error

StartStreamMonitoring begins monitoring for new audio streams

func (*PAClient) StopStreamMonitoring

func (client *PAClient) StopStreamMonitoring()

StopStreamMonitoring stops monitoring for new audio streams

type Stream

type Stream struct {
	Name       string
	FullName   string
	BinaryName string
	MediaName  string
	ProcessID  int
	// contains filtered or unexported fields
}

type StreamEventCallback

type StreamEventCallback func(stream Stream, streamType configuration.PulseAudioTargetType)

StreamEventCallback is called when a new stream is detected

Jump to

Keyboard shortcuts

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