hostwin

package module
v0.0.0-...-e6c1bf1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const BidulePort = 3210

Variables

View Source
var BiduleExe = "bidule.exe"
View Source
var EngineExe = "palette_engine.exe"
View Source
var EngineHttpPort = 3330
View Source
var EventClientPort = 6666
View Source
var FullDataPath string
View Source
var GuiExe = "palette_gui.exe"
View Source
var GuiPort = 3943
View Source
var LocalAddress = "127.0.0.1"
View Source
var MmttExe = "mmtt_kinect.exe"

var KeykitExe = "key.exe"

View Source
var MmttHttpPort = 4444
View Source
var MonitorExe = "palette_monitor.exe"
View Source
var MorphDefs map[string]string

MorphDefs xxx

View Source
var NoWriterInstance io.Writer
View Source
var OscPort = 3333
View Source
var PaletteExe = "palette.exe"
View Source
var ResolumeExe = "avenue.exe"
View Source
var ResolumeJSON map[string]any

ResolumeJSON is an unmarshalled version of the resolume.json file

View Source
var ResolumePort = 7000
View Source
var TheRand *rand.Rand

Functions

func CheckAutorestartProcesses

func CheckAutorestartProcesses()

func ConfigDir

func ConfigDir() string

func ConfigFilePath

func ConfigFilePath(nm string) string

func GetPaletteVersion

func GetPaletteVersion() string

func Hostname

func Hostname() string

func HttpApiRaw

func HttpApiRaw(url string, args string) (map[string]string, error)

func InitLog

func InitLog(logname string)

InitLog creates a logger to a log file, or stdout if logname is "".

func IsRunning

func IsRunning(process string) bool

func KillAllExceptMonitor

func KillAllExceptMonitor()

func KillProcess

func KillProcess(exe string)

KillProcess kills a process (synchronously)

func LoadImage

func LoadImage(path string) (*image.NRGBA, error)

LoadImage reads an image file

func LoadMorphs

func LoadMorphs() error

LoadMorphs initializes the list of morphs

func LocalPaletteDir

func LocalPaletteDir() string

LocalPaletteDir gets used for local (and changed) things in saved and config.

func LogError

func LogError(err error, keysAndValues ...any)

LogIfError will accept a nil value and do nothing

func LogFilePath

func LogFilePath(nm string) string

func LogIfError

func LogIfError(err error, keysAndValues ...any)

func LogInfo

func LogInfo(msg string, keysAndValues ...any)

func LogWarn

func LogWarn(msg string, keysAndValues ...any)

func MIDIFilePath

func MIDIFilePath(nm string) string

MIDIFilePath xxx

func MonitorIsRunning

func MonitorIsRunning() bool

func NewExecutableLogWriter

func NewExecutableLogWriter(exe string) io.Writer

func PaletteDataPath

func PaletteDataPath() string

func PaletteDir

func PaletteDir() string

PaletteDir is the value of environment variable PALETTE

func ProcessList

func ProcessList() []string

func ReadConfigFile

func ReadConfigFile(path string) (map[string]string, error)

ReadConfigFile xxx

func ReadableSavedFilePath

func ReadableSavedFilePath(category string, filename string) (string, error)

ReadableSavedFilePath returns the full path of a saved file. The value of filename isn't trusted, verify its sanity.

func SavedDir

func SavedDir() string

func SavedMap

func SavedMap(wantCategory string) (map[string]string, error)

SavedMap returns a map of saved names to file paths The saved names are of the form "category.name". If wantCategory is "*", all categories are returned

func SendMail

func SendMail(body string) error

func SendMailWithAttachment

func SendMailWithAttachment(body, attachfile string) error

SendMail xxx

func Spawn

func Spawn(executable string, background bool, stdout io.Writer, stderr io.Writer, args ...string) error

Spawn executes something. If background is true, it doesn't block

func StartDeviceInput

func StartDeviceInput()

StartDeviceInput starts anything needed to provide device inputs

func StartPlusUptime

func StartPlusUptime(startdate string, uptime float64) string

func StartRunning

func StartRunning(process string) error

func SummarizeLog

func SummarizeLog(fname string) error

func WritableSavedFilePath

func WritableSavedFilePath(category string, filename string) (string, error)

WritableSavedFilePath xxx

Types

type FileWriter

type FileWriter struct {
	Exe string
}

func (*FileWriter) Write

func (w *FileWriter) Write(p []byte) (n int, err error)

type HostWin

type HostWin struct {
	// contains filtered or unexported fields
}
var TheWinHost *HostWin

func NewHost

func NewHost(logname string) *HostWin

func (HostWin) Activate

func (h HostWin) Activate()

func (HostWin) ActivateAudio

func (h HostWin) ActivateAudio()

func (HostWin) ArchiveLogs

func (h HostWin) ArchiveLogs() error

func (HostWin) EngineHttpApi

func (h HostWin) EngineHttpApi(api string, args ...string) (map[string]string, error)

func (HostWin) EveryTick

func (h HostWin) EveryTick()

func (HostWin) FileExists

func (h HostWin) FileExists(filepath string) bool

func (HostWin) FreeframeClientFor

func (h HostWin) FreeframeClientFor(patchName string) *osc.Client

func (HostWin) GenerateVisualsFromCursor

func (h HostWin) GenerateVisualsFromCursor(ce kit.CursorEvent, patchName string)

func (HostWin) GetConfigFileData

func (h HostWin) GetConfigFileData(filename string) ([]byte, error)

func (HostWin) GetSavedData

func (h HostWin) GetSavedData(category string, filename string) (bytes []byte, err error)

func (HostWin) HandleIncomingMidiEvent

