xmms2go

package module
v0.0.0-...-46aeec5 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2016 License: GPL-3.0 Imports: 7 Imported by: 0

README

XMMS2GO

GoDoc

A golang binding to libxmmsclient.

Notice

Yep, there is still lots of heavy work to do.

Such as C callback func and finally XmmsClient

There may not be useful

may be i will transfer this project to my group nonameplayer

Documentation

Overview

Package xmms2Go is a Go binding for libxmmsclient. It's easy to use and friendly for go developers. Just import me to use.

package main
import(
    "github.com/tonychee7000/xmms2go"
    "os"
    "fmt"
)

func main(){
    x := xmms2go.NewXmms2Client("test")
    err := x.Connect(os.Getenv("XMMS_PATH"))
    // According to the documents of xmms2, some resources
    // should be released. So Unref() is necessary.
    defer x.Unref()
    if err != nil {
        fmt.Println(err)
        os.Exit(1)
    }

    err := x.Play()
    if err != nil {
        fmt.Println(err)
    }
}

Index

Constants

View Source
const (
	IPCObjectSignal = iota
	IPCObjectMain
	IPCObjectPlaylist
	IPCObjectConfig
	IPCObjectPlayback
	IPCObjectMedialib
	IPCObjectCollection
	IPCObjectVisualization
	IPCObjectMediaInfoReader
	IPCObjectXform
	IPCObjectBindata
	IPCObjectCollSync
	IPCObjectCourier
	IPCObjectIPCManager
	IPCObjectEnd
)

IPC object type

View Source
const (
	IPCSignalPlaylistChanged = iota
	IPCSignalConfigValueChanged
	IPCSignalPlaybackStatus
	IPCSignalPlaybackVolumeChanged
	IPCSignalPlaybackPlaytime
	IPCSignalPlaybackCurrentID
	IPCSignalPlaylistCurrentPos
	IPCSignalPlaylistLoaded
	IPCSignalMedialibEntryAdded
	IPCSignalMedialibEntryUpdate
	IPCSignalMedialibEntryRemoved
	IPCSignalCollectionChanged
	IPCSignalQuit
	IPCSignalMediaInfoReaderStstus
	IPCSignalMediaInfoReaderUnindexed
	IPCSignalCourierMessage
	IPCSignalIPCManagerClientConnected
	IPCSignalIPCManagerClientDisconnected
	IPCSignalEnd
)

IPC signals

View Source
const (
	IPCCmdReply = iota
	IPCCmdError
)

IPC command reply

View Source
const (
	IPCCmdSignal = ipcCmdFirst + iota
	IPCCmdBroadcast
)

Signal subsystem methods

View Source
const (
	IPCCmdHello = ipcCmdFirst + iota
	IPCCmdQuit
	IPCCmdPluginList
	IPCCmdStats
)

Main methods

View Source
const (
	IPCCmdReplace = ipcCmdFirst + iota
	IPCCmdSetpOS
	IPCCmdSetpOSRel
	IPCCmdAddURL
	IPCCmdAddColl
	IPCCmdRemoveEntry
	IPCCmdMoveEntry
	IPCCmdList
	IPCCmdCurrentPos
	IPCCmdCurrentActive
	IPCCmdInsertURL
	IPCCmdInsertColl
	IPCCmdLoad
	IPCCmdRAdd
	IPCCmdRInsert
)

Playlist methods

View Source
const (
	IPCCmdGetValue = ipcCmdFirst + iota
	IPCCmdSetValue
	IPCCmdRegValue
	IPCCmdListValues
)

Config methods

View Source
const (
	IPCCmdStart = ipcCmdFirst + iota
	IPCCmdStop
	IPCCmdPausE
	IPCCmdDecoderKill
	IPCCmdCPlaytime
	IPCCmdSeekMS
	IPCCmdSeekSamples
	IPCCmdPlaybackStatus
	IPCCmdCurrentID
	IPCCmdVolumeSet
	IPCCmdVolumeGet
)

Playback methods

View Source
const (
	IPCCmdInfo = ipcCmdFirst + iota
	IPCCmdPathImport
	IPCCmdRehash
	IPCCmdGetID
	IPCCmdRemoveID
	IPCCmdPropertySetStr
	IPCCmdPropertySetInt
	IPCCmdPropertyRemove
	IPCCmdMoveURL
	IPCCmdMlibAddURL
)

Medialib methods

