func (lp *ListPlayer) MediaState() (MediaState, error) {
	if err := lp.assertInit(); err != nil {
		return 0, err
	}
	state := int(C.libvlc_media_list_player_get_state(lp.player))
	return MediaState(state), getError()
}
MediaState returns the state of the current media.
package vlc
import "C"
type PlaybackMode uint
const (
	Default PlaybackMode = iota
	Loop
	Repeat
)
type ListPlayer struct {
	player *C.libvlc_media_list_player_t
	list   *MediaList
}
func NewListPlayer() (*ListPlayer, error) {
	if err := inst.assertInit(); err != nil {
		return nil, err
	}
	player := C.libvlc_media_list_player_new(inst.handle)
	if player == nil {
		return nil, errOrDefault(getError(), ErrListPlayerCreate)
	}
	return &ListPlayer{player: player}, nil
}
func (lp *ListPlayer) Release() error {
	if err := lp.assertInit(); err != nil {
		return nil
	}
	C.libvlc_media_list_player_release(lp.player)
	lp.player = nil
	return getError()
}
func (lp *ListPlayer) Player() (*Player, error) {
	if err := lp.assertInit(); err != nil {
		return nil, err
	}
	player := C.libvlc_media_list_player_get_media_player(lp.player)
	if player == nil {
		return nil, getError()
	}
	C.libvlc_media_player_release(player)
	return &Player{player: player}, nil
}
func (lp *ListPlayer) SetPlayer(player *Player) error {
	if err := lp.assertInit(); err != nil {
		return err
	}
	if err := player.assertInit(); err != nil {
		return err
	}
	C.libvlc_media_list_player_set_media_player(lp.player, player.player)
	return getError()
}
func (lp *ListPlayer) Play() error {
	if err := lp.assertInit(); err != nil {
		return err
	}
	if lp.IsPlaying() {
		return nil
	}
	C.libvlc_media_list_player_play(lp.player)
	return getError()
}
func (lp *ListPlayer) PlayNext() error {
	if err := lp.assertInit(); err != nil {
		return err
	}
	if C.libvlc_media_list_player_next(lp.player) < 0 {
		return getError()
	}
	return nil
}
func (lp *ListPlayer) PlayPrevious() error {
	if err := lp.assertInit(); err != nil {
		return err
	}
	if C.libvlc_media_list_player_previous(lp.player) < 0 {
		return getError()
	}
	return nil
}
func (lp *ListPlayer) PlayAtIndex(index uint) error {
	if err := lp.assertInit(); err != nil {
		return err
	}
	idx := C.int(index)
	if C.libvlc_media_list_player_play_item_at_index(lp.player, idx) < 0 {
		return getError()
	}
	return nil
}
func (lp *ListPlayer) PlayItem(m *Media) error {
	if err := lp.assertInit(); err != nil {
		return err
	}
	if err := m.assertInit(); err != nil {
		return err
	}
	if C.libvlc_media_list_player_play_item(lp.player, m.media) < 0 {
		return errOrDefault(getError(), ErrMediaNotFound)
	}
	return nil
}
func (lp *ListPlayer) IsPlaying() bool {
	if err := lp.assertInit(); err != nil {
		return false
	}
	return C.libvlc_media_list_player_is_playing(lp.player) != 0
}
func (lp *ListPlayer) Stop() error {
	if err := lp.assertInit(); err != nil {
		return err
	}
	C.libvlc_media_list_player_stop(lp.player)
	return getError()
}
func (lp *ListPlayer) SetPause(pause bool) error {
	if err := lp.assertInit(); err != nil {
		return err
	}
	C.libvlc_media_list_player_set_pause(lp.player, C.int(boolToInt(pause)))
	return getError()
}
func (lp *ListPlayer) TogglePause() error {
	if err := lp.assertInit(); err != nil {
		return err
	}
	C.libvlc_media_list_player_pause(lp.player)
	return getError()
}
func (lp *ListPlayer) SetPlaybackMode(mode PlaybackMode) error {
	if err := lp.assertInit(); err != nil {
		return err
	}
	m := C.libvlc_playback_mode_t(mode)
	C.libvlc_media_list_player_set_playback_mode(lp.player, m)
	return getError()
}