/*This file is automatically generated by pkg.deepin.io/dbus-generator. Don't edit it*/
package mpris

import "pkg.deepin.io/lib/dbus"
import "pkg.deepin.io/lib/dbus/property"
import "reflect"
import "sync"
import "runtime"
import "fmt"
import "errors"

/*prevent compile error*/
var _ = fmt.Println
var _ = runtime.SetFinalizer
var _ = sync.NewCond
var _ = reflect.TypeOf
var _ = property.BaseObserver{}

type Player struct {
	Path     dbus.ObjectPath
	DestName string
	core     *dbus.Object

	signals       map[<-chan *dbus.Signal]struct{}
	signalsLocker sync.Mutex

	PlaybackStatus *dbusPropertyPlayerPlaybackStatus
	LoopStatus     *dbusPropertyPlayerLoopStatus
	Rate           *dbusPropertyPlayerRate
	Shuffle        *dbusPropertyPlayerShuffle
	Metadata       *dbusPropertyPlayerMetadata
	Volume         *dbusPropertyPlayerVolume
	Position       *dbusPropertyPlayerPosition
	MinimumRate    *dbusPropertyPlayerMinimumRate
	MaximumRate    *dbusPropertyPlayerMaximumRate
	CanGoNext      *dbusPropertyPlayerCanGoNext
	CanGoPrevious  *dbusPropertyPlayerCanGoPrevious
	CanPlay        *dbusPropertyPlayerCanPlay
	CanPause       *dbusPropertyPlayerCanPause
	CanSeek        *dbusPropertyPlayerCanSeek
	CanControl     *dbusPropertyPlayerCanControl
}

func (obj *Player) _createSignalChan() <-chan *dbus.Signal {
	obj.signalsLocker.Lock()
	ch := getBus().Signal()
	obj.signals[ch] = struct{}{}
	obj.signalsLocker.Unlock()
	return ch
}
func (obj *Player) _deleteSignalChan(ch <-chan *dbus.Signal) {
	obj.signalsLocker.Lock()
	delete(obj.signals, ch)
	getBus().DetachSignal(ch)
	obj.signalsLocker.Unlock()
}
func DestroyPlayer(obj *Player) {
	obj.signalsLocker.Lock()
	defer obj.signalsLocker.Unlock()
	if obj.signals == nil {
		return
	}
	for ch, _ := range obj.signals {
		getBus().DetachSignal(ch)
	}
	obj.signals = nil

	runtime.SetFinalizer(obj, nil)

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='org.freedesktop.DBus.Properties',sender='" + obj.DestName + "',member='PropertiesChanged'")
	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='org.mpris.MediaPlayer2.Player',sender='" + obj.DestName + "',member='PropertiesChanged'")

	dbusRemoveMatch("type='signal',path='" + string(obj.Path) + "',interface='org.mpris.MediaPlayer2.Player',sender='" + obj.DestName + "',member='Seeked'")

	obj.PlaybackStatus.Reset()
	obj.LoopStatus.Reset()
	obj.Rate.Reset()
	obj.Shuffle.Reset()
	obj.Metadata.Reset()
	obj.Volume.Reset()
	obj.Position.Reset()
	obj.MinimumRate.Reset()
	obj.MaximumRate.Reset()
	obj.CanGoNext.Reset()
	obj.CanGoPrevious.Reset()
	obj.CanPlay.Reset()
	obj.CanPause.Reset()
	obj.CanSeek.Reset()
	obj.CanControl.Reset()
}

func (obj *Player) Next() (_err error) {
	_err = obj.core.Call("org.mpris.MediaPlayer2.Player.Next", 0).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Player) Previous() (_err error) {
	_err = obj.core.Call("org.mpris.MediaPlayer2.Player.Previous", 0).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Player) Pause() (_err error) {
	_err = obj.core.Call("org.mpris.MediaPlayer2.Player.Pause", 0).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Player) PlayPause() (_err error) {
	_err = obj.core.Call("org.mpris.MediaPlayer2.Player.PlayPause", 0).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Player) Stop() (_err error) {
	_err = obj.core.Call("org.mpris.MediaPlayer2.Player.Stop", 0).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Player) Play() (_err error) {
	_err = obj.core.Call("org.mpris.MediaPlayer2.Player.Play", 0).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Player) Seek(Offset int64) (_err error) {
	_err = obj.core.Call("org.mpris.MediaPlayer2.Player.Seek", 0, Offset).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Player) SetPosition(TrackId dbus.ObjectPath, Position int64) (_err error) {
	_err = obj.core.Call("org.mpris.MediaPlayer2.Player.SetPosition", 0, TrackId, Position).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Player) OpenUri(Uri string) (_err error) {
	_err = obj.core.Call("org.mpris.MediaPlayer2.Player.OpenUri", 0, Uri).Store()
	if _err != nil {
		fmt.Println(_err)
	}
	return
}