View Source
const (
	IPCCmdCollectionGet = ipcCmdFirst + iota
	IPCCmdCollectionList
	IPCCmdCollectionSave
	IPCCmdCollectionRemove
	IPCCmdCollectionFind
	IPCCmdCollectionRename
	IPCCmdQuery
	IPCCmdQueryInfos
	IPCCmdIDListFromPLS
)

Collection methods

View Source
const (
	IPCCmdGetData = ipcCmdFirst + iota
	IPCCmdAddData
	IPCCmdRemoveData
	IPCCmdListData
)

bindata methods

View Source
const (
	IPCCmdVisualizationQueryVersion = ipcCmdFirst + iota
	IPCCmdVisualizationRegister
	IPCCmdVisualizationInitSHM
	IPCCmdVisualizationInitUDP
	IPCCmdVisualizationProperty
	IPCCmdVisualizationProperties
	IPCCmdVisualizationShutdown
)

visualization methods

View Source
const (
	IPCCmdSendMessage = ipcCmdFirst + iota
	IPCCmdReplyMessage
	IPCCmdGetConnectedClients
)

courier methods

View Source
const (
	PlaylistChangedAdd = iota
	PlaylistChangedInsert
	PlaylistChangedShuffle /* deprecated */
	PlaylistChangedRemove
	PlaylistChangedClear /* deprecated */
	PlaylistChangedMove
	PlaylistChangedSort /* deprecated */
	PlaylistChangedUpdate
	PlaylistChangedReplace
)

Playlist changed events

View Source
const (
	CollectionChangedAdd = iota
	CollectionChangedUpdate
	CollectionChangedRename
	CollectionChangedRemove
)

Collection changed events

View Source
const (
	PlaylistCurrentIDForget = iota
	PlaylistCurrentIDKeep
	PlaylistCurrentIDMoveToFront
)

Playlist current ID methods

View Source
const (
	PlaybackStatusStop = iota
	PlaybackStatusPlay
	PlaybackStatusPause
)

Playback status

View Source
const (
	PlaybackSeekCur = 1 + iota
	PlaybackSeekSet
)

Playback seek

View Source
const (
	MediaInfoReaderStatusIdle = iota
	MediaInfoReaderStatusRunning
)

Media info reader status

View Source
const (
	PluginTypeAll = iota
	PluginTypeOutput
	PluginTypeXform
)

Plugin type

View Source
const (
	CollectionTypeReference = iota
	CollectionTypeUniverse
	CollectionTypeUnion
	CollectionTypeIntersection
	CollectionTypeComplement
	CollectionTypeHas
	CollectionTypeMatch
	CollectionTypeToken
	CollectionTypeEquals
	CollectionTypeNotEqual
	CollectionTypeSmaller
	CollectionTypeSmallerEQ
	CollectionTypeGreater
	CollectionTypeGreaterEQ
	CollectionTypeOrder
	CollectionTypeLimit
	CollectionTypeMediaset
	CollectionTypeIDList
	CollectionTypeLast = CollectionTypeIDList
)

Collection type

View Source
const (
	MedialibEntryStatusNew = iota
	MedialibEntryStatusOK
	MedialibEntryStatusResolving
	MedialibEntryStatusNotAvailable
	MedialibEntryStatusRehash
)

Medialib entry status

View Source
const (
	LogLevelUnknown = iota
	LogLevelFatal
	LogLevelFail
	LogLevelError
	LogLevelInfo
	LogLevelDebug
	LogLevelCount /* must be last */
)

Log level

View Source
const (
	C2CReplyPolicyNoReply = iota
	C2CReplyPolicySingleReply
	C2CReplyPolicyMultiReply
)

C2C reply policy

View Source
const (
	ErrorNone = iota
	ErrorGeneric
	ErrorOOM
	ErrorPermission
	ErrorNoEntry
	ErrorInval
	ErrorNoSausage
	ErrorCount /* must be last */
)

Error type

View Source
const (
	ResultClassDefault = iota
	ResultClassSignal
	ResultClassBroadcast
)
View Source
const (
	TypeNone = iota
	TypeError
	TypeInt64
	TypeString
	TypeColl
	TypeBin
	TypeList
	TypeDict
	TypeBitBuffer
	TypeFloat
	TypeEnd
)

Value type, INT32 is same to INT64

View Source
const (
	IPCCmdBrowse = ipcCmdFirst + iota
)

xform methods

View Source
const (
	IPCCmdCollSyncSync = ipcCmdFirst + iota
)

Coll sync methods

View Source
const TypeInt32 = TypeInt64

