soundutils

package
v0.0.0-...-17244d7 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventPowerPlug     = "power-plug"
	EventPowerUnplug   = "power-unplug"
	EventBatteryLow    = "power-unplug-battery-low"
	EventVolumeChanged = "audio-volume-change"
	EventIconToDesktop = "x-deepin-app-sent-to-desktop"
	EventLogin         = "desktop-login"
	EventLogout        = "desktop-logout"
	EventShutdown      = "system-shutdown"
	EventWakeup        = "suspend-resume"

	EventPowerUnplugBatteryLow   = "power-unplug-battery-low"
	EventAudioVolumeChanged      = "audio-volume-change"
	EventXDeepinAppSentToDesktop = "x-deepin-app-sent-to-desktop"
	EventDesktopLogin            = "desktop-login"
	EventDesktopLogout           = "desktop-logout"
	EventSystemShutdown          = "system-shutdown"
	EventSuspendResume           = "suspend-resume"

	EventDeviceAdded   = "device-added"
	EventDeviceRemoved = "device-removed"
)

Variables

View Source
var UseCache = true

Functions

func CanPlayEvent

func CanPlayEvent(event string) bool

func GetSoundTheme

func GetSoundTheme() string

func GetSystemSoundFile

func GetSystemSoundFile(event string) string

func GetThemeSoundFile

func GetThemeSoundFile(theme, event string) string

func PlaySystemSound

func PlaySystemSound(event, device string) error

func PlayThemeSound

func PlayThemeSound(theme, event, device string) error

func SetShutdownSoundConfig

func SetShutdownSoundConfig(v *ShutdownSoundConfig) error

Types

type ShutdownSoundConfig

type ShutdownSoundConfig struct {
	CanPlay bool
	Theme   string
	Event   string
	Device  string
}

func GetShutdownSoundConfig

func GetShutdownSoundConfig() (*ShutdownSoundConfig, error)

Jump to

Keyboard shortcuts

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