ctrl

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func AtoVFO

func AtoVFO(a string) (client.VFO, error)

func Project added in v0.4.0

func Project(r ValueRange, value int) uint8

func RangeTick added in v0.4.0

func RangeTick(r ValueRange) float64

func Translate added in v0.4.0

func Translate(r ValueRange, value uint8) int

func TrimToRange added in v0.4.0

func TrimToRange(r ValueRange, value int) int

Types

type CWController added in v0.4.0

type CWController interface {
	SendCWMessage(int, string, string, string) error
	StopCW() error
	SetCWMacrosSpeed(wpm int) error
}

type CWSpeedControl added in v0.4.0

type CWSpeedControl struct {
	ValueControl
}

func NewCWSpeedControl added in v0.4.0

func NewCWSpeedControl(key MidiKey, controlType ControlType, led LED, stepSize int, reverseDirection bool, dynamicMode bool, controller CWController) *CWSpeedControl

func (*CWSpeedControl) SetCWMacrosSpeed added in v0.4.0

func (s *CWSpeedControl) SetCWMacrosSpeed(wpm int)

type CWSpeedController added in v0.4.0

type CWSpeedController interface {
	SetRXBalance(trx int, vfo client.VFO, dB int) error
}

type ControlFactory added in v0.4.0

type ControlFactory func(Mapping, LED, *client.Client) (any, ControlType, error)

type ControlType added in v0.4.0

type ControlType int
const (
	UnknownControl ControlType = iota
	ButtonControl
	PotiControl
	EncoderControl
)

type Encoder added in v0.4.0

type Encoder struct {
	// contains filtered or unexported fields
}

func NewEncoder added in v0.4.0

func NewEncoder(key MidiKey, set func(int), valueRange ValueRange, led LED, stepSize int, reverseDirection bool, dynamicMode bool) *Encoder

func (*Encoder) Changed added in v0.4.0

func (e *Encoder) Changed(turns int)

func (*Encoder) Close added in v0.4.0

func (e *Encoder) Close()

func (*Encoder) SetActiveValue added in v0.4.0

func (e *Encoder) SetActiveValue(value int)

type FilterBandButton

type FilterBandButton struct {
	// contains filtered or unexported fields
}

func NewFilterBandButton

func NewFilterBandButton(key MidiKey, trx int, bottomFrequency int, topFrequency int, mode client.Mode, led LED, controller RXFilterBandController) *FilterBandButton

func (*FilterBandButton) Pressed

func (b *FilterBandButton) Pressed()

func (*FilterBandButton) SetMode added in v0.5.0

func (b *FilterBandButton) SetMode(trx int, mode client.Mode)

func (*FilterBandButton) SetRXFilterBand

func (b *FilterBandButton) SetRXFilterBand(trx int, min, max int)

type FilterWidthControl added in v0.4.0

type FilterWidthControl struct {
	ValueControl
	// contains filtered or unexported fields
}

func NewFilterWidthControl added in v0.4.0

func NewFilterWidthControl(key MidiKey, trx int, controlType ControlType, led LED, stepSize int, reverseDirection bool, dynamicMode bool, controller RXFilterBandController) *FilterWidthControl

func (*FilterWidthControl) Infinite added in v0.4.0

func (s *FilterWidthControl) Infinite() bool

func (*FilterWidthControl) Max added in v0.4.0

func (s *FilterWidthControl) Max() int

func (*FilterWidthControl) Min added in v0.4.0

func (s *FilterWidthControl) Min() int

func (*FilterWidthControl) SetMode added in v0.4.0

func (s *FilterWidthControl) SetMode(trx int, mode client.Mode)

func (*FilterWidthControl) SetRXFilterBand added in v0.4.0

func (s *FilterWidthControl) SetRXFilterBand(trx int, min, max int)

type InfiniteRange added in v0.4.0

type InfiniteRange struct{}

func (InfiniteRange) Infinite added in v0.4.0

func (r InfiniteRange) Infinite() bool

func (InfiniteRange) Max added in v0.4.0

func (r InfiniteRange) Max() int

func (InfiniteRange) Min added in v0.4.0

func (r InfiniteRange) Min() int

type LED

type LED interface {
	SetOn(key MidiKey, on bool)
	SetFlashing(key MidiKey, on bool)
	SetValue(key MidiKey, value uint8)
}