In 32bit system.

Variables

This section is empty.

Functions

func GetUserConfDir

func GetUserConfDir(b []byte) string

Types

type BitBuffer

type BitBuffer interface {
	ValueNone
	GetBits(bits int) (int64, error)
	GetData(length int) ([]byte, error)
	PutBits(bits int, data int64) error
	PutBitsAt(bits int, data int64, offset int) error
	PutData(b []byte) error
	Align() error
	Goto(pos int) error
	Pos() int
	Rewind() error
	End() error
	Len() int
	GetBuffer() ([]byte, error)
}

Use this BitBuffer interface to avoid native value methods.

func NewBitBuffer

func NewBitBuffer() BitBuffer

type BitBufferReadonly

type BitBufferReadonly interface {
	ValueNone
	GetBits(bits int) (int64, error)
	GetData(length int) ([]byte, error)
	Goto(pos int) error
	Pos() int
	Rewind() error
	End() error
	Len() int
	GetBuffer() ([]byte, error)
}

func NewBitBufferReadonly

func NewBitBufferReadonly(v []byte, length int) BitBufferReadonly

type Collection

type Collection interface {
	ValueNone
	SetIDList(ids []int)
	AddOperand(val *Value)
	RemoveOperand(val *Value)
	GetOperands() *Value
	SetOperands(val *Value)
	IDListAppend(id int) error
	IDListInsert(index int, id int) error
	IDListMove(_old int, _new int) error
	IDListRemove(index int) error
	IDListClear() error
	IDListGetIndexInt32(index int) (int32, error)
	IDListGetIndexInt64(index int) (int64, error)
	IDListSetIndexInt32(index int, val int32) error
	IDListSetIndexInt64(index int, val int64) error
	IDListGetSize() int
	IsType(_type int) bool
	GetType() int
	IDListGet() *Value
	IDListSet(idlist *Value)
	AttributeSetString(key string, val string)
	AttributeSetInt32(key string, val int32)
	AttributeSetInt64(key string, val int64)
	AttributeSetValue(key string, val *Value)
	AttributeRemove(key string) error
	AttributeGetString(key string) (string, error)
	AttributeGetInt32(key string) (int32, error)
	AttributeGetInt64(key string) (int64, error)
	AttributeGetValue(key string) (*Value, error)
	AttributesGet() *Value
	AttributesSet(val *Value)
	AddOrderOperator(order *Value) Collection
	AddOrderOperators(order *Value) Collection
	AddLimitOperator(start int, length int) Collection
}

func NewCollection

func NewCollection(_type int) Collection

type Connector

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

func NewConnector

func NewConnector(clientName string) (*Connector, error)

func (*Connector) BroadCastQuit

func (c *Connector) BroadCastQuit() *Result

func (*Connector) Connect

func (c *Connector) Connect(url string) error

func (*Connector) DisconnectCallBackSet

func (c *Connector) DisconnectCallBackSet(
	disconnectfunc DisconnectFunc,
	userdata interface{},
)

When use this in parallel, a lock is needed.

func (*Connector) DisconnectCallBackSetFull

func (c *Connector) DisconnectCallBackSetFull(
	disconnectfunc DisconnectFunc,
	userdata interface{},
	userdatafreefunc UserDataFreeFunc,
)

When use this in parallel, a lock is needed.

func (*Connector) GetLastError

func (c *Connector) GetLastError() error

func (*Connector) IODisconnect

func (c *Connector) IODisconnect()

func (*Connector) IOFdGet

func (c *Connector) IOFdGet() error

func (*Connector) IOInHandle

func (c *Connector) IOInHandle() error

func (*Connector) IONeedOutCallbackSet

func (c *Connector) IONeedOutCallbackSet(
	ioneedoutcallback IONeedOutCallbackFunc,
	userdata interface{},
)

When use this in parallel, a lock is needed.

func (*Connector) IONeedOutCallbackSetFull

func (c *Connector) IONeedOutCallbackSetFull(
	ioneedoutcallback IONeedOutCallbackFunc,
	userdata interface{},
	userdatafreefunc UserDataFreeFunc,
)

When use this in parallel, a lock is needed.

func (*Connector) IOOutHandle

func (c *Connector) IOOutHandle() error

func (*Connector) IOWantOut

func (c *Connector) IOWantOut() error

func (*Connector) LockSet

func (c *Connector) LockSet(
	lock interface{},
	lockfunc LockFunc,
	unlockfunc UnlockFunc,
)

