Documentation
¶
Index ¶
- type AudioSource
- type MediaStatusCallback
- type PAClient
- func (client *PAClient) GetAudioSources() []AudioSource
- func (client *PAClient) GetFocusedWindowPlaybackStreams() ([]Stream, error)
- func (client *PAClient) IsMediaPlaying() bool
- func (client *PAClient) List()
- func (client *PAClient) ListDetailed()
- func (client *PAClient) ProcessMediaControlAction(action configuration.Action) error
- func (client *PAClient) ProcessVolumeAction(action configuration.Action, volumePercent float32) error
- func (client *PAClient) SetDefaultOutput(action configuration.Action) error
- func (client *PAClient) SetMediaStatusCallback(callback MediaStatusCallback)
- func (client *PAClient) SetNewStreamCallback(callback StreamEventCallback)
- func (client *PAClient) SetRemovedStreamCallback(callback StreamEventCallback)
- func (client *PAClient) SmartMatchStreams(sourceType configuration.PulseAudioTargetType, sourceName string) ([]Stream, *Stream)
- func (client *PAClient) StartMediaStatusMonitoring() error
- func (client *PAClient) StartStreamMonitoring() error
- func (client *PAClient) StopStreamMonitoring()
- type Stream
- type StreamEventCallback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AudioSource ¶
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 ¶
GetFocusedWindowPlaybackStreams returns active playback streams that best match the focused niri window.
func (*PAClient) IsMediaPlaying ¶
IsMediaPlaying checks if any media player is currently playing
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 ¶
StartMediaStatusMonitoring begins monitoring MPRIS media players for playback status changes
func (*PAClient) StartStreamMonitoring ¶
StartStreamMonitoring begins monitoring for new audio streams
func (*PAClient) StopStreamMonitoring ¶
func (client *PAClient) StopStreamMonitoring()
StopStreamMonitoring stops monitoring for new audio streams
type StreamEventCallback ¶
type StreamEventCallback func(stream Stream, streamType configuration.PulseAudioTargetType)
StreamEventCallback is called when a new stream is detected