soundutils

package
v0.0.0-...-d1fb4aa Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: GPL-3.0 Imports: 7 Imported by: 10

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) (err error)

Types

type ShutdownSoundConfig

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

func GetShutdownSoundConfig

func GetShutdownSoundConfig() (*ShutdownSoundConfig, error)

Jump to

Keyboard shortcuts

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