Actually, Use native sync.Mutex is better

func (*Connector) Quit

func (c *Connector) Quit() *Result

func (*Connector) UnRef

func (c *Connector) UnRef()

type Dict

type Dict interface {
	ValueNone
	Get(key string) (*Value, error)
	Set(key string, val *Value) error
	Remove(key string) error
	Clear() error
	GetSize() int
	HasKey(key string) bool

	GetString(key string) (string, error)
	GetInt32(key string) (int32, error)
	GetInt64(key string) (int64, error)
	GetFloat32(key string) (float32, error)
	GetFloat64(key string) (float64, error)

	SetString(key string, val string) error
	SetInt64(key string, val int64) error
	SetInt32(key string, val int32) error
	SetFloat64(key string, val float64) error
	SetFloat32(key string, val float32) error

	GetType(key string) int
	FromMap(val map[string]interface{}) error
	ToMap() (map[string]interface{}, error)
}

func NewDict

func NewDict() Dict

type DictIter

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

func NewDictIter

func NewDictIter(val Dict) (*DictIter, error)

func (*DictIter) Destroy

func (i *DictIter) Destroy()

func (*DictIter) Find

func (i *DictIter) Find(key string) error

func (*DictIter) First

func (i *DictIter) First()

func (*DictIter) GetFloat32

func (i *DictIter) GetFloat32() (string, float32, error)

func (*DictIter) GetFloat64

func (i *DictIter) GetFloat64() (string, float64, error)

func (*DictIter) Next

func (i *DictIter) Next()

func (*DictIter) Pair

func (i *DictIter) Pair() (string, *Value, error)

func (*DictIter) PairInt32

func (i *DictIter) PairInt32() (string, int32, error)

func (*DictIter) PairInt64

func (i *DictIter) PairInt64() (string, int64, error)

func (*DictIter) PairString

func (i *DictIter) PairString() (string, string, error)

func (*DictIter) Remove

func (i *DictIter) Remove() error

func (*DictIter) Set

func (i *DictIter) Set(val *Value) error

func (*DictIter) SetFloat32

func (i *DictIter) SetFloat32(val float32) error

func (*DictIter) SetFloat64

func (i *DictIter) SetFloat64(val float64) error

func (*DictIter) SetInt32

func (i *DictIter) SetInt32(val int32) error

func (*DictIter) SetInt64

func (i *DictIter) SetInt64(val int64) error

func (*DictIter) SetString

func (i *DictIter) SetString(s string) error

func (*DictIter) Valid

func (i *DictIter) Valid() bool

type DisconnectFunc

type DisconnectFunc func(interface{})

DisconnectFunc means origin

typedef void (*xmmsc_disconnect_func_t) (void *user_data);

To convert interface{} to a struct, use:

foo := (*Foo)(v.(unsafe.Pointer))

type IONeedOutCallbackFunc

type IONeedOutCallbackFunc func(int, interface{})

IONeedOutCallbackFunc means origin

typedef void (*xmmsc_io_need_out_call_back_func_t) (int, void*);

To convert interface{} to a struct, use:

foo := (*Foo)(v.(unsafe.Pointer))

type List

type List interface {
	ValueNone
	Append(val *Value) error
	AppendFloat32(val float32) error
	AppendFloat64(val float64) error
	AppendInt32(val int32) error
	AppendInt64(val int64) error
	AppendString(val string) error
	Clear() error
	Flatten(dep int) List
	FromSlice(s []interface{}) error
	Get(pos int) (*Value, error)
	GetFloat32(pos int) (float32, error)
	GetFloat64(pos int) (float64, error)
	GetInt32(pos int) (int32, error)
	GetInt64(pos int) (int64, error)
	GetSize() int
	GetString(pos int) (string, error)
	GetType() (int, error)
	HasType(_type int) bool
	IndexOf(val *Value) int
	Insert(pos int, val *Value) error
	InsertFloat32(pos int, val float32) error
	InsertFloat64(pos int, val float64) error
	InsertInt32(pos int, val int32) error
	InsertInt64(pos int, val int64) error
	InsertString(pos int, val string) error
	Move(posOld int, posNew int) error
	Remove(pos int) error
	RestrictType(_type int) error
	Set(pos int, val *Value) error
	SetFloat32(pos int, val float32) error
	SetFloat64(pos int, val float64) error
	SetInt32(pos int, val int32) error
	SetInt64(pos int, val int64) error
	SetString(pos int, val string) error
	Sort(f ListCompareFunc) error
	ToSlice() ([]interface{}, error)
}