type MOXButton added in v0.4.0

type MOXButton struct {
	// contains filtered or unexported fields
}

func NewMOXButton added in v0.4.0

func NewMOXButton(key MidiKey, trx int, led LED, enabler MOXEnabler) *MOXButton

func (*MOXButton) Pressed added in v0.4.0

func (b *MOXButton) Pressed()

func (*MOXButton) SetTX added in v0.4.0

func (b *MOXButton) SetTX(trx int, ptt bool)

type MOXEnabler added in v0.4.0

type MOXEnabler interface {
	SetTX(int, bool, client.SignalSource) error
}

type Mapping

type Mapping struct {
	Type    MappingType       `json:"type"`
	Channel byte              `json:"channel"`
	Key     int8              `json:"key"`
	TRX     int               `json:"trx"`
	VFO     string            `json:"vfo"`
	Options map[string]string `json:"options"`
}

func (Mapping) BoolOption added in v0.5.0

func (m Mapping) BoolOption(name string, defaultValue bool) bool

func (Mapping) IntOption added in v0.5.0

func (m Mapping) IntOption(name string, defaultValue int) (int, error)

func (Mapping) MidiKey

func (m Mapping) MidiKey() MidiKey

func (Mapping) RequiredIntOption added in v0.5.0

func (m Mapping) RequiredIntOption(name string) (int, bool, error)

func (Mapping) ValueControlOptions added in v0.4.0

func (m Mapping) ValueControlOptions(defaultStepSize int) (controlType ControlType, stepSize int, reverseDirection bool, dynamicMode bool, err error)

type MappingType

type MappingType string
const (
	SendCWMapping  MappingType = "send_cw"
	StopCWMapping  MappingType = "stop_cw"
	CWSpeedMapping MappingType = "cw_speed"
)
const (
	FilterMapping      MappingType = "filter"
	FilterWidthMapping MappingType = "filter_width"
)
const (
	MuteMapping   MappingType = "mute"
	VolumeMapping MappingType = "volume"
)
const (
	EnableRITMapping MappingType = "enable_rit"
	RITMapping       MappingType = "rit"
	EnableXITMapping MappingType = "enable_xit"
	XITMapping       MappingType = "xit"
)
const (
	MixerMapping    MappingType = "rx_mixer"
	SetMixerMapping MappingType = "set_rx_mixer"
)
const (
	EnableRXMapping     MappingType = "enable_rx"
	RXVolumeMapping     MappingType = "rx_volume"
	SetRXVolumeMapping  MappingType = "set_rx_volume"
	RXBalanceMapping    MappingType = "rx_balance"
	SetRXBalanceMapping MappingType = "set_rx_balance"
)
const (
	EnableSplitMapping      MappingType = "enable_split"
	SyncVFOFrequencyMapping MappingType = "sync_vfo_frequency"
)
const (
	MOXMapping  MappingType = "mox"
	TuneMapping MappingType = "tune"
)
const ModeMapping MappingType = "mode"
const VFOMapping MappingType = "vfo"

type MidiKey

type MidiKey struct {
	Channel byte
	Key     int8
}

type ModeButton

type ModeButton struct {
	// contains filtered or unexported fields
}

func NewModeButton

func NewModeButton(key MidiKey, trx int, mode client.Mode, led LED, controller ModeController) *ModeButton

func (*ModeButton) Pressed

func (b *ModeButton) Pressed()

func (*ModeButton) SetMode

func (b *ModeButton) SetMode(trx int, mode client.Mode)

type ModeController

type ModeController interface {
	SetMode(trx int, mode client.Mode) error
}

type MuteButton

type MuteButton struct {
	// contains filtered or unexported fields
}

func NewMuteButton

func NewMuteButton(key MidiKey, led LED, muter Muter) *MuteButton

func (*MuteButton) Pressed

func (b *MuteButton) Pressed()

func (*MuteButton) SetMute

func (b *MuteButton) SetMute(muted bool)

type Muter

type Muter interface {
	SetMute(bool) error
}

type Poti added in v0.4.0

type Poti struct {
	// contains filtered or unexported fields
}

func NewPoti added in v0.4.0

func NewPoti(key MidiKey, set func(int), valueRange ValueRange, led LED) *Poti

func (*Poti) Changed added in v0.4.0

func (s *Poti) Changed(value int)

