ui

package
v1.0.44 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Unlicense Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDevices

func GetDevices() (result []streamdeck_wrapper.Device)

func GetJSON

func GetJSON(baseURL string, headers map[string]string, params map[string]string) (target interface{})

func PostJSON

func PostJSON(url string, headers map[string]string, payload interface{}) (result interface{})

func PrintDevices

func PrintDevices() (result []streamdeck_wrapper.Device)

Types

type Button

type Button struct {
	PressCount    int       `yaml:"-"`
	LastPressTime time.Time `yaml:"-"`
	// Toggled bool `yamm:"toggled"`
	Timer       *time.Timer       `yaml:"-"`
	Index       uint8             `yaml:"index"`
	Image       string            `yaml:"image"`
	MP3         string            `yaml:"mp3"`
	Id          string            `yaml:"_"`
	SingleClick string            `yaml:"single_click"`
	DoubleClick string            `yaml:"double_click"`
	TripleClick string            `yaml:"triple_click"`
	Toggle      string            `yaml:"toggle"`
	ReturnPage  string            `yaml:"return_page"`
	Options     map[string]string `yaml:"options"`
}

type PageButton

type PageButton struct {
	Index uint8  `yaml:"index"`
	Id    string `yaml:"id"`
}

type PushOverConfig

type PushOverConfig struct {
	Token             string `yaml:"token"`
	GlobalNotify      bool   `yaml:"global_notify"`
	GlobalNotifyTo    string `yaml:"global_notify_to"`
	GlobalNotifySound string `yaml:"global_notify_sound"`
}

type StreamDeckUI

type StreamDeckUI struct {
	Device                     streamdeck_wrapper.Device   `yaml:"-"`
	Ready                      bool                        `yaml:"-"`
	Muted                      bool                        `yaml:"muted"`
	Fresh                      bool                        `yaml:"-"`
	SettingsMode               bool                        `yaml:"-"`
	PlayBackMutex              sync.Mutex                  `yaml:"-"`
	TwilioCallMutex            sync.Mutex                  `yaml:"-"`
	ActivePageID               string                      `yaml:"-"`
	Sleep                      bool                        `yaml:"-"`
	Serial                     string                      `yaml:"serial"`
	VendorID                   string                      `yaml:"vendor_id"`
	ProductID                  string                      `yaml:"product_id"`
	IconSize                   uint                        `yaml:"icon_size"`
	Brightness                 uint8                       `yaml:"brightness"`
	XSize                      int                         `yaml:"x_size"`
	YSize                      int                         `yaml:"y_size"`
	GlobalCooldownMilliseconds int64                       `yaml:"global_cooldown_milliseconds"`
	LastPressTime              time.Time                   `yaml:"-"`
	EndpointHostName           string                      `yaml:"endpoint_hostname"`
	EndpointToken              string                      `yaml:"endpoint_token"`
	Twilio                     TwilioConfig                `yaml:"twilio"`
	PushOver                   PushOverConfig              `yaml:"push_over"`
	TwilioLocked               bool                        `yaml:"-"`
	Pages                      map[string]StreamDeckUIPage `yaml:"pages"`
	Buttons                    map[string]Button           `yaml:"buttons"`
	LoadedButtonImages         map[uint8]string            `yaml:"-"`
	DB                         *bolt_api.DB                `yaml:"-"`
}

func NewStreamDeckUI

func NewStreamDeckUI(file_path string) (result *StreamDeckUI)

func NewStreamDeckUIFromInterface

func NewStreamDeckUIFromInterface(config interface{}) (result *StreamDeckUI)

func (*StreamDeckUI) AddButton

func (ui *StreamDeckUI) AddButton(button_id string, button Button) (result string)

doesn't persist

func (*StreamDeckUI) AddImageAsTiledButton

func (ui *StreamDeckUI) AddImageAsTiledButton(file_path string, button Button) string

doesn't persist

func (*StreamDeckUI) AddImageAsTiledButtonCustom

func (ui *StreamDeckUI) AddImageAsTiledButtonCustom(file_path string, button Button, x_size_int int, y_size_int int, tile_size_int int) string

func (*StreamDeckUI) AddPage

func (ui *StreamDeckUI) AddPage(page_id string, page StreamDeckUIPage) (result string)

doesn't persist

func (*StreamDeckUI) BtnIdToPageButton

func (ui *StreamDeckUI) BtnIdToPageButton(button_id string) (result Button)

func (*StreamDeckUI) BtnNumToPageButton

func (ui *StreamDeckUI) BtnNumToPageButton(button_index uint8) (result Button)

func (*StreamDeckUI) ButtonAction

func (ui *StreamDeckUI) ButtonAction(button Button, action_type string, action string, mp3_path string)

func (*StreamDeckUI) Clear

func (ui *StreamDeckUI) Clear()

func (*StreamDeckUI) Connect

func (ui *StreamDeckUI) Connect()

func (*StreamDeckUI) DecreaseBrightness

func (ui *StreamDeckUI) DecreaseBrightness()

func (*StreamDeckUI) GetActivePageID

func (ui *StreamDeckUI) GetActivePageID() (result string)

func (*StreamDeckUI) Hide

func (ui *StreamDeckUI) Hide()

func (*StreamDeckUI) IncreaseBrightness

func (ui *StreamDeckUI) IncreaseBrightness()

func (*StreamDeckUI) Mute

func (ui *StreamDeckUI) Mute()

func (*StreamDeckUI) PlayMP3

func (ui *StreamDeckUI) PlayMP3(file_path string)

func (*StreamDeckUI) PushOverSend

func (ui *StreamDeckUI) PushOverSend(to string, message string, sound string)

func (*StreamDeckUI) Render

func (ui *StreamDeckUI) Render()

func (*StreamDeckUI) RenderSoft

func (ui *StreamDeckUI) RenderSoft()

func (*StreamDeckUI) SetActivePageID

func (ui *StreamDeckUI) SetActivePageID(page_id string) (result string)

func (*StreamDeckUI) SetBrightness

func (ui *StreamDeckUI) SetBrightness(brightness_level uint8)

func (*StreamDeckUI) Show

func (ui *StreamDeckUI) Show()

func (*StreamDeckUI) SingleClickId

func (ui *StreamDeckUI) SingleClickId(button_id string)

func (*StreamDeckUI) SingleClickNumber

func (ui *StreamDeckUI) SingleClickNumber(button_num uint8)

func (*StreamDeckUI) TwilioCall

func (ui *StreamDeckUI) TwilioCall(to string, url string)

func (*StreamDeckUI) UnMute

func (ui *StreamDeckUI) UnMute()

func (*StreamDeckUI) WatchKeys

func (ui *StreamDeckUI) WatchKeys()

type StreamDeckUIPage

type StreamDeckUIPage struct {
	Buttons []PageButton
}

type TwilioConfig

type TwilioConfig struct {
	SID          string `yaml:"sid"`
	Token        string `yaml:"token"`
	From         string `yaml:"from"`
	APIKeySID    string `yaml:"api_key_sid"`
	APIKeySecret string `yaml:"api_key_secret"`
}

Jump to

Keyboard shortcuts

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