Documentation ¶
Index ¶
- Constants
- Variables
- func NewPaInfo(data unsafe.Pointer, Type int) *paInfo
- type CVolume
- func (cv CVolume) Avg() float64
- func (cv CVolume) Balance(cmap ChannelMap) float64
- func (cv CVolume) Fade(cmap ChannelMap) float64
- func (cv CVolume) SetAvg(v float64) CVolume
- func (cv CVolume) SetBalance(cm ChannelMap, balance float64) CVolume
- func (cv CVolume) SetFade(cm ChannelMap, fade float64) CVolume
- type Callback
- type Card
- type CardPortInfo
- type CardPortInfos
- type ChannelMap
- type ChannelPosition
- type Context
- func (c *Context) AddEventChan(ch chan<- *Event)
- func (c *Context) AddStateChan(ch chan<- int)
- func (c *Context) GetCard(index uint32) (*Card, error)
- func (c *Context) GetCardList() (r []*Card)
- func (c *Context) GetDefaultSink() string
- func (c *Context) GetDefaultSource() string
- func (c *Context) GetServer() (*Server, error)
- func (c *Context) GetSink(index uint32) (*Sink, error)
- func (c *Context) GetSinkInput(index uint32) (*SinkInput, error)
- func (c *Context) GetSinkInputList() (r []*SinkInput)
- func (c *Context) GetSinkList() (r []*Sink)
- func (c *Context) GetSource(index uint32) (*Source, error)
- func (c *Context) GetSourceList() (r []*Source)
- func (c *Context) GetSourceOutput(index uint32) (*SourceOutput, error)
- func (c *Context) GetSourceOutputList() (r []*SourceOutput)
- func (c *Context) MoveSinkInputsByIndex(sinkInputs []uint32, sinkIdx uint32)
- func (c *Context) MoveSinkInputsByName(sinkInputs []uint32, sinkName string)
- func (c *Context) MoveSourceOutputsByIndex(sourceOutputs []uint32, sourceIdx uint32)
- func (c *Context) MoveSourceOutputsByName(sourceOutputs []uint32, sourceName string)
- func (c *Context) RemoveEventChan(ch chan<- *Event)
- func (c *Context) RemoveStateChan(ch chan<- int)
- func (c *Context) SetDefaultSink(name string)
- func (c *Context) SetDefaultSource(name string)
- func (c *Context) SetSinkInputMute(sinkInputIndex uint32, mute bool)
- func (c *Context) SetSinkInputVolume(sinkInputIndex uint32, v CVolume)
- func (c *Context) SetSinkMuteByIndex(sinkIndex uint32, mute bool)
- func (c *Context) SetSinkPortByIndex(sinkIndex uint32, portName string)
- func (c *Context) SetSinkVolumeByIndex(sinkIndex uint32, v CVolume)
- func (c *Context) SetSourceMuteByIndex(sourceIndex uint32, mute bool)
- func (c *Context) SetSourcePortByIndex(sourceIndex uint32, portName string)
- func (c *Context) SetSourceVolumeByIndex(sourceIndex uint32, v CVolume)
- func (c *Context) SuspendSinkById(idx uint32, suspend int)
- func (c *Context) SuspendSourceById(idx uint32, suspend int)
- type Event
- type PortInfo
- type PortInfos
- type ProfileInfo2
- type ProfileInfos2
- type PropList
- type SampleFormat
- type SampleSpec
- type Server
- type Sink
- type SinkInput
- type Source
- type SourceMeter
- type SourceOutput
- type Volume
Constants ¶
View Source
const ( DirectionSink int = iota + 1 DirectionSource )
View Source
const ( VolumeMax = C.PA_VOLUME_MAX * 1.0 / C.PA_VOLUME_NORM VolumeUIMax = 99957.0 / C.PA_VOLUME_NORM // C.pa_sw_volume_from_dB(11.0) )
View Source
const ( AvailableTypeUnknow int = iota AvailableTypeNo AvailableTypeYes )
View Source
const ( PA_PROP_MEDIA_NAME = "media.name" PA_PROP_MEDIA_TITLE = "media.title" PA_PROP_MEDIA_ARTIST = "media.artist" PA_PROP_MEDIA_COPYRIGHT = "media.copyright" PA_PROP_MEDIA_SOFTWARE = "media.software" PA_PROP_MEDIA_LANGUAGE = "media.language" PA_PROP_MEDIA_FILENAME = "media.filename" PA_PROP_MEDIA_ICON_NAME = "media.icon_name" PA_PROP_MEDIA_ROLE = "media.role" PA_PROP_FILTER_WANT = "filter.want" PA_PROP_FILTER_APPLY = "filter.apply" PA_PROP_FILTER_SUPPRESS = "filter.suppress" PA_PROP_EVENT_ID = "event.id" PA_PROP_EVENT_DESCRIPTION = "event.description" PA_PROP_EVENT_MOUSE_X = "event.mouse.x" PA_PROP_EVENT_MOUSE_Y = "event.mouse.y" PA_PROP_EVENT_MOUSE_HPOS = "event.mouse.hpos" PA_PROP_EVENT_MOUSE_VPOS = "event.mouse.vpos" PA_PROP_EVENT_MOUSE_BUTTON = "event.mouse.button" PA_PROP_WINDOW_NAME = "window.name" PA_PROP_WINDOW_ID = "window.id" PA_PROP_WINDOW_ICON_NAME = "window.icon_name" PA_PROP_WINDOW_X = "window.x" PA_PROP_WINDOW_Y = "window.y" PA_PROP_WINDOW_WIDTH = "window.width" PA_PROP_WINDOW_HEIGHT = "window.height" PA_PROP_WINDOW_HPOS = "window.hpos" PA_PROP_WINDOW_VPOS = "window.vpos" PA_PROP_WINDOW_DESKTOP = "window.desktop" PA_PROP_WINDOW_X11_DISPLAY = "window.x11.display" PA_PROP_WINDOW_X11_SCREEN = "window.x11.screen" PA_PROP_WINDOW_X11_MONITOR = "window.x11.monitor" PA_PROP_WINDOW_X11_XID = "window.x11.xid" PA_PROP_APPLICATION_NAME = "application.name" PA_PROP_APPLICATION_ID = "application.id" PA_PROP_APPLICATION_VERSION = "application.version" PA_PROP_APPLICATION_ICON_NAME = "application.icon_name" PA_PROP_APPLICATION_LANGUAGE = "application.language" PA_PROP_APPLICATION_PROCESS_ID = "application.process.id" PA_PROP_APPLICATION_PROCESS_BINARY = "application.process.binary" PA_PROP_APPLICATION_PROCESS_USER = "application.process.user" PA_PROP_APPLICATION_PROCESS_HOST = "application.process.host" PA_PROP_APPLICATION_PROCESS_MACHINE_ID = "application.process.machine_id" PA_PROP_APPLICATION_PROCESS_SESSION_ID = "application.process.session_id" PA_PROP_DEVICE_STRING = "device.string" PA_PROP_DEVICE_API = "device.api" PA_PROP_DEVICE_DESCRIPTION = "device.description" PA_PROP_DEVICE_BUS_PATH = "device.bus_path" PA_PROP_DEVICE_SERIAL = "device.serial" PA_PROP_DEVICE_VENDOR_ID = "device.vendor.id" PA_PROP_DEVICE_VENDOR_NAME = "device.vendor.name" PA_PROP_DEVICE_PRODUCT_ID = "device.product.id" PA_PROP_DEVICE_PRODUCT_NAME = "device.product.name" PA_PROP_DEVICE_CLASS = "device.class" PA_PROP_DEVICE_FORM_FACTOR = "device.form_factor" PA_PROP_DEVICE_BUS = "device.bus" PA_PROP_DEVICE_ICON_NAME = "device.icon_name" PA_PROP_DEVICE_ACCESS_MODE = "device.access_mode" PA_PROP_DEVICE_MASTER_DEVICE = "device.master_device" PA_PROP_DEVICE_BUFFERING_BUFFER_SIZE = "device.buffering.buffer_size" PA_PROP_DEVICE_BUFFERING_FRAGMENT_SIZE = "device.buffering.fragment_size" PA_PROP_DEVICE_PROFILE_NAME = "device.profile.name" PA_PROP_DEVICE_INTENDED_ROLES = "device.intended_roles" PA_PROP_DEVICE_PROFILE_DESCRIPTION = "device.profile.description" PA_PROP_MODULE_AUTHOR = "module.author" PA_PROP_MODULE_DESCRIPTION = "module.description" PA_PROP_MODULE_USAGE = "module.usage" PA_PROP_MODULE_VERSION = "module.version" PA_PROP_FORMAT_SAMPLE_FORMAT = "format.sample_format" PA_PROP_FORMAT_RATE = "format.rate" PA_PROP_FORMAT_CHANNELS = "format.channels" PA_PROP_FORMAT_CHANNEL_MAP = "format.channel_map" )
View Source
const ( EventTypeNew = C.PA_SUBSCRIPTION_EVENT_NEW EventTypeChange = C.PA_SUBSCRIPTION_EVENT_CHANGE EventTypeRemove = C.PA_SUBSCRIPTION_EVENT_REMOVE )
View Source
const ( FacilityServer = C.PA_SUBSCRIPTION_EVENT_SERVER FacilitySink = C.PA_SUBSCRIPTION_EVENT_SINK FacilitySource = C.PA_SUBSCRIPTION_EVENT_SOURCE FacilitySinkInput = C.PA_SUBSCRIPTION_EVENT_SINK_INPUT FacilitySourceOutput = C.PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT FacilityCard = C.PA_SUBSCRIPTION_EVENT_CARD FacilityClient = C.PA_SUBSCRIPTION_EVENT_CLIENT FacilityModule = C.PA_SUBSCRIPTION_EVENT_MODULE FacilitySampleCache = C.PA_SUBSCRIPTION_EVENT_SAMPLE_CACHE )
View Source
const ( ContextStateUnconnected = C.PA_CONTEXT_UNCONNECTED ContextStateConnecting = C.PA_CONTEXT_CONNECTING ContextStateAuthorizing = C.PA_CONTEXT_AUTHORIZING ContextStateSettingName = C.PA_CONTEXT_SETTING_NAME ContextStateReady = C.PA_CONTEXT_READY ContextStateFailed = C.PA_CONTEXT_FAILED ContextStateTerminated = C.PA_CONTEXT_TERMINATED )
Variables ¶
View Source
var PulseInitTimeout = 20
Functions ¶
Types ¶
type CVolume ¶
type CVolume struct {
// contains filtered or unexported fields
}
func (CVolume) Balance ¶
func (cv CVolume) Balance(cmap ChannelMap) float64
func (CVolume) Fade ¶
func (cv CVolume) Fade(cmap ChannelMap) float64
func (CVolume) SetBalance ¶
func (cv CVolume) SetBalance(cm ChannelMap, balance float64) CVolume
type Card ¶
type Card struct { Index uint32 Name string OwnerModule uint32 Driver string PropList map[string]string Profiles ProfileInfos2 ActiveProfile ProfileInfo2 Ports CardPortInfos }
typedef struct pa_card_info { uint32_t index; /**< Index of this card */ const char *name; /**< Name of this card */ uint32_t owner_module; /**< Index of the owning module, or PA_INVALID_INDEX. */ const char *driver; /**< Driver name */ uint32_t n_profiles; /**< Number of entries in profile array */ pa_card_profile_info* profiles; /**< \deprecated Superseded by profiles2 */ pa_card_profile_info* active_profile; /**< \deprecated Superseded by active_profile2 */ pa_proplist *proplist; /**< Property list */ uint32_t n_ports; /**< Number of entries in port array */ pa_card_port_info **ports; /**< Array of pointers to ports, or NULL. Array is terminated by an entry set to NULL. */ pa_card_profile_info2** profiles2; /**< Array of pointers to available profiles, or NULL. Array is terminated by an entry set to NULL. \since 5.0 */ pa_card_profile_info2* active_profile2; /**< Pointer to active profile in the array, or NULL. \since 5.0 */ } pa_card_info;
func (*Card) SetProfile ¶
type CardPortInfo ¶
type CardPortInfo struct { PortInfo Direction int Profiles ProfileInfos2 }
type CardPortInfos ¶
type CardPortInfos []CardPortInfo
func (CardPortInfos) Get ¶
func (infos CardPortInfos) Get(name string, direction int) (CardPortInfo, error)
func (CardPortInfos) TrySelectProfile ¶
func (infos CardPortInfos) TrySelectProfile(portName string) (string, error)
type ChannelMap ¶
type ChannelMap struct {
// contains filtered or unexported fields
}
func (ChannelMap) CanBalance ¶
func (cm ChannelMap) CanBalance() bool
func (ChannelMap) CanFade ¶
func (cm ChannelMap) CanFade() bool
type ChannelPosition ¶
type ChannelPosition int32
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func GetContext ¶
func GetContext() *Context
func GetContextForced ¶
func GetContextForced() *Context
func (*Context) AddEventChan ¶
func (*Context) AddStateChan ¶
func (*Context) GetCardList ¶
func (*Context) GetDefaultSink ¶
func (*Context) GetDefaultSource ¶
func (*Context) GetSinkInputList ¶
func (*Context) GetSinkList ¶
func (*Context) GetSourceList ¶
func (*Context) GetSourceOutput ¶
func (c *Context) GetSourceOutput(index uint32) (*SourceOutput, error)
func (*Context) GetSourceOutputList ¶
func (c *Context) GetSourceOutputList() (r []*SourceOutput)
func (*Context) MoveSinkInputsByIndex ¶
MoveSinkInputsByIndex move sink-inputs to the special sink index
func (*Context) MoveSinkInputsByName ¶
MoveSinkInputsByName move sink-inputs to the special sink name
func (*Context) MoveSourceOutputsByIndex ¶
MoveSourceOutputsByIndex move source-outputs to the special source index
func (*Context) MoveSourceOutputsByName ¶
MoveSourceOutputsByName move source-outputs to the special source name
func (*Context) RemoveEventChan ¶
func (*Context) RemoveStateChan ¶
func (*Context) SetDefaultSink ¶
func (*Context) SetDefaultSource ¶
func (*Context) SetSinkInputMute ¶
func (*Context) SetSinkInputVolume ¶
func (*Context) SetSinkMuteByIndex ¶
func (*Context) SetSinkPortByIndex ¶
func (*Context) SetSinkVolumeByIndex ¶
func (*Context) SetSourceMuteByIndex ¶
func (*Context) SetSourcePortByIndex ¶
func (*Context) SetSourceVolumeByIndex ¶
func (*Context) SuspendSinkById ¶
func (*Context) SuspendSourceById ¶
type ProfileInfo2 ¶
type ProfileInfos2 ¶
type ProfileInfos2 []ProfileInfo2
func (ProfileInfos2) Exists ¶
func (infos ProfileInfos2) Exists(name string) bool
func (ProfileInfos2) Len ¶
func (infos ProfileInfos2) Len() int
func (ProfileInfos2) Less ¶
func (infos ProfileInfos2) Less(i, j int) bool
func (ProfileInfos2) SelectProfile ¶
func (infos ProfileInfos2) SelectProfile() string
func (ProfileInfos2) Swap ¶
func (infos ProfileInfos2) Swap(i, j int)
type SampleFormat ¶
type SampleFormat int32
type SampleSpec ¶
type SampleSpec struct { Format SampleFormat Rate uint32 Channels uint8 }
type Sink ¶
type Sink struct { Index uint32 Name string Description string ChannelMap ChannelMap OwnerModule uint32 Volume CVolume Mute bool MonitorSource uint32 MonitorSourceName string Driver string Flags int PropList map[string]string BaseVolume Volume NVolumeSteps uint32 Card uint32 Ports []PortInfo ActivePort PortInfo }
type Source ¶
type Source struct { Index uint32 Name string Description string ChannelMap ChannelMap OwnerModule uint32 Volume CVolume Mute bool MonitorOfSink uint32 MonitorOfSinkName string Driver string Flags int Proplist map[string]string BaseVolume Volume NVolumeSteps uint32 Card uint32 Ports []PortInfo ActivePort PortInfo }
type SourceMeter ¶
type SourceMeter struct {
// contains filtered or unexported fields
}
func NewSourceMeter ¶
func NewSourceMeter(c *Context, idx uint32) *SourceMeter
func (*SourceMeter) ConnectChanged ¶
func (s *SourceMeter) ConnectChanged(cb func(v float64))
func (*SourceMeter) Destroy ¶
func (s *SourceMeter) Destroy()
type SourceOutput ¶
type SourceOutput struct{}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.