func (obj *Player) ConnectSeeked(callback func(Position int64)) func() {
	sigChan := obj._createSignalChan()
	go func() {
		for v := range sigChan {
			if v.Path != obj.Path || v.Name != "org.mpris.MediaPlayer2.Player.Seeked" || 1 != len(v.Body) {
				continue
			}
			if reflect.TypeOf(v.Body[0]) != reflect.TypeOf((*int64)(nil)).Elem() {
				continue
			}

			callback(v.Body[0].(int64))
		}
	}()
	return func() {
		obj._deleteSignalChan(sigChan)
	}
}

type dbusPropertyPlayerPlaybackStatus struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyPlayerPlaybackStatus) SetValue(notwritable interface{}) {
	fmt.Println("org.mpris.MediaPlayer2.Player.PlaybackStatus is not writable")
}

func (this *dbusPropertyPlayerPlaybackStatus) Get() string {
	v, _ := this.GetValue()
	return v.(string)
}
func (this *dbusPropertyPlayerPlaybackStatus) GetValue() (interface{} /*string*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.mpris.MediaPlayer2.Player", "PlaybackStatus").Store(&r)
	if err == nil && r.Signature().String() == "s" {
		return r.Value().(string), nil
	}
	return *new(string), err
}
func (this *dbusPropertyPlayerPlaybackStatus) GetType() reflect.Type {
	return reflect.TypeOf((*string)(nil)).Elem()
}

type dbusPropertyPlayerLoopStatus struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyPlayerLoopStatus) SetValue(v interface{} /*string*/) {
	if reflect.TypeOf(v) == reflect.TypeOf((*string)(nil)).Elem() {
		this.core.Call("org.freedesktop.DBus.Properties.Set", 0, "org.mpris.MediaPlayer2.Player", "LoopStatus", dbus.MakeVariant(v))
	} else {
		fmt.Println("The property LoopStatus of org.mpris.MediaPlayer2.Player is an string but Set with an ", reflect.TypeOf(v))
	}
}
func (this *dbusPropertyPlayerLoopStatus) Set(v string) {
	this.SetValue(v)
}

func (this *dbusPropertyPlayerLoopStatus) Get() string {
	v, _ := this.GetValue()
	return v.(string)
}
func (this *dbusPropertyPlayerLoopStatus) GetValue() (interface{} /*string*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.mpris.MediaPlayer2.Player", "LoopStatus").Store(&r)
	if err == nil && r.Signature().String() == "s" {
		return r.Value().(string), nil
	}
	return *new(string), err
}
func (this *dbusPropertyPlayerLoopStatus) GetType() reflect.Type {
	return reflect.TypeOf((*string)(nil)).Elem()
}

type dbusPropertyPlayerRate struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyPlayerRate) SetValue(v interface{} /*float64*/) {
	if reflect.TypeOf(v) == reflect.TypeOf((*float64)(nil)).Elem() {
		this.core.Call("org.freedesktop.DBus.Properties.Set", 0, "org.mpris.MediaPlayer2.Player", "Rate", dbus.MakeVariant(v))
	} else {
		fmt.Println("The property Rate of org.mpris.MediaPlayer2.Player is an float64 but Set with an ", reflect.TypeOf(v))
	}
}
func (this *dbusPropertyPlayerRate) Set(v float64) {
	this.SetValue(v)
}

