gma2ws

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyName0 KeyName = "0"
	KeyName1 KeyName = "1"
	KeyName2 KeyName = "2"
	KeyName3 KeyName = "3"
	KeyName4 KeyName = "4"
	KeyName5 KeyName = "5"
	KeyName6 KeyName = "6"
	KeyName7 KeyName = "7"
	KeyName8 KeyName = "8"
	KeyName9 KeyName = "9"

	KeyNameOn        KeyName = "ON"
	KeyNameOff       KeyName = "OFF"
	KeyNameHighlight KeyName = "HIGH"
	KeyNameSolo      KeyName = "SOLO"
	KeyNameSelect    KeyName = "SELECT"

	KeyStatusOff   KeyStatus = "off"
	KeyStatusOn    KeyStatus = "on"
	KeyStatusBlink KeyStatus = "blink"
)
View Source
const (
	RequestTypeGetData            RequestType = "getdata"
	RequestTypeLogin              RequestType = "login"
	RequestTypePlaybacks          RequestType = "playbacks"
	RequestTypeClose              RequestType = "close"
	RequestTypePlaybacksUserInput RequestType = "playbacks_userInput"
	RequestTypeKeyname            RequestType = "keyname"
	RequestTypeCommand            RequestType = "command"

	ExecButtonViewModeFader ExecButtonViewMode = 1
)

Variables

View Source
var InvalidPasswordError error = fmt.Errorf("Invalid password")

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(host, user, password string) (*Client, error)

func (*Client) ButtonChanged

func (c *Client) ButtonChanged(ctx context.Context, executor, page, button int, value bool) error

func (*Client) FaderChanged

func (c *Client) FaderChanged(ctx context.Context, executor, page int, value float64) error

func (*Client) KeyStatuses

func (c *Client) KeyStatuses(keys ...string) (map[string]KeyStatus, error)

func (*Client) Playbacks

func (c *Client) Playbacks(page int, ranges []PlaybacksRange) ([]ServerPlaybacks, error)

func (*Client) SendCommand

func (c *Client) SendCommand(ctx context.Context, command string) error

func (*Client) SendKey

func (c *Client) SendKey(ctx context.Context, key KeyName, pressed bool) error

func (*Client) Start

func (c *Client) Start(ctx context.Context) (Stopper, error)

func (*Client) WriteJSON

func (c *Client) WriteJSON(data interface{}) error

type ClientHanshake

type ClientHanshake struct {
	Session int `json:"session"`
}

type ClientRequestCommand

type ClientRequestCommand struct {
	ClientRequestGeneric
	Command string `json:"command"`
}

type ClientRequestGeneric

type ClientRequestGeneric struct {
	RequestType RequestType `json:"requestType"`
	Session     int         `json:"session"`
	MaxRequests int         `json:"maxRequests"`
}

type ClientRequestGetData

type ClientRequestGetData struct {
	ClientRequestGeneric
	Data string `json:"data"`
}

type ClientRequestKeyName

type ClientRequestKeyName struct {
	ClientRequestGeneric
	KeyName         KeyName `json:"keyname"`
	Value           int     `json:"value"`
	CommandLineText string  `json:"cmdlinetext"`
	AutoSubmit      bool    `json:"autoSubmit"`
}

type ClientRequestLogin

type ClientRequestLogin struct {
	ClientRequestGeneric
	Username string `json:"username"`
	Password string `json:"password"`
}

type ClientRequestPlaybacks

type ClientRequestPlaybacks struct {
	ClientRequestGeneric
	PageIndex          int                `json:"pageIndex"`  // Page selected
	StartIndex         []int              `json:"startIndex"` // For the different ranges: executors to select (start index)
	ItemsCount         []int              `json:"itemsCount"` // For the different ranges: executors to select (count)
	ItemsType          []int              `json:"itemsType"`  // ???
	View               int                `json:"view"`       // ???
	ExecButtonViewMode ExecButtonViewMode `json:"execButtonViewMode"`
	ButtonsViewMode    int                `json:"buttonsViewMode"` // ???
}

type ClientRequestPlaybacksUserInput

type ClientRequestPlaybacksUserInput struct {
	ClientRequestGeneric
	Executor int     `json:"execIndex"`
	Page     int     `json:"pageIndex"`
	Value    float64 `json:"faderValue"`
	Type     int     `json:"type"`
	ButtonID int     `json:"buttonId"`
	Pressed  bool    `json:"pressed"`
	Released bool    `json:"released"`
}

type ExecButtonViewMode

type ExecButtonViewMode int

type ItemType

type ItemType int

type KeyName

type KeyName string

type KeyStatus

type KeyStatus string

