configuration

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Type      PulseAudioActionType `yaml:"type"`
	RawTarget yaml.Node            `yaml:"target"`
	Target    interface{}          `yaml:"-"`
}

type Config

type Config struct {
	MidiDevices []MidiDevice `yaml:"midiDevices"`
	Rules       []Rule       `yaml:"rules"`
}

func Load

func Load() (Config, string, error)

type MidiDevice

type MidiDevice struct {
	Name        string         `yaml:"name"`
	Type        MidiDeviceType `yaml:"type"`
	MidiInName  string         `yaml:"midiInName"`
	MidiOutName string         `yaml:"midiOutName"`
}

type MidiDeviceType

type MidiDeviceType string
const (
	Generic          MidiDeviceType = "Generic"
	AkaiLpd8         MidiDeviceType = "AkaiLpd8"
	KorgNanoKontrol2 MidiDeviceType = "KorgNanoKontrol2"
)

type MidiMessage

type MidiMessage struct {
	DeviceName        string          `yaml:"deviceName"`
	DeviceControlPath string          `yaml:"deviceControlPath"`
	Type              MidiMessageType `yaml:"type"`
	Channel           uint8           `yaml:"channel"`
	Note              uint8           `yaml:"note"`
	Controller        uint8           `yaml:"controller"`
	Program           uint8           `yaml:"program"`
	MinValue          uint8           `yaml:"minValue"`
	MaxValue          uint8           `yaml:"maxValue"`
}

type MidiMessageType

type MidiMessageType string
const (
	None          MidiMessageType = ""
	Note          MidiMessageType = "Note"
	ControlChange MidiMessageType = "ControlChange"
	ProgramChange MidiMessageType = "ProgramChange"
)

type PulseAudioActionType

type PulseAudioActionType string
const (
	SetVolume        PulseAudioActionType = "SetVolume"
	ToggleMute       PulseAudioActionType = "ToggleMute"
	SetDefaultOutput PulseAudioActionType = "SetDefaultOutput"
)

type PulseAudioTargetType

type PulseAudioTargetType string
const (
	PlaybackStream PulseAudioTargetType = "PlaybackStream"
	RecordStream   PulseAudioTargetType = "RecordStream"
	OutputDevice   PulseAudioTargetType = "OutputDevice"
	InputDevice    PulseAudioTargetType = "InputDevice"
)

type Rule

type Rule struct {
	MidiMessage MidiMessage `yaml:"midiMessage"`
	Actions     []Action    `yaml:"actions"`
}

type Target

type Target struct {
	Name string `yaml:"name"`
}

type TypedTarget

type TypedTarget struct {
	Type PulseAudioTargetType `yaml:"type"`
	Name string               `yaml:"name"`
}

Jump to

Keyboard shortcuts

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