Documentation ¶
Index ¶
- Constants
- func ClientApiVersion() uint64
- func EventName(event EventID) string
- type EClientMessage
- type ECommandReply
- type EEndFile
- type EHook
- type ELogMessage
- type EProperty
- type EStartFile
- type EndFileReason
- type Error
- type Event
- type EventID
- type Format
- type LogLevel
- type Mpv
- func (m *Mpv) AbortAsyncCommand(id uint64)
- func (m *Mpv) ClientID() int64
- func (m *Mpv) ClientName() string
- func (m *Mpv) Command(args []string) error
- func (m *Mpv) CommandAsync(args []string, id uint64) error
- func (m *Mpv) CommandAsyncNode(args *Node, id uint64) error
- func (m *Mpv) CommandNode(args *Node) (*Node, error)
- func (m *Mpv) CommandReturn(args []string) (*Node, error)
- func (m *Mpv) CommandString(command string) error
- func (m *Mpv) CreateClient(name string) (*Mpv, error)
- func (m *Mpv) CreateWeakClient(name string) (*Mpv, error)
- func (m *Mpv) Destroy()
- func (m Mpv) EventWait(timeout float64) *Event
- func (m *Mpv) GetProperty(name string, format Format) (interface{}, error)
- func (m *Mpv) GetPropertyAsync(name string, id uint64, format Format) error
- func (m *Mpv) GetPropertyOsdString(name string) (string, error)
- func (m *Mpv) GetPropertyString(name string) (string, error)
- func (m Mpv) HookAdd(name string, priority int, id uint64) error
- func (m Mpv) HookContinue(id uint64) error
- func (m *Mpv) Initialize() error
- func (m *Mpv) InternalTime() int64
- func (m *Mpv) LoadConfig(filename string) error
- func (m *Mpv) ObserveProperty(name string, id uint64, format Format) error
- func (m Mpv) RequestEvent(event EventID, status bool) error
- func (m Mpv) RequestLogMessages(level LogLevel) error
- func (m *Mpv) SetOption(name string, option interface{}, format Format) error
- func (m *Mpv) SetOptionString(name, option string) error
- func (m *Mpv) SetProperty(name string, property interface{}, format Format) error
- func (m *Mpv) SetPropertyAsync(name string, property interface{}, id uint64, format Format) error
- func (m *Mpv) SetPropertyString(name, property string) error
- func (m Mpv) SetWakeupCallback()
- func (m *Mpv) Terminate()
- func (m *Mpv) UnObserveProperty(id uint64) (int, error)
- func (m Mpv) WaitAsyncRequests()
- func (m Mpv) Wakeup()
- type Node
- type NodeList
- type NodeMap
Constants ¶
const ( ErrSuccess = 0 ErrEventQueueFull = -1 ErrNomem = -2 ErrUninitialized = -3 ErrInvalidParameter = -4 ErrOptionNotFound = -5 ErrOptionFormat = -6 ErrOptionError = -7 ErrPropertyNotFound = -8 ErrPropertyFormat = -9 ErrPropertyError = -11 ErrCommand = -12 ErrLoadingFailed = -13 ErrAoInitFailed = -14 ErrVoInitFailed = -15 ErrNothingToPlay = -16 ErrUnknownFormat = -17 ErrUnsupported = -18 ErrNotImplemented = -19 ErrGeneric = -20 )
Variables ¶
This section is empty.
Functions ¶
func ClientApiVersion ¶
func ClientApiVersion() uint64
ClientApiVersion returns version of compiled mpv
Types ¶
type EClientMessage ¶
type EClientMessage []string
type ECommandReply ¶
type ECommandReply *Node
type EEndFile ¶
type EEndFile struct { PlaylistEntryID int64 PlaylistInsertID int64 PlaylistInsertEntries int Error Error Reason EndFileReason }
type ELogMessage ¶
type EStartFile ¶
type EStartFile int64
type EndFileReason ¶
type EndFileReason int
const ( EndFileReasonEof EndFileReason = 0 EndFileReasonStop EndFileReason = 2 EndFileReasonQuit EndFileReason = 3 EndFileReasonError EndFileReason = 4 EndFileReasonRedirect EndFileReason = 5 )
type Error ¶
type Error int
Error this is not used anywhere, but maybe someone finds use case for it
Every error code is wrapped with go standard error package
type EventID ¶
type EventID int
const ( EventNone EventID = 0 EventShutdown EventID = 1 EventLogMessage EventID = 2 EventGetPropertyReply EventID = 3 EventSetPropertyReply EventID = 4 EventCommandReply EventID = 5 EventStartFile EventID = 6 EventEndFile EventID = 7 EventFileLoaded EventID = 8 EventIdle EventID = 11 // Deprecated: use ObserveProperty("idle-activity") instead EventPause EventID = 12 // Deprecated: use ObserveProperty("pause") instead EventUnpause EventID = 13 // Deprecated: use ObserveProperty("unpause") instead EventTick EventID = 14 // Deprecated: use for example ObserveProperty("playback-time") instead EventClientMessage EventID = 16 EventVideoReconfig EventID = 17 EventAudioReconfig EventID = 18 EventSeek EventID = 20 EventPlaybackRestart EventID = 21 EventPropertyChange EventID = 22 EventQueueOverflow EventID = 24 EventHook EventID = 25 )
type Format ¶
type Format int
Format represents supported formats by mpv API used for retrieving and setting options and properties.
const ( FormatNone Format = 0 // FormatNone is used to represent invalid or in some cases empty values. FormatString Format = 1 // FormatString is used for string values FormatOsdString Format = 2 // FormatOsdString is used for OSD string values FormatFlag Format = 3 // FormatFlag is used for boolean values FormatBoolean Format = 3 // FormatBoolean is alias for FormatFlag FormatInt64 Format = 4 // FormatInt64 is used for integer values FormatDouble Format = 5 // FormatDouble is used for floating point values FormatFloat64 Format = 5 // FormatFloat64 is alias for FormatDouble FormatNode Format = 6 // FormatNode is used for Node values FormatNodeArray Format = 7 // FormatNodeArray is used for NodeList values FormatNodeMap Format = 8 // FormatNodeMap is used for NodeMap values FormatByteArray Format = 9 // FormatByteArray is used for byte array values )
type LogLevel ¶
type LogLevel int
const ( LogLevelNone LogLevel = 0 // "no" - disable absolutely all messages LogLevelFatal LogLevel = 10 // "fatal" - critical/aborting errors LogLevelError LogLevel = 20 // "error" - simple errors LogLevelWarn LogLevel = 30 // "warn" - possible problems LogLevelInfo LogLevel = 40 // "info" - informational message LogLevelV LogLevel = 50 // "v" - noisy informational message LogLevelDebug LogLevel = 60 // "debug" - very noisy technical information LogLevelTrace LogLevel = 70 // "trace" - extremely noisy )
type Mpv ¶
type Mpv struct {
// contains filtered or unexported fields
}
func (*Mpv) AbortAsyncCommand ¶
func (*Mpv) ClientName ¶
ClientName returns the name of current client handle
func (*Mpv) CommandString ¶
func (*Mpv) CreateClient ¶
CreateClient creates a new client handle connected to the same player core as current client.
func (*Mpv) CreateWeakClient ¶
CreateWeakClient creates weak handle reference.
If all handles are weak references, core is automatically destroyed.
func (*Mpv) GetProperty ¶
func (*Mpv) GetPropertyAsync ¶
func (Mpv) HookContinue ¶
func (*Mpv) Initialize ¶
Initialize initializes uninitialized mpv instance
func (*Mpv) InternalTime ¶
InternalTime returns internal time in microseconds. This has an arbitrary start offset, but will never wrap or go backwards.
func (*Mpv) LoadConfig ¶
LoadConfig loads and parse provided file.
filename should be absolute path to file
func (*Mpv) ObserveProperty ¶
func (Mpv) RequestLogMessages ¶
func (*Mpv) SetOptionString ¶
func (*Mpv) SetProperty ¶
func (*Mpv) SetPropertyAsync ¶
func (*Mpv) SetPropertyString ¶
func (Mpv) SetWakeupCallback ¶
func (m Mpv) SetWakeupCallback()
func (*Mpv) Terminate ¶
func (m *Mpv) Terminate()
Terminate terminates the player and all clients, and waits until all of them are destroyed
func (Mpv) WaitAsyncRequests ¶
func (m Mpv) WaitAsyncRequests()