type PlaybackResonse

type PlaybackResonse struct {
	Response []ServerPlaybacks
	Error    error
}

type PlaybacksItemType

type PlaybacksItemType int
const (
	PlaybacksItemTypeFader  PlaybacksItemType = 2
	PlaybacksItemTypeButton PlaybacksItemType = 3
)

type PlaybacksRange

type PlaybacksRange struct {
	Index    int
	Count    int
	ItemType PlaybacksItemType
}

type RequestType

type RequestType string

type ServerLoginParams

type ServerLoginParams struct {
	Realtime   bool `json:"realtime"`
	Session    int  `json:"session"`
	ForceLogin bool `json:"forceLogin"`
	WorldIndex int  `json:"worldIndex"`
}

type ServerLoginResponse

type ServerLoginResponse struct {
	Realtime    bool   `json:"realtime"`
	RequestType string `json:"requestType"`
	Result      bool   `json:"result"`
	WorldIndex  int    `json:"worldIndex"`
}

type ServerPlayback

type ServerPlayback struct {
	Index                 ServerPlaybackTextItem         `json:"i"`
	ObjectType            ServerPlaybackTextItem         `json:"oType"`
	ObjectIndex           ServerPlaybackTextItem         `json:"oI"`
	TextTop               ServerPlaybackTextItem         `json:"tt"`
	HeaderBackgroundColor string                         `json:"bC"`
	HeaderBorderColor     string                         `json:"bdC"`
	Cues                  ServerPlaybackCues             `json:"cues"`
	CombinedItems         int                            `json:"combinedItems"`
	IsExec                int                            `json:"iExec"`
	IsRun                 int                            `json:"isRun"`
	ExecutorBlocks        []ServerPlaybackExecutorBlocks `json:"executorBlocks"` // Why an array here ???
}

type ServerPlaybackCues

type ServerPlaybackCues struct {
	BackgroundColor string                   `json:"bC"`
	Items           []ServerPlaybackTextItem `json:"items"`
}

type ServerPlaybackExecutorBlock

type ServerPlaybackExecutorBlock struct {
	ID          int         `json:"id"`
	Text        string      `json:"t"`
	S           bool        `json:"s"` // ???
	Color       string      `json:"color"`
	BorderColor string      `json:"bdC"`
	LeftLed     interface{} `json:"leftLED"`  // Seems to never be filled
	RightLed    interface{} `json:"rightLED"` // Same
	TypeText    string      `json:"tt"`       // Only on faders
	Value       float64     `json:"v"`        // Only on faders
	ValueText   string      `json:"vT"`       // Only on faders
	Min         float64     `json:"min"`      // Only on faders
	Max         float64     `json:"max"`      // Only on faders
}

type ServerPlaybackExecutorBlocks

type ServerPlaybackExecutorBlocks struct {
	Button1 *ServerPlaybackExecutorBlock `json:"button1"`
	Button2 *ServerPlaybackExecutorBlock `json:"button2"`
	Button3 *ServerPlaybackExecutorBlock `json:"button3"`
	Fader   *ServerPlaybackExecutorBlock `json:"fader"`
}

type ServerPlaybackProgress

type ServerPlaybackProgress struct {
	Value           float64 `json:"v"`
	BackgroundColor string  `json:"bC"`
}

type ServerPlaybackTextItem

type ServerPlaybackTextItem struct {
	Text     string                  `json:"t"`
	Color    string                  `json:"c"`
	Progress *ServerPlaybackProgress `json:"pgs"`
}

type ServerPlaybacks

type ServerPlaybacks struct {
	ItemsType int                `json:"itemsType"` // ???
	CntPages  int                `json:"cntPages"`  // ???
	Items     [][]ServerPlayback `json:"items"`     // Items per fader groups (fader groups are 5 fader wide)
}

type ServerResponseGeneric

type ServerResponseGeneric struct {
	ResponseType RequestType `json:"responseType"`
	Realtime     bool        `json:"realtime"`
	WorldIndex   int         `json:"worldIndex"`
}

type ServerResponseGetData

type ServerResponseGetData struct {
	ServerResponseGeneric
	Data []map[string]string `json:"data"`
}

type ServerResponsePlayback

type ServerResponsePlayback struct {
	ServerResponseGeneric
	ResponseSubType int               `json:"responseSubType"` // ???
	IPage           int               `json:"iPage"`           // ???
	ItemGroups      []ServerPlaybacks `json:"itemGroups"`      // 1 ServerPlaybacks per requested ranges
}

type ServerStatus

type ServerStatus struct {
	Status  string `json:"status"`
	AppType string `json:"appType"`
}

type Stopper

type Stopper func()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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