func (this *dbusPropertyPlayerRate) Get() float64 {
	v, _ := this.GetValue()
	return v.(float64)
}
func (this *dbusPropertyPlayerRate) GetValue() (interface{} /*float64*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.mpris.MediaPlayer2.Player", "Rate").Store(&r)
	if err == nil && r.Signature().String() == "d" {
		return r.Value().(float64), nil
	}
	return *new(float64), err
}
func (this *dbusPropertyPlayerRate) GetType() reflect.Type {
	return reflect.TypeOf((*float64)(nil)).Elem()
}

type dbusPropertyPlayerShuffle struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyPlayerShuffle) SetValue(v interface{} /*bool*/) {
	if reflect.TypeOf(v) == reflect.TypeOf((*bool)(nil)).Elem() {
		this.core.Call("org.freedesktop.DBus.Properties.Set", 0, "org.mpris.MediaPlayer2.Player", "Shuffle", dbus.MakeVariant(v))
	} else {
		fmt.Println("The property Shuffle of org.mpris.MediaPlayer2.Player is an bool but Set with an ", reflect.TypeOf(v))
	}
}
func (this *dbusPropertyPlayerShuffle) Set(v bool) {
	this.SetValue(v)
}

func (this *dbusPropertyPlayerShuffle) Get() bool {
	v, _ := this.GetValue()
	return v.(bool)
}
func (this *dbusPropertyPlayerShuffle) GetValue() (interface{} /*bool*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.mpris.MediaPlayer2.Player", "Shuffle").Store(&r)
	if err == nil && r.Signature().String() == "b" {
		return r.Value().(bool), nil
	}
	return *new(bool), err
}
func (this *dbusPropertyPlayerShuffle) GetType() reflect.Type {
	return reflect.TypeOf((*bool)(nil)).Elem()
}

type dbusPropertyPlayerMetadata struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyPlayerMetadata) SetValue(notwritable interface{}) {
	fmt.Println("org.mpris.MediaPlayer2.Player.Metadata is not writable")
}

func (this *dbusPropertyPlayerMetadata) Get() map[string]dbus.Variant {
	v, _ := this.GetValue()
	return v.(map[string]dbus.Variant)
}
func (this *dbusPropertyPlayerMetadata) GetValue() (interface{} /*map[string]dbus.Variant*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.mpris.MediaPlayer2.Player", "Metadata").Store(&r)
	if err == nil && r.Signature().String() == "a{sv}" {
		return r.Value().(map[string]dbus.Variant), nil
	}
	return *new(map[string]dbus.Variant), err
}
func (this *dbusPropertyPlayerMetadata) GetType() reflect.Type {
	return reflect.TypeOf((*map[string]dbus.Variant)(nil)).Elem()
}

type dbusPropertyPlayerVolume struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyPlayerVolume) SetValue(v interface{} /*float64*/) {
	if reflect.TypeOf(v) == reflect.TypeOf((*float64)(nil)).Elem() {
		this.core.Call("org.freedesktop.DBus.Properties.Set", 0, "org.mpris.MediaPlayer2.Player", "Volume", dbus.MakeVariant(v))
	} else {
		fmt.Println("The property Volume of org.mpris.MediaPlayer2.Player is an float64 but Set with an ", reflect.TypeOf(v))
	}
}
func (this *dbusPropertyPlayerVolume) Set(v float64) {
	this.SetValue(v)
}

