Documentation
¶
Overview ¶
Package mpv provides Go bindings for libmpv.
Index ¶
- Variables
- type Event
- type EventEndFile
- type EventID
- type EventLogMessage
- type EventProperty
- type EventStartFile
- type Format
- type Mpv
- func (m *Mpv) Command(command []string) error
- func (m *Mpv) CommandAsync(replyUserdata uint64, command []string) 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) ID() int64
- func (m *Mpv) Initialize() error
- func (m *Mpv) LoadConfigFile(fileName string) error
- func (m *Mpv) Name() string
- 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) TimeUS() int64
- func (m *Mpv) UnobserveProperty(replyUserdata uint64) error
- func (m *Mpv) Version() uint64
- func (m *Mpv) WaitAsyncRequests()
- func (m *Mpv) WaitEvent(timeout float32) *Event
- func (m *Mpv) Wakeup()
- type Reason
Constants ¶
This section is empty.
Variables ¶
var ErrAoInitFailed = errors.New("audio output initialization failed")
var ErrCommand = errors.New("error running command")
var ErrEventQueueFull = errors.New("event queue full")
var ErrGeneric = errors.New("something happened")
var ErrInvalidParameter = errors.New("invalid parameter")
var ErrLoadingFailed = errors.New("loading failed")
var ErrNomem = errors.New("memory allocation failed")
var ErrNotImplemented = errors.New("operation not implemented")
var ErrNothingToPlay = errors.New("no audio or video data played")
var ErrOptionError = errors.New("error setting option")
var ErrOptionFormat = errors.New("unsupported format for accessing option")
var ErrOptionNotFound = errors.New("option not found")
var ErrPropertyError = errors.New("error accessing property")
var ErrPropertyFormat = errors.New("unsupported format for accessing property")
var ErrPropertyNotFound = errors.New("property not found")
var ErrUninitialized = errors.New("core not uninitialized")
var ErrUnknown = errors.New("unknown error")
var ErrUnknownFormat = errors.New("unrecognized file format")
var ErrUnsupported = errors.New("not supported")
var ErrVoInitFailed = errors.New("video output initialization failed")
Functions ¶
This section is empty.
Types ¶
type Event ¶
Event represents an mpv_event struct.
func (*Event) LogMessage ¶
func (e *Event) LogMessage() EventLogMessage
LogMessage returns EventLogMessage.
func (*Event) StartFile ¶
func (e *Event) StartFile() EventStartFile
StartFile returns EventStartFile.
type EventEndFile ¶
type EventEndFile struct { Reason Reason Error error EntryID int64 InsertID int64 InsertNumEntries int32 }
EventEndFile type.
type EventID ¶
type EventID int
EventID type.
const ( EventNone EventID = 0 EventShutdown EventID = 1 EventLogMsg EventID = 2 EventGetPropertyReply EventID = 3 EventSetPropertyReply EventID = 4 EventCommandReply EventID = 5 EventStart EventID = 6 EventEnd EventID = 7 EventFileLoaded EventID = 8 EventClientMessage EventID = 16 EventVideoReconfig EventID = 17 EventAudioReconfig EventID = 18 EventSeek EventID = 20 EventPlaybackRestart EventID = 21 EventPropertyChange EventID = 22 EventQueueOverflow EventID = 24 EventHook EventID = 25 )
EventID constants.
type EventLogMessage ¶
EventLogMessage type.
type EventProperty ¶
EventProperty type.
type Mpv ¶
type Mpv struct {
// contains filtered or unexported fields
}
Mpv represents an mpv client.
func Create ¶
func Create() *Mpv
Create creates a new mpv instance and an associated client API handle.
func (*Mpv) Command ¶
Command runs the specified command, returning an error if something goes wrong.
func (*Mpv) CommandAsync ¶
CommandAsync runs the command asynchronously.
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 gets a property asynchronously.
func (*Mpv) GetPropertyOsdString ¶
GetPropertyOsdString returns the value of the property as a string formatted for 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 initializes an uninitialized mpv instance.
func (*Mpv) LoadConfigFile ¶
LoadConfigFile loads the given config file.
func (*Mpv) ObserveProperty ¶
ObserveProperty gets a notification whenever the given property changes.
func (*Mpv) RequestEvent ¶
RequestEvent enables or disables the given event.
func (*Mpv) RequestLogMessages ¶
RequestLogMessages enables or disables receiving of log messages. Valid log levels: no fatal error warn info v debug trace.
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 sets a property asynchronously.
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 will remove all observed properties for passed replyUserdata.
func (*Mpv) Version ¶
Version returns the MPV_CLIENT_API_VERSION the mpv source has been compiled with.
func (*Mpv) WaitAsyncRequests ¶
func (m *Mpv) WaitAsyncRequests()
WaitAsyncRequests blocks until all asynchronous requests are done.