Documentation
¶
Index ¶
- func CNodeList(nodelist []*Node) *C.mpv_node_list
- func CNodeMap(nodemap map[string]*Node) *C.mpv_node_list
- func NewError(err int) error
- func NewNodeMap(n *C.mpv_node_list) map[string]*Node
- type Error
- type Event
- type EventId
- type Format
- type Mpv
- func (m *Mpv) ClientName() string
- func (m *Mpv) Command(command []string) error
- func (m *Mpv) CommandAsync(replyUserdata uint64, command []string) error
- func (m *Mpv) CommandNode(args Node, result *Node) error
- func (m *Mpv) CommandNodeAsync(replyUserdata uint64, args Node) error
- func (m *Mpv) CommandString(command string) error
- func (m *Mpv) GetProperty(name string, format Format) (interface{}, error)
- func (m *Mpv) GetPropertyAsync(name string, replyUserdata uint64, format Format) error
- func (m *Mpv) GetPropertyOsdString(name string) string
- func (m *Mpv) GetPropertyString(name string) string
- func (m *Mpv) GetTimeUS() int64
- func (m *Mpv) GetWakeupPipe() int
- func (m *Mpv) Initialize() error
- func (m *Mpv) LoadConfigFile(fn string) error
- func (m *Mpv) MPVHandle() unsafe.Pointer
- func (m *Mpv) ObserveProperty(replyUserdata uint64, name string, format Format) error
- func (m *Mpv) RequestEvent(event EventId, enable bool) error
- func (m *Mpv) RequestLogMessages(level string) error
- func (m *Mpv) SetOption(name string, format Format, data interface{}) error
- func (m *Mpv) SetOptionString(name, value string) error
- func (m *Mpv) SetProperty(name string, format Format, data interface{}) error
- func (m *Mpv) SetPropertyAsync(name string, replyUserdata uint64, format Format, data interface{}) error
- func (m *Mpv) SetPropertyString(name, value string) error
- func (m *Mpv) TerminateDestroy()
- func (m *Mpv) UnobserveProperty(replyUserdata uint64) error
- func (m *Mpv) WaitEvent(timeout float32) *Event
- func (m *Mpv) Wakeup()
- type Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CNodeList ¶
func CNodeList(nodelist []*Node) *C.mpv_node_list
CNodeList turns a list of Go Nodes into an mpv_node_list
func CNodeMap ¶
func CNodeMap(nodemap map[string]*Node) *C.mpv_node_list
CNodeMap turns a map of strings to Go nodes into an mpv_node_list.
func NewNodeMap ¶
func NewNodeMap(n *C.mpv_node_list) map[string]*Node
NewNodeMap turns an mpv_node_list into a map of strings to Go Nodes.
Types ¶
type Error ¶
type Error int
Error type.
const ( ERROR_SUCCESS Error = C.MPV_ERROR_SUCCESS ERROR_EVENT_QUEUE_FULL Error = C.MPV_ERROR_EVENT_QUEUE_FULL ERROR_NOMEM Error = C.MPV_ERROR_NOMEM ERROR_UNINITIALIZED Error = C.MPV_ERROR_UNINITIALIZED ERROR_INVALID_PARAMETER Error = C.MPV_ERROR_INVALID_PARAMETER ERROR_OPTION_NOT_FOUND Error = C.MPV_ERROR_OPTION_NOT_FOUND ERROR_OPTION_FORMAT Error = C.MPV_ERROR_OPTION_FORMAT ERROR_OPTION_ERROR Error = C.MPV_ERROR_OPTION_ERROR ERROR_PROPERTY_NOT_FOUND Error = C.MPV_ERROR_PROPERTY_NOT_FOUND ERROR_PROPERTY_FORMAT Error = C.MPV_ERROR_PROPERTY_FORMAT ERROR_PROPERTY_UNAVAILABLE Error = C.MPV_ERROR_PROPERTY_UNAVAILABLE ERROR_PROPERTY_ERROR Error = C.MPV_ERROR_PROPERTY_ERROR ERROR_COMMAND Error = C.MPV_ERROR_COMMAND ERROR_LOADING_FAILED Error = C.MPV_ERROR_LOADING_FAILED ERROR_AO_INIT_FAILED Error = C.MPV_ERROR_AO_INIT_FAILED ERROR_VO_INIT_FAILED Error = C.MPV_ERROR_VO_INIT_FAILED ERROR_NOTHING_TO_PLAY Error = C.MPV_ERROR_NOTHING_TO_PLAY ERROR_UNKNOWN_FORMAT Error = C.MPV_ERROR_UNKNOWN_FORMAT ERROR_UNSUPPORTED Error = C.MPV_ERROR_UNSUPPORTED ERROR_NOT_IMPLEMENTED Error = C.MPV_ERROR_NOT_IMPLEMENTED )
Errors .
type EventId ¶
type EventId int
EventId type.
const ( EVENT_NONE EventId = C.MPV_EVENT_NONE EVENT_SHUTDOWN EventId = C.MPV_EVENT_SHUTDOWN EVENT_LOG_MESSAGE EventId = C.MPV_EVENT_LOG_MESSAGE EVENT_GET_PROPERTY_REPLY EventId = C.MPV_EVENT_GET_PROPERTY_REPLY EVENT_SET_PROPERTY_REPLY EventId = C.MPV_EVENT_SET_PROPERTY_REPLY EVENT_COMMAND_REPLY EventId = C.MPV_EVENT_COMMAND_REPLY EVENT_START_FILE EventId = C.MPV_EVENT_START_FILE EVENT_END_FILE EventId = C.MPV_EVENT_END_FILE EVENT_FILE_LOADED EventId = C.MPV_EVENT_FILE_LOADED EVENT_IDLE EventId = C.MPV_EVENT_IDLE EVENT_TICK EventId = C.MPV_EVENT_TICK EVENT_CLIENT_MESSAGE EventId = C.MPV_EVENT_CLIENT_MESSAGE EVENT_VIDEO_RECONFIG EventId = C.MPV_EVENT_VIDEO_RECONFIG EVENT_AUDIO_RECONFIG EventId = C.MPV_EVENT_AUDIO_RECONFIG EVENT_SEEK EventId = C.MPV_EVENT_SEEK EVENT_PLAYBACK_RESTART EventId = C.MPV_EVENT_PLAYBACK_RESTART EVENT_PROPERTY_CHANGE EventId = C.MPV_EVENT_PROPERTY_CHANGE EVENT_QUEUE_OVERFLOW EventId = C.MPV_EVENT_QUEUE_OVERFLOW )
Events .
type Format ¶
type Format int
Format .
const ( FORMAT_NONE Format = C.MPV_FORMAT_NONE FORMAT_STRING Format = C.MPV_FORMAT_STRING FORMAT_OSD_STRING Format = C.MPV_FORMAT_OSD_STRING FORMAT_FLAG Format = C.MPV_FORMAT_FLAG FORMAT_INT64 Format = C.MPV_FORMAT_INT64 FORMAT_DOUBLE Format = C.MPV_FORMAT_DOUBLE FORMAT_NODE Format = C.MPV_FORMAT_NODE FORMAT_NODE_ARRAY Format = C.MPV_FORMAT_NODE_ARRAY FORMAT_NODE_MAP Format = C.MPV_FORMAT_NODE_MAP FORMAT_BYTE_ARRAY Format = C.MPV_FORMAT_BYTE_ARRAY )
type Mpv ¶
type Mpv struct {
// contains filtered or unexported fields
}
Mpv represents an mpv client.
func (*Mpv) Command ¶
Command runs the specified command, returning an error if something goes wrong.
func (*Mpv) CommandAsync ¶
CommandAsync .
func (*Mpv) CommandNode ¶
CommandNode runs the given command node.
func (*Mpv) CommandNodeAsync ¶
CommandNodeAsync .
func (*Mpv) CommandString ¶
CommandString runs the given command string, this string is parsed internally by mpv.
func (*Mpv) GetProperty ¶
GetProperty returns the value of the property according to the given format.
func (*Mpv) GetPropertyAsync ¶
GetPropertyAsync .
func (*Mpv) GetPropertyOsdString ¶
GetPropertyOsdString returns the value of the property as a string formatted for mpv's on-screen display.
func (*Mpv) GetPropertyString ¶
GetPropertyString returns the value of the property as a string. If the property is empty, an empty string is returned.
func (*Mpv) Initialize ¶
Initialize runs mpv_initialize and returns any errors that might occur.
func (*Mpv) LoadConfigFile ¶
LoadConfigFile loads the given config file.
func (*Mpv) MPVHandle ¶
MPVHandle returns the pointer to the mpv_handle struct for invoking native MPV APIs
func (*Mpv) ObserveProperty ¶
ObserveProperty .
func (*Mpv) RequestEvent ¶
RequestEvent .
func (*Mpv) RequestLogMessages ¶
RequestLogMessages .
func (*Mpv) SetOptionString ¶
SetOptionString sets the option to the given string.
func (*Mpv) SetProperty ¶
SetProperty sets the client property according to the given format.
func (*Mpv) SetPropertyAsync ¶
func (m *Mpv) SetPropertyAsync(name string, replyUserdata uint64, format Format, data interface{}) error
SetPropertyAsync .
func (*Mpv) SetPropertyString ¶
SetPropertyString sets the property to the given string.
func (*Mpv) TerminateDestroy ¶
func (m *Mpv) TerminateDestroy()
TerminateDestroy terminates mpv and destroys the client.
func (*Mpv) UnobserveProperty ¶
UnobserveProperty .
type Node ¶
type Node struct { Data interface{} Format Format }
Node type.
func NewNode ¶
NewNode takes a pointer to an mpv_node struct and returns a pointer to a native Go Node struct. The data is converted into Go data according to mpv_node.format.
func NewNodeList ¶
func NewNodeList(n *C.mpv_node_list) []*Node
NewNodeList turns an mpv_node_list into a list of Go Nodes.