func (this *dbusPropertyPlayerVolume) Get() float64 {
	v, _ := this.GetValue()
	return v.(float64)
}
func (this *dbusPropertyPlayerVolume) GetValue() (interface{} /*float64*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.mpris.MediaPlayer2.Player", "Volume").Store(&r)
	if err == nil && r.Signature().String() == "d" {
		return r.Value().(float64), nil
	}
	return *new(float64), err
}
func (this *dbusPropertyPlayerVolume) GetType() reflect.Type {
	return reflect.TypeOf((*float64)(nil)).Elem()
}

type dbusPropertyPlayerPosition struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyPlayerPosition) SetValue(notwritable interface{}) {
	fmt.Println("org.mpris.MediaPlayer2.Player.Position is not writable")
}

func (this *dbusPropertyPlayerPosition) Get() int64 {
	v, _ := this.GetValue()
	return v.(int64)
}
func (this *dbusPropertyPlayerPosition) GetValue() (interface{} /*int64*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.mpris.MediaPlayer2.Player", "Position").Store(&r)
	if err == nil && r.Signature().String() == "x" {
		return r.Value().(int64), nil
	}
	return *new(int64), err
}
func (this *dbusPropertyPlayerPosition) GetType() reflect.Type {
	return reflect.TypeOf((*int64)(nil)).Elem()
}

type dbusPropertyPlayerMinimumRate struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyPlayerMinimumRate) SetValue(notwritable interface{}) {
	fmt.Println("org.mpris.MediaPlayer2.Player.MinimumRate is not writable")
}

func (this *dbusPropertyPlayerMinimumRate) Get() float64 {
	v, _ := this.GetValue()
	return v.(float64)
}
func (this *dbusPropertyPlayerMinimumRate) GetValue() (interface{} /*float64*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.mpris.MediaPlayer2.Player", "MinimumRate").Store(&r)
	if err == nil && r.Signature().String() == "d" {
		return r.Value().(float64), nil
	}
	return *new(float64), err
}
func (this *dbusPropertyPlayerMinimumRate) GetType() reflect.Type {
	return reflect.TypeOf((*float64)(nil)).Elem()
}

type dbusPropertyPlayerMaximumRate struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyPlayerMaximumRate) SetValue(notwritable interface{}) {
	fmt.Println("org.mpris.MediaPlayer2.Player.MaximumRate is not writable")
}

func (this *dbusPropertyPlayerMaximumRate) Get() float64 {
	v, _ := this.GetValue()
	return v.(float64)
}
func (this *dbusPropertyPlayerMaximumRate) GetValue() (interface{} /*float64*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.mpris.MediaPlayer2.Player", "MaximumRate").Store(&r)
	if err == nil && r.Signature().String() == "d" {
		return r.Value().(float64), nil
	}
	return *new(float64), err
}
func (this *dbusPropertyPlayerMaximumRate) GetType() reflect.Type {
	return reflect.TypeOf((*float64)(nil)).Elem()
}

type dbusPropertyPlayerCanGoNext struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyPlayerCanGoNext) SetValue(notwritable interface{}) {
	fmt.Println("org.mpris.MediaPlayer2.Player.CanGoNext is not writable")
}

func (this *dbusPropertyPlayerCanGoNext) Get() bool {
	v, _ := this.GetValue()
	return v.(bool)
}
func (this *dbusPropertyPlayerCanGoNext) GetValue() (interface{} /*bool*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.mpris.MediaPlayer2.Player", "CanGoNext").Store(&r)
	if err == nil && r.Signature().String() == "b" {
		return r.Value().(bool), nil
	}
	return *new(bool), err
}
func (this *dbusPropertyPlayerCanGoNext) GetType() reflect.Type {
	return reflect.TypeOf((*bool)(nil)).Elem()
}

type dbusPropertyPlayerCanGoPrevious struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyPlayerCanGoPrevious) SetValue(notwritable interface{}) {
	fmt.Println("org.mpris.MediaPlayer2.Player.CanGoPrevious is not writable")
}

func (this *dbusPropertyPlayerCanGoPrevious) Get() bool {
	v, _ := this.GetValue()
	return v.(bool)
}
func (this *dbusPropertyPlayerCanGoPrevious) GetValue() (interface{} /*bool*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.mpris.MediaPlayer2.Player", "CanGoPrevious").Store(&r)
	if err == nil && r.Signature().String() == "b" {
		return r.Value().(bool), nil
	}
	return *new(bool), err
}
func (this *dbusPropertyPlayerCanGoPrevious) GetType() reflect.Type {
	return reflect.TypeOf((*bool)(nil)).Elem()
}

type dbusPropertyPlayerCanPlay struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyPlayerCanPlay) SetValue(notwritable interface{}) {
	fmt.Println("org.mpris.MediaPlayer2.Player.CanPlay is not writable")
}

func (this *dbusPropertyPlayerCanPlay) Get() bool {
	v, _ := this.GetValue()
	return v.(bool)
}
func (this *dbusPropertyPlayerCanPlay) GetValue() (interface{} /*bool*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.mpris.MediaPlayer2.Player", "CanPlay").Store(&r)
	if err == nil && r.Signature().String() == "b" {
		return r.Value().(bool), nil
	}
	return *new(bool), err
}
func (this *dbusPropertyPlayerCanPlay) GetType() reflect.Type {
	return reflect.TypeOf((*bool)(nil)).Elem()
}

type dbusPropertyPlayerCanPause struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyPlayerCanPause) SetValue(notwritable interface{}) {
	fmt.Println("org.mpris.MediaPlayer2.Player.CanPause is not writable")
}

func (this *dbusPropertyPlayerCanPause) Get() bool {
	v, _ := this.GetValue()
	return v.(bool)
}
func (this *dbusPropertyPlayerCanPause) GetValue() (interface{} /*bool*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.mpris.MediaPlayer2.Player", "CanPause").Store(&r)
	if err == nil && r.Signature().String() == "b" {
		return r.Value().(bool), nil
	}
	return *new(bool), err
}
func (this *dbusPropertyPlayerCanPause) GetType() reflect.Type {
	return reflect.TypeOf((*bool)(nil)).Elem()
}

type dbusPropertyPlayerCanSeek struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyPlayerCanSeek) SetValue(notwritable interface{}) {
	fmt.Println("org.mpris.MediaPlayer2.Player.CanSeek is not writable")
}

func (this *dbusPropertyPlayerCanSeek) Get() bool {
	v, _ := this.GetValue()
	return v.(bool)
}
func (this *dbusPropertyPlayerCanSeek) GetValue() (interface{} /*bool*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.mpris.MediaPlayer2.Player", "CanSeek").Store(&r)
	if err == nil && r.Signature().String() == "b" {
		return r.Value().(bool), nil
	}
	return *new(bool), err
}
func (this *dbusPropertyPlayerCanSeek) GetType() reflect.Type {
	return reflect.TypeOf((*bool)(nil)).Elem()
}

type dbusPropertyPlayerCanControl struct {
	*property.BaseObserver
	core *dbus.Object
}

func (this *dbusPropertyPlayerCanControl) SetValue(notwritable interface{}) {
	fmt.Println("org.mpris.MediaPlayer2.Player.CanControl is not writable")
}

func (this *dbusPropertyPlayerCanControl) Get() bool {
	v, _ := this.GetValue()
	return v.(bool)
}
func (this *dbusPropertyPlayerCanControl) GetValue() (interface{} /*bool*/, error) {
	var r dbus.Variant
	err := this.core.Call("org.freedesktop.DBus.Properties.Get", 0, "org.mpris.MediaPlayer2.Player", "CanControl").Store(&r)
	if err == nil && r.Signature().String() == "b" {
		return r.Value().(bool), nil
	}
	return *new(bool), err
}
func (this *dbusPropertyPlayerCanControl) GetType() reflect.Type {
	return reflect.TypeOf((*bool)(nil)).Elem()
}

