Documentation
¶
Index ¶
- type Card
- func (c *Card) Close() error
- func (c *Card) FindControl(name string) (*Control, error)
- func (c *Card) FindControlByID(id string) (*Control, error)
- func (c *Card) FindControlByPrefix(prefix string) (*Control, error)
- func (c *Card) FindControlsMatching(pattern string) ([]*Control, error)
- func (c *Card) GetControls() ([]*Control, error)
- func (c *Card) GetMixerInput(mixName string, inputNum int) (*Control, error)
- func (c *Card) GetMixerInputs() ([]MixerInput, error)
- func (c *Card) GetMixerLevel(mixName string, inputNum int) (int64, error)
- func (c *Card) GetPollFds() []int
- func (c *Card) GetPreampChannel(channelNum int) (*PreampChannel, error)
- func (c *Card) GetPreampChannels() ([]PreampChannel, error)
- func (c *Card) GetRouting() (map[string]int, error)
- func (c *Card) GetRoutingSinks() ([]RoutingSink, error)
- func (c *Card) GetRoutingSources() ([]RoutingSource, error)
- func (c *Card) IsScarlett() bool
- func (c *Card) NewEventMonitor() *EventMonitor
- func (c *Card) PrintMixerState() error
- func (c *Card) PrintPreampState() error
- func (c *Card) PrintRoutingMatrix() error
- func (c *Card) SetMixerLevel(mixName string, inputNum int, level int64) error
- func (c *Card) SetPreampAir(channelNum int, enabled bool) error
- func (c *Card) SetPreampGain(channelNum int, gain int64) error
- func (c *Card) SetPreampPad(channelNum int, enabled bool) error
- func (c *Card) SetPreampPhantom(channelNum int, enabled bool) error
- func (c *Card) SetRouting(sinkName string, sourceID int) error
- func (c *Card) SetRoutingByNames(sinkName, sourceName string) error
- func (c *Card) String() string
- func (c *Card) WatchWithDisplay() error
- type Control
- func (ctl *Control) DetailedString() string
- func (ctl *Control) FullID() string
- func (ctl *Control) GetValue() (int64, error)
- func (ctl *Control) GetValueString() (string, error)
- func (ctl *Control) SetValue(value int64) error
- func (ctl *Control) SetValueByString(valueStr string) error
- func (ctl *Control) String() string
- type ControlType
- type EventCallback
- type EventMonitor
- type InterfaceType
- type MixerInput
- type PortCategory
- type PreampChannel
- type RoutingSink
- type RoutingSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Card ¶
Card represents a Scarlett audio interface card
func ListCards ¶
ListCards returns a list of all available ALSA cards It filters to only include Focusrite Scarlett devices
func (*Card) FindControl ¶
FindControl finds a control by exact name or full ID If the input contains ':' and '/', it is treated as a full ID (e.g., "mixer:0.0/Level Meter[0]") Otherwise it is treated as a control name
func (*Card) FindControlByID ¶
FindControlByID finds a control by its full identifier The ID format is "interface:device.subdevice/name[index]" (e.g., "mixer:0.0/Level Meter[0]")
func (*Card) FindControlByPrefix ¶
FindControlByPrefix finds a control by name prefix
func (*Card) FindControlsMatching ¶
FindControlsMatching finds all controls matching a pattern
func (*Card) GetControls ¶
GetControls returns all controls for this card
func (*Card) GetMixerInput ¶
GetMixerInput gets a specific mixer input control
func (*Card) GetMixerInputs ¶
func (c *Card) GetMixerInputs() ([]MixerInput, error)
GetMixerInputs returns all mixer input volume controls
func (*Card) GetMixerLevel ¶
GetMixerLevel gets a mixer input level
func (*Card) GetPollFds ¶
GetPollFds returns the file descriptors to poll for events
func (*Card) GetPreampChannel ¶
func (c *Card) GetPreampChannel(channelNum int) (*PreampChannel, error)
GetPreampChannel gets a specific preamp channel
func (*Card) GetPreampChannels ¶
func (c *Card) GetPreampChannels() ([]PreampChannel, error)
GetPreampChannels returns all preamp channels with their controls
func (*Card) GetRouting ¶
GetRouting returns the current routing configuration as a map of sink -> source ID
func (*Card) GetRoutingSinks ¶
func (c *Card) GetRoutingSinks() ([]RoutingSink, error)
GetRoutingSinks returns all routing sinks (destinations) on the card
func (*Card) GetRoutingSources ¶
func (c *Card) GetRoutingSources() ([]RoutingSource, error)
GetRoutingSources returns all routing sources available on the card
func (*Card) IsScarlett ¶
IsScarlett checks if this card is a supported Scarlett device
func (*Card) NewEventMonitor ¶
func (c *Card) NewEventMonitor() *EventMonitor
NewEventMonitor creates a new event monitor for the card
func (*Card) PrintMixerState ¶
PrintMixerState prints the current state of all mixer inputs
func (*Card) PrintPreampState ¶
PrintPreampState prints the current state of all preamp channels
func (*Card) PrintRoutingMatrix ¶
PrintRoutingMatrix prints a human-readable routing matrix
func (*Card) SetMixerLevel ¶
SetMixerLevel sets a mixer input level
func (*Card) SetPreampAir ¶
SetPreampAir sets air mode for a preamp channel
func (*Card) SetPreampGain ¶
SetPreampGain sets the gain for a preamp channel
func (*Card) SetPreampPad ¶
SetPreampPad sets pad for a preamp channel
func (*Card) SetPreampPhantom ¶
SetPreampPhantom sets phantom power for a preamp channel
func (*Card) SetRouting ¶
SetRouting sets a routing connection
func (*Card) SetRoutingByNames ¶
SetRoutingByNames sets a routing connection using source and sink names
func (*Card) WatchWithDisplay ¶
WatchWithDisplay monitors controls and displays changes in a human-readable format
type Control ¶
type Control struct {
NumID uint
Name string
Type ControlType
Count int
Index int
Interface InterfaceType // interface type (mixer, pcm, card, etc.)
Device uint // device number
Subdevice uint // subdevice number
// for integer/enumerated types
Min int64
Max int64
// for enumerated types
Items []string
// contains filtered or unexported fields
}
Control represents an ALSA control element
func (*Control) DetailedString ¶
DetailedString returns a detailed string representation including current value
func (*Control) GetValueString ¶
GetValueString returns the control value as a human-readable string
func (*Control) SetValueByString ¶
SetValueByString sets the control value from a string representation
type ControlType ¶
type ControlType int
ControlType represents the type of an ALSA control element
const ( ControlTypeNone ControlType = iota ControlTypeBoolean ControlTypeInteger ControlTypeEnumerated ControlTypeBytes ControlTypeIEC958 ControlTypeInteger64 )
func (ControlType) String ¶
func (t ControlType) String() string
type EventCallback ¶
type EventCallback func(control *Control)
EventCallback is called when a control changes value
type EventMonitor ¶
type EventMonitor struct {
// contains filtered or unexported fields
}
EventMonitor monitors ALSA control events
func (*EventMonitor) Watch ¶
func (em *EventMonitor) Watch(callback func(numid uint) error) error
Watch starts monitoring for control changes and calls the callback for each change The callback receives the numid of the changed control
func (*EventMonitor) WatchControls ¶
func (em *EventMonitor) WatchControls(callback func(control *Control, value int64) error) error
WatchControls monitors specific controls and calls the callback with control details
type InterfaceType ¶
type InterfaceType int
InterfaceType represents the ALSA control interface type
const ( InterfaceCard InterfaceType = iota InterfaceHwDep InterfaceMixer InterfacePCM InterfaceRawMidi InterfaceTimer InterfaceSequencer )
func (InterfaceType) String ¶
func (i InterfaceType) String() string
type MixerInput ¶
type MixerInput struct {
MixName string // e.g., "Mix A", "Mix B"
InputNum int // 1-based input number
Control *Control
}
MixerInput represents a mixer input channel
type PortCategory ¶
type PortCategory int
PortCategory represents the routing port category
const ( PortCategoryOff PortCategory = iota PortCategoryHW PortCategoryMix PortCategoryDSP PortCategoryPCM )
func (PortCategory) String ¶
func (p PortCategory) String() string
type PreampChannel ¶
type PreampChannel struct {
ChannelNum int
Gain *Control
Phantom *Control
Air *Control
Pad *Control
Impedance *Control
Level *Control
Autogain *Control
Safe *Control
Link *Control
}
PreampChannel represents a preamp input channel with all its controls
type RoutingSink ¶
type RoutingSink struct {
Index int
Name string
Category PortCategory
PortNum int
Control *Control
}
RoutingSink represents a routing sink (destination)
type RoutingSource ¶
type RoutingSource struct {
ID int
Name string
Category PortCategory
PortNum int
HardwareType string
}
RoutingSource represents a routing source endpoint