func (*Poti) Close added in v0.4.0

func (s *Poti) Close()

func (*Poti) SetActiveValue added in v0.4.0

func (s *Poti) SetActiveValue(value int)

type RITControl added in v0.4.0

type RITControl struct {
	ValueControl
	// contains filtered or unexported fields
}

func NewRITControl added in v0.4.0

func NewRITControl(key MidiKey, trx int, controlType ControlType, led LED, stepSize int, reverseDirection bool, dynamicMode bool, frequencyRange int, controller RITController) *RITControl

func (*RITControl) SetRITOffset added in v0.4.0

func (s *RITControl) SetRITOffset(trx int, offset int)

type RITController

type RITController interface {
	SetRITOffset(trx int, offset int) error
}

type RITEnableButton

type RITEnableButton struct {
	// contains filtered or unexported fields
}

func NewRITEnableButton

func NewRITEnableButton(key MidiKey, trx int, led LED, reset bool, ritEnabler RITEnabler) *RITEnableButton

func (*RITEnableButton) Pressed

func (b *RITEnableButton) Pressed()

func (*RITEnableButton) SetRITEnable

func (b *RITEnableButton) SetRITEnable(trx int, enabled bool)

type RITEnabler

type RITEnabler interface {
	SetRITOffset(int, int) error
	SetRITEnable(int, bool) error
}

type RXBalanceControl added in v0.4.0

type RXBalanceControl struct {
	ValueControl
	// contains filtered or unexported fields
}

func NewRXBalanceControl added in v0.4.0

func NewRXBalanceControl(key MidiKey, trx int, vfo client.VFO, controlType ControlType, led LED, stepSize int, reverseDirection bool, dynamicMode bool, controller RXBalanceController) *RXBalanceControl

func (*RXBalanceControl) SetRXBalance added in v0.4.0

func (s *RXBalanceControl) SetRXBalance(trx int, vfo client.VFO, balance int)

type RXBalanceController

type RXBalanceController interface {
	SetRXBalance(trx int, vfo client.VFO, dB int) error
}

type RXChannelEnableButton

type RXChannelEnableButton struct {
	// contains filtered or unexported fields
}

func NewRXChannelEnableButton

func NewRXChannelEnableButton(key MidiKey, trx int, vfo client.VFO, led LED, rxChannelEnabler RXChannelEnabler) *RXChannelEnableButton

func (*RXChannelEnableButton) Pressed

func (b *RXChannelEnableButton) Pressed()

func (*RXChannelEnableButton) SetRXChannelEnable

func (b *RXChannelEnableButton) SetRXChannelEnable(trx int, vfo client.VFO, enabled bool)

type RXChannelEnabler

type RXChannelEnabler interface {
	SetRXChannelEnable(int, client.VFO, bool) error
}

type RXFilterBandController

type RXFilterBandController interface {
	SetRXFilterBand(trx int, min, max int) error
	SetMode(trx int, mode client.Mode) error
}

type RXMixController

type RXMixController interface {
	SetRXVolume(trx int, vfo client.VFO, dB int) error
	SetRXBalance(trx int, vfo client.VFO, dB int) error
}

type RXMixer

type RXMixer struct {
	// contains filtered or unexported fields
}

func NewRXMixer

func NewRXMixer(trx int, controller RXMixController) *RXMixer

func (*RXMixer) Changed

func (s *RXMixer) Changed(value int)

func (*RXMixer) Close

func (s *RXMixer) Close()

func (*RXMixer) SetRXBalance

func (s *RXMixer) SetRXBalance(trx int, vfo client.VFO, balance int)

func (*RXMixer) SetRXVolume

func (s *RXMixer) SetRXVolume(trx int, vfo client.VFO, volume int)

type RXMixer2 added in v0.5.1

type RXMixer2 struct {
	ValueControl
	// contains filtered or unexported fields
}

experimental

func NewRXMixer2 added in v0.5.1

func NewRXMixer2(key MidiKey, trx int, controlType ControlType, led LED, stepSize int, reverseDirection bool, dynamicMode bool, controller RXMixController) *RXMixer2

func (*RXMixer2) SetRXBalance added in v0.5.1

func (m *RXMixer2) SetRXBalance(trx int, vfo client.VFO, balance int)

func (*RXMixer2) SetRXVolume added in v0.5.1

