Documentation ¶
Index ¶
- Constants
- func GetPortType(cardName string, portName string) int
- type Audio
- func (v *Audio) GetExportedMethods() dbusutil.ExportedMethods
- func (*Audio) GetInterfaceName() string
- func (a *Audio) IsPortEnabled(cardId uint32, portName string) (enabled bool, busErr *dbus.Error)
- func (a *Audio) NoRestartPulseAudio() *dbus.Error
- func (a *Audio) Reset() *dbus.Error
- func (a *Audio) SetPort(cardId uint32, portName string, direction int32) *dbus.Error
- func (a *Audio) SetPortEnabled(cardId uint32, portName string, enabled bool) *dbus.Error
- type Card
- type CardConfig
- type CardExport
- type CardList
- type CardPortExport
- type ConfigKeeper
- func (ck *ConfigKeeper) GetCardAndPortConfig(cardName string, portName string) (*CardConfig, *PortConfig)
- func (ck *ConfigKeeper) Load(file string) error
- func (ck *ConfigKeeper) Print()
- func (ck *ConfigKeeper) RemoveCardConfig(cardName string)
- func (ck *ConfigKeeper) Save(file string) error
- func (ck *ConfigKeeper) SetBalance(cardName string, portName string, balance float64)
- func (ck *ConfigKeeper) SetEnabled(cardName string, portName string, enabled bool)
- func (ck *ConfigKeeper) SetIncreaseVolume(cardName string, portName string, enhance bool)
- func (ck *ConfigKeeper) SetMute(cardName string, portName string, mute bool)
- func (ck *ConfigKeeper) SetReduceNoise(cardName string, portName string, reduce bool)
- func (ck *ConfigKeeper) SetVolume(cardName string, portName string, volume float64)
- func (ck *ConfigKeeper) UpdateCardConfig(cardConfig *CardConfig)
- type Meter
- type Module
- type Port
- type PortConfig
- type PortToken
- type Priorities
- func (pr *Priorities) AddAvailable(cards CardList)
- func (pr *Priorities) AddInputPort(cardName string, portName string)
- func (pr *Priorities) AddOutputPort(cardName string, portName string)
- func (pr *Priorities) GetFirstInput() (string, string)
- func (pr *Priorities) GetFirstInputSkip(skipper Skipper) (string, string)
- func (pr *Priorities) GetFirstOutput() (string, string)
- func (pr *Priorities) GetFirstOutputSkip(skipper Skipper) (string, string)
- func (pr *Priorities) IsInputTypeAfter(type1 int, type2 int) bool
- func (pr *Priorities) IsOutputTypeAfter(type1 int, type2 int) bool
- func (pr *Priorities) Load(file string, cards CardList)
- func (pr *Priorities) Print()
- func (pr *Priorities) RemoveCard(cardName string)
- func (pr *Priorities) RemoveInputPort(cardName string, portName string)
- func (pr *Priorities) RemoveOutputPort(cardName string, portName string)
- func (pr *Priorities) RemoveUnavailable(cards CardList)
- func (pr *Priorities) Save(file string) error
- func (pr *Priorities) SetInputPortFirst(cardName string, portName string)
- func (pr *Priorities) SetOutputPortFirst(cardName string, portName string)
- type Profile
- type ProfileList
- type Sink
- func (v *Sink) GetExportedMethods() dbusutil.ExportedMethods
- func (*Sink) GetInterfaceName() string
- func (s *Sink) GetMeter() (meter dbus.ObjectPath, busErr *dbus.Error)
- func (s *Sink) SetBalance(value float64, isPlay bool) *dbus.Error
- func (s *Sink) SetFade(value float64) *dbus.Error
- func (s *Sink) SetMute(value bool) *dbus.Error
- func (s *Sink) SetPort(name string) *dbus.Error
- func (s *Sink) SetVolume(value float64, isPlay bool) *dbus.Error
- type SinkInput
- func (v *SinkInput) GetExportedMethods() dbusutil.ExportedMethods
- func (*SinkInput) GetInterfaceName() string
- func (s *SinkInput) SetBalance(value float64, isPlay bool) *dbus.Error
- func (s *SinkInput) SetFade(value float64) *dbus.Error
- func (s *SinkInput) SetMute(value bool) *dbus.Error
- func (s *SinkInput) SetVolume(value float64, isPlay bool) *dbus.Error
- type Skipper
- type Source
- func (v *Source) GetExportedMethods() dbusutil.ExportedMethods
- func (*Source) GetInterfaceName() string
- func (s *Source) GetMeter() (meter dbus.ObjectPath, busErr *dbus.Error)
- func (s *Source) SetBalance(value float64, isPlay bool) *dbus.Error
- func (s *Source) SetFade(value float64) *dbus.Error
- func (s *Source) SetMute(value bool) *dbus.Error
- func (s *Source) SetPort(name string) *dbus.Error
- func (s *Source) SetVolume(value float64, isPlay bool) *dbus.Error
Constants ¶
View Source
const ( CardBuildin = 0 CardBluethooh = 1 CardUnknow = 2 PropDeviceFromFactor = "device.form_factor" PropDeviceBus = "device.bus" )
View Source
const ( PortTypeBluetooth = iota PortTypeHeadset PortTypeSpeaker PortTypeHdmi PortTypeMultiChannel PortTypeCount // 类型数量 )
View Source
const ( PropAppIconName = "application.icon_name" PropAppName = "application.name" PropAppProcessID = "application.process.id" PropAppProcessBinary = "application.process.binary" )
Variables ¶
This section is empty.
Functions ¶
func GetPortType ¶
Types ¶
type Audio ¶
type Audio struct { PropsMu sync.RWMutex // dbusutil-gen: equal=objectPathSliceEqual SinkInputs []dbus.ObjectPath // dbusutil-gen: equal=objectPathSliceEqual Sinks []dbus.ObjectPath // dbusutil-gen: equal=objectPathSliceEqual Sources []dbus.ObjectPath DefaultSink dbus.ObjectPath DefaultSource dbus.ObjectPath Cards string // dbusutil-gen: ignore IncreaseVolume gsprop.Bool `prop:"access:rw"` // dbusutil-gen: ignore ReduceNoise gsprop.Bool `prop:"access:rw"` // 最大音量 MaxUIVolume float64 // readonly // contains filtered or unexported fields }
func (*Audio) GetExportedMethods ¶
func (v *Audio) GetExportedMethods() dbusutil.ExportedMethods
func (*Audio) GetInterfaceName ¶
func (*Audio) IsPortEnabled ¶
func (*Audio) NoRestartPulseAudio ¶
type Card ¶
type Card struct { Id uint32 Name string ActiveProfile *Profile Profiles ProfileList Ports pulse.CardPortInfos // contains filtered or unexported fields }
type CardConfig ¶
type CardConfig struct { Name string Ports map[string]*PortConfig // Name => PortConfig }
func NewCardConfig ¶
func NewCardConfig(name string) *CardConfig
func (*CardConfig) RemovePortConfig ¶
func (card *CardConfig) RemovePortConfig(portName string)
func (*CardConfig) UpdatePortConfig ¶
func (card *CardConfig) UpdatePortConfig(portConfig *PortConfig)
type CardExport ¶
type CardExport struct { Id uint32 Name string Ports []CardPortExport }
type CardPortExport ¶
type ConfigKeeper ¶
type ConfigKeeper struct {
ConfigMap map[string]*CardConfig // Name => CardConfig
}
func NewConfigKeeper ¶
func NewConfigKeeper() *ConfigKeeper
func (*ConfigKeeper) GetCardAndPortConfig ¶
func (ck *ConfigKeeper) GetCardAndPortConfig(cardName string, portName string) (*CardConfig, *PortConfig)
func (*ConfigKeeper) Load ¶
func (ck *ConfigKeeper) Load(file string) error
func (*ConfigKeeper) Print ¶
func (ck *ConfigKeeper) Print()
func (*ConfigKeeper) RemoveCardConfig ¶
func (ck *ConfigKeeper) RemoveCardConfig(cardName string)
func (*ConfigKeeper) Save ¶
func (ck *ConfigKeeper) Save(file string) error
func (*ConfigKeeper) SetBalance ¶
func (ck *ConfigKeeper) SetBalance(cardName string, portName string, balance float64)
func (*ConfigKeeper) SetEnabled ¶
func (ck *ConfigKeeper) SetEnabled(cardName string, portName string, enabled bool)
func (*ConfigKeeper) SetIncreaseVolume ¶
func (ck *ConfigKeeper) SetIncreaseVolume(cardName string, portName string, enhance bool)
func (*ConfigKeeper) SetMute ¶
func (ck *ConfigKeeper) SetMute(cardName string, portName string, mute bool)
func (*ConfigKeeper) SetReduceNoise ¶
func (ck *ConfigKeeper) SetReduceNoise(cardName string, portName string, reduce bool)
func (*ConfigKeeper) SetVolume ¶
func (ck *ConfigKeeper) SetVolume(cardName string, portName string, volume float64)
func (*ConfigKeeper) UpdateCardConfig ¶
func (ck *ConfigKeeper) UpdateCardConfig(cardConfig *CardConfig)
type Meter ¶
func (*Meter) GetExportedMethods ¶
func (v *Meter) GetExportedMethods() dbusutil.ExportedMethods
func (*Meter) GetInterfaceName ¶
type Module ¶
type Module struct { *loader.ModuleBase // contains filtered or unexported fields }
func (*Module) GetDependencies ¶
func (*Module) WaitEnable ¶
func (m *Module) WaitEnable()
type PortConfig ¶
type PortConfig struct { Name string Enabled bool Volume float64 IncreaseVolume bool Balance float64 ReduceNoise bool Mute bool }
func NewPortConfig ¶
func NewPortConfig(name string) *PortConfig
type Priorities ¶
type Priorities struct { OutputTypePriority []int OutputInstancePriority []*PortToken InputTypePriority []int InputInstancePriority []*PortToken }
func NewPriorities ¶
func NewPriorities() *Priorities
func (*Priorities) AddAvailable ¶
func (pr *Priorities) AddAvailable(cards CardList)
func (*Priorities) AddInputPort ¶
func (pr *Priorities) AddInputPort(cardName string, portName string)
func (*Priorities) AddOutputPort ¶
func (pr *Priorities) AddOutputPort(cardName string, portName string)
func (*Priorities) GetFirstInput ¶
func (pr *Priorities) GetFirstInput() (string, string)
func (*Priorities) GetFirstInputSkip ¶
func (pr *Priorities) GetFirstInputSkip(skipper Skipper) (string, string)
func (*Priorities) GetFirstOutput ¶
func (pr *Priorities) GetFirstOutput() (string, string)
func (*Priorities) GetFirstOutputSkip ¶
func (pr *Priorities) GetFirstOutputSkip(skipper Skipper) (string, string)
func (*Priorities) IsInputTypeAfter ¶
func (pr *Priorities) IsInputTypeAfter(type1 int, type2 int) bool
这个判断的是 type2 是否在 type1 之后
func (*Priorities) IsOutputTypeAfter ¶
func (pr *Priorities) IsOutputTypeAfter(type1 int, type2 int) bool
这个判断的是 type2 是否在 type1 之后
func (*Priorities) Load ¶
func (pr *Priorities) Load(file string, cards CardList)
func (*Priorities) Print ¶
func (pr *Priorities) Print()
func (*Priorities) RemoveCard ¶
func (pr *Priorities) RemoveCard(cardName string)
func (*Priorities) RemoveInputPort ¶
func (pr *Priorities) RemoveInputPort(cardName string, portName string)
func (*Priorities) RemoveOutputPort ¶
func (pr *Priorities) RemoveOutputPort(cardName string, portName string)
func (*Priorities) RemoveUnavailable ¶
func (pr *Priorities) RemoveUnavailable(cards CardList)
func (*Priorities) Save ¶
func (pr *Priorities) Save(file string) error
func (*Priorities) SetInputPortFirst ¶
func (pr *Priorities) SetInputPortFirst(cardName string, portName string)
func (*Priorities) SetOutputPortFirst ¶
func (pr *Priorities) SetOutputPortFirst(cardName string, portName string)
type ProfileList ¶
type ProfileList []*Profile
type Sink ¶
type Sink struct { PropsMu sync.RWMutex Name string Description string // 默认音量值 BaseVolume float64 // 是否静音 Mute bool // 当前音量 Volume float64 // 左右声道平衡值 Balance float64 // 是否支持左右声道调整 SupportBalance bool // 前后声道平衡值 Fade float64 // 是否支持前后声道调整 SupportFade bool // dbusutil-gen: equal=portsEqual // 支持的输出端口 Ports []Port // 当前使用的输出端口 ActivePort Port // 声卡的索引 Card uint32 // contains filtered or unexported fields }
func (*Sink) GetExportedMethods ¶
func (v *Sink) GetExportedMethods() dbusutil.ExportedMethods
func (*Sink) GetInterfaceName ¶
type SinkInput ¶
type SinkInput struct { PropsMu sync.RWMutex // Name process name Name string Icon string Mute bool Volume float64 Balance float64 SupportBalance bool Fade float64 SupportFade bool SinkIndex uint32 // contains filtered or unexported fields }
func (*SinkInput) GetExportedMethods ¶
func (v *SinkInput) GetExportedMethods() dbusutil.ExportedMethods
func (*SinkInput) GetInterfaceName ¶
func (*SinkInput) SetBalance ¶
type Source ¶
type Source struct { PropsMu sync.RWMutex Name string Description string // 默认的输入音量 BaseVolume float64 Mute bool Volume float64 Balance float64 SupportBalance bool Fade float64 SupportFade bool // dbusutil-gen: equal=portsEqual Ports []Port ActivePort Port // 声卡的索引 Card uint32 // contains filtered or unexported fields }
func (*Source) GetExportedMethods ¶
func (v *Source) GetExportedMethods() dbusutil.ExportedMethods
func (*Source) GetInterfaceName ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.