Documentation
¶
Overview ¶
Package mxremote is a Go library for interfacing with Pulse-Eight MX Remote compatible devices over a local network (UDP multicast or broadcast): video/ audio matrices, OneIP/V2IP units (transmitter/receiver/transceiver/ multiviewer) and amplifiers, all running the shared MatrixOS firmware.
The wire protocol is byte-for-byte compatible with the reference Python library and the MatrixOS firmware. The Go API itself is idiomatic and does not mirror the Python class layout.
Typical use:
mx := mxremote.New(mxremote.Config{
Callbacks: mxremote.Callbacks{
OnDeviceConfigComplete: func(d *mxremote.Device) {
fmt.Println("ready:", d.Serial(), d.ModelName())
},
},
})
if err := mx.Start(ctx); err != nil {
log.Fatal(err)
}
defer mx.Close()
Discovery runs in the background; devices and their bays are populated as hello and configuration frames arrive. Callbacks fire from a single internal goroutine. V2IP routing is driven from sink bays via Bay.SelectVideoSource, Bay.SelectAudioSource and Bay.SelectAudioSourceAddr.
Index ¶
- Constants
- func BayStatusHDCP(status uint32) int
- func BayStatusRCType(status uint32) int
- func ValidAddresses() []string
- type AmpDolbySettings
- type AmpZoneSettings
- type AudioChangeSource
- type AudioEndpoint
- type AudioEndpoints
- type AudioFeatures
- func (a AudioFeatures) HasTrigger() bool
- func (a AudioFeatures) IsAmp() bool
- func (a AudioFeatures) IsHDMI() bool
- func (a AudioFeatures) IsInput() bool
- func (a AudioFeatures) IsOutput() bool
- func (a AudioFeatures) IsRCA() bool
- func (a AudioFeatures) IsSPDIF() bool
- func (a AudioFeatures) IsV2IP() bool
- func (a AudioFeatures) IsV2IPRx() bool
- func (a AudioFeatures) IsV2IPTx() bool
- func (a AudioFeatures) SupportMute() bool
- func (a AudioFeatures) SupportVolume() bool
- type AudioLink
- type Bay
- func (b *Bay) ARC() string
- func (b *Bay) AmpSettings() *AmpZoneSettings
- func (b *Bay) AudioEndpoint() *AudioEndpoint
- func (b *Bay) AudioRouteEndpoint() string
- func (b *Bay) AudioSource() *Bay
- func (b *Bay) BayLabel() string
- func (b *Bay) BayName() string
- func (b *Bay) BayNumber() int
- func (b *Bay) BayUID() BayUID
- func (b *Bay) CECDetected() bool
- func (b *Bay) DecoderDisabled() bool
- func (b *Bay) Device() *Device
- func (b *Bay) DolbyInput() string
- func (b *Bay) EdidProfileValue() (EdidProfile, bool)
- func (b *Bay) EncoderDisabled() bool
- func (b *Bay) Faulty() bool
- func (b *Bay) Features() BayFeaturesMask
- func (b *Bay) HDBTConnected() bool
- func (b *Bay) HPDDetected() bool
- func (b *Bay) Hidden() bool
- func (b *Bay) IsAudio() bool
- func (b *Bay) IsHDBaseT() bool
- func (b *Bay) IsHDMI() bool
- func (b *Bay) IsInput() bool
- func (b *Bay) IsLocal() bool
- func (b *Bay) IsOutput() bool
- func (b *Bay) IsV2IPRemote() bool
- func (b *Bay) IsV2IPSink() bool
- func (b *Bay) IsV2IPSource() bool
- func (b *Bay) Link() *BayLink
- func (b *Bay) LinkConfigured() bool
- func (b *Bay) LinkedBay() *Bay
- func (b *Bay) Mirroring() BayMirrorStatus
- func (b *Bay) Mode() string
- func (b *Bay) MuteSet(mute bool) error
- func (b *Bay) Muted() (bool, bool)
- func (b *Bay) PoEPowered() bool
- func (b *Bay) Port() int
- func (b *Bay) PowerOff() error
- func (b *Bay) PowerOn() error
- func (b *Bay) PowerStatusValue() PowerStatus
- func (b *Bay) RCTypeValue() (RCType, bool)
- func (b *Bay) RegisterCallback(fn func(*Bay))
- func (b *Bay) SelectAudioSource(port int) error
- func (b *Bay) SelectAudioSourceAddr(audioIP string, audioPort int, fmt *V2IPAudioFormat) error
- func (b *Bay) SelectAudioSourceByName(name string, format *V2IPAudioFormat) error
- func (b *Bay) SelectEdidProfile(profile EdidProfile) error
- func (b *Bay) SelectVideoSource(port int) error
- func (b *Bay) SelectVideoSourceByUserName(name string) error
- func (b *Bay) SetHidden(hidden bool) error
- func (b *Bay) SetName(name string) error
- func (b *Bay) SetZoneSettings(s AmpZoneSettings) error
- func (b *Bay) SignalDetected() bool
- func (b *Bay) SignalType() string
- func (b *Bay) String() string
- func (b *Bay) TxAction(action RCAction) error
- func (b *Bay) UserName() string
- func (b *Bay) V2IPSource() *V2IPStreamSources
- func (b *Bay) V2IPUID() DeviceUID
- func (b *Bay) VideoRouteEndpoint() string
- func (b *Bay) VideoSource() *Bay
- func (b *Bay) Volume() (int, bool)
- func (b *Bay) VolumeDown() error
- func (b *Bay) VolumeSet(volume int, muted *bool) error
- func (b *Bay) VolumeStatus() *VolumeMuteStatus
- func (b *Bay) VolumeUp() error
- type BayFeaturesMask
- type BayLink
- type BayMirrorStatus
- type BayStatusMask
- type BayUID
- type Callbacks
- type Config
- type ConnectStatus
- type Device
- func (d *Device) Address() string
- func (d *Device) AmpDolbyChannels() int
- func (d *Device) AudioEndpointByID(id int) *AudioEndpoint
- func (d *Device) AudioEndpoints() *AudioEndpoints
- func (d *Device) AudioMute(endpointID int, mute bool) error
- func (d *Device) AudioSelectInput(sinkEP *AudioEndpoint, source DeviceUID, sourceEP *AudioEndpoint) error
- func (d *Device) AudioTrigger(endpointID int, trigger bool) error
- func (d *Device) AudioVolumeSet(endpointID, volume int) error
- func (d *Device) Bays() map[int]*Bay
- func (d *Device) ConfigurationComplete() bool
- func (d *Device) DolbySettings() *AmpDolbySettings
- func (d *Device) Features() DeviceFeature
- func (d *Device) FirmwareVersions() map[FirmwareType]FirmwareVersion
- func (d *Device) FirstInput() *Bay
- func (d *Device) FirstOutput() *Bay
- func (d *Device) GetByPortname(name string) *Bay
- func (d *Device) GetByPortnum(portnum int) *Bay
- func (d *Device) Inputs() []*Bay
- func (d *Device) IsAmp() bool
- func (d *Device) IsAudioMatrix() bool
- func (d *Device) IsMeshMaster() bool
- func (d *Device) IsMeshMember() bool
- func (d *Device) IsOneIPMultiviewer() bool
- func (d *Device) IsOneIPRx() bool
- func (d *Device) IsOneIPTx() bool
- func (d *Device) IsOneIPTz() bool
- func (d *Device) IsV2IP() bool
- func (d *Device) IsVideoMatrix() bool
- func (d *Device) MACAddress() string
- func (d *Device) MeshMaster() *Device
- func (d *Device) ModelName() string
- func (d *Device) Multiviewer() *Multiviewer
- func (d *Device) Name() string
- func (d *Device) NetworkStatus() map[int]NetworkPortStatus
- func (d *Device) Online() bool
- func (d *Device) Outputs() []*Bay
- func (d *Device) Protocol() int
- func (d *Device) ReadStats(enable bool) error
- func (d *Device) Reboot() error
- func (d *Device) RegisterCallback(fn func(*Device))
- func (d *Device) Serial() string
- func (d *Device) Status() DeviceStatus
- func (d *Device) StatusMessage() string
- func (d *Device) String() string
- func (d *Device) SystemStatus() (status int, message string, ok bool)
- func (d *Device) Temperatures() map[string]int
- func (d *Device) Topology() []TopologyEntry
- func (d *Device) UID() DeviceUID
- func (d *Device) V2IPDetails() *DeviceV2IPDetails
- func (d *Device) V2IPSink() *DeviceV2IPSink
- func (d *Device) V2IPSourceLocal() *V2IPStreamSources
- func (d *Device) V2IPSources() []V2IPStreamSources
- func (d *Device) V2IPStats() *V2IPDeviceStats
- func (d *Device) Version() string
- type DeviceFeature
- type DeviceStatus
- type DeviceUID
- type DeviceV2IPDetails
- type DeviceV2IPSink
- type EdidProfile
- type FirmwareType
- type FirmwareVersion
- type HiddenStatus
- type LinkFeature
- type Multiviewer
- func (m *Multiviewer) AudioMuted() MultiviewerBool
- func (m *Multiviewer) AudioSource() MultiviewerSource
- func (m *Multiviewer) AudioVolume() int
- func (m *Multiviewer) AutoRoute() error
- func (m *Multiviewer) AutoSwitch() MultiviewerBool
- func (m *Multiviewer) ConnectedSource(input int) (DeviceUID, bool)
- func (m *Multiviewer) EdidTemplate() MultiviewerEDIDTemplate
- func (m *Multiviewer) HDCPMode() MultiviewerHDCPMode
- func (m *Multiviewer) MCUVersion() string
- func (m *Multiviewer) OutputITCMode() MultiviewerITCMode
- func (m *Multiviewer) OutputMode() MultiviewerOutputMode
- func (m *Multiviewer) PipPosition() MultiviewerPipPosition
- func (m *Multiviewer) PipSize() MultiviewerPipSize
- func (m *Multiviewer) RemoteControl() MultiviewerSource
- func (m *Multiviewer) ScalerVersion() string
- func (m *Multiviewer) ScreenAspect() MultiviewerAspectRatio
- func (m *Multiviewer) SetAudioSource(source MultiviewerSource) error
- func (m *Multiviewer) SetAudioVolume(volume int, muted bool) error
- func (m *Multiviewer) SetAutoSwitch(enable bool) error
- func (m *Multiviewer) SetConnectedSource(input int, source DeviceUID) error
- func (m *Multiviewer) SetEdidTemplate(e MultiviewerEDIDTemplate) error
- func (m *Multiviewer) SetHDCPMode(h MultiviewerHDCPMode) error
- func (m *Multiviewer) SetOutputITCMode(o MultiviewerITCMode) error
- func (m *Multiviewer) SetOutputMode(o MultiviewerOutputMode) error
- func (m *Multiviewer) SetPipPosition(p MultiviewerPipPosition) error
- func (m *Multiviewer) SetPipSize(s MultiviewerPipSize) error
- func (m *Multiviewer) SetRemoteControl(source MultiviewerSource) error
- func (m *Multiviewer) SetScreenAspect(a MultiviewerAspectRatio) error
- func (m *Multiviewer) SetVideoSource(screen int, source MultiviewerSource) error
- func (m *Multiviewer) SetViewMode(v MultiviewerViewMode) error
- func (m *Multiviewer) VideoSource(screen int) MultiviewerSource
- func (m *Multiviewer) ViewMode() MultiviewerViewMode
- type MultiviewerAspectRatio
- type MultiviewerBool
- type MultiviewerEDIDTemplate
- type MultiviewerHDCPMode
- type MultiviewerITCMode
- type MultiviewerOutputMode
- type MultiviewerPipPosition
- type MultiviewerPipSize
- type MultiviewerSource
- type MultiviewerViewMode
- type MuteStatus
- type NetworkPortStatus
- type PowerStatus
- type RCAction
- type RCKey
- type RCType
- type Remote
- func (r *Remote) Close() error
- func (r *Remote) Devices() []*Device
- func (r *Remote) GetBayByPortnum(uid DeviceUID, port int) *Bay
- func (r *Remote) GetBySerial(serial string) *Device
- func (r *Remote) GetByUID(uid DeviceUID) *Device
- func (r *Remote) GetByUIDString(s string) *Device
- func (r *Remote) Name() string
- func (r *Remote) SendMonitoringPulse() error
- func (r *Remote) Start(ctx context.Context) error
- func (r *Remote) UID() DeviceUID
- func (r *Remote) UpdateConfig(localIP string, broadcast bool) error
- type Svd
- type TopologyEntry
- type UtpCableStatus
- type UtpLinkErrors
- type UtpLinkSpeed
- type V2IPAudioFormat
- type V2IPDecoderState
- type V2IPDeviceStats
- type V2IPRxStats
- type V2IPScalingSettings
- type V2IPStreamSource
- type V2IPStreamSources
- type V2IPTxStats
- type VolumeMuteStatus
Constants ¶
const ( ArcNone = "Inactive" ArcHDMI = "HDMI" ArcOptical = "optical" ArcAnalog = "analog" )
ARC (audio return channel) status strings.
const ( // Version is the version of this library. Version = "1.1.0" // ProtocolVersion is the highest MX Remote protocol version understood. ProtocolVersion uint16 = 0x27 )
Library and protocol versions.
const ( // BroadcastPort is the UDP port used in broadcast mode. BroadcastPort = 8811 // MulticastIP is the multicast group address used for discovery. MulticastIP = "224.8.8.8" // MulticastPort is the UDP port used in multicast mode. MulticastPort = 8812 )
Network defaults.
const ( V2IPPortVideo = 50020 V2IPPortANC = 50021 V2IPPortAudio = 50022 )
Default V2IP stream destination UDP ports.
const ( V2IPAudioDefaultSampleRate = 48000 V2IPAudioDefaultChannels = 2 V2IPAudioMinChannels = 1 V2IPAudioMaxChannels = 8 )
V2IP audio defaults.
Variables ¶
This section is empty.
Functions ¶
func BayStatusHDCP ¶
BayStatusHDCP extracts the HDCP status (2 bits) from a bay-status word.
func BayStatusRCType ¶
BayStatusRCType extracts the RC type (4 bits) from a bay-status word.
func ValidAddresses ¶
func ValidAddresses() []string
ValidAddresses returns the non-loopback IPv4 addresses usable as LocalIP.
Types ¶
type AmpDolbySettings ¶
AmpDolbySettings holds the Dolby processing state of a ProAmp8.
type AmpZoneSettings ¶
type AmpZoneSettings struct {
GainLeft int
GainRight int
VolumeMin int
VolumeMax int
DelayLeft uint32
DelayRight uint32
Bass int
Treble int
Bridged int
PowerMode int
PowerLevel int
PowerTimeout uint32
EQLeft [5]int
EQRight [5]int
}
AmpZoneSettings holds the per-zone settings of a ProAmp8 output.
type AudioChangeSource ¶
AudioChangeSource describes an audio input-selection change.
type AudioEndpoint ¶
type AudioEndpoint struct {
ID int
Features AudioFeatures
Address *V2IPStreamSource
// contains filtered or unexported fields
}
AudioEndpoint is a single audio endpoint on a V2IP device (an input, output, or processor node in the device's audio tree).
func (*AudioEndpoint) Bay ¶
func (e *AudioEndpoint) Bay() *Bay
Bay returns the bay this endpoint is associated with, or nil.
func (*AudioEndpoint) Input ¶
func (e *AudioEndpoint) Input() *AudioEndpoint
Input returns the currently routed input endpoint, or nil.
func (*AudioEndpoint) InputsAvailable ¶
func (e *AudioEndpoint) InputsAvailable() []*AudioEndpoint
InputsAvailable returns the input endpoints that can be routed to this one.
func (*AudioEndpoint) IsInput ¶
func (e *AudioEndpoint) IsInput() bool
func (*AudioEndpoint) IsOutput ¶
func (e *AudioEndpoint) IsOutput() bool
func (*AudioEndpoint) IsV2IP ¶
func (e *AudioEndpoint) IsV2IP() bool
type AudioEndpoints ¶
type AudioEndpoints struct {
// contains filtered or unexported fields
}
AudioEndpoints is the collection of audio endpoints reported by a device.
func (*AudioEndpoints) Get ¶
func (a *AudioEndpoints) Get(id int) *AudioEndpoint
Get returns the endpoint with the given id, or nil.
func (*AudioEndpoints) List ¶
func (a *AudioEndpoints) List() []*AudioEndpoint
List returns all endpoints in wire order.
type AudioFeatures ¶
type AudioFeatures uint32
AudioFeatures is the capability bitmask of a V2IP audio endpoint.
func (AudioFeatures) HasTrigger ¶
func (a AudioFeatures) HasTrigger() bool
func (AudioFeatures) IsAmp ¶
func (a AudioFeatures) IsAmp() bool
func (AudioFeatures) IsHDMI ¶
func (a AudioFeatures) IsHDMI() bool
func (AudioFeatures) IsInput ¶
func (a AudioFeatures) IsInput() bool
func (AudioFeatures) IsOutput ¶
func (a AudioFeatures) IsOutput() bool
func (AudioFeatures) IsRCA ¶
func (a AudioFeatures) IsRCA() bool
func (AudioFeatures) IsSPDIF ¶
func (a AudioFeatures) IsSPDIF() bool
func (AudioFeatures) IsV2IP ¶
func (a AudioFeatures) IsV2IP() bool
func (AudioFeatures) IsV2IPRx ¶
func (a AudioFeatures) IsV2IPRx() bool
func (AudioFeatures) IsV2IPTx ¶
func (a AudioFeatures) IsV2IPTx() bool
func (AudioFeatures) SupportMute ¶
func (a AudioFeatures) SupportMute() bool
func (AudioFeatures) SupportVolume ¶
func (a AudioFeatures) SupportVolume() bool
type Bay ¶
type Bay struct {
// contains filtered or unexported fields
}
Bay is a single input or output port on a Device.
All exported methods are safe for concurrent use. Values returned are snapshots taken under the owning Remote's lock.
func (*Bay) AmpSettings ¶
func (b *Bay) AmpSettings() *AmpZoneSettings
AmpSettings returns the amplifier zone settings for this bay, or nil.
func (*Bay) AudioEndpoint ¶
func (b *Bay) AudioEndpoint() *AudioEndpoint
AudioEndpoint returns the audio endpoint associated with this bay, or nil.
func (*Bay) AudioRouteEndpoint ¶
AudioRouteEndpoint returns the raw "ip:port" of an active V2IP sink audio subscription that maps to no known source bay, or "".
func (*Bay) AudioSource ¶
AudioSource returns the currently routed audio source bay, or nil.
func (*Bay) CECDetected ¶
CECDetected reports whether a CEC device is detected.
func (*Bay) DecoderDisabled ¶
DecoderDisabled reports whether the V2IP decoder is disabled.
func (*Bay) DolbyInput ¶
DolbyInput returns the input bay name providing the Dolby audio source, or "".
func (*Bay) EdidProfileValue ¶
func (b *Bay) EdidProfileValue() (EdidProfile, bool)
EdidProfileValue returns the EDID profile of an HDMI input bay.
func (*Bay) EncoderDisabled ¶
EncoderDisabled reports whether the V2IP encoder is disabled.
func (*Bay) Features ¶
func (b *Bay) Features() BayFeaturesMask
Features returns the bay feature bitmask.
func (*Bay) HDBTConnected ¶
HDBTConnected reports whether the HDBaseT link is up.
func (*Bay) HPDDetected ¶
HPDDetected reports whether hotplug is detected.
func (*Bay) IsV2IPRemote ¶
IsV2IPRemote reports whether this bay is a remote (mesh-forwarded) V2IP bay.
func (*Bay) IsV2IPSink ¶
IsV2IPSink reports whether this bay is a V2IP sink.
func (*Bay) IsV2IPSource ¶
IsV2IPSource reports whether this bay is a V2IP source.
func (*Bay) LinkConfigured ¶
LinkConfigured reports whether this bay is linked to another bay.
func (*Bay) Mirroring ¶
func (b *Bay) Mirroring() BayMirrorStatus
Mirroring returns the bay's mirror status.
func (*Bay) PoEPowered ¶
PoEPowered reports whether PoE is supplying power on this bay.
func (*Bay) PowerStatusValue ¶
func (b *Bay) PowerStatusValue() PowerStatus
PowerStatusValue returns the computed CEC power status of the connected device.
func (*Bay) RCTypeValue ¶
RCTypeValue returns the remote-control type of an HDMI input bay.
func (*Bay) RegisterCallback ¶
RegisterCallback registers fn to be called whenever this bay changes.
func (*Bay) SelectAudioSource ¶
SelectAudioSource routes the audio source of this output bay to the given source port. Only V2IP sinks are supported.
func (*Bay) SelectAudioSourceAddr ¶
func (b *Bay) SelectAudioSourceAddr(audioIP string, audioPort int, fmt *V2IPAudioFormat) error
SelectAudioSourceAddr routes the audio of this V2IP sink to a raw multicast address, optionally overriding the audio format. A zero port defaults to the standard V2IP audio port. video and ancillary streams are left unchanged.
func (*Bay) SelectAudioSourceByName ¶
func (b *Bay) SelectAudioSourceByName(name string, format *V2IPAudioFormat) error
SelectAudioSourceByName routes audio from the input bay with the given user-assigned name. When fmt is non-nil the manual switch frame is used so the receiver's sample rate / channel count can be overridden. V2IP sinks only.
func (*Bay) SelectEdidProfile ¶
func (b *Bay) SelectEdidProfile(profile EdidProfile) error
SelectEdidProfile sets the EDID profile of this input bay.
func (*Bay) SelectVideoSource ¶
SelectVideoSource routes the video source of this output bay to the given source port. Only V2IP sinks are supported.
func (*Bay) SelectVideoSourceByUserName ¶
SelectVideoSourceByUserName routes video from the input bay with the given user-assigned name. Only V2IP sinks are supported.
func (*Bay) SetZoneSettings ¶
func (b *Bay) SetZoneSettings(s AmpZoneSettings) error
SetZoneSettings applies amplifier zone settings to this bay.
func (*Bay) SignalDetected ¶
SignalDetected reports whether a signal is present.
func (*Bay) SignalType ¶
SignalType returns the current signal type description.
func (*Bay) V2IPSource ¶
func (b *Bay) V2IPSource() *V2IPStreamSources
V2IPSource returns the V2IP stream addresses advertised by this source bay.
func (*Bay) V2IPUID ¶
V2IPUID returns the source device UID this V2IP bay maps to (from bay mappings), or the zero UID.
func (*Bay) VideoRouteEndpoint ¶
VideoRouteEndpoint returns the raw "ip:port" of an active V2IP sink video subscription that maps to no known source bay, or "".
func (*Bay) VideoSource ¶
VideoSource returns the currently routed video source bay, or nil.
func (*Bay) VolumeStatus ¶
func (b *Bay) VolumeStatus() *VolumeMuteStatus
VolumeStatus returns the current volume/mute state, or nil if unknown.
type BayFeaturesMask ¶
type BayFeaturesMask uint32
BayFeaturesMask is the bitmask of a bay's capabilities.
const ( BayHDMIOut BayFeaturesMask = 1 << 0 BayHDMIIn BayFeaturesMask = 1 << 1 BayAudioDigOut BayFeaturesMask = 1 << 2 BayAudioDigIn BayFeaturesMask = 1 << 3 BayAudioAnaOut BayFeaturesMask = 1 << 4 BayAudioAnaIn BayFeaturesMask = 1 << 5 BayIRIn BayFeaturesMask = 1 << 6 BayIROut BayFeaturesMask = 1 << 7 BayAudioAmpOut BayFeaturesMask = 1 << 8 BayRCOut BayFeaturesMask = 1 << 9 BayRCIn BayFeaturesMask = 1 << 10 BayDolby BayFeaturesMask = 1 << 11 BayAutoOff BayFeaturesMask = 1 << 12 BayV2IPSourceRemote BayFeaturesMask = 1 << 13 BayV2IPSinkRemote BayFeaturesMask = 1 << 14 BayV2IPSourceLocal BayFeaturesMask = 1 << 15 BayV2IPSinkLocal BayFeaturesMask = 1 << 16 )
func (BayFeaturesMask) Has ¶
func (b BayFeaturesMask) Has(f BayFeaturesMask) bool
type BayLink ¶
type BayLink struct {
// contains filtered or unexported fields
}
BayLink is a virtual link between two bays on two devices (e.g. an amp output linked to a OneIP sink). All exported methods are safe for concurrent use.
func (*BayLink) Configured ¶
Configured reports whether a link has been set up.
func (*BayLink) LinkedBayName ¶
LinkedBayName returns the name of the linked bay.
type BayMirrorStatus ¶
type BayMirrorStatus struct {
Target *BayUID
}
BayMirrorStatus describes whether an output bay mirrors another device's output, and which one. The zero value means "not mirroring".
func (BayMirrorStatus) IsMirroring ¶
func (m BayMirrorStatus) IsMirroring() bool
IsMirroring reports whether this bay mirrors another.
type BayStatusMask ¶
type BayStatusMask uint32
BayStatusMask is the bitmask of a bay's live status flags. Note that bits 16-19 (RC type) and 22-23 (HDCP) are bit-fields, not flags; use BayStatusRCType and BayStatusHDCP to extract them.
const ( BayStatusFault BayStatusMask = 1 << 0 BayStatusHidden BayStatusMask = 1 << 1 BayStatusPowered BayStatusMask = 1 << 2 BayStatusSignalDetected BayStatusMask = 1 << 3 BayStatusHPDDetected BayStatusMask = 1 << 4 BayStatusSignalScramble BayStatusMask = 1 << 5 BayStatusHDBTConnected BayStatusMask = 1 << 6 BayStatusCECDetected BayStatusMask = 1 << 7 BayStatusPoweredOn BayStatusMask = 1 << 8 BayStatusPoweredOff BayStatusMask = 1 << 9 BayStatusAudioARCHDMI BayStatusMask = 1 << 10 BayStatusAudioARCOptic BayStatusMask = 1 << 11 BayStatusAudioARCAnalog BayStatusMask = 1 << 12 BayStatusOffline BayStatusMask = 1 << 13 BayStatusDecoderDisable BayStatusMask = 1 << 14 BayStatusEncoderDisable BayStatusMask = 1 << 15 BayStatusCECDisabled BayStatusMask = 1 << 20 BayStatusEncoderError BayStatusMask = 1 << 21 )
func (BayStatusMask) Has ¶
func (b BayStatusMask) Has(f BayStatusMask) bool
type Callbacks ¶
type Callbacks struct {
// Device-level events.
OnDeviceConfigChanged func(d *Device)
OnDeviceConfigComplete func(d *Device)
OnDeviceOnlineStatusChanged func(d *Device, online bool)
OnDeviceTemperatureChanged func(d *Device)
OnDeviceUpdate func(d *Device)
// Bay-level events.
OnBayRegistered func(b *Bay)
OnBayUpdate func(b *Bay)
OnVideoSourceChanged func(b *Bay, videoSource *Bay)
OnAudioSourceChanged func(b *Bay, audioSource *Bay)
OnVolumeChanged func(b *Bay, volume *VolumeMuteStatus)
OnPowerChanged func(b *Bay, power PowerStatus)
OnNameChanged func(b *Bay, name string)
OnStatusSignalDetectedChanged func(b *Bay, detected bool)
OnStatusFaultyChanged func(b *Bay, faulty bool)
OnStatusHiddenChanged func(b *Bay, hidden bool)
OnStatusPoePoweredChanged func(b *Bay, powered bool)
OnStatusHdbtConnectedChanged func(b *Bay, connected bool)
OnStatusSignalTypeChanged func(b *Bay, signalType string)
OnStatusHpdDetectedChanged func(b *Bay, detected bool)
OnStatusCecDetectedChanged func(b *Bay, detected bool)
OnStatusArcChanged func(b *Bay, arc string)
OnEdidProfileChanged func(b *Bay, profile EdidProfile)
OnRcTypeChanged func(b *Bay, rcType RCType)
OnKeyPressed func(b *Bay, key RCKey)
OnActionReceived func(b *Bay, action RCAction)
OnMirrorStatusChanged func(b *Bay, mirror BayMirrorStatus)
OnBayLinked func(b *Bay, linkedSerial, linkedBay string, features LinkFeature)
OnBayUnlinked func(b *Bay, linkedSerial, linkedBay string)
OnAmpZoneSettingsChanged func(b *Bay, settings AmpZoneSettings)
OnAmpDolbySettingsChanged func(d *Device, settings AmpDolbySettings)
}
Callbacks holds optional event handlers invoked when device or bay state changes. Every field is optional; leave a field nil to ignore that event.
Handlers are invoked sequentially from a single dispatcher goroutine, so they must not block for long. It is safe to call Remote/Device/Bay methods from a handler.
type Config ¶
type Config struct {
// TargetIP is the multicast/broadcast destination. Empty uses the default
// (multicast 224.8.8.8, or the interface broadcast address when Broadcast).
TargetIP string
// Port is the UDP port. Zero uses the default for the selected mode.
Port int
// LocalIP binds to a specific interface. Empty picks the first non-loopback.
LocalIP string
// Interface is the network interface name (e.g. "br_v8") for multicast
// discovery. When set it takes precedence over LocalIP and works even on an
// interface with no IPv4 address (tagged VLANs): membership and egress are
// keyed by interface index. Linux only; on macOS/Windows the interface must
// have an IPv4 address. Empty keeps the LocalIP behaviour.
Interface string
// Broadcast uses broadcast instead of multicast.
Broadcast bool
// Name is advertised on the network.
Name string
// Callbacks receives state-change events.
Callbacks Callbacks
}
Config configures a Remote.
type ConnectStatus ¶
type ConnectStatus int
ConnectStatus is the connect / signal-detect state reported for a bay.
const ( ConnectUnknown ConnectStatus = 0 Connected ConnectStatus = 1 Disconnected ConnectStatus = 2 )
func (ConnectStatus) String ¶
func (c ConnectStatus) String() string
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device is a discovered device on the MX Remote network (matrix, OneIP unit or amplifier). All exported methods are safe for concurrent use.
func (*Device) AmpDolbyChannels ¶
AmpDolbyChannels returns the number of Dolby-capable channels on an amplifier.
func (*Device) AudioEndpointByID ¶
func (d *Device) AudioEndpointByID(id int) *AudioEndpoint
AudioEndpointByID returns the audio endpoint with the given id, or nil.
func (*Device) AudioEndpoints ¶
func (d *Device) AudioEndpoints() *AudioEndpoints
AudioEndpoints returns the device's audio endpoint collection, or nil.
func (*Device) AudioSelectInput ¶
func (d *Device) AudioSelectInput(sinkEP *AudioEndpoint, source DeviceUID, sourceEP *AudioEndpoint) error
AudioSelectInput routes a source endpoint (on the given source device) to a sink endpoint on this device.
func (*Device) AudioTrigger ¶
AudioTrigger sets the trigger state of an audio endpoint on this device.
func (*Device) AudioVolumeSet ¶
AudioVolumeSet sets the volume of an audio endpoint on this device.
func (*Device) ConfigurationComplete ¶
ConfigurationComplete reports whether all configuration has been received.
func (*Device) DolbySettings ¶
func (d *Device) DolbySettings() *AmpDolbySettings
DolbySettings returns the amplifier Dolby settings, or nil.
func (*Device) Features ¶
func (d *Device) Features() DeviceFeature
Features returns the device feature bitmask.
func (*Device) FirmwareVersions ¶
func (d *Device) FirmwareVersions() map[FirmwareType]FirmwareVersion
FirmwareVersions returns the V2IP firmware components keyed by type.
func (*Device) FirstInput ¶
FirstInput returns the first input bay, or nil.
func (*Device) FirstOutput ¶
FirstOutput returns the first output bay, or nil.
func (*Device) GetByPortname ¶
GetByPortname returns the bay with the given port name, or nil.
func (*Device) GetByPortnum ¶
GetByPortnum returns the bay with the given port number, or nil.
func (*Device) IsAudioMatrix ¶
IsAudioMatrix reports whether this is an audio-only matrix.
func (*Device) IsMeshMaster ¶
IsMeshMaster reports whether this device is the mesh controller.
func (*Device) IsMeshMember ¶
IsMeshMember reports whether this device is a mesh member.
func (*Device) IsOneIPMultiviewer ¶
IsOneIPMultiviewer reports whether this is a OneIP multiviewer.
func (*Device) IsVideoMatrix ¶
IsVideoMatrix reports whether this is a video matrix.
func (*Device) MACAddress ¶
MACAddress returns the first non-zero MAC address reported by a network port, or "".
func (*Device) MeshMaster ¶
MeshMaster returns the mesh controller device. For non-V2IP devices or when the master is unknown it returns the device itself.
func (*Device) Multiviewer ¶
func (d *Device) Multiviewer() *Multiviewer
Multiviewer returns the multiviewer controller for this device.
func (*Device) NetworkStatus ¶
func (d *Device) NetworkStatus() map[int]NetworkPortStatus
NetworkStatus returns the network port status keyed by port id.
func (*Device) RegisterCallback ¶
RegisterCallback registers fn to be called whenever this device changes.
func (*Device) Status ¶
func (d *Device) Status() DeviceStatus
Status returns the high-level device status.
func (*Device) StatusMessage ¶
StatusMessage returns a human-readable health summary combining the device status, crash flag, and any system-status message.
func (*Device) SystemStatus ¶
SystemStatus returns the device's numeric status code and message. ok is false when no system-status report has been received.
func (*Device) Temperatures ¶
Temperatures returns the named temperature sensor readings.
func (*Device) Topology ¶
func (d *Device) Topology() []TopologyEntry
Topology returns the most recent topology report from this device.
func (*Device) V2IPDetails ¶
func (d *Device) V2IPDetails() *DeviceV2IPDetails
V2IPDetails returns the device's V2IP encoder/decoder configuration, or nil.
func (*Device) V2IPSink ¶
func (d *Device) V2IPSink() *DeviceV2IPSink
V2IPSink returns the device's current sink subscription, or nil.
func (*Device) V2IPSourceLocal ¶
func (d *Device) V2IPSourceLocal() *V2IPStreamSources
V2IPSourceLocal returns the V2IP stream sources of this device's local input, or nil.
func (*Device) V2IPSources ¶
func (d *Device) V2IPSources() []V2IPStreamSources
V2IPSources returns the V2IP stream sources advertised by this device, or nil.
func (*Device) V2IPStats ¶
func (d *Device) V2IPStats() *V2IPDeviceStats
V2IPStats returns the most recent V2IP statistics, or nil.
type DeviceFeature ¶
type DeviceFeature uint32
DeviceFeature is the bitmask of capabilities a device reports in its hello frame.
const ( FeatureIRRx DeviceFeature = 1 << 0 FeatureIRTx DeviceFeature = 1 << 1 FeatureCEC DeviceFeature = 1 << 2 FeatureV2IPSource DeviceFeature = 1 << 3 FeatureV2IPSink DeviceFeature = 1 << 4 FeatureVideoRouting DeviceFeature = 1 << 5 FeatureAudioRouting DeviceFeature = 1 << 6 FeatureVolumeControl DeviceFeature = 1 << 7 FeatureAudioReturn DeviceFeature = 1 << 8 FeatureRemoteControl DeviceFeature = 1 << 9 FeatureSetupCompleted DeviceFeature = 1 << 10 FeatureMeshMaster DeviceFeature = 1 << 11 FeatureStatusNotify DeviceFeature = 1 << 12 FeatureStatusWarning DeviceFeature = 1 << 13 FeatureStatusError DeviceFeature = 1 << 14 FeatureStatusReboot DeviceFeature = 1 << 15 FeatureMeshMember DeviceFeature = 1 << 16 FeatureAudioAmplifier DeviceFeature = 1 << 17 FeatureBooting DeviceFeature = 1 << 18 FeatureManager DeviceFeature = 1 << 19 FeatureStatusPowSave DeviceFeature = 1 << 20 FeatureMesh DeviceFeature = 1 << 21 FeatureMultiviewer DeviceFeature = 1 << 22 FeatureStatusCrashed DeviceFeature = 1 << 23 FeatureBootBit DeviceFeature = 1 << 31 )
func (DeviceFeature) Has ¶
func (d DeviceFeature) Has(f DeviceFeature) bool
Has reports whether all bits in f are set.
type DeviceStatus ¶
type DeviceStatus int
DeviceStatus is the high-level state of a device or bay on the network.
const ( StatusOnline DeviceStatus = 0 StatusOffline DeviceStatus = 1 StatusRebooting DeviceStatus = 2 StatusBooting DeviceStatus = 3 StatusInactive DeviceStatus = 4 )
func (DeviceStatus) String ¶
func (s DeviceStatus) String() string
type DeviceUID ¶
type DeviceUID [16]byte
DeviceUID is the 16-byte unique identifier of an MX Remote device on the network. The zero value is the empty (all-zero) UID.
func DeviceUIDFromBytes ¶
DeviceUIDFromBytes builds a UID from raw bytes. An empty slice yields the zero UID; any other length shorter than 16 is an error.
func ParseDeviceUID ¶
ParseDeviceUID parses the human-readable "aaaaaaaa.bbbbbbbb.cccccccc.dddddddd" form (four little-endian 32-bit words printed big-endian in hex) into a UID.
type DeviceV2IPDetails ¶
type DeviceV2IPDetails struct {
Video V2IPStreamSource
Audio V2IPStreamSource
Anc V2IPStreamSource
Arc V2IPStreamSource
TxRate uint8
Scaling V2IPScalingSettings
}
DeviceV2IPDetails is the local encoder/decoder configuration of a V2IP device.
type DeviceV2IPSink ¶
type DeviceV2IPSink struct {
Addresses V2IPStreamSources
AudioFmt *V2IPAudioFormat
}
DeviceV2IPSink is the sink-side route a V2IP device is currently subscribed to.
type EdidProfile ¶
type EdidProfile int
EdidProfile is an EDID preset selectable on an HDMI input.
const ( Edid1080PStereo EdidProfile = 0 EdidFixed EdidProfile = 1 Edid4K EdidProfile = 2 Edid1080P51 EdidProfile = 3 Edid720P EdidProfile = 4 Edid1080P71 EdidProfile = 5 Edid4K71 EdidProfile = 6 Edid4KHDRStereo EdidProfile = 7 Edid4KHDR71 EdidProfile = 8 Edid4KHDRAVROnly EdidProfile = 9 EdidLowestCommon EdidProfile = 10 EdidLowestCommonAll EdidProfile = 11 Edid4KHDRAtmos EdidProfile = 12 EdidSink1 EdidProfile = 101 EdidSink32 EdidProfile = 132 EdidCustom0 EdidProfile = 500 EdidUnknown EdidProfile = 0xFFF )
func (EdidProfile) String ¶
func (e EdidProfile) String() string
type FirmwareType ¶
type FirmwareType int
FirmwareType identifies a firmware component.
const ( FirmwareUnknown FirmwareType = 0 FirmwareFPGA FirmwareType = 1 FirmwareLinux FirmwareType = 2 FirmwareLoadingOverlay FirmwareType = 3 )
func (FirmwareType) String ¶
func (f FirmwareType) String() string
type FirmwareVersion ¶
type FirmwareVersion struct {
Type FirmwareType
Timestamp int64
Version string
Hash uint32
}
FirmwareVersion describes a firmware component reported by a device.
func (FirmwareVersion) String ¶
func (f FirmwareVersion) String() string
type HiddenStatus ¶
type HiddenStatus int
HiddenStatus is the visibility state of a bay.
const ( HiddenUnknown HiddenStatus = 0 Hidden HiddenStatus = 1 Visible HiddenStatus = 2 )
func (HiddenStatus) String ¶
func (h HiddenStatus) String() string
type LinkFeature ¶
type LinkFeature uint32
LinkFeature is the bitmask of media carried by a virtual link.
const ( LinkNone LinkFeature = 0 LinkVideoHDMI LinkFeature = 1 << 0 LinkAudioOptical LinkFeature = 1 << 1 LinkAudioAnalog LinkFeature = 1 << 2 LinkIR LinkFeature = 1 << 3 LinkRC LinkFeature = 1 << 4 )
func (LinkFeature) Has ¶
func (l LinkFeature) Has(f LinkFeature) bool
type Multiviewer ¶
type Multiviewer struct {
// contains filtered or unexported fields
}
Multiviewer provides read access and control for a OneIP multiviewer device. Obtain one from Device.Multiviewer. All methods are safe for concurrent use; control methods are no-ops (returning an error) on non-multiviewer devices.
func (*Multiviewer) AudioMuted ¶
func (m *Multiviewer) AudioMuted() MultiviewerBool
AudioMuted returns the output mute state.
func (*Multiviewer) AudioSource ¶
func (m *Multiviewer) AudioSource() MultiviewerSource
AudioSource returns the screen whose audio is selected.
func (*Multiviewer) AudioVolume ¶
func (m *Multiviewer) AudioVolume() int
AudioVolume returns the output volume (0-100), or -1 when unknown.
func (*Multiviewer) AutoRoute ¶
func (m *Multiviewer) AutoRoute() error
AutoRoute triggers automatic source routing.
func (*Multiviewer) AutoSwitch ¶
func (m *Multiviewer) AutoSwitch() MultiviewerBool
AutoSwitch returns whether auto-switching is enabled.
func (*Multiviewer) ConnectedSource ¶
func (m *Multiviewer) ConnectedSource(input int) (DeviceUID, bool)
ConnectedSource returns the device UID mapped to the given multiviewer input.
func (*Multiviewer) EdidTemplate ¶
func (m *Multiviewer) EdidTemplate() MultiviewerEDIDTemplate
EdidTemplate returns the active EDID template.
func (*Multiviewer) HDCPMode ¶
func (m *Multiviewer) HDCPMode() MultiviewerHDCPMode
HDCPMode returns the HDCP mode.
func (*Multiviewer) MCUVersion ¶
func (m *Multiviewer) MCUVersion() string
MCUVersion returns the multiviewer MCU firmware version.
func (*Multiviewer) OutputITCMode ¶
func (m *Multiviewer) OutputITCMode() MultiviewerITCMode
OutputITCMode returns the output IT-content mode.
func (*Multiviewer) OutputMode ¶
func (m *Multiviewer) OutputMode() MultiviewerOutputMode
OutputMode returns the output resolution/refresh mode.
func (*Multiviewer) PipPosition ¶
func (m *Multiviewer) PipPosition() MultiviewerPipPosition
PipPosition returns the picture-in-picture window position.
func (*Multiviewer) PipSize ¶
func (m *Multiviewer) PipSize() MultiviewerPipSize
PipSize returns the picture-in-picture window size.
func (*Multiviewer) RemoteControl ¶
func (m *Multiviewer) RemoteControl() MultiviewerSource
RemoteControl returns the screen receiving remote-control passthrough.
func (*Multiviewer) ScalerVersion ¶
func (m *Multiviewer) ScalerVersion() string
ScalerVersion returns the multiviewer scaler firmware version.
func (*Multiviewer) ScreenAspect ¶
func (m *Multiviewer) ScreenAspect() MultiviewerAspectRatio
ScreenAspect returns the output aspect ratio.
func (*Multiviewer) SetAudioSource ¶
func (m *Multiviewer) SetAudioSource(source MultiviewerSource) error
SetAudioSource selects which screen's audio to output.
func (*Multiviewer) SetAudioVolume ¶
func (m *Multiviewer) SetAudioVolume(volume int, muted bool) error
SetAudioVolume sets the output volume and mute state.
func (*Multiviewer) SetAutoSwitch ¶
func (m *Multiviewer) SetAutoSwitch(enable bool) error
SetAutoSwitch enables or disables auto-switching.
func (*Multiviewer) SetConnectedSource ¶
func (m *Multiviewer) SetConnectedSource(input int, source DeviceUID) error
SetConnectedSource maps a source device UID to a multiviewer input. Pass the zero UID to clear the mapping.
func (*Multiviewer) SetEdidTemplate ¶
func (m *Multiviewer) SetEdidTemplate(e MultiviewerEDIDTemplate) error
SetEdidTemplate sets the EDID template.
func (*Multiviewer) SetHDCPMode ¶
func (m *Multiviewer) SetHDCPMode(h MultiviewerHDCPMode) error
SetHDCPMode sets the HDCP mode.
func (*Multiviewer) SetOutputITCMode ¶
func (m *Multiviewer) SetOutputITCMode(o MultiviewerITCMode) error
SetOutputITCMode sets the output IT-content mode.
func (*Multiviewer) SetOutputMode ¶
func (m *Multiviewer) SetOutputMode(o MultiviewerOutputMode) error
SetOutputMode sets the output resolution/refresh mode.
func (*Multiviewer) SetPipPosition ¶
func (m *Multiviewer) SetPipPosition(p MultiviewerPipPosition) error
SetPipPosition sets the PIP window position.
func (*Multiviewer) SetPipSize ¶
func (m *Multiviewer) SetPipSize(s MultiviewerPipSize) error
SetPipSize sets the PIP window size.
func (*Multiviewer) SetRemoteControl ¶
func (m *Multiviewer) SetRemoteControl(source MultiviewerSource) error
SetRemoteControl sets which screen receives remote-control passthrough.
func (*Multiviewer) SetScreenAspect ¶
func (m *Multiviewer) SetScreenAspect(a MultiviewerAspectRatio) error
SetScreenAspect sets the output aspect ratio.
func (*Multiviewer) SetVideoSource ¶
func (m *Multiviewer) SetVideoSource(screen int, source MultiviewerSource) error
SetVideoSource assigns a source to a screen.
func (*Multiviewer) SetViewMode ¶
func (m *Multiviewer) SetViewMode(v MultiviewerViewMode) error
SetViewMode sets the screen layout mode.
func (*Multiviewer) VideoSource ¶
func (m *Multiviewer) VideoSource(screen int) MultiviewerSource
VideoSource returns the source assigned to the given screen index.
func (*Multiviewer) ViewMode ¶
func (m *Multiviewer) ViewMode() MultiviewerViewMode
ViewMode returns the current screen layout mode.
type MultiviewerAspectRatio ¶
type MultiviewerAspectRatio int
Multiviewer aspect ratio.
const ( MVAspectUnknown MultiviewerAspectRatio = 0 MVAspectFull MultiviewerAspectRatio = 1 MVAspect16x9 MultiviewerAspectRatio = 2 )
type MultiviewerBool ¶
type MultiviewerBool int
MultiviewerBool is a tri-state on/off/unknown setting.
const ( MVBoolOff MultiviewerBool = 0 MVBoolOn MultiviewerBool = 1 MVBoolUnknown MultiviewerBool = 0xFF )
type MultiviewerEDIDTemplate ¶
type MultiviewerEDIDTemplate int
Multiviewer EDID template.
const (
MVEdidUnknown MultiviewerEDIDTemplate = 0
)
type MultiviewerHDCPMode ¶
type MultiviewerHDCPMode int
Multiviewer HDCP mode.
const ( MVHDCPUnknown MultiviewerHDCPMode = 0 MVHDCPV14 MultiviewerHDCPMode = 1 MVHDCPV22 MultiviewerHDCPMode = 2 )
type MultiviewerITCMode ¶
type MultiviewerITCMode int
Multiviewer IT-content mode.
const ( MVITCUnknown MultiviewerITCMode = 0 MVITCVideo MultiviewerITCMode = 1 MVITCPC MultiviewerITCMode = 2 )
type MultiviewerOutputMode ¶
type MultiviewerOutputMode int
Multiviewer output resolution/refresh mode.
const ( MVOutUnknown MultiviewerOutputMode = 0 MVOut4096x2160P60 MultiviewerOutputMode = 1 MVOut4096x2160P50 MultiviewerOutputMode = 2 MVOut3840x2160P60 MultiviewerOutputMode = 3 MVOut3840x2160P50 MultiviewerOutputMode = 4 MVOut3840x2160P30 MultiviewerOutputMode = 5 MVOut3840x2160P25 MultiviewerOutputMode = 6 MVOut1920x1200P60RB MultiviewerOutputMode = 7 MVOut1920x1080P60 MultiviewerOutputMode = 8 MVOut1920x1080P50 MultiviewerOutputMode = 9 MVOut1360x768P60 MultiviewerOutputMode = 10 MVOut1280x800P60 MultiviewerOutputMode = 11 MVOut1280x720P60 MultiviewerOutputMode = 12 MVOut1280x720P50 MultiviewerOutputMode = 13 MVOut1024x768P60 MultiviewerOutputMode = 14 )
type MultiviewerPipPosition ¶
type MultiviewerPipPosition int
Multiviewer picture-in-picture position.
const ( MVPipPosUnknown MultiviewerPipPosition = 0 MVPipPosLeftTop MultiviewerPipPosition = 1 MVPipPosLeftBottom MultiviewerPipPosition = 2 MVPipPosRightTop MultiviewerPipPosition = 3 MVPipPosRightBottom MultiviewerPipPosition = 4 )
type MultiviewerPipSize ¶
type MultiviewerPipSize int
Multiviewer picture-in-picture size.
const ( MVPipSizeUnknown MultiviewerPipSize = 0 MVPipSizeSmall MultiviewerPipSize = 1 MVPipSizeMedium MultiviewerPipSize = 2 MVPipSizeLarge MultiviewerPipSize = 3 )
type MultiviewerSource ¶
type MultiviewerSource int
Multiviewer input source selection.
const ( MVSourceUnknown MultiviewerSource = 0 MVSource1 MultiviewerSource = 1 MVSource2 MultiviewerSource = 2 MVSource3 MultiviewerSource = 3 MVSource4 MultiviewerSource = 4 )
type MultiviewerViewMode ¶
type MultiviewerViewMode int
Multiviewer view layout modes.
const ( MVViewUnknown MultiviewerViewMode = 0 MVViewSingle MultiviewerViewMode = 1 MVViewPIP MultiviewerViewMode = 2 MVViewTwoScreenLarge MultiviewerViewMode = 3 MVViewTwoScreenSmall MultiviewerViewMode = 4 MVViewThreeScreenLarge MultiviewerViewMode = 5 MVViewThreeScreenSmall MultiviewerViewMode = 6 MVViewFourScreenLarge MultiviewerViewMode = 7 MVViewFourScreenSmall MultiviewerViewMode = 8 )
type MuteStatus ¶
type MuteStatus uint8
MuteStatus decodes the per-channel mute bitfield (bit0=left, bit1=right).
func (MuteStatus) Left ¶
func (m MuteStatus) Left() bool
func (MuteStatus) Muted ¶
func (m MuteStatus) Muted() bool
func (MuteStatus) Right ¶
func (m MuteStatus) Right() bool
type NetworkPortStatus ¶
type NetworkPortStatus struct {
Port int
Name string
LinkSpeed UtpLinkSpeed
LinkFullDuplex bool
IP string
Querier string
MACAddress string
Errors *UtpLinkErrors
VCTStatus []string
CableStatus []UtpCableStatus
}
NetworkPortStatus describes the link state and diagnostics of a network port. Optional fields (Errors, VCTStatus, CableStatus) are nil when the port or firmware does not report them.
type PowerStatus ¶
type PowerStatus int
PowerStatus is the CEC power state of a device connected to a bay.
const ( PowerUnknown PowerStatus = 0 PowerOn PowerStatus = 1 PowerOff PowerStatus = 2 )
func (PowerStatus) String ¶
func (p PowerStatus) String() string
type RCKey ¶
type RCKey int
RCKey is a remote-control key code (CEC/IR).
const ( KeyNum0 RCKey = 0 KeyNum1 RCKey = 1 KeyNum2 RCKey = 2 KeyNum3 RCKey = 3 KeyNum4 RCKey = 4 KeyNum5 RCKey = 5 KeyNum6 RCKey = 6 KeyNum7 RCKey = 7 KeyNum8 RCKey = 8 KeyNum9 RCKey = 9 KeySelect RCKey = 10 KeyBack RCKey = 11 KeyUp RCKey = 12 KeyDown RCKey = 13 KeyLeft RCKey = 14 KeyRight RCKey = 15 KeyMenu RCKey = 16 KeyContentMenu RCKey = 17 KeyChannelUp RCKey = 18 KeyChannelDown RCKey = 19 KeyPlay RCKey = 20 KeyPause RCKey = 21 KeyStop RCKey = 22 KeyRecord RCKey = 23 KeyFastForward RCKey = 24 KeyRewind RCKey = 25 KeyRed RCKey = 26 KeyGreen RCKey = 27 KeyYellow RCKey = 28 KeyBlue RCKey = 29 KeyHelp RCKey = 30 KeyInformation RCKey = 31 KeyText RCKey = 32 KeyGuide RCKey = 33 KeyVideoOnDemand RCKey = 34 KeyPreviousChan RCKey = 80 Key3DMode RCKey = 81 KeySubtitle RCKey = 82 KeySoundSelect RCKey = 83 KeyInputSelect RCKey = 84 KeyEject RCKey = 85 KeyNextChapter RCKey = 86 KeyPrevChapter RCKey = 87 KeyInteractive RCKey = 128 KeySearch RCKey = 129 KeySky RCKey = 130 KeyCustomCEC RCKey = 1280 KeyCustomSky RCKey = 2048 )
type Remote ¶
type Remote struct {
// contains filtered or unexported fields
}
Remote is the main entry point. It manages the UDP connection, discovers devices, and maintains the device registry. Create one with New and start it with Start.
func (*Remote) GetBayByPortnum ¶
GetBayByPortnum returns the bay on the given device (by UID) and port, or nil.
func (*Remote) GetBySerial ¶
GetBySerial returns the device with the given serial number, or nil.
func (*Remote) GetByUIDString ¶
GetByUIDString resolves a device by its dotted-hex UID string, falling back to a serial-number match, mirroring the reference get_by_uid.
func (*Remote) SendMonitoringPulse ¶
SendMonitoringPulse broadcasts a monitoring pulse (opcode 0x2B), asking peers on the network to report their monitoring data immediately.
type Svd ¶
type Svd struct {
ID int
PictureAspect int
PixelAspect int
HorizontalActive int
HorizontalTotal int
VerticalActive int
VerticalTotal int
Refresh int
Interlaced bool
Multiplier int
}
Svd is a Short Video Descriptor: a standard video resolution/timing entry.
type TopologyEntry ¶
TopologyEntry is one device in a topology report: a device UID and the bitmask of devices it is connected to.
type UtpCableStatus ¶
UtpCableStatus is the diagnostic status of a single UTP cable pair.
type UtpLinkErrors ¶
type UtpLinkErrors struct {
InError bool
InFCSError bool
InCollision bool
OutDeferred bool
OutExcessive bool
PolarityError bool
SkewWarning bool
LengthWarning bool
}
UtpLinkErrors is the decoded link-error bitmask for a network port.
type UtpLinkSpeed ¶
type UtpLinkSpeed int
UtpLinkSpeed is the negotiated speed of a network port.
const ( LinkSpeedUnknown UtpLinkSpeed = 0 LinkSpeed10M UtpLinkSpeed = 1 LinkSpeed100M UtpLinkSpeed = 2 LinkSpeed200M UtpLinkSpeed = 3 LinkSpeed1G UtpLinkSpeed = 4 )
func (UtpLinkSpeed) String ¶
func (u UtpLinkSpeed) String() string
type V2IPAudioFormat ¶
V2IPAudioFormat overrides the sample rate and channel count of a V2IP audio stream. Zero values mean "use the firmware default".
func (V2IPAudioFormat) String ¶
func (f V2IPAudioFormat) String() string
type V2IPDecoderState ¶
type V2IPDecoderState int
V2IPDecoderState is the health state of a V2IP decoder.
const ( DecoderUnknown V2IPDecoderState = 0 DecoderHealthy V2IPDecoderState = 1 DecoderBad V2IPDecoderState = 2 )
func (V2IPDecoderState) String ¶
func (s V2IPDecoderState) String() string
type V2IPDeviceStats ¶
type V2IPDeviceStats struct {
Tx V2IPTxStats
TxPerMinute V2IPTxStats
Rx V2IPRxStats
RxPerMinute V2IPRxStats
}
V2IPDeviceStats holds the cumulative and per-minute TX/RX statistics.
type V2IPRxStats ¶
type V2IPRxStats struct {
VideoTotal uint32
VideoDropped uint32
VideoSeqErrors uint32
WdtTimeout uint32
AudioTotal uint32
AudioDropped uint32
AudioSeqErrors uint32
AncTotal uint32
AncDropped uint32
AncSeqErrors uint32
DecoderState V2IPDecoderState
}
V2IPRxStats holds receiver stream statistics.
type V2IPScalingSettings ¶
V2IPScalingSettings holds a V2IP output's scaling mode, refresh rate and flags.
type V2IPStreamSource ¶
V2IPStreamSource is a single multicast stream address (video, audio, or ancillary).
func (V2IPStreamSource) String ¶
func (s V2IPStreamSource) String() string
type V2IPStreamSources ¶
type V2IPStreamSources struct {
UID DeviceUID
Video V2IPStreamSource
Audio V2IPStreamSource
Anc V2IPStreamSource
Arc *V2IPStreamSource
}
V2IPStreamSources groups the video, audio, ancillary and (optional) ARC streams advertised by a single V2IP source, with the originating device UID when known (zero UID means unknown).
func (V2IPStreamSources) String ¶
func (s V2IPStreamSources) String() string
type V2IPTxStats ¶
V2IPTxStats holds transmitter stream statistics.
type VolumeMuteStatus ¶
VolumeMuteStatus holds the volume and mute state of a bay. Left/right values of -1 mean "unknown".
func (VolumeMuteStatus) Muted ¶
func (v VolumeMuteStatus) Muted() (bool, bool)
Muted reports the combined mute state. The second result is false when the mute state is unknown.
func (VolumeMuteStatus) Volume ¶
func (v VolumeMuteStatus) Volume() int
Volume returns the combined left/right volume percentage.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
discover
command
Command discover finds MX Remote devices on the local network and prints them, along with their bays, as discovery completes.
|
Command discover finds MX Remote devices on the local network and prints them, along with their bays, as discovery completes. |