obs

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeDelay byte = iota
	Mode_2
	ModePan
	Mode_4
	Mode_5
	Mode_6
)

Variables

View Source
var (
	OBS_MONITORING_TYPE_NONE               string = "OBS_MONITORING_TYPE_NONE"
	OBS_MONITORING_TYPE_MONITOR_AND_OUTPUT string = "OBS_MONITORING_TYPE_MONITOR_AND_OUTPUT"
	OBS_MONITORING_TYPE_MONITOR_ONLY       string = "OBS_MONITORING_TYPE_MONITOR_ONLY"
)
View Source
var ExitWithObs bool
View Source
var ShowHotkeyNames bool

Functions

func InitObs

func InitObs(in chan interface{}, out chan interface{}, wg *sync.WaitGroup)

Starts the runloop that manages the connection to OBS

Types

type Channel

type Channel struct {
	Name        string
	Visible     bool
	Muted       bool
	Pan         float64
	Volume      float64
	MonitorType string
	DelayMS     float64
	Tracks      map[string]bool
}

one source in obs that can be controlled if visible

func NewChannel added in v0.3.0

func NewChannel(name string) *Channel

create a new channel

type ChannelList

type ChannelList struct {
	FirstChannel    int
	AssignMode      byte
	SelectedChannel string
	// contains filtered or unexported fields
}

Master list of all channels, has functions to set their state when obs sends new values. It syncs the state with the mcu runloop based on the channel visibility etc. The mcu runloop is responsible for deduping the MIDI messages.

func NewChannelList

func NewChannelList() *ChannelList

create a new channel list

func (*ChannelList) AddChannel

func (l *ChannelList) AddChannel(name string)

add a channel to the list (doesn't check if it has audio)

func (*ChannelList) AddInput

func (l *ChannelList) AddInput(inputName string)

adds an input and gets the basic info (mute state, volume etc) only adds if it has audio tracks

func (*ChannelList) ChangeFaderBank

func (l *ChannelList) ChangeFaderBank(amount int)

change the first channel shown on the mcu

func (*ChannelList) Clear

func (l *ChannelList) Clear()

clear the channel list

func (*ChannelList) GetDelayMS added in v0.2.0

func (l *ChannelList) GetDelayMS(name string) float64

get the delay of a channel

func (*ChannelList) GetMonitorType

func (l *ChannelList) GetMonitorType(name string) string

get the monitor type of a channel

func (*ChannelList) GetPan added in v0.5.0

func (l *ChannelList) GetPan(name string) float64

get the pan state of a channel

func (*ChannelList) GetVisible

func (l *ChannelList) GetVisible() []Channel

create alphabetically sorted list of visible channels

func (*ChannelList) GetVisibleName

func (l *ChannelList) GetVisibleName(index byte) string

get the name of a visible channel by its index on the mcu

func (*ChannelList) GetVisibleNumber

func (l *ChannelList) GetVisibleNumber(name string) int

get the index of a visible channel by its name returns -1 if not found

func (*ChannelList) RemoveChannel

func (l *ChannelList) RemoveChannel(name string)

remove a channel from the list

func (*ChannelList) SetAllInvisible

func (l *ChannelList) SetAllInvisible()

set all channels to invisible (unused)

func (*ChannelList) SetAssignMode added in v0.5.0

func (l *ChannelList) SetAssignMode(mode byte)

set the assign mode of the mcu (delay or pan on the vpots)

func (*ChannelList) SetDelayMS added in v0.2.0

func (l *ChannelList) SetDelayMS(name string, delay float64)

set the delay of a channel

func (*ChannelList) SetMonitorType

func (l *ChannelList) SetMonitorType(name string, mon string)

set the monitor type of a channel (rec and solo button) type can be "OBS_MONITORING_TYPE_NONE", "OBS_MONITORING_TYPE_MONITOR_ONLY", "OBS_MONITORING_TYPE_MONITOR_AND_OUTPUT"

func (*ChannelList) SetMuted

func (l *ChannelList) SetMuted(name string, muted bool)

set the mute state of a channel

func (*ChannelList) SetPan

func (l *ChannelList) SetPan(name string, pan float64)

set the pan state of a channel

func (*ChannelList) SetSelected added in v0.2.9

func (l *ChannelList) SetSelected(fader byte, selected bool)

set the selected channel # on the mcu

func (*ChannelList) SetTrack added in v0.3.0

func (l *ChannelList) SetTrack(idx byte, state bool) *Channel

set the enabled state of a track of the selected channel

func (*ChannelList) SetTracks

func (l *ChannelList) SetTracks(name string, tracksEnabled map[string]bool)

set the enabled state of all tracks of the channel with the given name

func (*ChannelList) SetVisible

func (l *ChannelList) SetVisible(name string, visible bool)

set the visibility of a channel (if its shown in obs and on the mcu)

func (*ChannelList) SetVolume

func (l *ChannelList) SetVolume(name string, volume float64)

set the volume of a channel

func (*ChannelList) SyncMcu

func (l *ChannelList) SyncMcu()

actual sync with mcu, called from main runloop (sync channel)

func (*ChannelList) UpdateSpecialInputs

func (l *ChannelList) UpdateSpecialInputs() error

TODO: check for changes reads the special inputs from obs on start newly added inputs are detected by the event handler

func (*ChannelList) UpdateVisible

func (l *ChannelList) UpdateVisible()

get all visible channels from obs and set their state locally TODO: other way to get active ones initially?

type ObsState added in v0.2.4

type ObsState struct {
	StateName string
	LedName   string
	State     bool
}

type ObsStates added in v0.2.4

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

func NewObsStates added in v0.2.4

func NewObsStates() *ObsStates

func (*ObsStates) DeleteState added in v0.2.4

func (s *ObsStates) DeleteState(name string, state bool)

func (*ObsStates) GetState added in v0.2.4

func (s *ObsStates) GetState(name string) *ObsState

func (*ObsStates) SendAll added in v0.2.4

func (s *ObsStates) SendAll()

func (*ObsStates) SetState added in v0.2.4

func (s *ObsStates) SetState(name string, state bool)

Jump to

Keyboard shortcuts

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