func (m *RXMixer2) SetRXVolume(trx int, vfo client.VFO, volume int)

type RXVolumeControl added in v0.4.0

type RXVolumeControl struct {
	ValueControl
	// contains filtered or unexported fields
}

func NewRXVolumeControl added in v0.4.0

func NewRXVolumeControl(key MidiKey, trx int, vfo client.VFO, controlType ControlType, led LED, stepSize int, reverseDirection bool, dynamicMode bool, controller RXVolumeController) *RXVolumeControl

func (*RXVolumeControl) SetRXVolume added in v0.4.0

func (s *RXVolumeControl) SetRXVolume(trx int, vfo client.VFO, volume int)

type RXVolumeController

type RXVolumeController interface {
	SetRXVolume(trx int, vfo client.VFO, dB int) error
}

type SendCWButton added in v0.4.0

type SendCWButton struct {
	// contains filtered or unexported fields
}

func NewSendCWButton added in v0.4.0

func NewSendCWButton(key MidiKey, trx int, led LED, text string, controller CWController) *SendCWButton

func (*SendCWButton) Pressed added in v0.4.0

func (b *SendCWButton) Pressed()

type SetRXBalanceButton added in v0.5.0

type SetRXBalanceButton struct {
	// contains filtered or unexported fields
}

func NewSetRXBalanceButton added in v0.5.0

func NewSetRXBalanceButton(key MidiKey, trx int, vfo client.VFO, led LED, value int, controller RXBalanceController) *SetRXBalanceButton

func (*SetRXBalanceButton) Pressed added in v0.5.0

func (b *SetRXBalanceButton) Pressed()

func (*SetRXBalanceButton) SetRXBalance added in v0.5.0

func (b *SetRXBalanceButton) SetRXBalance(trx int, vfo client.VFO, balance int)

type SetRXMixerButton added in v0.5.0

type SetRXMixerButton struct {
	// contains filtered or unexported fields
}

func NewSetRXMixerButton added in v0.5.0

func NewSetRXMixerButton(key MidiKey, trx int, led LED, volumeA, volumeB, balanceA, balanceB int, controller RXMixController) *SetRXMixerButton

func (*SetRXMixerButton) Pressed added in v0.5.0

func (b *SetRXMixerButton) Pressed()

func (*SetRXMixerButton) SetRXBalance added in v0.5.0

func (b *SetRXMixerButton) SetRXBalance(trx int, vfo client.VFO, balance int)

func (*SetRXMixerButton) SetRXVolume added in v0.5.0

func (b *SetRXMixerButton) SetRXVolume(trx int, vfo client.VFO, volume int)

type SetRXVolumeButton added in v0.5.0

type SetRXVolumeButton struct {
	// contains filtered or unexported fields
}

func NewSetRXVolumeButton added in v0.5.0

func NewSetRXVolumeButton(key MidiKey, trx int, vfo client.VFO, led LED, value int, controller RXVolumeController) *SetRXVolumeButton

func (*SetRXVolumeButton) Pressed added in v0.5.0

func (b *SetRXVolumeButton) Pressed()

func (*SetRXVolumeButton) SetRXVolume added in v0.5.0

func (b *SetRXVolumeButton) SetRXVolume(trx int, vfo client.VFO, volume int)

type SplitEnableButton

type SplitEnableButton struct {
	// contains filtered or unexported fields
}

func NewSplitEnableButton

func NewSplitEnableButton(key MidiKey, trx int, led LED, splitEnabler SplitEnabler) *SplitEnableButton

func (*SplitEnableButton) Pressed

func (b *SplitEnableButton) Pressed()

func (*SplitEnableButton) SetSplitEnable

func (b *SplitEnableButton) SetSplitEnable(trx int, enabled bool)

type SplitEnabler

type SplitEnabler interface {
	SetSplitEnable(int, bool) error
}

type StaticRange added in v0.4.0

type StaticRange struct {
	// contains filtered or unexported fields
}

func (StaticRange) Infinite added in v0.4.0

func (r StaticRange) Infinite() bool

func (StaticRange) Max added in v0.4.0

func (r StaticRange) Max() int

func (StaticRange) Min added in v0.4.0

func (r StaticRange) Min() int

type StopCWButton added in v0.4.0

type StopCWButton struct {
	// contains filtered or unexported fields
}

func NewStopCWButton added in v0.4.0