func NewPlayer(destName string, path dbus.ObjectPath) (*Player, error) {
	if !path.IsValid() {
		return nil, errors.New("The path of '" + string(path) + "' is invalid.")
	}

	core := getBus().Object(destName, path)

	obj := &Player{Path: path, DestName: destName, core: core, signals: make(map[<-chan *dbus.Signal]struct{})}

	obj.PlaybackStatus = &dbusPropertyPlayerPlaybackStatus{&property.BaseObserver{}, core}
	obj.LoopStatus = &dbusPropertyPlayerLoopStatus{&property.BaseObserver{}, core}
	obj.Rate = &dbusPropertyPlayerRate{&property.BaseObserver{}, core}
	obj.Shuffle = &dbusPropertyPlayerShuffle{&property.BaseObserver{}, core}
	obj.Metadata = &dbusPropertyPlayerMetadata{&property.BaseObserver{}, core}
	obj.Volume = &dbusPropertyPlayerVolume{&property.BaseObserver{}, core}
	obj.Position = &dbusPropertyPlayerPosition{&property.BaseObserver{}, core}
	obj.MinimumRate = &dbusPropertyPlayerMinimumRate{&property.BaseObserver{}, core}
	obj.MaximumRate = &dbusPropertyPlayerMaximumRate{&property.BaseObserver{}, core}
	obj.CanGoNext = &dbusPropertyPlayerCanGoNext{&property.BaseObserver{}, core}
	obj.CanGoPrevious = &dbusPropertyPlayerCanGoPrevious{&property.BaseObserver{}, core}
	obj.CanPlay = &dbusPropertyPlayerCanPlay{&property.BaseObserver{}, core}
	obj.CanPause = &dbusPropertyPlayerCanPause{&property.BaseObserver{}, core}
	obj.CanSeek = &dbusPropertyPlayerCanSeek{&property.BaseObserver{}, core}
	obj.CanControl = &dbusPropertyPlayerCanControl{&property.BaseObserver{}, core}

	dbusAddMatch("type='signal',path='" + string(path) + "',interface='org.freedesktop.DBus.Properties',sender='" + destName + "',member='PropertiesChanged'")
	dbusAddMatch("type='signal',path='" + string(path) + "',interface='org.mpris.MediaPlayer2.Player',sender='" + destName + "',member='PropertiesChanged'")
	sigChan := obj._createSignalChan()
	go func() {
		typeString := reflect.TypeOf("")
		typeKeyValues := reflect.TypeOf(map[string]dbus.Variant{})
		typeArrayValues := reflect.TypeOf([]string{})
		for v := range sigChan {
			if v.Name == "org.freedesktop.DBus.Properties.PropertiesChanged" &&
				len(v.Body) == 3 &&
				reflect.TypeOf(v.Body[0]) == typeString &&
				reflect.TypeOf(v.Body[1]) == typeKeyValues &&
				reflect.TypeOf(v.Body[2]) == typeArrayValues &&
				v.Body[0].(string) == "org.mpris.MediaPlayer2.Player" {
				props := v.Body[1].(map[string]dbus.Variant)
				for key, _ := range props {
					if false {
					} else if key == "PlaybackStatus" {
						obj.PlaybackStatus.Notify()

					} else if key == "LoopStatus" {
						obj.LoopStatus.Notify()

					} else if key == "Rate" {
						obj.Rate.Notify()

					} else if key == "Shuffle" {
						obj.Shuffle.Notify()

					} else if key == "Metadata" {
						obj.Metadata.Notify()

					} else if key == "Volume" {
						obj.Volume.Notify()

					} else if key == "Position" {
						obj.Position.Notify()

					} else if key == "MinimumRate" {
						obj.MinimumRate.Notify()

					} else if key == "MaximumRate" {
						obj.MaximumRate.Notify()

					} else if key == "CanGoNext" {
						obj.CanGoNext.Notify()

					} else if key == "CanGoPrevious" {
						obj.CanGoPrevious.Notify()

					} else if key == "CanPlay" {
						obj.CanPlay.Notify()

					} else if key == "CanPause" {
						obj.CanPause.Notify()

					} else if key == "CanSeek" {
						obj.CanSeek.Notify()

					} else if key == "CanControl" {
						obj.CanControl.Notify()
					}
				}
			} else if v.Name == "org.mpris.MediaPlayer2.Player.PropertiesChanged" && len(v.Body) == 1 && reflect.TypeOf(v.Body[0]) == typeKeyValues {
				for key, _ := range v.Body[0].(map[string]dbus.Variant) {
					if false {
					} else if key == "PlaybackStatus" {
						obj.PlaybackStatus.Notify()

					} else if key == "LoopStatus" {
						obj.LoopStatus.Notify()

					} else if key == "Rate" {
						obj.Rate.Notify()

					} else if key == "Shuffle" {
						obj.Shuffle.Notify()

					} else if key == "Metadata" {
						obj.Metadata.Notify()

					} else if key == "Volume" {
						obj.Volume.Notify()

					} else if key == "Position" {
						obj.Position.Notify()

					} else if key == "MinimumRate" {
						obj.MinimumRate.Notify()

					} else if key == "MaximumRate" {
						obj.MaximumRate.Notify()

					} else if key == "CanGoNext" {
						obj.CanGoNext.Notify()

					} else if key == "CanGoPrevious" {
						obj.CanGoPrevious.Notify()

					} else if key == "CanPlay" {
						obj.CanPlay.Notify()

					} else if key == "CanPause" {
						obj.CanPause.Notify()

					} else if key == "CanSeek" {
						obj.CanSeek.Notify()

					} else if key == "CanControl" {
						obj.CanControl.Notify()
					}
				}
			}
		}
	}()

	dbusAddMatch("type='signal',path='" + string(obj.Path) + "',interface='org.mpris.MediaPlayer2.Player',sender='" + obj.DestName + "',member='Seeked'")

	runtime.SetFinalizer(obj, func(_obj *Player) { DestroyPlayer(_obj) })
	return obj, nil
}