func (h HostWin) HandleIncomingMidiEvent(me kit.MidiEvent)

func (HostWin) Init

func (h HostWin) Init() error

func (HostWin) InputEventLock

func (h HostWin) InputEventLock()

func (HostWin) InputEventUnlock

func (h HostWin) InputEventUnlock()

func (HostWin) KillProcess

func (h HostWin) KillProcess(process string) (err error)

func (HostWin) LogError

func (h HostWin) LogError(err error, keysAndValues ...any)

func (HostWin) LogIfError

func (h HostWin) LogIfError(err error, keysAndValues ...any)

func (HostWin) LogInfo

func (h HostWin) LogInfo(msg string, keysAndValues ...any)

func (HostWin) LogWarn

func (h HostWin) LogWarn(msg string, keysAndValues ...any)

func (HostWin) MmttHttpApi

func (h HostWin) MmttHttpApi(api string) (map[string]string, error)

func (HostWin) PortAndLayerNumForPatch

func (h HostWin) PortAndLayerNumForPatch(patchName string) (portNum, layerNum int)

func (HostWin) ProcessInfo

func (h HostWin) ProcessInfo() *ProcessInfo

func (HostWin) ProcessInfoBidule

func (h HostWin) ProcessInfoBidule() *ProcessInfo

func (HostWin) ResetAudio

func (h HostWin) ResetAudio()

func (HostWin) SaveDataInFile

func (h HostWin) SaveDataInFile(data []byte, category string, filename string) error

func (HostWin) SavedFileList

func (h HostWin) SavedFileList(category string) ([]string, error)

SavedArray returns a list of saved filenames for a particular category.

func (HostWin) SayDone

func (h HostWin) SayDone()

func (HostWin) SendEffectParam

func (h HostWin) SendEffectParam(patchName string, name string, value string)

func (HostWin) SendMIDI

func (h HostWin) SendMIDI(output any, bytes []byte) error

func (HostWin) SendOsc

func (h HostWin) SendOsc(client *osc.Client, msg *osc.Message)

func (HostWin) SendToOscClients

func (h HostWin) SendToOscClients(msg *osc.Message)

func (HostWin) SetMidiInput

func (h HostWin) SetMidiInput(midiInputName string) error

func (HostWin) ShowClip

func (h HostWin) ShowClip(clipNum int)

In text layer, clip 1 is the animated text generator for the preset names, and clips 2,3,... are images for startup and reboot.

func (HostWin) ShowText

func (h HostWin) ShowText(text string)

func (HostWin) Start

func (h HostWin) Start()

func (HostWin) StartHttp

func (h HostWin) StartHttp(port int)

StartHttp xxx

func (HostWin) StartOscListener

func (h HostWin) StartOscListener(port int)

func (HostWin) StartRunning

func (h HostWin) StartRunning(process string) (err error)

func (HostWin) TextLayerNum

func (h HostWin) TextLayerNum() int

func (HostWin) ToFreeFramePlugin

func (h HostWin) ToFreeFramePlugin(patchName string, msg *osc.Message)

func (HostWin) WaitTillDone

func (h HostWin) WaitTillDone()

type MIDIDeviceEvent

type MIDIDeviceEvent struct {
	Timestamp int64 // milliseconds
	Status    int64
	Data1     int64
	Data2     int64
}

MIDIDeviceEvent is a single MIDI event

type NoWriter

type NoWriter struct {
}

func (*NoWriter) Write

func (w *NoWriter) Write(p []byte) (n int, err error)

type ProcessInfo

type ProcessInfo struct {
	Exe       string // just the last part
	FullPath  string
	Arg       string
	Activate  func()
	Activated bool
}

func GuiProcessInfo

func GuiProcessInfo() *ProcessInfo

func MmttProcessInfo

func MmttProcessInfo() *ProcessInfo

func NewProcessInfo

func NewProcessInfo(exe, fullPath, arg string, activate func()) *ProcessInfo

type ProcessManager

type ProcessManager struct {
	// contains filtered or unexported fields
}
var TheProcessManager *ProcessManager

func NewProcessManager

func NewProcessManager() *ProcessManager

func (*ProcessManager) AddBuiltins

func (pm *ProcessManager) AddBuiltins()

func (*ProcessManager) AddProcess

func (pm *ProcessManager) AddProcess(process string, info *ProcessInfo)

func (*ProcessManager) AddProcessBuiltIn

func (pm *ProcessManager) AddProcessBuiltIn(process string)

func (*ProcessManager) CheckAutorestartProcesses

func (pm *ProcessManager) CheckAutorestartProcesses()

CheckAutorestartProcesses will restart processes that were started but are no longer running.

func (*ProcessManager) GetProcessInfo

func (pm *ProcessManager) GetProcessInfo(process string) (*ProcessInfo, error)

func (*ProcessManager) IsAvailable

func (pm *ProcessManager) IsAvailable(process string) bool

func (*ProcessManager) IsRunning

func (pm *ProcessManager) IsRunning(process string) bool

func (*ProcessManager) KillProcess

func (pm *ProcessManager) KillProcess(process string) (err error)

func (*ProcessManager) ProcessStatus

func (pm *ProcessManager) ProcessStatus() string

func (*ProcessManager) StartRunning

func (pm *ProcessManager) StartRunning(process string) error

type Router

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

Router takes events and routes them

var TheRouter *Router

func NewRouter

func NewRouter() *Router

func (*Router) InputListenOnce

func (r *Router) InputListenOnce()

func (*Router) InputListener

func (r *Router) InputListener()

InputListener listens for local device inputs (OSC, MIDI) them in a single select eliminates some need for locking.

func (*Router) Start

func (r *Router) Start()

Jump to

Keyboard shortcuts

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