func NewStopCWButton(key MidiKey, trx int, led LED, controller CWController) *StopCWButton

func (*StopCWButton) Pressed added in v0.4.0

func (b *StopCWButton) Pressed()

type SyncVFOFrequencyButton

type SyncVFOFrequencyButton struct {
	// contains filtered or unexported fields
}

func NewSyncVFOFrequencyButton

func NewSyncVFOFrequencyButton(srcTrx int, srcVFO client.VFO, dstTrx int, dstVFO client.VFO, offset int, controller VFOFrequencyController, provider VFOFrequencyProvider) *SyncVFOFrequencyButton

func (*SyncVFOFrequencyButton) Pressed

func (b *SyncVFOFrequencyButton) Pressed()

type TuneButton added in v0.4.0

type TuneButton struct {
	// contains filtered or unexported fields
}

func NewTuneButton added in v0.4.0

func NewTuneButton(key MidiKey, trx int, led LED, enabler TuneEnabler) *TuneButton

func (*TuneButton) Pressed added in v0.4.0

func (b *TuneButton) Pressed()

func (*TuneButton) SetTune added in v0.4.0

func (b *TuneButton) SetTune(trx int, ptt bool)

type TuneEnabler added in v0.4.0

type TuneEnabler interface {
	SetTune(int, bool) error
}

type VFOEncoder added in v0.4.0

type VFOEncoder struct {
	*Encoder
	// contains filtered or unexported fields
}

func NewVFOEncoder added in v0.4.0

func NewVFOEncoder(trx int, vfo client.VFO, stepSize int, reverseDirection bool, dynamicMode bool, controller VFOFrequencyController) *VFOEncoder

func (*VFOEncoder) SetVFOFrequency added in v0.4.0

func (e *VFOEncoder) SetVFOFrequency(trx int, vfo client.VFO, frequency int)

type VFOFrequencyController

type VFOFrequencyController interface {
	SetVFOFrequency(trx int, vfo client.VFO, frequency int) error
}

type VFOFrequencyProvider

type VFOFrequencyProvider interface {
	VFOFrequency(trx int, vfo client.VFO) (int, error)
}

type ValueControl added in v0.4.0

type ValueControl interface {
	Changed(int)
	SetActiveValue(value int)
	Close()
}

func NewValueControl added in v0.4.0

func NewValueControl(key MidiKey, controlType ControlType, set func(int), valueRange ValueRange, led LED, stepSize int, reverseDirection bool, dynamicMode bool) ValueControl

type ValueRange added in v0.4.0

type ValueRange interface {
	Min() int
	Max() int
	Infinite() bool
}

type VolumeControl added in v0.4.0

type VolumeControl struct {
	ValueControl
}

func NewVolumeControl added in v0.4.0

func NewVolumeControl(key MidiKey, controlType ControlType, led LED, stepSize int, reverseDirection bool, dynamicMode bool, controller VolumeController) *VolumeControl

func (*VolumeControl) SetVolume added in v0.4.0

func (s *VolumeControl) SetVolume(volume int)

type VolumeController

type VolumeController interface {
	SetVolume(dB int) error
}

type XITControl added in v0.4.0

type XITControl struct {
	ValueControl
	// contains filtered or unexported fields
}

func NewXITControl added in v0.4.0

func NewXITControl(key MidiKey, trx int, controlType ControlType, led LED, stepSize int, reverseDirection bool, dynamicMode bool, frequencyRange int, controller XITController) *XITControl

func (*XITControl) SetXITOffset added in v0.4.0

func (s *XITControl) SetXITOffset(trx int, offset int)

type XITController

type XITController interface {
	SetXITOffset(trx int, offset int) error
}

type XITEnableButton

type XITEnableButton struct {
	// contains filtered or unexported fields
}

func NewXITEnableButton

func NewXITEnableButton(key MidiKey, trx int, led LED, reset bool, xitEnabler XITEnabler) *XITEnableButton

func (*XITEnableButton) Pressed

func (b *XITEnableButton) Pressed()

func (*XITEnableButton) SetXITEnable

func (b *XITEnableButton) SetXITEnable(trx int, enabled bool)

type XITEnabler

type XITEnabler interface {
	SetXITOffset(int, int) error
	SetXITEnable(int, bool) error
}

Jump to

Keyboard shortcuts

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