dbus

package
v0.0.0-...-42fbe33 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package dbus implements a D-Bus interface to Audacious.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Advance

func Advance(ctx context.Context) error

Advance skips ahead one song in the current playlist.

func BusConnect

func BusConnect() error

BusConnect starts the dbus connection, it should only be called once.

func GetPlaylistLength

func GetPlaylistLength(ctx context.Context) (length int32, err error)

GetPlaylistLength returns the number of songs in the active playlist.

func GetPlaylistName

func GetPlaylistName(ctx context.Context) (name string, err error)

GetPlaylistName returns the name of the active playlist.

func GetPlaylistPosition

func GetPlaylistPosition(ctx context.Context) (position uint32, err error)

GetPlaylistPosition returns the currently selected song in the active playlist.

func GetRepeat

func GetRepeat(ctx context.Context) (repeat bool, err error)

GetRepeat toggles the value of the repeat button.

func GetShuffle

func GetShuffle(ctx context.Context) (shuffle bool, err error)

GetShuffle toggles the value of the shuffle button.

func GetSongAlbum

func GetSongAlbum(ctx context.Context, entry uint32) (album string, err error)

GetSongAlbum returns the album of the given song in the active playlist.

func GetSongArtist

func GetSongArtist(ctx context.Context, entry uint32) (artist string, err error)

GetSongArtist returns the artist of the given song in the active playlist.

func GetSongFilename

func GetSongFilename(ctx context.Context, entry uint32) (filename string, err error)

GetSongFilename returns the filename of the given song in the active playlist.

func GetSongLength

func GetSongLength(ctx context.Context, entry uint32) (length int32, err error)

GetSongLength returns the length, in seconds, of the given song in the active playlist.

func GetSongName

func GetSongName(ctx context.Context, entry uint32) (title string, err error)

GetSongName returns the unformatted title of the given song in the active playlist.

func GetSongTitle

func GetSongTitle(ctx context.Context, entry uint32) (title string, err error)

GetSongTitle returns the formatted title of the given song in the active playlist.

func GetSongYear

func GetSongYear(ctx context.Context, entry uint32) (year int32, err error)

GetSongYear returns the year of the given song in the active playlist.

func GetVolume

func GetVolume(ctx context.Context) (volume int32, err error)

GetVolume returns the volume of the media player.

func IsUnknownServiceError

func IsUnknownServiceError(err error) bool

IsUnknownServiceError returns true if the error represents an org.freedesktop.DBus.Error.ServiceUnknown error. An error of this type will be returned if Audacious is closed.

func Play

func Play(ctx context.Context) error

Play starts playing the currently selected song in the active playlist.

func PlayPause

func PlayPause(ctx context.Context) error

PlayPause either starts playback of the currently selected song or pauses playback of the currently playing song.

func PlaylistJump

func PlaylistJump(ctx context.Context, pos uint32) error

PlaylistJump switches the currently selected song in the active playlist.

func Reverse

func Reverse(ctx context.Context) error

Reverse skips backwards one song in the current playlist.

func SetVolume

func SetVolume(ctx context.Context, volume int32) error

SetVolume sets the volume of the media player to the given value.

func Stop

func Stop(ctx context.Context) error

Stop stops playback of the currently playing song.

func ToggleRepeat

func ToggleRepeat(ctx context.Context) error

ToggleRepeat toggles the value of the repeat button.

func ToggleShuffle

func ToggleShuffle(ctx context.Context) error

ToggleShuffle toggles the value of the shuffle button.

func WaitForAudacious

func WaitForAudacious() (waitStarted func(), isRunning func() bool, err error)

WaitForAudacious monitors the running state of Audacious. It returns two funcs, the first of which waits until Audacious has started, and the second of which can be used to query it's running state.

Neither func will ever be nil, even in the case of err being non-nil.

Types

type Error

type Error = dbus.Error

Error represents a D-Bus message of type Error.

Jump to

Keyboard shortcuts

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