Use this List interface to avoid native Value methods.

func NewList

func NewList() List

type ListCompareFunc

type ListCompareFunc func(*Value, *Value) int

ListCompareFunc means origin

typedef int (*xmmsv_list_compare_func_t)(xmmsv_t **, xmmsv_t **);

type ListIter

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

ListIter is cursor to List

func NewListIter

func NewListIter(val List) (*ListIter, error)

Get a new list iter

func (*ListIter) Destroy

func (l *ListIter) Destroy()

func (*ListIter) Entry

func (l *ListIter) Entry() (*Value, error)

func (*ListIter) EntryFloat32

func (l *ListIter) EntryFloat32() (float32, error)

func (*ListIter) EntryFloat64

func (l *ListIter) EntryFloat64() (float64, error)

func (*ListIter) EntryInt32

func (l *ListIter) EntryInt32() (int32, error)

func (*ListIter) EntryInt64

func (l *ListIter) EntryInt64() (int64, error)

func (*ListIter) EntryString

func (l *ListIter) EntryString() (string, error)

func (*ListIter) First

func (l *ListIter) First()

Point to the first element

func (*ListIter) GetParent

func (l *ListIter) GetParent() *Value

func (*ListIter) Insert

func (l *ListIter) Insert(val *Value) error

func (*ListIter) InsertFloat32

func (l *ListIter) InsertFloat32(f float32) error

func (*ListIter) InsertFloat64

func (l *ListIter) InsertFloat64(f float64) error

func (*ListIter) InsertInt32

func (l *ListIter) InsertInt32(i int32) error

func (*ListIter) InsertInt64

func (l *ListIter) InsertInt64(i int64) error

func (*ListIter) InsertString

func (l *ListIter) InsertString(s string) error

func (*ListIter) Last

func (l *ListIter) Last()

Point to the last element

func (*ListIter) Next

func (l *ListIter) Next()

Point to the next element

func (*ListIter) Prev

func (l *ListIter) Prev()

Point to the previous element

func (*ListIter) Remove

func (l *ListIter) Remove() error

func (*ListIter) Seek

func (l *ListIter) Seek(pos int) error

Goto positon.

func (*ListIter) Set

func (l *ListIter) Set(val *Value) error

func (*ListIter) Tell

func (l *ListIter) Tell() int

Tell the position of the ListIter

func (*ListIter) Valid

func (l *ListIter) Valid() bool

type LockFunc

type LockFunc func(interface{})

LockFunc means origin

void (*lockfunc)(void *)

at xmms_client.h: 50

type Result

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

func NewResult

func NewResult() *Result

func (*Result) Disconnect

func (r *Result) Disconnect()

func (*Result) GetClass

func (r *Result) GetClass() int

func (*Result) GetValue

func (r *Result) GetValue() *Value

func (*Result) NotifierSetC2C

func (r *Result) NotifierSetC2C()

Dummy

func (*Result) NotifierSetC2CFull

func (r *Result) NotifierSetC2CFull()

Dummy

func (*Result) NotifierSetDefault

func (r *Result) NotifierSetDefault()

Dummy

func (*Result) NotifierSetDefaultFull

func (r *Result) NotifierSetDefaultFull()

Dummy

func (*Result) NotifierSetRaw

func (r *Result) NotifierSetRaw()

Dummy

func (*Result) NotifierSetRawFull

func (r *Result) NotifierSetRawFull()

Dummy

func (*Result) UnRef

func (r *Result) UnRef()

func (*Result) Wait

func (r *Result) Wait()

type UnlockFunc

type UnlockFunc func(interface{})

UnlockFunc means origin

void (*unlockfunc)(void *)

at xmms_client.h: 50

type UserDataFreeFunc

type UserDataFreeFunc func(interface{})

UserDataFreeFunc means origin

typedef void (*xmmsc_user_data_free_func_t) (void *user_data);

To convert interface{} to a struct, use:

foo := (*Foo)(v.(unsafe.Pointer))

type Value

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

*C.xmmsv_t

func NewValueFromCopyValue

func NewValueFromCopyValue(v *Value) *Value

func NewValueFromRef

func NewValueFromRef(v *Value) *Value

func (*Value) GetAny

func (x *Value) GetAny() (interface{}, error)

func (*Value) GetBitBuffer

func (x *Value) GetBitBuffer() (BitBuffer, error)

func (*Value) GetBytes

func (x *Value) GetBytes() ([]byte, error)

func (*Value) GetCollection

func (x *Value) GetCollection() (Collection, error)

func (*Value) GetDict

func (x *Value) GetDict() (Dict, error)

func (*Value) GetError

func (x *Value) GetError() (error, error)

func (*Value) GetFloat32

func (x *Value) GetFloat32() (float32, error)

func (*Value) GetFloat64

func (x *Value) GetFloat64() (float64, error)

func (*Value) GetInt32

func (x *Value) GetInt32() (int32, error)

func (*Value) GetInt64

func (x *Value) GetInt64() (int64, error)

func (*Value) GetList

func (x *Value) GetList() (List, error)

func (*Value) GetString

func (x *Value) GetString() (string, error)

func (*Value) GetType

func (x *Value) GetType() int

func (*Value) IsError

func (x *Value) IsError() bool

func (*Value) IsType

func (x *Value) IsType(t int) bool

func (*Value) ToValue

func (x *Value) ToValue() *Value

func (*Value) Unref

func (x *Value) Unref()

type ValueAny

type ValueAny interface {
	ValueNone
	GetAny() (interface{}, error)
}

func NewValueFromAny

func NewValueFromAny(any interface{}) ValueAny

Since Go 1.6, some Go pointer based type (like map[int]) may cause cgo panic. So return ValueNone.

type ValueBytes

type ValueBytes interface {
	ValueNone
	GetBytes() ([]byte, error)
}

func NewValueFromBytes

func NewValueFromBytes(b []byte) ValueBytes

type ValueError

type ValueError interface {
	ValueNone
	IsError() bool
	GetError() (error, error)
}

func NewValueFromError

func NewValueFromError(e error) ValueError

type ValueFloat32

type ValueFloat32 interface {
	ValueNone
	GetFloat32() (float32, error)
}

func NewValueFromFloat32

func NewValueFromFloat32(f float32) ValueFloat32

type ValueFloat64

type ValueFloat64 interface {
	ValueNone
	GetFloat64() (float64, error)
}

func NewValueFromFloat64

func NewValueFromFloat64(f float64) ValueFloat64

type ValueInt32

type ValueInt32 interface {
	ValueNone
	GetInt32() (int32, error)
}

func NewValueFromInt32

func NewValueFromInt32(i int32) ValueInt32

type ValueInt64

type ValueInt64 interface {
	ValueNone
	GetInt64() (int64, error)
}

func NewValueFromInt64

func NewValueFromInt64(i int64) ValueInt64

type ValueNone

type ValueNone interface {
	Unref()
	ToValue() *Value
	// contains filtered or unexported methods
}

func NewValueFromNone

func NewValueFromNone() ValueNone

type ValueString

type ValueString interface {
	ValueNone
	GetString() (string, error)
}

func NewValueFromString

func NewValueFromString(s string) ValueString

type Xmms2Client

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

A class of xmmsclient

func NewXmms2Client

func NewXmms2Client(clientName string) (*Xmms2Client, error)

Make new xmmsclient instance.

func (*Xmms2Client) Connect

func (x *Xmms2Client) Connect(url string) error

Connect to xmms server, both tcp or unix socket are works.

x = NewXmms2Client("test")
x.Connect("unix://somewhere")
x.Connect("tcp://somewhere")

func (*Xmms2Client) CurrentID

func (x *Xmms2Client) CurrentID() (int, error)

Get Current ID. If failed, return -1 and error info

func (*Xmms2Client) MediaLibInfo

func (x *Xmms2Client) MediaLibInfo(id int) (map[string]interface{}, error)

Get medialib info

func (*Xmms2Client) Pause

func (x *Xmms2Client) Pause() error

Pause playback.

func (*Xmms2Client) Play

func (x *Xmms2Client) Play() error

Start playback.

func (*Xmms2Client) ResultUnref

func (x *Xmms2Client) ResultUnref()

Every operation is done, clear memeory is needed.

func (*Xmms2Client) Stop

func (x *Xmms2Client) Stop() error

Stop playback.

func (*Xmms2Client) Tickle

func (x *Xmms2Client) Tickle() error

Stop decoding of current song.

func (*Xmms2Client) Unref

func (x *Xmms2Client) Unref()

You SHOULD use this when you quit.

x := NewXmms2Client("test")
x.Connect("somewhere")
defer x.Unref()
defer x.ResultUnref()
os.Exit(0)

Jump to

Keyboard shortcuts

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